kimi-code/packages/kap-server/test
Haozhe bf8e967d5c
Some checks are pending
CI / build (push) Waiting to run
CI / test (1) (push) Waiting to run
CI / test (2) (push) Waiting to run
CI / test (3) (push) Waiting to run
CI / test (4) (push) Waiting to run
CI / test (5) (push) Waiting to run
CI / test-pi-tui (push) Waiting to run
CI / test-windows (push) Waiting to run
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
Nix Build / Check flake.nix workspace sync (push) Waiting to run
Nix Build / nix build .#kimi-code (push) Blocked by required conditions
Release / Release (push) Waiting to run
Release / Deploy docs (push) Blocked by required conditions
Release / Native release artifact (push) Blocked by required conditions
Release / Publish native release assets (push) Blocked by required conditions
refactor(agent-core-v2): register tools as scoped services (#2196)
* refactor(agent-core-v2): register agent tools as DI services with profile-aware activation

- replace module-level registerTool + Eager AgentBuiltinToolsRegistrar with registerAgentTool double registration (Agent-scope DI service + contribution table)
- add toolActivation domain: AgentToolActivationService filters contributions by the bound Profile's tool policy using declared names, resolves instances lazily via accessor.get, and re-activates on agent.status.updated
- rename BuiltinTool to AgentTool service interface; tools become Agent-scope services with decorator-injected dependencies (e.g. AgentTool -> SubagentTool/ISubagentTool)
- AgentLifecycleService.create runs one activation pass after restore and profile binding so tools reflect the Profile before the first turn
- update tool registrations, scripts, and tests; add toolActivationService tests

* refactor(agent-core-v2): centralize builtin tools under agent/tools

- move builtin tools from scattered domain folders (plan/tools,
  goal/tools, os/backends/node-local/tools, task/tools, etc.) into a
  unified agent/tools/ directory
- split each tool into a kebab-case definition file (bash.ts) and a
  registration file (bashTool.ts) pairing with its prompt markdown
- update imports across src, tests, kap-server, and TUI comments

* fix(agent-core-v2): keep agent tools out of scope-creation instantiation

Main's instantiateAll constructs every registered service at scope
creation, but agent tool constructors may legitimately throw when their
host capability is absent (e.g. WebSearchTool without a configured
provider), and profile-aware activation must stay the only resolution
path so the runtime registry holds real instances, never proxies.

- add SyncDescriptor.instantiateWithScope (default true) and let
  registerScopedService opt registrations out of the instantiateAll
  sweep
- registerAgentTool passes the opt-out, restoring lazy
  activation-driven construction on top of the eager-scope semantics
- regenerate docs/state-manifest.d.ts

* refactor(agent-core-v2): replace delayed DI with scope activation

- add explicit OnScopeCreated and OnDemand activation modes
- remove delayed proxy and idle initialization support
- migrate service registrations, tests, and DI guidance
2026-07-26 14:32:59 +08:00
..
__snapshots__ feat(kap-server): add provider write endpoints and models.dev/registry import (#2110) 2026-07-24 14:00:16 +08:00
helpers feat(v2): land agent-core-v2 engine and kap-server behind experimental flag (#1441) 2026-07-12 21:44:04 +08:00
services feat(agent-core-v2): add per-scope keyed state container (#2192) 2026-07-26 10:10:15 +08:00
apiSurface.snapshot.test.ts feat(transcript): add unified transcript layer, drop the /api/v2 RPC surface (#1888) 2026-07-20 15:33:05 +08:00
approvals.test.ts feat(v2): land agent-core-v2 engine and kap-server behind experimental flag (#1441) 2026-07-12 21:44:04 +08:00
auth.test.ts feat(config): add env overrides for loop control and background task limits (#1993) 2026-07-21 19:49:00 +08:00
authMiddleware.test.ts feat(v2): land agent-core-v2 engine and kap-server behind experimental flag (#1441) 2026-07-12 21:44:04 +08:00
authTokenStore.test.ts feat(v2): land agent-core-v2 engine and kap-server behind experimental flag (#1441) 2026-07-12 21:44:04 +08:00
authWiring.e2e.test.ts feat(v2): land agent-core-v2 engine and kap-server behind experimental flag (#1441) 2026-07-12 21:44:04 +08:00
bindClassify.test.ts feat(v2): land agent-core-v2 engine and kap-server behind experimental flag (#1441) 2026-07-12 21:44:04 +08:00
boot.test.ts feat(cli): replace the kimi server command tree with kimi web and share one home across servers (#1826) 2026-07-19 11:43:46 +08:00
config.test.ts refactor(kap-server): drop the @moonshot-ai/protocol dependency (#1755) 2026-07-15 22:40:05 +08:00
connections.test.ts feat(transcript): add unified transcript layer, drop the /api/v2 RPC surface (#1888) 2026-07-20 15:33:05 +08:00
debugNonloopback.e2e.test.ts feat(kimi-inspect): add kap-server web inspector with dev-only /api/v1/debug RPC surface (#1806) 2026-07-17 15:56:53 +08:00
disableAuth.e2e.test.ts feat(transcript): add unified transcript layer, drop the /api/v2 RPC surface (#1888) 2026-07-20 15:33:05 +08:00
files.test.ts feat(v2): land agent-core-v2 engine and kap-server behind experimental flag (#1441) 2026-07-12 21:44:04 +08:00
fs-watch.e2e.test.ts feat(cli): replace the kimi server command tree with kimi web and share one home across servers (#1826) 2026-07-19 11:43:46 +08:00
fs.test.ts refactor(agent-core-v2): rebuild the model wire layer on the kosong architecture (#1970) 2026-07-21 13:03:54 +08:00
guiStore.test.ts feat(v2): land agent-core-v2 engine and kap-server behind experimental flag (#1441) 2026-07-12 21:44:04 +08:00
hostExposure.e2e.test.ts fix(server): allow inline styles in CSP so web math renders on non-loopback binds (#1847) 2026-07-17 20:21:10 +08:00
hostnames.test.ts feat(cli): replace the kimi server command tree with kimi web and share one home across servers (#1826) 2026-07-19 11:43:46 +08:00
inFlightTurnTracker.test.ts refactor(kap-server): drop the @moonshot-ai/protocol dependency (#1755) 2026-07-15 22:40:05 +08:00
instanceRegistry.test.ts feat(cli): replace the kimi server command tree with kimi web and share one home across servers (#1826) 2026-07-19 11:43:46 +08:00
messages.test.ts refactor(agent-core-v2): rebuild the model wire layer on the kosong architecture (#1970) 2026-07-21 13:03:54 +08:00
modelCatalog.test.ts feat(kap-server): add provider write endpoints and models.dev/registry import (#2110) 2026-07-24 14:00:16 +08:00
modelCatalogCatalog.test.ts feat(kap-server): add provider write endpoints and models.dev/registry import (#2110) 2026-07-24 14:00:16 +08:00
modelCatalogProviderWrite.test.ts feat(kap-server): add provider write endpoints and models.dev/registry import (#2110) 2026-07-24 14:00:16 +08:00
modelCatalogRefreshScheduler.test.ts refactor(agent-core-v2): rebuild the model wire layer on the kosong architecture (#1970) 2026-07-21 13:03:54 +08:00
oauthUsage.test.ts feat(kap-server): add GET /api/v1/oauth/usage for managed account plan usage (#2027) 2026-07-22 00:51:28 +08:00
openapi.test.ts feat(web): add session diagnostic export (#1646) 2026-07-14 12:48:28 +08:00
origin.test.ts feat(server): allow X-Kimi-Client-* headers and reflect request headers in CORS (#1661) 2026-07-14 11:51:43 +08:00
prompts.test.ts feat: send prompt-attached videos directly with the prompt (#1999) 2026-07-22 13:46:00 +08:00
publicApi.test.ts feat(v2): land agent-core-v2 engine and kap-server behind experimental flag (#1441) 2026-07-12 21:44:04 +08:00
questions.test.ts feat(v2): land agent-core-v2 engine and kap-server behind experimental flag (#1441) 2026-07-12 21:44:04 +08:00
rateLimit.test.ts fix(kap-server): close auth bypass via percent-encoded API paths (#1753) 2026-07-15 23:05:19 +08:00
requestLogging.test.ts feat(v2): land agent-core-v2 engine and kap-server behind experimental flag (#1441) 2026-07-12 21:44:04 +08:00
rpc.test.ts feat: agent-core-v2 permission/workspace refactors and transcript durability (#2021) 2026-07-22 19:21:56 +08:00
securityExposure.test.ts fix(server): allow inline styles in CSP so web math renders on non-loopback binds (#1847) 2026-07-17 20:21:10 +08:00
securityHeaders.test.ts fix(server): allow inline styles in CSP so web math renders on non-loopback binds (#1847) 2026-07-17 20:21:10 +08:00
sessionEventBroadcaster.test.ts feat(agent-core-v2): add per-scope keyed state container (#2192) 2026-07-26 10:10:15 +08:00
sessionEventJournal.test.ts refactor(agent-core-v2): derive session busy from agent activity (#1751) 2026-07-15 23:33:58 +08:00
sessions.test.ts feat(transcript): add unified transcript layer, drop the /api/v2 RPC surface (#1888) 2026-07-20 15:33:05 +08:00
skills.test.ts refactor(kap-server): drop the @moonshot-ai/protocol dependency (#1755) 2026-07-15 22:40:05 +08:00
snapshot.test.ts feat: agent-core-v2 permission/workspace refactors and transcript durability (#2021) 2026-07-22 19:21:56 +08:00
snapshotReader.unit.test.ts feat: agent-core-v2 permission/workspace refactors and transcript durability (#2021) 2026-07-22 19:21:56 +08:00
subagentRosterTracker.test.ts refactor(kap-server): drop the @moonshot-ai/protocol dependency (#1755) 2026-07-15 22:40:05 +08:00
tasks.test.ts refactor(agent-core-v2): rebuild the model wire layer on the kosong architecture (#1970) 2026-07-21 13:03:54 +08:00
terminals.test.ts refactor(agent-core-v2): register tools as scoped services (#2196) 2026-07-26 14:32:59 +08:00
tools.test.ts feat(kap-server): expose per-tool active state in GET /api/v1/tools (#2005) 2026-07-21 19:23:15 +08:00
transcript.test.ts feat(kap-server): global session work status, transcript subscribe_v2, and plan endpoint (#2094) 2026-07-23 18:48:25 +08:00
transport-errors.test.ts feat(transcript): add unified transcript layer, drop the /api/v2 RPC surface (#1888) 2026-07-20 15:33:05 +08:00
workspaceFs.test.ts feat(kap-server): add GET /api/v1/fs:content endpoint for host files (#2012) 2026-07-21 18:53:27 +08:00
workspaces.test.ts fix(workspace): dedupe workspaces across Windows path spelling variants (#1809) 2026-07-17 14:56:06 +08:00
wsBearerProtocol.test.ts feat(v2): land agent-core-v2 engine and kap-server behind experimental flag (#1441) 2026-07-12 21:44:04 +08:00
wsConnectionV1.test.ts feat(kap-server): global session work status, transcript subscribe_v2, and plan endpoint (#2094) 2026-07-23 18:48:25 +08:00
wsHostOrigin.test.ts feat(transcript): add unified transcript layer, drop the /api/v2 RPC surface (#1888) 2026-07-20 15:33:05 +08:00
wsUpgradeAuth.test.ts feat(transcript): add unified transcript layer, drop the /api/v2 RPC surface (#1888) 2026-07-20 15:33:05 +08:00
wsV1Resync.test.ts refactor(agent-core-v2): split agent lifecycle into existence, subagent, and session MCP domains (#1624) 2026-07-14 14:13:41 +08:00