feat(core): bootstrap packages/server and document extraction plan (#22492)

This commit is contained in:
Shoubhit Dash
2026-04-15 04:01:45 +05:30
committed by GitHub
parent f6409759e5
commit 6706358a6e
10 changed files with 753 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/server",
"version": "1.4.3",
"type": "module",
"license": "MIT",
"exports": {
".": "./src/index.ts",
"./openapi": "./src/openapi.ts",
"./definition": "./src/definition/index.ts",
"./definition/api": "./src/definition/api.ts",
"./api": "./src/api/index.ts"
},
"files": [
"dist"
],
"scripts": {
"typecheck": "tsc --noEmit",
"build": "tsc"
},
"devDependencies": {
"typescript": "catalog:"
}
}

View File

@@ -0,0 +1 @@
export {}

View File

@@ -0,0 +1,6 @@
import type { ServerApi } from "../types.js"
export const api: ServerApi = {
name: "opencode",
groups: [],
}

View File

@@ -0,0 +1 @@
export { api } from "./api.js"

View File

@@ -0,0 +1,3 @@
export { openapi } from "./openapi.js"
export { api } from "./definition/api.js"
export type { OpenApiSpec, ServerApi } from "./types.js"

View File

@@ -0,0 +1,14 @@
import { api } from "./definition/api.js"
import type { OpenApiSpec } from "./types.js"
export function openapi(): OpenApiSpec {
return {
openapi: "3.1.1",
info: {
title: api.name,
version: "0.0.0",
description: "Contract-first server package scaffold.",
},
paths: {},
}
}

View File

@@ -0,0 +1,14 @@
export interface ServerApi {
readonly name: string
readonly groups: readonly string[]
}
export interface OpenApiSpec {
readonly openapi: string
readonly info: {
readonly title: string
readonly version: string
readonly description: string
}
readonly paths: Record<string, never>
}

View File

@@ -0,0 +1,15 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"compilerOptions": {
"target": "ES2022",
"rootDir": "src",
"outDir": "dist",
"module": "nodenext",
"declaration": true,
"moduleResolution": "nodenext",
"lib": ["es2022", "dom", "dom.iterable"],
"strict": true,
"skipLibCheck": true
},
"include": ["src"]
}