feat(core): bootstrap packages/server and document extraction plan (#22492)
This commit is contained in:
24
packages/server/package.json
Normal file
24
packages/server/package.json
Normal 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:"
|
||||
}
|
||||
}
|
||||
1
packages/server/src/api/index.ts
Normal file
1
packages/server/src/api/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export {}
|
||||
6
packages/server/src/definition/api.ts
Normal file
6
packages/server/src/definition/api.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { ServerApi } from "../types.js"
|
||||
|
||||
export const api: ServerApi = {
|
||||
name: "opencode",
|
||||
groups: [],
|
||||
}
|
||||
1
packages/server/src/definition/index.ts
Normal file
1
packages/server/src/definition/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { api } from "./api.js"
|
||||
3
packages/server/src/index.ts
Normal file
3
packages/server/src/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export { openapi } from "./openapi.js"
|
||||
export { api } from "./definition/api.js"
|
||||
export type { OpenApiSpec, ServerApi } from "./types.js"
|
||||
14
packages/server/src/openapi.ts
Normal file
14
packages/server/src/openapi.ts
Normal 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: {},
|
||||
}
|
||||
}
|
||||
14
packages/server/src/types.ts
Normal file
14
packages/server/src/types.ts
Normal 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>
|
||||
}
|
||||
15
packages/server/tsconfig.json
Normal file
15
packages/server/tsconfig.json
Normal 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"]
|
||||
}
|
||||
Reference in New Issue
Block a user