mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-07-09 17:29:12 +00:00
Add `packages/server-v2`, a minimal Fastify server bootstrapped through the
`agent-core-v2` DI engine (`bootstrap()` -> Core `Scope`), speaking the same
`/api/v1` interface as the v1 server. Route handlers resolve Core services
via `core.accessor.get(IXxx)`.
- Serve healthz, meta, auth, oauth (login poll/start/cancel/logout) and
shutdown with the standard `{code, msg, data, request_id}` envelope.
- Re-point root `pnpm dev:server` to server-v2 and add a `src/main.ts`
foreground entry.
- Add `build/hash-imports-loader.mjs` so tsx resolves `agent-core-v2`'s `#/`
array-fallback subpath imports.
- `agent-core-v2` Phase 0 fixes so it compiles and boots: add the `event`
domain (`IEventService`), fix `gateway` `event.subscribe` -> `event.on`, fix
the `wireRecord` fallback `BlobStoreService` construction, export the
`provider` barrel, and fix a `tooldedup` test import casing.
32 lines
897 B
JSON
32 lines
897 B
JSON
{
|
||
"name": "@moonshot-ai/server-v2",
|
||
"version": "0.0.0",
|
||
"private": true,
|
||
"description": "Kimi Code server backed by the DI × Scope agent engine (agent-core-v2)",
|
||
"type": "module",
|
||
"exports": {
|
||
".": {
|
||
"types": "./src/index.ts",
|
||
"default": "./src/index.ts"
|
||
}
|
||
},
|
||
"scripts": {
|
||
"build": "tsdown",
|
||
"dev": "tsx --tsconfig ./tsconfig.dev.json --import ../../build/register-raw-text-loader.mjs --import ../../build/register-hash-imports-loader.mjs ./src/main.ts",
|
||
"typecheck": "tsc -p tsconfig.json --noEmit",
|
||
"test": "vitest run",
|
||
"clean": "rm -rf dist"
|
||
},
|
||
"dependencies": {
|
||
"@moonshot-ai/agent-core-v2": "workspace:^",
|
||
"@moonshot-ai/protocol": "workspace:^",
|
||
"fastify": "^5.1.0",
|
||
"pino": "^9.5.0",
|
||
"pino-pretty": "^13.0.0",
|
||
"ulid": "^3.0.1",
|
||
"zod": "catalog:"
|
||
},
|
||
"devDependencies": {
|
||
"tsx": "^4.21.0"
|
||
}
|
||
}
|