kimi-code/packages/node-sdk
7Sageer 47cd55b731 feat: multi-instance session lease, write fencing, and fs/watch reliability
Single-instance reliability:
- Journal: preserve content on write failure with sticky JournalStorageError,
  per-batch fsync, last-header open, and zero-write cold reads
- Broadcaster: writeFailure gate, deterministic dispose drain, replay failure
  now triggers resync_required; graceful close ordering in start.ts
- fswatch: per-connection monotonic seq, pinned truncated semantics, and
  gitignore double-cache invalidation; __global__ session made volatile

Cross-process lock unification:
- agent-core-v2 CrossProcessLockService: parameterized lock modes
  (heartbeat-TTL implemented), token-guarded release/update, rename-isolated
  stale takeover, creation window, PID-reuse detection (conservative on macOS)
- config.toml and workspace registry locked read-modify-write; mcp.json watch
- kap-server lock protocol aligned (lock_id, process_started_at, three-layer
  stale detection); minidb release ownership fixed, legacy cleanup removed

Multi-instance session ownership (gated by multi_server flag):
- Session leases with write fencing; 40921 SESSION_HELD_BY_PEER with typed
  details (routable/creating/holder-unresponsive/held-by-local-instance) and
  unregistered-writer detection; write-authority registry hard gate in
  AppendLogStore, session metadata, and flush paths
- kimi-web redirect to the holder with pending approvals/questions replay;
  klient transparent redirect with loop guard
- session.list_changed cross-instance discovery via two-layer fs watch;
  ownership field on GET /sessions

Stale-write fencing and skill hot reload:
- Session file ledger + agent file fencing: hard gate with the flag on,
  advisory note with it off; dirty-tick signals from fs watch
- Skill root watcher hot reload: catalog reload, turn-boundary listing
  reminder, and skill_catalog.changed volatile event to web clients
2026-07-22 20:08:21 +08:00
..
examples refactor!: overhaul thinking config and effort resolution (#1132) 2026-06-30 22:34:13 +08:00
scripts fix: avoid Windows command shim launches (#591) 2026-06-09 20:20:44 +08:00
src fix: five correctness follow-ups to the catalog metadata work (#2030) 2026-07-22 03:13:10 +08:00
test feat: multi-instance session lease, write fencing, and fs/watch reliability 2026-07-22 20:08:21 +08:00
api-extractor.json Kimi For Coding 2026-05-22 15:54:50 +08:00
CHANGELOG.md ci: release packages (#1989) 2026-07-22 17:24:39 +08:00
package.json ci: release packages (#1989) 2026-07-22 17:24:39 +08:00
README.md Kimi For Coding 2026-05-22 15:54:50 +08:00
tsconfig.api-extractor.json Kimi For Coding 2026-05-22 15:54:50 +08:00
tsconfig.dts.json Kimi For Coding 2026-05-22 15:54:50 +08:00
tsconfig.json feat(web): introduce Kimi web app and daemon gateway (#625) 2026-06-17 20:53:46 +08:00
tsdown.config.ts Kimi For Coding 2026-05-22 15:54:50 +08:00
vitest.config.ts chore: use raw query imports for prompt sources (#682) 2026-06-12 11:47:44 +08:00

@moonshot-ai/kimi-code-sdk

The TypeScript SDK for Kimi Code

Part of the Kimi Code monorepo.

See the main repository for documentation, issues, and contribution guidelines.

License

MIT