kimi-code/packages/kap-server/package.json
haozhe.yang 7caed454c9 feat(kap-server): key WS internals by SessionRef and adapt /api/v1/ws
Implement the M6 milestone: all live maps, journals, subscriptions,
activity and cache keys inside kap-server are now keyed by the full
SessionRef, while the /api/v1/ws wire stays byte-identical.

- Resolve bare session ids once at attach time through the v1 resolver,
  pin the ref on the subscription, and address every broadcaster,
  transcript, fs-watch, and replay operation by ref; ambiguous or
  unavailable ids get a compatible ack error and no subscription.
- Re-key the transcript stores, op journals, event journals (now
  per-runtime directories), snapshot caches, and the lifecycle tracked
  map by sessionRefKey; bare-id lookups answer only on a unique match.
- Route internal session events by an internal runtimeId payload field
  (never projected onto the wire) with resolver fallback; keep the
  active-state queue append synchronous to preserve frame ordering.
- Add multi-runtime isolation tests (same sessionId on two runtimes
  never crosses transcript/prompt/journal streams) and a repeatable
  black-box comparison harness that diffs a base-commit server against
  this build over REST, WS, and export scenarios.
- Widen node-sdk PlanInfo.path to string|null to match the engine type
  and fix the stale resolver-fallback comment in the broadcaster.
2026-07-29 10:48:45 +08:00

44 lines
1.2 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"name": "@moonshot-ai/kap-server",
"version": "0.1.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"
},
"./contract": {
"types": "./src/contract.ts",
"default": "./src/contract.ts"
}
},
"scripts": {
"build": "tsdown",
"typecheck": "tsc -p tsconfig.json --noEmit",
"test": "vitest run",
"blackbox:compare": "tsx --import ../../build/register-raw-text-loader.mjs test/blackbox/compare.mts",
"clean": "rm -rf dist"
},
"dependencies": {
"@fastify/multipart": "^10.0.0",
"@fastify/swagger": "^9.7.0",
"@moonshot-ai/agent-core-v2": "workspace:^",
"@moonshot-ai/kimi-code-oauth": "workspace:^",
"@moonshot-ai/minidb": "workspace:*",
"@moonshot-ai/transcript": "workspace:^",
"bcryptjs": "^2.4.3",
"fastify": "^5.1.0",
"pino": "^9.5.0",
"smol-toml": "^1.6.1",
"ulid": "^3.0.1",
"ws": "^8.18.0",
"zod": "catalog:"
},
"devDependencies": {
"@types/bcryptjs": "^2.4.6",
"@types/ws": "^8.18.0",
"tsx": "^4.21.0"
}
}