@crouton-kit/crouter 0.3.27 → 0.3.29
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/dist/build-root.js +4 -2
- package/dist/builtin-memory/crouter-development/marketplaces.md +7 -6
- package/dist/builtin-memory/crouter-development/personas/base-prompt.md +1 -1
- package/dist/builtin-memory/crouter-development/personas/orchestrator-prompt.md +1 -1
- package/dist/builtin-memory/crouter-development/personas.md +1 -1
- package/dist/builtin-memory/crouter-development/plugins.md +20 -18
- package/dist/builtin-memory/design.md +1 -1
- package/dist/builtin-memory/development.md +1 -1
- package/dist/builtin-memory/internal/INDEX.md +1 -1
- package/dist/builtin-memory/internal/examples/INDEX.md +1 -1
- package/dist/builtin-memory/internal/examples/imessage-assistant.md +2 -2
- package/dist/builtin-memory/internal/nodes-and-canvas.md +1 -1
- package/dist/builtin-memory/internal/storage-tiers.md +1 -1
- package/dist/builtin-memory/planning.md +1 -1
- package/dist/builtin-memory/spec.md +6 -4
- package/dist/builtin-personas/orchestration-kernel.md +4 -5
- package/dist/builtin-personas/runtime-base.md +8 -4
- package/dist/builtin-personas/spec/PERSONA.md +8 -4
- package/dist/builtin-personas/spec/orchestrator.md +5 -3
- package/dist/builtin-personas/spec/requirements/PERSONA.md +10 -0
- package/dist/builtin-views/canvas/core.mjs +586 -0
- package/dist/builtin-views/canvas/text.mjs +58 -0
- package/dist/builtin-views/canvas/tui.mjs +165 -0
- package/dist/builtin-views/canvas/web.jsx +120 -0
- package/dist/builtin-views/git-pr/core.mjs +673 -0
- package/dist/builtin-views/git-pr/text.mjs +84 -0
- package/dist/builtin-views/git-pr/tui.mjs +302 -0
- package/dist/builtin-views/git-pr/web.jsx +216 -0
- package/dist/builtin-views/inbox/_lib/render.mjs +1 -3
- package/dist/builtin-views/inbox/core.mjs +1273 -0
- package/dist/builtin-views/inbox/text.mjs +73 -0
- package/dist/builtin-views/inbox/tui.mjs +312 -0
- package/dist/builtin-views/inbox/web.jsx +188 -0
- package/dist/builtin-views/linkedin/core.mjs +906 -0
- package/dist/builtin-views/linkedin/text.mjs +69 -0
- package/dist/builtin-views/linkedin/tui.mjs +427 -0
- package/dist/builtin-views/linkedin/web.jsx +206 -0
- package/dist/builtin-views/workspace-sidebar/core.mjs +621 -0
- package/dist/builtin-views/workspace-sidebar/text.mjs +53 -0
- package/dist/builtin-views/workspace-sidebar/tui.mjs +142 -0
- package/dist/builtin-views/workspace-sidebar/web.jsx +109 -0
- package/dist/cli.js +3 -3
- package/dist/clients/attach/__tests__/action-parity.test.js +48 -0
- package/dist/clients/attach/__tests__/clipboard-image.test.js +76 -0
- package/dist/clients/attach/__tests__/editor-newline.test.js +57 -0
- package/dist/clients/attach/__tests__/git-info.test.js +31 -0
- package/dist/clients/attach/__tests__/onrequest-wired.test.js +20 -0
- package/dist/clients/attach/__tests__/reconnect-giveup.test.js +30 -0
- package/dist/clients/attach/__tests__/slash-quit-copy.test.js +42 -0
- package/dist/clients/attach/__tests__/titled-editor.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/titled-editor.test.js +39 -0
- package/dist/clients/attach/attach-cmd.js +445 -41
- package/dist/clients/attach/auth-pickers.d.ts +9 -0
- package/dist/clients/attach/auth-pickers.js +194 -0
- package/dist/clients/attach/canvas-panels.d.ts +12 -0
- package/dist/clients/attach/canvas-panels.js +78 -0
- package/dist/clients/attach/chat-view.d.ts +27 -2
- package/dist/clients/attach/chat-view.js +98 -9
- package/dist/clients/attach/clipboard-image.d.ts +47 -8
- package/dist/clients/attach/clipboard-image.js +150 -26
- package/dist/clients/attach/clipboard-text.d.ts +3 -0
- package/dist/clients/attach/clipboard-text.js +39 -0
- package/dist/clients/attach/config-load.d.ts +54 -7
- package/dist/clients/attach/config-load.js +99 -3
- package/dist/clients/attach/context-message.d.ts +12 -0
- package/dist/clients/attach/context-message.js +72 -0
- package/dist/clients/attach/git-info.d.ts +20 -0
- package/dist/clients/attach/git-info.js +44 -0
- package/dist/clients/attach/graph-overlay.d.ts +43 -0
- package/dist/clients/attach/graph-overlay.js +306 -0
- package/dist/clients/attach/input-controller.d.ts +81 -13
- package/dist/clients/attach/input-controller.js +307 -67
- package/dist/clients/attach/pickers.d.ts +58 -0
- package/dist/clients/attach/pickers.js +171 -0
- package/dist/clients/attach/slash-commands.d.ts +44 -1
- package/dist/clients/attach/slash-commands.js +250 -27
- package/dist/clients/attach/titled-editor.d.ts +33 -0
- package/dist/clients/attach/titled-editor.js +84 -0
- package/dist/clients/attach/view-socket.d.ts +37 -2
- package/dist/clients/attach/view-socket.js +131 -7
- package/dist/clients/web/dev-server.d.ts +7 -0
- package/dist/clients/web/dev-server.js +59 -0
- package/dist/clients/web/events.d.ts +14 -0
- package/dist/clients/web/events.js +151 -0
- package/dist/clients/web/server.d.ts +18 -0
- package/dist/clients/web/server.js +450 -0
- package/dist/clients/web/web-cmd.d.ts +2 -0
- package/dist/clients/web/web-cmd.js +120 -0
- package/dist/commands/canvas.js +1 -2
- package/dist/commands/chord.js +1 -1
- package/dist/commands/dashboard.js +5 -1
- package/dist/commands/human/prompts.js +3 -3
- package/dist/commands/human/queue.d.ts +17 -0
- package/dist/commands/human/queue.js +111 -4
- package/dist/commands/memory/__tests__/lint-schema.test.js +27 -4
- package/dist/commands/memory/lint.d.ts +5 -4
- package/dist/commands/memory/lint.js +23 -7
- package/dist/commands/memory/read.js +2 -2
- package/dist/commands/memory/shared.d.ts +7 -1
- package/dist/commands/memory/shared.js +18 -3
- package/dist/commands/memory/write.js +20 -7
- package/dist/commands/memory.js +4 -4
- package/dist/commands/node.d.ts +1 -1
- package/dist/commands/node.js +64 -65
- package/dist/commands/pkg.js +1 -2
- package/dist/commands/revive.js +11 -3
- package/dist/commands/sys/feedback.d.ts +1 -0
- package/dist/commands/sys/feedback.js +163 -0
- package/dist/commands/sys/sync.d.ts +1 -0
- package/dist/commands/sys/sync.js +187 -0
- package/dist/commands/sys.js +4 -2
- package/dist/commands/view-cycle.js +2 -2
- package/dist/commands/view-list.js +8 -8
- package/dist/commands/view-new.js +21 -17
- package/dist/commands/view-pick.js +1 -1
- package/dist/commands/view-run.js +35 -14
- package/dist/commands/view.js +8 -6
- package/dist/commands/workspace.d.ts +2 -0
- package/dist/commands/workspace.js +161 -0
- package/dist/core/__tests__/broker-double-spawn.test.d.ts +1 -0
- package/dist/core/__tests__/broker-double-spawn.test.js +143 -0
- package/dist/core/__tests__/broker-fork-seam.test.d.ts +1 -0
- package/dist/core/__tests__/broker-fork-seam.test.js +102 -0
- package/dist/core/__tests__/broker-sdk-wiring.test.js +2 -0
- package/dist/core/__tests__/broker-snapshot-history.test.d.ts +1 -0
- package/dist/core/__tests__/broker-snapshot-history.test.js +105 -0
- package/dist/core/__tests__/child-death-wake.test.js +56 -111
- package/dist/core/__tests__/close.test.js +14 -20
- package/dist/core/__tests__/context-intro.test.js +19 -19
- package/dist/core/__tests__/daemon-boot.test.js +30 -23
- package/dist/core/__tests__/draw-style.test.js +1 -1
- package/dist/core/__tests__/error-stall-recycle.test.d.ts +1 -0
- package/dist/core/__tests__/error-stall-recycle.test.js +141 -0
- package/dist/core/__tests__/fixtures/fake-engine.d.ts +24 -1
- package/dist/core/__tests__/fixtures/fake-engine.js +32 -2
- package/dist/core/__tests__/fixtures/fake-pi-host.js +2 -2
- package/dist/core/__tests__/focuses.test.js +25 -13
- package/dist/core/__tests__/fork.test.js +22 -5
- package/dist/core/__tests__/full/broker-control-preempt.test.d.ts +1 -0
- package/dist/core/__tests__/full/broker-control-preempt.test.js +61 -0
- package/dist/core/__tests__/full/broker-model-changed-broadcast.test.d.ts +1 -0
- package/dist/core/__tests__/full/broker-model-changed-broadcast.test.js +57 -0
- package/dist/core/__tests__/full/broker-navigate-tree-rewelcome.test.d.ts +1 -0
- package/dist/core/__tests__/full/broker-navigate-tree-rewelcome.test.js +80 -0
- package/dist/core/__tests__/full/broker-pane-resolution.test.js +90 -0
- package/dist/core/__tests__/full/cascade-close.test.js +22 -8
- package/dist/core/__tests__/full/detach-focus.test.js +66 -169
- package/dist/core/__tests__/helpers/harness.d.ts +6 -9
- package/dist/core/__tests__/helpers/harness.js +19 -36
- package/dist/core/__tests__/human-node-not-supervised.test.d.ts +1 -0
- package/dist/core/__tests__/human-node-not-supervised.test.js +83 -0
- package/dist/core/__tests__/human-stranded-deliver.test.d.ts +1 -0
- package/dist/core/__tests__/human-stranded-deliver.test.js +108 -0
- package/dist/core/__tests__/lifecycle.test.js +1 -19
- package/dist/core/__tests__/live-mutation-verbs.test.js +5 -5
- package/dist/core/__tests__/memory-resolver.test.js +1 -1
- package/dist/core/__tests__/on-read-dedup-resume.test.d.ts +1 -0
- package/dist/core/__tests__/on-read-dedup-resume.test.js +81 -0
- package/dist/core/__tests__/refresh-stall-recycle.test.d.ts +1 -0
- package/dist/core/__tests__/refresh-stall-recycle.test.js +88 -0
- package/dist/core/__tests__/relaunch-root.test.d.ts +1 -0
- package/dist/core/__tests__/relaunch-root.test.js +114 -0
- package/dist/core/__tests__/reset.test.js +19 -79
- package/dist/core/__tests__/steer-note.test.js +9 -7
- package/dist/core/__tests__/tmux-surface.test.js +13 -7
- package/dist/core/bootstrap.d.ts +0 -3
- package/dist/core/bootstrap.js +1 -143
- package/dist/core/canvas/browse/__tests__/model.test.js +86 -1
- package/dist/core/canvas/browse/__tests__/render.test.js +2 -1
- package/dist/core/canvas/browse/app.js +131 -8
- package/dist/core/canvas/browse/model.d.ts +23 -5
- package/dist/core/canvas/browse/model.js +68 -13
- package/dist/core/canvas/browse/render.d.ts +7 -1
- package/dist/core/canvas/browse/render.js +178 -47
- package/dist/core/canvas/canvas.js +1 -1
- package/dist/core/canvas/focuses.d.ts +4 -4
- package/dist/core/canvas/focuses.js +7 -7
- package/dist/core/canvas/nav-model.d.ts +162 -0
- package/dist/core/canvas/nav-model.js +487 -0
- package/dist/core/canvas/paths.d.ts +7 -0
- package/dist/core/canvas/paths.js +9 -0
- package/dist/core/canvas/render.d.ts +68 -9
- package/dist/core/canvas/render.js +195 -61
- package/dist/core/canvas/types.d.ts +16 -23
- package/dist/core/config.js +1 -4
- package/dist/core/memory-resolver.js +43 -5
- package/dist/core/runtime/bearings.d.ts +1 -1
- package/dist/core/runtime/bearings.js +8 -8
- package/dist/core/runtime/branded-host.d.ts +16 -0
- package/dist/core/runtime/branded-host.js +127 -0
- package/dist/core/runtime/broker-protocol.d.ts +212 -6
- package/dist/core/runtime/broker-sdk.d.ts +0 -12
- package/dist/core/runtime/broker-sdk.js +77 -6
- package/dist/core/runtime/broker.d.ts +5 -1
- package/dist/core/runtime/broker.js +520 -59
- package/dist/core/runtime/close.d.ts +12 -2
- package/dist/core/runtime/close.js +37 -16
- package/dist/core/runtime/front-door.js +14 -7
- package/dist/core/runtime/host.d.ts +14 -34
- package/dist/core/runtime/host.js +14 -50
- package/dist/core/runtime/launch.d.ts +12 -9
- package/dist/core/runtime/launch.js +27 -15
- package/dist/core/runtime/lifecycle.d.ts +1 -1
- package/dist/core/runtime/lifecycle.js +15 -19
- package/dist/core/runtime/nodes.d.ts +0 -55
- package/dist/core/runtime/nodes.js +6 -74
- package/dist/core/runtime/placement.d.ts +91 -334
- package/dist/core/runtime/placement.js +262 -828
- package/dist/core/runtime/promote.d.ts +2 -0
- package/dist/core/runtime/promote.js +24 -6
- package/dist/core/runtime/recap.d.ts +8 -0
- package/dist/core/runtime/recap.js +107 -0
- package/dist/core/runtime/recycle.js +25 -61
- package/dist/core/runtime/reset.d.ts +43 -37
- package/dist/core/runtime/reset.js +131 -218
- package/dist/core/runtime/revive.d.ts +9 -29
- package/dist/core/runtime/revive.js +45 -135
- package/dist/core/runtime/spawn.d.ts +15 -11
- package/dist/core/runtime/spawn.js +168 -136
- package/dist/core/runtime/surface-bg.d.ts +11 -0
- package/dist/core/runtime/surface-bg.js +68 -0
- package/dist/core/runtime/tmux.d.ts +15 -43
- package/dist/core/runtime/tmux.js +38 -80
- package/dist/core/scope.d.ts +1 -2
- package/dist/core/scope.js +1 -5
- package/dist/core/skill-sync/__tests__/dry-run-wrote-count.test.d.ts +1 -0
- package/dist/core/skill-sync/__tests__/dry-run-wrote-count.test.js +57 -0
- package/dist/core/skill-sync/builtins.d.ts +42 -0
- package/dist/core/skill-sync/builtins.js +112 -0
- package/dist/core/skill-sync/claude-plugins.d.ts +23 -0
- package/dist/core/skill-sync/claude-plugins.js +71 -0
- package/dist/core/skill-sync/engine.d.ts +42 -0
- package/dist/core/skill-sync/engine.js +633 -0
- package/dist/core/skill-sync/export.d.ts +23 -0
- package/dist/core/skill-sync/export.js +86 -0
- package/dist/core/skill-sync/manifest.d.ts +64 -0
- package/dist/core/skill-sync/manifest.js +181 -0
- package/dist/core/skill-sync/profile.d.ts +76 -0
- package/dist/core/skill-sync/profile.js +173 -0
- package/dist/core/skill-sync/snapshot.d.ts +57 -0
- package/dist/core/skill-sync/snapshot.js +120 -0
- package/dist/core/spawn.d.ts +14 -0
- package/dist/core/spawn.js +29 -9
- package/dist/core/substrate/index.d.ts +2 -2
- package/dist/core/substrate/index.js +7 -7
- package/dist/core/substrate/injected-store.d.ts +10 -0
- package/dist/core/substrate/injected-store.js +55 -0
- package/dist/core/substrate/on-read.js +68 -6
- package/dist/core/substrate/render.d.ts +8 -11
- package/dist/core/substrate/render.js +29 -43
- package/dist/core/substrate/schema.d.ts +16 -11
- package/dist/core/substrate/schema.js +32 -31
- package/dist/core/tui/host.d.ts +12 -4
- package/dist/core/tui/host.js +280 -149
- package/dist/core/view/bridge.d.ts +10 -0
- package/dist/core/view/bridge.js +31 -0
- package/dist/core/view/chrome.d.ts +9 -0
- package/dist/core/view/chrome.js +22 -0
- package/dist/core/view/contract.d.ts +171 -0
- package/dist/core/view/contract.js +23 -0
- package/dist/core/view/loader.d.ts +31 -0
- package/dist/core/view/loader.js +188 -0
- package/dist/core/view/transport-local.d.ts +7 -0
- package/dist/core/view/transport-local.js +70 -0
- package/dist/core/view/transport.d.ts +4 -0
- package/dist/core/view/transport.js +15 -0
- package/dist/daemon/crtrd.d.ts +38 -27
- package/dist/daemon/crtrd.js +303 -376
- package/dist/daemon/manage.js +6 -1
- package/dist/index.js +1 -1
- package/dist/pi-extensions/__tests__/canvas-stophook-agentend.test.js +28 -20
- package/dist/pi-extensions/canvas-context-intro.js +4 -4
- package/dist/pi-extensions/canvas-doc-substrate.js +29 -20
- package/dist/pi-extensions/canvas-nav.js +35 -385
- package/dist/pi-extensions/canvas-recap.d.ts +37 -0
- package/dist/pi-extensions/canvas-recap.js +236 -0
- package/dist/pi-extensions/canvas-resume.js +2 -1
- package/dist/pi-extensions/canvas-stophook.d.ts +15 -13
- package/dist/pi-extensions/canvas-stophook.js +119 -103
- package/dist/pi-extensions/canvas-view.js +2 -1
- package/dist/pi-extensions/widget-order-bus.d.ts +6 -0
- package/dist/pi-extensions/widget-order-bus.js +34 -0
- package/dist/prompts/view.d.ts +2 -2
- package/dist/prompts/view.js +145 -73
- package/dist/types.d.ts +1 -6
- package/dist/types.js +1 -3
- package/dist/web/ViewChrome.d.ts +7 -0
- package/dist/web/ViewChrome.js +28 -0
- package/dist/web/ViewPane.d.ts +39 -0
- package/dist/web/ViewPane.js +48 -0
- package/dist/web/index.d.ts +6 -0
- package/dist/web/index.js +16 -0
- package/dist/web/runtime.d.ts +39 -0
- package/dist/web/runtime.js +133 -0
- package/dist/web/states.d.ts +24 -0
- package/dist/web/states.js +24 -0
- package/dist/web/transport-http.d.ts +5 -0
- package/dist/web/transport-http.js +28 -0
- package/dist/web-client/assets/index-BUvQb4hR.css +2 -0
- package/dist/web-client/assets/index-ClLQXYAE.js +10 -0
- package/dist/web-client/index.html +13 -0
- package/package.json +20 -6
- package/dist/builtin-views/canvas/client.mjs +0 -303
- package/dist/builtin-views/canvas/view.mjs +0 -576
- package/dist/builtin-views/git-pr/client.mjs +0 -440
- package/dist/builtin-views/git-pr/view.mjs +0 -675
- package/dist/builtin-views/inbox/sources/gmail.mjs +0 -965
- package/dist/builtin-views/inbox/sources/linkedin.mjs +0 -427
- package/dist/builtin-views/inbox/view.mjs +0 -889
- package/dist/builtin-views/linkedin/client.mjs +0 -610
- package/dist/builtin-views/linkedin/view.mjs +0 -1171
- package/dist/commands/pkg/bridge.d.ts +0 -1
- package/dist/commands/pkg/bridge.js +0 -137
- package/dist/commands/skill/author.d.ts +0 -3
- package/dist/commands/skill/author.js +0 -140
- package/dist/commands/skill/shared.d.ts +0 -3
- package/dist/commands/skill/shared.js +0 -19
- package/dist/commands/skill.d.ts +0 -2
- package/dist/commands/skill.js +0 -21
- package/dist/commands/tmux-spread.d.ts +0 -2
- package/dist/commands/tmux-spread.js +0 -144
- package/dist/core/__tests__/full/daemon-liveness-pane.full.test.js +0 -292
- package/dist/core/__tests__/full/placement-focus.test.js +0 -309
- package/dist/core/__tests__/full/placement-reconcile.test.js +0 -212
- package/dist/core/__tests__/full/placement-revive.test.js +0 -238
- package/dist/core/__tests__/full/placement-teardown.test.js +0 -221
- package/dist/core/__tests__/home-session.test.js +0 -186
- package/dist/core/__tests__/relaunch.test.js +0 -335
- package/dist/core/bridge-map.d.ts +0 -19
- package/dist/core/bridge-map.js +0 -73
- package/dist/core/tui/contract.d.ts +0 -83
- package/dist/core/tui/contract.js +0 -8
- package/dist/core/tui/loader.d.ts +0 -16
- package/dist/core/tui/loader.js +0 -94
- package/dist/prompts/skill.d.ts +0 -2
- package/dist/prompts/skill.js +0 -650
- /package/dist/{core/__tests__/full/daemon-liveness-pane.full.test.d.ts → clients/attach/__tests__/action-parity.test.d.ts} +0 -0
- /package/dist/{core/__tests__/full/placement-focus.test.d.ts → clients/attach/__tests__/clipboard-image.test.d.ts} +0 -0
- /package/dist/{core/__tests__/full/placement-reconcile.test.d.ts → clients/attach/__tests__/editor-newline.test.d.ts} +0 -0
- /package/dist/{core/__tests__/full/placement-revive.test.d.ts → clients/attach/__tests__/git-info.test.d.ts} +0 -0
- /package/dist/{core/__tests__/full/placement-teardown.test.d.ts → clients/attach/__tests__/onrequest-wired.test.d.ts} +0 -0
- /package/dist/{core/__tests__/home-session.test.d.ts → clients/attach/__tests__/reconnect-giveup.test.d.ts} +0 -0
- /package/dist/{core/__tests__/relaunch.test.d.ts → clients/attach/__tests__/slash-quit-copy.test.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AgentSession, AgentSessionEvent, SessionStats } from '@earendil-works/pi-coding-agent';
|
|
2
|
-
import type { ImageContent } from '@earendil-works/pi-ai';
|
|
1
|
+
import type { AgentSession, AgentSessionEvent, SessionEntry, SessionInfo, SettingsConfig, SessionStats } from '@earendil-works/pi-coding-agent';
|
|
2
|
+
import type { Api, ImageContent, Model } from '@earendil-works/pi-ai';
|
|
3
3
|
/** Emitted when an extension needs user input (mirror of pi rpc-types.d.ts). */
|
|
4
4
|
export type RpcExtensionUIRequest = {
|
|
5
5
|
type: 'extension_ui_request';
|
|
@@ -152,15 +152,32 @@ export interface SetModelFrame {
|
|
|
152
152
|
type: 'set_model';
|
|
153
153
|
model: string;
|
|
154
154
|
}
|
|
155
|
-
/** `cycleModel()
|
|
155
|
+
/** `cycleModel(direction)` — ctrl+p (forward) / shift+ctrl+p (backward). `direction`
|
|
156
|
+
* defaults to `'forward'` when absent (back-compat with the original frame). */
|
|
156
157
|
export interface CycleModelFrame {
|
|
157
158
|
type: 'cycle_model';
|
|
159
|
+
direction?: 'forward' | 'backward';
|
|
158
160
|
}
|
|
159
|
-
/** `
|
|
161
|
+
/** `cycleThinkingLevel()` — shift+tab. Cycles to the next thinking level; the new
|
|
162
|
+
* level reaches viewers via the relayed `thinking_level_changed` event, so the
|
|
163
|
+
* broker replies a plain `ack` (no payload). Distinct from `set_thinking_level`,
|
|
164
|
+
* which jumps to a specific level chosen in the thinking picker. */
|
|
165
|
+
export interface CycleThinkingFrame {
|
|
166
|
+
type: 'cycle_thinking';
|
|
167
|
+
}
|
|
168
|
+
/** `setThinkingLevel(level)` — `/settings` thinking / thinking picker. */
|
|
160
169
|
export interface SetThinkingLevelFrame {
|
|
161
170
|
type: 'set_thinking_level';
|
|
162
171
|
level: AgentSession['thinkingLevel'];
|
|
163
172
|
}
|
|
173
|
+
/** `clearQueue()` — alt+up (dequeue). Removes ALL queued steering + follow-up
|
|
174
|
+
* messages and returns them so the viewer can restore them to the editor. A
|
|
175
|
+
* read-AND-mutate op: carries a correlation `id` and the broker replies with a
|
|
176
|
+
* `data{ kind:'dequeue' }` frame carrying the cleared messages. */
|
|
177
|
+
export interface DequeueFrame {
|
|
178
|
+
type: 'dequeue';
|
|
179
|
+
id: string;
|
|
180
|
+
}
|
|
164
181
|
/** `setAutoRetryEnabled(enabled)`. */
|
|
165
182
|
export interface SetAutoRetryFrame {
|
|
166
183
|
type: 'set_auto_retry';
|
|
@@ -221,9 +238,57 @@ export interface ExportFrame {
|
|
|
221
238
|
path: string;
|
|
222
239
|
format: 'html' | 'jsonl';
|
|
223
240
|
}
|
|
241
|
+
/** Model-selector data (`/model`, ctrl+l): the full registry, the current model,
|
|
242
|
+
* which models have auth, the `--models` scoped set, and the enabled-model set. */
|
|
243
|
+
export interface ListModelsFrame {
|
|
244
|
+
type: 'list_models';
|
|
245
|
+
id: string;
|
|
246
|
+
}
|
|
247
|
+
/** Session-resume data (`/resume`): the session list. `scope` selects the
|
|
248
|
+
* cwd-local list (default) or the cross-project list — `SessionSelectorComponent`
|
|
249
|
+
* uses BOTH loaders, so the viewer issues one request per scope. */
|
|
250
|
+
export interface ListSessionsFrame {
|
|
251
|
+
type: 'list_sessions';
|
|
252
|
+
id: string;
|
|
253
|
+
scope?: 'cwd' | 'all';
|
|
254
|
+
}
|
|
255
|
+
/** Session-tree + fork data (`/tree` nav AND `/fork` selector): the full tree,
|
|
256
|
+
* the current leaf, and the prior user messages the fork picker lists. */
|
|
257
|
+
export interface GetTreeFrame {
|
|
258
|
+
type: 'get_tree';
|
|
259
|
+
id: string;
|
|
260
|
+
}
|
|
261
|
+
/** Interactive settings-menu data (`/settings`): the full `SettingsConfig` toggle
|
|
262
|
+
* set plus auto-retry + current model (design §5 Unit A). */
|
|
263
|
+
export interface GetSettingsFrame {
|
|
264
|
+
type: 'get_settings';
|
|
265
|
+
id: string;
|
|
266
|
+
}
|
|
267
|
+
/** Scoped-models picker data (`/scoped-models`): every model + the enabled set. */
|
|
268
|
+
export interface ListScopedModelsFrame {
|
|
269
|
+
type: 'list_scoped_models';
|
|
270
|
+
id: string;
|
|
271
|
+
}
|
|
224
272
|
/** Answer a blocking extension dialog — pi's public RPC response type. */
|
|
225
273
|
export type ExtensionUIResponseFrame = RpcExtensionUIResponse;
|
|
226
|
-
|
|
274
|
+
/** Clone the current session to a new branch (`/clone`). Controller-only.
|
|
275
|
+
* Broker handler: reads current leaf from sessionManager, creates a branched
|
|
276
|
+
* session file, switches to it via runReplacement. */
|
|
277
|
+
export interface CloneFrame {
|
|
278
|
+
type: 'clone';
|
|
279
|
+
}
|
|
280
|
+
/** Share the session as a secret GitHub gist (`/share`). Controller-only.
|
|
281
|
+
* Broker handler: exports session to a temp HTML file, shells `gh gist create --secret`,
|
|
282
|
+
* returns the URL in ack.detail. */
|
|
283
|
+
export interface ShareFrame {
|
|
284
|
+
type: 'share';
|
|
285
|
+
}
|
|
286
|
+
/** Reload credentials + refresh model registry after a viewer-side auth change.
|
|
287
|
+
* Controller-only. Broker handler: services.authStorage.reload() + services.modelRegistry.refresh(). */
|
|
288
|
+
export interface ReloadAuthFrame {
|
|
289
|
+
type: 'reload_auth';
|
|
290
|
+
}
|
|
291
|
+
export type ClientToBroker = HelloFrame | PromptFrame | SteerFrame | FollowUpFrame | AbortFrame | RequestControlFrame | ReleaseControlFrame | ByeFrame | ShutdownFrame | SetModelFrame | CycleModelFrame | CycleThinkingFrame | SetThinkingLevelFrame | DequeueFrame | SetAutoRetryFrame | SetAutoCompactionFrame | CompactFrame | NewSessionFrame | SwitchSessionFrame | ForkFrame | SetSessionNameFrame | GetCommandsFrame | NavigateTreeFrame | ReloadFrame | ExportFrame | ListModelsFrame | ListSessionsFrame | GetTreeFrame | GetSettingsFrame | ListScopedModelsFrame | ExtensionUIResponseFrame | CloneFrame | ShareFrame | ReloadAuthFrame;
|
|
227
292
|
export interface WelcomeFrame {
|
|
228
293
|
type: 'welcome';
|
|
229
294
|
snapshot: BrokerSnapshot;
|
|
@@ -233,15 +298,34 @@ export interface WelcomeFrame {
|
|
|
233
298
|
* attach-mid-dialog). The field exists now; it is only ever populated in
|
|
234
299
|
* Phase 4 — Phase 3 always sends it absent/null. */
|
|
235
300
|
pending_dialog?: RpcExtensionUIRequest | null;
|
|
301
|
+
/** The pi agent dir (`~/.pi/agent`) from the broker's process — so the viewer
|
|
302
|
+
* can construct an AuthStorage/ModelRegistry pointing at the SAME auth.json.
|
|
303
|
+
* crtr attach is tmux-local only: broker + viewer share a filesystem. */
|
|
304
|
+
agentDir?: string;
|
|
236
305
|
}
|
|
237
306
|
export interface ControlChangedFrame {
|
|
238
307
|
type: 'control_changed';
|
|
239
308
|
controller_id: string | null;
|
|
240
309
|
}
|
|
310
|
+
/** Broadcast to EVERY client after a successful `set_model`/`cycle_model`. pi
|
|
311
|
+
* emits no AgentSessionEvent for a model switch, so without this the new model
|
|
312
|
+
* reaches no viewer at all (the requester gets only a bare ack) and footers
|
|
313
|
+
* show the stale model until the next unrelated event. `model` mirrors
|
|
314
|
+
* `snapshot.state.model` (the model id); undefined when the engine has none. */
|
|
315
|
+
export interface ModelChangedFrame {
|
|
316
|
+
type: 'model_changed';
|
|
317
|
+
model: string | undefined;
|
|
318
|
+
}
|
|
241
319
|
export interface ErrorFrame {
|
|
242
320
|
type: 'error';
|
|
243
321
|
code: string;
|
|
244
322
|
message: string;
|
|
323
|
+
/** Correlation token, echoed from the request that failed. Present ONLY on the
|
|
324
|
+
* failure of a correlated request (a read-op or `dequeue`, which carry an `id`
|
|
325
|
+
* and otherwise resolve via a `data` frame) so the viewer can reject the exact
|
|
326
|
+
* pending-by-id promise instead of hanging it. Absent on uncorrelated errors
|
|
327
|
+
* (engine drive errors, command-op failures, frame_overflow). */
|
|
328
|
+
id?: string;
|
|
245
329
|
}
|
|
246
330
|
/** Result of a controller command op (§1.3): `for` echoes the op name, `ok` the
|
|
247
331
|
* outcome, `detail` an optional human-readable note. */
|
|
@@ -251,12 +335,134 @@ export interface AckFrame {
|
|
|
251
335
|
ok: boolean;
|
|
252
336
|
detail?: string;
|
|
253
337
|
}
|
|
338
|
+
/** `provider/id` model reference — the wire form of a current/selected model. */
|
|
339
|
+
export interface WireModelRef {
|
|
340
|
+
provider: string;
|
|
341
|
+
id: string;
|
|
342
|
+
}
|
|
343
|
+
/** A `--models` scoped cycle entry (mirror of `AgentSession.scopedModels[n]`). */
|
|
344
|
+
export interface WireScopedModel {
|
|
345
|
+
model: Model<Api>;
|
|
346
|
+
thinkingLevel?: AgentSession['thinkingLevel'];
|
|
347
|
+
}
|
|
348
|
+
/** Wire form of pi's `SessionInfo`: identical EXCEPT `created`/`modified` are ISO
|
|
349
|
+
* strings (pi's are `Date`, which JSON cannot round-trip) — the viewer revives
|
|
350
|
+
* them with `new Date(...)` before handing them to `SessionSelectorComponent`. */
|
|
351
|
+
export interface WireSessionInfo extends Omit<SessionInfo, 'created' | 'modified'> {
|
|
352
|
+
created: string;
|
|
353
|
+
modified: string;
|
|
354
|
+
}
|
|
355
|
+
/** Wire form of pi's `SessionTreeNode` (NOT re-exported from the pi package root,
|
|
356
|
+
* so mirrored structurally here). Byte-compatible with `SessionManager.getTree()`'s
|
|
357
|
+
* return; `SessionEntry` IS re-exported, so it is referenced directly. */
|
|
358
|
+
export interface WireSessionTreeNode {
|
|
359
|
+
entry: SessionEntry;
|
|
360
|
+
children: WireSessionTreeNode[];
|
|
361
|
+
label?: string;
|
|
362
|
+
labelTimestamp?: string;
|
|
363
|
+
}
|
|
364
|
+
/** A prior user message for the `/fork` selector (`UserMessageSelectorComponent`
|
|
365
|
+
* consumes `{ id, text, timestamp? }`). `id` is the session entry id. */
|
|
366
|
+
export interface WireForkPoint {
|
|
367
|
+
id: string;
|
|
368
|
+
text: string;
|
|
369
|
+
timestamp?: string;
|
|
370
|
+
}
|
|
371
|
+
/** The interactive settings-menu state. The full pi `SettingsConfig` (every toggle
|
|
372
|
+
* the `/settings` menu shows) PLUS auto-retry and the current model, which the
|
|
373
|
+
* menu reflects but `SettingsConfig` omits. Build-time `extends` enforces that the
|
|
374
|
+
* broker populates every `SettingsConfig` field (no thin payload — design R1). */
|
|
375
|
+
export interface WireSettings extends SettingsConfig {
|
|
376
|
+
/** `AgentSession.autoRetryEnabled`. */
|
|
377
|
+
autoRetry: boolean;
|
|
378
|
+
/** `AgentSession.model`, as a `provider/id` ref (null if none selected). */
|
|
379
|
+
model: WireModelRef | null;
|
|
380
|
+
}
|
|
381
|
+
export interface ListModelsData {
|
|
382
|
+
type: 'data';
|
|
383
|
+
id: string;
|
|
384
|
+
kind: 'list_models';
|
|
385
|
+
/** Every registered model (`ModelRegistry.getAll()`). */
|
|
386
|
+
models: Model<Api>[];
|
|
387
|
+
/** The currently selected model, or null. */
|
|
388
|
+
current: WireModelRef | null;
|
|
389
|
+
/** `provider/id` of every model that has auth configured (`getAvailable()`). */
|
|
390
|
+
availableIds: string[];
|
|
391
|
+
/** The `--models` scoped cycle set (may be empty). */
|
|
392
|
+
scopedModels: WireScopedModel[];
|
|
393
|
+
/** The enabled-model patterns (`SettingsManager.getEnabledModels()`), or null. */
|
|
394
|
+
enabledModelIds: string[] | null;
|
|
395
|
+
}
|
|
396
|
+
export interface ListSessionsData {
|
|
397
|
+
type: 'data';
|
|
398
|
+
id: string;
|
|
399
|
+
kind: 'list_sessions';
|
|
400
|
+
scope: 'cwd' | 'all';
|
|
401
|
+
sessions: WireSessionInfo[];
|
|
402
|
+
/** The live session's file path, so the picker can mark the current entry. */
|
|
403
|
+
currentSessionFile: string | undefined;
|
|
404
|
+
}
|
|
405
|
+
export interface GetTreeData {
|
|
406
|
+
type: 'data';
|
|
407
|
+
id: string;
|
|
408
|
+
kind: 'get_tree';
|
|
409
|
+
tree: WireSessionTreeNode[];
|
|
410
|
+
currentLeafId: string | null;
|
|
411
|
+
/** Prior user messages for the `/fork` selector. */
|
|
412
|
+
forkPoints: WireForkPoint[];
|
|
413
|
+
}
|
|
414
|
+
export interface GetSettingsData {
|
|
415
|
+
type: 'data';
|
|
416
|
+
id: string;
|
|
417
|
+
kind: 'get_settings';
|
|
418
|
+
settings: WireSettings;
|
|
419
|
+
}
|
|
420
|
+
export interface ListScopedModelsData {
|
|
421
|
+
type: 'data';
|
|
422
|
+
id: string;
|
|
423
|
+
kind: 'list_scoped_models';
|
|
424
|
+
/** Every registered model (`ModelRegistry.getAll()`), to enable/disable. */
|
|
425
|
+
allModels: Model<Api>[];
|
|
426
|
+
enabledModelIds: string[] | null;
|
|
427
|
+
}
|
|
428
|
+
/** The `dequeue` result: the steering + follow-up messages just cleared, for the
|
|
429
|
+
* viewer to restore to the editor. */
|
|
430
|
+
export interface DequeueData {
|
|
431
|
+
type: 'data';
|
|
432
|
+
id: string;
|
|
433
|
+
kind: 'dequeue';
|
|
434
|
+
steering: string[];
|
|
435
|
+
followUp: string[];
|
|
436
|
+
}
|
|
437
|
+
/** All correlated data replies (read-ops + dequeue). Discriminate on `kind`. */
|
|
438
|
+
export type BrokerDataFrame = ListModelsData | ListSessionsData | GetTreeData | GetSettingsData | ListScopedModelsData | DequeueData;
|
|
439
|
+
/** `ctx.ui.setStatus(key, text)` — a keyed footer/status entry; `text===undefined`
|
|
440
|
+
* clears that key. */
|
|
441
|
+
export interface DisplayStatusFrame {
|
|
442
|
+
type: 'display_status';
|
|
443
|
+
key: string;
|
|
444
|
+
text: string | undefined;
|
|
445
|
+
}
|
|
446
|
+
/** `ctx.ui.setWidget(key, lines, {placement})` — persistent lines above/below the
|
|
447
|
+
* editor; `lines===undefined` clears that key. The component-factory overload of
|
|
448
|
+
* setWidget cannot cross the socket and is dropped broker-side (R1 caveat). */
|
|
449
|
+
export interface DisplayWidgetFrame {
|
|
450
|
+
type: 'display_widget';
|
|
451
|
+
key: string;
|
|
452
|
+
lines: string[] | undefined;
|
|
453
|
+
placement: 'aboveEditor' | 'belowEditor';
|
|
454
|
+
}
|
|
455
|
+
/** `ctx.ui.setTitle(title)` — the terminal window/tab title. */
|
|
456
|
+
export interface DisplayTitleFrame {
|
|
457
|
+
type: 'display_title';
|
|
458
|
+
title: string;
|
|
459
|
+
}
|
|
254
460
|
/** A blocking dialog routed to the controller — pi's public RPC request type. */
|
|
255
461
|
export type ExtensionUIRequestFrame = RpcExtensionUIRequest;
|
|
256
462
|
/** Everything the broker can send. Live `AgentSessionEvent`s are relayed
|
|
257
463
|
* verbatim (the broker adds nothing); the broker's own control frames carry
|
|
258
464
|
* non-colliding `type` discriminants. */
|
|
259
|
-
export type BrokerToClient = WelcomeFrame | ControlChangedFrame | ErrorFrame | AckFrame | ExtensionUIRequestFrame | AgentSessionEvent;
|
|
465
|
+
export type BrokerToClient = WelcomeFrame | ControlChangedFrame | ModelChangedFrame | ErrorFrame | AckFrame | BrokerDataFrame | DisplayStatusFrame | DisplayWidgetFrame | DisplayTitleFrame | ExtensionUIRequestFrame | AgentSessionEvent;
|
|
260
466
|
/** Encode one frame as a single newline-terminated JSON line. */
|
|
261
467
|
export declare function encodeFrame(frame: ClientToBroker | BrokerToClient): string;
|
|
262
468
|
/** Byte bounds for a {@link FrameDecoder} (C5). */
|
|
@@ -33,16 +33,4 @@ export interface BrokerEngine {
|
|
|
33
33
|
* through here so the seam stays a single, auditable swap.
|
|
34
34
|
*/
|
|
35
35
|
export declare function loadBrokerEngine(): Promise<BrokerEngine>;
|
|
36
|
-
/**
|
|
37
|
-
* Boot-time tripwire: compare the imported SDK `VERSION` against the `pi` binary
|
|
38
|
-
* crouter forks elsewhere (`pi --version`). On mismatch (or if the binary can't be
|
|
39
|
-
* probed) it logs a LOUD warning to stderr and proceeds — it NEVER throws. The v3
|
|
40
|
-
* session format auto-migrates on load, so minor skew round-trips; a hard fail here
|
|
41
|
-
* would risk a grace-revive crash loop. Phase 5 may harden this to fail-fast once
|
|
42
|
-
* the broker is the only host.
|
|
43
|
-
*
|
|
44
|
-
* @param engineVersion the version actually loaded (defaults to the statically
|
|
45
|
-
* imported `VERSION`; pass `engine.VERSION` from `loadBrokerEngine` to assert the
|
|
46
|
-
* version the broker is really driving).
|
|
47
|
-
*/
|
|
48
36
|
export declare function assertEngineVersion(engineVersion?: string): void;
|
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
// Nothing else in the tree imports this yet; it compiles but stays inert so the
|
|
12
12
|
// lifecycle suite stays green until the broker is wired up.
|
|
13
13
|
import { execFileSync } from 'node:child_process';
|
|
14
|
+
import { existsSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
15
|
+
import { delimiter, join } from 'node:path';
|
|
14
16
|
import { createAgentSessionServices, createAgentSessionFromServices, createAgentSessionRuntime, SessionManager, VERSION, } from '@earendil-works/pi-coding-agent';
|
|
17
|
+
import { crtrHome } from '../canvas/paths.js';
|
|
15
18
|
// Static re-exports — the real SDK surface the broker drives in production.
|
|
16
19
|
export { createAgentSessionServices, createAgentSessionFromServices, createAgentSessionRuntime, SessionManager, VERSION, };
|
|
17
20
|
/**
|
|
@@ -53,15 +56,83 @@ export async function loadBrokerEngine() {
|
|
|
53
56
|
* imported `VERSION`; pass `engine.VERSION` from `loadBrokerEngine` to assert the
|
|
54
57
|
* version the broker is really driving).
|
|
55
58
|
*/
|
|
59
|
+
/** Resolve the `pi` executable on PATH without spawning anything — a plain walk
|
|
60
|
+
* of `$PATH` entries (`statSync` follows symlinks, so an npm/brew bin shim
|
|
61
|
+
* resolves to the real target). Returns the first match, or undefined. */
|
|
62
|
+
function resolvePiBinary() {
|
|
63
|
+
const path = process.env['PATH'];
|
|
64
|
+
if (path === undefined || path === '')
|
|
65
|
+
return undefined;
|
|
66
|
+
for (const dir of path.split(delimiter)) {
|
|
67
|
+
if (dir === '')
|
|
68
|
+
continue;
|
|
69
|
+
const candidate = join(dir, 'pi');
|
|
70
|
+
try {
|
|
71
|
+
if (existsSync(candidate))
|
|
72
|
+
return candidate;
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
/* unreadable PATH entry — skip */
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
const PI_VERSION_CACHE = () => join(crtrHome(), 'pi-version.json');
|
|
81
|
+
/** Cached `pi --version`, keyed on the binary's path+mtime+size so a pi upgrade
|
|
82
|
+
* re-probes but the steady state never spawns. Returns undefined when the
|
|
83
|
+
* binary can't be resolved/stat'd or the cache misses — the caller then spawns
|
|
84
|
+
* once and back-fills via {@link writePiVersionCache}. */
|
|
85
|
+
function readPiVersionCache(binPath, mtimeMs, size) {
|
|
86
|
+
try {
|
|
87
|
+
const c = JSON.parse(readFileSync(PI_VERSION_CACHE(), 'utf8'));
|
|
88
|
+
if (c.path === binPath && c.mtimeMs === mtimeMs && c.size === size && typeof c.version === 'string') {
|
|
89
|
+
return c.version;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
/* missing/corrupt cache — treat as a miss */
|
|
94
|
+
}
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
function writePiVersionCache(entry) {
|
|
98
|
+
try {
|
|
99
|
+
writeFileSync(PI_VERSION_CACHE(), JSON.stringify(entry), 'utf8');
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
/* best-effort: a missing cache just means the next boot re-probes */
|
|
103
|
+
}
|
|
104
|
+
}
|
|
56
105
|
export function assertEngineVersion(engineVersion = VERSION) {
|
|
106
|
+
// Resolve + stat the binary (no spawn). When its path+mtime+size matches the
|
|
107
|
+
// cache, reuse the stored version and skip the ~0.4s `pi --version` boot — the
|
|
108
|
+
// common path on every broker start. A pi upgrade changes the stat and re-probes.
|
|
109
|
+
const binPath = resolvePiBinary();
|
|
110
|
+
let stat;
|
|
111
|
+
if (binPath !== undefined) {
|
|
112
|
+
try {
|
|
113
|
+
const s = statSync(binPath);
|
|
114
|
+
stat = { mtimeMs: s.mtimeMs, size: s.size };
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
stat = undefined;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
57
120
|
let binaryVersion;
|
|
58
|
-
|
|
59
|
-
binaryVersion =
|
|
121
|
+
if (binPath !== undefined && stat !== undefined) {
|
|
122
|
+
binaryVersion = readPiVersionCache(binPath, stat.mtimeMs, stat.size);
|
|
60
123
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
124
|
+
if (binaryVersion === undefined) {
|
|
125
|
+
try {
|
|
126
|
+
binaryVersion = execFileSync('pi', ['--version'], { encoding: 'utf8' }).trim();
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
process.stderr.write(`[broker] WARNING: could not run 'pi --version' to verify engine parity ` +
|
|
130
|
+
`(SDK ${engineVersion}): ${err.message}\n`);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (binPath !== undefined && stat !== undefined) {
|
|
134
|
+
writePiVersionCache({ path: binPath, mtimeMs: stat.mtimeMs, size: stat.size, version: binaryVersion });
|
|
135
|
+
}
|
|
65
136
|
}
|
|
66
137
|
if (binaryVersion !== engineVersion) {
|
|
67
138
|
process.stderr.write(`[broker] WARNING: pi SDK version mismatch — imported SDK is ${engineVersion} but ` +
|
|
@@ -2,7 +2,7 @@ import { type Socket } from 'node:net';
|
|
|
2
2
|
import { type AgentSessionRuntime, type AgentSessionServices, type CreateAgentSessionResult, type ExtensionUIContext } from '@earendil-works/pi-coding-agent';
|
|
3
3
|
import { type BrokerSdkConfig } from './launch.js';
|
|
4
4
|
import { type BrokerEngine } from './broker-sdk.js';
|
|
5
|
-
import { FrameDecoder, type ClientRole, type RpcExtensionUIRequest, type RpcExtensionUIResponse } from './broker-protocol.js';
|
|
5
|
+
import { FrameDecoder, type BrokerSnapshot, type BrokerToClient, type ClientRole, type RpcExtensionUIRequest, type RpcExtensionUIResponse } from './broker-protocol.js';
|
|
6
6
|
interface BrokerClient {
|
|
7
7
|
id: string;
|
|
8
8
|
role: ClientRole;
|
|
@@ -33,6 +33,7 @@ interface PendingDialog {
|
|
|
33
33
|
* bash children. No-op before the session is built or after a clean dispose. */
|
|
34
34
|
export declare function disposeActiveSession(): void;
|
|
35
35
|
export declare function runBroker(nodeId: string): Promise<void>;
|
|
36
|
+
export declare function snapshotMessages(session: CreateAgentSessionResult['session']): BrokerSnapshot['messages'];
|
|
36
37
|
export declare function buildBrokerSession(engine: BrokerEngine, cfg: BrokerSdkConfig): Promise<{
|
|
37
38
|
session: CreateAgentSessionResult['session'];
|
|
38
39
|
services: AgentSessionServices;
|
|
@@ -50,6 +51,9 @@ export interface BrokerDialogDeps {
|
|
|
50
51
|
forward: (client: BrokerClient, request: RpcExtensionUIRequest) => void;
|
|
51
52
|
/** Pending-dialog registry, keyed by request id (answered via extension_ui_response). */
|
|
52
53
|
pending: Map<string, PendingDialog>;
|
|
54
|
+
/** Broadcast a non-blocking display frame (setStatus/setWidget/setTitle) to ALL
|
|
55
|
+
* viewers — the relay path for pi's fire-and-forget extension-UI surface. */
|
|
56
|
+
broadcast: (frame: BrokerToClient) => void;
|
|
53
57
|
}
|
|
54
58
|
export declare function makeBrokerUiContext(deps: BrokerDialogDeps): ExtensionUIContext;
|
|
55
59
|
export {};
|