From 5ca918a0d340cbaa20e7adba655dac6eca479d0b Mon Sep 17 00:00:00 2001 From: seekskyworld Date: Fri, 4 Sep 2026 11:15:52 +0800 Subject: [PATCH] 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(