From 5ca918a0d340cbaa20e7adba655dac6eca479d0b Mon Sep 17 00:00:00 2001 From: seekskyworld Date: Fri, 4 Sep 2026 11:15:52 +0800 Subject: [PATCH 1/2] feat(web): expose bounded capability snapshot endpoint Signed-off-by: seekskyworld --- web/host/web-host.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/host/web-host.ts b/web/host/web-host.ts index 6203e647..1f95280e 100644 --- a/web/host/web-host.ts +++ b/web/host/web-host.ts @@ -9,7 +9,10 @@ import { } from "node:http"; import { URL } from "node:url"; import { promisify } from "node:util"; -import { subscribeWebCapabilities } from "../../extensions/shared/web-observer-registry.ts"; +import { + subscribeWebCapabilities, + webCapabilitySnapshot, +} from "../../extensions/shared/web-observer-registry.ts"; import { PiWebAdapter } from "../adapter/pi-adapter.ts"; import { jsonByteLength, @@ -557,6 +560,11 @@ export class WebHost { } if (url.pathname === "/api/models") return this.json(response, 200, { models: this.runtime.listModels() }); + if (url.pathname === "/api/capabilities") + return this.json(response, 200, { + sessionId: this.runtime.sessionManager.getSessionId(), + capabilities: webCapabilitySnapshot(this.runtime.sessionManager), + }); if (url.pathname === "/api/snapshot") { const cursor = this.sequence; const projection = await this.adapter.getSnapshot( From 13a0270bc1ac7f662943cb52c0313b973bc541a9 Mon Sep 17 00:00:00 2001 From: seekskyworld Date: Fri, 4 Sep 2026 11:17:25 +0800 Subject: [PATCH 2/2] feat(web): expose bounded runtime diagnostics Signed-off-by: seekskyworld --- web/host/web-host.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web/host/web-host.ts b/web/host/web-host.ts index 1f95280e..779d502a 100644 --- a/web/host/web-host.ts +++ b/web/host/web-host.ts @@ -565,6 +565,14 @@ export class WebHost { sessionId: this.runtime.sessionManager.getSessionId(), capabilities: webCapabilitySnapshot(this.runtime.sessionManager), }); + if (url.pathname === "/api/diagnostics") + return this.json(response, 200, { + node: process.version, + cwd: this.runtime.cwd, + sessionId: this.runtime.sessionManager.getSessionId(), + workspaceSelected: this.runtime.workspaceSelected, + models: this.runtime.listModels().filter((model) => model.current), + }); if (url.pathname === "/api/snapshot") { const cursor = this.sequence; const projection = await this.adapter.getSnapshot(