kimi-code/apps/kimi-inspect
Haozhe 4623395379
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-vscode-legacy (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
Publish VS Code extension / Publish VSIX to marketplaces (push) Waiting to run
refactor(agent-core-v2): fold the prompt queue into the agent loop service (#3747)
* refactor(agent-core-v2): fold the prompt queue into the agent loop service

Delete AgentPromptService/IAgentPromptService: prompt submit/queue/steer/
abort now ride the agent machine queue through IAgentLoopService's extended
surface (submitPrompt/submitSteerPrompt/enqueuePrompt/steerPrompts/
abortPrompt/drainPrompts/injectPrompt/retryPrompt/promptQueue plus
hooks.onBeforeSubmitPrompt and the promptAdmission reservation slot).

Durable prompt.* event classes move to agent/prompt/promptEvents.ts and keep
their registrations; promptAdmissionKey keeps its fold. Dead assets go away:
promptResolutionKey, PROMPT_ALREADY_COMPLETED (kap-server 40903 path),
promptLaunchingKey and clear(). Compaction gating (queue while compacting,
resume on finish) moves into the loop reservation drain.

The 'agentPromptService' wire name keeps its shape: a thin AgentPromptChannel
facade (same decorator id) forwards submit/submitSteer to the loop, so
klient memory/ipc/debug transports and the kap-server dispatcher are
unchanged.

* test(agent-core-v2): re-pin prompt queue semantics on the loop service

Rewrite promptService.test.ts (25 cases, count unchanged) against the real
AgentLoopService with the scripted-LLM harness, fold the launch-window
reservation out of promptQueue().pending to match the old snapshot contract
exactly, and update the debug-channels pin to the facade's submit/submitSteer
surface.

* refactor(agent-core-v2): lint-align the loop prompt queue surface

* fix(agent-core-v2): settle prompt completions on the turn-result chain

Match the deleted service's microtask position: prompt.completed/aborted and
the completion deferreds fire from a result.then chain attached at bind time
instead of synchronously inside endTurn, so wire/emit ordering with
post-turn producers (tool unregister, next-prompt launch) stays identical to
the baseline snapshots. Steered children move onto the reservation so the
chain can settle them after the active turn is gone.

* refactor(agent-core-v2): move the prompt-submit gate into the agent machine

* refactor(agent-core-v2): keep image compression captions inline in prompt messages

* refactor(agent-core-v2): drop the durable prompt admission facility

* refactor(kap-server): resolve prompt auth at turn runtime instead of submit time

* refactor(agent-core-v2): teach the agent machine queue metadata, multi-id steer, gate rewrite, and pause

* refactor(agent-core-v2): converge prompt submission on machine queue user entries

* refactor(agent-core-v2): replace loop prompt records with a waiter registry fed by machine events
2026-09-14 15:07:18 +08:00
..
src refactor(agent-core-v2): fold the prompt queue into the agent loop service (#3747) 2026-09-14 15:07:18 +08:00
vite 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
AGENTS.md feat(kap-server): add flat entity message protocol (v3 WS + history API) (#3532) 2026-09-10 19:08:27 +08:00
index.html 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
package.json feat(kap-server): add flat entity message protocol (v3 WS + history API) (#3532) 2026-09-10 19:08:27 +08:00
README.md refactor(agent-core-v2): rewire the model catalog runtime onto the provider-catalog state machine (#3606) 2026-09-09 15:37:44 +08:00
tsconfig.json refactor(agent-core-v2): absorb the human layer and replace the agent loop with a facade over its turn state machine (#3580) 2026-09-06 22:26:35 +08:00
vite.config.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

kimi-inspect

Web inspector for the kap-server /api/v1/debug RPC surface — a read/trigger window into a running Kimi Code engine (workspaces, sessions, agents, and the scoped DI registry).

Run

  1. Start a kap-server with the debug surface mounted (repo dev scripts do this for you): pnpm dev:v1 / pnpm dev:v2 from the repo root pass --debug-endpoints on a loopback bind; the surface inherits the global bearer auth.
  2. pnpm --filter @moonshot-ai/kimi-inspect dev — the Vite dev server proxies /api to the server (KIMI_SERVER_URL, default http://127.0.0.1:58627) and auto-discovers running instances (~/.kimi-code/server/instances); switch servers from the header dropdown.

A connection failure shows a blocking "Debug surface unavailable" screen — there is no fallback data source.

Views (left icon rail)

  • Chat workspace — session list (activity badges from the global-events WS) plus a transcript-driven per-session chat; the right dock hosts the Agent-scope Service panels, a plan lookup card, and the transcript audit panel. The Session scope has its own column (pending interactions + session Service panels, and a State tab).
  • Search — cross-session full-text search over POST /api/v1/search (cursor-paged; exact-match maps to the API's literal mode; a live/index badge shows which server route served the results).
  • Model Catalog — every provider with its models and the default marker, with per-model ping and session creation actions.
  • App / Workspace Services — the full Service reflection over the App scope, and over each Workspace scope (picked via the directory browser; workspace handlers materialize on demand).
  • DI — the engine's Service × Effect × DI debug surface, four panels fed by the App-scope debug Services (IDebugLedgerService / IDebugGraphService / IDebugCascadeService) and refreshed eagerly off the event.di.unit_changed WS frame:
    • Unit tree — scope → unit → ledger entries (label, five-state Pending / Activating / Active / Unloading / Failed, uid, pinned flag, unit error object), with unprovide / update / dispose triggers.
    • Graph — the dependency DAG (instance edges across scopes + collection edges).
    • Cascade — the cascade transaction history ring (changes, contagion set, torn-down / rebuilt / failed, abort wait, duration).
    • Pending — the waiting area: units parked on unsatisfied dependencies with their missing-token sets.

Notes for maintainers

  • The channel layer (src/channel/) is a VS Code-style ProxyChannel: GET /api/v1/debug/channels enumerates every scoped Service — there is no whitelist; new Services appear automatically.
  • There is no Service-event push channel besides the global events listed above; panels fetch/refresh on demand (react-query, 15 s poll) plus the event.di.unit_changed invalidation for the DI view.