- add GET /sessions/{session_id}/skills and POST .../{name}:activate, mirroring the v1 wire contract and protocol schemas
- gate both endpoints on activated (live) sessions via ISessionLifecycleService; when persisted but not live, return 40401 with a "you need to activate it first" hint
- resolve ISkillCatalog for listing and the main agent's IAgentSkillService for activation; map skill.not_found to 40415 and skill.type_unsupported to 40912
- export IAgentSkillService and ISkillCatalog from agent-core-v2
- expose /api/v1/sessions/{sid}/fs:* mirror routes backed by the
Session-scoped IFsService (list, read, list_many, stat, stat_many,
mkdir, search, grep, git_status, diff, open, open-in, reveal) plus the
fs/{path}:download stream
- extend agent-core-v2 IFsService with list/read/stat/mkdir/resolve
methods and add fs.is_directory/is_binary/too_large/already_exists
error codes (protocol KimiErrorCode + FsErrors)
- seed IWorkspaceContext with the session work dir in session-lifecycle
so workspace-relative services resolve paths against the session root
- port fileLaunch lib for open/reveal/open-in
- port SKILL.md parser (frontmatter + body) from agent-core
- add ISkillCatalogStore business-specific Store so the skill domain never
touches node:fs; File backend walks roots recursively, InMemory backend
backs tests
- split the catalog into three scopes: IGlobalSkillCatalog (Core; builtin +
user/brand), ISkillCatalog (Session; project skills merged by workDir),
IAgentSkillService (Agent; activation)
- inject ISkillCatalog into AgentSkillService; make activate/activateFromModel
async and await ISkillCatalog.ready to remove the first-activation race
- bind the File backend in the composition root and trigger loading from
session-lifecycle
- rename SessionSkillRegistry to InMemorySkillCatalog (backs both Core global
and Session catalogs)
- add js-yaml for frontmatter parsing
- IOAuthService/OAuthService now owns refreshOAuthProviderModels: the managed
OAuth provider's credential provisioning and server-side model refresh live
together in the auth domain.
- modelCatalog is back to a read-only catalog projection (listModels,
listProviders, getProvider, setDefaultModel); the OAuth refresh method and
its helpers are removed.
- server-v2 /providers:refresh_oauth route and the oauth example resolve
IOAuthService for the refresh.
- Move the refresh tests into test/auth and add the auth --> config edge to
the DI scope diagram.
- Add `kaos` domain (`IKaos` per session + `IKaosFactory`) wrapping
`@moonshot-ai/kaos`, so business code imports `#/kaos` instead of the
package directly.
- Back `agentFs` and `process` with `IKaos`; drop the per-domain
`IFileSystemBackend` / `IProcessBackend` interfaces and their
local/ssh stubs.
- Migrate `read-media`, `path-access`, `background/process-task`, and
`bootstrap` off direct kaos-package imports.
- Seed `IKaos` per session in `SessionLifecycleService` and expose
`agentFs` / `fs` on the server-v2 action map.
- Create the server-v2 main agent on demand (`ensureMainAgent`)
instead of failing requests when it is missing.
- replace the `/fs:action` parametric dispatcher with two routes that
mirror v1 (`/fs::browse`, `/fs::home`), so the wire path is the
single-colon `/api/v1/fs:browse` and `/api/v1/fs:home` that v1 serves
- update the folder-picker test to hit the single-colon URLs and assert
the double-colon form 404s, guarding against reintroducing the
parametric dispatcher
- reword agentFs barrel doc comment to mention fs/fsService/errors
- add exitCode/dispose to fake IProcess in fs test helpers
- add ignore to pnpm-lock to match package.json
- bootstrap: storageSeed() now returns a per-token SyncDescriptor so
IStorageService / IAppendLogStorage / IAtomicDocumentStorage / IBlobStorage
each resolve to a distinct FileStorageService rooted at homeDir, instead of
sharing one instance. Keeps the roles independently routable.
- server-v2: drop the now-redundant durableStorageSeeds and rely on bootstrap()
for file-backed storage.
- add a regression test asserting the four tokens are distinct instances.
- add `_serviceBrand` to 17 DI service interfaces and 18 implementations that were missing it (red line #3)
- restore bare tool-result slice retention in normalizeToolExchanges (lost in the context-projection rewrite)
- make BackgroundTaskPersistence.listTasks skip corrupt task files
- add optional dirMode to FileStorageService so background task dirs can be 0700
- fix migrated tests: register IBlobStorage, use the 4-arg BackgroundTaskPersistence construction, add the approval stub and kaos/execute-tool fixtures
Port the v1 server's `/sessions/{sid}/tasks*` REST surface onto
agent-core-v2:
- GET /sessions/{sid}/tasks — list with optional `status` filter
- GET /sessions/{sid}/tasks/{tid} — get by id with optional
`with_output` / `output_bytes` preview
- POST /sessions/{sid}/tasks/{tid}:cancel — cancel with the
idempotent 40904 `{cancelled:false}` shape
The routes resolve the main agent's `IBackgroundService` through the
core -> session -> agent scope chain and project `BackgroundTaskInfo`
onto the protocol `BackgroundTask`, matching the v1 wire contract
(schemas, error codes, and messages). The `:cancel` suffix is parsed
via the shared `parseActionSuffix` helper.
Resolved the parallel kosong/tool refactors: kept the modelRuntime+model+chatProvider split and the tool contract domain (L3), adopted upstream's onContextOverflow turn hook and ToolCall unification, and ported prompt_cache_key/kimiRequestHeaders into ModelResolver.
Return turn_id from agent prompt and steer RPC/gateway methods, route
prompt submit/steer/undo/clear/cancel through IAgentRPCService in the
server-v2 action map, and cover prompt submission and missing-agent errors.
Add ReadMediaFile with image/video content handling, shared magic-byte file
type detection, and capability-based registration so the tool only appears
when the active model supports image or video input.
Add a session-scoped IFsService that backs fs search, content grep, git
status, and git diff using AgentFileSystem and IProcessRunner, with gitignore
filtering and protocol-shaped responses.
Add createdAt to parked interactions and keep a bounded recently-resolved
ledger so edge transports can distinguish duplicate resolves from unknown
ids. Cover the server-v2 approval duplicate-resolve path.
Replace the kosong domain with chatProvider, model, and modelRuntime
services, move model alias config and env overlay into model, and update
profile and LLM requester to resolve providers through IModelResolver and
IChatProviderFactory.
Move tool metadata, result, and execution hook contexts into the tool
domain, update callers to import from the new tool contract surface, and
make tool dedupe self-wiring through tool executor hooks.
- GET /tools, GET /mcp/servers, POST /mcp/servers/{id}:restart
- resolve IToolRegistry / IMcpService from the most-recent session's
main agent; empty list / 40408 when no session is live
- project v2 models to the protocol wire shapes, matching
packages/server (source/status mapping, mcp_server_id, null input_schema)
- add GET /sessions/:sid/questions (list pending) and POST
/sessions/:sid/questions/:tail (resolve + :dismiss) on top of
IQuestionService / IInteractionService
- enrich the agent-core-v2 question domain with the rich in-process
model (QuestionItem / QuestionResult) and dismiss() so the v1 wire
can be projected faithfully
- reimplement the protocol <-> in-process adapter at the edge (no v1
agent-core import): synthesized item/option ids, allow_other,
expires_at, and the 5-kind answer flattening
- add GET /sessions/{sid}/messages (paginated, role-filtered) and GET /sessions/{sid}/messages/{message_id}
- thin wrapper over the main agent's IContextMemory, already exposed in the v2 action map
- port v1 id derivation, content mapping, pagination and role-filter semantics
- register the routes under /api/v1 and cover with tests
- add Core-scoped IModelCatalogService in agent-core-v2 covering
listModels, listProviders, getProvider, setDefaultModel, and
refreshOAuthProviderModels
- expose the v1-compatible /api/v1 models and providers catalog routes
in server-v2, mapping provider.not_found / model.not_found to the
numeric protocol error codes
- add IOAuthService.getCachedAccessToken for provider status detection
- register provider.not_found and model.not_found protocol error codes
- add `/sessions/{sid}/approvals` GET (list pending) and POST (resolve)
routes, backed by IApprovalService and IInteractionService; duplicate
resolves return 40902 via the kernel's recently-resolved window
- add `/workspaces` GET / POST / PATCH / DELETE routes, backed by
IWorkspaceRegistry, projecting v2 workspace records onto the v1 wire shape
- register both route groups in registerApiV1Routes
- add an agent-core-v2 interaction example that resolves the Session-scoped
kernel and approval/question facades through the scope tree
- map `workspaces:update` to IWorkspaceRegistry.update in the core actionMap
- cover the rename round-trip in rpc.test.ts
- sync the edge-exposure cheatsheet
- add GET/POST /config backed by agent-core-v2 IConfigService
- reuse protocol configResponseSchema/patchConfigRequestSchema for wire fidelity
- project resolved config generically (camelCase to snake_case); redact provider credentials to has_api_key
- split the flat POST patch into per-domain set calls and publish a config.changed DomainEvent
- wire registerConfigRoutes into /api/v1
- add domain-boundaries.md covering scope vs domain, data-ownership test, and the session/agent/turn split conclusions
- cross-link the topic from SKILL.md, design.md, persistence.md, and service-authoring.md
- warn against I{Scope}EntityService bundles that re-merge domains by lifetime
- regenerate DI x Scope dependency graph from scripts/dep-graph.mjs output:
add storage / bootstrap / session-metadata nodes, drop phantom records /
environment / dynamicInjector / turnRunner nodes, and fix session-index /
background / cron / wireRecord / blobStore / config storage edges
- fix check-domain-layers.mjs layer table (eventBus -> eventSink,
toolDedup -> tooldedup, drop dynamicInjector, add toolExecutor>turn and
permissionMode>contextInjector exceptions) so lint:domain passes again
- remove unused mcpCredentialsDir / defaultMcpCredentialsDir path helpers
from the mcp oauth store (it now persists via IAtomicDocumentStore)
- correct stale persistence comments in fileStorageService and the AGENTS.md
session example
- bootstrap seeds IAppendLogStorage + IAtomicDocumentStorage with
FileStorageService so the Store layer is durable in the CLI
- background task state goes through IAtomicDocumentStore, output.log
through IStorageService byte primitives
- cron task records go through IAtomicDocumentStore; the per-id-json-store
util is deleted
- mcp OAuth credentials move to an async McpOAuthStore over
IAtomicDocumentStore, with the provider caching eagerly so the SDK's
synchronous getters stay non-blocking
- telemetry failed-event spool goes through IStorageService bytes
- session-index enumerates via IStorageService.list and reads state.json
via IAtomicDocumentStore instead of hostFs
- add ITerminalService (create/list/get/attach/write/resize/close) and
ITerminalBackend contract; Session-scoped so per-session sessionId
threading is dropped
- implement TerminalService with per-terminal output buffering, seq replay,
sink fan-out, and dispose-time process cleanup
- register a default NotImplementedTerminalBackend; the real PTY backend is
supplied by the composition root
- add the terminal.not_found error code (protocol + ErrorCodes) and register
the terminal layer in check-domain-layers
- cover the service with unit tests driven by a fake backend
- Add IBlobStorage role token for pluggable blob backends
- Make BlobStoreService depend on IBlobStorage instead of IHostFileSystem
- Remove host filesystem dependency from WireRecordService
- Seed IBlobStorage in local and server-v2 composition roots
- Add BlobStoreService tests
- add non-blocking `enqueue` and `onDidResolve` to the `IInteractionService` kernel
- add typed `enqueue` to `IApprovalService` and `IQuestionService`
- expose `interactions:request`, `approvals:request`, `questions:ask` actions
- stream pending set (`interactions`) and resolutions (`interactions:resolved`) over WS