@xrkseek/harness 0.4.12 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@xrkseek/a2a/README.md +8 -6
- package/node_modules/@xrkseek/a2a/dist/client.d.ts +1 -0
- package/node_modules/@xrkseek/a2a/dist/client.d.ts.map +1 -1
- package/node_modules/@xrkseek/a2a/dist/client.js +36 -20
- package/node_modules/@xrkseek/a2a/dist/client.js.map +1 -1
- package/node_modules/@xrkseek/a2a/dist/inbound.d.ts +9 -2
- package/node_modules/@xrkseek/a2a/dist/inbound.d.ts.map +1 -1
- package/node_modules/@xrkseek/a2a/dist/inbound.js +86 -41
- package/node_modules/@xrkseek/a2a/dist/inbound.js.map +1 -1
- package/node_modules/@xrkseek/a2a/dist/index.d.ts +2 -1
- package/node_modules/@xrkseek/a2a/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/a2a/dist/index.js +2 -1
- package/node_modules/@xrkseek/a2a/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/a2a/dist/protocol.d.ts +9 -0
- package/node_modules/@xrkseek/a2a/dist/protocol.d.ts.map +1 -1
- package/node_modules/@xrkseek/a2a/dist/protocol.js +25 -0
- package/node_modules/@xrkseek/a2a/dist/protocol.js.map +1 -1
- package/node_modules/@xrkseek/a2a/dist/task-store.d.ts +43 -0
- package/node_modules/@xrkseek/a2a/dist/task-store.d.ts.map +1 -0
- package/node_modules/@xrkseek/a2a/dist/task-store.js +105 -0
- package/node_modules/@xrkseek/a2a/dist/task-store.js.map +1 -0
- package/node_modules/@xrkseek/context-fragments/README.md +4 -2
- package/node_modules/@xrkseek/context-fragments/dist/index.d.ts +10 -2
- package/node_modules/@xrkseek/context-fragments/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/context-fragments/dist/index.js +16 -11
- package/node_modules/@xrkseek/context-fragments/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-agent/dist/index.d.ts +5 -0
- package/node_modules/@xrkseek/core-agent/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-agent/dist/index.js +3 -0
- package/node_modules/@xrkseek/core-agent/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts +11 -0
- package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/index.js +9 -0
- package/node_modules/@xrkseek/core-agent-loop/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/background.js +2 -2
- package/node_modules/@xrkseek/exec-computer-use/dist/background.js.map +1 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/format.d.ts +22 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/format.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/format.js +75 -9
- package/node_modules/@xrkseek/exec-computer-use/dist/format.js.map +1 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/index.d.ts +2 -2
- package/node_modules/@xrkseek/exec-computer-use/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/index.js +2 -2
- package/node_modules/@xrkseek/exec-computer-use/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/memory.d.ts +2 -0
- package/node_modules/@xrkseek/exec-computer-use/dist/memory.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/memory.js +18 -2
- package/node_modules/@xrkseek/exec-computer-use/dist/memory.js.map +1 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/tools.d.ts +15 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/tools.js +77 -22
- package/node_modules/@xrkseek/exec-computer-use/dist/tools.js.map +1 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/types.d.ts +5 -0
- package/node_modules/@xrkseek/exec-computer-use/dist/types.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/types.js.map +1 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/windows-uia.d.ts +4 -0
- package/node_modules/@xrkseek/exec-computer-use/dist/windows-uia.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/windows-uia.js +138 -6
- package/node_modules/@xrkseek/exec-computer-use/dist/windows-uia.js.map +1 -1
- package/node_modules/@xrkseek/exec-environment/README.md +2 -2
- package/node_modules/@xrkseek/exec-environment/dist/index.d.ts +1 -0
- package/node_modules/@xrkseek/exec-environment/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-environment/dist/index.js +1 -0
- package/node_modules/@xrkseek/exec-environment/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-environment/dist/memory.d.ts +25 -0
- package/node_modules/@xrkseek/exec-environment/dist/memory.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-environment/dist/memory.js +290 -0
- package/node_modules/@xrkseek/exec-environment/dist/memory.js.map +1 -0
- package/node_modules/@xrkseek/exec-environment/dist/resolve.d.ts +5 -3
- package/node_modules/@xrkseek/exec-environment/dist/resolve.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-environment/dist/resolve.js +13 -5
- package/node_modules/@xrkseek/exec-environment/dist/resolve.js.map +1 -1
- package/node_modules/@xrkseek/exec-environment/dist/types.d.ts +1 -1
- package/node_modules/@xrkseek/exec-environment/dist/types.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-environment/package.json +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/index.d.ts +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/index.js +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/read-image.d.ts +2 -0
- package/node_modules/@xrkseek/exec-fs/dist/read-image.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/read-image.js +69 -31
- package/node_modules/@xrkseek/exec-fs/dist/read-image.js.map +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/routing-prompt.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/routing-prompt.js +10 -1
- package/node_modules/@xrkseek/exec-fs/dist/routing-prompt.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/format.d.ts +14 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/format.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/format.js +28 -6
- package/node_modules/@xrkseek/exec-image-gen/dist/format.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/index.d.ts +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/index.js +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/references.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/references.js +8 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/references.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/schema.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/schema.js +11 -7
- package/node_modules/@xrkseek/exec-image-gen/dist/schema.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/tools.d.ts +2 -2
- package/node_modules/@xrkseek/exec-image-gen/dist/tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/tools.js +38 -14
- package/node_modules/@xrkseek/exec-image-gen/dist/tools.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/package.json +2 -1
- package/node_modules/@xrkseek/exec-sandbox/dist/bwrap.d.ts +23 -3
- package/node_modules/@xrkseek/exec-sandbox/dist/bwrap.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-sandbox/dist/bwrap.js +40 -5
- package/node_modules/@xrkseek/exec-sandbox/dist/bwrap.js.map +1 -1
- package/node_modules/@xrkseek/exec-sandbox/dist/doctor.js +1 -1
- package/node_modules/@xrkseek/exec-sandbox/dist/doctor.js.map +1 -1
- package/node_modules/@xrkseek/exec-sandbox/dist/index.d.ts +1 -1
- package/node_modules/@xrkseek/exec-sandbox/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-sandbox/dist/index.js +1 -1
- package/node_modules/@xrkseek/exec-sandbox/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-sandbox/dist/resolve.d.ts +8 -0
- package/node_modules/@xrkseek/exec-sandbox/dist/resolve.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-sandbox/dist/resolve.js +13 -4
- package/node_modules/@xrkseek/exec-sandbox/dist/resolve.js.map +1 -1
- package/node_modules/@xrkseek/exec-shell/dist/index.d.ts +6 -3
- package/node_modules/@xrkseek/exec-shell/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-shell/dist/index.js +40 -10
- package/node_modules/@xrkseek/exec-shell/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-subprocess/dist/index.d.ts +4 -0
- package/node_modules/@xrkseek/exec-subprocess/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-subprocess/dist/index.js +2 -0
- package/node_modules/@xrkseek/exec-subprocess/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/format.js +6 -6
- package/node_modules/@xrkseek/exec-video-gen/dist/format.js.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/tools.js +2 -2
- package/node_modules/@xrkseek/exec-video-gen/dist/tools.js.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/browser-cdp.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/browser-cdp.js +26 -1
- package/node_modules/@xrkseek/exec-web/dist/browser-cdp.js.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/browser-session.d.ts +10 -2
- package/node_modules/@xrkseek/exec-web/dist/browser-session.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/browser-session.js +27 -4
- package/node_modules/@xrkseek/exec-web/dist/browser-session.js.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/browser-tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/browser-tools.js +43 -14
- package/node_modules/@xrkseek/exec-web/dist/browser-tools.js.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/format.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/format.js +2 -1
- package/node_modules/@xrkseek/exec-web/dist/format.js.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/index.d.ts +1 -1
- package/node_modules/@xrkseek/exec-web/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/llm/dist/reasoning-effort.d.ts +14 -0
- package/node_modules/@xrkseek/llm/dist/reasoning-effort.d.ts.map +1 -0
- package/node_modules/@xrkseek/llm/dist/reasoning-effort.js +21 -0
- package/node_modules/@xrkseek/llm/dist/reasoning-effort.js.map +1 -0
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/preset.js +28 -4
- package/node_modules/@xrkseek/preset-harness/dist/preset.js.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/preset-minimal/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/preset-server/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/protocol/dist/workspace-changes.d.ts.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/workspace-changes.js +3 -1
- package/node_modules/@xrkseek/protocol/dist/workspace-changes.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/attach-http.d.ts +6 -2
- package/node_modules/@xrkseek/server-face/dist/attach-http.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/attach-http.js +120 -46
- package/node_modules/@xrkseek/server-face/dist/attach-http.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/context.d.ts +18 -3
- package/node_modules/@xrkseek/server-face/dist/context.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/dispatch.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/dispatch.js +6 -2
- package/node_modules/@xrkseek/server-face/dist/dispatch.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/face-schema.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/face-schema.js +1 -0
- package/node_modules/@xrkseek/server-face/dist/face-schema.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/catalog.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/catalog.js +2 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/catalog.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/remotes.d.ts +11 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/remotes.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/remotes.js +170 -4
- package/node_modules/@xrkseek/server-face/dist/handlers/remotes.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/session-added.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/session-added.js +3 -2
- package/node_modules/@xrkseek/server-face/dist/handlers/session-added.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/session.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/session.js +7 -6
- package/node_modules/@xrkseek/server-face/dist/handlers/session.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.d.mts +3734 -0
- package/node_modules/@xrkseek/server-face/dist/index.d.mts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/index.d.ts +6 -3
- package/node_modules/@xrkseek/server-face/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.js +6 -3
- package/node_modules/@xrkseek/server-face/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.mjs +22085 -0
- package/node_modules/@xrkseek/server-face/dist/index.mjs.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/model-reasoning.d.ts +51 -0
- package/node_modules/@xrkseek/server-face/dist/model-reasoning.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/model-reasoning.js +104 -0
- package/node_modules/@xrkseek/server-face/dist/model-reasoning.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/plugin-agent-presets.d.ts +34 -0
- package/node_modules/@xrkseek/server-face/dist/plugin-agent-presets.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/plugin-agent-presets.js +41 -0
- package/node_modules/@xrkseek/server-face/dist/plugin-agent-presets.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/plugin-inventory.d.ts +5 -2
- package/node_modules/@xrkseek/server-face/dist/plugin-inventory.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/plugin-inventory.js +13 -2
- package/node_modules/@xrkseek/server-face/dist/plugin-inventory.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.js +3 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/remote-event.d.ts +1 -1
- package/node_modules/@xrkseek/server-face/dist/remote-event.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/remote-event.js +1 -0
- package/node_modules/@xrkseek/server-face/dist/remote-event.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/runtime.d.ts +17 -4
- package/node_modules/@xrkseek/server-face/dist/runtime.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/runtime.js +14 -2
- package/node_modules/@xrkseek/server-face/dist/runtime.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-agent-preset-store.d.ts +14 -0
- package/node_modules/@xrkseek/server-face/dist/session-agent-preset-store.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/session-agent-preset-store.js +71 -0
- package/node_modules/@xrkseek/server-face/dist/session-agent-preset-store.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/session-agent-preset.d.ts +17 -0
- package/node_modules/@xrkseek/server-face/dist/session-agent-preset.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/session-agent-preset.js +50 -0
- package/node_modules/@xrkseek/server-face/dist/session-agent-preset.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/session-attachment.d.ts +4 -0
- package/node_modules/@xrkseek/server-face/dist/session-attachment.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-attachment.js +30 -7
- package/node_modules/@xrkseek/server-face/dist/session-attachment.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-status.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-status.js +2 -1
- package/node_modules/@xrkseek/server-face/dist/session-status.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-credentials.d.ts +6 -0
- package/node_modules/@xrkseek/server-face/dist/settings-credentials.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-credentials.js +68 -12
- package/node_modules/@xrkseek/server-face/dist/settings-credentials.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js +7 -3
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/subagent-tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/subagent-tools.js +25 -1
- package/node_modules/@xrkseek/server-face/dist/subagent-tools.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/types.d.ts +3 -0
- package/node_modules/@xrkseek/server-face/dist/types.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-face.d.ts +2 -0
- package/node_modules/@xrkseek/server-face/dist/workspace-face.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-face.js +61 -3
- package/node_modules/@xrkseek/server-face/dist/workspace-face.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-registry.d.ts +23 -2
- package/node_modules/@xrkseek/server-face/dist/workspace-registry.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-registry.js +37 -2
- package/node_modules/@xrkseek/server-face/dist/workspace-registry.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-store.d.ts +2 -0
- package/node_modules/@xrkseek/server-face/dist/workspace-store.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-store.js +4 -0
- package/node_modules/@xrkseek/server-face/dist/workspace-store.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/cron-http.d.ts +26 -0
- package/node_modules/@xrkseek/server-host/dist/cron-http.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-host/dist/cron-http.js +77 -0
- package/node_modules/@xrkseek/server-host/dist/cron-http.js.map +1 -0
- package/node_modules/@xrkseek/server-host/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.js +222 -123
- package/node_modules/@xrkseek/server-host/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/mcp-wire.d.ts +8 -0
- package/node_modules/@xrkseek/server-host/dist/mcp-wire.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/mcp-wire.js +33 -1
- package/node_modules/@xrkseek/server-host/dist/mcp-wire.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.js +2 -1
- package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty-agent.d.ts +2 -0
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty-agent.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty-agent.js +98 -0
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty-agent.js.map +1 -0
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty-worker.d.ts +18 -0
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty-worker.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty-worker.js +141 -0
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty-worker.js.map +1 -0
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty.d.ts +11 -4
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty.js +353 -2
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/win-fd-inherit.d.ts +30 -0
- package/node_modules/@xrkseek/server-host/dist/win-fd-inherit.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-host/dist/win-fd-inherit.js +96 -0
- package/node_modules/@xrkseek/server-host/dist/win-fd-inherit.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-providers.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-providers.js +306 -11
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-providers.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/audit-community-client.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/audit-community-client.js +53 -3
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/audit-community-client.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/billing.d.ts +9 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/billing.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/billing.js +80 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/billing.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/code-server.d.ts +11 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/code-server.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/code-server.js +152 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/code-server.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/community-plugin-root.d.ts +5 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/community-plugin-root.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/community-plugin-root.js +31 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/community-plugin-root.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/community-root-http.d.ts +17 -3
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/community-root-http.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/community-root-http.js +265 -8
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/community-root-http.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-client-scan.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-client-scan.js +6 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-client-scan.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-codex-ui.d.ts +7 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-codex-ui.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-codex-ui.js +188 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-codex-ui.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-compat-matrix.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-compat-matrix.js +3 -3
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-compat-matrix.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-context.d.ts +11 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-context.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-context.js +117 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-context.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-email.d.ts +11 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-email.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-email.js +381 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-email.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-path-capabilities.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-path-capabilities.js +43 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-path-capabilities.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-pet-legacy.d.ts +11 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-pet-legacy.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-pet-legacy.js +173 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-pet-legacy.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-skins.d.ts +17 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-skins.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-skins.js +209 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-skins.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-ssh.d.ts +7 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-ssh.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-ssh.js +470 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-ssh.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-update.d.ts +7 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-update.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-update.js +93 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-update.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/free-search.d.ts +27 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/free-search.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/free-search.js +213 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/free-search.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-dsh-http.d.ts +6 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-dsh-http.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-dsh-http.js +92 -14
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-dsh-http.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-plugin-http.d.ts +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-plugin-http.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-plugin-http.js +72 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-plugin-http.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/git-graph.d.ts +9 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/git-graph.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/git-graph.js +341 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/git-graph.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/honest-http-catchall.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/honest-http-catchall.js +3 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/honest-http-catchall.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/im-connect.d.ts +7 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/im-connect.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/im-connect.js +138 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/im-connect.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/install.d.ts +11 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/install.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/install.js +85 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/install.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/market.d.ts +27 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/market.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/market.js +230 -52
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/market.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mcp-connector.d.ts +11 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mcp-connector.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mcp-connector.js +182 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mcp-connector.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/michengai.d.ts +13 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/michengai.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/michengai.js +151 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/michengai.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mnemon-store.d.ts +6 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mnemon-store.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mnemon-store.js +34 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mnemon-store.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mnemon.d.ts +2 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mnemon.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mnemon.js +271 -20
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mnemon.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/modlens.d.ts +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/modlens.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/modlens.js +105 -21
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/modlens.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/niulai-kws.d.ts +7 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/niulai-kws.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/niulai-kws.js +81 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/niulai-kws.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/pet.d.ts +8 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/pet.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/pet.js +378 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/pet.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/remote-web-ui.d.ts +7 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/remote-web-ui.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/remote-web-ui.js +229 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/remote-web-ui.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/server-deck.d.ts +7 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/server-deck.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/server-deck.js +300 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/server-deck.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/settings-defaults.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/settings-defaults.js +10 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/settings-defaults.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/settings-store.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/settings-store.js +40 -9
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/settings-store.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skills-manager.d.ts +8 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skills-manager.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skills-manager.js +428 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skills-manager.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-assets.d.ts +12 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-assets.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-assets.js +166 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-assets.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-center.d.ts +20 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-center.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-center.js +308 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-center.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-discover.d.ts +32 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-discover.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-discover.js +183 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-discover.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-market.d.ts +2 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-market.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-market.js +20 -16
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-market.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/task-board.d.ts +7 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/task-board.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/task-board.js +245 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/task-board.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/token-usage-stats-dash.d.ts +9 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/token-usage-stats-dash.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/token-usage-stats-dash.js +116 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/token-usage-stats-dash.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/http-json.d.ts +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/http-json.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/http-json.js +5 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/http-json.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/index.d.ts +2 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/index.js +2 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/index.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/plugin-surface-store.d.ts +18 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/plugin-surface-store.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/plugin-surface-store.js +65 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/plugin-surface-store.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/univer-api.d.ts +11 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/univer-api.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/univer-api.js +114 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/univer-api.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wallpaper.d.ts +3 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wallpaper.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wallpaper.js +42 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wallpaper.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wire/stub-handlers.d.ts +6 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wire/stub-handlers.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wire/stub-handlers.js +68 -8
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/wire/stub-handlers.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/fetch-dispatch.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/fetch-dispatch.js +111 -26
- package/node_modules/@xrkseek/server-http/dist/fetch-dispatch.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/host-owned-paths.d.ts +6 -0
- package/node_modules/@xrkseek/server-http/dist/host-owned-paths.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/host-owned-paths.js +32 -0
- package/node_modules/@xrkseek/server-http/dist/host-owned-paths.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/index.d.ts +1 -0
- package/node_modules/@xrkseek/server-http/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/index.js +1 -0
- package/node_modules/@xrkseek/server-http/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-adapter.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-adapter.js +10 -0
- package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-adapter.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/xrk/plugin-mutate.d.ts +9 -0
- package/node_modules/@xrkseek/server-http/dist/xrk/plugin-mutate.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/xrk/plugin-mutate.js +68 -21
- package/node_modules/@xrkseek/server-http/dist/xrk/plugin-mutate.js.map +1 -1
- package/node_modules/@xrkseek/server-http/package.json +1 -0
- package/node_modules/@xrkseek/server-loader/dist/index.d.ts +1 -1
- package/node_modules/@xrkseek/server-loader/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-loader/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-loader/dist/load.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-loader/dist/load.js +5 -2
- package/node_modules/@xrkseek/server-loader/dist/load.js.map +1 -1
- package/node_modules/@xrkseek/server-loader/dist/managed-state.d.ts +11 -1
- package/node_modules/@xrkseek/server-loader/dist/managed-state.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-loader/dist/managed-state.js +11 -2
- package/node_modules/@xrkseek/server-loader/dist/managed-state.js.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/index.d.ts +9 -0
- package/node_modules/@xrkseek/workspace/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/index.js +4 -2
- package/node_modules/@xrkseek/workspace/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/workspace-anchor.d.ts +32 -2
- package/node_modules/@xrkseek/workspace/dist/workspace-anchor.d.ts.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/workspace-anchor.js +69 -2
- package/node_modules/@xrkseek/workspace/dist/workspace-anchor.js.map +1 -1
- package/node_modules/@xrkseek/xrk-session-reference/README.md +1 -1
- package/node_modules/@xrkseek/xrk-session-reference/README.zh.md +1 -1
- package/node_modules/@xrkseek/xrk-session-reference/dist/spill.d.ts +5 -3
- package/node_modules/@xrkseek/xrk-session-reference/dist/spill.d.ts.map +1 -1
- package/node_modules/@xrkseek/xrk-session-reference/dist/spill.js +20 -17
- package/node_modules/@xrkseek/xrk-session-reference/dist/spill.js.map +1 -1
- package/node_modules/@xrkseek/xrk-session-reference/package.json +1 -1
- package/package.json +1 -1
- package/node_modules/@xrkseek/server-face/dist/opencode-zen.d.ts +0 -13
- package/node_modules/@xrkseek/server-face/dist/opencode-zen.d.ts.map +0 -1
- package/node_modules/@xrkseek/server-face/dist/opencode-zen.js +0 -40
- package/node_modules/@xrkseek/server-face/dist/opencode-zen.js.map +0 -1
|
@@ -0,0 +1,3734 @@
|
|
|
1
|
+
import { AdmitReceipt, SessionDrainCancelOptions, SessionRecord, SessionStore } from "@xrkseek/core-session";
|
|
2
|
+
import { ApprovalPolicy, FeedbackCategory, PermissionKnobState, PlanProjection, SandboxMode, SessionEvent, TodoItem, WorkspaceChangesSummary } from "@xrkseek/protocol";
|
|
3
|
+
import { AuthMode, ProtocolId, ProviderBinding, ProviderRegistry, RoutingLlmAdapter } from "@xrkseek/llm-registry";
|
|
4
|
+
import { ProjectionCheckpoint, ProjectionDefinition, ProjectionSnapshot, ProjectionWire, SessionProjectionRegistry, SessionProjectionRegistryOptions } from "@xrkseek/session-projection";
|
|
5
|
+
import { ApprovalHandler, PresentToolLookup, PresentToolLookup as PresentToolLookup$1, SESSION_QUERY_ROUTING_PROMPT_TEXT, SUBAGENT_ROUTING_PROMPT_TEXT, ToolCallPairing, ToolCallPairing as ToolCallPairing$1, ToolDefinition, ToolEventView, ToolEventView as ToolEventView$1, ToolPipelineContext, ToolRegistry } from "@xrkseek/core-tools";
|
|
6
|
+
import { ProposeSkillDraft, Recipe } from "@xrkseek/workspace";
|
|
7
|
+
import { DISABLED_PLUGINS_FILE, ManagedPackageIndex, ManagedPluginPackageMeta, PermissionRequestDecision, atomicWriteText, clearSoftDisabledIdsAt, isPluginSoftDisabledAt, lookupManagedPluginSourceAt, readDisabledPluginIdsAt, readManagedPackageIndexAt, readManagedPluginPackagesAt, reconcileManagedProcessPlugins, setSoftDisabledAt, writeDisabledPluginIdsAt } from "@xrkseek/server-loader";
|
|
8
|
+
import { spawn } from "node:child_process";
|
|
9
|
+
import { PolicyEngine } from "@xrkseek/policy";
|
|
10
|
+
import { AttachmentStore, FileAttachmentLimits, ImageAttachmentLimits } from "@xrkseek/attachment";
|
|
11
|
+
import { GitRunner, WorkspaceCheckpointRecord, WorkspaceCheckpointStore } from "@xrkseek/checkpoint";
|
|
12
|
+
import { ShellService } from "@xrkseek/exec-shell";
|
|
13
|
+
import { IncomingMessage, Server, ServerResponse } from "node:http";
|
|
14
|
+
import WebSocket, { WebSocketServer } from "ws";
|
|
15
|
+
import { AgentHandle } from "@xrkseek/core-agent";
|
|
16
|
+
import { LlmAdapter } from "@xrkseek/llm";
|
|
17
|
+
//#region src/types.d.ts
|
|
18
|
+
type RpcId = string;
|
|
19
|
+
interface FaceRpcRequest<P = unknown> {
|
|
20
|
+
readonly rpcId: RpcId;
|
|
21
|
+
readonly payload: P;
|
|
22
|
+
}
|
|
23
|
+
/** Handler-side fail. Wire always gets `details` via `errResponse`. */
|
|
24
|
+
type FaceRpcFail = {
|
|
25
|
+
readonly code: string;
|
|
26
|
+
readonly message: string;
|
|
27
|
+
readonly details?: Record<string, unknown>;
|
|
28
|
+
};
|
|
29
|
+
/** 产品壳 Zod 要求:线上错误必须有 `details`。 */
|
|
30
|
+
type FaceRpcError = {
|
|
31
|
+
readonly code: string;
|
|
32
|
+
readonly message: string;
|
|
33
|
+
readonly details: Record<string, unknown>;
|
|
34
|
+
};
|
|
35
|
+
type FaceRpcResult<T> = {
|
|
36
|
+
readonly ok: true;
|
|
37
|
+
readonly value: T;
|
|
38
|
+
} | {
|
|
39
|
+
readonly ok: false;
|
|
40
|
+
readonly error: FaceRpcFail;
|
|
41
|
+
};
|
|
42
|
+
/** Unary response — Face `type: server-response`. */
|
|
43
|
+
interface FaceRpcResponse<T = unknown> {
|
|
44
|
+
readonly type: "server-response";
|
|
45
|
+
readonly rpcId: RpcId;
|
|
46
|
+
readonly result: {
|
|
47
|
+
readonly ok: true;
|
|
48
|
+
readonly value: T;
|
|
49
|
+
} | {
|
|
50
|
+
readonly ok: false;
|
|
51
|
+
readonly error: FaceRpcError;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/** DSH `POST /api/respond` 回执。 */
|
|
55
|
+
type FaceRpcReceipt = {
|
|
56
|
+
readonly accepted: true;
|
|
57
|
+
} | {
|
|
58
|
+
readonly accepted: false;
|
|
59
|
+
readonly reason: "not-pending" | "bad-response";
|
|
60
|
+
};
|
|
61
|
+
type MuxFrame = {
|
|
62
|
+
readonly type: "session/event";
|
|
63
|
+
readonly sessionId: string;
|
|
64
|
+
readonly event: unknown;
|
|
65
|
+
readonly seq: number;
|
|
66
|
+
/** Host-computed, non-persisted tool card (optional). */
|
|
67
|
+
readonly view?: unknown;
|
|
68
|
+
} | {
|
|
69
|
+
readonly type: "session/projection";
|
|
70
|
+
readonly sessionId: string;
|
|
71
|
+
readonly key: string;
|
|
72
|
+
readonly value: unknown;
|
|
73
|
+
readonly seq: number;
|
|
74
|
+
} | {
|
|
75
|
+
readonly type: "session/subscribed";
|
|
76
|
+
readonly sessionId: string;
|
|
77
|
+
readonly lastSeq: number;
|
|
78
|
+
} | {
|
|
79
|
+
readonly type: "session/queue";
|
|
80
|
+
readonly sessionId: string;
|
|
81
|
+
readonly items: readonly unknown[];
|
|
82
|
+
} |
|
|
83
|
+
/** DSH `session/jobs` — whole-set snapshot; omit baseline when empty. */
|
|
84
|
+
{
|
|
85
|
+
readonly type: "session/jobs";
|
|
86
|
+
readonly sessionId: string;
|
|
87
|
+
readonly jobs: readonly unknown[];
|
|
88
|
+
} |
|
|
89
|
+
/** 产品壳可应答审批(稳定 rpcId 在 server-request 信封上)。 */
|
|
90
|
+
{
|
|
91
|
+
readonly type: "approval/requested";
|
|
92
|
+
readonly sessionId: string;
|
|
93
|
+
readonly approvalId: string;
|
|
94
|
+
readonly toolName: string;
|
|
95
|
+
readonly callId?: string;
|
|
96
|
+
readonly reason?: string;
|
|
97
|
+
/** tool · network · escalation (Codex-style UX split). */
|
|
98
|
+
readonly category?: "tool" | "network" | "escalation";
|
|
99
|
+
readonly networkHost?: string;
|
|
100
|
+
readonly networkProtocol?: string;
|
|
101
|
+
} | {
|
|
102
|
+
readonly type: "approval/resolved";
|
|
103
|
+
readonly sessionId: string;
|
|
104
|
+
readonly approvalId: string;
|
|
105
|
+
readonly outcome: "allowed-once" | "rejected" | "cancelled" | "unavailable";
|
|
106
|
+
} |
|
|
107
|
+
/** Face `question/requested` — answerable server-request (rpcId on envelope). */
|
|
108
|
+
{
|
|
109
|
+
readonly type: "question/requested";
|
|
110
|
+
readonly sessionId: string;
|
|
111
|
+
readonly questions: readonly FaceQuestionItem[];
|
|
112
|
+
} | {
|
|
113
|
+
readonly type: "question/resolved";
|
|
114
|
+
readonly sessionId: string;
|
|
115
|
+
readonly questionRpcId: string;
|
|
116
|
+
readonly outcome: "answered" | "cancelled";
|
|
117
|
+
};
|
|
118
|
+
/** Face `AskUserQuestionItem` (product-shell Zod). */
|
|
119
|
+
interface FaceQuestionItem {
|
|
120
|
+
readonly id: string;
|
|
121
|
+
readonly question: string;
|
|
122
|
+
readonly header?: string;
|
|
123
|
+
readonly detail?: string;
|
|
124
|
+
readonly options?: readonly {
|
|
125
|
+
readonly label: string;
|
|
126
|
+
readonly description?: string;
|
|
127
|
+
}[];
|
|
128
|
+
readonly multiSelect?: boolean;
|
|
129
|
+
readonly intent?: {
|
|
130
|
+
readonly kind: "plan-review";
|
|
131
|
+
readonly approve: string;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/** Face `AskUserQuestionAnswer`. */
|
|
135
|
+
interface FaceQuestionAnswer {
|
|
136
|
+
readonly answers: readonly FaceQuestionAnswerItem[];
|
|
137
|
+
}
|
|
138
|
+
interface FaceQuestionAnswerItem {
|
|
139
|
+
readonly id: string;
|
|
140
|
+
readonly selected: readonly string[];
|
|
141
|
+
readonly custom?: string;
|
|
142
|
+
}
|
|
143
|
+
type HostFrame = {
|
|
144
|
+
readonly type: "host/session-added";
|
|
145
|
+
readonly sessionId: string;
|
|
146
|
+
readonly blank: boolean;
|
|
147
|
+
readonly agentPreset?: string;
|
|
148
|
+
readonly cwd?: string;
|
|
149
|
+
readonly parentSessionId?: string;
|
|
150
|
+
readonly origin?: "subagent" | "fork";
|
|
151
|
+
} | {
|
|
152
|
+
readonly type: "host/session-removed";
|
|
153
|
+
readonly sessionId: string;
|
|
154
|
+
} | {
|
|
155
|
+
readonly type: "host/session-status";
|
|
156
|
+
readonly sessionId: string;
|
|
157
|
+
readonly running: boolean;
|
|
158
|
+
} | {
|
|
159
|
+
readonly type: "host/agent-error";
|
|
160
|
+
readonly sessionId: string;
|
|
161
|
+
readonly message: string;
|
|
162
|
+
} | {
|
|
163
|
+
readonly type: "host/workspace-changed";
|
|
164
|
+
readonly workspace: {
|
|
165
|
+
readonly workspaceId: string;
|
|
166
|
+
readonly path: string;
|
|
167
|
+
readonly title: string;
|
|
168
|
+
readonly sessionIds: readonly string[];
|
|
169
|
+
readonly createdAt: string;
|
|
170
|
+
readonly updatedAt: string;
|
|
171
|
+
};
|
|
172
|
+
} | {
|
|
173
|
+
readonly type: "host/workspace-removed";
|
|
174
|
+
readonly workspaceId: string;
|
|
175
|
+
} | {
|
|
176
|
+
readonly type: "host/workspace-order-changed";
|
|
177
|
+
readonly workspaceIds: readonly string[];
|
|
178
|
+
} | {
|
|
179
|
+
readonly type: "host/archived-sessions-changed";
|
|
180
|
+
readonly archivedSessionIds: readonly string[];
|
|
181
|
+
} | {
|
|
182
|
+
readonly type: "host/pinned-sessions-changed";
|
|
183
|
+
readonly pinnedSessionIds: readonly string[];
|
|
184
|
+
} | {
|
|
185
|
+
/** DSH `host/remote-event` — allowlisted Host events for `ctx.remote.$dispatch`. */
|
|
186
|
+
readonly type: "host/remote-event";
|
|
187
|
+
readonly event: string;
|
|
188
|
+
readonly args: readonly unknown[];
|
|
189
|
+
};
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/wire/envelope.d.ts
|
|
192
|
+
/**
|
|
193
|
+
* 解析 unary body。接受 DSH `{ type: client-request }` 与瘦形 `{ rpcId, payload }`。
|
|
194
|
+
*/
|
|
195
|
+
declare function parseFaceRpcRequest(body: unknown): FaceRpcRequest;
|
|
196
|
+
/** DSH unary 成功信封。 */
|
|
197
|
+
declare function okResponse<T>(rpcId: RpcId, value: T): FaceRpcResponse<T>;
|
|
198
|
+
/** DSH unary 失败信封;必含 `details`。 */
|
|
199
|
+
declare function errResponse(rpcId: RpcId, code: string, message: string, details?: unknown): FaceRpcResponse<never>;
|
|
200
|
+
/** DSH WS 下行:`server-request`,method = payload.type。 */
|
|
201
|
+
declare function serverRequestFrame(rpcId: RpcId, payload: {
|
|
202
|
+
readonly type: string;
|
|
203
|
+
} & Record<string, unknown>): {
|
|
204
|
+
readonly type: "server-request";
|
|
205
|
+
readonly rpcId: RpcId;
|
|
206
|
+
readonly method: string;
|
|
207
|
+
readonly payload: typeof payload;
|
|
208
|
+
};
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region src/wire/rpc-error.d.ts
|
|
211
|
+
/** 产品壳浏览器客户端接受的 code(RpcErrorDetailsMap 键)。 */
|
|
212
|
+
declare const FACE_RPC_ERROR_CODES: readonly ["bad-request", "cancelled", "session-not-found", "model-unavailable", "session-conflict", "invalid-time-zone", "workspace-attach-failed", "workspace-not-found", "workspace-invalid-path", "workspace-name-conflict", "workspace-move-invalid", "directory-unreadable", "directory-exists", "directory-create-failed", "directory-picker-unavailable", "agent-preset-read-only", "agent-preset-locked", "agent-preset-conflict", "agent-preset-not-found", "agent-preset-invalid", "agent-busy", "attachment-error", "queue-item-not-found", "steer-unavailable", "command-error", "unknown-command", "settings-rejected", "settings-conflict", "credential-rejected", "model-discovery-failed", "title-invalid", "fork-unavailable", "subagent-parent-unavailable", "subagent-not-found", "subagent-catalog-diagnostic", "subagent-not-resumable", "subagent-unauthorized", "subagent-delivery-unavailable", "job-not-found", "job-host-unavailable", "job-not-foreground", "policy-denied", "policy-ask", "internal"];
|
|
213
|
+
type FaceRpcErrorCode = (typeof FACE_RPC_ERROR_CODES)[number];
|
|
214
|
+
/**
|
|
215
|
+
* 把 handler 错误归一成产品壳可解析的 RpcError。
|
|
216
|
+
* 未知 / 仅 XRK 的 code 折到最近壳侧码或 `internal`。
|
|
217
|
+
*/
|
|
218
|
+
declare function mapFaceRpcError(code: string, message: string, details?: unknown): FaceRpcError;
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region src/wire/paths.d.ts
|
|
221
|
+
/**
|
|
222
|
+
* Face HTTP/WS 路径:与产品壳 apiproxy 同形。
|
|
223
|
+
*
|
|
224
|
+
* Unary 两类:
|
|
225
|
+
* - 点号方法:`/api/session.prompt`(须含 `.`,避免抢走 REST `/api/sessions`)
|
|
226
|
+
* - Typert Remote:`/api/commands/execute`(`ns/method`;白名单 namespace)
|
|
227
|
+
*/
|
|
228
|
+
declare const FACE_WS_PATHS: readonly ["/api/face/events.mux", "/api/face/events.host", "/api/events.mux", "/api/events.host"];
|
|
229
|
+
declare const FACE_RESPOND_PATHS: readonly ["/api/respond", "/api/face/respond"];
|
|
230
|
+
/**
|
|
231
|
+
* 产品壳 `connection.rpc.call("/api", endpoint)` 会打的 Remote namespace。
|
|
232
|
+
* 未实现的 endpoint 仍要认领,回合法 Face 信封,禁止 HTTP 404。
|
|
233
|
+
*/
|
|
234
|
+
declare const FACE_REMOTE_NAMESPACES: Set<string>;
|
|
235
|
+
declare function isFaceRespondPath(pathname: string): boolean;
|
|
236
|
+
declare function isFaceWsPath(pathname: string): boolean;
|
|
237
|
+
declare function isFaceHttpPath(pathname: string): boolean;
|
|
238
|
+
/**
|
|
239
|
+
* 从 pathname 解析 unary method。
|
|
240
|
+
* - `/api/face/session.prompt`(U1 前缀)
|
|
241
|
+
* - `/api/session.prompt`(DSH 点号形)
|
|
242
|
+
* - `/api/commands/execute`(DSH Typert Remote)
|
|
243
|
+
*/
|
|
244
|
+
declare function faceMethodFromPath(pathname: string): string | undefined;
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region src/wire/loopback.d.ts
|
|
247
|
+
/**
|
|
248
|
+
* 本机回环判定:产品壳同源 fetch/WS 不带 Authorization。
|
|
249
|
+
*/
|
|
250
|
+
declare function isLoopbackAddress(address: string | undefined): boolean;
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region src/adapt/job-view.d.ts
|
|
253
|
+
/**
|
|
254
|
+
* Wire `JobView` (copied from `@xrkseek/xrk-host-apiproxy` `api/jobs.ts`).
|
|
255
|
+
* Registry internals (`ownerSession`, `reported`, `outputLimitBytes`) stay off
|
|
256
|
+
* the wire — the mux frame's `sessionId` is the owner. Optional `foreground`
|
|
257
|
+
* marks a yield-attached wait.
|
|
258
|
+
*/
|
|
259
|
+
type JobViewStatus = "running" | "stopping" | "completed" | "killed" | "failed";
|
|
260
|
+
interface JobView {
|
|
261
|
+
readonly id: string;
|
|
262
|
+
readonly kind: string;
|
|
263
|
+
readonly label: string;
|
|
264
|
+
readonly status: JobViewStatus;
|
|
265
|
+
readonly detail?: string;
|
|
266
|
+
readonly startedAt: number;
|
|
267
|
+
readonly finishedAt?: number;
|
|
268
|
+
readonly foreground?: boolean;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Project snapshots onto the wire view, dropping internal fields.
|
|
272
|
+
* Copied from apiproxy `jobViews`.
|
|
273
|
+
*/
|
|
274
|
+
declare function jobViews(snapshots: readonly JobView[]): JobView[];
|
|
275
|
+
interface FaceJobsSource {
|
|
276
|
+
list(): readonly JobView[];
|
|
277
|
+
onJobsChanged(listener: () => void): () => void;
|
|
278
|
+
}
|
|
279
|
+
/** Face tool-jobs `fitCompletionNotice` (optional UTF-8 cap). */
|
|
280
|
+
declare function formatJobCompletionNotice(job: JobView, maxBytes?: number): string;
|
|
281
|
+
declare function isSettledJobStatus(status: JobViewStatus): boolean;
|
|
282
|
+
/** Face `maxConsecutiveWakes` default. */
|
|
283
|
+
declare const JOB_COMPLETION_MAX_WAKES = 3;
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region src/bus.d.ts
|
|
286
|
+
interface FaceBus {
|
|
287
|
+
subscribeMux(listener: (rpcId: string, frame: MuxFrame) => void): () => void;
|
|
288
|
+
subscribeHost(listener: (rpcId: string, frame: HostFrame) => void): () => void;
|
|
289
|
+
publishMux(frame: MuxFrame, rpcId?: string): void;
|
|
290
|
+
publishHost(frame: HostFrame, rpcId?: string): void;
|
|
291
|
+
}
|
|
292
|
+
declare function createFaceBus(): FaceBus;
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region src/seq.d.ts
|
|
295
|
+
/**
|
|
296
|
+
* Face mux wire sequence brands — independent of Session log sequence brands.
|
|
297
|
+
* Runtime values remain plain numbers; brands stop mixing mux clocks with log offsets.
|
|
298
|
+
*/
|
|
299
|
+
declare const FACE_MUX_SEQ: unique symbol;
|
|
300
|
+
/** Per-session Face mux frame sequence (1-based after the first `next`). */
|
|
301
|
+
type FaceMuxSeq = number & {
|
|
302
|
+
readonly [FACE_MUX_SEQ]: void;
|
|
303
|
+
};
|
|
304
|
+
/** Admit a numeric value as a Face mux sequence. */
|
|
305
|
+
declare function FaceMuxSeq(value: number): FaceMuxSeq;
|
|
306
|
+
interface FaceSeqClock {
|
|
307
|
+
next(sessionId: string): FaceMuxSeq;
|
|
308
|
+
last(sessionId: string): FaceMuxSeq;
|
|
309
|
+
/**
|
|
310
|
+
* Raise the mux watermark to at least `seq` without walking `next` one-by-one.
|
|
311
|
+
* Used when replaying history so long sessions do not O(maxSeq) spin.
|
|
312
|
+
*/
|
|
313
|
+
ensureAtLeast(sessionId: string, seq: number): FaceMuxSeq;
|
|
314
|
+
}
|
|
315
|
+
declare function createFaceSeqClock(): FaceSeqClock;
|
|
316
|
+
//#endregion
|
|
317
|
+
//#region src/face-schema.d.ts
|
|
318
|
+
/** Same preset ids as the permission-presets settings row enum. */
|
|
319
|
+
declare const FACE_PERMISSION_PRESETS: readonly ["read-only", "workspace-write", "danger-full-access"];
|
|
320
|
+
type FacePermissionPreset = (typeof FACE_PERMISSION_PRESETS)[number];
|
|
321
|
+
//#endregion
|
|
322
|
+
//#region src/permissions.d.ts
|
|
323
|
+
declare const CUSTOM_PERMISSION_PRESET: "custom";
|
|
324
|
+
interface PermissionPresetSpec {
|
|
325
|
+
readonly sandbox: SandboxMode;
|
|
326
|
+
readonly approval: ApprovalPolicy;
|
|
327
|
+
readonly name: string;
|
|
328
|
+
readonly description: string;
|
|
329
|
+
}
|
|
330
|
+
interface PermissionSelectOption {
|
|
331
|
+
readonly value: string;
|
|
332
|
+
readonly name: string;
|
|
333
|
+
readonly description?: string;
|
|
334
|
+
}
|
|
335
|
+
interface PermissionSelect {
|
|
336
|
+
readonly options: readonly PermissionSelectOption[];
|
|
337
|
+
readonly currentValue: string;
|
|
338
|
+
}
|
|
339
|
+
/** Same table ids as settings `permission.defaultPreset`. */
|
|
340
|
+
declare const FACE_PERMISSION_TABLE: Readonly<Record<FacePermissionPreset, PermissionPresetSpec>>;
|
|
341
|
+
/**
|
|
342
|
+
* Derive select currentValue from folded knobs + composition defaults.
|
|
343
|
+
* Defaults match a coding harness (workspace-write + ask).
|
|
344
|
+
*/
|
|
345
|
+
declare function derivePermissionSelect(state: PermissionKnobState, defaults?: {
|
|
346
|
+
readonly sandbox?: SandboxMode;
|
|
347
|
+
readonly approval?: ApprovalPolicy;
|
|
348
|
+
}): PermissionSelect;
|
|
349
|
+
declare function permissionSelectFromEvents(events: readonly SessionEvent[]): PermissionSelect;
|
|
350
|
+
declare function defaultPermissionPreset(runtime: FaceRuntime): FacePermissionPreset;
|
|
351
|
+
/** Pin durable knobs on a fresh session (settings defaultPreset). */
|
|
352
|
+
declare function pinInitialPermission(store: SessionStore, sessionId: string, preset: FacePermissionPreset): void;
|
|
353
|
+
/**
|
|
354
|
+
* Switch preset: append changed knobs only. Selecting the effective preset
|
|
355
|
+
* again appends nothing.
|
|
356
|
+
*
|
|
357
|
+
* Optional `hasPtyActivity` fences sandbox mode changes while **Agent**
|
|
358
|
+
* `terminal_*` PTY sessions are open or spawning (CV DSH terminal-bash
|
|
359
|
+
* `ensureSandboxModeFence` / `@xrkseek/exec-pty` `sandboxModeChangeBlockedMessage`).
|
|
360
|
+
* Sidebar user terminals are independent and must not be reported here.
|
|
361
|
+
*/
|
|
362
|
+
declare function applyPermissionPreset(store: SessionStore, sessionId: string, name: string, options?: {
|
|
363
|
+
readonly hasPtyActivity?: () => boolean;
|
|
364
|
+
}): {
|
|
365
|
+
readonly ok: true;
|
|
366
|
+
readonly changed: boolean;
|
|
367
|
+
} | {
|
|
368
|
+
readonly ok: false;
|
|
369
|
+
readonly message: string;
|
|
370
|
+
};
|
|
371
|
+
/**
|
|
372
|
+
* Settings `permission.defaultPreset` is `applies: live`. Push the new default
|
|
373
|
+
* onto sessions still on the previous default (not manually customized via
|
|
374
|
+
* Access / `/permission`), then invalidate so sandbox/approval rebuild.
|
|
375
|
+
*/
|
|
376
|
+
declare function applyLivePermissionDefaultPreset(runtime: FaceRuntime, previousUser: unknown, nextValue: unknown): Promise<void>;
|
|
377
|
+
//#endregion
|
|
378
|
+
//#region src/projections/units/auto-review.d.ts
|
|
379
|
+
interface AutoReviewProjection {
|
|
380
|
+
readonly enabled: boolean;
|
|
381
|
+
readonly verdictsUsed: number;
|
|
382
|
+
readonly failuresUsed: number;
|
|
383
|
+
readonly allows: number;
|
|
384
|
+
readonly denies: number;
|
|
385
|
+
readonly fallbacks: number;
|
|
386
|
+
readonly neverRejects: number;
|
|
387
|
+
readonly avgDurationMs: number;
|
|
388
|
+
readonly circuit: null | {
|
|
389
|
+
readonly trip: {
|
|
390
|
+
readonly kind: string;
|
|
391
|
+
readonly count: number;
|
|
392
|
+
};
|
|
393
|
+
readonly action: string;
|
|
394
|
+
};
|
|
395
|
+
readonly recentDenies: ReadonlyArray<{
|
|
396
|
+
readonly reviewId: string;
|
|
397
|
+
readonly toolName: string;
|
|
398
|
+
}>;
|
|
399
|
+
readonly recent: ReadonlyArray<Record<string, unknown>>;
|
|
400
|
+
}
|
|
401
|
+
//#endregion
|
|
402
|
+
//#region src/projections/units/turn-outline.d.ts
|
|
403
|
+
/** One started turn's outline facts served on the wire. */
|
|
404
|
+
interface TurnOutlineEntry {
|
|
405
|
+
/** Face wire turn number (order of first-seen `turnId`). */
|
|
406
|
+
readonly turn: number;
|
|
407
|
+
/** Face seq of this turn's `turn/start` (loadThrough target). */
|
|
408
|
+
readonly seq: number;
|
|
409
|
+
/** Bounded first-human-prompt preview; `''` until an eligible prompt lands. */
|
|
410
|
+
readonly prompt: string;
|
|
411
|
+
/** Bounded final-response preview; `''` until turn/end commits assistant text. */
|
|
412
|
+
readonly response: string;
|
|
413
|
+
}
|
|
414
|
+
//#endregion
|
|
415
|
+
//#region src/projections/units/workspace-changes.d.ts
|
|
416
|
+
/** Wire view: durable summary plus Face 1-based seq of the announcing event. */
|
|
417
|
+
type WorkspaceChangesProjected = WorkspaceChangesSummary & {
|
|
418
|
+
readonly seq: number;
|
|
419
|
+
};
|
|
420
|
+
//#endregion
|
|
421
|
+
//#region src/projections/registry.d.ts
|
|
422
|
+
/** Well-known projection keys owned by Face default units (client views). */
|
|
423
|
+
interface FaceProjectionMap {
|
|
424
|
+
/** Latest title, or null while untitled. */
|
|
425
|
+
readonly title: string | null;
|
|
426
|
+
/** Sidebar list hint. */
|
|
427
|
+
readonly sessionListMetadata: SessionListMetadata;
|
|
428
|
+
/** Standing plan (TodoDock); null before first write; persists across turns. */
|
|
429
|
+
readonly todos: TodoItem[] | null;
|
|
430
|
+
/** Permission select (DSH Access chip); folded from knob events. */
|
|
431
|
+
readonly permissions: PermissionSelect;
|
|
432
|
+
/** Plan-mode chip: logged active + pending `/plan` selection. */
|
|
433
|
+
readonly plan: PlanProjection;
|
|
434
|
+
/** dsh-auto-review session header panel. */
|
|
435
|
+
readonly autoReview: AutoReviewProjection;
|
|
436
|
+
/**
|
|
437
|
+
* Attachment intake limits (DSH InputBar pre-check). Present only while
|
|
438
|
+
* Face has an AttachmentStore; constant per boot — no change frames.
|
|
439
|
+
*/
|
|
440
|
+
readonly imageLimits: ImageAttachmentLimits;
|
|
441
|
+
/**
|
|
442
|
+
* Generic-file intake limits. Present only while Face has an AttachmentStore;
|
|
443
|
+
* constant per boot — no change frames.
|
|
444
|
+
*/
|
|
445
|
+
readonly fileLimits: FileAttachmentLimits;
|
|
446
|
+
/**
|
|
447
|
+
* Whole-log turn outline for the chat rail (DSH turnOutline): every started
|
|
448
|
+
* turn with its `turn/start` Face seq and bounded previews. Paging cannot
|
|
449
|
+
* shrink the ladder — unloaded marks jump via loadThrough.
|
|
450
|
+
*/
|
|
451
|
+
readonly turnOutline: readonly TurnOutlineEntry[];
|
|
452
|
+
/**
|
|
453
|
+
* Whole-log turn/step counts and wall times (DSH sessionStats).
|
|
454
|
+
* StatsLine reads this so paging cannot change the strip.
|
|
455
|
+
*/
|
|
456
|
+
readonly sessionStats: {
|
|
457
|
+
readonly turns: number;
|
|
458
|
+
readonly steps: number;
|
|
459
|
+
readonly llmMs: number;
|
|
460
|
+
readonly toolMs: number;
|
|
461
|
+
readonly ttftMs: number;
|
|
462
|
+
readonly ttftSteps: number;
|
|
463
|
+
readonly decodeMs: number;
|
|
464
|
+
readonly decodeTokens: number;
|
|
465
|
+
};
|
|
466
|
+
/** Cumulative provider token buckets (DSH tokenUsage; StatsLine). */
|
|
467
|
+
readonly tokenUsage: {
|
|
468
|
+
readonly uncachedInputTokens: number;
|
|
469
|
+
readonly outputTokens: number;
|
|
470
|
+
readonly cacheReadTokens: number;
|
|
471
|
+
readonly cacheWriteTokens: number;
|
|
472
|
+
};
|
|
473
|
+
/** Per-session token buckets for dsh-cost-meter (`useProjection('costUsage')`). */
|
|
474
|
+
readonly costUsage: {
|
|
475
|
+
readonly input: number;
|
|
476
|
+
readonly output: number;
|
|
477
|
+
readonly cacheRead: number;
|
|
478
|
+
readonly cacheWrite: number;
|
|
479
|
+
readonly reasoning: number;
|
|
480
|
+
readonly cost: number;
|
|
481
|
+
readonly byModel: Record<string, unknown>;
|
|
482
|
+
readonly byProviderModel: Record<string, unknown>;
|
|
483
|
+
};
|
|
484
|
+
/** Newest prompt pressure + route capacity (DSH contextPressure; ContextMeter). */
|
|
485
|
+
readonly contextPressure: {
|
|
486
|
+
readonly pressureTokens?: number;
|
|
487
|
+
readonly projectedTokens?: number;
|
|
488
|
+
readonly contextWindow?: number;
|
|
489
|
+
};
|
|
490
|
+
/** Heuristic system/tools/message composition (DSH contextBreakdown). */
|
|
491
|
+
readonly contextBreakdown: {
|
|
492
|
+
readonly systemTokens: number;
|
|
493
|
+
readonly toolsTokens: number;
|
|
494
|
+
readonly messageTokens: number;
|
|
495
|
+
};
|
|
496
|
+
/**
|
|
497
|
+
* Minimal timeline for community `dsh-context` (DSH contextTimeline).
|
|
498
|
+
* Always present so the Context tab does not hang on null.
|
|
499
|
+
*/
|
|
500
|
+
readonly contextTimeline: {
|
|
501
|
+
readonly current: {
|
|
502
|
+
readonly system: number;
|
|
503
|
+
readonly tools: number;
|
|
504
|
+
readonly user: number;
|
|
505
|
+
readonly inject: number;
|
|
506
|
+
readonly assistant: number;
|
|
507
|
+
readonly tool: number;
|
|
508
|
+
readonly total: number;
|
|
509
|
+
};
|
|
510
|
+
readonly toolList: readonly unknown[];
|
|
511
|
+
readonly requests: readonly unknown[];
|
|
512
|
+
readonly events: readonly unknown[];
|
|
513
|
+
readonly nodes: readonly unknown[];
|
|
514
|
+
readonly archive: readonly unknown[];
|
|
515
|
+
readonly droppedNodes: number;
|
|
516
|
+
readonly model?: string;
|
|
517
|
+
readonly provider?: string;
|
|
518
|
+
readonly contextWindow?: number;
|
|
519
|
+
};
|
|
520
|
+
/** Header snapshots for dsh-context browser (may be empty). */
|
|
521
|
+
readonly contextHeaders: {
|
|
522
|
+
readonly headers: readonly {
|
|
523
|
+
readonly seq: number;
|
|
524
|
+
readonly system?: string;
|
|
525
|
+
readonly tools: readonly unknown[];
|
|
526
|
+
}[];
|
|
527
|
+
};
|
|
528
|
+
/**
|
|
529
|
+
* Turn-end changed-files card (DSH workspace/changes). One summary per
|
|
530
|
+
* `turnId` (same-turn replace), each stamped with the announcing Face `seq`
|
|
531
|
+
* for `changes.fileDiff`.
|
|
532
|
+
*/
|
|
533
|
+
readonly workspaceChanges: readonly WorkspaceChangesProjected[];
|
|
534
|
+
}
|
|
535
|
+
interface SessionListMetadata {
|
|
536
|
+
readonly blank: boolean;
|
|
537
|
+
readonly lastPromptAt: number | null;
|
|
538
|
+
}
|
|
539
|
+
declare module "@xrkseek/session-projection" {
|
|
540
|
+
interface SessionProjectionMap extends FaceProjectionMap {}
|
|
541
|
+
}
|
|
542
|
+
type FaceProjectionRegistryOptions = SessionProjectionRegistryOptions;
|
|
543
|
+
/** Face carrier registry (same contract as the seam). */
|
|
544
|
+
type FaceProjectionRegistry = SessionProjectionRegistry;
|
|
545
|
+
declare function createFaceProjectionRegistry(options: FaceProjectionRegistryOptions): FaceProjectionRegistry;
|
|
546
|
+
//#endregion
|
|
547
|
+
//#region src/projections/units/title.d.ts
|
|
548
|
+
interface TitleProjectionState {
|
|
549
|
+
readonly title: string | null;
|
|
550
|
+
/** User rename pins — automatic fallback must not overwrite. */
|
|
551
|
+
readonly pinned: boolean;
|
|
552
|
+
}
|
|
553
|
+
declare function createTitleProjectionUnit(): ProjectionDefinition<"title", TitleProjectionState, string | null>;
|
|
554
|
+
//#endregion
|
|
555
|
+
//#region src/projections/units/session-list-metadata.d.ts
|
|
556
|
+
declare function createSessionListMetadataUnit(): ProjectionDefinition<"sessionListMetadata", SessionListMetadata, SessionListMetadata>;
|
|
557
|
+
//#endregion
|
|
558
|
+
//#region src/projections/units/image-limits.d.ts
|
|
559
|
+
/**
|
|
560
|
+
* DSH `imageLimits` constant projection (api-proxy pattern).
|
|
561
|
+
*
|
|
562
|
+
* Boot-constant: `apply` keeps the same state reference so no
|
|
563
|
+
* `session/projection` change frames are ever pushed. Baselines alone
|
|
564
|
+
* (history tail / list) carry the value for InputBar intake pre-check.
|
|
565
|
+
* Register only while an AttachmentStore is composed — absent key =
|
|
566
|
+
* attachment service not available (shell hides upload affordances).
|
|
567
|
+
*/
|
|
568
|
+
declare function createImageLimitsProjectionUnit(limits: ImageAttachmentLimits): ProjectionDefinition<"imageLimits", null, ImageAttachmentLimits>;
|
|
569
|
+
//#endregion
|
|
570
|
+
//#region src/projections/units/file-limits.d.ts
|
|
571
|
+
/**
|
|
572
|
+
* Face `fileLimits` constant projection (mirrors imageLimits).
|
|
573
|
+
*
|
|
574
|
+
* Boot-constant: `apply` keeps the same state reference so no
|
|
575
|
+
* `session/projection` change frames are ever pushed. Baselines alone
|
|
576
|
+
* (history tail / list) carry the value for InputBar intake pre-check.
|
|
577
|
+
* Register only while an AttachmentStore is composed.
|
|
578
|
+
*/
|
|
579
|
+
declare function createFileLimitsProjectionUnit(limits: FileAttachmentLimits): ProjectionDefinition<"fileLimits", null, FileAttachmentLimits>;
|
|
580
|
+
//#endregion
|
|
581
|
+
//#region src/projections/units/context-timeline.d.ts
|
|
582
|
+
/** Compaction trigger mirrored from `context/compaction.reason`. */
|
|
583
|
+
type ContextTimelineCompactReason = "auto" | "overflow" | "manual";
|
|
584
|
+
//#endregion
|
|
585
|
+
//#region src/projections/title-normalize.d.ts
|
|
586
|
+
declare function normalizeSessionTitle(input: string, maxBytes: number): string;
|
|
587
|
+
declare function fallbackSessionTitle(input: string, maxWords: number, maxBytes: number): string;
|
|
588
|
+
//#endregion
|
|
589
|
+
//#region src/projections/title-controller.d.ts
|
|
590
|
+
declare class SessionTitleInvalidError extends Error {
|
|
591
|
+
readonly name = "SessionTitleInvalidError";
|
|
592
|
+
}
|
|
593
|
+
interface TitleControllerOptions {
|
|
594
|
+
readonly maxTitleBytes?: number;
|
|
595
|
+
readonly fallbackMaxWords?: number;
|
|
596
|
+
readonly fallbackMaxBytes?: number;
|
|
597
|
+
append(sessionId: string, event: SessionEvent): SessionEvent;
|
|
598
|
+
getEvents(sessionId: string): readonly SessionEvent[];
|
|
599
|
+
readonly projections: FaceProjectionRegistry;
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Appends log-only `session/title` events (rename + first-prompt fallback).
|
|
603
|
+
* Projection units fold those events; this controller never mutates projection cells directly.
|
|
604
|
+
*/
|
|
605
|
+
declare class FaceTitleController {
|
|
606
|
+
private readonly maxTitleBytes;
|
|
607
|
+
private readonly fallbackMaxWords;
|
|
608
|
+
private readonly fallbackMaxBytes;
|
|
609
|
+
private readonly append;
|
|
610
|
+
private readonly getEvents;
|
|
611
|
+
private readonly projections;
|
|
612
|
+
constructor(options: TitleControllerOptions);
|
|
613
|
+
/** Explicit user rename — pins title; returns accepted title + Face seq. */
|
|
614
|
+
rename(sessionId: string, raw: string): {
|
|
615
|
+
title: string;
|
|
616
|
+
seq: number;
|
|
617
|
+
};
|
|
618
|
+
/**
|
|
619
|
+
* After a committed `user/message` at `messageSeq`, append fallback title
|
|
620
|
+
* iff the session still has no title event and projection title is null.
|
|
621
|
+
*/
|
|
622
|
+
maybeFallbackFromUserMessage(sessionId: string, messageSeq: number, content: string): void;
|
|
623
|
+
}
|
|
624
|
+
//#endregion
|
|
625
|
+
//#region src/projections/install-defaults.d.ts
|
|
626
|
+
interface InstallDefaultFaceProjectionsOptions {
|
|
627
|
+
/**
|
|
628
|
+
* When set, register DSH `imageLimits` (boot-constant). Omit when no
|
|
629
|
+
* AttachmentStore — shell treats missing key as no upload surface.
|
|
630
|
+
*/
|
|
631
|
+
readonly imageLimits?: ImageAttachmentLimits;
|
|
632
|
+
/**
|
|
633
|
+
* When set, register `fileLimits` (boot-constant). Usually paired with
|
|
634
|
+
* imageLimits while an AttachmentStore is composed.
|
|
635
|
+
*/
|
|
636
|
+
readonly fileLimits?: FileAttachmentLimits;
|
|
637
|
+
}
|
|
638
|
+
/** Register Face default projection units. */
|
|
639
|
+
declare function installDefaultFaceProjections(registry: FaceProjectionRegistry, options?: InstallDefaultFaceProjectionsOptions): {
|
|
640
|
+
dispose(): void;
|
|
641
|
+
};
|
|
642
|
+
//#endregion
|
|
643
|
+
//#region src/projections/list-checkpoint-cache.d.ts
|
|
644
|
+
interface FaceListProjectionCache {
|
|
645
|
+
/** Capture list-tier rows from a live registry checkpoint before eviction. */
|
|
646
|
+
remember(sessionId: string, checkpoint: ProjectionCheckpoint): void;
|
|
647
|
+
/** Wire block for a cold row, or undefined on miss / version mismatch. */
|
|
648
|
+
cachedSnapshot(sessionId: string, registry: FaceProjectionRegistry): ProjectionSnapshot | undefined;
|
|
649
|
+
/** Drop one session (optional; eviction keeps the row). */
|
|
650
|
+
forget(sessionId: string): void;
|
|
651
|
+
/** Persist to disk when a path is configured. */
|
|
652
|
+
flush(): void;
|
|
653
|
+
}
|
|
654
|
+
//#endregion
|
|
655
|
+
//#region src/plugin-inventory.d.ts
|
|
656
|
+
/** DSH `pluginInventory/list` fiber phase. */
|
|
657
|
+
type FacePluginFiberPhase = "pending" | "loading" | "active" | "failed" | "unloading" | null;
|
|
658
|
+
interface FacePluginInventoryEntry {
|
|
659
|
+
readonly entryId: string;
|
|
660
|
+
readonly moduleName: string;
|
|
661
|
+
readonly enabled: boolean;
|
|
662
|
+
readonly fiberPhase: FacePluginFiberPhase;
|
|
663
|
+
/**
|
|
664
|
+
* User-installed (CLI inventory / community cordis) — Settings may offer
|
|
665
|
+
* edit / disable / delete. Built-in product-shell and MCP rows stay false.
|
|
666
|
+
*/
|
|
667
|
+
readonly managed: boolean;
|
|
668
|
+
/** CLI inventory version when known (Codex-style plugin summary). */
|
|
669
|
+
readonly version?: string;
|
|
670
|
+
/** `client` | `process` | `both` | `mcp` | `cordis` | `builtin`. */
|
|
671
|
+
readonly kind?: string;
|
|
672
|
+
/** Original `plugin add` spec when managed. */
|
|
673
|
+
readonly source?: string;
|
|
674
|
+
/**
|
|
675
|
+
* Soft-disable / re-enable / install changed disk state but this Host
|
|
676
|
+
* process still has the opposite live set — restart to apply.
|
|
677
|
+
*/
|
|
678
|
+
readonly needsRestart?: boolean;
|
|
679
|
+
}
|
|
680
|
+
interface FaceWebPlugin {
|
|
681
|
+
readonly id: string;
|
|
682
|
+
readonly moduleName?: string;
|
|
683
|
+
}
|
|
684
|
+
interface FacePluginCommandResult {
|
|
685
|
+
readonly kind: "success" | "error";
|
|
686
|
+
readonly text?: string;
|
|
687
|
+
}
|
|
688
|
+
interface FacePluginCommand {
|
|
689
|
+
readonly name: string;
|
|
690
|
+
readonly description: string;
|
|
691
|
+
readonly input?: {
|
|
692
|
+
readonly hint: string;
|
|
693
|
+
};
|
|
694
|
+
readonly handler: (ctx: {
|
|
695
|
+
sessionId: string;
|
|
696
|
+
rawInput: string;
|
|
697
|
+
commandId: string;
|
|
698
|
+
}) => FacePluginCommandResult | Promise<FacePluginCommandResult>;
|
|
699
|
+
}
|
|
700
|
+
/** Process plugin snapshot Face reads for inventory + slash. */
|
|
701
|
+
interface FaceProcessPlugin {
|
|
702
|
+
readonly id: string;
|
|
703
|
+
readonly kind: string;
|
|
704
|
+
readonly commands?: readonly FacePluginCommand[];
|
|
705
|
+
/** `kind: tools` contributions — Face `viewFor` standing lookup. */
|
|
706
|
+
readonly tools?: readonly ToolDefinition[];
|
|
707
|
+
/** `kind: channel` IM / notification descriptors (process plugin discover). */
|
|
708
|
+
readonly channels?: readonly {
|
|
709
|
+
readonly channelId: string;
|
|
710
|
+
readonly displayName?: string;
|
|
711
|
+
}[];
|
|
712
|
+
/** MCP supervisor health (Host `mcp:*` plugins). */
|
|
713
|
+
readonly mcpHealth?: "connected" | "reconnecting" | "gave-up";
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* Managed plugins root: Host `pluginsDir` (incl. `XRK_PLUGINS_DIR`) wins;
|
|
717
|
+
* otherwise `{harnessHome}/plugins`.
|
|
718
|
+
*/
|
|
719
|
+
declare function resolveManagedPluginsDir(runtime: Pick<FaceRuntime, "productDir" | "hostPublic">): string;
|
|
720
|
+
/**
|
|
721
|
+
* Reinstall/update spec: keep registry / github sources; local path installs
|
|
722
|
+
* are cwd-sensitive after Host restart → fall back to `name@latest`.
|
|
723
|
+
*/
|
|
724
|
+
declare function resolveManagedPluginUpdateSpec(entryId: string, source: string | undefined): string;
|
|
725
|
+
/** Absolute install directory for a managed plugin, if it exists on disk. */
|
|
726
|
+
declare function resolveManagedPluginDir(runtime: Pick<FaceRuntime, "productDir" | "hostPublic">, entryId: string, moduleName?: string): string | undefined;
|
|
727
|
+
/**
|
|
728
|
+
* Rewrite `{pluginsDir}/web/boot.json` from inventory client rows.
|
|
729
|
+
* Delegates to shared {@link reconcileClientBootAt} (stable rev · atomic write).
|
|
730
|
+
*/
|
|
731
|
+
declare function reconcileManagedClientBoot(runtime: Pick<FaceRuntime, "productDir" | "hostPublic">): void;
|
|
732
|
+
/**
|
|
733
|
+
* Host process plugins first (user-managed sorted ahead), then product-shell
|
|
734
|
+
* boot entries, then CLI inventory packages missing from live boot.
|
|
735
|
+
*
|
|
736
|
+
* Soft-disabled client packages are dropped from `web/boot.json` (and thus from
|
|
737
|
+
* Host `webPlugins`) so they do not load — but Settings must still list them
|
|
738
|
+
* from `.xrk-plugins.json`, otherwise there is no row to re-enable.
|
|
739
|
+
*/
|
|
740
|
+
declare function listFacePluginInventory(runtime: Pick<FaceRuntime, "plugins" | "webPlugins" | "hostPublic" | "productDir">): FacePluginInventoryEntry[];
|
|
741
|
+
//#endregion
|
|
742
|
+
//#region src/slash.d.ts
|
|
743
|
+
type SlashRecipesLoader = () => Promise<readonly Recipe[]> | readonly Recipe[];
|
|
744
|
+
//#endregion
|
|
745
|
+
//#region src/settings-credentials.d.ts
|
|
746
|
+
/** Fill empty vault slots from the OS keyring / memory SecretStore when available. */
|
|
747
|
+
declare function hydrateCredentialsFromSecretStore(runtime: FaceRuntime): Promise<void>;
|
|
748
|
+
type UiTheme = "system" | "light" | "dark";
|
|
749
|
+
interface FaceUiSettings {
|
|
750
|
+
theme: UiTheme;
|
|
751
|
+
locale: string;
|
|
752
|
+
}
|
|
753
|
+
interface FaceHostPublicSettings {
|
|
754
|
+
readonly host: string;
|
|
755
|
+
readonly port: number;
|
|
756
|
+
readonly workspaceRoot: string;
|
|
757
|
+
readonly preset: string;
|
|
758
|
+
readonly corsOrigin: string;
|
|
759
|
+
readonly rateLimitPerMinute: number;
|
|
760
|
+
readonly pluginsDir?: string;
|
|
761
|
+
readonly webDistConfigured: boolean;
|
|
762
|
+
/** Community packages whose `host.mjs` apply succeeded via dsh-compat. */
|
|
763
|
+
readonly cordisHostApplied?: readonly string[];
|
|
764
|
+
/** Per-package RPC channels from successful host.mjs apply. */
|
|
765
|
+
readonly cordisHostPackages?: readonly {
|
|
766
|
+
readonly packageName: string;
|
|
767
|
+
readonly rpcChannels: readonly string[];
|
|
768
|
+
}[];
|
|
769
|
+
/** Process `kind: channel` rows wired on Host spawn (inventory). */
|
|
770
|
+
readonly processChannels?: readonly {
|
|
771
|
+
readonly pluginId: string;
|
|
772
|
+
readonly channelId: string;
|
|
773
|
+
readonly displayName?: string;
|
|
774
|
+
}[];
|
|
775
|
+
/**
|
|
776
|
+
* Cordis WorkflowEngine Host default (Isolating + Face createAgent + tools.*).
|
|
777
|
+
* Full sandboxed Node PTC process confinement is not claimed.
|
|
778
|
+
*/
|
|
779
|
+
readonly workflowEngine?: {
|
|
780
|
+
readonly provider: "isolating";
|
|
781
|
+
readonly createAgentBridged: true;
|
|
782
|
+
readonly toolsBridged: boolean;
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
interface FaceCordisHostBridge {
|
|
786
|
+
readonly applyHostHalf?: (packageName: string) => Promise<{
|
|
787
|
+
readonly ok: boolean;
|
|
788
|
+
readonly message?: string;
|
|
789
|
+
}>;
|
|
790
|
+
readonly invokeRpc?: (channel: string, endpoint: string, payload: Record<string, unknown>) => Promise<unknown>;
|
|
791
|
+
readonly stopHostHalf?: (packageName: string) => Promise<void>;
|
|
792
|
+
}
|
|
793
|
+
interface CredentialSlotView {
|
|
794
|
+
readonly id: string;
|
|
795
|
+
readonly label: string;
|
|
796
|
+
readonly envVar?: string;
|
|
797
|
+
/** True if env or in-memory vault has a non-empty value. Never returns the value. */
|
|
798
|
+
readonly configured: boolean;
|
|
799
|
+
readonly source: "env" | "vault" | "file" | "none";
|
|
800
|
+
}
|
|
801
|
+
declare function defaultUiSettings(): FaceUiSettings;
|
|
802
|
+
declare class FaceCredentialVault {
|
|
803
|
+
private readonly overrides;
|
|
804
|
+
/** Values loaded from `.credentials.yaml` (reported as `source: file`). */
|
|
805
|
+
private readonly fileBacked;
|
|
806
|
+
peek(slotId: string): string | undefined;
|
|
807
|
+
hasOverride(slotId: string): boolean;
|
|
808
|
+
isFileBacked(slotId: string): boolean;
|
|
809
|
+
setFromFile(slotId: string, value: string): void;
|
|
810
|
+
set(slotId: string, value: string | null): void;
|
|
811
|
+
listFileBackedSlots(): {
|
|
812
|
+
slotId: string;
|
|
813
|
+
value: string | null;
|
|
814
|
+
}[];
|
|
815
|
+
/** Every in-memory override eligible for `.credentials.yaml` persistence. */
|
|
816
|
+
listPersistedSlots(): {
|
|
817
|
+
slotId: string;
|
|
818
|
+
value: string | null;
|
|
819
|
+
}[];
|
|
820
|
+
/** Test / diagnostics — never expose via Face RPC. */
|
|
821
|
+
size(): number;
|
|
822
|
+
}
|
|
823
|
+
declare function listCredentialSlots(runtime: FaceRuntime, env?: NodeJS.ProcessEnv): CredentialSlotView[];
|
|
824
|
+
/** Effective Host API key: vault override wins, else bootstrap env/config value. */
|
|
825
|
+
declare function effectiveHostApiKey(runtime: FaceRuntime): string;
|
|
826
|
+
declare function settingsGet(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
827
|
+
declare function settingsSet(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
828
|
+
declare function credentialsList(runtime: FaceRuntime): Promise<FaceRpcResult<unknown>>;
|
|
829
|
+
/** Face `credentials.describe({ refs })` — never returns secret values. */
|
|
830
|
+
declare function credentialsDescribe(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
831
|
+
declare function credentialsSet(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
832
|
+
/** Face `credentials.unset({ ref })` → empty object. */
|
|
833
|
+
declare function credentialsUnset(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
834
|
+
/** Face SettingsNamespaceView (minimal fields the product shell reads). */
|
|
835
|
+
interface FaceSettingsNamespaceView {
|
|
836
|
+
readonly ns: string;
|
|
837
|
+
readonly schema: unknown;
|
|
838
|
+
readonly value: unknown;
|
|
839
|
+
readonly base?: unknown;
|
|
840
|
+
readonly user?: unknown;
|
|
841
|
+
readonly applies: "live" | "restart";
|
|
842
|
+
readonly secrets: readonly {
|
|
843
|
+
readonly path: string[];
|
|
844
|
+
readonly set: boolean;
|
|
845
|
+
}[];
|
|
846
|
+
readonly revision: number;
|
|
847
|
+
}
|
|
848
|
+
type FaceSettingsPathOp = {
|
|
849
|
+
readonly op: "set";
|
|
850
|
+
readonly path: string[];
|
|
851
|
+
readonly value: unknown;
|
|
852
|
+
} | {
|
|
853
|
+
readonly op: "unset";
|
|
854
|
+
readonly path: string[];
|
|
855
|
+
};
|
|
856
|
+
/**
|
|
857
|
+
* Process-memory settings namespaces for Face (welcome notice, etc.).
|
|
858
|
+
* Most ns stay in memory; `mcp.servers` also persist to host-settings.json
|
|
859
|
+
* (and live-remount when Host wires `syncMcpServers`).
|
|
860
|
+
*/
|
|
861
|
+
declare class FaceSettingsNamespaces {
|
|
862
|
+
private readonly map;
|
|
863
|
+
ensure(ns: string): {
|
|
864
|
+
user: Record<string, unknown>;
|
|
865
|
+
revision: number;
|
|
866
|
+
base: Record<string, unknown>;
|
|
867
|
+
schema: unknown;
|
|
868
|
+
applies: "live" | "restart";
|
|
869
|
+
};
|
|
870
|
+
view(ns: string, base?: Record<string, unknown>, schema?: unknown, applies?: "live" | "restart"): FaceSettingsNamespaceView;
|
|
871
|
+
mutate(ns: string, ops: readonly FaceSettingsPathOp[], expectedRevision?: number): {
|
|
872
|
+
ok: true;
|
|
873
|
+
view: FaceSettingsNamespaceView;
|
|
874
|
+
} | {
|
|
875
|
+
ok: false;
|
|
876
|
+
code: string;
|
|
877
|
+
message: string;
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
interface FaceMcpServerDraft {
|
|
881
|
+
readonly serverName: string;
|
|
882
|
+
readonly command?: string;
|
|
883
|
+
readonly url?: string;
|
|
884
|
+
readonly args?: readonly string[];
|
|
885
|
+
readonly cwd?: string;
|
|
886
|
+
/** Required when `cwd` resolves under the Host workspace. */
|
|
887
|
+
readonly cwdAllowWorkspace?: boolean;
|
|
888
|
+
/** Proxy-only env (HTTP_PROXY / …); secrets stay in Credentials. */
|
|
889
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
890
|
+
}
|
|
891
|
+
/** Parse Face/host-settings MCP drafts. Proxy env kept; other env keys rejected. */
|
|
892
|
+
declare function parseFaceMcpServers(raw: unknown): FaceMcpServerDraft[];
|
|
893
|
+
/** Face `settings.describe` — namespaces[] for welcome / forms. */
|
|
894
|
+
declare function settingsDescribeFace(runtime: FaceRuntime): Promise<FaceRpcResult<unknown>>;
|
|
895
|
+
/** Face `settings.mutate` — path ops (welcome notice ack). */
|
|
896
|
+
declare function settingsMutateFace(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
897
|
+
/** Face `settings.update` — merge patch into namespace user layer. */
|
|
898
|
+
declare function settingsUpdateFace(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
899
|
+
/** Face `settings.replace` — replace entire user section for ns. */
|
|
900
|
+
declare function settingsReplaceFace(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
901
|
+
/** Slash `/mcp` inventory text (desired servers + live mount status). */
|
|
902
|
+
declare function formatMcpInventoryText(runtime: FaceRuntime, options?: {
|
|
903
|
+
readonly verbose?: boolean;
|
|
904
|
+
}): string;
|
|
905
|
+
/** Test helper — clear host-settings last-good cache. */
|
|
906
|
+
declare function resetLastGoodHostMcpCache(): void;
|
|
907
|
+
/** Load `~/.xrk/host-settings.json` mcp.servers (+ allowConnect) into the namespace user layer. */
|
|
908
|
+
declare function hydrateFaceHostSettings(runtime: FaceRuntime): void;
|
|
909
|
+
/**
|
|
910
|
+
* Face pathless `settings.openDocument`.
|
|
911
|
+
* Wire value is only `{ opened: true }` (DSH schema); non-desktop → NI.
|
|
912
|
+
*/
|
|
913
|
+
declare function settingsOpenDocument(runtime: FaceRuntime): Promise<FaceRpcResult<{
|
|
914
|
+
opened: true;
|
|
915
|
+
}>>;
|
|
916
|
+
//#endregion
|
|
917
|
+
//#region src/approval-category.d.ts
|
|
918
|
+
/**
|
|
919
|
+
* Classify human-approval asks for UX (Codex network vs escalation vs tool).
|
|
920
|
+
* Heuristic only — never a security boundary by itself.
|
|
921
|
+
*/
|
|
922
|
+
type ApprovalCategory = "tool" | "network" | "escalation";
|
|
923
|
+
type NetworkApprovalProtocol = "http" | "https" | "ws" | "wss" | "other";
|
|
924
|
+
interface NetworkApprovalContext {
|
|
925
|
+
readonly host: string;
|
|
926
|
+
readonly protocol: NetworkApprovalProtocol;
|
|
927
|
+
}
|
|
928
|
+
interface ApprovalClassification {
|
|
929
|
+
readonly category: ApprovalCategory;
|
|
930
|
+
readonly network?: NetworkApprovalContext;
|
|
931
|
+
}
|
|
932
|
+
/** Best-effort URL/host extraction from tool args or summaries. */
|
|
933
|
+
declare function extractNetworkContext(args: unknown): NetworkApprovalContext | undefined;
|
|
934
|
+
/**
|
|
935
|
+
* Map tool / host-gate name + args onto an approval UX category.
|
|
936
|
+
*/
|
|
937
|
+
declare function classifyApproval(input: {
|
|
938
|
+
readonly toolName: string;
|
|
939
|
+
readonly args?: unknown;
|
|
940
|
+
readonly reason?: string;
|
|
941
|
+
}): ApprovalClassification;
|
|
942
|
+
//#endregion
|
|
943
|
+
//#region src/approvals.d.ts
|
|
944
|
+
type ApprovalOutcomeWire = "allowed-once" | "rejected" | "cancelled" | "unavailable";
|
|
945
|
+
interface PendingApprovalItem {
|
|
946
|
+
/** Stable server-request rpcId for product-shell `/api/respond`. */
|
|
947
|
+
readonly rpcId: string;
|
|
948
|
+
readonly approvalId: string;
|
|
949
|
+
readonly sessionId: string;
|
|
950
|
+
readonly toolCallId: string;
|
|
951
|
+
readonly toolName: string;
|
|
952
|
+
readonly reason: string;
|
|
953
|
+
readonly askedAt: number;
|
|
954
|
+
readonly argsSummary?: string;
|
|
955
|
+
/** UX category: ordinary tool · network · sandbox escalation. */
|
|
956
|
+
readonly category: ApprovalCategory;
|
|
957
|
+
readonly network?: NetworkApprovalContext;
|
|
958
|
+
}
|
|
959
|
+
interface FaceApprovalHooks {
|
|
960
|
+
onRequested(item: PendingApprovalItem): void;
|
|
961
|
+
onResolved(sessionId: string, approvalId: string, outcome: ApprovalOutcomeWire): void;
|
|
962
|
+
}
|
|
963
|
+
type PermissionRequestGate = (args: {
|
|
964
|
+
readonly toolName: string;
|
|
965
|
+
readonly toolInput?: unknown;
|
|
966
|
+
readonly toolUseId?: string;
|
|
967
|
+
readonly category?: string;
|
|
968
|
+
readonly signal?: AbortSignal;
|
|
969
|
+
}) => Promise<PermissionRequestDecision | undefined>;
|
|
970
|
+
declare class FaceApprovalBroker {
|
|
971
|
+
private readonly store;
|
|
972
|
+
private readonly hooks;
|
|
973
|
+
private readonly waiters;
|
|
974
|
+
private readonly byRpcId;
|
|
975
|
+
private permissionGate;
|
|
976
|
+
constructor(store: SessionStore, hooks: FaceApprovalHooks);
|
|
977
|
+
/** Optional Claude/Codex PermissionRequest hooks (run before the human UI). */
|
|
978
|
+
setPermissionRequestGate(gate: PermissionRequestGate | undefined): void;
|
|
979
|
+
listPending(sessionId?: string): readonly PendingApprovalItem[];
|
|
980
|
+
/**
|
|
981
|
+
* Host sidebar / Office policy `ask` — synthetic tool name so the existing
|
|
982
|
+
* approval UI / `/api/respond` path works without a live tool call.
|
|
983
|
+
*/
|
|
984
|
+
requestHostGate(sessionId: string, gate: {
|
|
985
|
+
readonly kind: string;
|
|
986
|
+
readonly reason: string;
|
|
987
|
+
readonly summary?: string;
|
|
988
|
+
}, signal?: AbortSignal): Promise<boolean>;
|
|
989
|
+
/** Pipeline `ApprovalHandler` bound to a session. */
|
|
990
|
+
handlerFor(sessionId: string): ApprovalHandler;
|
|
991
|
+
request(sessionId: string, ctx: Pick<ToolPipelineContext, "call" | "args" | "signal">, reason: string): Promise<boolean>;
|
|
992
|
+
respond(sessionId: string, approvalId: string, decision: "allow" | "deny"): {
|
|
993
|
+
readonly ok: true;
|
|
994
|
+
} | {
|
|
995
|
+
readonly ok: false;
|
|
996
|
+
readonly code: string;
|
|
997
|
+
readonly message: string;
|
|
998
|
+
};
|
|
999
|
+
/**
|
|
1000
|
+
* Settle via DSH `POST /api/respond` (rpcId correlation).
|
|
1001
|
+
* @returns receipt shape consumed by the Web client.
|
|
1002
|
+
*/
|
|
1003
|
+
respondByRpcId(rpcId: string, value: unknown): FaceRpcReceipt;
|
|
1004
|
+
private decide;
|
|
1005
|
+
}
|
|
1006
|
+
/** mux `approval/requested` 载荷(rpcId 走 bus/信封,不在 payload 里)。 */
|
|
1007
|
+
declare function approvalRequestedFrame(item: PendingApprovalItem): Extract<MuxFrame, {
|
|
1008
|
+
type: "approval/requested";
|
|
1009
|
+
}>;
|
|
1010
|
+
declare function approvalResolvedFrame(sessionId: string, approvalId: string, outcome: ApprovalOutcomeWire): Extract<MuxFrame, {
|
|
1011
|
+
type: "approval/resolved";
|
|
1012
|
+
}>;
|
|
1013
|
+
//#endregion
|
|
1014
|
+
//#region src/questions.d.ts
|
|
1015
|
+
declare class FaceQuestionError extends Error {
|
|
1016
|
+
readonly code: "ASK_CANCELLED" | "ASK_ABORTED" | "EMPTY_QUESTIONS";
|
|
1017
|
+
constructor(message: string, code: "ASK_CANCELLED" | "ASK_ABORTED" | "EMPTY_QUESTIONS");
|
|
1018
|
+
}
|
|
1019
|
+
interface PendingQuestionItem {
|
|
1020
|
+
readonly rpcId: string;
|
|
1021
|
+
readonly sessionId: string;
|
|
1022
|
+
readonly questions: readonly FaceQuestionItem[];
|
|
1023
|
+
}
|
|
1024
|
+
interface FaceQuestionHooks {
|
|
1025
|
+
onRequested(item: PendingQuestionItem): void;
|
|
1026
|
+
onResolved(sessionId: string, questionRpcId: string, outcome: "answered" | "cancelled"): void;
|
|
1027
|
+
}
|
|
1028
|
+
declare function formatQuestionAnswer(answer: FaceQuestionAnswer): string;
|
|
1029
|
+
declare class FaceQuestionBroker {
|
|
1030
|
+
private readonly hooks;
|
|
1031
|
+
private readonly waiters;
|
|
1032
|
+
constructor(hooks: FaceQuestionHooks);
|
|
1033
|
+
listPending(sessionId?: string): readonly PendingQuestionItem[];
|
|
1034
|
+
hasRpcId(rpcId: string): boolean;
|
|
1035
|
+
ask(sessionId: string, questions: readonly FaceQuestionItem[], signal?: AbortSignal): Promise<FaceQuestionAnswer>;
|
|
1036
|
+
askText(sessionId: string, question: string, signal?: AbortSignal): Promise<string>;
|
|
1037
|
+
/**
|
|
1038
|
+
* DSH `/api/respond` after approvals miss. `result` is the client-response
|
|
1039
|
+
* `result` object (`ok` + `value` or `error`).
|
|
1040
|
+
*/
|
|
1041
|
+
respondByRpcId(rpcId: string, result: unknown): FaceRpcReceipt;
|
|
1042
|
+
private claim;
|
|
1043
|
+
}
|
|
1044
|
+
declare function questionRequestedFrame(item: PendingQuestionItem): Extract<MuxFrame, {
|
|
1045
|
+
type: "question/requested";
|
|
1046
|
+
}>;
|
|
1047
|
+
declare function questionResolvedFrame(sessionId: string, questionRpcId: string, outcome: "answered" | "cancelled"): Extract<MuxFrame, {
|
|
1048
|
+
type: "question/resolved";
|
|
1049
|
+
}>;
|
|
1050
|
+
/**
|
|
1051
|
+
* Coerce `ask_user` args to DSH `AskUserQuestionItem[]`.
|
|
1052
|
+
* Accepts free-text `{ question }` or `{ questions: [...] }` (`multi_select` → multiSelect).
|
|
1053
|
+
*/
|
|
1054
|
+
declare function coerceAskUserQuestions(args: unknown): FaceQuestionItem[] | undefined;
|
|
1055
|
+
/** Point `ask_user` execute at Face questions (DSH web provider). */
|
|
1056
|
+
declare function bindAskUserTool(tools: ToolRegistry, ask: (questions: readonly FaceQuestionItem[], signal?: AbortSignal) => Promise<string>): void;
|
|
1057
|
+
/** Point `exit_plan_mode` at Face questions + session fold. Always registered. */
|
|
1058
|
+
declare function bindExitPlanModeTool(tools: ToolRegistry, store: SessionStore, sessionId: string, ask: (questions: readonly FaceQuestionItem[], signal?: AbortSignal) => Promise<FaceQuestionAnswer>): void;
|
|
1059
|
+
//#endregion
|
|
1060
|
+
//#region src/workspace-registry.d.ts
|
|
1061
|
+
/**
|
|
1062
|
+
* Workspace registry for Face (list/create/rename/archive).
|
|
1063
|
+
* Persists to `{harnessHome}/workspaces.json` via workspace-store.
|
|
1064
|
+
*/
|
|
1065
|
+
interface FaceWorkspaceView {
|
|
1066
|
+
readonly workspaceId: string;
|
|
1067
|
+
readonly path: string;
|
|
1068
|
+
title: string;
|
|
1069
|
+
readonly sessionIds: string[];
|
|
1070
|
+
readonly createdAt: string;
|
|
1071
|
+
updatedAt: string;
|
|
1072
|
+
}
|
|
1073
|
+
declare class FaceWorkspaceRegistry {
|
|
1074
|
+
private readonly root;
|
|
1075
|
+
private readonly workspaces;
|
|
1076
|
+
private readonly order;
|
|
1077
|
+
private readonly membership;
|
|
1078
|
+
/** workspaceId → session ids in sidebar order. */
|
|
1079
|
+
private readonly sessionOrder;
|
|
1080
|
+
private readonly archived;
|
|
1081
|
+
/** Registry-global pin order (newest pin first). Mutually exclusive with archive. */
|
|
1082
|
+
private pinned;
|
|
1083
|
+
private seq;
|
|
1084
|
+
constructor(root: string);
|
|
1085
|
+
defaultId(): string;
|
|
1086
|
+
/** Live (non-archived) workspace owning this session, if any. */
|
|
1087
|
+
workspaceIdOf(sessionId: string): string | undefined;
|
|
1088
|
+
get(workspaceId: string): Omit<FaceWorkspaceView, "sessionIds"> | undefined;
|
|
1089
|
+
findByPath(absPath: string): Omit<FaceWorkspaceView, "sessionIds"> | undefined;
|
|
1090
|
+
attachSession(sessionId: string, workspaceId: string): FaceWorkspaceView | undefined;
|
|
1091
|
+
/** Resolve workspaceId or adopt/create by cwd path. */
|
|
1092
|
+
resolveAttachTarget(opts: {
|
|
1093
|
+
workspaceId?: string;
|
|
1094
|
+
cwd?: string;
|
|
1095
|
+
}): {
|
|
1096
|
+
workspaceId?: string;
|
|
1097
|
+
cwd: string;
|
|
1098
|
+
} | {
|
|
1099
|
+
error: string;
|
|
1100
|
+
};
|
|
1101
|
+
create(absPath: string): {
|
|
1102
|
+
workspace: FaceWorkspaceView;
|
|
1103
|
+
created: boolean;
|
|
1104
|
+
};
|
|
1105
|
+
rename(workspaceId: string, title: string): FaceWorkspaceView | undefined;
|
|
1106
|
+
/**
|
|
1107
|
+
* Archive one session into the registry-global set. Membership and sidebar
|
|
1108
|
+
* order stay so a later unarchive restores the same workspace slot (dsh
|
|
1109
|
+
* parity). Already-archived ids are idempotent. Pin and archive are
|
|
1110
|
+
* mutually exclusive — archive drops any pin (DSH parity).
|
|
1111
|
+
*/
|
|
1112
|
+
archiveSession(sessionId: string): {
|
|
1113
|
+
archivedSessionIds: string[];
|
|
1114
|
+
pinnedSessionIds: string[];
|
|
1115
|
+
};
|
|
1116
|
+
/**
|
|
1117
|
+
* Drop one session from the archive set. Accounting was never cleared on
|
|
1118
|
+
* archive, so the session reappears in its recorded workspace order. An id
|
|
1119
|
+
* that is not archived resolves without writing.
|
|
1120
|
+
*/
|
|
1121
|
+
unarchiveSession(sessionId: string): string[];
|
|
1122
|
+
/**
|
|
1123
|
+
* Pin one session to the front of the registry-global pin order (newest
|
|
1124
|
+
* first). Unarchives first when needed so pin and archive stay exclusive.
|
|
1125
|
+
*/
|
|
1126
|
+
pinSession(sessionId: string): {
|
|
1127
|
+
archivedSessionIds: string[];
|
|
1128
|
+
pinnedSessionIds: string[];
|
|
1129
|
+
};
|
|
1130
|
+
/**
|
|
1131
|
+
* Drop one session from the pin order. Unknown ids resolve without writing.
|
|
1132
|
+
*/
|
|
1133
|
+
unpinSession(sessionId: string): string[];
|
|
1134
|
+
/**
|
|
1135
|
+
* Remove one workspace registration (including the bootstrap default).
|
|
1136
|
+
* Sessions lose their accounting slot and appear under Ungrouped; logs and
|
|
1137
|
+
* directories stay untouched.
|
|
1138
|
+
*/
|
|
1139
|
+
delete(workspaceId: string): {
|
|
1140
|
+
ok: true;
|
|
1141
|
+
movedSessionIds: string[];
|
|
1142
|
+
} | {
|
|
1143
|
+
ok: false;
|
|
1144
|
+
reason: string;
|
|
1145
|
+
};
|
|
1146
|
+
/** Reorder workspaces so `workspaceId` sits immediately before `beforeId`. */
|
|
1147
|
+
insertBefore(workspaceId: string, beforeId: string): FaceWorkspaceView[] | undefined;
|
|
1148
|
+
/**
|
|
1149
|
+
* Reorder (and optionally move) a session so it sits before `beforeSessionId`.
|
|
1150
|
+
* Both must be live (not archived).
|
|
1151
|
+
*/
|
|
1152
|
+
insertSessionBefore(sessionId: string, beforeSessionId: string): FaceWorkspaceView | undefined;
|
|
1153
|
+
list(allSessionIds: readonly string[]): {
|
|
1154
|
+
items: FaceWorkspaceView[];
|
|
1155
|
+
archivedSessionIds: string[];
|
|
1156
|
+
pinnedSessionIds: string[];
|
|
1157
|
+
};
|
|
1158
|
+
private removeFromOrder;
|
|
1159
|
+
private view;
|
|
1160
|
+
exportState(): {
|
|
1161
|
+
order: string[];
|
|
1162
|
+
entries: Record<string, {
|
|
1163
|
+
path: string;
|
|
1164
|
+
title: string;
|
|
1165
|
+
createdAt: string;
|
|
1166
|
+
updatedAt: string;
|
|
1167
|
+
}>;
|
|
1168
|
+
seq: number;
|
|
1169
|
+
membership: Record<string, string>;
|
|
1170
|
+
sessionOrder: Record<string, string[]>;
|
|
1171
|
+
archivedSessionIds: string[];
|
|
1172
|
+
pinnedSessionIds: string[];
|
|
1173
|
+
};
|
|
1174
|
+
/** All live session → workspace bindings. */
|
|
1175
|
+
listMembership(): readonly (readonly [string, string])[];
|
|
1176
|
+
importState(doc: {
|
|
1177
|
+
order: readonly string[];
|
|
1178
|
+
entries: Readonly<Record<string, {
|
|
1179
|
+
path: string;
|
|
1180
|
+
title: string;
|
|
1181
|
+
createdAt: string;
|
|
1182
|
+
updatedAt: string;
|
|
1183
|
+
}>>;
|
|
1184
|
+
seq: number;
|
|
1185
|
+
membership?: Readonly<Record<string, string>>;
|
|
1186
|
+
sessionOrder?: Readonly<Record<string, readonly string[]>>;
|
|
1187
|
+
archivedSessionIds?: readonly string[];
|
|
1188
|
+
pinnedSessionIds?: readonly string[];
|
|
1189
|
+
}, fallbackRoot: string): void;
|
|
1190
|
+
}
|
|
1191
|
+
//#endregion
|
|
1192
|
+
//#region src/subagent-registry.d.ts
|
|
1193
|
+
type SubagentMode = "one-shot" | "continuable" | "fork";
|
|
1194
|
+
interface FaceSubagentLink {
|
|
1195
|
+
readonly parentSessionId: string;
|
|
1196
|
+
readonly childSessionId: string;
|
|
1197
|
+
readonly mode: SubagentMode;
|
|
1198
|
+
readonly label: string;
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* Parent → direct children. Optional JSON sidecar for JSONL session dir.
|
|
1202
|
+
* Does not invent session events.
|
|
1203
|
+
*/
|
|
1204
|
+
declare class FaceSubagentRegistry {
|
|
1205
|
+
private readonly hooks?;
|
|
1206
|
+
private readonly byParent;
|
|
1207
|
+
private readonly byChild;
|
|
1208
|
+
private readonly persistPath;
|
|
1209
|
+
constructor(persistPath?: string, hooks?: {
|
|
1210
|
+
onAttach?: (link: FaceSubagentLink) => void;
|
|
1211
|
+
/** Observe-only: child stretch idle / one-shot settle (shell SubagentStop). */
|
|
1212
|
+
onStop?: (link: FaceSubagentLink) => void;
|
|
1213
|
+
} | undefined);
|
|
1214
|
+
getByChild(childSessionId: string): FaceSubagentLink | undefined;
|
|
1215
|
+
get(parentSessionId: string, childSessionId: string): FaceSubagentLink | undefined;
|
|
1216
|
+
list(parentSessionId: string): readonly FaceSubagentLink[];
|
|
1217
|
+
entries(): readonly FaceSubagentLink[];
|
|
1218
|
+
/** Tool-delegated children only (excludes UI/rewind `fork` lineage). */
|
|
1219
|
+
listDelegated(parentSessionId: string): readonly FaceSubagentLink[];
|
|
1220
|
+
hasChildren(sessionId: string): boolean;
|
|
1221
|
+
hasDelegatedChildren(sessionId: string): boolean;
|
|
1222
|
+
attach(link: FaceSubagentLink): FaceSubagentLink;
|
|
1223
|
+
/** Fire SubagentStop observers (idempotent callers should gate themselves). */
|
|
1224
|
+
notifyStop(link: FaceSubagentLink): void;
|
|
1225
|
+
private load;
|
|
1226
|
+
private save;
|
|
1227
|
+
}
|
|
1228
|
+
//#endregion
|
|
1229
|
+
//#region src/external-agent-runtime.d.ts
|
|
1230
|
+
type ExternalAgentKind = "acp" | "app-server" | "claude-code";
|
|
1231
|
+
type ExternalSpawn = typeof spawn;
|
|
1232
|
+
/** Face `external-agent` product (Settings → Plugins). */
|
|
1233
|
+
interface ExternalAgentProductConfig {
|
|
1234
|
+
readonly acpAgent?: string;
|
|
1235
|
+
readonly codexAppServer?: string;
|
|
1236
|
+
readonly claudeCode?: string;
|
|
1237
|
+
}
|
|
1238
|
+
interface RunExternalAgentOptions {
|
|
1239
|
+
readonly kind: ExternalAgentKind;
|
|
1240
|
+
readonly cwd: string;
|
|
1241
|
+
readonly prompt: string;
|
|
1242
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
1243
|
+
readonly product?: ExternalAgentProductConfig;
|
|
1244
|
+
readonly signal?: AbortSignal;
|
|
1245
|
+
readonly spawnImpl?: ExternalSpawn;
|
|
1246
|
+
}
|
|
1247
|
+
declare class ExternalAgentError extends Error {
|
|
1248
|
+
readonly code: string;
|
|
1249
|
+
constructor(message: string, code?: string);
|
|
1250
|
+
}
|
|
1251
|
+
declare function resolveExternalAgentLaunch(kind: ExternalAgentKind, env: NodeJS.ProcessEnv, prompt: string, product?: ExternalAgentProductConfig): {
|
|
1252
|
+
command: string;
|
|
1253
|
+
args: string[];
|
|
1254
|
+
protocol: "acp" | "app-server" | "print";
|
|
1255
|
+
};
|
|
1256
|
+
/** Normalize Face `external-agent` section into launch product fields. */
|
|
1257
|
+
declare function parseExternalAgentProduct(raw: unknown): ExternalAgentProductConfig | undefined;
|
|
1258
|
+
/**
|
|
1259
|
+
* Hand one prompt to an external agent subprocess.
|
|
1260
|
+
* Does not create an in-process child session.
|
|
1261
|
+
*/
|
|
1262
|
+
declare function runExternalAgentTurn(options: RunExternalAgentOptions): Promise<{
|
|
1263
|
+
readonly text: string;
|
|
1264
|
+
readonly kind: ExternalAgentKind;
|
|
1265
|
+
}>;
|
|
1266
|
+
declare function parseExternalAgentKind(raw: unknown): ExternalAgentKind | "in-process" | undefined;
|
|
1267
|
+
/** ACP / app-server keep a live process; claude-code print is one-shot only. */
|
|
1268
|
+
type ContinuableExternalKind = "acp" | "app-server";
|
|
1269
|
+
declare function supportsExternalContinuable(kind: ExternalAgentKind): kind is ContinuableExternalKind;
|
|
1270
|
+
interface ExternalAgentLiveSession {
|
|
1271
|
+
readonly kind: ContinuableExternalKind;
|
|
1272
|
+
readonly remoteId: string;
|
|
1273
|
+
isBusy(): boolean;
|
|
1274
|
+
lastText(): string | undefined;
|
|
1275
|
+
prompt(text: string, signal?: AbortSignal): Promise<string>;
|
|
1276
|
+
interrupt(): Promise<void>;
|
|
1277
|
+
dispose(): void;
|
|
1278
|
+
}
|
|
1279
|
+
interface OpenExternalLiveOptions {
|
|
1280
|
+
readonly kind: ContinuableExternalKind;
|
|
1281
|
+
readonly cwd: string;
|
|
1282
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
1283
|
+
readonly product?: ExternalAgentProductConfig;
|
|
1284
|
+
readonly spawnImpl?: ExternalSpawn;
|
|
1285
|
+
/**
|
|
1286
|
+
* Cold-resume remote id (ACP sessionId / app-server thread id). When set,
|
|
1287
|
+
* prefer resume/load over a fresh session/thread.
|
|
1288
|
+
*/
|
|
1289
|
+
readonly resumeRemoteId?: string;
|
|
1290
|
+
}
|
|
1291
|
+
declare function openExternalAgentLiveSession(options: OpenExternalLiveOptions): Promise<ExternalAgentLiveSession>;
|
|
1292
|
+
/** Durable handle for cold resume after Host restart / process dispose. */
|
|
1293
|
+
interface ExternalAgentHandleRecord {
|
|
1294
|
+
readonly faceSessionId: string;
|
|
1295
|
+
readonly kind: ContinuableExternalKind;
|
|
1296
|
+
readonly remoteId: string;
|
|
1297
|
+
readonly cwd: string;
|
|
1298
|
+
readonly updatedAt: number;
|
|
1299
|
+
}
|
|
1300
|
+
declare function externalAgentHandlesPath(subagentPersistPath?: string): string | undefined;
|
|
1301
|
+
/** Face child session id → live ACP / app-server handle (+ optional cold sidecar). */
|
|
1302
|
+
declare class ExternalAgentSessionRegistry {
|
|
1303
|
+
private readonly map;
|
|
1304
|
+
private readonly handles;
|
|
1305
|
+
private readonly persistPath;
|
|
1306
|
+
constructor(persistPath?: string);
|
|
1307
|
+
has(faceSessionId: string): boolean;
|
|
1308
|
+
get(faceSessionId: string): ExternalAgentLiveSession | undefined;
|
|
1309
|
+
isBusy(faceSessionId: string): boolean;
|
|
1310
|
+
kind(faceSessionId: string): ContinuableExternalKind | undefined;
|
|
1311
|
+
/** Sidecar handle when process is gone but remote id is still known. */
|
|
1312
|
+
getHandle(faceSessionId: string): ExternalAgentHandleRecord | undefined;
|
|
1313
|
+
/**
|
|
1314
|
+
* Status badge: `live` while process attached; `cold` when only the sidecar
|
|
1315
|
+
* remains (Host restart / dispose) so UI / follow-up can attempt reopen.
|
|
1316
|
+
*/
|
|
1317
|
+
resumeState(faceSessionId: string): "live" | "cold" | undefined;
|
|
1318
|
+
attach(faceSessionId: string, session: ExternalAgentLiveSession, meta?: {
|
|
1319
|
+
readonly cwd?: string;
|
|
1320
|
+
}): void;
|
|
1321
|
+
detach(faceSessionId: string): void;
|
|
1322
|
+
/** Drop live + cold handle (interrupt dispose path that should not resume). */
|
|
1323
|
+
clearHandle(faceSessionId: string): void;
|
|
1324
|
+
disposeAll(): void;
|
|
1325
|
+
private loadHandles;
|
|
1326
|
+
private saveHandles;
|
|
1327
|
+
}
|
|
1328
|
+
/** Narrow host surface for external continuable (avoids FaceRuntime import cycle). */
|
|
1329
|
+
interface ExternalAgentHost {
|
|
1330
|
+
readonly store: SessionStore;
|
|
1331
|
+
readonly drain: {
|
|
1332
|
+
isActive(sessionId: string): boolean;
|
|
1333
|
+
};
|
|
1334
|
+
readonly externalAgents: ExternalAgentSessionRegistry;
|
|
1335
|
+
onSessionDrainStatus(sessionId: string, running: boolean): void;
|
|
1336
|
+
suppressOwnedSubagentCompletion(childSessionId: string): void;
|
|
1337
|
+
}
|
|
1338
|
+
/** True when Face drain or an external live session is mid-turn. */
|
|
1339
|
+
declare function isChildSessionActive(runtime: ExternalAgentHost, sessionId: string): boolean;
|
|
1340
|
+
interface StartExternalContinuableOptions {
|
|
1341
|
+
readonly runtime: ExternalAgentHost;
|
|
1342
|
+
readonly faceSessionId: string;
|
|
1343
|
+
readonly kind: ContinuableExternalKind;
|
|
1344
|
+
readonly cwd: string;
|
|
1345
|
+
readonly prompt: string;
|
|
1346
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
1347
|
+
readonly product?: ExternalAgentProductConfig;
|
|
1348
|
+
readonly spawnImpl?: ExternalSpawn;
|
|
1349
|
+
readonly signal?: AbortSignal;
|
|
1350
|
+
/** When true, return after spawn + first turn kickoff (do not await answer). */
|
|
1351
|
+
readonly background: boolean;
|
|
1352
|
+
}
|
|
1353
|
+
/**
|
|
1354
|
+
* Open ACP / app-server live session, attach to Face child id, run first prompt.
|
|
1355
|
+
* Background: kicks the turn and returns; completion steers parent via drain hooks.
|
|
1356
|
+
*/
|
|
1357
|
+
declare function startExternalContinuable(options: StartExternalContinuableOptions): Promise<{
|
|
1358
|
+
readonly text?: string;
|
|
1359
|
+
readonly kind: ContinuableExternalKind;
|
|
1360
|
+
}>;
|
|
1361
|
+
/**
|
|
1362
|
+
* Follow-up prompt on an attached external live session (send_message / followup_task).
|
|
1363
|
+
* When the live process is gone but a cold sidecar handle remains, reopen via
|
|
1364
|
+
* ACP session/load or app-server thread/resume before prompting.
|
|
1365
|
+
*/
|
|
1366
|
+
declare function promptExternalContinuable(runtime: ExternalAgentHost, faceSessionId: string, message: string, opts?: {
|
|
1367
|
+
readonly signal?: AbortSignal;
|
|
1368
|
+
readonly steer?: boolean;
|
|
1369
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
1370
|
+
readonly product?: ExternalAgentProductConfig;
|
|
1371
|
+
readonly spawnImpl?: ExternalSpawn;
|
|
1372
|
+
}): Promise<string>;
|
|
1373
|
+
declare function interruptExternalContinuable(runtime: ExternalAgentHost, faceSessionId: string, opts?: {
|
|
1374
|
+
readonly dispose?: boolean;
|
|
1375
|
+
}): Promise<void>;
|
|
1376
|
+
//#endregion
|
|
1377
|
+
//#region src/agent-team-graph.d.ts
|
|
1378
|
+
type AgentTeamEdgeKind = "delegates" | "peer";
|
|
1379
|
+
/**
|
|
1380
|
+
* Team role for one node.
|
|
1381
|
+
* - `delegator` — hands work to a child (outgoing `delegates` edge).
|
|
1382
|
+
* - `worker` — the child that received the delegation.
|
|
1383
|
+
* - `observer` — linked by `peer` only; reads/coordinates, owns no delegation.
|
|
1384
|
+
* Derived from edges unless an explicit override is set.
|
|
1385
|
+
*/
|
|
1386
|
+
type AgentTeamRole = "delegator" | "worker" | "observer";
|
|
1387
|
+
declare const AGENT_TEAM_ROLES: readonly AgentTeamRole[];
|
|
1388
|
+
declare function isAgentTeamRole(value: unknown): value is AgentTeamRole;
|
|
1389
|
+
interface AgentTeamNode {
|
|
1390
|
+
readonly id: string;
|
|
1391
|
+
readonly label: string;
|
|
1392
|
+
/** Effective role: explicit override when set, else derived from edges. */
|
|
1393
|
+
readonly role?: AgentTeamRole;
|
|
1394
|
+
/**
|
|
1395
|
+
* Delegation depth from the `view`/`depthFrom` root along `delegates` edges
|
|
1396
|
+
* (root = 0). Omitted when the node is only peer-linked to the component.
|
|
1397
|
+
*/
|
|
1398
|
+
readonly depth?: number;
|
|
1399
|
+
}
|
|
1400
|
+
interface AgentTeamEdge {
|
|
1401
|
+
readonly from: string;
|
|
1402
|
+
readonly to: string;
|
|
1403
|
+
readonly kind: AgentTeamEdgeKind;
|
|
1404
|
+
readonly label?: string;
|
|
1405
|
+
}
|
|
1406
|
+
/** One adjacency hop from `neighbors()`. */
|
|
1407
|
+
interface AgentTeamNeighbor {
|
|
1408
|
+
readonly id: string;
|
|
1409
|
+
readonly kind: AgentTeamEdgeKind;
|
|
1410
|
+
/** `out` = this node is edge.from; `in` = this node is edge.to (peer always sorted). */
|
|
1411
|
+
readonly direction: "in" | "out";
|
|
1412
|
+
readonly label?: string;
|
|
1413
|
+
}
|
|
1414
|
+
declare class AgentTeamGraph {
|
|
1415
|
+
private readonly nodes;
|
|
1416
|
+
private readonly edges;
|
|
1417
|
+
private readonly roles;
|
|
1418
|
+
private readonly persistPath;
|
|
1419
|
+
constructor(persistPath?: string);
|
|
1420
|
+
recordDelegation(link: FaceSubagentLink): void;
|
|
1421
|
+
/** Replace delegation edges from the live registry; peer links stay. */
|
|
1422
|
+
rebuildDelegations(links: readonly FaceSubagentLink[]): void;
|
|
1423
|
+
linkPeers(from: string, to: string, label?: string): AgentTeamEdge | undefined;
|
|
1424
|
+
/** Drop a peer edge (no-op when missing). Returns whether an edge was removed. */
|
|
1425
|
+
unlinkPeers(from: string, to: string): boolean;
|
|
1426
|
+
/**
|
|
1427
|
+
* Remove peer edges touching `nodeId`, clear its role override, and drop the
|
|
1428
|
+
* node when no `delegates` edge remains. Delegation edges stay owned by
|
|
1429
|
+
* `rebuildDelegations` / the live registry.
|
|
1430
|
+
*/
|
|
1431
|
+
removeNode(nodeId: string): boolean;
|
|
1432
|
+
/**
|
|
1433
|
+
* Adjacent nodes. `kind` defaults to any; peer hops are undirected
|
|
1434
|
+
* (`direction` still reports sorted from→to orientation).
|
|
1435
|
+
*/
|
|
1436
|
+
neighbors(nodeId: string, kind?: AgentTeamEdgeKind): readonly AgentTeamNeighbor[];
|
|
1437
|
+
/**
|
|
1438
|
+
* BFS depth along `delegates` from `rootId` (root = 0). Undefined when the
|
|
1439
|
+
* target is unreachable via delegation (peer-only nodes).
|
|
1440
|
+
*/
|
|
1441
|
+
depthFrom(rootId: string, nodeId: string): number | undefined;
|
|
1442
|
+
/** Effective role for one node (explicit override, else derived from edges). */
|
|
1443
|
+
roleOf(nodeId: string): AgentTeamRole;
|
|
1444
|
+
/**
|
|
1445
|
+
* Override a node's role. Pass `undefined` to clear the override and fall
|
|
1446
|
+
* back to the derived role. Returns the effective role afterwards.
|
|
1447
|
+
*/
|
|
1448
|
+
setRole(nodeId: string, role?: AgentTeamRole): AgentTeamRole | undefined;
|
|
1449
|
+
/** Explicit overrides only (derived roles are recomputed on read). */
|
|
1450
|
+
roleOverrides(): Readonly<Record<string, AgentTeamRole>>;
|
|
1451
|
+
private deriveRole;
|
|
1452
|
+
/** Connected component around `rootId` (delegation + peer). */
|
|
1453
|
+
view(rootId: string): {
|
|
1454
|
+
readonly nodes: readonly AgentTeamNode[];
|
|
1455
|
+
readonly edges: readonly AgentTeamEdge[];
|
|
1456
|
+
};
|
|
1457
|
+
private upsertNode;
|
|
1458
|
+
private upsertEdge;
|
|
1459
|
+
private load;
|
|
1460
|
+
private save;
|
|
1461
|
+
}
|
|
1462
|
+
declare function agentTeamGraphPath(subagentPersistPath?: string): string | undefined;
|
|
1463
|
+
//#endregion
|
|
1464
|
+
//#region src/agent-team-roles.d.ts
|
|
1465
|
+
/**
|
|
1466
|
+
* Spawn-time role templates for Agent Teams (Codex agent_type · Hermes leaf/orchestrator).
|
|
1467
|
+
* Graph `delegator|worker|observer` stays a UI label; these prefix the child prompt.
|
|
1468
|
+
*/
|
|
1469
|
+
type AgentTeamSpawnRole = "default" | "worker" | "researcher" | "reviewer" | "lead";
|
|
1470
|
+
declare const AGENT_TEAM_SPAWN_ROLES: readonly AgentTeamSpawnRole[];
|
|
1471
|
+
declare function isAgentTeamSpawnRole(value: unknown): value is AgentTeamSpawnRole;
|
|
1472
|
+
/** Resolve a spawn role string (aliases: agent_type · role). Unknown → undefined. */
|
|
1473
|
+
declare function parseAgentTeamSpawnRole(value: unknown): AgentTeamSpawnRole | undefined;
|
|
1474
|
+
/** Prepend the role reminder when non-empty. */
|
|
1475
|
+
declare function applySpawnRoleReminder(prompt: string, role: AgentTeamSpawnRole | undefined): string;
|
|
1476
|
+
declare function listSpawnRoleIds(): readonly AgentTeamSpawnRole[];
|
|
1477
|
+
//#endregion
|
|
1478
|
+
//#region src/agent-team-tasks.d.ts
|
|
1479
|
+
type AgentTeamTaskStatus = "pending" | "in_progress" | "completed" | "failed" | "paused";
|
|
1480
|
+
interface AgentTeamTask {
|
|
1481
|
+
readonly id: string;
|
|
1482
|
+
readonly parentSessionId: string;
|
|
1483
|
+
readonly title: string;
|
|
1484
|
+
readonly status: AgentTeamTaskStatus;
|
|
1485
|
+
readonly revision: number;
|
|
1486
|
+
readonly createdAt: number;
|
|
1487
|
+
readonly updatedAt: number;
|
|
1488
|
+
readonly childSessionId?: string;
|
|
1489
|
+
readonly role?: AgentTeamSpawnRole;
|
|
1490
|
+
/** Managed worktree checkout path when spawn used worktree isolation. */
|
|
1491
|
+
readonly worktreePath?: string;
|
|
1492
|
+
readonly worktreeBranch?: string;
|
|
1493
|
+
readonly worktreeId?: string;
|
|
1494
|
+
/** Human owns the child after interrupt takeover (suppress auto-steer). */
|
|
1495
|
+
readonly humanOwned?: boolean;
|
|
1496
|
+
readonly resultPreview?: string;
|
|
1497
|
+
readonly schemaValid?: boolean;
|
|
1498
|
+
readonly schemaErrors?: readonly string[];
|
|
1499
|
+
}
|
|
1500
|
+
declare class AgentTeamTaskBoard {
|
|
1501
|
+
private readonly tasks;
|
|
1502
|
+
/** In-memory only — schemas are large and session-scoped. */
|
|
1503
|
+
private readonly schemas;
|
|
1504
|
+
private readonly persistPath;
|
|
1505
|
+
constructor(persistPath?: string);
|
|
1506
|
+
get(taskId: string): AgentTeamTask | undefined;
|
|
1507
|
+
list(parentSessionId: string): readonly AgentTeamTask[];
|
|
1508
|
+
/** Create a pending/in_progress task when spawning a teammate. */
|
|
1509
|
+
open(input: {
|
|
1510
|
+
readonly parentSessionId: string;
|
|
1511
|
+
readonly title: string;
|
|
1512
|
+
readonly childSessionId?: string;
|
|
1513
|
+
readonly role?: AgentTeamSpawnRole;
|
|
1514
|
+
readonly taskId?: string;
|
|
1515
|
+
readonly now?: number;
|
|
1516
|
+
}): AgentTeamTask;
|
|
1517
|
+
/** Bind a child session after create (when id was known before spawn). */
|
|
1518
|
+
bindChild(taskId: string, childSessionId: string, now?: number): AgentTeamTask | undefined;
|
|
1519
|
+
findByChild(childSessionId: string): AgentTeamTask | undefined;
|
|
1520
|
+
/** Attach managed worktree lease fields to a Teams task. */
|
|
1521
|
+
bindWorktree(taskId: string, worktree: {
|
|
1522
|
+
readonly path: string;
|
|
1523
|
+
readonly branch: string;
|
|
1524
|
+
readonly id?: string;
|
|
1525
|
+
}, now?: number): AgentTeamTask | undefined;
|
|
1526
|
+
/** Attach an output_schema for later validation (not persisted). */
|
|
1527
|
+
setOutputSchema(taskId: string, schema: Readonly<Record<string, unknown>>): void;
|
|
1528
|
+
outputSchemaOf(taskId: string): Readonly<Record<string, unknown>> | undefined;
|
|
1529
|
+
outputSchemaForChild(childSessionId: string): Readonly<Record<string, unknown>> | undefined;
|
|
1530
|
+
/**
|
|
1531
|
+
* Soft-pause / human takeover after interrupt.
|
|
1532
|
+
* Marks the task paused + humanOwned (completion steer already suppressed).
|
|
1533
|
+
*/
|
|
1534
|
+
markTakeover(childSessionId: string, now?: number): AgentTeamTask | undefined;
|
|
1535
|
+
/** Resume after send_message — clear humanOwned, back to in_progress. */
|
|
1536
|
+
markResumed(childSessionId: string, now?: number): AgentTeamTask | undefined;
|
|
1537
|
+
complete(taskId: string, input: {
|
|
1538
|
+
readonly ok: boolean;
|
|
1539
|
+
readonly preview?: string;
|
|
1540
|
+
readonly schemaValid?: boolean;
|
|
1541
|
+
readonly schemaErrors?: readonly string[];
|
|
1542
|
+
readonly now?: number;
|
|
1543
|
+
}): AgentTeamTask | undefined;
|
|
1544
|
+
/** Complete by child session id (foreground wait / idle notice). */
|
|
1545
|
+
completeByChild(childSessionId: string, input: {
|
|
1546
|
+
readonly ok: boolean;
|
|
1547
|
+
readonly preview?: string;
|
|
1548
|
+
readonly schemaValid?: boolean;
|
|
1549
|
+
readonly schemaErrors?: readonly string[];
|
|
1550
|
+
readonly now?: number;
|
|
1551
|
+
}): AgentTeamTask | undefined;
|
|
1552
|
+
private load;
|
|
1553
|
+
private save;
|
|
1554
|
+
}
|
|
1555
|
+
declare function agentTeamTasksPath(subagentPersistPath?: string): string | undefined;
|
|
1556
|
+
//#endregion
|
|
1557
|
+
//#region src/subagent-worktree.d.ts
|
|
1558
|
+
interface SubagentWorktreeResult {
|
|
1559
|
+
path: string;
|
|
1560
|
+
branch: string;
|
|
1561
|
+
commits: number;
|
|
1562
|
+
dirty: boolean;
|
|
1563
|
+
pruned: boolean;
|
|
1564
|
+
inspection_failed?: boolean;
|
|
1565
|
+
note?: string;
|
|
1566
|
+
}
|
|
1567
|
+
interface GitRunResult {
|
|
1568
|
+
readonly code: number;
|
|
1569
|
+
readonly stdout: string;
|
|
1570
|
+
readonly stderr: string;
|
|
1571
|
+
}
|
|
1572
|
+
type GitRunner$1 = (args: readonly string[], cwd: string) => GitRunResult;
|
|
1573
|
+
//#endregion
|
|
1574
|
+
//#region src/managed-worktree.d.ts
|
|
1575
|
+
declare const MANAGED_WORKTREE_OWNER_VERSION: 1;
|
|
1576
|
+
declare const MANAGED_WORKTREE_OWNER_FILENAME = "xrk-managed-worktree.json";
|
|
1577
|
+
type ManagedWorktreeStatus = "active" | "reclaimed" | "retained";
|
|
1578
|
+
/**
|
|
1579
|
+
* How to fold a managed worktree branch back into the parent checkout.
|
|
1580
|
+
* Only `ff-only` is implemented (matches Codex “clean merge or keep retained”).
|
|
1581
|
+
* Conflict / diverged history → retain the lease; no auto conflict UI.
|
|
1582
|
+
*/
|
|
1583
|
+
type ManagedWorktreeMergeStrategy = "ff-only";
|
|
1584
|
+
interface ManagedWorktreeMergeResult {
|
|
1585
|
+
readonly ok: boolean;
|
|
1586
|
+
readonly strategy: ManagedWorktreeMergeStrategy;
|
|
1587
|
+
readonly leaseId: string;
|
|
1588
|
+
readonly branch: string;
|
|
1589
|
+
readonly repoRoot: string;
|
|
1590
|
+
/** True when `git merge --ff-only` succeeded. */
|
|
1591
|
+
readonly merged: boolean;
|
|
1592
|
+
readonly reason?: string;
|
|
1593
|
+
readonly stdout?: string;
|
|
1594
|
+
readonly stderr?: string;
|
|
1595
|
+
/** Present when `pruneAfter` ran after a successful merge. */
|
|
1596
|
+
readonly reclaim?: SubagentWorktreeResult;
|
|
1597
|
+
}
|
|
1598
|
+
/** Durable owner record written beside each checkout (git admin or `.xrk/`). */
|
|
1599
|
+
interface ManagedWorktreeOwnerRecord {
|
|
1600
|
+
readonly version: typeof MANAGED_WORKTREE_OWNER_VERSION;
|
|
1601
|
+
/** Child session that owns the checkout (Codex ownerThreadId analogue). */
|
|
1602
|
+
readonly ownerSessionId: string;
|
|
1603
|
+
readonly parentSessionId?: string;
|
|
1604
|
+
readonly teamTaskId?: string;
|
|
1605
|
+
readonly branch?: string;
|
|
1606
|
+
readonly baseCommit?: string;
|
|
1607
|
+
readonly boundAt: number;
|
|
1608
|
+
}
|
|
1609
|
+
interface ManagedWorktreeLease {
|
|
1610
|
+
readonly id: string;
|
|
1611
|
+
readonly path: string;
|
|
1612
|
+
readonly branch: string;
|
|
1613
|
+
readonly repoRoot: string;
|
|
1614
|
+
readonly baseCommit: string;
|
|
1615
|
+
readonly parentSessionId: string;
|
|
1616
|
+
readonly createdAt: number;
|
|
1617
|
+
readonly status: ManagedWorktreeStatus;
|
|
1618
|
+
readonly childSessionId?: string;
|
|
1619
|
+
readonly teamTaskId?: string;
|
|
1620
|
+
readonly reclaim?: SubagentWorktreeResult;
|
|
1621
|
+
}
|
|
1622
|
+
/** Read owner metadata; `null` when missing or invalid. */
|
|
1623
|
+
declare function readManagedWorktreeOwner(checkout: string, git?: GitRunner$1): ManagedWorktreeOwnerRecord | null;
|
|
1624
|
+
/**
|
|
1625
|
+
* Bind ownership atomically. Re-binding the same owner is a no-op;
|
|
1626
|
+
* a different owner throws.
|
|
1627
|
+
*/
|
|
1628
|
+
declare function bindManagedWorktreeOwner(checkout: string, record: Omit<ManagedWorktreeOwnerRecord, "version" | "boundAt"> & {
|
|
1629
|
+
readonly boundAt?: number;
|
|
1630
|
+
}, git?: GitRunner$1): ManagedWorktreeOwnerRecord;
|
|
1631
|
+
declare function managedWorktreesPath(subagentPersistPath: string | undefined): string | undefined;
|
|
1632
|
+
/** Face-scoped registry of managed worktree leases. */
|
|
1633
|
+
declare class ManagedWorktreeManager {
|
|
1634
|
+
private readonly leases;
|
|
1635
|
+
private readonly persistPath;
|
|
1636
|
+
private readonly git;
|
|
1637
|
+
constructor(persistPath?: string, options?: {
|
|
1638
|
+
readonly git?: GitRunner$1;
|
|
1639
|
+
});
|
|
1640
|
+
get(id: string): ManagedWorktreeLease | undefined;
|
|
1641
|
+
list(parentSessionId?: string): readonly ManagedWorktreeLease[];
|
|
1642
|
+
findByChild(childSessionId: string): ManagedWorktreeLease | undefined;
|
|
1643
|
+
findByTask(teamTaskId: string): ManagedWorktreeLease | undefined;
|
|
1644
|
+
/**
|
|
1645
|
+
* Allocate a git worktree and register an active lease (unbound until
|
|
1646
|
+
* {@link bind}).
|
|
1647
|
+
*/
|
|
1648
|
+
allocate(input: {
|
|
1649
|
+
readonly parentCwd: string;
|
|
1650
|
+
readonly parentSessionId: string;
|
|
1651
|
+
readonly subagentId?: string;
|
|
1652
|
+
readonly now?: number;
|
|
1653
|
+
}): ManagedWorktreeLease | null;
|
|
1654
|
+
/** Bind lease to child session (+ optional Teams task) and write owner file. */
|
|
1655
|
+
bind(leaseId: string, input: {
|
|
1656
|
+
readonly childSessionId: string;
|
|
1657
|
+
readonly teamTaskId?: string;
|
|
1658
|
+
readonly now?: number;
|
|
1659
|
+
}): ManagedWorktreeLease | undefined;
|
|
1660
|
+
/**
|
|
1661
|
+
* Merge the lease branch into the parent repo's current HEAD (`ff-only`).
|
|
1662
|
+
* Editing in the child stays isolated (session cwd = worktree); this is the
|
|
1663
|
+
* explicit fold-back step — never runs on reclaim by default.
|
|
1664
|
+
* Diverged / dirty parent → `{ ok:false, merged:false }` and lease stays.
|
|
1665
|
+
*/
|
|
1666
|
+
mergeIntoParent(leaseId: string, options?: {
|
|
1667
|
+
readonly strategy?: ManagedWorktreeMergeStrategy;
|
|
1668
|
+
/** After a successful ff merge, reclaim (prune-if-clean). Default false. */
|
|
1669
|
+
readonly pruneAfter?: boolean;
|
|
1670
|
+
}): ManagedWorktreeMergeResult | undefined;
|
|
1671
|
+
/** Reclaim (prune-if-clean) and update lease status. */
|
|
1672
|
+
reclaim(leaseId: string, options?: {
|
|
1673
|
+
readonly prune?: boolean;
|
|
1674
|
+
}): SubagentWorktreeResult | undefined;
|
|
1675
|
+
/** Convenience: reclaim by child session id. */
|
|
1676
|
+
reclaimByChild(childSessionId: string, options?: {
|
|
1677
|
+
readonly prune?: boolean;
|
|
1678
|
+
}): SubagentWorktreeResult | undefined;
|
|
1679
|
+
private load;
|
|
1680
|
+
private save;
|
|
1681
|
+
}
|
|
1682
|
+
//#endregion
|
|
1683
|
+
//#region src/message-feedback.d.ts
|
|
1684
|
+
declare const MESSAGE_FEEDBACK_NOTE_MAX_BYTES = 4096;
|
|
1685
|
+
type MessageFeedbackRating = "positive" | "negative";
|
|
1686
|
+
interface MessageFeedbackItem {
|
|
1687
|
+
readonly messageId: string;
|
|
1688
|
+
readonly rating: MessageFeedbackRating;
|
|
1689
|
+
readonly note?: string;
|
|
1690
|
+
readonly version: string;
|
|
1691
|
+
readonly createdAt: number;
|
|
1692
|
+
readonly updatedAt: number;
|
|
1693
|
+
}
|
|
1694
|
+
type TypertOk$1<T> = {
|
|
1695
|
+
readonly ok: true;
|
|
1696
|
+
readonly value: T;
|
|
1697
|
+
};
|
|
1698
|
+
type TypertFail$1 = {
|
|
1699
|
+
readonly ok: false;
|
|
1700
|
+
readonly error: Record<string, unknown> & {
|
|
1701
|
+
readonly code: string;
|
|
1702
|
+
};
|
|
1703
|
+
};
|
|
1704
|
+
declare class FaceMessageFeedbackStore {
|
|
1705
|
+
private readonly bySession;
|
|
1706
|
+
list(store: SessionStore, sessionId: string): FaceRpcResult<TypertOk$1<{
|
|
1707
|
+
items: MessageFeedbackItem[];
|
|
1708
|
+
}> | TypertFail$1>;
|
|
1709
|
+
put(store: SessionStore, input: {
|
|
1710
|
+
readonly sessionId: string;
|
|
1711
|
+
readonly messageId: string;
|
|
1712
|
+
readonly rating: unknown;
|
|
1713
|
+
readonly note?: unknown;
|
|
1714
|
+
readonly notePresent: boolean;
|
|
1715
|
+
readonly ifVersion: unknown;
|
|
1716
|
+
}): FaceRpcResult<TypertOk$1<MessageFeedbackItem> | TypertFail$1>;
|
|
1717
|
+
delete(store: SessionStore, input: {
|
|
1718
|
+
readonly sessionId: string;
|
|
1719
|
+
readonly messageId: string;
|
|
1720
|
+
readonly ifVersion: unknown;
|
|
1721
|
+
}): FaceRpcResult<TypertOk$1<{
|
|
1722
|
+
absent: true;
|
|
1723
|
+
}> | TypertFail$1>;
|
|
1724
|
+
private bucket;
|
|
1725
|
+
}
|
|
1726
|
+
//#endregion
|
|
1727
|
+
//#region src/goal-store.d.ts
|
|
1728
|
+
declare const DEFAULT_MAX_GOAL_ROUNDS = 16;
|
|
1729
|
+
declare const GOAL_OBJECTIVE_MAX_CHARS = 4000;
|
|
1730
|
+
type GoalPhase = "active" | "paused" | "blocked" | "complete";
|
|
1731
|
+
type GoalActivation = "armed" | "disarmed";
|
|
1732
|
+
interface GoalRef {
|
|
1733
|
+
readonly id: string;
|
|
1734
|
+
readonly revision: number;
|
|
1735
|
+
}
|
|
1736
|
+
interface GoalView {
|
|
1737
|
+
readonly id: string;
|
|
1738
|
+
readonly revision: number;
|
|
1739
|
+
readonly objective: string;
|
|
1740
|
+
readonly phase: GoalPhase;
|
|
1741
|
+
readonly activation: GoalActivation;
|
|
1742
|
+
readonly maxGoalRounds: number;
|
|
1743
|
+
readonly roundsStarted: number;
|
|
1744
|
+
readonly createdAt: number;
|
|
1745
|
+
readonly updatedAt: number;
|
|
1746
|
+
readonly blockedReason?: {
|
|
1747
|
+
readonly code: string;
|
|
1748
|
+
readonly message: string;
|
|
1749
|
+
};
|
|
1750
|
+
}
|
|
1751
|
+
type GoalProjectionValue = {
|
|
1752
|
+
readonly goal: GoalView;
|
|
1753
|
+
} | null;
|
|
1754
|
+
declare class FaceGoalStore {
|
|
1755
|
+
private readonly bySession;
|
|
1756
|
+
private readonly persistPath;
|
|
1757
|
+
private runtime;
|
|
1758
|
+
constructor(persistPath?: string);
|
|
1759
|
+
bind(runtime: FaceRuntime): void;
|
|
1760
|
+
get(sessionId: string): GoalView | undefined;
|
|
1761
|
+
onTurnEnd(sessionId: string, turnReasonKind?: string): void;
|
|
1762
|
+
create(sessionId: string, objective: string, maxGoalRounds?: number): FaceRpcResult<{
|
|
1763
|
+
ref: GoalRef;
|
|
1764
|
+
}>;
|
|
1765
|
+
edit(sessionId: string, ref: GoalRef, patch: {
|
|
1766
|
+
objective?: string;
|
|
1767
|
+
maxGoalRounds?: number;
|
|
1768
|
+
}): FaceRpcResult<GoalView>;
|
|
1769
|
+
pause(sessionId: string, ref: GoalRef): FaceRpcResult<GoalView>;
|
|
1770
|
+
resume(sessionId: string, ref: GoalRef): FaceRpcResult<GoalView>;
|
|
1771
|
+
complete(sessionId: string, ref: GoalRef): FaceRpcResult<GoalView>;
|
|
1772
|
+
/** Model / Host: mark blocked and disarm automatic rounds. */
|
|
1773
|
+
block(sessionId: string, ref: GoalRef, reason: {
|
|
1774
|
+
readonly code: string;
|
|
1775
|
+
readonly message: string;
|
|
1776
|
+
}): FaceRpcResult<GoalView>;
|
|
1777
|
+
clear(sessionId: string, ref: GoalRef): FaceRpcResult<GoalRef>;
|
|
1778
|
+
private startRound;
|
|
1779
|
+
private mutate;
|
|
1780
|
+
private publish;
|
|
1781
|
+
private load;
|
|
1782
|
+
private save;
|
|
1783
|
+
private requireRuntime;
|
|
1784
|
+
}
|
|
1785
|
+
//#endregion
|
|
1786
|
+
//#region src/adapt/wire-ids.d.ts
|
|
1787
|
+
/**
|
|
1788
|
+
* Session-scoped turn/step counters for Face wire (numeric, order of first seen).
|
|
1789
|
+
* Prefer this over hashing string ids so trajectory location math stays monotonic.
|
|
1790
|
+
*/
|
|
1791
|
+
declare class FaceWireIdMaps {
|
|
1792
|
+
private readonly turns;
|
|
1793
|
+
private readonly steps;
|
|
1794
|
+
private readonly turnCount;
|
|
1795
|
+
private readonly stepCount;
|
|
1796
|
+
turn(sessionId: string, turnId: string): number;
|
|
1797
|
+
step(sessionId: string, turnId: string, stepId: string): number;
|
|
1798
|
+
/**
|
|
1799
|
+
* Drop every session-scoped bucket for one session. Called on session
|
|
1800
|
+
* eviction so long-running hosts do not retain turn/step counters for
|
|
1801
|
+
* evicted sessions (per-session entries would otherwise accumulate forever).
|
|
1802
|
+
*/
|
|
1803
|
+
clear(sessionId: string): void;
|
|
1804
|
+
}
|
|
1805
|
+
//#endregion
|
|
1806
|
+
//#region src/adapt/inbox-wire.d.ts
|
|
1807
|
+
type InboxTarget = "next-turn" | "next-step";
|
|
1808
|
+
interface FaceWireUserMessage {
|
|
1809
|
+
readonly id: string;
|
|
1810
|
+
readonly role: "user";
|
|
1811
|
+
readonly content: readonly ({
|
|
1812
|
+
readonly type: "text";
|
|
1813
|
+
readonly text: string;
|
|
1814
|
+
} | {
|
|
1815
|
+
readonly type: "image";
|
|
1816
|
+
readonly attachment: {
|
|
1817
|
+
readonly attachmentId: string;
|
|
1818
|
+
readonly mediaType: string;
|
|
1819
|
+
readonly bytes: number;
|
|
1820
|
+
readonly width: number;
|
|
1821
|
+
readonly height: number;
|
|
1822
|
+
readonly name?: string;
|
|
1823
|
+
};
|
|
1824
|
+
} | {
|
|
1825
|
+
readonly type: "file";
|
|
1826
|
+
readonly attachment: {
|
|
1827
|
+
readonly attachmentId: string;
|
|
1828
|
+
readonly name: string;
|
|
1829
|
+
readonly bytes: number;
|
|
1830
|
+
readonly mediaType?: string;
|
|
1831
|
+
};
|
|
1832
|
+
})[];
|
|
1833
|
+
readonly source: {
|
|
1834
|
+
readonly kind: "user";
|
|
1835
|
+
readonly rpcId?: string;
|
|
1836
|
+
};
|
|
1837
|
+
}
|
|
1838
|
+
interface FaceInboxSplice {
|
|
1839
|
+
readonly target: InboxTarget;
|
|
1840
|
+
readonly start: number;
|
|
1841
|
+
readonly removedCount?: number;
|
|
1842
|
+
readonly inserted: readonly FaceWireUserMessage[];
|
|
1843
|
+
readonly outcome?: "canceled";
|
|
1844
|
+
}
|
|
1845
|
+
/**
|
|
1846
|
+
* Incremental projector: apply one prompt event → one normalized splice.
|
|
1847
|
+
* Callers must feed events in session log order.
|
|
1848
|
+
*/
|
|
1849
|
+
declare class FaceInboxWireProjector {
|
|
1850
|
+
private readonly admitToRpc;
|
|
1851
|
+
private readonly nextTurn;
|
|
1852
|
+
private readonly nextStep;
|
|
1853
|
+
constructor(admitToRpc?: ReadonlyMap<string, string>);
|
|
1854
|
+
/** Project one XRK prompt event into a Face inbox splice, mutating pending lists. */
|
|
1855
|
+
project(event: SessionEvent): FaceInboxSplice | undefined;
|
|
1856
|
+
private locate;
|
|
1857
|
+
}
|
|
1858
|
+
/** Per-session projectors for live mux fan-out. */
|
|
1859
|
+
declare class FaceInboxWireMaps {
|
|
1860
|
+
private readonly admitToRpc;
|
|
1861
|
+
private readonly bySession;
|
|
1862
|
+
constructor(admitToRpc: ReadonlyMap<string, string>);
|
|
1863
|
+
forSession(sessionId: string): FaceInboxWireProjector;
|
|
1864
|
+
/** Fresh projector for history rebuild (does not touch live mux state). */
|
|
1865
|
+
fresh(): FaceInboxWireProjector;
|
|
1866
|
+
clear(sessionId: string): void;
|
|
1867
|
+
}
|
|
1868
|
+
//#endregion
|
|
1869
|
+
//#region src/host-directory.d.ts
|
|
1870
|
+
interface DirectoryEntryView {
|
|
1871
|
+
readonly name: string;
|
|
1872
|
+
readonly path: string;
|
|
1873
|
+
readonly hidden: boolean;
|
|
1874
|
+
}
|
|
1875
|
+
interface DirectoryListingView {
|
|
1876
|
+
readonly path: string;
|
|
1877
|
+
readonly home: string;
|
|
1878
|
+
readonly crumbs: readonly DirectoryEntryView[];
|
|
1879
|
+
readonly entries: readonly DirectoryEntryView[];
|
|
1880
|
+
readonly truncated: boolean;
|
|
1881
|
+
}
|
|
1882
|
+
/** Same predicate as DSH `fullyQualified` (browse picker). */
|
|
1883
|
+
declare function fullyQualified(path: string, platform?: NodeJS.Platform): boolean;
|
|
1884
|
+
declare function hostListDirectory(payload: unknown): Promise<FaceRpcResult<DirectoryListingView>>;
|
|
1885
|
+
declare function hostCreateDirectory(payload: unknown): Promise<FaceRpcResult<{
|
|
1886
|
+
path: string;
|
|
1887
|
+
}>>;
|
|
1888
|
+
//#endregion
|
|
1889
|
+
//#region src/context.d.ts
|
|
1890
|
+
/**
|
|
1891
|
+
* When Host runs with SSH remote cwd, Web browse RPCs use this backend
|
|
1892
|
+
* instead of the local filesystem (paths are remote POSIX coordinates).
|
|
1893
|
+
*/
|
|
1894
|
+
interface FaceDirectoryBackend {
|
|
1895
|
+
list(payload: unknown): Promise<FaceRpcResult<DirectoryListingView>>;
|
|
1896
|
+
create(payload: unknown): Promise<FaceRpcResult<{
|
|
1897
|
+
path: string;
|
|
1898
|
+
}>>;
|
|
1899
|
+
}
|
|
1900
|
+
interface FaceDrain {
|
|
1901
|
+
wake(sessionId: string): void;
|
|
1902
|
+
cancel(sessionId: string, options?: SessionDrainCancelOptions): Promise<void>;
|
|
1903
|
+
isActive(sessionId: string): boolean;
|
|
1904
|
+
/** Wait until the session drain settles (Host hub.run). */
|
|
1905
|
+
run?(sessionId: string): Promise<void>;
|
|
1906
|
+
}
|
|
1907
|
+
interface FaceRuntime {
|
|
1908
|
+
/** Durable image blobs; omit → image prompt / session.attachment unavailable. */
|
|
1909
|
+
readonly attachments?: AttachmentStore;
|
|
1910
|
+
/**
|
|
1911
|
+
* Declared input modalities for Host precheck (DSH-aligned).
|
|
1912
|
+
* Default `["text"]` — images rejected before save unless `"image"` is listed.
|
|
1913
|
+
*/
|
|
1914
|
+
readonly inputModalities?: readonly ("text" | "image")[];
|
|
1915
|
+
readonly store: SessionStore;
|
|
1916
|
+
ensureSession(id?: string): string;
|
|
1917
|
+
resolveAgent(sessionId: string): Promise<AgentHandle>;
|
|
1918
|
+
readonly drain: FaceDrain;
|
|
1919
|
+
readonly registry: ProviderRegistry;
|
|
1920
|
+
readonly workspaceRoot: string;
|
|
1921
|
+
/**
|
|
1922
|
+
* True when tool cwd / fs / bash ride SSH (`XRK_SSH_*`).
|
|
1923
|
+
* Native openPath · OS folder picker · sidebar PTY stay host-local and are gated off.
|
|
1924
|
+
*/
|
|
1925
|
+
readonly remoteExecution?: boolean;
|
|
1926
|
+
/**
|
|
1927
|
+
* Local Host cwd before SSH workspace swap (settings / product home anchor).
|
|
1928
|
+
* Absent when not remote.
|
|
1929
|
+
*/
|
|
1930
|
+
readonly localHostRoot?: string;
|
|
1931
|
+
/** SSH-backed `host.listDirectory` / `host.createDirectory` (remote POSIX). */
|
|
1932
|
+
readonly directoryBackend?: FaceDirectoryBackend;
|
|
1933
|
+
/** Product inject dir override for tests; Host leaves unset → `{workspace}/.xrk`. Settings/creds use `resolveHarnessHome` (`~/.xrk`). */
|
|
1934
|
+
readonly productDir?: string;
|
|
1935
|
+
readonly version: string;
|
|
1936
|
+
readonly defaultAgentPreset?: string;
|
|
1937
|
+
readonly bus: FaceBus;
|
|
1938
|
+
readonly seq: FaceSeqClock;
|
|
1939
|
+
readonly projections: FaceProjectionRegistry;
|
|
1940
|
+
/**
|
|
1941
|
+
* Cold list column for `title` / `sessionListMetadata` (Codex-style).
|
|
1942
|
+
* Written on list-key changes and before SQLite LRU eviction.
|
|
1943
|
+
*/
|
|
1944
|
+
readonly listProjectionCache: FaceListProjectionCache;
|
|
1945
|
+
readonly titles: FaceTitleController;
|
|
1946
|
+
/** rpcId (unary) → admitId */
|
|
1947
|
+
readonly rpcAdmitMap: Map<string, string>;
|
|
1948
|
+
/** admitId → rpcId (reverse for queue / stamp) */
|
|
1949
|
+
readonly admitRpcMap: Map<string, string>;
|
|
1950
|
+
/** Next user/message for session should carry this rpcId */
|
|
1951
|
+
readonly pendingUserRpc: Map<string, string>;
|
|
1952
|
+
readonly sessionModels: Map<string, {
|
|
1953
|
+
provider: string;
|
|
1954
|
+
model: string;
|
|
1955
|
+
reasoningEffort?: string;
|
|
1956
|
+
}>;
|
|
1957
|
+
/** sessionId → agentPreset id */
|
|
1958
|
+
readonly sessionAgentPresets: Map<string, string>;
|
|
1959
|
+
/** sessionId → project cwd (DSH session.list / blank reuse). */
|
|
1960
|
+
readonly sessionCwds: Map<string, string>;
|
|
1961
|
+
/**
|
|
1962
|
+
* Sessions known to contain image-bearing user/admit content.
|
|
1963
|
+
* Maintained on append; first miss may scan once then mark {@link sessionImageScanned}.
|
|
1964
|
+
*/
|
|
1965
|
+
readonly sessionHasImage: Set<string>;
|
|
1966
|
+
/** Sessions whose image presence has been resolved (hit or miss). */
|
|
1967
|
+
readonly sessionImageScanned: Set<string>;
|
|
1968
|
+
/** In-memory workspace registry for the product shell. */
|
|
1969
|
+
readonly workspaces: FaceWorkspaceRegistry;
|
|
1970
|
+
/** Direct subagent children (fork / create-with-parent). */
|
|
1971
|
+
readonly subagents: FaceSubagentRegistry;
|
|
1972
|
+
/**
|
|
1973
|
+
* Live ACP / app-server subprocesses keyed by Face child session id.
|
|
1974
|
+
* Same list / send / interrupt / wait surface as in-process continuable.
|
|
1975
|
+
*/
|
|
1976
|
+
readonly externalAgents: ExternalAgentSessionRegistry;
|
|
1977
|
+
/** Delegation + peer team graph (persisted next to the subagent sidecar). */
|
|
1978
|
+
readonly agentTeams: AgentTeamGraph;
|
|
1979
|
+
/** Thin task board (delivery · result · pause/takeover) beside the graph. */
|
|
1980
|
+
readonly agentTeamTasks: AgentTeamTaskBoard;
|
|
1981
|
+
/** Managed git worktree leases (allocate / reclaim / Teams bind). */
|
|
1982
|
+
readonly managedWorktrees: ManagedWorktreeManager;
|
|
1983
|
+
/** Per-session assistant-message ratings (process-local CAS). */
|
|
1984
|
+
readonly messageFeedback: FaceMessageFeedbackStore;
|
|
1985
|
+
/**
|
|
1986
|
+
* Directory for conversation-slice JSON on session feedback
|
|
1987
|
+
* (`feedback/record` · `sessionFeedback/record`).
|
|
1988
|
+
*/
|
|
1989
|
+
readonly feedbackSlicesDir?: string;
|
|
1990
|
+
/** Per-session Goal sidecar (projection key `goal`). */
|
|
1991
|
+
readonly goals: FaceGoalStore;
|
|
1992
|
+
/** Session-scoped turn/step numbers for DSH wire events. */
|
|
1993
|
+
readonly wireIds: FaceWireIdMaps;
|
|
1994
|
+
/** Session-scoped inbox splice projectors for live mux. */
|
|
1995
|
+
readonly inboxWire: FaceInboxWireMaps;
|
|
1996
|
+
readonly loadSlashRecipes?: SlashRecipesLoader;
|
|
1997
|
+
/** Process plugins (`XRK_PLUGINS_DIR` / MCP) for inventory + slash. */
|
|
1998
|
+
readonly plugins?: readonly FaceProcessPlugin[];
|
|
1999
|
+
/**
|
|
2000
|
+
* Host live-applies Face MCP desired servers when sourced from
|
|
2001
|
+
* host-settings.json (env empty). Absent → mutate stays `applies: restart`.
|
|
2002
|
+
* Returns per-server connect failures and parked names.
|
|
2003
|
+
*/
|
|
2004
|
+
readonly syncMcpServers?: (servers: readonly FaceMcpServerDraft[], options?: {
|
|
2005
|
+
readonly allowConnect?: boolean;
|
|
2006
|
+
}) => Promise<{
|
|
2007
|
+
readonly failures: readonly {
|
|
2008
|
+
readonly serverName: string;
|
|
2009
|
+
readonly message: string;
|
|
2010
|
+
}[];
|
|
2011
|
+
readonly parked?: readonly string[];
|
|
2012
|
+
}>;
|
|
2013
|
+
/**
|
|
2014
|
+
* Last `syncMcpServers` overlay (parked / connectFailures). Mutate writes;
|
|
2015
|
+
* describe/get read so Settings UI does not reclassify failures as parked.
|
|
2016
|
+
*/
|
|
2017
|
+
mcpSyncOverlay: {
|
|
2018
|
+
connectFailures: readonly {
|
|
2019
|
+
readonly serverName: string;
|
|
2020
|
+
readonly message: string;
|
|
2021
|
+
}[];
|
|
2022
|
+
parked: readonly string[];
|
|
2023
|
+
};
|
|
2024
|
+
/** Standing / remembered tool presenters (wire tools get). */
|
|
2025
|
+
readonly getTool?: (sessionId: string, name: string) => Pick<ToolDefinition, "presentCall" | "presentResult"> | undefined;
|
|
2026
|
+
/** Product-shell `boot.json` entries (assembled client plugins). */
|
|
2027
|
+
readonly webPlugins?: readonly FaceWebPlugin[];
|
|
2028
|
+
/** Mutable UI prefs (theme/locale) — not secrets. */
|
|
2029
|
+
readonly uiSettings: FaceUiSettings;
|
|
2030
|
+
/** Read-only host public snapshot (from host spawn). */
|
|
2031
|
+
readonly hostPublic?: FaceHostPublicSettings;
|
|
2032
|
+
/** On-demand Cordis `host.mjs` apply (Host wires after dsh-compat prewarm). */
|
|
2033
|
+
readonly cordisHostBridge?: FaceCordisHostBridge;
|
|
2034
|
+
/** In-memory credential overrides — never session-logged. */
|
|
2035
|
+
readonly credentials: FaceCredentialVault;
|
|
2036
|
+
/**
|
|
2037
|
+
* Optional OS keyring / memory SecretStore overlay (`XRK_SECRETS_BACKEND`).
|
|
2038
|
+
* Face `.credentials.yaml` remains the default durable SoT.
|
|
2039
|
+
*/
|
|
2040
|
+
readonly secretStore?: import("@xrkseek/secrets").SecretStore;
|
|
2041
|
+
/** Face settings namespaces (welcome notice, etc.). */
|
|
2042
|
+
readonly settingsNamespaces: FaceSettingsNamespaces;
|
|
2043
|
+
/** Bootstrap Host API key from env/config (before vault override). */
|
|
2044
|
+
readonly bootstrapApiKey?: string;
|
|
2045
|
+
/** Optional policy engine (e.g. from XRK_POLICY_FILE) for provider.use gates. */
|
|
2046
|
+
readonly policy?: PolicyEngine;
|
|
2047
|
+
/**
|
|
2048
|
+
* Absolute path to a local settings/policy document.
|
|
2049
|
+
* Opened by `settings.openDocument` — request carries no filesystem path.
|
|
2050
|
+
*/
|
|
2051
|
+
readonly settingsDocumentPath?: string;
|
|
2052
|
+
/** Native opener; default platform `openNativePath`. */
|
|
2053
|
+
openNativePath?(target: string): Promise<void>;
|
|
2054
|
+
/** Native folder chooser; default platform `pickNativeDirectory`. Cancel → `null`. */
|
|
2055
|
+
pickNativeDirectory?(signal: AbortSignal): Promise<string | null>;
|
|
2056
|
+
/**
|
|
2057
|
+
* Remove a user-installed plugin (`xrkh plugin remove`). Host wires
|
|
2058
|
+
* CLI mutate; absent → inventory remove returns a CLI hint.
|
|
2059
|
+
*/
|
|
2060
|
+
removeUserPlugin?(spec: string): Promise<{
|
|
2061
|
+
readonly ok: boolean;
|
|
2062
|
+
readonly error?: string;
|
|
2063
|
+
}>;
|
|
2064
|
+
/**
|
|
2065
|
+
* Reinstall / bump a user plugin (`xrkh plugin add <spec>`). Spec is the
|
|
2066
|
+
* inventory `source` when known, else `name@latest`.
|
|
2067
|
+
*/
|
|
2068
|
+
updateUserPlugin?(spec: string): Promise<{
|
|
2069
|
+
readonly ok: boolean;
|
|
2070
|
+
readonly error?: string;
|
|
2071
|
+
}>;
|
|
2072
|
+
/**
|
|
2073
|
+
* After soft-disable / remove / update mutates disk: Host reconciles the
|
|
2074
|
+
* in-process plugin loader (unload disabled / missing, load newly enabled).
|
|
2075
|
+
* Client half still needs a browser reload (`needsRestart`).
|
|
2076
|
+
*/
|
|
2077
|
+
syncManagedProcessPlugins?(): Promise<void>;
|
|
2078
|
+
/**
|
|
2079
|
+
* Standing tool registry (preset layer) when no live agent is remembered.
|
|
2080
|
+
* Host wires Isolating WorkflowEngine `tools.*` from this.
|
|
2081
|
+
*/
|
|
2082
|
+
readonly tools?: ToolRegistry;
|
|
2083
|
+
/** Human approval waiters (tool policy `ask`). */
|
|
2084
|
+
readonly approvals: FaceApprovalBroker;
|
|
2085
|
+
/** DSH user-questions (`question/requested` + `/api/respond`). */
|
|
2086
|
+
readonly questions: FaceQuestionBroker;
|
|
2087
|
+
/** Drop cached agent when preset changes (host wires). May be async (compose dispose). */
|
|
2088
|
+
invalidateAgent?(sessionId: string): void | Promise<void>;
|
|
2089
|
+
/**
|
|
2090
|
+
* Session leaving the live set (archive / Host stop). Host may run curated-memory
|
|
2091
|
+
* Phase1 consolidate. Best-effort; failures must not block Face.
|
|
2092
|
+
*/
|
|
2093
|
+
onSessionFinalize?(sessionId: string): void | Promise<void>;
|
|
2094
|
+
/**
|
|
2095
|
+
* Last curated-memory consolidate report (Host updates after Phase1/2).
|
|
2096
|
+
* Optional — Status / `/status` surface when present.
|
|
2097
|
+
*/
|
|
2098
|
+
curatedMemoryConsolidate?: {
|
|
2099
|
+
sessionId: string;
|
|
2100
|
+
at: number;
|
|
2101
|
+
phase1Written: number;
|
|
2102
|
+
phase2: string;
|
|
2103
|
+
phase2Written: number;
|
|
2104
|
+
skipped?: string;
|
|
2105
|
+
providerKind?: string;
|
|
2106
|
+
};
|
|
2107
|
+
/** When true, `/permission` refuses sandbox mode changes while **Agent**
|
|
2108
|
+
* `terminal_*` PTY sessions are open or spawning (CV DSH terminal-bash
|
|
2109
|
+
* sandbox fence). Sidebar user terminals must not be reported here.
|
|
2110
|
+
*/
|
|
2111
|
+
hasPtyActivity?(): boolean;
|
|
2112
|
+
/** Host persists `/auto-review` slash to dsh-compat HTTP store (~/.xrk). */
|
|
2113
|
+
autoReviewSlashPersist?(args: string): void;
|
|
2114
|
+
/** Publish store appends as mux session/event. */
|
|
2115
|
+
watchSession(sessionId: string): void;
|
|
2116
|
+
publishQueue(sessionId: string): void;
|
|
2117
|
+
publishApprovals(sessionId: string): void;
|
|
2118
|
+
/**
|
|
2119
|
+
* DSH `session/jobs`. `undefined` = no registry (emit nothing).
|
|
2120
|
+
* Empty array is a live set that just cleared (still pushed on change).
|
|
2121
|
+
*/
|
|
2122
|
+
jobViewsFor(sessionId: string): JobView[] | undefined;
|
|
2123
|
+
publishJobs(sessionId: string, opts?: {
|
|
2124
|
+
baseline?: boolean;
|
|
2125
|
+
}): void;
|
|
2126
|
+
/**
|
|
2127
|
+
* Copy parent log into a new session without inventing title/fallback rows
|
|
2128
|
+
* (replay path).
|
|
2129
|
+
*/
|
|
2130
|
+
forkSession(sourceId: string, boundaryIndex?: number, childId?: string): SessionRecord;
|
|
2131
|
+
/**
|
|
2132
|
+
* Host drain status hook. Continuable children notify the parent on idle
|
|
2133
|
+
* (same wake budget as job completions). Idle notifies are epoch-scoped:
|
|
2134
|
+
* a later `running:true` drops in-flight stale delivers; transient resolve
|
|
2135
|
+
* failures retry once on the same idle stretch.
|
|
2136
|
+
*/
|
|
2137
|
+
onSessionDrainStatus(sessionId: string, running: boolean): void;
|
|
2138
|
+
/**
|
|
2139
|
+
* Suppress the parent completion steer for a continuable child (interrupt /
|
|
2140
|
+
* cancel). Must be called *before* draining the child to idle so the
|
|
2141
|
+
* cancel→idle race cannot re-admit a "finished a turn" notice.
|
|
2142
|
+
* Cleared when the child drain goes running again (resume via send_message).
|
|
2143
|
+
*/
|
|
2144
|
+
suppressOwnedSubagentCompletion(childSessionId: string): void;
|
|
2145
|
+
/** Shared shell registry for session-scoped job kill / background RPC. */
|
|
2146
|
+
readonly shell?: ShellService;
|
|
2147
|
+
}
|
|
2148
|
+
//#endregion
|
|
2149
|
+
//#region src/wire/respond.d.ts
|
|
2150
|
+
type ParsedClientResponse = {
|
|
2151
|
+
readonly ok: true;
|
|
2152
|
+
readonly rpcId: string;
|
|
2153
|
+
readonly value: unknown;
|
|
2154
|
+
} | {
|
|
2155
|
+
readonly ok: false;
|
|
2156
|
+
readonly reason: "bad-response";
|
|
2157
|
+
};
|
|
2158
|
+
/** 解析 `{ type: client-response, rpcId, result }`(ok:true 路径,审批用)。 */
|
|
2159
|
+
declare function parseClientResponse(body: unknown): ParsedClientResponse;
|
|
2160
|
+
/** 把 client-response 交给审批或提问 broker,返回 DSH 回执。 */
|
|
2161
|
+
declare function settleFaceRespond(runtime: FaceRuntime, body: unknown): FaceRpcReceipt;
|
|
2162
|
+
//#endregion
|
|
2163
|
+
//#region src/runtime.d.ts
|
|
2164
|
+
interface CreateFaceRuntimeOptions {
|
|
2165
|
+
readonly store: SessionStore;
|
|
2166
|
+
readonly resolveAgent: (sessionId: string) => Promise<AgentHandle>;
|
|
2167
|
+
readonly drain: FaceDrain;
|
|
2168
|
+
readonly workspaceRoot: string;
|
|
2169
|
+
/** SSH remote execution world — see {@link FaceRuntime.remoteExecution}. */
|
|
2170
|
+
readonly remoteExecution?: boolean;
|
|
2171
|
+
/** Local Host cwd before SSH swap — see {@link FaceRuntime.localHostRoot}. */
|
|
2172
|
+
readonly localHostRoot?: string;
|
|
2173
|
+
/** SSH-backed directory browse — see {@link FaceRuntime.directoryBackend}. */
|
|
2174
|
+
readonly directoryBackend?: FaceDirectoryBackend;
|
|
2175
|
+
/** Override harness home for settings/creds (default `~/.xrk`). Workspace inject stays `{workspaceRoot}/.xrk`. */
|
|
2176
|
+
readonly productDir?: string;
|
|
2177
|
+
readonly version?: string;
|
|
2178
|
+
readonly defaultAgentPreset?: string;
|
|
2179
|
+
readonly registry?: ProviderRegistry;
|
|
2180
|
+
readonly bus?: FaceBus;
|
|
2181
|
+
readonly seq?: FaceSeqClock;
|
|
2182
|
+
readonly projections?: FaceProjectionRegistry;
|
|
2183
|
+
readonly skipDefaultProjections?: boolean;
|
|
2184
|
+
readonly loadSlashRecipes?: SlashRecipesLoader;
|
|
2185
|
+
/** Process plugins for `pluginInventory/list` + `commands/*`. */
|
|
2186
|
+
readonly plugins?: readonly FaceProcessPlugin[];
|
|
2187
|
+
/**
|
|
2188
|
+
* Host live-applies Face `mcp.servers` when MCP is sourced from
|
|
2189
|
+
* host-settings.json (env empty).
|
|
2190
|
+
*/
|
|
2191
|
+
readonly syncMcpServers?: (servers: readonly FaceMcpServerDraft[]) => Promise<{
|
|
2192
|
+
readonly failures: readonly {
|
|
2193
|
+
readonly serverName: string;
|
|
2194
|
+
readonly message: string;
|
|
2195
|
+
}[];
|
|
2196
|
+
}>;
|
|
2197
|
+
/** Product-shell boot entries listed in inventory. */
|
|
2198
|
+
readonly webPlugins?: readonly FaceWebPlugin[];
|
|
2199
|
+
readonly invalidateAgent?: (sessionId: string) => void | Promise<void>;
|
|
2200
|
+
/**
|
|
2201
|
+
* Host Phase1 / teardown hook when a session leaves the live set
|
|
2202
|
+
* (archive). Optional — Host may also run consolidate on stop.
|
|
2203
|
+
*/
|
|
2204
|
+
readonly onSessionFinalize?: (sessionId: string) => void | Promise<void>;
|
|
2205
|
+
/** Public host runtime snapshot for settings.get (no secrets). */
|
|
2206
|
+
readonly hostPublic?: FaceHostPublicSettings;
|
|
2207
|
+
/** Cordis panel `runHostHalf` → dsh-compat `host.mjs` apply. */
|
|
2208
|
+
readonly cordisHostBridge?: FaceCordisHostBridge;
|
|
2209
|
+
/** Initial Host API key from env (vault may override). */
|
|
2210
|
+
readonly bootstrapApiKey?: string;
|
|
2211
|
+
/** Optional SecretStore overlay (OS keyring / memory). */
|
|
2212
|
+
readonly secretStore?: import("@xrkseek/secrets").SecretStore;
|
|
2213
|
+
readonly uiSettings?: FaceUiSettings;
|
|
2214
|
+
readonly policy?: PolicyEngine;
|
|
2215
|
+
/**
|
|
2216
|
+
* Host-resolved settings document (e.g. `XRK_POLICY_FILE`).
|
|
2217
|
+
* `settings.openDocument` never takes a browser path.
|
|
2218
|
+
*/
|
|
2219
|
+
readonly settingsDocumentPath?: string;
|
|
2220
|
+
/** Inject native opener (tests). Default `openNativePath`. */
|
|
2221
|
+
readonly openNativePath?: (target: string) => Promise<void>;
|
|
2222
|
+
/** Inject native folder chooser (tests). Default `pickNativeDirectory`. */
|
|
2223
|
+
readonly pickNativeDirectory?: (signal: AbortSignal) => Promise<string | null>;
|
|
2224
|
+
/** Host wires `xrkh plugin remove` for Settings inventory. */
|
|
2225
|
+
readonly removeUserPlugin?: (spec: string) => Promise<{
|
|
2226
|
+
readonly ok: boolean;
|
|
2227
|
+
readonly error?: string;
|
|
2228
|
+
}>;
|
|
2229
|
+
/** Host wires `xrkh plugin add` for Settings inventory update. */
|
|
2230
|
+
readonly updateUserPlugin?: (spec: string) => Promise<{
|
|
2231
|
+
readonly ok: boolean;
|
|
2232
|
+
readonly error?: string;
|
|
2233
|
+
}>;
|
|
2234
|
+
/**
|
|
2235
|
+
* Live-reconcile process plugins after inventory soft-disable / remove /
|
|
2236
|
+
* update (Host). Client boot still needs a page reload.
|
|
2237
|
+
*/
|
|
2238
|
+
readonly syncManagedProcessPlugins?: () => Promise<void>;
|
|
2239
|
+
/** Durable image store (default none → image RPCs unavailable). */
|
|
2240
|
+
readonly attachments?: AttachmentStore;
|
|
2241
|
+
/** Standing tool registry (preset layer) when no live agent is remembered. */
|
|
2242
|
+
readonly tools?: ToolRegistry;
|
|
2243
|
+
/** Standing / unowned jobs (DSH `ctx.jobs` without an owner). */
|
|
2244
|
+
readonly jobs?: FaceJobsSource;
|
|
2245
|
+
/**
|
|
2246
|
+
* When true, `/permission` refuses sandbox mode changes while **Agent**
|
|
2247
|
+
* `terminal_*` PTY sessions are open or spawning (CV DSH terminal-bash
|
|
2248
|
+
* sandbox fence). Sidebar user terminals must not be reported here.
|
|
2249
|
+
*/
|
|
2250
|
+
readonly hasPtyActivity?: () => boolean;
|
|
2251
|
+
/** Host input modalities; default text-only. */
|
|
2252
|
+
readonly inputModalities?: readonly ("text" | "image")[];
|
|
2253
|
+
/** Host persists `/auto-review` slash to dsh-compat store (DSH panel HTTP). */
|
|
2254
|
+
readonly autoReviewSlashPersist?: (args: string) => void;
|
|
2255
|
+
/** Optional JSON sidecar for parent→child links (sessions directory). */
|
|
2256
|
+
readonly subagentPersistPath?: string;
|
|
2257
|
+
/** Optional JSON sidecar for Face goals (sessions directory). */
|
|
2258
|
+
readonly goalPersistPath?: string;
|
|
2259
|
+
/**
|
|
2260
|
+
* Directory for conversation-slice JSON written on session feedback
|
|
2261
|
+
* (`{sessionsDir}/feedback-slices`).
|
|
2262
|
+
*/
|
|
2263
|
+
readonly feedbackSlicesDir?: string;
|
|
2264
|
+
/**
|
|
2265
|
+
* Cold `session.list` projection column (`title` · `sessionListMetadata`).
|
|
2266
|
+
* Typical path: `{sessionsDir}/projection-list-cache.json`.
|
|
2267
|
+
*/
|
|
2268
|
+
readonly listProjectionCachePath?: string;
|
|
2269
|
+
/** Shared shell job registry (harness/server preset). */
|
|
2270
|
+
readonly shell?: ShellService;
|
|
2271
|
+
}
|
|
2272
|
+
/**
|
|
2273
|
+
* Builds Face runtime and patches `store.append` in-place so REST + Face share
|
|
2274
|
+
* one log; mux receives adapted session/event (+ tool view) and projections.
|
|
2275
|
+
*/
|
|
2276
|
+
declare function createFaceRuntime(options: CreateFaceRuntimeOptions): FaceRuntime;
|
|
2277
|
+
//#endregion
|
|
2278
|
+
//#region src/plugin-boot.d.ts
|
|
2279
|
+
interface ClientBootEntry {
|
|
2280
|
+
readonly id: string;
|
|
2281
|
+
readonly url: string;
|
|
2282
|
+
readonly rev: string;
|
|
2283
|
+
readonly inject: readonly string[];
|
|
2284
|
+
readonly immediately?: boolean;
|
|
2285
|
+
}
|
|
2286
|
+
interface ClientBootReconcileResult {
|
|
2287
|
+
readonly rev: string;
|
|
2288
|
+
readonly entries: readonly ClientBootEntry[];
|
|
2289
|
+
/** False when on-disk boot already matched (no rewrite / no cache bust). */
|
|
2290
|
+
readonly wrote: boolean;
|
|
2291
|
+
/** True when disabled file was rewritten (orphan prune and/or canonicalize). */
|
|
2292
|
+
readonly prunedDisabled: boolean;
|
|
2293
|
+
}
|
|
2294
|
+
/**
|
|
2295
|
+
* Rewrite `{pluginsDir}/web/boot.json` from `.xrk-plugins.json` client rows,
|
|
2296
|
+
* omitting soft-disabled ids and pruning/canonicalizing the disabled file.
|
|
2297
|
+
*/
|
|
2298
|
+
declare function reconcileClientBootAt(pluginsDir: string): ClientBootReconcileResult;
|
|
2299
|
+
//#endregion
|
|
2300
|
+
//#region src/session-feedback.d.ts
|
|
2301
|
+
/** Product taxonomy in presentation order (durable log vocabulary). */
|
|
2302
|
+
declare const FEEDBACK_CATEGORIES: readonly ["task-result", "instruction-following", "product-interaction", "service-stability", "resource-cost", "security-privacy-permission", "other"];
|
|
2303
|
+
declare const FEEDBACK_TEXT_MAX_CHARS = 8192;
|
|
2304
|
+
type SessionFeedbackEntry = {
|
|
2305
|
+
readonly text?: string;
|
|
2306
|
+
readonly category?: FeedbackCategory;
|
|
2307
|
+
};
|
|
2308
|
+
type TypertOk<T> = {
|
|
2309
|
+
readonly ok: true;
|
|
2310
|
+
readonly value: T;
|
|
2311
|
+
};
|
|
2312
|
+
type TypertFail = {
|
|
2313
|
+
readonly ok: false;
|
|
2314
|
+
readonly error: Record<string, unknown> & {
|
|
2315
|
+
readonly code: string;
|
|
2316
|
+
};
|
|
2317
|
+
};
|
|
2318
|
+
declare function isFeedbackCategory(value: unknown): value is FeedbackCategory;
|
|
2319
|
+
/**
|
|
2320
|
+
* Normalize human input: trim text (blank → absent); keep category when valid.
|
|
2321
|
+
*/
|
|
2322
|
+
declare function normalizeFeedbackEntry(entry: SessionFeedbackEntry): SessionFeedbackEntry;
|
|
2323
|
+
/**
|
|
2324
|
+
* Persist a conversation-prefix sidecar next to sessions; returns sliceId or
|
|
2325
|
+
* undefined when the directory is unset or write fails (record still succeeds).
|
|
2326
|
+
*/
|
|
2327
|
+
declare function writeFeedbackConversationSlice(slicesDir: string | undefined, sessionId: string, events: readonly SessionEvent[]): string | undefined;
|
|
2328
|
+
/**
|
|
2329
|
+
* Append one `feedback/record` (log-only). Blank text is omitted; category-only
|
|
2330
|
+
* and empty drafts are valid. Optionally attaches a conversation-slice id.
|
|
2331
|
+
*/
|
|
2332
|
+
declare function recordSessionFeedback(store: SessionStore, sessionId: string, entry: SessionFeedbackEntry, options?: {
|
|
2333
|
+
readonly slicesDir?: string;
|
|
2334
|
+
readonly ts?: number;
|
|
2335
|
+
}): {
|
|
2336
|
+
readonly recorded: true;
|
|
2337
|
+
readonly sliceId?: string;
|
|
2338
|
+
};
|
|
2339
|
+
/**
|
|
2340
|
+
* Face Typert `sessionFeedback/record` — nested `{ ok, value|error }` like
|
|
2341
|
+
* messageFeedback (carrier ok wraps business result).
|
|
2342
|
+
*/
|
|
2343
|
+
declare function sessionFeedbackRecord(store: SessionStore, input: {
|
|
2344
|
+
readonly sessionId: string;
|
|
2345
|
+
readonly text?: unknown;
|
|
2346
|
+
readonly category?: unknown;
|
|
2347
|
+
}, options?: {
|
|
2348
|
+
readonly slicesDir?: string;
|
|
2349
|
+
}): FaceRpcResult<TypertOk<{
|
|
2350
|
+
recorded: true;
|
|
2351
|
+
sliceId?: string;
|
|
2352
|
+
}> | TypertFail>;
|
|
2353
|
+
//#endregion
|
|
2354
|
+
//#region src/goal-round-driver.d.ts
|
|
2355
|
+
/**
|
|
2356
|
+
* Same-session goal round driver helpers (dsh goal-round-driver semantics,
|
|
2357
|
+
* without Cordis). FaceGoalStore owns state; this module owns the retained
|
|
2358
|
+
* continuation prompt and turn/end scheduling decisions.
|
|
2359
|
+
*/
|
|
2360
|
+
/** Minimal goal fields the driver needs. */
|
|
2361
|
+
interface GoalRoundSnapshot {
|
|
2362
|
+
readonly objective: string;
|
|
2363
|
+
readonly phase: "active" | "paused" | "blocked" | "complete";
|
|
2364
|
+
readonly activation: "armed" | "disarmed";
|
|
2365
|
+
readonly maxGoalRounds: number;
|
|
2366
|
+
readonly roundsStarted: number;
|
|
2367
|
+
}
|
|
2368
|
+
type GoalTurnEndDecision = {
|
|
2369
|
+
readonly kind: "noop";
|
|
2370
|
+
} | {
|
|
2371
|
+
readonly kind: "wake-pending";
|
|
2372
|
+
} | {
|
|
2373
|
+
readonly kind: "continue";
|
|
2374
|
+
readonly round: number;
|
|
2375
|
+
readonly prompt: string;
|
|
2376
|
+
} | {
|
|
2377
|
+
readonly kind: "block";
|
|
2378
|
+
readonly code: string;
|
|
2379
|
+
readonly message: string;
|
|
2380
|
+
} | {
|
|
2381
|
+
readonly kind: "disarm";
|
|
2382
|
+
readonly code: string;
|
|
2383
|
+
readonly message: string;
|
|
2384
|
+
};
|
|
2385
|
+
/**
|
|
2386
|
+
* Render the retained `<goal_round>` user prompt for one automatic round.
|
|
2387
|
+
* Round is 1-based and must equal `roundsStarted + 1` at admission time.
|
|
2388
|
+
*/
|
|
2389
|
+
declare function renderGoalRoundPrompt(goal: Pick<GoalRoundSnapshot, "objective" | "maxGoalRounds">, round: number): string;
|
|
2390
|
+
/** First-round / resume prompt (still tags `<goal_round>` for model consistency). */
|
|
2391
|
+
declare function renderGoalStartPrompt(goal: Pick<GoalRoundSnapshot, "objective" | "maxGoalRounds">, round: number, lead: "start" | "resume"): string;
|
|
2392
|
+
/**
|
|
2393
|
+
* Decide what happens after `turn/end` for an armed active goal.
|
|
2394
|
+
* @param hasPendingAdmits - session already has queued admits (wake only).
|
|
2395
|
+
* @param turnReasonKind - `turn/end.reason.kind` when present.
|
|
2396
|
+
*/
|
|
2397
|
+
declare function decideGoalTurnEnd(input: {
|
|
2398
|
+
readonly goal: GoalRoundSnapshot;
|
|
2399
|
+
readonly hasPendingAdmits: boolean;
|
|
2400
|
+
readonly turnReasonKind?: string;
|
|
2401
|
+
}): GoalTurnEndDecision;
|
|
2402
|
+
//#endregion
|
|
2403
|
+
//#region src/goal-tools.d.ts
|
|
2404
|
+
interface BindGoalToolsOptions {
|
|
2405
|
+
readonly runtime: FaceRuntime;
|
|
2406
|
+
readonly sessionId: string;
|
|
2407
|
+
}
|
|
2408
|
+
/** Register `get_goal` + `update_goal` on the session tool registry. */
|
|
2409
|
+
declare function bindGoalTools(tools: ToolRegistry, options: BindGoalToolsOptions): void;
|
|
2410
|
+
//#endregion
|
|
2411
|
+
//#region src/propose-skill.d.ts
|
|
2412
|
+
declare const PROPOSE_SKILL_APPROVE_LABEL = "Write skill";
|
|
2413
|
+
declare const PROPOSE_SKILL_REJECT_LABEL = "Reject";
|
|
2414
|
+
declare const PROPOSE_SKILL_QUESTION_ID = "propose-skill";
|
|
2415
|
+
declare function proposeSkillQuestions(draft: ProposeSkillDraft): FaceQuestionItem[];
|
|
2416
|
+
interface BindProposeSkillToolOptions {
|
|
2417
|
+
readonly workspaceRoot: string;
|
|
2418
|
+
readonly sessionId: string;
|
|
2419
|
+
readonly skillsRoot?: string;
|
|
2420
|
+
readonly ask: (questions: readonly FaceQuestionItem[], signal?: AbortSignal) => Promise<FaceQuestionAnswer>;
|
|
2421
|
+
}
|
|
2422
|
+
/** Register / replace `propose_skill` with Face confirm → write. */
|
|
2423
|
+
declare function bindProposeSkillTool(tools: ToolRegistry, options: BindProposeSkillToolOptions): void;
|
|
2424
|
+
//#endregion
|
|
2425
|
+
//#region src/session-export.d.ts
|
|
2426
|
+
declare const SESSION_EXPORT_PATHS: readonly ["/api/session.export", "/api/face/session.export"];
|
|
2427
|
+
declare function isSessionExportPath(pathname: string): boolean;
|
|
2428
|
+
declare function sessionExportFilename(sessionId: string): string;
|
|
2429
|
+
//#endregion
|
|
2430
|
+
//#region src/handlers/types.d.ts
|
|
2431
|
+
type FaceHandler = (runtime: FaceRuntime, rpcId: string, payload: unknown) => Promise<FaceRpcResult<unknown>>;
|
|
2432
|
+
//#endregion
|
|
2433
|
+
//#region src/dispatch.d.ts
|
|
2434
|
+
declare function getHandler(method: string): FaceHandler | undefined;
|
|
2435
|
+
declare function dispatchFaceMethod(runtime: FaceRuntime, method: string, rpcId: string, payload: unknown): Promise<FaceRpcResponse>;
|
|
2436
|
+
//#endregion
|
|
2437
|
+
//#region src/remote-event.d.ts
|
|
2438
|
+
declare const FACE_HOST_REMOTE_EVENTS: readonly ["agent-preset/selected", "commands/change", "credentials/updated", "llm/adapters-updated", "settings/document-updated"];
|
|
2439
|
+
type FaceHostRemoteEvent = (typeof FACE_HOST_REMOTE_EVENTS)[number];
|
|
2440
|
+
type FaceRemoteArg = string | number | boolean | null;
|
|
2441
|
+
declare function publishRemoteEvent(bus: Pick<FaceBus, "publishHost">, event: FaceHostRemoteEvent, args?: readonly FaceRemoteArg[]): void;
|
|
2442
|
+
//#endregion
|
|
2443
|
+
//#region src/plan-mode.d.ts
|
|
2444
|
+
type PlanSetOutcome = "committed" | "queued" | "cancelled" | "noop";
|
|
2445
|
+
declare function planWantedFromArgs(rawInput: string): boolean;
|
|
2446
|
+
/**
|
|
2447
|
+
* Decide a `/plan` selection against the log *before* this command/run.
|
|
2448
|
+
* Caller logs `command/run` first, then appends `plan/mode` only when
|
|
2449
|
+
* this returns `committed`.
|
|
2450
|
+
*/
|
|
2451
|
+
declare function previewPlanSet(events: readonly import("@xrkseek/protocol").SessionEvent[], active: boolean): PlanSetOutcome;
|
|
2452
|
+
declare function commitPlanMode(store: SessionStore, sessionId: string, active: boolean): void;
|
|
2453
|
+
declare function narratePlanCommand(outcome: PlanSetOutcome, wanted: boolean, loggedActive: boolean): string;
|
|
2454
|
+
/** Optional `/plan <message>` suffix becomes the next user prompt. */
|
|
2455
|
+
declare function steerPlanMessage(store: SessionStore, sessionId: string, rawInput: string): string | undefined;
|
|
2456
|
+
//#endregion
|
|
2457
|
+
//#region src/attach-http.d.ts
|
|
2458
|
+
interface AttachFaceOptions {
|
|
2459
|
+
readonly apiKey: string;
|
|
2460
|
+
checkAuth(req: IncomingMessage): boolean;
|
|
2461
|
+
/**
|
|
2462
|
+
* Mux/host WebSocket Ping cadence (ms). Defaults to
|
|
2463
|
+
* {@link FACE_WS_HEARTBEAT_INTERVAL_MS}; tests may shorten it.
|
|
2464
|
+
*/
|
|
2465
|
+
readonly heartbeatIntervalMs?: number;
|
|
2466
|
+
}
|
|
2467
|
+
/**
|
|
2468
|
+
* 若路径是 Face unary 或 `/api/respond`,接管响应并返回 true。
|
|
2469
|
+
*/
|
|
2470
|
+
declare function tryHandleFaceHttp(req: IncomingMessage, res: ServerResponse, runtime: FaceRuntime, options: AttachFaceOptions): boolean;
|
|
2471
|
+
declare function attachFaceUpgrades(server: Server, runtime: FaceRuntime, options: AttachFaceOptions): {
|
|
2472
|
+
close(): void;
|
|
2473
|
+
};
|
|
2474
|
+
/** 仅 Face 的测试/边车服务器。 */
|
|
2475
|
+
declare function createFaceOnlyServer(runtime: FaceRuntime, options: AttachFaceOptions & {
|
|
2476
|
+
host?: string;
|
|
2477
|
+
port?: number;
|
|
2478
|
+
}): {
|
|
2479
|
+
listen(): Promise<{
|
|
2480
|
+
host: string;
|
|
2481
|
+
port: number;
|
|
2482
|
+
}>;
|
|
2483
|
+
close(): Promise<void>;
|
|
2484
|
+
readonly server: Server;
|
|
2485
|
+
};
|
|
2486
|
+
declare function handleFaceHttpRequest(runtime: FaceRuntime, method: string, body: unknown): Promise<unknown>;
|
|
2487
|
+
//#endregion
|
|
2488
|
+
//#region src/ws-heartbeat.d.ts
|
|
2489
|
+
/** Default interval between Ping control frames (ms). */
|
|
2490
|
+
declare const FACE_WS_HEARTBEAT_INTERVAL_MS = 2000;
|
|
2491
|
+
/**
|
|
2492
|
+
* Missed Ping answers before terminate. DSH gateway uses 2; Face mux shares
|
|
2493
|
+
* the Host event loop with tool / projection work (no per-stream uplink byte
|
|
2494
|
+
* window), so 5 ≈ 10s at the default interval avoids mid-turn false kills.
|
|
2495
|
+
*/
|
|
2496
|
+
declare const FACE_WS_HEARTBEAT_MAX_MISSED = 5;
|
|
2497
|
+
interface WsHeartbeat {
|
|
2498
|
+
/** Arm Ping tracking for one accepted socket; starts the shared timer. */
|
|
2499
|
+
watch(ws: WebSocket): void;
|
|
2500
|
+
/** Clear the shared timer (call from Face upgrade close). */
|
|
2501
|
+
stop(): void;
|
|
2502
|
+
}
|
|
2503
|
+
/**
|
|
2504
|
+
* Shared Ping/Pong watchdog across one or more `noServer` WebSocketServers.
|
|
2505
|
+
* @param servers - Face mux and/or host acceptors.
|
|
2506
|
+
* @param intervalMs - Ping cadence and per-miss deadline (default 2s).
|
|
2507
|
+
*/
|
|
2508
|
+
declare function startWsHeartbeat(servers: readonly WebSocketServer[], intervalMs?: number): WsHeartbeat;
|
|
2509
|
+
//#endregion
|
|
2510
|
+
//#region src/adapt/tool-view.d.ts
|
|
2511
|
+
declare class FaceToolArgMaps {
|
|
2512
|
+
private readonly sessions;
|
|
2513
|
+
remember(sessionId: string, event: SessionEvent): void;
|
|
2514
|
+
forSession(sessionId: string): Map<string, ToolCallPairing$1>;
|
|
2515
|
+
/**
|
|
2516
|
+
* Drop a session's arg-pairing map entirely (outer entry included). Called
|
|
2517
|
+
* on session eviction; clearing only the inner map would leave the outer
|
|
2518
|
+
* `sessions` entry behind and grow without bound across evictions.
|
|
2519
|
+
*/
|
|
2520
|
+
clear(sessionId: string): void;
|
|
2521
|
+
}
|
|
2522
|
+
declare function collectToolCallArgs(events: readonly SessionEvent[]): Map<string, ToolCallPairing$1>;
|
|
2523
|
+
declare function faceToolLookup(getTool: PresentToolLookup$1["getTool"], argsByCallId?: ReadonlyMap<string, ToolCallPairing$1>): PresentToolLookup$1;
|
|
2524
|
+
/** Face `viewFor` — missing lookup / pairing / presenter → no view. */
|
|
2525
|
+
declare function presentToolView(event: SessionEvent, lookup?: PresentToolLookup$1): ToolEventView$1 | undefined;
|
|
2526
|
+
//#endregion
|
|
2527
|
+
//#region src/adapt/model-route.d.ts
|
|
2528
|
+
/**
|
|
2529
|
+
* Assistant wire `message.source` attribution (Face mux / history).
|
|
2530
|
+
* Prefer the live `request/header` route; fall back to session model selection.
|
|
2531
|
+
*/
|
|
2532
|
+
interface FaceModelRoute {
|
|
2533
|
+
readonly provider: string;
|
|
2534
|
+
readonly model: string;
|
|
2535
|
+
}
|
|
2536
|
+
/** Wire source when no route is known yet (unit tests / cold sessions). */
|
|
2537
|
+
declare const FACE_ASSISTANT_SOURCE_PLACEHOLDER: {
|
|
2538
|
+
readonly kind: "model";
|
|
2539
|
+
readonly provider: "xrk";
|
|
2540
|
+
readonly model: "unknown";
|
|
2541
|
+
};
|
|
2542
|
+
/** Cost-ledger key when usage arrives before any request/header. */
|
|
2543
|
+
declare const FACE_USAGE_ROUTE_PLACEHOLDER: FaceModelRoute;
|
|
2544
|
+
/**
|
|
2545
|
+
* Normalize an optional route into Face assistant `message.source`.
|
|
2546
|
+
* Empty strings fall back to the placeholder so token-meter never sees blanks.
|
|
2547
|
+
*/
|
|
2548
|
+
declare function assistantMessageSource(route?: FaceModelRoute | null): {
|
|
2549
|
+
readonly kind: "model";
|
|
2550
|
+
readonly provider: string;
|
|
2551
|
+
readonly model: string;
|
|
2552
|
+
};
|
|
2553
|
+
/** `provider:model` map key for costUsage / cost-meter buckets. */
|
|
2554
|
+
declare function providerModelKey(route: FaceModelRoute): string;
|
|
2555
|
+
declare function routeFromRequestHeader(event: {
|
|
2556
|
+
readonly type: string;
|
|
2557
|
+
readonly header?: {
|
|
2558
|
+
readonly config?: {
|
|
2559
|
+
readonly provider?: string;
|
|
2560
|
+
readonly model?: string;
|
|
2561
|
+
};
|
|
2562
|
+
};
|
|
2563
|
+
}): FaceModelRoute | undefined;
|
|
2564
|
+
//#endregion
|
|
2565
|
+
//#region src/adapt/wire-event.d.ts
|
|
2566
|
+
/** Published isomorphism keys (XRK type → wire role). */
|
|
2567
|
+
declare const EVENT_ISOMORPHISM: {
|
|
2568
|
+
readonly "user/message": "user";
|
|
2569
|
+
readonly "assistant/chunk": "assistant.delta";
|
|
2570
|
+
readonly "assistant/message": "assistant.message";
|
|
2571
|
+
readonly "tool/call": "tool.call";
|
|
2572
|
+
readonly "tool/result": "tool.result";
|
|
2573
|
+
readonly "turn/start": "turn.start";
|
|
2574
|
+
readonly "turn/end": "turn.end";
|
|
2575
|
+
readonly "step/start": "step.start";
|
|
2576
|
+
readonly "step/end": "step.end";
|
|
2577
|
+
readonly "prompt/admitted": "agent/inbox/spliced";
|
|
2578
|
+
readonly "prompt/promoted": "agent/inbox/spliced";
|
|
2579
|
+
readonly "prompt/withdrawn": "agent/inbox/spliced";
|
|
2580
|
+
readonly "safety/notice": "safety";
|
|
2581
|
+
readonly "context/compaction": "compaction";
|
|
2582
|
+
readonly "session/title": "title";
|
|
2583
|
+
readonly "approval/asked": "approval.asked";
|
|
2584
|
+
readonly "approval/decided": "approval.decided";
|
|
2585
|
+
readonly "command/run": "command/run";
|
|
2586
|
+
readonly "command/done": "command/done";
|
|
2587
|
+
readonly "todo/write": "todo/write";
|
|
2588
|
+
readonly "permission/preset": "permission/preset";
|
|
2589
|
+
readonly "sandbox/mode": "sandbox/mode";
|
|
2590
|
+
readonly "approval/policy": "approval/policy";
|
|
2591
|
+
readonly "plan/mode": "plan/mode";
|
|
2592
|
+
readonly "feedback/record": "feedback/record";
|
|
2593
|
+
readonly "request/header": "request.header";
|
|
2594
|
+
readonly "llm/retry": "llm.retry";
|
|
2595
|
+
readonly "llm/retry-started": "llm.retry-started";
|
|
2596
|
+
readonly "image/offload": "image/offload";
|
|
2597
|
+
readonly "workspace/changes": "workspace/changes";
|
|
2598
|
+
readonly "deliverables/presented": "deliverables/presented";
|
|
2599
|
+
};
|
|
2600
|
+
/** SessionEvent envelope on the Face wire. */
|
|
2601
|
+
interface FaceWireSessionEvent {
|
|
2602
|
+
readonly type: string;
|
|
2603
|
+
readonly seq: number;
|
|
2604
|
+
readonly time: number;
|
|
2605
|
+
readonly data: unknown;
|
|
2606
|
+
/**
|
|
2607
|
+
* Face surface marker. Client conversation fold only updates
|
|
2608
|
+
* `assistant/message` / `tool/result` / `user/message` when this is `append`
|
|
2609
|
+
* (see `isAppendSurfaceEvent`). XRK protocol events have no surfaceOp — Face
|
|
2610
|
+
* stamps append on the three model-visible types at the wire boundary.
|
|
2611
|
+
*/
|
|
2612
|
+
readonly surfaceOp?: "append" | {
|
|
2613
|
+
readonly op: "replace";
|
|
2614
|
+
readonly start: number;
|
|
2615
|
+
readonly end: number;
|
|
2616
|
+
};
|
|
2617
|
+
/** When true, product-shell fold may skip unknown / non-product events. */
|
|
2618
|
+
readonly ignorable?: true;
|
|
2619
|
+
}
|
|
2620
|
+
interface WireHistoryEntry {
|
|
2621
|
+
readonly event: FaceWireSessionEvent;
|
|
2622
|
+
readonly view?: ToolEventView;
|
|
2623
|
+
}
|
|
2624
|
+
interface WireAdaptContext {
|
|
2625
|
+
readonly sessionId: string;
|
|
2626
|
+
readonly ids?: FaceWireIdMaps;
|
|
2627
|
+
/**
|
|
2628
|
+
* Ordered inbox projector. Required for prompt/* ? `agent/inbox/spliced`.
|
|
2629
|
+
* History builds a fresh projector; mux reuses the per-session instance.
|
|
2630
|
+
*/
|
|
2631
|
+
readonly inbox?: FaceInboxWireProjector;
|
|
2632
|
+
/**
|
|
2633
|
+
* Call-id ? { name, args } pairing for result-time presenters (wire `argsFor`).
|
|
2634
|
+
* History precomputes from the log; mux uses FaceToolArgMaps.
|
|
2635
|
+
*/
|
|
2636
|
+
readonly toolArgs?: ReadonlyMap<string, {
|
|
2637
|
+
readonly name: string;
|
|
2638
|
+
readonly args: unknown;
|
|
2639
|
+
}>;
|
|
2640
|
+
/** Tool presenter lookup (standing tools get). Omit ? no view. */
|
|
2641
|
+
readonly getTool?: PresentToolLookup["getTool"];
|
|
2642
|
+
/**
|
|
2643
|
+
* LLM route for this session's current attempt (`request/header` / session
|
|
2644
|
+
* model). Used as `assistant/message` wire `source`; omit → placeholder.
|
|
2645
|
+
*/
|
|
2646
|
+
readonly modelRoute?: FaceModelRoute;
|
|
2647
|
+
}
|
|
2648
|
+
/**
|
|
2649
|
+
* Fallback when no FaceWireIdMaps (unit tests). Prefer maps in production path.
|
|
2650
|
+
*/
|
|
2651
|
+
declare function wireNumericId(id: string): number;
|
|
2652
|
+
/** Map XRK flat event → Face `{ type, seq, time, data }`. */
|
|
2653
|
+
declare function toFaceWireSessionEvent(event: SessionEvent, seq: number, ctx?: WireAdaptContext): FaceWireSessionEvent;
|
|
2654
|
+
declare function toWireHistoryEntry(event: SessionEvent, seq: number, ctx?: WireAdaptContext): WireHistoryEntry;
|
|
2655
|
+
declare function toMuxSessionEvent(sessionId: string, event: SessionEvent, seq: number, ctx?: WireAdaptContext): {
|
|
2656
|
+
readonly type: "session/event";
|
|
2657
|
+
readonly sessionId: string;
|
|
2658
|
+
readonly event: FaceWireSessionEvent;
|
|
2659
|
+
readonly seq: number;
|
|
2660
|
+
readonly view?: ToolEventView;
|
|
2661
|
+
};
|
|
2662
|
+
//#endregion
|
|
2663
|
+
//#region src/adapt/subagent-notice.d.ts
|
|
2664
|
+
/**
|
|
2665
|
+
* Child body text for parent-facing completion / tool results.
|
|
2666
|
+
*
|
|
2667
|
+
* Only `assistant/message.content` (or text `assistant/chunk`s). Never
|
|
2668
|
+
* `reasoning` / reasoning chunks — parent providers must not receive the
|
|
2669
|
+
* child's CoT in the next request (DSH settlement keeps text blocks only;
|
|
2670
|
+
* Codex: reasoning never enters the parent session).
|
|
2671
|
+
*/
|
|
2672
|
+
declare function lastAssistantBodyText(events: readonly SessionEvent[]): string;
|
|
2673
|
+
/**
|
|
2674
|
+
* Parent inbox notice when a background (continuable) child drain goes idle.
|
|
2675
|
+
* Mirrors job completion copy: short status + how to follow up.
|
|
2676
|
+
*/
|
|
2677
|
+
declare function formatSubagentCompletionNotice(link: FaceSubagentLink, events: readonly SessionEvent[], maxPreviewChars?: number): string;
|
|
2678
|
+
//#endregion
|
|
2679
|
+
//#region src/presets-catalog.d.ts
|
|
2680
|
+
/** Catalog of Face-exposed session agent presets (tool composition badges). */
|
|
2681
|
+
type AgentToolComposition = "minimal" | "harness";
|
|
2682
|
+
/**
|
|
2683
|
+
* Built-in session badges (five tiers).
|
|
2684
|
+
* Plan mode is `/plan` / `exit_plan_mode`, not a badge.
|
|
2685
|
+
* Order matches product picker: lighter → fuller.
|
|
2686
|
+
*/
|
|
2687
|
+
type CatalogAgentPresetId = "minimal" | "shell" | "frugal" | "shallow" | "harness";
|
|
2688
|
+
/** Subagent policy for a session badge (Host binds tools from this). */
|
|
2689
|
+
interface AgentSubagentPolicy {
|
|
2690
|
+
readonly mode: "off" | "on";
|
|
2691
|
+
/**
|
|
2692
|
+
* Optional badge ceiling on nesting depth when mode is on.
|
|
2693
|
+
* Live cap is Face `agent-loop.maxSubagentDepth` (default
|
|
2694
|
+
* {@link DEFAULT_MAX_DEPTH}); effective = min(face, this) when set.
|
|
2695
|
+
*/
|
|
2696
|
+
readonly maxDepth?: number;
|
|
2697
|
+
/**
|
|
2698
|
+
* Optional badge ceiling on concurrent active children under one parent.
|
|
2699
|
+
* Live cap is Face `agent-loop.maxActiveSubagents` (default
|
|
2700
|
+
* {@link DEFAULT_MAX_ACTIVE_CHILDREN}).
|
|
2701
|
+
*/
|
|
2702
|
+
readonly maxActiveChildren?: number;
|
|
2703
|
+
}
|
|
2704
|
+
/** Harness-plane tool switches (ignored when composition is minimal). */
|
|
2705
|
+
interface AgentToolFlags {
|
|
2706
|
+
readonly web: boolean;
|
|
2707
|
+
readonly lsp: boolean;
|
|
2708
|
+
readonly pty: boolean;
|
|
2709
|
+
}
|
|
2710
|
+
interface AgentPresetProfile {
|
|
2711
|
+
readonly id: CatalogAgentPresetId;
|
|
2712
|
+
readonly composition: AgentToolComposition;
|
|
2713
|
+
readonly tools: AgentToolFlags;
|
|
2714
|
+
readonly subagents: AgentSubagentPolicy;
|
|
2715
|
+
/** Skip harness `tool:subagent` routing prompt when subagents are off. */
|
|
2716
|
+
readonly subagentRouting: boolean;
|
|
2717
|
+
/**
|
|
2718
|
+
* Seed `plan/mode` active on session.create.
|
|
2719
|
+
* Prefer `/plan` for collaboration mode; badges keep this false.
|
|
2720
|
+
*/
|
|
2721
|
+
readonly planModeDefault: boolean;
|
|
2722
|
+
}
|
|
2723
|
+
interface AgentPresetInfo {
|
|
2724
|
+
readonly id: CatalogAgentPresetId;
|
|
2725
|
+
readonly displayName: string;
|
|
2726
|
+
readonly description: string;
|
|
2727
|
+
readonly profile: AgentPresetProfile;
|
|
2728
|
+
}
|
|
2729
|
+
/** Face / tool default: nesting depth cap (Hermes-style tighter than historical 3). */
|
|
2730
|
+
declare const DEFAULT_MAX_DEPTH = 2;
|
|
2731
|
+
/** Face / tool default: concurrent active children under one parent. */
|
|
2732
|
+
declare const DEFAULT_MAX_ACTIVE_CHILDREN = 2;
|
|
2733
|
+
/**
|
|
2734
|
+
* Session badges offered in the product UI.
|
|
2735
|
+
* Host CLI also accepts `server` (same as harness) — see {@link resolveAgentPresetProfile}.
|
|
2736
|
+
*/
|
|
2737
|
+
declare const FACE_AGENT_PRESETS: readonly AgentPresetInfo[];
|
|
2738
|
+
/** Host `--preset` / env ids (includes legacy `server` / `plan` → harness). */
|
|
2739
|
+
declare const HOST_CLI_PRESET_IDS: readonly [...CatalogAgentPresetId[], "server", "plan"];
|
|
2740
|
+
/** Ids accepted on the wire (includes legacy `server` / `plan` → harness). */
|
|
2741
|
+
declare const FACE_AGENT_PRESET_IDS: Set<string>;
|
|
2742
|
+
/**
|
|
2743
|
+
* Normalize wire / Host `--preset` to a catalog profile.
|
|
2744
|
+
* Unknown ids fall back to `hostFallback` (default harness).
|
|
2745
|
+
* Legacy `server` and `plan` map to harness tools (`/plan` owns collaboration mode).
|
|
2746
|
+
*/
|
|
2747
|
+
declare function resolveAgentPresetProfile(agentPreset: string | undefined, hostFallback?: string): AgentPresetProfile;
|
|
2748
|
+
/**
|
|
2749
|
+
* Map session badge / Host `--preset` to the tool composition package.
|
|
2750
|
+
* `server` is the Host-plane CLI name; tools match harness.
|
|
2751
|
+
*/
|
|
2752
|
+
declare function resolveToolPreset(agentPreset: string | undefined, hostFallback?: string): AgentToolComposition;
|
|
2753
|
+
/** Persist only catalog ids (legacy `server` → `harness`). */
|
|
2754
|
+
declare function canonicalAgentPresetId(id: string): CatalogAgentPresetId;
|
|
2755
|
+
//#endregion
|
|
2756
|
+
//#region src/queue.d.ts
|
|
2757
|
+
/**
|
|
2758
|
+
* Authoritative `session/queue` item: id · placement · message.
|
|
2759
|
+
*/
|
|
2760
|
+
type QueuePlacement = "queued" | "steering" | "context";
|
|
2761
|
+
interface FaceQueueMessage {
|
|
2762
|
+
readonly id: string;
|
|
2763
|
+
readonly role: "user";
|
|
2764
|
+
readonly content: readonly ({
|
|
2765
|
+
readonly type: "text";
|
|
2766
|
+
readonly text: string;
|
|
2767
|
+
} | {
|
|
2768
|
+
readonly type: "image";
|
|
2769
|
+
readonly attachment: {
|
|
2770
|
+
readonly attachmentId: string;
|
|
2771
|
+
readonly mediaType: string;
|
|
2772
|
+
readonly bytes: number;
|
|
2773
|
+
readonly width: number;
|
|
2774
|
+
readonly height: number;
|
|
2775
|
+
readonly name?: string;
|
|
2776
|
+
};
|
|
2777
|
+
} | {
|
|
2778
|
+
readonly type: "file";
|
|
2779
|
+
readonly attachment: {
|
|
2780
|
+
readonly attachmentId: string;
|
|
2781
|
+
readonly name: string;
|
|
2782
|
+
readonly bytes: number;
|
|
2783
|
+
readonly mediaType?: string;
|
|
2784
|
+
};
|
|
2785
|
+
})[];
|
|
2786
|
+
readonly source: {
|
|
2787
|
+
readonly kind: "user";
|
|
2788
|
+
readonly rpcId?: string;
|
|
2789
|
+
};
|
|
2790
|
+
}
|
|
2791
|
+
interface FaceQueueItem {
|
|
2792
|
+
readonly id: string;
|
|
2793
|
+
readonly placement: QueuePlacement;
|
|
2794
|
+
readonly message: FaceQueueMessage;
|
|
2795
|
+
}
|
|
2796
|
+
declare function toQueueItems(pending: readonly AdmitReceipt[], admitToRpc: ReadonlyMap<string, string>): FaceQueueItem[];
|
|
2797
|
+
//#endregion
|
|
2798
|
+
//#region src/workspace-face.d.ts
|
|
2799
|
+
declare function resolveProductDir(root: string): string;
|
|
2800
|
+
/** Ensure candidate resolves under root (or equals root). */
|
|
2801
|
+
declare function assertUnderRoot(root: string, candidate: string): string;
|
|
2802
|
+
declare class PathEscapeError extends Error {
|
|
2803
|
+
constructor(message: string);
|
|
2804
|
+
}
|
|
2805
|
+
interface WorkspaceProductEntry {
|
|
2806
|
+
readonly path: string;
|
|
2807
|
+
readonly kind: "file" | "dir";
|
|
2808
|
+
readonly bytes?: number;
|
|
2809
|
+
}
|
|
2810
|
+
declare function listProductTree(productDir: string, options?: {
|
|
2811
|
+
maxEntries?: number;
|
|
2812
|
+
maxDepth?: number;
|
|
2813
|
+
}): Promise<{
|
|
2814
|
+
readonly entries: WorkspaceProductEntry[];
|
|
2815
|
+
readonly truncated: boolean;
|
|
2816
|
+
readonly exists: boolean;
|
|
2817
|
+
}>;
|
|
2818
|
+
declare function workspaceDescribe(runtime: FaceRuntime, _rpcId?: string, payload?: unknown): Promise<FaceRpcResult<unknown>>;
|
|
2819
|
+
declare function workspaceListProduct(runtime: FaceRuntime, _rpcId?: string, payload?: unknown): Promise<FaceRpcResult<unknown>>;
|
|
2820
|
+
declare function workspacePreviewInject(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
2821
|
+
/**
|
|
2822
|
+
* Face `workspace.list` — registry of workspaces + archived sessions.
|
|
2823
|
+
*/
|
|
2824
|
+
declare function workspaceListFace(runtime: FaceRuntime): Promise<FaceRpcResult<unknown>>;
|
|
2825
|
+
declare function workspaceCreateFace(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
2826
|
+
declare function workspaceRenameFace(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
2827
|
+
declare function workspaceArchiveSessionFace(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
2828
|
+
declare function workspaceUnarchiveSessionFace(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
2829
|
+
declare function workspacePinSessionFace(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
2830
|
+
declare function workspaceUnpinSessionFace(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
2831
|
+
declare function workspaceDeleteFace(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
2832
|
+
declare function workspaceInsertBeforeFace(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
2833
|
+
declare function workspaceInsertSessionBeforeFace(runtime: FaceRuntime, payload: unknown): Promise<FaceRpcResult<unknown>>;
|
|
2834
|
+
//#endregion
|
|
2835
|
+
//#region src/workspace-paths.d.ts
|
|
2836
|
+
/**
|
|
2837
|
+
* Workspace path title helper (Host Face).
|
|
2838
|
+
* Drive roots (`C:\`) keep the complete root spelling; ordinary dirs use basename.
|
|
2839
|
+
* Absolute-path acceptance for create reuses {@link fullyQualified} (browse picker).
|
|
2840
|
+
*/
|
|
2841
|
+
/**
|
|
2842
|
+
* Derive a non-empty default title from a workspace path.
|
|
2843
|
+
* @param path - Workspace path (typically already absolute).
|
|
2844
|
+
* @param platform - Host platform; injectable for deterministic path tests.
|
|
2845
|
+
*/
|
|
2846
|
+
declare function defaultWorkspaceTitle(path: string, platform?: NodeJS.Platform): string;
|
|
2847
|
+
//#endregion
|
|
2848
|
+
//#region src/ralph-tool.d.ts
|
|
2849
|
+
/** Product default / call ceiling (DSH default 256 is too large for Face). */
|
|
2850
|
+
declare const RALPH_DEFAULT_MAX_ROUNDS = 8;
|
|
2851
|
+
declare const RALPH_HARD_MAX_ROUNDS = 32;
|
|
2852
|
+
declare const RALPH_MAX_HANDOFF_CHARS = 16384;
|
|
2853
|
+
/** Parent-facing terminal text ceiling (DSH tool-ralph default). */
|
|
2854
|
+
declare const RALPH_MAX_RESULT_CHARS = 16384;
|
|
2855
|
+
type RalphRoundStatus = "continue" | "complete" | "blocked";
|
|
2856
|
+
interface RalphRoundReport {
|
|
2857
|
+
readonly status: RalphRoundStatus;
|
|
2858
|
+
readonly summary: string;
|
|
2859
|
+
readonly evidence: readonly string[];
|
|
2860
|
+
readonly nextSteps: readonly string[];
|
|
2861
|
+
readonly blocker: string;
|
|
2862
|
+
}
|
|
2863
|
+
type RalphTerminalStatus = "complete" | "blocked" | "budget-limited" | "round-failed";
|
|
2864
|
+
/** Validate a worker report (DSH status-specific rules + size ceiling). */
|
|
2865
|
+
declare function validateRalphReport(raw: unknown, maxHandoffChars?: number): RalphRoundReport;
|
|
2866
|
+
interface BindRalphToolOptions {
|
|
2867
|
+
readonly runtime: FaceRuntime;
|
|
2868
|
+
readonly parentSessionId: string;
|
|
2869
|
+
readonly maxDepth?: number;
|
|
2870
|
+
readonly maxActiveChildren?: number;
|
|
2871
|
+
/** Override default/ceiling for tests. */
|
|
2872
|
+
readonly maxRoundsCeiling?: number;
|
|
2873
|
+
}
|
|
2874
|
+
declare function createRalphTool(options: BindRalphToolOptions): ToolDefinition;
|
|
2875
|
+
declare function bindRalphTool(tools: ToolRegistry, options: BindRalphToolOptions): void;
|
|
2876
|
+
//#endregion
|
|
2877
|
+
//#region src/agent-team-output.d.ts
|
|
2878
|
+
/**
|
|
2879
|
+
* Hermes-style optional output_schema contract for delegated tasks.
|
|
2880
|
+
* Appends an OUTPUT CONTRACT block; validates final JSON with a light check
|
|
2881
|
+
* (no jsonschema dependency). One correction turn is the caller's job.
|
|
2882
|
+
*/
|
|
2883
|
+
type OutputSchemaObject = Readonly<Record<string, unknown>>;
|
|
2884
|
+
/** Coerce model-supplied schema; `(schema, undefined)` or `(undefined, error)`. */
|
|
2885
|
+
declare function coerceOutputSchema(raw: unknown): {
|
|
2886
|
+
readonly schema: OutputSchemaObject;
|
|
2887
|
+
readonly error?: undefined;
|
|
2888
|
+
} | {
|
|
2889
|
+
readonly schema?: undefined;
|
|
2890
|
+
readonly error: string;
|
|
2891
|
+
} | {
|
|
2892
|
+
readonly schema?: undefined;
|
|
2893
|
+
readonly error?: undefined;
|
|
2894
|
+
};
|
|
2895
|
+
/** Append the machine-validated OUTPUT CONTRACT block (Hermes wording). */
|
|
2896
|
+
declare function appendOutputContract(prompt: string, schema: OutputSchemaObject): string;
|
|
2897
|
+
/** Strip fences / prose; return outermost `{…}` or `[…]` that parses as JSON. */
|
|
2898
|
+
declare function extractJsonCandidate(text: string): string | undefined;
|
|
2899
|
+
interface OutputSchemaValidation {
|
|
2900
|
+
readonly valid: boolean;
|
|
2901
|
+
readonly errors: readonly string[];
|
|
2902
|
+
readonly candidate?: string;
|
|
2903
|
+
}
|
|
2904
|
+
/**
|
|
2905
|
+
* Light validation: parse JSON candidate; when schema.required is a string[],
|
|
2906
|
+
* require those keys on object results. Type mismatches are best-effort only.
|
|
2907
|
+
*/
|
|
2908
|
+
declare function validateOutputAgainstSchema(text: string, schema: OutputSchemaObject): OutputSchemaValidation;
|
|
2909
|
+
/** One correction turn (Hermes: do not re-paste the schema). */
|
|
2910
|
+
declare function buildOutputSchemaRetryMessage(errors: readonly string[]): string;
|
|
2911
|
+
//#endregion
|
|
2912
|
+
//#region src/session-status.d.ts
|
|
2913
|
+
interface SessionStatusJobRow {
|
|
2914
|
+
readonly id: string;
|
|
2915
|
+
readonly status: string;
|
|
2916
|
+
readonly label?: string;
|
|
2917
|
+
}
|
|
2918
|
+
interface SessionStatusSubagentLive {
|
|
2919
|
+
readonly id: string;
|
|
2920
|
+
readonly label?: string;
|
|
2921
|
+
readonly activity: "running" | "inactive";
|
|
2922
|
+
readonly mode: string;
|
|
2923
|
+
readonly liveText?: string;
|
|
2924
|
+
readonly liveTool?: string;
|
|
2925
|
+
/** Child inbox admits waiting as queue (not yet drained). */
|
|
2926
|
+
readonly queued?: number;
|
|
2927
|
+
/** Child inbox admits waiting as steer. */
|
|
2928
|
+
readonly steering?: number;
|
|
2929
|
+
/** External runtime kind when this child is ACP / app-server backed. */
|
|
2930
|
+
readonly externalKind?: "acp" | "app-server";
|
|
2931
|
+
/**
|
|
2932
|
+
* `live` = process handle attached; `cold` = sidecar handle only (Host
|
|
2933
|
+
* restart / dispose) — follow-up may attempt reopen via thread/resume.
|
|
2934
|
+
*/
|
|
2935
|
+
readonly externalResume?: "live" | "cold";
|
|
2936
|
+
}
|
|
2937
|
+
/** Depth / concurrency caps for Status + model `analytics`. */
|
|
2938
|
+
interface SessionStatusSubagentQuota {
|
|
2939
|
+
readonly depth: number;
|
|
2940
|
+
readonly maxDepth: number;
|
|
2941
|
+
readonly active: number;
|
|
2942
|
+
readonly maxActive: number;
|
|
2943
|
+
readonly delegated: number;
|
|
2944
|
+
readonly slotsFree: number;
|
|
2945
|
+
}
|
|
2946
|
+
interface SessionStatusGraph {
|
|
2947
|
+
readonly nodes: readonly {
|
|
2948
|
+
readonly id: string;
|
|
2949
|
+
readonly label: string;
|
|
2950
|
+
readonly role?: string;
|
|
2951
|
+
/** Delegation depth from the status session root (0 = root). */
|
|
2952
|
+
readonly depth?: number;
|
|
2953
|
+
/** Joined from `subagents.live` when the node is a registered child. */
|
|
2954
|
+
readonly activity?: "running" | "inactive";
|
|
2955
|
+
}[];
|
|
2956
|
+
readonly edges: readonly {
|
|
2957
|
+
readonly from: string;
|
|
2958
|
+
readonly to: string;
|
|
2959
|
+
readonly kind: string;
|
|
2960
|
+
readonly label?: string;
|
|
2961
|
+
}[];
|
|
2962
|
+
}
|
|
2963
|
+
interface SessionStatusCostBuckets {
|
|
2964
|
+
readonly input: number;
|
|
2965
|
+
readonly output: number;
|
|
2966
|
+
readonly cacheRead: number;
|
|
2967
|
+
readonly cacheWrite: number;
|
|
2968
|
+
readonly reasoning: number;
|
|
2969
|
+
readonly cost: number;
|
|
2970
|
+
}
|
|
2971
|
+
/** Per-session costUsage totals + model breakdown (Face projection). */
|
|
2972
|
+
interface SessionStatusCost extends SessionStatusCostBuckets {
|
|
2973
|
+
readonly byModel: Readonly<Record<string, SessionStatusCostBuckets>>;
|
|
2974
|
+
readonly byProviderModel: Readonly<Record<string, SessionStatusCostBuckets>>;
|
|
2975
|
+
}
|
|
2976
|
+
/** One ranked row for Overview / `/status` (session or ledger). */
|
|
2977
|
+
interface SessionStatusCostModelRow {
|
|
2978
|
+
readonly key: string;
|
|
2979
|
+
readonly input: number;
|
|
2980
|
+
readonly output: number;
|
|
2981
|
+
readonly cost: number;
|
|
2982
|
+
}
|
|
2983
|
+
/**
|
|
2984
|
+
* Cross-session cost-meter ledger fold (today / month / total + top models).
|
|
2985
|
+
* Same file ledger as `costMeter/getState` · tokenledger — not a second SoT.
|
|
2986
|
+
*/
|
|
2987
|
+
interface SessionStatusBilling {
|
|
2988
|
+
readonly todayCost: number;
|
|
2989
|
+
readonly monthCost: number;
|
|
2990
|
+
readonly totalCost: number;
|
|
2991
|
+
readonly todayTokens: number;
|
|
2992
|
+
readonly monthTokens: number;
|
|
2993
|
+
/** Month window, ranked by cost then tokens (max 8). */
|
|
2994
|
+
readonly byModel: readonly SessionStatusCostModelRow[];
|
|
2995
|
+
/** Month window `provider:model`, ranked (max 8). */
|
|
2996
|
+
readonly byProviderModel: readonly SessionStatusCostModelRow[];
|
|
2997
|
+
/** Recent daily points from ledger history (Hermes insights / dsh-wallet). */
|
|
2998
|
+
readonly dailyTrend: readonly SessionStatusBillingDay[];
|
|
2999
|
+
}
|
|
3000
|
+
/** One day on the billing trend sparkline. */
|
|
3001
|
+
interface SessionStatusBillingDay {
|
|
3002
|
+
readonly date: string;
|
|
3003
|
+
readonly cost: number;
|
|
3004
|
+
readonly tokens: number;
|
|
3005
|
+
}
|
|
3006
|
+
/**
|
|
3007
|
+
* Fleet health for Status (subagents · jobs · channels) — Hermes StatusPage
|
|
3008
|
+
* style operator glance, not a separate monitoring product.
|
|
3009
|
+
*/
|
|
3010
|
+
type SessionStatusFleetHealth = "ok" | "warn" | "critical";
|
|
3011
|
+
interface SessionStatusFleetAlert {
|
|
3012
|
+
readonly id: string;
|
|
3013
|
+
readonly severity: "info" | "warn" | "critical";
|
|
3014
|
+
readonly message: string;
|
|
3015
|
+
}
|
|
3016
|
+
interface SessionStatusFleet {
|
|
3017
|
+
readonly health: SessionStatusFleetHealth;
|
|
3018
|
+
readonly runningJobs: number;
|
|
3019
|
+
readonly runningSubagents: number;
|
|
3020
|
+
readonly slotsFree: number;
|
|
3021
|
+
readonly queuedInbox: number;
|
|
3022
|
+
readonly channelAlerts: number;
|
|
3023
|
+
readonly alerts: readonly SessionStatusFleetAlert[];
|
|
3024
|
+
}
|
|
3025
|
+
interface SessionStatusChannels {
|
|
3026
|
+
readonly process: readonly {
|
|
3027
|
+
readonly pluginId: string;
|
|
3028
|
+
readonly channelId: string;
|
|
3029
|
+
readonly displayName?: string;
|
|
3030
|
+
}[];
|
|
3031
|
+
readonly im: readonly {
|
|
3032
|
+
readonly channelId: string;
|
|
3033
|
+
readonly displayName: string;
|
|
3034
|
+
readonly wired: string;
|
|
3035
|
+
}[];
|
|
3036
|
+
readonly note: string;
|
|
3037
|
+
/** Discover stubs / bridge-only IM that need operator attention. */
|
|
3038
|
+
readonly alerts: readonly SessionStatusFleetAlert[];
|
|
3039
|
+
}
|
|
3040
|
+
interface SessionStatusTimeline {
|
|
3041
|
+
readonly total: number;
|
|
3042
|
+
readonly system: number;
|
|
3043
|
+
readonly tools: number;
|
|
3044
|
+
readonly user: number;
|
|
3045
|
+
readonly inject: number;
|
|
3046
|
+
readonly assistant: number;
|
|
3047
|
+
readonly tool: number;
|
|
3048
|
+
readonly requestCount: number;
|
|
3049
|
+
readonly eventCount: number;
|
|
3050
|
+
readonly model?: string;
|
|
3051
|
+
readonly provider?: string;
|
|
3052
|
+
readonly contextWindow?: number;
|
|
3053
|
+
/** Distinct inject source labels (kind · form · plugin name). */
|
|
3054
|
+
readonly injectSources: readonly string[];
|
|
3055
|
+
/** Latest compaction reason when any compaction event exists. */
|
|
3056
|
+
readonly lastCompactReason?: ContextTimelineCompactReason;
|
|
3057
|
+
/** Latest shadowedTokenCount from compaction (when logged). */
|
|
3058
|
+
readonly lastShadowedTokens?: number;
|
|
3059
|
+
/** Count of prune events that cite a spill path. */
|
|
3060
|
+
readonly spillCount: number;
|
|
3061
|
+
/** Count of tool-result prune / spill boundary events. */
|
|
3062
|
+
readonly pruneCount: number;
|
|
3063
|
+
}
|
|
3064
|
+
/** Soft-budget / overflow stage chain folded from durable timeline events. */
|
|
3065
|
+
type SessionStatusCompactionPipeline = "none" | "prune" | "summary" | "prune→summary";
|
|
3066
|
+
type SessionStatusCompactionStage = "prune" | "summary";
|
|
3067
|
+
/**
|
|
3068
|
+
* Prune-first then summary observability (DSH-aligned stages on the Status
|
|
3069
|
+
* surface — no extra protocol events; folds existing prune + compaction rows).
|
|
3070
|
+
*/
|
|
3071
|
+
interface SessionStatusCompaction {
|
|
3072
|
+
/** Last completed stage chain within one turn (or across latest markers). */
|
|
3073
|
+
readonly pipeline: SessionStatusCompactionPipeline;
|
|
3074
|
+
/** Ordered stages for that last pipeline (empty when `none`). */
|
|
3075
|
+
readonly stages: readonly SessionStatusCompactionStage[];
|
|
3076
|
+
/**
|
|
3077
|
+
* Configured soft-budget strategy (Face `agent-loop.compactionStrategy`).
|
|
3078
|
+
* Distinct from last-turn `pipeline` (what actually ran).
|
|
3079
|
+
*/
|
|
3080
|
+
readonly strategy?: "prune-summary" | "prune-only" | "summary-only" | "off";
|
|
3081
|
+
readonly lastReason?: ContextTimelineCompactReason;
|
|
3082
|
+
readonly lastShadowedTokens?: number;
|
|
3083
|
+
readonly pruneCount: number;
|
|
3084
|
+
/** Count of `context/compaction` (summary) timeline rows. */
|
|
3085
|
+
readonly summaryCount: number;
|
|
3086
|
+
readonly spillCount: number;
|
|
3087
|
+
/**
|
|
3088
|
+
* Recent unique spill files (newest last; capped). Each row may include
|
|
3089
|
+
* basename · bytes · head/tail preview when the file is still on disk.
|
|
3090
|
+
*/
|
|
3091
|
+
readonly spillPaths?: readonly SessionStatusSpillEntry[];
|
|
3092
|
+
/**
|
|
3093
|
+
* Live latch: turn or manual `/compact` holds the agent busy bit
|
|
3094
|
+
* (compact and turn are mutually exclusive on the same latch).
|
|
3095
|
+
*/
|
|
3096
|
+
readonly phase: "idle" | "busy";
|
|
3097
|
+
/** Thin Guardian fragment registered (Settings `guardianFragments`). */
|
|
3098
|
+
readonly guardian?: boolean;
|
|
3099
|
+
}
|
|
3100
|
+
/** One tool-result spill file surfaced on Status / Context browse. */
|
|
3101
|
+
interface SessionStatusSpillEntry {
|
|
3102
|
+
readonly path: string;
|
|
3103
|
+
/** Basename for the overview list. */
|
|
3104
|
+
readonly name: string;
|
|
3105
|
+
/** On-disk UTF-8 byte length when the file is readable. */
|
|
3106
|
+
readonly bytes?: number;
|
|
3107
|
+
/** Head/tail peek (capped); absent when the file is missing. */
|
|
3108
|
+
readonly preview?: string;
|
|
3109
|
+
/** Tool name from the prune/spill timeline row when known. */
|
|
3110
|
+
readonly tool?: string;
|
|
3111
|
+
}
|
|
3112
|
+
/**
|
|
3113
|
+
* Queue vs turn mutual exclusion facts for the Overview Status column.
|
|
3114
|
+
* Compact shares the agent latch with the turn — queue still FIFO-accepts.
|
|
3115
|
+
*/
|
|
3116
|
+
interface SessionStatusDelivery {
|
|
3117
|
+
readonly turnActive: boolean;
|
|
3118
|
+
readonly queued: number;
|
|
3119
|
+
readonly steering: number;
|
|
3120
|
+
/** True when the latch is held — `/compact` returns busy. */
|
|
3121
|
+
readonly compactBlockedByTurn: boolean;
|
|
3122
|
+
/** Admits with delivery=queue still land while the latch is held. */
|
|
3123
|
+
readonly queueAcceptedWhileBusy: true;
|
|
3124
|
+
/** Steer placement only applies while a turn is active. */
|
|
3125
|
+
readonly steerRequiresActiveTurn: true;
|
|
3126
|
+
/** One-line operator note (slash + Overview). */
|
|
3127
|
+
readonly note: string;
|
|
3128
|
+
}
|
|
3129
|
+
interface SessionStatusTeamTask {
|
|
3130
|
+
readonly id: string;
|
|
3131
|
+
readonly title: string;
|
|
3132
|
+
readonly status: string;
|
|
3133
|
+
readonly revision: number;
|
|
3134
|
+
readonly childSessionId?: string;
|
|
3135
|
+
readonly role?: string;
|
|
3136
|
+
readonly humanOwned?: boolean;
|
|
3137
|
+
readonly schemaValid?: boolean;
|
|
3138
|
+
readonly worktreePath?: string;
|
|
3139
|
+
readonly worktreeBranch?: string;
|
|
3140
|
+
readonly worktreeId?: string;
|
|
3141
|
+
/** Managed lease status (`active` · `retained` · `reclaimed`) when known. */
|
|
3142
|
+
readonly worktreeLeaseStatus?: string;
|
|
3143
|
+
/** Truncated completion / failure preview from the task board. */
|
|
3144
|
+
readonly resultPreview?: string;
|
|
3145
|
+
/**
|
|
3146
|
+
* External-agent resume surface for the bound child (`live` process vs
|
|
3147
|
+
* `cold` sidecar-only). Same values as `subagents.live[].externalResume`.
|
|
3148
|
+
*/
|
|
3149
|
+
readonly externalResume?: "live" | "cold";
|
|
3150
|
+
}
|
|
3151
|
+
/** Structured Status facts shared by slash `/status` and Overview. */
|
|
3152
|
+
interface SessionStatusSnapshot {
|
|
3153
|
+
readonly sessionId: string;
|
|
3154
|
+
readonly badge: string;
|
|
3155
|
+
readonly permission: string;
|
|
3156
|
+
readonly plan: "on" | "off";
|
|
3157
|
+
readonly theme: string;
|
|
3158
|
+
readonly model: {
|
|
3159
|
+
readonly provider: string;
|
|
3160
|
+
readonly model: string;
|
|
3161
|
+
};
|
|
3162
|
+
readonly cwd: string;
|
|
3163
|
+
readonly events: number;
|
|
3164
|
+
readonly jobs: readonly SessionStatusJobRow[];
|
|
3165
|
+
readonly subagents: {
|
|
3166
|
+
readonly live: readonly SessionStatusSubagentLive[];
|
|
3167
|
+
readonly graph: SessionStatusGraph;
|
|
3168
|
+
/** Face agent-loop ∩ badge ceilings + live active count. */
|
|
3169
|
+
readonly quota: SessionStatusSubagentQuota;
|
|
3170
|
+
};
|
|
3171
|
+
/** Agent Teams task board (delivery · result · pause/takeover). */
|
|
3172
|
+
readonly teamTasks: readonly SessionStatusTeamTask[];
|
|
3173
|
+
readonly cost: SessionStatusCost;
|
|
3174
|
+
/** Host-wide ledger fold (cross-session · cross-model). */
|
|
3175
|
+
readonly billing: SessionStatusBilling;
|
|
3176
|
+
/** Subagent / job / channel health glance. */
|
|
3177
|
+
readonly fleet: SessionStatusFleet;
|
|
3178
|
+
readonly timeline: SessionStatusTimeline;
|
|
3179
|
+
/** Prune → summary stage fold + live busy phase. */
|
|
3180
|
+
readonly compaction: SessionStatusCompaction;
|
|
3181
|
+
/** Queue / steer / turn latch mutual exclusion. */
|
|
3182
|
+
readonly delivery: SessionStatusDelivery;
|
|
3183
|
+
readonly channels: SessionStatusChannels;
|
|
3184
|
+
/** Last curated-memory consolidate (Host pipeline; optional). */
|
|
3185
|
+
readonly curatedMemory?: SessionStatusCuratedMemory;
|
|
3186
|
+
}
|
|
3187
|
+
/** Host curated-memory consolidate glance (Hermes memory_status-style). */
|
|
3188
|
+
interface SessionStatusCuratedMemory {
|
|
3189
|
+
readonly sessionId: string;
|
|
3190
|
+
readonly at: number;
|
|
3191
|
+
readonly phase1Written: number;
|
|
3192
|
+
readonly phase2: string;
|
|
3193
|
+
readonly phase2Written: number;
|
|
3194
|
+
readonly skipped?: string;
|
|
3195
|
+
readonly providerKind?: string;
|
|
3196
|
+
}
|
|
3197
|
+
/** Rank map rows by cost, then tokens (Hermes insights-style top models). */
|
|
3198
|
+
declare function rankCostModelRows(map: Readonly<Record<string, SessionStatusCostBuckets>>, limit?: number): SessionStatusCostModelRow[];
|
|
3199
|
+
/**
|
|
3200
|
+
* Peek a spill file for Status/Context browse (basename · bytes · head/tail).
|
|
3201
|
+
* Missing files still return a path+name row so the operator can see the locator.
|
|
3202
|
+
*/
|
|
3203
|
+
declare function peekSpillEntry(filePath: string, options?: {
|
|
3204
|
+
readonly tool?: string;
|
|
3205
|
+
readonly previewBudget?: number;
|
|
3206
|
+
}): SessionStatusSpillEntry;
|
|
3207
|
+
/**
|
|
3208
|
+
* Build the Status snapshot for one session.
|
|
3209
|
+
* Same facts feed `/status` text and Face `session.status`.
|
|
3210
|
+
*/
|
|
3211
|
+
declare function buildSessionStatusSnapshot(runtime: FaceRuntime, sessionId: string): SessionStatusSnapshot;
|
|
3212
|
+
/** Format the shared snapshot as `/status` command text. */
|
|
3213
|
+
declare function formatSessionStatusText(snap: SessionStatusSnapshot): string;
|
|
3214
|
+
//#endregion
|
|
3215
|
+
//#region src/rollout-trace.d.ts
|
|
3216
|
+
type RolloutTraceEdgeKind = "spawn" | "message" | "tool";
|
|
3217
|
+
type RolloutTraceNodeKind = "session" | "turn" | "tool_call" | "message";
|
|
3218
|
+
interface RolloutTraceNode {
|
|
3219
|
+
readonly id: string;
|
|
3220
|
+
readonly kind: RolloutTraceNodeKind;
|
|
3221
|
+
readonly sessionId: string;
|
|
3222
|
+
readonly label?: string;
|
|
3223
|
+
readonly turnId?: string;
|
|
3224
|
+
readonly toolName?: string;
|
|
3225
|
+
}
|
|
3226
|
+
interface RolloutTraceEdge {
|
|
3227
|
+
readonly id: string;
|
|
3228
|
+
readonly kind: RolloutTraceEdgeKind;
|
|
3229
|
+
readonly from: string;
|
|
3230
|
+
readonly to: string;
|
|
3231
|
+
readonly label?: string;
|
|
3232
|
+
}
|
|
3233
|
+
interface RolloutTraceLink {
|
|
3234
|
+
readonly parentSessionId: string;
|
|
3235
|
+
readonly childSessionId: string;
|
|
3236
|
+
readonly mode?: string;
|
|
3237
|
+
readonly label?: string;
|
|
3238
|
+
}
|
|
3239
|
+
interface RolloutTraceState {
|
|
3240
|
+
readonly version: 1;
|
|
3241
|
+
/** Local debug only — never treat as telemetry upload payload. */
|
|
3242
|
+
readonly purpose: "local-debug";
|
|
3243
|
+
readonly rootSessionId: string;
|
|
3244
|
+
readonly sessions: readonly string[];
|
|
3245
|
+
readonly nodes: readonly RolloutTraceNode[];
|
|
3246
|
+
readonly edges: readonly RolloutTraceEdge[];
|
|
3247
|
+
readonly counts: {
|
|
3248
|
+
readonly nodes: number;
|
|
3249
|
+
readonly edges: number;
|
|
3250
|
+
readonly spawn: number;
|
|
3251
|
+
readonly message: number;
|
|
3252
|
+
readonly tool: number;
|
|
3253
|
+
};
|
|
3254
|
+
}
|
|
3255
|
+
interface BuildRolloutTraceInput {
|
|
3256
|
+
readonly rootSessionId: string;
|
|
3257
|
+
/** Session id → append-only events (order preserved). */
|
|
3258
|
+
readonly eventsBySession: Readonly<Record<string, readonly SessionEvent[]>>;
|
|
3259
|
+
/** Parent→child registry (Face subagents); drives spawn edges. */
|
|
3260
|
+
readonly links?: readonly RolloutTraceLink[];
|
|
3261
|
+
}
|
|
3262
|
+
/**
|
|
3263
|
+
* Reduce session events + subagent links into a local debug graph.
|
|
3264
|
+
* Edges: spawn (registry), message (user/assistant turns), tool (call→result).
|
|
3265
|
+
*/
|
|
3266
|
+
declare function buildRolloutTraceState(input: BuildRolloutTraceInput): RolloutTraceState;
|
|
3267
|
+
//#endregion
|
|
3268
|
+
//#region src/host-pick-directory.d.ts
|
|
3269
|
+
/**
|
|
3270
|
+
* Whether Face may run the OS directory picker.
|
|
3271
|
+
* Same Desktop override as {@link canOpenNativePath}: `XRK_NATIVE_OPEN=1`.
|
|
3272
|
+
*/
|
|
3273
|
+
declare function canPickNativeDirectory(platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): boolean;
|
|
3274
|
+
/** Testable command boundary; implementations should not invoke a shell. */
|
|
3275
|
+
type DirectoryPickerRunner = (command: string, args: readonly string[], signal: AbortSignal) => Promise<{
|
|
3276
|
+
readonly stdout: string;
|
|
3277
|
+
}>;
|
|
3278
|
+
interface DirectoryPickerInternals {
|
|
3279
|
+
readonly platform?: NodeJS.Platform;
|
|
3280
|
+
readonly run?: DirectoryPickerRunner;
|
|
3281
|
+
}
|
|
3282
|
+
/** STA FolderBrowserDialog — no koffi; cancel exits 1. */
|
|
3283
|
+
declare const WIN32_POWERSHELL_PICK: string;
|
|
3284
|
+
/**
|
|
3285
|
+
* Open the platform directory picker.
|
|
3286
|
+
* @returns selected path, or `null` when the user cancels.
|
|
3287
|
+
*/
|
|
3288
|
+
declare function pickNativeDirectory(signal: AbortSignal, internals?: DirectoryPickerInternals): Promise<string | null>;
|
|
3289
|
+
type NativeDirectoryPicker = (signal: AbortSignal) => Promise<string | null>;
|
|
3290
|
+
/**
|
|
3291
|
+
* Face RPC wrapper. Inject `pickNativeDirectory` on the runtime in tests —
|
|
3292
|
+
* never pop a real dialog in CI.
|
|
3293
|
+
*/
|
|
3294
|
+
declare function hostPickDirectoryRpc(runtime: {
|
|
3295
|
+
pickNativeDirectory?: NativeDirectoryPicker;
|
|
3296
|
+
}): Promise<FaceRpcResult<{
|
|
3297
|
+
path: string | null;
|
|
3298
|
+
}>>;
|
|
3299
|
+
//#endregion
|
|
3300
|
+
//#region src/host-open-path.d.ts
|
|
3301
|
+
/**
|
|
3302
|
+
* Whether Face may advertise `canOpenPath` / run `host.openPath`.
|
|
3303
|
+
* Desktop Host sets `XRK_NATIVE_OPEN=1` so the bit stays true without a second opener.
|
|
3304
|
+
*/
|
|
3305
|
+
declare function canOpenNativePath(platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): boolean;
|
|
3306
|
+
/** Normalize trailing `.` / separator noise from client path joins. */
|
|
3307
|
+
declare function normalizeOpenPath(target: string): string;
|
|
3308
|
+
/**
|
|
3309
|
+
* Win32 path for Explorer argv. Forward slashes must become `\`: Explorer
|
|
3310
|
+
* treats `/seg` after `/select,` as another switch, so reveal silently no-ops.
|
|
3311
|
+
* Must NOT be used on absolute URLs — that would turn `https://` into `https:\\`.
|
|
3312
|
+
*/
|
|
3313
|
+
declare function windowsExplorerPath(target: string): string;
|
|
3314
|
+
declare function openNativePath(target: string, platform?: NodeJS.Platform): Promise<void>;
|
|
3315
|
+
/**
|
|
3316
|
+
* Reveal a path in the desktop file manager (select file when possible).
|
|
3317
|
+
*/
|
|
3318
|
+
declare function revealNativePath(target: string, platform?: NodeJS.Platform): Promise<void>;
|
|
3319
|
+
declare function hostOpenPath(payload: unknown): Promise<FaceRpcResult<{
|
|
3320
|
+
opened: true;
|
|
3321
|
+
}>>;
|
|
3322
|
+
//#endregion
|
|
3323
|
+
//#region src/model-catalog.d.ts
|
|
3324
|
+
interface FaceModelSelection {
|
|
3325
|
+
readonly provider: string;
|
|
3326
|
+
readonly model: string;
|
|
3327
|
+
readonly reasoningEffort?: string;
|
|
3328
|
+
}
|
|
3329
|
+
//#endregion
|
|
3330
|
+
//#region src/llm-resolve.d.ts
|
|
3331
|
+
interface ResolvedFaceLlm {
|
|
3332
|
+
readonly binding: ProviderBinding;
|
|
3333
|
+
readonly adapter: LlmAdapter;
|
|
3334
|
+
readonly selection: FaceModelSelection;
|
|
3335
|
+
}
|
|
3336
|
+
declare class FaceLlmResolveError extends Error {
|
|
3337
|
+
readonly code: "missing-credential" | "resolve-failed";
|
|
3338
|
+
constructor(code: FaceLlmResolveError["code"], message: string);
|
|
3339
|
+
}
|
|
3340
|
+
/** Build adapter for an explicit selection (selectModel preflight + agent factory). */
|
|
3341
|
+
declare function resolveLlmForSelection(runtime: FaceRuntime, selection: FaceModelSelection): ResolvedFaceLlm;
|
|
3342
|
+
/** Session-scoped routing adapter (DSH hot model switch without agent invalidate). */
|
|
3343
|
+
declare function createSessionRoutingLlm(runtime: FaceRuntime, sessionId: string): RoutingLlmAdapter | undefined;
|
|
3344
|
+
/**
|
|
3345
|
+
* Whether the live model route declares image input (DSH resolveModelInfo gate).
|
|
3346
|
+
* Face `inputModalities` is intake-only and must not override this.
|
|
3347
|
+
*/
|
|
3348
|
+
declare function liveRouteAllowsImageInput(runtime: FaceRuntime, sessionId?: string): boolean;
|
|
3349
|
+
/** Build adapter for the session's selected provider/model when credentials exist. */
|
|
3350
|
+
declare function resolveLlmForSession(runtime: FaceRuntime, sessionId: string): ResolvedFaceLlm | undefined;
|
|
3351
|
+
//#endregion
|
|
3352
|
+
//#region src/llm-provider-context.d.ts
|
|
3353
|
+
interface ProviderRouteContext {
|
|
3354
|
+
readonly baseUrl?: string;
|
|
3355
|
+
readonly path?: string;
|
|
3356
|
+
readonly authMode?: AuthMode;
|
|
3357
|
+
/** Face `llm-pi-ai.providers.*.api` → Registry protocol. */
|
|
3358
|
+
readonly protocol?: ProtocolId;
|
|
3359
|
+
}
|
|
3360
|
+
interface ProviderCredentialContext {
|
|
3361
|
+
readonly apiKey?: string;
|
|
3362
|
+
readonly source: "typed" | "vault" | "env" | "none";
|
|
3363
|
+
}
|
|
3364
|
+
/** One hand-declared `llm-pi-ai.providers.<id>` that is not a Registry brand. */
|
|
3365
|
+
type DeclaredPiAiProvider = {
|
|
3366
|
+
readonly id: string;
|
|
3367
|
+
readonly displayName: string;
|
|
3368
|
+
readonly baseUrl?: string;
|
|
3369
|
+
readonly api?: string;
|
|
3370
|
+
readonly models: readonly {
|
|
3371
|
+
readonly id: string;
|
|
3372
|
+
readonly name?: string;
|
|
3373
|
+
readonly inputModalities?: readonly ("text" | "image")[];
|
|
3374
|
+
readonly contextWindow?: number;
|
|
3375
|
+
}[];
|
|
3376
|
+
};
|
|
3377
|
+
/** Case-insensitive lookup into `llm-pi-ai.providers`. */
|
|
3378
|
+
declare function piAiProviderProfile(runtime: FaceRuntime, provider: string): Record<string, unknown> | undefined;
|
|
3379
|
+
/**
|
|
3380
|
+
* Effective credential env name: brand → deepseek settings → pi-ai profile.
|
|
3381
|
+
*/
|
|
3382
|
+
declare function providerApiKeyEnv(runtime: FaceRuntime, provider: string): string | undefined;
|
|
3383
|
+
/**
|
|
3384
|
+
* Settings-declared providers that name an `apiKeyEnv` (credential slots).
|
|
3385
|
+
*/
|
|
3386
|
+
declare function listSettingsProviderCredentialRefs(runtime: FaceRuntime): readonly {
|
|
3387
|
+
readonly providerId: string;
|
|
3388
|
+
readonly apiKeyEnv: string;
|
|
3389
|
+
}[];
|
|
3390
|
+
/**
|
|
3391
|
+
* Settings-only routes (Custom provider card). Excludes Registry brands.
|
|
3392
|
+
*/
|
|
3393
|
+
declare function listDeclaredPiAiProviders(runtime: FaceRuntime): readonly DeclaredPiAiProvider[];
|
|
3394
|
+
/** Effective route overrides from `llm-deepseek` / `llm-pi-ai`. */
|
|
3395
|
+
declare function readProviderRoute(runtime: FaceRuntime, provider: string): ProviderRouteContext;
|
|
3396
|
+
/** Credential precedence: typed probe → vault → env. */
|
|
3397
|
+
declare function readProviderApiKey(runtime: FaceRuntime, provider: string, typed?: string): ProviderCredentialContext;
|
|
3398
|
+
/** Whether this provider can authenticate for a live adapter. */
|
|
3399
|
+
declare function providerHasUsableCredential(runtime: FaceRuntime, provider: string): boolean;
|
|
3400
|
+
/**
|
|
3401
|
+
* Resolve Registry brand, or synthesize from `llm-pi-ai.providers.<id>`.
|
|
3402
|
+
* Optional `route` overlays settings (e.g. discovery draft `baseURL`).
|
|
3403
|
+
*/
|
|
3404
|
+
declare function resolveProviderBinding(runtime: FaceRuntime, input: {
|
|
3405
|
+
readonly provider: string;
|
|
3406
|
+
readonly model: string;
|
|
3407
|
+
readonly route?: ProviderRouteContext;
|
|
3408
|
+
}): ProviderBinding;
|
|
3409
|
+
/** Whether a provider id can resolve to a live binding (not API-key gated). */
|
|
3410
|
+
declare function providerRouteServed(runtime: FaceRuntime, provider: string): boolean;
|
|
3411
|
+
//#endregion
|
|
3412
|
+
//#region src/llm-api-key.d.ts
|
|
3413
|
+
/**
|
|
3414
|
+
* API key validation — twin of `@xrkseek/xrk-llm` `normalizeApiKey` / client `apiKeyFailure`.
|
|
3415
|
+
* Face cannot import xrk-llm; keep charset rule in sync with ui-settings-models.
|
|
3416
|
+
*/
|
|
3417
|
+
type ApiKeyRejection = "empty" | "illegalCharacters";
|
|
3418
|
+
type ApiKeyCheck = {
|
|
3419
|
+
readonly ok: true;
|
|
3420
|
+
readonly value: string;
|
|
3421
|
+
} | {
|
|
3422
|
+
readonly ok: false;
|
|
3423
|
+
readonly reason: ApiKeyRejection;
|
|
3424
|
+
};
|
|
3425
|
+
/** Trim and validate a credential before it enters an HTTP header. */
|
|
3426
|
+
declare function normalizeApiKey(raw: string): ApiKeyCheck;
|
|
3427
|
+
//#endregion
|
|
3428
|
+
//#region src/session-cwd.d.ts
|
|
3429
|
+
declare function resolveSessionCwd(runtime: FaceRuntime, sessionId: string): string;
|
|
3430
|
+
//#endregion
|
|
3431
|
+
//#region src/settings-document.d.ts
|
|
3432
|
+
/** Harness home: explicit `productDir` (tests isolate settings/workspaces), else `XRK_HOME` / `~/.xrk`.
|
|
3433
|
+
* Not the workspace product tree — that is always `{workspaceRoot}/.xrk` via `resolveProductDir`.
|
|
3434
|
+
*/
|
|
3435
|
+
declare function resolveHarnessHome(runtime: FaceRuntime): string;
|
|
3436
|
+
declare function settingsYamlPath(runtime: FaceRuntime): string;
|
|
3437
|
+
/** Test helper — clear last-good caches between isolated productDir cases. */
|
|
3438
|
+
declare function resetLastGoodConfigCaches(): void;
|
|
3439
|
+
declare function validateSettingsNamespace(ns: string, merged: Record<string, unknown>): string | undefined;
|
|
3440
|
+
/**
|
|
3441
|
+
* Sync peek of one namespace's user layer from `{harnessHome}/settings.yaml`.
|
|
3442
|
+
* Used by Host before Face exists (SSH world must bind workspaceRoot at spawn).
|
|
3443
|
+
*/
|
|
3444
|
+
declare function peekSettingsYamlSection(harnessHome: string, ns: string): Record<string, unknown> | undefined;
|
|
3445
|
+
//#endregion
|
|
3446
|
+
//#region src/settings-agent-tools.d.ts
|
|
3447
|
+
declare function bindSettingsTools(tools: ToolRegistry, runtime: FaceRuntime): void;
|
|
3448
|
+
//#endregion
|
|
3449
|
+
//#region src/session-query-tools.d.ts
|
|
3450
|
+
/** Tool-side UTF-8 budget for one `session_read` snapshot (same default as prepare). */
|
|
3451
|
+
declare const SESSION_READ_MAX_BYTES = 65536;
|
|
3452
|
+
/** Max ancestor / descendant rows returned by `session_trace`. */
|
|
3453
|
+
declare const SESSION_TRACE_MAX_NODES = 32;
|
|
3454
|
+
interface BindSessionQueryToolsOptions {
|
|
3455
|
+
readonly runtime: FaceRuntime;
|
|
3456
|
+
readonly parentSessionId: string;
|
|
3457
|
+
readonly maxSearchResults?: number;
|
|
3458
|
+
readonly maxReadBytes?: number;
|
|
3459
|
+
}
|
|
3460
|
+
declare function createSessionSearchTool(options: BindSessionQueryToolsOptions): ToolDefinition;
|
|
3461
|
+
declare function createSessionReadTool(options: BindSessionQueryToolsOptions): ToolDefinition;
|
|
3462
|
+
declare function createSessionTraceTool(options: BindSessionQueryToolsOptions): ToolDefinition;
|
|
3463
|
+
/** Register session_search / session_read / session_trace on a live agent. */
|
|
3464
|
+
declare function bindSessionQueryTools(tools: ToolRegistry, options: BindSessionQueryToolsOptions): void;
|
|
3465
|
+
//#endregion
|
|
3466
|
+
//#region src/subagent-tools.d.ts
|
|
3467
|
+
/** Effective Face + badge ceilings for subagent depth / concurrency. */
|
|
3468
|
+
interface SubagentQuotaCaps {
|
|
3469
|
+
readonly depth: number;
|
|
3470
|
+
readonly maxDepth: number;
|
|
3471
|
+
readonly active: number;
|
|
3472
|
+
readonly maxActive: number;
|
|
3473
|
+
readonly delegated: number;
|
|
3474
|
+
readonly slotsFree: number;
|
|
3475
|
+
}
|
|
3476
|
+
/**
|
|
3477
|
+
* Resolve live quota for Status / `analytics` (Face agent-loop ∩ badge ceiling).
|
|
3478
|
+
*/
|
|
3479
|
+
declare function resolveSubagentQuota(runtime: FaceRuntime, sessionId: string): SubagentQuotaCaps;
|
|
3480
|
+
declare function subagentDepth(runtime: FaceRuntime, sessionId: string): number;
|
|
3481
|
+
interface BindSubagentToolsOptions {
|
|
3482
|
+
readonly runtime: FaceRuntime;
|
|
3483
|
+
readonly parentSessionId: string;
|
|
3484
|
+
readonly maxDepth?: number;
|
|
3485
|
+
/**
|
|
3486
|
+
* Max concurrent *active* (draining) direct children under this parent.
|
|
3487
|
+
* Omit → {@link DEFAULT_MAX_ACTIVE_CHILDREN} (4).
|
|
3488
|
+
*/
|
|
3489
|
+
readonly maxActiveChildren?: number;
|
|
3490
|
+
/** Override spawn for external runtimes (tests). */
|
|
3491
|
+
readonly externalSpawn?: ExternalSpawn;
|
|
3492
|
+
/** Override env for external launch resolution (tests). */
|
|
3493
|
+
readonly externalEnv?: NodeJS.ProcessEnv;
|
|
3494
|
+
}
|
|
3495
|
+
/** Register model-facing subagent tools on a live Agent tool registry. */
|
|
3496
|
+
declare function bindSubagentTools(tools: ToolRegistry, options: BindSubagentToolsOptions): void;
|
|
3497
|
+
//#endregion
|
|
3498
|
+
//#region src/cost-meter-balance.d.ts
|
|
3499
|
+
interface DeepSeekBalanceSnapshot {
|
|
3500
|
+
readonly status: "ok" | "err" | "off";
|
|
3501
|
+
readonly message: string;
|
|
3502
|
+
readonly fetchedAt: number;
|
|
3503
|
+
readonly currency: string;
|
|
3504
|
+
readonly totalBalance: number;
|
|
3505
|
+
readonly grantedBalance: number;
|
|
3506
|
+
readonly toppedUpBalance: number;
|
|
3507
|
+
}
|
|
3508
|
+
//#endregion
|
|
3509
|
+
//#region src/cost-meter-go-quota.d.ts
|
|
3510
|
+
interface GoQuotaWindow {
|
|
3511
|
+
readonly percent: number;
|
|
3512
|
+
readonly resetsAt: string;
|
|
3513
|
+
}
|
|
3514
|
+
interface GoQuotaSnapshot {
|
|
3515
|
+
readonly status: "ok" | "err" | "off";
|
|
3516
|
+
readonly message: string;
|
|
3517
|
+
readonly fetchedAt: number;
|
|
3518
|
+
readonly rolling: GoQuotaWindow | null;
|
|
3519
|
+
readonly weekly: GoQuotaWindow | null;
|
|
3520
|
+
readonly monthly: GoQuotaWindow | null;
|
|
3521
|
+
}
|
|
3522
|
+
//#endregion
|
|
3523
|
+
//#region src/cost-meter-coding-plan-service.d.ts
|
|
3524
|
+
interface CodingPlanSnapshot {
|
|
3525
|
+
readonly status: "ok" | "err" | "off" | "error";
|
|
3526
|
+
readonly message: string;
|
|
3527
|
+
readonly fetchedAt: number;
|
|
3528
|
+
readonly windows: Record<string, unknown>;
|
|
3529
|
+
}
|
|
3530
|
+
//#endregion
|
|
3531
|
+
//#region src/cost-meter-custom-balance.d.ts
|
|
3532
|
+
interface CustomBalanceSnapshot {
|
|
3533
|
+
readonly status: "ok" | "err" | "off";
|
|
3534
|
+
readonly message: string;
|
|
3535
|
+
readonly fetchedAt: number;
|
|
3536
|
+
readonly label: string;
|
|
3537
|
+
readonly unit: string;
|
|
3538
|
+
readonly remaining: number;
|
|
3539
|
+
readonly maxBudget: number | null;
|
|
3540
|
+
readonly spend: number | null;
|
|
3541
|
+
}
|
|
3542
|
+
//#endregion
|
|
3543
|
+
//#region src/cost-meter-store.d.ts
|
|
3544
|
+
interface CostMeterBuckets {
|
|
3545
|
+
input: number;
|
|
3546
|
+
output: number;
|
|
3547
|
+
cacheRead: number;
|
|
3548
|
+
cacheWrite: number;
|
|
3549
|
+
reasoning: number;
|
|
3550
|
+
cost: number;
|
|
3551
|
+
}
|
|
3552
|
+
interface CostMeterDay {
|
|
3553
|
+
date: string;
|
|
3554
|
+
input: number;
|
|
3555
|
+
output: number;
|
|
3556
|
+
cacheRead: number;
|
|
3557
|
+
cacheWrite: number;
|
|
3558
|
+
reasoning: number;
|
|
3559
|
+
calls: number;
|
|
3560
|
+
cost: number;
|
|
3561
|
+
byModel: Record<string, CostMeterBuckets>;
|
|
3562
|
+
byProviderModel: Record<string, CostMeterBuckets>;
|
|
3563
|
+
sessions: Array<Record<string, unknown>>;
|
|
3564
|
+
}
|
|
3565
|
+
interface CostMeterState {
|
|
3566
|
+
today: CostMeterDay;
|
|
3567
|
+
month: CostMeterDay;
|
|
3568
|
+
total: CostMeterDay;
|
|
3569
|
+
budgetUsed?: number;
|
|
3570
|
+
balance: Record<string, unknown>;
|
|
3571
|
+
goQuota: Record<string, unknown>;
|
|
3572
|
+
customBalance: Record<string, unknown>;
|
|
3573
|
+
codingPlans: Record<string, unknown>;
|
|
3574
|
+
history: CostMeterDay[];
|
|
3575
|
+
config: Record<string, unknown>;
|
|
3576
|
+
priceCatalog: Record<string, unknown> | null;
|
|
3577
|
+
meta: {
|
|
3578
|
+
now: number;
|
|
3579
|
+
timezoneOffsetMinutes: number;
|
|
3580
|
+
dayKey: string;
|
|
3581
|
+
monthKey: string;
|
|
3582
|
+
};
|
|
3583
|
+
}
|
|
3584
|
+
type LedgerFile = {
|
|
3585
|
+
config: Record<string, unknown>;
|
|
3586
|
+
history: CostMeterDay[];
|
|
3587
|
+
pendingByKey?: Record<string, CostMeterUsageSample>;
|
|
3588
|
+
balanceCache?: DeepSeekBalanceSnapshot;
|
|
3589
|
+
goQuotaCache?: GoQuotaSnapshot;
|
|
3590
|
+
customBalanceCache?: CustomBalanceSnapshot;
|
|
3591
|
+
codingPlansCache?: Record<string, CodingPlanSnapshot>;
|
|
3592
|
+
};
|
|
3593
|
+
interface CostMeterRefreshResult {
|
|
3594
|
+
readonly ok: boolean;
|
|
3595
|
+
readonly message: string;
|
|
3596
|
+
readonly state: CostMeterState;
|
|
3597
|
+
}
|
|
3598
|
+
interface CostMeterUsageSample {
|
|
3599
|
+
readonly sessionId: string;
|
|
3600
|
+
readonly turnId: string;
|
|
3601
|
+
readonly stepId: string;
|
|
3602
|
+
readonly ts: number;
|
|
3603
|
+
readonly provider: string;
|
|
3604
|
+
readonly model: string;
|
|
3605
|
+
readonly input: number;
|
|
3606
|
+
readonly output: number;
|
|
3607
|
+
readonly cacheRead: number;
|
|
3608
|
+
readonly cacheWrite: number;
|
|
3609
|
+
readonly reasoning: number;
|
|
3610
|
+
/** USD estimate at record time (from bundled / configured prices). */
|
|
3611
|
+
readonly cost: number;
|
|
3612
|
+
}
|
|
3613
|
+
/** Align ledger path with Face `productDir` (~/.xrk). */
|
|
3614
|
+
declare function configureCostMeterHome(home?: string): void;
|
|
3615
|
+
/** Absolute path of the Host cost-meter ledger (doctor / integrators). */
|
|
3616
|
+
declare function costMeterLedgerPath(): string;
|
|
3617
|
+
/**
|
|
3618
|
+
* Upgrade V3-era bundled tables to V4 flash/pro and recompute every stored cost
|
|
3619
|
+
* from disjoint token buckets (dsh-cost-meter costOf). Returns true when ledger mutated.
|
|
3620
|
+
*/
|
|
3621
|
+
declare function migrateAndRepriceLedger(ledger: LedgerFile): boolean;
|
|
3622
|
+
declare function costMeterGetState(): CostMeterState;
|
|
3623
|
+
declare function costMeterRefreshBalance(): Promise<CostMeterRefreshResult>;
|
|
3624
|
+
/** DSH tokenledger / usage-stats aggregate from persisted ledger history. */
|
|
3625
|
+
declare function costMeterAggregateUsage(query?: {
|
|
3626
|
+
readonly days?: number;
|
|
3627
|
+
}): Record<string, unknown>;
|
|
3628
|
+
interface CostMeterSessionTotals {
|
|
3629
|
+
readonly uncachedInputTokens: number;
|
|
3630
|
+
readonly outputTokens: number;
|
|
3631
|
+
readonly cacheReadTokens: number;
|
|
3632
|
+
readonly cacheWriteTokens: number;
|
|
3633
|
+
readonly costUsd: number;
|
|
3634
|
+
}
|
|
3635
|
+
/** Sum ledger session rows for a Face session id (live cost-meter data). */
|
|
3636
|
+
declare function costMeterSessionTotals(sessionId: string): CostMeterSessionTotals | null;
|
|
3637
|
+
/** dsh-wallet usage panel: recent daily cost from ledger (CNY display). */
|
|
3638
|
+
declare function costMeterDisplayExchangeRate(): number;
|
|
3639
|
+
/** Recent daily cost for dsh-wallet (CNY). */
|
|
3640
|
+
declare function costMeterWalletUsage(days?: number): {
|
|
3641
|
+
readonly today: {
|
|
3642
|
+
date: string;
|
|
3643
|
+
cost: number;
|
|
3644
|
+
};
|
|
3645
|
+
readonly days: Array<{
|
|
3646
|
+
date: string;
|
|
3647
|
+
cost: number;
|
|
3648
|
+
}>;
|
|
3649
|
+
readonly ready: boolean;
|
|
3650
|
+
readonly degraded: boolean;
|
|
3651
|
+
};
|
|
3652
|
+
//#endregion
|
|
3653
|
+
//#region src/cost-meter-pricing.d.ts
|
|
3654
|
+
interface ModelPriceTier {
|
|
3655
|
+
readonly cacheHit: number;
|
|
3656
|
+
readonly cacheMiss: number;
|
|
3657
|
+
readonly output: number;
|
|
3658
|
+
/** Extra reasoning rate; default 0 — reasoning is usually already in output. */
|
|
3659
|
+
readonly reasoning?: number;
|
|
3660
|
+
}
|
|
3661
|
+
interface ModelPriceRow extends ModelPriceTier {
|
|
3662
|
+
readonly peak?: ModelPriceTier;
|
|
3663
|
+
readonly offPeak?: ModelPriceTier;
|
|
3664
|
+
readonly legacyBase?: ModelPriceTier;
|
|
3665
|
+
}
|
|
3666
|
+
/** DeepSeek + aliases (per-million USD). Keys are lowercase product ids. */
|
|
3667
|
+
declare const BUNDLED_MODEL_PRICES: Readonly<Record<string, ModelPriceRow>>;
|
|
3668
|
+
declare function bundledCostMeterPriceConfig(): Record<string, unknown>;
|
|
3669
|
+
/**
|
|
3670
|
+
* Estimate USD cost. `sample.input` must be **uncached** (disjoint from cacheRead).
|
|
3671
|
+
*/
|
|
3672
|
+
declare function estimateUsageCostUsd(sample: Pick<CostMeterUsageSample, "provider" | "model" | "input" | "output" | "cacheRead" | "cacheWrite" | "reasoning"> & {
|
|
3673
|
+
readonly ts?: number;
|
|
3674
|
+
}, config: Record<string, unknown>): number;
|
|
3675
|
+
/** Recompute a CostMeterBuckets-shaped cost from stored token counts. */
|
|
3676
|
+
declare function estimateBucketsCostUsd(buckets: {
|
|
3677
|
+
readonly input: number;
|
|
3678
|
+
readonly output: number;
|
|
3679
|
+
readonly cacheRead: number;
|
|
3680
|
+
readonly cacheWrite: number;
|
|
3681
|
+
readonly reasoning: number;
|
|
3682
|
+
}, provider: string, model: string, config: Record<string, unknown>, ts?: number): number;
|
|
3683
|
+
//#endregion
|
|
3684
|
+
//#region src/workspace-checkpoint.d.ts
|
|
3685
|
+
/**
|
|
3686
|
+
* Upper bound for one `snapshotSessionWorkspace` call. The store's per-command
|
|
3687
|
+
* timeout should win first; this races the whole call so a runner that never
|
|
3688
|
+
* settles (or a hung fs call) still degrades to "no checkpoint" instead of
|
|
3689
|
+
* blocking the drain queue. Skips the turn's point, never the turn.
|
|
3690
|
+
*/
|
|
3691
|
+
declare const SNAPSHOT_TIMEOUT_MS = 20000;
|
|
3692
|
+
/**
|
|
3693
|
+
* Soft budget for Host drain pre-turn snapshots when the tool barrier must
|
|
3694
|
+
* wait (LLM returned tools before git finished). Overlaps the model call via
|
|
3695
|
+
* `beforeTools`; prefer skip over stalling Queue/Steer. Manual
|
|
3696
|
+
* `session.checkpoint.snapshot` still uses {@link SNAPSHOT_TIMEOUT_MS}.
|
|
3697
|
+
*/
|
|
3698
|
+
declare const SNAPSHOT_DRAIN_BUDGET_MS = 5000;
|
|
3699
|
+
/** Test seam: replace the process git runner (or clear with `undefined`). */
|
|
3700
|
+
declare function setWorkspaceCheckpointGitRunner(runner: GitRunner | undefined): void;
|
|
3701
|
+
/** Drop cached stores (tests / Host cwd swap). */
|
|
3702
|
+
declare function clearWorkspaceCheckpointStores(): void;
|
|
3703
|
+
/**
|
|
3704
|
+
* Resolve (and cache) the checkpoint store for a workspace directory.
|
|
3705
|
+
* Shadow git lives under `{XRK_HOME}/checkpoints/<workspace-id>` — product
|
|
3706
|
+
* data is gathered in the XRK home, never inside the workspace.
|
|
3707
|
+
*/
|
|
3708
|
+
declare function workspaceCheckpointStoreFor(workspaceDir: string, runGit?: GitRunner): WorkspaceCheckpointStore;
|
|
3709
|
+
declare function workspaceCheckpointStoreForSession(runtime: FaceRuntime, sessionId: string, runGit?: GitRunner): WorkspaceCheckpointStore;
|
|
3710
|
+
/**
|
|
3711
|
+
* Host / Face: snapshot worktree before a turn mutates files.
|
|
3712
|
+
* Best-effort — git missing or snapshot failure must not block the turn.
|
|
3713
|
+
* Disabled when `XRK_CHECKPOINTS=0`.
|
|
3714
|
+
*
|
|
3715
|
+
* Hard deadline: race the snapshot against `opts.budgetMs` (default
|
|
3716
|
+
* {@link SNAPSHOT_TIMEOUT_MS}). Host drain should pass
|
|
3717
|
+
* {@link SNAPSHOT_DRAIN_BUDGET_MS} so large worktrees cannot pin Queue/Steer.
|
|
3718
|
+
*/
|
|
3719
|
+
declare function snapshotSessionWorkspace(runtime: FaceRuntime, sessionId: string, opts?: {
|
|
3720
|
+
readonly label?: string;
|
|
3721
|
+
readonly seq?: number;
|
|
3722
|
+
/** Whole-call race budget; default {@link SNAPSHOT_TIMEOUT_MS}. */
|
|
3723
|
+
readonly budgetMs?: number;
|
|
3724
|
+
}): Promise<WorkspaceCheckpointRecord | undefined>;
|
|
3725
|
+
/**
|
|
3726
|
+
* Newest checkpoint for this session whose `seq` is ≤ `atSeq`
|
|
3727
|
+
* (Face 1-based history seq of the message / turn tail).
|
|
3728
|
+
*/
|
|
3729
|
+
declare function findCheckpointAtOrBefore(store: WorkspaceCheckpointStore, sessionId: string, atSeq: number): WorkspaceCheckpointRecord | undefined;
|
|
3730
|
+
/** Resolve `/rollback` target: bare index (1-based newest-last list), id prefix, or `seq:N`. */
|
|
3731
|
+
declare function resolveRollbackTarget(store: WorkspaceCheckpointStore, sessionId: string, token: string): WorkspaceCheckpointRecord | undefined;
|
|
3732
|
+
//#endregion
|
|
3733
|
+
export { AGENT_TEAM_ROLES, AGENT_TEAM_SPAWN_ROLES, type AgentPresetInfo, type AgentPresetProfile, type AgentSubagentPolicy, type AgentTeamEdge, type AgentTeamEdgeKind, AgentTeamGraph, type AgentTeamNeighbor, type AgentTeamNode, type AgentTeamRole, type AgentTeamSpawnRole, type AgentTeamTask, AgentTeamTaskBoard, type AgentTeamTaskStatus, type AgentToolComposition, type AgentToolFlags, type ApiKeyCheck, type ApprovalCategory, type ApprovalClassification, type ApprovalOutcomeWire, type AttachFaceOptions, BUNDLED_MODEL_PRICES, type BindGoalToolsOptions, type BindProposeSkillToolOptions, type BindRalphToolOptions, type BindSessionQueryToolsOptions, type BindSubagentToolsOptions, type BuildRolloutTraceInput, CUSTOM_PERMISSION_PRESET, type CatalogAgentPresetId, type ClientBootEntry, type ClientBootReconcileResult, type ContinuableExternalKind, type CreateFaceRuntimeOptions, type CredentialSlotView, DEFAULT_MAX_ACTIVE_CHILDREN, DEFAULT_MAX_DEPTH, DEFAULT_MAX_GOAL_ROUNDS, DISABLED_PLUGINS_FILE, type DeclaredPiAiProvider, type DirectoryEntryView, type DirectoryListingView, type DirectoryPickerInternals, type DirectoryPickerRunner, EVENT_ISOMORPHISM, ExternalAgentError, type ExternalAgentHandleRecord, type ExternalAgentKind, type ExternalAgentLiveSession, type ExternalAgentProductConfig, ExternalAgentSessionRegistry, type ExternalSpawn, FACE_AGENT_PRESETS, FACE_AGENT_PRESET_IDS, FACE_ASSISTANT_SOURCE_PLACEHOLDER, FACE_HOST_REMOTE_EVENTS, FACE_PERMISSION_TABLE, FACE_REMOTE_NAMESPACES, FACE_RESPOND_PATHS, FACE_RPC_ERROR_CODES, FACE_USAGE_ROUTE_PLACEHOLDER, FACE_WS_HEARTBEAT_INTERVAL_MS, FACE_WS_HEARTBEAT_MAX_MISSED, FACE_WS_PATHS, FEEDBACK_CATEGORIES, FEEDBACK_TEXT_MAX_CHARS, FaceApprovalBroker, type FaceApprovalHooks, type FaceBus, FaceCredentialVault, type FaceDirectoryBackend, type FaceDrain, FaceGoalStore, type FaceHostPublicSettings, type FaceHostRemoteEvent, type FaceInboxSplice, FaceInboxWireMaps, FaceInboxWireProjector, type FaceJobsSource, FaceLlmResolveError, type FaceMcpServerDraft, FaceMessageFeedbackStore, type FaceModelRoute, FaceMuxSeq, type FacePluginInventoryEntry, type FaceProcessPlugin, type FaceProjectionMap, type FaceProjectionRegistry, type FaceQuestionAnswer, type FaceQuestionAnswerItem, FaceQuestionBroker, FaceQuestionError, type FaceQuestionHooks, type FaceQuestionItem, type FaceQueueItem, type FaceQueueMessage, type FaceRemoteArg, type FaceRpcError, type FaceRpcErrorCode, type FaceRpcFail, type FaceRpcReceipt, type FaceRpcRequest, type FaceRpcResponse, type FaceRpcResult, type FaceRuntime, type FaceSeqClock, type FaceSettingsNamespaceView, FaceSettingsNamespaces, type FaceSettingsPathOp, type FaceSubagentLink, FaceSubagentRegistry, FaceTitleController, FaceToolArgMaps, type FaceUiSettings, type FaceWebPlugin, FaceWireIdMaps, type FaceWireSessionEvent, type FaceWireUserMessage, FaceWorkspaceRegistry, type FaceWorkspaceView, GOAL_OBJECTIVE_MAX_CHARS, type GoalActivation, type GoalPhase, type GoalProjectionValue, type GoalRef, type GoalRoundSnapshot, type GoalTurnEndDecision, type GoalView, HOST_CLI_PRESET_IDS, type HostFrame, JOB_COMPLETION_MAX_WAKES, type JobView, MANAGED_WORKTREE_OWNER_FILENAME, MANAGED_WORKTREE_OWNER_VERSION, MESSAGE_FEEDBACK_NOTE_MAX_BYTES, type ManagedPackageIndex, type ManagedPluginPackageMeta, type ManagedWorktreeLease, ManagedWorktreeManager, type ManagedWorktreeMergeResult, type ManagedWorktreeMergeStrategy, type ManagedWorktreeOwnerRecord, type ManagedWorktreeStatus, type MessageFeedbackItem, type MessageFeedbackRating, type MuxFrame, type NativeDirectoryPicker, type NetworkApprovalContext, type NetworkApprovalProtocol, type OutputSchemaObject, type OutputSchemaValidation, PROPOSE_SKILL_APPROVE_LABEL, PROPOSE_SKILL_QUESTION_ID, PROPOSE_SKILL_REJECT_LABEL, type ParsedClientResponse, PathEscapeError, type PendingApprovalItem, type PendingQuestionItem, type PermissionPresetSpec, type PermissionRequestGate, type PermissionSelect, type PermissionSelectOption, type PlanSetOutcome, type PresentToolLookup, type ProjectionSnapshot, type ProjectionWire, type ProviderRouteContext, type QueuePlacement, RALPH_DEFAULT_MAX_ROUNDS, RALPH_HARD_MAX_ROUNDS, RALPH_MAX_HANDOFF_CHARS, RALPH_MAX_RESULT_CHARS, type RalphRoundReport, type RalphRoundStatus, type RalphTerminalStatus, type ResolvedFaceLlm, type RolloutTraceEdge, type RolloutTraceEdgeKind, type RolloutTraceLink, type RolloutTraceNode, type RolloutTraceNodeKind, type RolloutTraceState, type RpcId, type RunExternalAgentOptions, SESSION_EXPORT_PATHS, SESSION_QUERY_ROUTING_PROMPT_TEXT, SESSION_READ_MAX_BYTES, SESSION_TRACE_MAX_NODES, SNAPSHOT_DRAIN_BUDGET_MS, SNAPSHOT_TIMEOUT_MS, SUBAGENT_ROUTING_PROMPT_TEXT, type SessionFeedbackEntry, type SessionListMetadata, type SessionStatusBilling, type SessionStatusBillingDay, type SessionStatusChannels, type SessionStatusCompaction, type SessionStatusCompactionPipeline, type SessionStatusCompactionStage, type SessionStatusCost, type SessionStatusCostBuckets, type SessionStatusCostModelRow, type SessionStatusCuratedMemory, type SessionStatusDelivery, type SessionStatusFleet, type SessionStatusFleetAlert, type SessionStatusFleetHealth, type SessionStatusGraph, type SessionStatusJobRow, type SessionStatusSnapshot, type SessionStatusSpillEntry, type SessionStatusSubagentLive, type SessionStatusTeamTask, type SessionStatusTimeline, SessionTitleInvalidError, type SubagentMode, type ToolCallPairing, type ToolEventView, type UiTheme, WIN32_POWERSHELL_PICK, type WireAdaptContext, type WireHistoryEntry, type WorkspaceProductEntry, type WsHeartbeat, agentTeamGraphPath, agentTeamTasksPath, appendOutputContract, applyLivePermissionDefaultPreset, applyPermissionPreset, applySpawnRoleReminder, approvalRequestedFrame, approvalResolvedFrame, assertUnderRoot, assistantMessageSource, atomicWriteText, attachFaceUpgrades, bindAskUserTool, bindExitPlanModeTool, bindGoalTools, bindManagedWorktreeOwner, bindProposeSkillTool, bindRalphTool, bindSessionQueryTools, bindSettingsTools, bindSubagentTools, buildOutputSchemaRetryMessage, buildRolloutTraceState, buildSessionStatusSnapshot, bundledCostMeterPriceConfig, canOpenNativePath, canPickNativeDirectory, canonicalAgentPresetId, classifyApproval, clearSoftDisabledIdsAt, clearWorkspaceCheckpointStores, coerceAskUserQuestions, coerceOutputSchema, collectToolCallArgs, commitPlanMode, configureCostMeterHome, costMeterAggregateUsage, costMeterDisplayExchangeRate, costMeterGetState, costMeterLedgerPath, costMeterRefreshBalance, costMeterSessionTotals, costMeterWalletUsage, createFaceBus, createFaceOnlyServer, createFaceProjectionRegistry, createFaceRuntime, createFaceSeqClock, createFileLimitsProjectionUnit, createImageLimitsProjectionUnit, createRalphTool, createSessionListMetadataUnit, createSessionReadTool, createSessionRoutingLlm, createSessionSearchTool, createSessionTraceTool, createTitleProjectionUnit, credentialsDescribe, credentialsList, credentialsSet, credentialsUnset, decideGoalTurnEnd, defaultPermissionPreset, defaultUiSettings, defaultWorkspaceTitle, derivePermissionSelect, dispatchFaceMethod, effectiveHostApiKey, errResponse, estimateBucketsCostUsd, estimateUsageCostUsd, externalAgentHandlesPath, extractJsonCandidate, extractNetworkContext, faceMethodFromPath, faceToolLookup, fallbackSessionTitle, findCheckpointAtOrBefore, formatJobCompletionNotice, formatMcpInventoryText, formatQuestionAnswer, formatSessionStatusText, formatSubagentCompletionNotice, fullyQualified, getHandler, handleFaceHttpRequest, hostCreateDirectory, hostListDirectory, hostOpenPath, hostPickDirectoryRpc, hydrateCredentialsFromSecretStore, hydrateFaceHostSettings, installDefaultFaceProjections, interruptExternalContinuable, isAgentTeamRole, isAgentTeamSpawnRole, isChildSessionActive, isFaceHttpPath, isFaceRespondPath, isFaceWsPath, isFeedbackCategory, isLoopbackAddress, isPluginSoftDisabledAt, isSessionExportPath, isSettledJobStatus, jobViews, lastAssistantBodyText, listCredentialSlots, listDeclaredPiAiProviders, listFacePluginInventory, listProductTree, listSettingsProviderCredentialRefs, listSpawnRoleIds, liveRouteAllowsImageInput, lookupManagedPluginSourceAt, managedWorktreesPath, mapFaceRpcError, migrateAndRepriceLedger, narratePlanCommand, normalizeApiKey, normalizeFeedbackEntry, normalizeOpenPath, normalizeSessionTitle, okResponse, openExternalAgentLiveSession, openNativePath, parseAgentTeamSpawnRole, parseClientResponse, parseExternalAgentKind, parseExternalAgentProduct, parseFaceMcpServers, parseFaceRpcRequest, peekSettingsYamlSection, peekSpillEntry, permissionSelectFromEvents, piAiProviderProfile, pickNativeDirectory, pinInitialPermission, planWantedFromArgs, presentToolView, previewPlanSet, promptExternalContinuable, proposeSkillQuestions, providerApiKeyEnv, providerHasUsableCredential, providerModelKey, providerRouteServed, publishRemoteEvent, questionRequestedFrame, questionResolvedFrame, rankCostModelRows, readDisabledPluginIdsAt, readManagedPackageIndexAt, readManagedPluginPackagesAt, readManagedWorktreeOwner, readProviderApiKey, readProviderRoute, reconcileClientBootAt, reconcileManagedClientBoot, reconcileManagedProcessPlugins, recordSessionFeedback, renderGoalRoundPrompt, renderGoalStartPrompt, resetLastGoodConfigCaches, resetLastGoodHostMcpCache, resolveAgentPresetProfile, resolveExternalAgentLaunch, resolveHarnessHome, resolveLlmForSelection, resolveLlmForSession, resolveManagedPluginDir, resolveManagedPluginUpdateSpec, resolveManagedPluginsDir, resolveProductDir, resolveProviderBinding, resolveRollbackTarget, resolveSessionCwd, resolveSubagentQuota, resolveToolPreset, revealNativePath, routeFromRequestHeader, runExternalAgentTurn, serverRequestFrame, sessionExportFilename, sessionFeedbackRecord, setSoftDisabledAt, setWorkspaceCheckpointGitRunner, settingsDescribeFace, settingsGet, settingsMutateFace, settingsOpenDocument, settingsReplaceFace, settingsSet, settingsUpdateFace, settingsYamlPath, settleFaceRespond, snapshotSessionWorkspace, startExternalContinuable, startWsHeartbeat, steerPlanMessage, subagentDepth, supportsExternalContinuable, toFaceWireSessionEvent, toMuxSessionEvent, toQueueItems, toWireHistoryEntry, tryHandleFaceHttp, validateOutputAgainstSchema, validateRalphReport, validateSettingsNamespace, windowsExplorerPath, wireNumericId, workspaceArchiveSessionFace, workspaceCheckpointStoreFor, workspaceCheckpointStoreForSession, workspaceCreateFace, workspaceDeleteFace, workspaceDescribe, workspaceInsertBeforeFace, workspaceInsertSessionBeforeFace, workspaceListFace, workspaceListProduct, workspacePinSessionFace, workspacePreviewInject, workspaceRenameFace, workspaceUnarchiveSessionFace, workspaceUnpinSessionFace, writeDisabledPluginIdsAt, writeFeedbackConversationSlice };
|
|
3734
|
+
//# sourceMappingURL=index.d.mts.map
|