@bastani/atomic 0.9.9 → 0.9.10-alpha.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/CHANGELOG.md +66 -0
- package/README.md +2 -0
- package/dist/builtin/cursor/CHANGELOG.md +6 -0
- package/dist/builtin/cursor/package.json +3 -3
- package/dist/builtin/intercom/CHANGELOG.md +15 -0
- package/dist/builtin/intercom/README.md +12 -4
- package/dist/builtin/intercom/broker/broker.ts +96 -14
- package/dist/builtin/intercom/broker/client-message-validation.ts +39 -0
- package/dist/builtin/intercom/broker/client.ts +101 -92
- package/dist/builtin/intercom/broker/group-isolation.ts +28 -0
- package/dist/builtin/intercom/broker/send-handler.ts +62 -10
- package/dist/builtin/intercom/broker/send-signature.ts +3 -0
- package/dist/builtin/intercom/broker/supervisor-channel.ts +126 -0
- package/dist/builtin/intercom/closed-workflow-stage-message.ts +66 -0
- package/dist/builtin/intercom/config.ts +10 -0
- package/dist/builtin/intercom/contact-supervisor-tool.ts +14 -10
- package/dist/builtin/intercom/foreground-detach-handoff.ts +12 -2
- package/dist/builtin/intercom/group.ts +46 -0
- package/dist/builtin/intercom/inbound-message-admission.ts +79 -0
- package/dist/builtin/intercom/incoming-message-delivery.ts +49 -0
- package/dist/builtin/intercom/index-heavy.ts +148 -94
- package/dist/builtin/intercom/index.ts +66 -4
- package/dist/builtin/intercom/intercom-test-seams.ts +6 -0
- package/dist/builtin/intercom/intercom-tool.ts +71 -20
- package/dist/builtin/intercom/intercom-utils.ts +15 -2
- package/dist/builtin/intercom/late-stage-message-router.ts +148 -0
- package/dist/builtin/intercom/lifecycle.ts +10 -4
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/intercom/reconnect-backoff.ts +6 -0
- package/dist/builtin/intercom/reply-tracker.ts +8 -0
- package/dist/builtin/intercom/skills/intercom/SKILL.md +2 -0
- package/dist/builtin/intercom/stable-delivery-retry.ts +32 -0
- package/dist/builtin/intercom/subagent-relay.ts +67 -14
- package/dist/builtin/intercom/supervisor-authorization-registry.ts +22 -0
- package/dist/builtin/intercom/terminal-ordering-barrier.ts +144 -25
- package/dist/builtin/intercom/types.ts +18 -5
- package/dist/builtin/intercom/workflow-reply-tracker.ts +19 -0
- package/dist/builtin/intercom/workflow-stage-admission.ts +43 -0
- package/dist/builtin/intercom/workflow-stage-delivery-failure.ts +77 -0
- package/dist/builtin/mcp/CHANGELOG.md +11 -0
- package/dist/builtin/mcp/README.md +6 -2
- package/dist/builtin/mcp/config.ts +8 -8
- package/dist/builtin/mcp/direct-tool-executor.ts +7 -6
- package/dist/builtin/mcp/package.json +3 -3
- package/dist/builtin/mcp/proxy-call.ts +5 -4
- package/dist/builtin/mcp/sampling-handler.ts +7 -2
- package/dist/builtin/mcp/tool-call-timeout.ts +101 -0
- package/dist/builtin/mcp/tool-result-renderer.ts +3 -2
- package/dist/builtin/mcp/types.ts +5 -0
- package/dist/builtin/mcp/ui-server.ts +3 -2
- package/dist/builtin/subagents/CHANGELOG.md +21 -0
- package/dist/builtin/subagents/README.md +6 -3
- package/dist/builtin/subagents/agents/code-simplifier.md +1 -1
- package/dist/builtin/subagents/agents/codebase-analyzer.md +1 -1
- package/dist/builtin/subagents/agents/codebase-locator.md +1 -1
- package/dist/builtin/subagents/agents/codebase-online-researcher.md +1 -1
- package/dist/builtin/subagents/agents/codebase-pattern-finder.md +1 -1
- package/dist/builtin/subagents/agents/codebase-research-analyzer.md +1 -1
- package/dist/builtin/subagents/agents/codebase-research-locator.md +1 -1
- package/dist/builtin/subagents/agents/debugger.md +1 -1
- package/dist/builtin/subagents/agents/worker.md +1 -1
- package/dist/builtin/subagents/package.json +4 -4
- package/dist/builtin/subagents/skills/subagent/SKILL.md +1 -1
- package/dist/builtin/subagents/src/extension/index.ts +37 -61
- package/dist/builtin/subagents/src/extension/notification-content.ts +80 -0
- package/dist/builtin/subagents/src/extension/schemas.ts +9 -0
- package/dist/builtin/subagents/src/extension/tool-description.ts +1 -0
- package/dist/builtin/subagents/src/intercom/supervisor-authorization.ts +23 -0
- package/dist/builtin/subagents/src/runs/background/async-execution-chain.ts +4 -0
- package/dist/builtin/subagents/src/runs/background/async-execution-single.ts +2 -0
- package/dist/builtin/subagents/src/runs/background/async-execution-types.ts +4 -0
- package/dist/builtin/subagents/src/runs/background/async-job-tracker.ts +75 -13
- package/dist/builtin/subagents/src/runs/background/async-status.ts +19 -0
- package/dist/builtin/subagents/src/runs/background/completion-notification.ts +4 -3
- package/dist/builtin/subagents/src/runs/background/notify.ts +76 -15
- package/dist/builtin/subagents/src/runs/background/stale-run-reconciler.ts +1 -1
- package/dist/builtin/subagents/src/runs/background/subagent-runner-dynamic.ts +13 -0
- package/dist/builtin/subagents/src/runs/background/subagent-runner-parallel.ts +1 -0
- package/dist/builtin/subagents/src/runs/background/subagent-runner-sequential.ts +1 -0
- package/dist/builtin/subagents/src/runs/background/subagent-runner-step.ts +2 -1
- package/dist/builtin/subagents/src/runs/background/subagent-runner-types.ts +4 -0
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-runner.ts +13 -0
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-step.ts +19 -2
- package/dist/builtin/subagents/src/runs/foreground/detached-cleanup-barrier.ts +26 -0
- package/dist/builtin/subagents/src/runs/foreground/execution-attempt.ts +19 -30
- package/dist/builtin/subagents/src/runs/foreground/execution-intercom-detach.ts +47 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-async.ts +60 -2
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts +21 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel.ts +21 -2
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-resume.ts +6 -1
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +2 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-types.ts +2 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +1 -1
- package/dist/builtin/subagents/src/runs/shared/intercom-group.ts +50 -0
- package/dist/builtin/subagents/src/runs/shared/pi-args.ts +16 -0
- package/dist/builtin/subagents/src/runs/shared/worktree-post-create.ts +75 -0
- package/dist/builtin/subagents/src/runs/shared/worktree-root.ts +51 -0
- package/dist/builtin/subagents/src/runs/shared/worktree.ts +69 -77
- package/dist/builtin/subagents/src/shared/types-config.ts +6 -0
- package/dist/builtin/subagents/src/slash/slash-commands.ts +3 -2
- package/dist/builtin/subagents/src/tui/render-result-compact.ts +5 -3
- package/dist/builtin/subagents/src/tui/render-result.ts +5 -3
- package/dist/builtin/subagents/src/tui/render-widget-graph.ts +7 -4
- package/dist/builtin/web-access/CHANGELOG.md +11 -0
- package/dist/builtin/web-access/extract-frames.ts +14 -13
- package/dist/builtin/web-access/extract.ts +2 -2
- package/dist/builtin/web-access/gemini-api.ts +0 -3
- package/dist/builtin/web-access/gemini-web-config.ts +1 -3
- package/dist/builtin/web-access/gemini-web.ts +1 -0
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/web-access/perplexity.ts +0 -3
- package/dist/builtin/web-access/result-renderers.ts +7 -5
- package/dist/builtin/web-access/subprocess.ts +100 -0
- package/dist/builtin/web-access/summary-review.ts +14 -3
- package/dist/builtin/web-access/video-extract.ts +12 -17
- package/dist/builtin/web-access/web-search-browser.ts +18 -10
- package/dist/builtin/web-access/web-search-summary.ts +9 -2
- package/dist/builtin/web-access/youtube-extract.ts +22 -25
- package/dist/builtin/workflows/CHANGELOG.md +77 -0
- package/dist/builtin/workflows/README.md +76 -38
- package/dist/builtin/workflows/ambient.d.ts +30 -0
- package/dist/builtin/workflows/builtin/adversarial-verification-prompts.ts +15 -0
- package/dist/builtin/workflows/builtin/adversarial-verification-runner.ts +93 -0
- package/dist/builtin/workflows/builtin/adversarial-verification.d.ts +11 -0
- package/dist/builtin/workflows/builtin/adversarial-verification.ts +24 -0
- package/dist/builtin/workflows/builtin/classify-and-act-prompts.ts +11 -0
- package/dist/builtin/workflows/builtin/classify-and-act-runner.ts +110 -0
- package/dist/builtin/workflows/builtin/classify-and-act.d.ts +24 -0
- package/dist/builtin/workflows/builtin/classify-and-act.ts +35 -0
- package/dist/builtin/workflows/builtin/deep-research-codebase-utils.ts +8 -2
- package/dist/builtin/workflows/builtin/fan-out-and-synthesize-prompts.ts +11 -0
- package/dist/builtin/workflows/builtin/fan-out-and-synthesize-runner.ts +96 -0
- package/dist/builtin/workflows/builtin/fan-out-and-synthesize.d.ts +23 -0
- package/dist/builtin/workflows/builtin/fan-out-and-synthesize.ts +32 -0
- package/dist/builtin/workflows/builtin/generate-and-filter-prompts.ts +15 -0
- package/dist/builtin/workflows/builtin/generate-and-filter-runner.ts +75 -0
- package/dist/builtin/workflows/builtin/generate-and-filter.d.ts +11 -0
- package/dist/builtin/workflows/builtin/generate-and-filter.ts +26 -0
- package/dist/builtin/workflows/builtin/goal-models.ts +72 -0
- package/dist/builtin/workflows/builtin/goal-runner.ts +2 -64
- package/dist/builtin/workflows/builtin/index.d.ts +44 -0
- package/dist/builtin/workflows/builtin/index.ts +6 -0
- package/dist/builtin/workflows/builtin/loop-until-done-prompts.ts +79 -0
- package/dist/builtin/workflows/builtin/loop-until-done-runner.ts +189 -0
- package/dist/builtin/workflows/builtin/loop-until-done.d.ts +34 -0
- package/dist/builtin/workflows/builtin/loop-until-done.ts +31 -0
- package/dist/builtin/workflows/builtin/open-claude-design-runner.ts +6 -1
- package/dist/builtin/workflows/builtin/pattern-artifact-root.ts +28 -0
- package/dist/builtin/workflows/builtin/ralph-models.ts +26 -5
- package/dist/builtin/workflows/builtin/ralph-runner.ts +1 -0
- package/dist/builtin/workflows/builtin/tournament-prompts.ts +79 -0
- package/dist/builtin/workflows/builtin/tournament-runner.ts +188 -0
- package/dist/builtin/workflows/builtin/tournament.d.ts +33 -0
- package/dist/builtin/workflows/builtin/tournament.ts +34 -0
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/src/authoring.d.ts +2 -6
- package/dist/builtin/workflows/src/durable/backend.ts +163 -120
- package/dist/builtin/workflows/src/durable/completed-catalog.ts +37 -64
- package/dist/builtin/workflows/src/durable/completed-inspection.ts +4 -72
- package/dist/builtin/workflows/src/durable/dbos-backend.ts +242 -195
- package/dist/builtin/workflows/src/durable/dbos-embedded-postgres.ts +207 -0
- package/dist/builtin/workflows/src/durable/dbos-envelope.ts +42 -42
- package/dist/builtin/workflows/src/durable/dbos-lifecycle.ts +155 -0
- package/dist/builtin/workflows/src/durable/dbos-local-postgres.ts +126 -0
- package/dist/builtin/workflows/src/durable/dbos-metadata.ts +105 -58
- package/dist/builtin/workflows/src/durable/dbos-prompt-reservations.ts +320 -0
- package/dist/builtin/workflows/src/durable/dbos-sdk-handle.ts +161 -0
- package/dist/builtin/workflows/src/durable/dbos-status-transition.ts +62 -0
- package/dist/builtin/workflows/src/durable/dbos-tombstone.ts +2 -2
- package/dist/builtin/workflows/src/durable/durable-hash.ts +20 -0
- package/dist/builtin/workflows/src/durable/factory.ts +23 -83
- package/dist/builtin/workflows/src/durable/format-version.ts +4 -10
- package/dist/builtin/workflows/src/durable/index.ts +16 -20
- package/dist/builtin/workflows/src/durable/local-command.ts +63 -0
- package/dist/builtin/workflows/src/durable/prompt-reservation-state.ts +177 -0
- package/dist/builtin/workflows/src/durable/prompt-reservations.ts +36 -0
- package/dist/builtin/workflows/src/durable/resume-catalog.ts +2 -200
- package/dist/builtin/workflows/src/durable/resume-eligibility.ts +42 -2
- package/dist/builtin/workflows/src/durable/resume-runtime.ts +121 -118
- package/dist/builtin/workflows/src/durable/retention-policy.ts +42 -0
- package/dist/builtin/workflows/src/durable/run-timing.ts +98 -0
- package/dist/builtin/workflows/src/durable/scoped-backend.ts +62 -14
- package/dist/builtin/workflows/src/durable/stage-primitive.ts +15 -2
- package/dist/builtin/workflows/src/durable/tool-primitive.ts +11 -7
- package/dist/builtin/workflows/src/durable/types.ts +25 -18
- package/dist/builtin/workflows/src/durable/ui-primitive.ts +117 -29
- package/dist/builtin/workflows/src/durable/workflow-status-transition.ts +30 -0
- package/dist/builtin/workflows/src/engine/primitives/parallel.ts +20 -5
- package/dist/builtin/workflows/src/engine/primitives/task.ts +3 -2
- package/dist/builtin/workflows/src/engine/primitives/ui.ts +6 -3
- package/dist/builtin/workflows/src/engine/run-durable-finalize.ts +14 -22
- package/dist/builtin/workflows/src/engine/run-durable-stage-session.ts +14 -14
- package/dist/builtin/workflows/src/engine/run.ts +35 -37
- package/dist/builtin/workflows/src/engine/runtime.ts +3 -0
- package/dist/builtin/workflows/src/engine/workflow-activity.ts +9 -0
- package/dist/builtin/workflows/src/extension/completed-stage-intercom-ask.ts +155 -0
- package/dist/builtin/workflows/src/extension/config-file-loader.ts +13 -0
- package/dist/builtin/workflows/src/extension/config-loader.ts +20 -0
- package/dist/builtin/workflows/src/extension/dispatcher.ts +56 -17
- package/dist/builtin/workflows/src/extension/extension-factory.ts +13 -10
- package/dist/builtin/workflows/src/extension/extension-lifecycle.ts +37 -59
- package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +16 -18
- package/dist/builtin/workflows/src/extension/lifecycle-notification-delivery.ts +83 -0
- package/dist/builtin/workflows/src/extension/lifecycle-notifications.ts +80 -41
- package/dist/builtin/workflows/src/extension/postmortem-deps.ts +73 -0
- package/dist/builtin/workflows/src/extension/public-types.ts +11 -51
- package/dist/builtin/workflows/src/extension/render-call.ts +3 -9
- package/dist/builtin/workflows/src/extension/render-result.ts +22 -7
- package/dist/builtin/workflows/src/extension/runtime-active-block-claim.ts +78 -0
- package/dist/builtin/workflows/src/extension/runtime-durable-resume.ts +50 -29
- package/dist/builtin/workflows/src/extension/runtime.ts +70 -219
- package/dist/builtin/workflows/src/extension/ui-surface.ts +107 -3
- package/dist/builtin/workflows/src/extension/wiring.ts +76 -7
- package/dist/builtin/workflows/src/extension/workflow-command-completions.ts +10 -5
- package/dist/builtin/workflows/src/extension/workflow-command-registration.ts +27 -5
- package/dist/builtin/workflows/src/extension/workflow-durable-resume-command.ts +49 -19
- package/dist/builtin/workflows/src/extension/workflow-prompts.ts +8 -8
- package/dist/builtin/workflows/src/extension/workflow-resume-picker-rows.ts +81 -0
- package/dist/builtin/workflows/src/extension/workflow-resume-shadow.ts +55 -0
- package/dist/builtin/workflows/src/extension/workflow-run-control-command.ts +193 -145
- package/dist/builtin/workflows/src/extension/workflow-schema.ts +9 -133
- package/dist/builtin/workflows/src/extension/workflow-status-summary.ts +189 -0
- package/dist/builtin/workflows/src/extension/workflow-targets.ts +1 -1
- package/dist/builtin/workflows/src/extension/workflow-tool-content.ts +78 -3
- package/dist/builtin/workflows/src/extension/workflow-tool-control.ts +185 -89
- package/dist/builtin/workflows/src/extension/workflow-tool-send.ts +92 -11
- package/dist/builtin/workflows/src/extension/workflow-tool.ts +18 -24
- package/dist/builtin/workflows/src/runs/background/durable-resume-transition.ts +63 -0
- package/dist/builtin/workflows/src/runs/background/quit.ts +139 -29
- package/dist/builtin/workflows/src/runs/background/resume-acknowledgements.ts +97 -0
- package/dist/builtin/workflows/src/runs/background/run-inspect.ts +111 -0
- package/dist/builtin/workflows/src/runs/background/runner.ts +46 -17
- package/dist/builtin/workflows/src/runs/background/startup-admission.ts +77 -0
- package/dist/builtin/workflows/src/runs/background/status.ts +133 -224
- package/dist/builtin/workflows/src/runs/background/workflow-lifecycle-aggregate.ts +44 -0
- package/dist/builtin/workflows/src/runs/foreground/executor-direct-helpers.ts +57 -256
- package/dist/builtin/workflows/src/runs/foreground/executor-hil.ts +7 -4
- package/dist/builtin/workflows/src/runs/foreground/executor-lifecycle.ts +12 -1
- package/dist/builtin/workflows/src/runs/foreground/executor-prompt-nodes.ts +39 -0
- package/dist/builtin/workflows/src/runs/foreground/executor-queued-user-message.ts +75 -0
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-call.ts +44 -12
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-control.ts +63 -12
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +30 -4
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-replay.ts +3 -0
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-types.ts +4 -1
- package/dist/builtin/workflows/src/runs/foreground/executor-task-prompts.ts +0 -67
- package/dist/builtin/workflows/src/runs/foreground/executor-types.ts +6 -0
- package/dist/builtin/workflows/src/runs/foreground/executor.ts +0 -1
- package/dist/builtin/workflows/src/runs/foreground/postmortem-stage-chat.ts +169 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-control-registry.ts +38 -1
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-candidate.ts +21 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-context.ts +21 -3
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +85 -84
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-message-admission.ts +195 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-options.ts +12 -5
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-replacement.ts +42 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-send-user-message.ts +100 -8
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-session-options.ts +51 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-session.ts +19 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-types.ts +28 -2
- package/dist/builtin/workflows/src/runs/shared/prompt-callsite.ts +4 -6
- package/dist/builtin/workflows/src/runs/shared/worktree-git-runner.ts +89 -0
- package/dist/builtin/workflows/src/runs/shared/worktree-git.ts +29 -133
- package/dist/builtin/workflows/src/runs/shared/worktree-post-create.ts +130 -0
- package/dist/builtin/workflows/src/runs/shared/worktree-root.ts +84 -0
- package/dist/builtin/workflows/src/runs/shared/worktree-setup.ts +77 -63
- package/dist/builtin/workflows/src/runs/shared/worktree-types.ts +4 -0
- package/dist/builtin/workflows/src/sdk-surface.ts +1 -1
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +29 -22
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.ts +26 -24
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +5 -0
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.ts +5 -0
- package/dist/builtin/workflows/src/shared/intercom-group.ts +51 -0
- package/dist/builtin/workflows/src/shared/persistence-restore-helpers.ts +6 -0
- package/dist/builtin/workflows/src/shared/persistence-restore.ts +4 -0
- package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +3 -0
- package/dist/builtin/workflows/src/shared/prompt-callsite-context.ts +13 -0
- package/dist/builtin/workflows/src/shared/returned-run-status.ts +2 -1
- package/dist/builtin/workflows/src/shared/session-transcript.ts +74 -0
- package/dist/builtin/workflows/src/shared/store-stage-methods.ts +1 -0
- package/dist/builtin/workflows/src/shared/store-types.ts +8 -0
- package/dist/builtin/workflows/src/shared/timing.ts +4 -1
- package/dist/builtin/workflows/src/shared/types.ts +2 -6
- package/dist/builtin/workflows/src/tui/chat-surface-message.ts +2 -42
- package/dist/builtin/workflows/src/tui/dispatch-confirm.ts +2 -2
- package/dist/builtin/workflows/src/tui/graph-view-constants.ts +7 -3
- package/dist/builtin/workflows/src/tui/graph-view-input.ts +29 -67
- package/dist/builtin/workflows/src/tui/graph-view-render-helpers.ts +15 -10
- package/dist/builtin/workflows/src/tui/graph-view-state.ts +0 -2
- package/dist/builtin/workflows/src/tui/graph-view-types.ts +3 -9
- package/dist/builtin/workflows/src/tui/host-input-form.ts +62 -0
- package/dist/builtin/workflows/src/tui/mouse-input.ts +63 -0
- package/dist/builtin/workflows/src/tui/node-card.ts +1 -0
- package/dist/builtin/workflows/src/tui/overlay-adapter.ts +67 -42
- package/dist/builtin/workflows/src/tui/overlay-terminal-modes.ts +49 -0
- package/dist/builtin/workflows/src/tui/session-overlays.ts +3 -104
- package/dist/builtin/workflows/src/tui/session-picker.ts +3 -12
- package/dist/builtin/workflows/src/tui/stage-chat-composer-drafts.ts +19 -0
- package/dist/builtin/workflows/src/tui/stage-chat-view-archive-history.ts +30 -10
- package/dist/builtin/workflows/src/tui/stage-chat-view-footer-status.ts +19 -9
- package/dist/builtin/workflows/src/tui/stage-chat-view-input.ts +25 -38
- package/dist/builtin/workflows/src/tui/stage-chat-view-render-helpers.ts +1 -1
- package/dist/builtin/workflows/src/tui/stage-chat-view-state.ts +7 -6
- package/dist/builtin/workflows/src/tui/stage-chat-view-types.ts +7 -1
- package/dist/builtin/workflows/src/tui/stage-chat-view.ts +3 -1
- package/dist/builtin/workflows/src/tui/store-widget-installer.ts +19 -20
- package/dist/builtin/workflows/src/tui/switcher.ts +4 -4
- package/dist/builtin/workflows/src/tui/widget.ts +46 -33
- package/dist/builtin/workflows/src/tui/workflow-attach-pane-handle.ts +26 -0
- package/dist/builtin/workflows/src/tui/workflow-attach-pane-types.ts +14 -2
- package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +26 -27
- package/dist/builtin/workflows/src/tui/workflow-resume-selector.ts +208 -69
- package/dist/bun/cli.js +3 -0
- package/dist/bun/cli.js.map +1 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +3 -0
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-auto-compaction.js +19 -2
- package/dist/core/agent-session-auto-compaction.js.map +1 -1
- package/dist/core/agent-session-compaction.js +2 -2
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +5 -3
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-export.js +1 -1
- package/dist/core/agent-session-export.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts +2 -4
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +9 -2
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-message-queue.d.ts +6 -0
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js +107 -36
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +18 -7
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-models.d.ts +3 -1
- package/dist/core/agent-session-models.d.ts.map +1 -1
- package/dist/core/agent-session-models.js +1 -1
- package/dist/core/agent-session-models.js.map +1 -1
- package/dist/core/agent-session-post-tool-compaction.d.ts +16 -0
- package/dist/core/agent-session-post-tool-compaction.d.ts.map +1 -0
- package/dist/core/agent-session-post-tool-compaction.js +113 -0
- package/dist/core/agent-session-post-tool-compaction.js.map +1 -0
- package/dist/core/agent-session-prompt.d.ts +12 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +22 -5
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +3 -0
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
- package/dist/core/agent-session-tool-hooks.js +21 -0
- package/dist/core/agent-session-tool-hooks.js.map +1 -1
- package/dist/core/agent-session-tree.d.ts.map +1 -1
- package/dist/core/agent-session-tree.js +2 -1
- package/dist/core/agent-session-tree.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +7 -0
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/agent-session.d.ts +6 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +18 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/async/job-manager.d.ts +1 -0
- package/dist/core/async/job-manager.d.ts.map +1 -1
- package/dist/core/async/job-manager.js +29 -5
- package/dist/core/async/job-manager.js.map +1 -1
- package/dist/core/async/session-manager.d.ts +2 -4
- package/dist/core/async/session-manager.d.ts.map +1 -1
- package/dist/core/async/session-manager.js +5 -32
- package/dist/core/async/session-manager.js.map +1 -1
- package/dist/core/atomic-guide-command.d.ts.map +1 -1
- package/dist/core/atomic-guide-command.js +2 -0
- package/dist/core/atomic-guide-command.js.map +1 -1
- package/dist/core/auth-storage.d.ts +20 -10
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +151 -92
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/callback-activity.d.ts +27 -0
- package/dist/core/callback-activity.d.ts.map +1 -0
- package/dist/core/callback-activity.js +44 -0
- package/dist/core/callback-activity.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +4 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +4 -3
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction-boundary.d.ts +1 -1
- package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
- package/dist/core/compaction/compaction-boundary.js +10 -23
- package/dist/core/compaction/compaction-boundary.js.map +1 -1
- package/dist/core/compaction/compaction-runner.d.ts +4 -1
- package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
- package/dist/core/compaction/compaction-runner.js +1 -1
- package/dist/core/compaction/compaction-runner.js.map +1 -1
- package/dist/core/compaction/compaction-types.d.ts +3 -2
- package/dist/core/compaction/compaction-types.d.ts.map +1 -1
- package/dist/core/compaction/compaction-types.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +6 -6
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +12 -9
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/index.d.ts +1 -0
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/index.js +1 -0
- package/dist/core/compaction/index.js.map +1 -1
- package/dist/core/compaction/range-planner-diagnostics.d.ts +101 -0
- package/dist/core/compaction/range-planner-diagnostics.d.ts.map +1 -0
- package/dist/core/compaction/range-planner-diagnostics.js +116 -0
- package/dist/core/compaction/range-planner-diagnostics.js.map +1 -0
- package/dist/core/compaction/range-planner.d.ts +13 -3
- package/dist/core/compaction/range-planner.d.ts.map +1 -1
- package/dist/core/compaction/range-planner.js +117 -68
- package/dist/core/compaction/range-planner.js.map +1 -1
- package/dist/core/compaction/truncated-range-recovery.d.ts +47 -0
- package/dist/core/compaction/truncated-range-recovery.d.ts.map +1 -0
- package/dist/core/compaction/truncated-range-recovery.js +112 -0
- package/dist/core/compaction/truncated-range-recovery.js.map +1 -0
- package/dist/core/extensions/api-types.d.ts +2 -2
- package/dist/core/extensions/api-types.d.ts.map +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/context-types.d.ts +23 -1
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader-api.js +2 -2
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/loader-core.d.ts.map +1 -1
- package/dist/core/extensions/loader-core.js +8 -1
- package/dist/core/extensions/loader-core.js.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.js +9 -6
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/extensions/message-types.d.ts +17 -0
- package/dist/core/extensions/message-types.d.ts.map +1 -1
- package/dist/core/extensions/message-types.js.map +1 -1
- package/dist/core/extensions/provider-types.d.ts +3 -0
- package/dist/core/extensions/provider-types.d.ts.map +1 -1
- package/dist/core/extensions/provider-types.js.map +1 -1
- package/dist/core/extensions/runner-events.d.ts.map +1 -1
- package/dist/core/extensions/runner-events.js +11 -10
- package/dist/core/extensions/runner-events.js.map +1 -1
- package/dist/core/extensions/runtime-types.d.ts +2 -2
- package/dist/core/extensions/runtime-types.d.ts.map +1 -1
- package/dist/core/extensions/runtime-types.js.map +1 -1
- package/dist/core/extensions/ui-types.d.ts +78 -0
- package/dist/core/extensions/ui-types.d.ts.map +1 -1
- package/dist/core/extensions/ui-types.js.map +1 -1
- package/dist/core/model-registry-auth.d.ts +2 -1
- package/dist/core/model-registry-auth.d.ts.map +1 -1
- package/dist/core/model-registry-auth.js +25 -6
- package/dist/core/model-registry-auth.js.map +1 -1
- package/dist/core/model-registry-builtins.d.ts +3 -2
- package/dist/core/model-registry-builtins.d.ts.map +1 -1
- package/dist/core/model-registry-builtins.js +12 -6
- package/dist/core/model-registry-builtins.js.map +1 -1
- package/dist/core/model-registry-dynamic.d.ts +1 -0
- package/dist/core/model-registry-dynamic.d.ts.map +1 -1
- package/dist/core/model-registry-dynamic.js +53 -13
- package/dist/core/model-registry-dynamic.js.map +1 -1
- package/dist/core/model-registry-loader.d.ts +2 -1
- package/dist/core/model-registry-loader.d.ts.map +1 -1
- package/dist/core/model-registry-loader.js +2 -2
- package/dist/core/model-registry-loader.js.map +1 -1
- package/dist/core/model-registry-types.d.ts +10 -3
- package/dist/core/model-registry-types.d.ts.map +1 -1
- package/dist/core/model-registry-types.js.map +1 -1
- package/dist/core/model-registry.d.ts +15 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +214 -30
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/models-store.d.ts +25 -0
- package/dist/core/models-store.d.ts.map +1 -0
- package/dist/core/models-store.js +73 -0
- package/dist/core/models-store.js.map +1 -0
- package/dist/core/oauth-compat.d.ts +17 -0
- package/dist/core/oauth-compat.d.ts.map +1 -0
- package/dist/core/oauth-compat.js +2 -0
- package/dist/core/oauth-compat.js.map +1 -0
- package/dist/core/oauth-provider-bridge.d.ts +40 -0
- package/dist/core/oauth-provider-bridge.d.ts.map +1 -0
- package/dist/core/oauth-provider-bridge.js +169 -0
- package/dist/core/oauth-provider-bridge.js.map +1 -0
- package/dist/core/output-guard.d.ts +2 -0
- package/dist/core/output-guard.d.ts.map +1 -1
- package/dist/core/output-guard.js +14 -0
- package/dist/core/output-guard.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +5 -0
- package/dist/core/remote-catalog-provider.d.ts.map +1 -0
- package/dist/core/remote-catalog-provider.js +138 -0
- package/dist/core/remote-catalog-provider.js.map +1 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +8 -3
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager-core.d.ts +1 -1
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +1 -1
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-entries.d.ts +1 -1
- package/dist/core/session-manager-entries.d.ts.map +1 -1
- package/dist/core/session-manager-entries.js.map +1 -1
- package/dist/core/session-manager-history.d.ts +2 -2
- package/dist/core/session-manager-history.js +2 -2
- package/dist/core/session-manager-history.js.map +1 -1
- package/dist/core/session-manager-list.d.ts.map +1 -1
- package/dist/core/session-manager-list.js +65 -23
- package/dist/core/session-manager-list.js.map +1 -1
- package/dist/core/session-manager-types.d.ts +3 -2
- package/dist/core/session-manager-types.d.ts.map +1 -1
- package/dist/core/session-manager-types.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +9 -5
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +2 -3
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/find.js +2 -2
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.js +2 -2
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.js +2 -2
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +4 -3
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/todos-render.d.ts.map +1 -1
- package/dist/core/tools/todos-render.js +3 -2
- package/dist/core/tools/todos-render.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +3 -2
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/write.js +2 -2
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/workflow-stage-admission.d.ts +29 -0
- package/dist/core/workflow-stage-admission.d.ts.map +1 -0
- package/dist/core/workflow-stage-admission.js +81 -0
- package/dist/core/workflow-stage-admission.js.map +1 -0
- package/dist/index-extensions.d.ts +1 -1
- package/dist/index-extensions.d.ts.map +1 -1
- package/dist/index-extensions.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/main-types.d.ts +13 -0
- package/dist/main-types.d.ts.map +1 -0
- package/dist/main-types.js +2 -0
- package/dist/main-types.js.map +1 -0
- package/dist/main.d.ts +2 -5
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +25 -17
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +17 -12
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/atomic-banner.d.ts +7 -0
- package/dist/modes/interactive/components/atomic-banner.d.ts.map +1 -1
- package/dist/modes/interactive/components/atomic-banner.js +20 -0
- package/dist/modes/interactive/components/atomic-banner.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +5 -3
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +3 -4
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.d.ts +4 -0
- package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.js +4 -0
- package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.js +79 -8
- package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.js +4 -2
- package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts +1 -0
- package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.js +4 -1
- package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.js +3 -4
- package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
- package/dist/modes/interactive/components/host-input-form-mount.d.ts +14 -0
- package/dist/modes/interactive/components/host-input-form-mount.d.ts.map +1 -0
- package/dist/modes/interactive/components/host-input-form-mount.js +79 -0
- package/dist/modes/interactive/components/host-input-form-mount.js.map +1 -0
- package/dist/modes/interactive/components/host-input-form.d.ts +52 -0
- package/dist/modes/interactive/components/host-input-form.d.ts.map +1 -0
- package/dist/modes/interactive/components/host-input-form.js +278 -0
- package/dist/modes/interactive/components/host-input-form.js.map +1 -0
- package/dist/modes/interactive/components/host-session-picker.d.ts +46 -0
- package/dist/modes/interactive/components/host-session-picker.d.ts.map +1 -0
- package/dist/modes/interactive/components/host-session-picker.js +183 -0
- package/dist/modes/interactive/components/host-session-picker.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +1 -1
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +1 -1
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +2 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +12 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +3 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +8 -2
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +7 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +57 -10
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +15 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +35 -3
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +3 -2
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +9 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.js +24 -10
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.js +7 -1
- package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.js +3 -3
- package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-autocomplete.js +49 -0
- package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
- package/dist/modes/interactive/interactive-bash-compact.js +2 -0
- package/dist/modes/interactive/interactive-bash-compact.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-context.js +14 -0
- package/dist/modes/interactive/interactive-extension-context.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-global-clear.d.ts +13 -0
- package/dist/modes/interactive/interactive-global-clear.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-global-clear.js +11 -0
- package/dist/modes/interactive/interactive-global-clear.js.map +1 -0
- package/dist/modes/interactive/interactive-input-handling.js +17 -10
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +6 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +25 -2
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts +4 -3
- package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js +2 -2
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.d.ts +4 -1
- package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.js +14 -1
- package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +3 -2
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-types.d.ts +3 -0
- package/dist/modes/interactive/interactive-mode-types.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-types.js.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.js +7 -4
- package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-queueing.js +2 -2
- package/dist/modes/interactive/interactive-queueing.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +25 -4
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-session-routing.js +3 -0
- package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +5 -2
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +22 -9
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-terminal-title.d.ts +6 -0
- package/dist/modes/interactive/interactive-terminal-title.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-terminal-title.js +7 -0
- package/dist/modes/interactive/interactive-terminal-title.js.map +1 -0
- package/dist/modes/interactive-engine/activity-watchdog.d.ts +45 -0
- package/dist/modes/interactive-engine/activity-watchdog.d.ts.map +1 -0
- package/dist/modes/interactive-engine/activity-watchdog.js +74 -0
- package/dist/modes/interactive-engine/activity-watchdog.js.map +1 -0
- package/dist/modes/interactive-engine/create-isolated-runtime.d.ts +14 -0
- package/dist/modes/interactive-engine/create-isolated-runtime.d.ts.map +1 -0
- package/dist/modes/interactive-engine/create-isolated-runtime.js +56 -0
- package/dist/modes/interactive-engine/create-isolated-runtime.js.map +1 -0
- package/dist/modes/interactive-engine/engine-args.d.ts +10 -0
- package/dist/modes/interactive-engine/engine-args.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-args.js +55 -0
- package/dist/modes/interactive-engine/engine-args.js.map +1 -0
- package/dist/modes/interactive-engine/engine-child-liveness.d.ts +7 -0
- package/dist/modes/interactive-engine/engine-child-liveness.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-child-liveness.js +50 -0
- package/dist/modes/interactive-engine/engine-child-liveness.js.map +1 -0
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts +47 -0
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-custom-ui.js +276 -0
- package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -0
- package/dist/modes/interactive-engine/engine-input-form.d.ts +13 -0
- package/dist/modes/interactive-engine/engine-input-form.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-input-form.js +49 -0
- package/dist/modes/interactive-engine/engine-input-form.js.map +1 -0
- package/dist/modes/interactive-engine/engine-monitor.d.ts +18 -0
- package/dist/modes/interactive-engine/engine-monitor.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-monitor.js +63 -0
- package/dist/modes/interactive-engine/engine-monitor.js.map +1 -0
- package/dist/modes/interactive-engine/engine-render-service.d.ts +17 -0
- package/dist/modes/interactive-engine/engine-render-service.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-render-service.js +150 -0
- package/dist/modes/interactive-engine/engine-render-service.js.map +1 -0
- package/dist/modes/interactive-engine/engine-session-picker.d.ts +22 -0
- package/dist/modes/interactive-engine/engine-session-picker.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-session-picker.js +106 -0
- package/dist/modes/interactive-engine/engine-session-picker.js.map +1 -0
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +23 -0
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -0
- package/dist/modes/interactive-engine/extension-ui-bridge.js +126 -0
- package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -0
- package/dist/modes/interactive-engine/input-form-host.d.ts +15 -0
- package/dist/modes/interactive-engine/input-form-host.d.ts.map +1 -0
- package/dist/modes/interactive-engine/input-form-host.js +44 -0
- package/dist/modes/interactive-engine/input-form-host.js.map +1 -0
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +75 -0
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -0
- package/dist/modes/interactive-engine/isolated-runtime.js +448 -0
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -0
- package/dist/modes/interactive-engine/protocol.d.ts +184 -0
- package/dist/modes/interactive-engine/protocol.d.ts.map +1 -0
- package/dist/modes/interactive-engine/protocol.js +254 -0
- package/dist/modes/interactive-engine/protocol.js.map +1 -0
- package/dist/modes/interactive-engine/remote-command-catalog.d.ts +33 -0
- package/dist/modes/interactive-engine/remote-command-catalog.d.ts.map +1 -0
- package/dist/modes/interactive-engine/remote-command-catalog.js +51 -0
- package/dist/modes/interactive-engine/remote-command-catalog.js.map +1 -0
- package/dist/modes/interactive-engine/remote-component.d.ts +16 -0
- package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -0
- package/dist/modes/interactive-engine/remote-component.js +209 -0
- package/dist/modes/interactive-engine/remote-component.js.map +1 -0
- package/dist/modes/interactive-engine/remote-frame-clamp.d.ts +25 -0
- package/dist/modes/interactive-engine/remote-frame-clamp.d.ts.map +1 -0
- package/dist/modes/interactive-engine/remote-frame-clamp.js +43 -0
- package/dist/modes/interactive-engine/remote-frame-clamp.js.map +1 -0
- package/dist/modes/interactive-engine/remote-renderer.d.ts +59 -0
- package/dist/modes/interactive-engine/remote-renderer.d.ts.map +1 -0
- package/dist/modes/interactive-engine/remote-renderer.js +123 -0
- package/dist/modes/interactive-engine/remote-renderer.js.map +1 -0
- package/dist/modes/interactive-engine/session-picker-host.d.ts +25 -0
- package/dist/modes/interactive-engine/session-picker-host.d.ts.map +1 -0
- package/dist/modes/interactive-engine/session-picker-host.js +75 -0
- package/dist/modes/interactive-engine/session-picker-host.js.map +1 -0
- package/dist/modes/interactive-engine/terminal-mode-controller.d.ts +43 -0
- package/dist/modes/interactive-engine/terminal-mode-controller.d.ts.map +1 -0
- package/dist/modes/interactive-engine/terminal-mode-controller.js +109 -0
- package/dist/modes/interactive-engine/terminal-mode-controller.js.map +1 -0
- package/dist/modes/rpc/bounded-writer.d.ts +27 -0
- package/dist/modes/rpc/bounded-writer.d.ts.map +1 -0
- package/dist/modes/rpc/bounded-writer.js +103 -0
- package/dist/modes/rpc/bounded-writer.js.map +1 -0
- package/dist/modes/rpc/jsonl.d.ts +15 -12
- package/dist/modes/rpc/jsonl.d.ts.map +1 -1
- package/dist/modes/rpc/jsonl.js +102 -28
- package/dist/modes/rpc/jsonl.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +83 -0
- package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client-api.js +64 -0
- package/dist/modes/rpc/rpc-client-api.js.map +1 -0
- package/dist/modes/rpc/rpc-client-process.d.ts +19 -0
- package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client-process.js +79 -0
- package/dist/modes/rpc/rpc-client-process.js.map +1 -0
- package/dist/modes/rpc/rpc-client-waits.d.ts +8 -0
- package/dist/modes/rpc/rpc-client-waits.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client-waits.js +33 -0
- package/dist/modes/rpc/rpc-client-waits.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +48 -124
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +295 -249
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts +5 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +79 -3
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-event-buffer.d.ts +11 -0
- package/dist/modes/rpc/rpc-event-buffer.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-event-buffer.js +30 -0
- package/dist/modes/rpc/rpc-event-buffer.js.map +1 -0
- package/dist/modes/rpc/rpc-extension-ui.d.ts +7 -1
- package/dist/modes/rpc/rpc-extension-ui.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-extension-ui.js +54 -32
- package/dist/modes/rpc/rpc-extension-ui.js.map +1 -1
- package/dist/modes/rpc/rpc-input-scheduler.d.ts +16 -0
- package/dist/modes/rpc/rpc-input-scheduler.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-input-scheduler.js +69 -0
- package/dist/modes/rpc/rpc-input-scheduler.js.map +1 -0
- package/dist/modes/rpc/rpc-input.d.ts +2 -1
- package/dist/modes/rpc/rpc-input.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-input.js +4 -9
- package/dist/modes/rpc/rpc-input.js.map +1 -1
- package/dist/modes/rpc/rpc-keybindings-reload.d.ts +27 -0
- package/dist/modes/rpc/rpc-keybindings-reload.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-keybindings-reload.js +69 -0
- package/dist/modes/rpc/rpc-keybindings-reload.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +63 -8
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-output-buffer.d.ts +10 -0
- package/dist/modes/rpc/rpc-output-buffer.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-output-buffer.js +70 -0
- package/dist/modes/rpc/rpc-output-buffer.js.map +1 -0
- package/dist/modes/rpc/rpc-session-binding.d.ts +16 -1
- package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.js +16 -3
- package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +109 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli-parser.d.ts +2 -0
- package/dist/package-manager-cli-parser.d.ts.map +1 -1
- package/dist/package-manager-cli-parser.js +24 -5
- package/dist/package-manager-cli-parser.js.map +1 -1
- package/dist/package-manager-cli.d.ts +7 -0
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +65 -1
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/shell.d.ts +1 -0
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +46 -0
- package/dist/utils/shell.js.map +1 -1
- package/docs/changelog.mdx +11 -0
- package/docs/compaction.md +53 -17
- package/docs/custom-provider.md +24 -5
- package/docs/development.md +9 -7
- package/docs/docs.json +1 -0
- package/docs/extensions.md +30 -16
- package/docs/intercom.md +489 -0
- package/docs/json.md +1 -1
- package/docs/keybindings.md +1 -1
- package/docs/packages.md +1 -0
- package/docs/quickstart.md +11 -5
- package/docs/rpc.md +9 -7
- package/docs/sdk.md +6 -0
- package/docs/session-format.md +7 -6
- package/docs/sessions.md +4 -2
- package/docs/settings.md +2 -2
- package/docs/subagents.md +7 -2
- package/docs/tui.md +61 -2
- package/docs/usage.md +6 -5
- package/docs/workflows.md +2572 -1379
- package/examples/extensions/handoff.ts +1 -1
- package/examples/extensions/qna.ts +1 -1
- package/examples/extensions/summarize.ts +1 -1
- package/npm-shrinkwrap.json +225 -76
- package/package.json +7 -6
- package/dist/builtin/workflows/src/durable/file-backend.ts +0 -439
- package/dist/builtin/workflows/src/durable/file-lock.ts +0 -153
- package/dist/builtin/workflows/src/durable/file-state.ts +0 -104
- package/dist/builtin/workflows/src/extension/runtime-direct.ts +0 -96
- package/dist/builtin/workflows/src/extension/workflow-tool-helpers.ts +0 -66
- package/dist/builtin/workflows/src/runs/foreground/executor-direct-output.ts +0 -91
- package/dist/builtin/workflows/src/runs/foreground/executor-direct.ts +0 -282
- package/dist/builtin/workflows/src/shared/resumable-workflow-notices.ts +0 -43
- package/dist/builtin/workflows/src/tui/session-confirm.ts +0 -299
|
@@ -36,7 +36,19 @@ function createDialogPromise({ output, pendingExtensionRequests, dialogOptions,
|
|
|
36
36
|
function emitExtensionUIRequest(output, request) {
|
|
37
37
|
output({ type: "extension_ui_request", id: crypto.randomUUID(), ...request });
|
|
38
38
|
}
|
|
39
|
-
export function createRpcExtensionUIContext({ output, pendingExtensionRequests, }) {
|
|
39
|
+
export function createRpcExtensionUIContext({ output, pendingExtensionRequests, customUi, sessionPicker, inputForm, }) {
|
|
40
|
+
const unsupportedWarnings = new Set();
|
|
41
|
+
let toolsExpanded = false;
|
|
42
|
+
const warnUnsupported = (method) => {
|
|
43
|
+
if (!customUi || unsupportedWarnings.has(method))
|
|
44
|
+
return;
|
|
45
|
+
unsupportedWarnings.add(method);
|
|
46
|
+
emitExtensionUIRequest(output, {
|
|
47
|
+
method: "notify",
|
|
48
|
+
message: `${method} is unavailable in isolated interactive mode because it requires a synchronous host callback`,
|
|
49
|
+
notifyType: "warning",
|
|
50
|
+
});
|
|
51
|
+
};
|
|
40
52
|
return {
|
|
41
53
|
select: (title, options, opts) => createDialogPromise({
|
|
42
54
|
output,
|
|
@@ -65,11 +77,15 @@ export function createRpcExtensionUIContext({ output, pendingExtensionRequests,
|
|
|
65
77
|
notify(message, type) {
|
|
66
78
|
emitExtensionUIRequest(output, { method: "notify", message, notifyType: type });
|
|
67
79
|
},
|
|
68
|
-
requestRender() {
|
|
69
|
-
|
|
80
|
+
requestRender() { customUi?.requestRender(); },
|
|
81
|
+
getHostCustomUiState: () => customUi?.getHostCustomUiState() ?? {
|
|
82
|
+
blockingInlineCustomUiDepth: 0,
|
|
83
|
+
blockingInlineCustomUiActive: false,
|
|
70
84
|
},
|
|
85
|
+
onHostCustomUiStateChange: (listener) => customUi?.onHostCustomUiStateChange(listener) ?? (() => { }),
|
|
86
|
+
focusHostInlineCustomUi: () => customUi?.focusHostInlineCustomUi() ?? false,
|
|
71
87
|
onTerminalInput() {
|
|
72
|
-
|
|
88
|
+
warnUnsupported("ctx.ui.onTerminalInput");
|
|
73
89
|
return () => { };
|
|
74
90
|
},
|
|
75
91
|
setStatus(key, text) {
|
|
@@ -88,29 +104,39 @@ export function createRpcExtensionUIContext({ output, pendingExtensionRequests,
|
|
|
88
104
|
// Hidden thinking label not supported in RPC mode - requires TUI message rendering access
|
|
89
105
|
},
|
|
90
106
|
setWidget(key, content, options) {
|
|
91
|
-
|
|
92
|
-
|
|
107
|
+
if (content === undefined) {
|
|
108
|
+
customUi?.setWidget(key, undefined, options?.placement);
|
|
93
109
|
emitExtensionUIRequest(output, {
|
|
94
|
-
method: "setWidget",
|
|
95
|
-
widgetKey: key,
|
|
96
|
-
widgetLines: content,
|
|
97
|
-
widgetPlacement: options?.placement,
|
|
110
|
+
method: "setWidget", widgetKey: key, widgetLines: undefined, widgetPlacement: options?.placement,
|
|
98
111
|
});
|
|
112
|
+
return;
|
|
99
113
|
}
|
|
114
|
+
if (Array.isArray(content)) {
|
|
115
|
+
emitExtensionUIRequest(output, {
|
|
116
|
+
method: "setWidget", widgetKey: key, widgetLines: content, widgetPlacement: options?.placement,
|
|
117
|
+
});
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (customUi && typeof content === "function") {
|
|
121
|
+
customUi.setWidget(key, content, options?.placement);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
warnUnsupported("component-factory widgets");
|
|
100
125
|
},
|
|
101
|
-
setFooter(
|
|
102
|
-
|
|
103
|
-
},
|
|
104
|
-
setHeader(_factory) {
|
|
105
|
-
// Custom header not supported in RPC mode - requires TUI access
|
|
106
|
-
},
|
|
126
|
+
setFooter() { warnUnsupported("ctx.ui.setFooter"); },
|
|
127
|
+
setHeader() { warnUnsupported("ctx.ui.setHeader"); },
|
|
107
128
|
setTitle(title) {
|
|
108
129
|
emitExtensionUIRequest(output, { method: "setTitle", title });
|
|
109
130
|
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
131
|
+
custom: (factory, options) => customUi
|
|
132
|
+
? customUi.custom(factory, options)
|
|
133
|
+
: Promise.resolve(undefined),
|
|
134
|
+
// Exposed in the isolated engine child, where the terminal host mounts
|
|
135
|
+
// the real session selector natively so picker navigation never crosses
|
|
136
|
+
// the process boundary. Absent in plain headless RPC (no interactive
|
|
137
|
+
// host); callers must fail with an actionable error, not degrade.
|
|
138
|
+
...(sessionPicker ? { hostSessionPicker: (request) => sessionPicker.open(request) } : {}),
|
|
139
|
+
...(inputForm ? { hostInputForm: (request) => inputForm.open(request) } : {}),
|
|
114
140
|
pasteToEditor(text) {
|
|
115
141
|
// Paste handling not supported in RPC mode - falls back to setEditorText
|
|
116
142
|
this.setEditorText(text);
|
|
@@ -119,7 +145,7 @@ export function createRpcExtensionUIContext({ output, pendingExtensionRequests,
|
|
|
119
145
|
emitExtensionUIRequest(output, { method: "set_editor_text", text });
|
|
120
146
|
},
|
|
121
147
|
getEditorText() {
|
|
122
|
-
|
|
148
|
+
warnUnsupported("ctx.ui.getEditorText");
|
|
123
149
|
return "";
|
|
124
150
|
},
|
|
125
151
|
async editor(title, prefill) {
|
|
@@ -142,12 +168,8 @@ export function createRpcExtensionUIContext({ output, pendingExtensionRequests,
|
|
|
142
168
|
output({ type: "extension_ui_request", id, method: "editor", title, prefill });
|
|
143
169
|
});
|
|
144
170
|
},
|
|
145
|
-
addAutocompleteProvider() {
|
|
146
|
-
|
|
147
|
-
},
|
|
148
|
-
setEditorComponent() {
|
|
149
|
-
// Custom editor components not supported in RPC mode
|
|
150
|
-
},
|
|
171
|
+
addAutocompleteProvider() { warnUnsupported("ctx.ui.addAutocompleteProvider"); },
|
|
172
|
+
setEditorComponent() { warnUnsupported("ctx.ui.setEditorComponent"); },
|
|
151
173
|
getEditorComponent() {
|
|
152
174
|
// Custom editor components not supported in RPC mode
|
|
153
175
|
return undefined;
|
|
@@ -174,17 +196,17 @@ export function createRpcExtensionUIContext({ output, pendingExtensionRequests,
|
|
|
174
196
|
return { success: false, error: "Theme switching not supported in RPC mode" };
|
|
175
197
|
},
|
|
176
198
|
getToolsExpanded() {
|
|
177
|
-
|
|
178
|
-
return false;
|
|
199
|
+
return toolsExpanded;
|
|
179
200
|
},
|
|
180
|
-
setToolsExpanded(
|
|
181
|
-
|
|
201
|
+
setToolsExpanded(expanded) {
|
|
202
|
+
toolsExpanded = expanded;
|
|
203
|
+
customUi?.requestRender();
|
|
182
204
|
},
|
|
183
205
|
getChatRenderSettings() {
|
|
184
206
|
return {
|
|
185
207
|
hideThinkingBlock: false,
|
|
186
208
|
hiddenThinkingLabel: "Thinking...",
|
|
187
|
-
toolOutputExpanded:
|
|
209
|
+
toolOutputExpanded: toolsExpanded,
|
|
188
210
|
showImages: false,
|
|
189
211
|
imageWidthCells: 60,
|
|
190
212
|
getToolDefinition: () => undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-extension-ui.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-extension-ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAOtC,OAAO,EAAc,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAuBlE,SAAS,mBAAmB,CAAI,EAC/B,MAAM,EACN,wBAAwB,EACxB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,aAAa,GACY;IACzB,IAAI,aAAa,EAAE,MAAM,EAAE,OAAO;QAAE,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAEzE,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IAC/B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,IAAI,SAAoD,CAAC;QAEzD,MAAM,OAAO,GAAG,GAAG,EAAE;YACpB,IAAI,SAAS;gBAAE,YAAY,CAAC,SAAS,CAAC,CAAC;YACvC,aAAa,EAAE,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC7D,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACrC,CAAC,CAAC;QAEF,MAAM,OAAO,GAAG,GAAG,EAAE;YACpB,OAAO,EAAE,CAAC;YACV,OAAO,CAAC,YAAY,CAAC,CAAC;QACvB,CAAC,CAAC;QACF,aAAa,EAAE,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAE1E,IAAI,aAAa,EAAE,OAAO,EAAE,CAAC;YAC5B,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC3B,OAAO,EAAE,CAAC;gBACV,OAAO,CAAC,YAAY,CAAC,CAAC;YACvB,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,CAAC;QACd,CAAC;QAED,YAAY;YACX,OAAO,EAAE,CAAC;QACX,CAAC;QAED,QAAQ,CAAC,KAAa;YACrB,OAAO,SAAS,CAAC;QAClB,CAAC;QAED,QAAQ,CAAC,MAAsB;YAC9B,4CAA4C;YAC5C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,2CAA2C,EAAE,CAAC;QAC/E,CAAC;QAED,gBAAgB;YACf,oDAAoD;YACpD,OAAO,KAAK,CAAC;QACd,CAAC;QAED,gBAAgB,CAAC,SAAkB;YAClC,oDAAoD;QACrD,CAAC;QAED,qBAAqB;YACpB,OAAO;gBACN,iBAAiB,EAAE,KAAK;gBACxB,mBAAmB,EAAE,aAAa;gBAClC,kBAAkB,EAAE,KAAK;gBACzB,UAAU,EAAE,KAAK;gBACjB,eAAe,EAAE,EAAE;gBACnB,iBAAiB,EAAE,GAAG,EAAE,CAAC,SAAS;gBAClC,wBAAwB,EAAE,GAAG,EAAE,CAAC,SAAS;aACzC,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["import * as crypto from \"node:crypto\";\nimport type {\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tWorkingIndicatorOptions,\n} from \"../../core/extensions/index.ts\";\nimport { type Theme, theme } from \"../interactive/theme/theme.ts\";\nimport type { RpcExtensionUIRequest, RpcExtensionUIResponse } from \"./rpc-types.ts\";\nimport type { RpcOutput } from \"./rpc-responses.ts\";\n\nexport interface RpcPendingExtensionRequest {\n\tresolve: (value: RpcExtensionUIResponse) => void;\n\treject: (error: Error) => void;\n}\n\nexport type RpcPendingExtensionRequests = Map<string, RpcPendingExtensionRequest>;\n\ninterface CreateRpcExtensionUIContextOptions {\n\toutput: RpcOutput;\n\tpendingExtensionRequests: RpcPendingExtensionRequests;\n}\n\ninterface DialogPromiseOptions<T> extends CreateRpcExtensionUIContextOptions {\n\tdialogOptions: ExtensionUIDialogOptions | undefined;\n\tdefaultValue: T;\n\trequest: Record<string, unknown>;\n\tparseResponse: (response: RpcExtensionUIResponse) => T;\n}\n\nfunction createDialogPromise<T>({\n\toutput,\n\tpendingExtensionRequests,\n\tdialogOptions,\n\tdefaultValue,\n\trequest,\n\tparseResponse,\n}: DialogPromiseOptions<T>): Promise<T> {\n\tif (dialogOptions?.signal?.aborted) return Promise.resolve(defaultValue);\n\n\tconst id = crypto.randomUUID();\n\treturn new Promise((resolve, reject) => {\n\t\tlet timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n\t\tconst cleanup = () => {\n\t\t\tif (timeoutId) clearTimeout(timeoutId);\n\t\t\tdialogOptions?.signal?.removeEventListener(\"abort\", onAbort);\n\t\t\tpendingExtensionRequests.delete(id);\n\t\t};\n\n\t\tconst onAbort = () => {\n\t\t\tcleanup();\n\t\t\tresolve(defaultValue);\n\t\t};\n\t\tdialogOptions?.signal?.addEventListener(\"abort\", onAbort, { once: true });\n\n\t\tif (dialogOptions?.timeout) {\n\t\t\ttimeoutId = setTimeout(() => {\n\t\t\t\tcleanup();\n\t\t\t\tresolve(defaultValue);\n\t\t\t}, dialogOptions.timeout);\n\t\t}\n\n\t\tpendingExtensionRequests.set(id, {\n\t\t\tresolve: (response: RpcExtensionUIResponse) => {\n\t\t\t\tcleanup();\n\t\t\t\tresolve(parseResponse(response));\n\t\t\t},\n\t\t\treject,\n\t\t});\n\t\toutput({ type: \"extension_ui_request\", id, ...request } as RpcExtensionUIRequest);\n\t});\n}\n\nfunction emitExtensionUIRequest(output: RpcOutput, request: Record<string, unknown>): void {\n\toutput({ type: \"extension_ui_request\", id: crypto.randomUUID(), ...request } as RpcExtensionUIRequest);\n}\n\nexport function createRpcExtensionUIContext({\n\toutput,\n\tpendingExtensionRequests,\n}: CreateRpcExtensionUIContextOptions): ExtensionUIContext {\n\treturn {\n\t\tselect: (title, options, opts) =>\n\t\t\tcreateDialogPromise({\n\t\t\t\toutput,\n\t\t\t\tpendingExtensionRequests,\n\t\t\t\tdialogOptions: opts,\n\t\t\t\tdefaultValue: undefined,\n\t\t\t\trequest: { method: \"select\", title, options, timeout: opts?.timeout },\n\t\t\t\tparseResponse: (response) =>\n\t\t\t\t\t\"cancelled\" in response && response.cancelled ? undefined : \"value\" in response ? response.value : undefined,\n\t\t\t}),\n\n\t\tconfirm: (title, message, opts) =>\n\t\t\tcreateDialogPromise({\n\t\t\t\toutput,\n\t\t\t\tpendingExtensionRequests,\n\t\t\t\tdialogOptions: opts,\n\t\t\t\tdefaultValue: false,\n\t\t\t\trequest: { method: \"confirm\", title, message, timeout: opts?.timeout },\n\t\t\t\tparseResponse: (response) =>\n\t\t\t\t\t\"cancelled\" in response && response.cancelled ? false : \"confirmed\" in response ? response.confirmed : false,\n\t\t\t}),\n\n\t\tinput: (title, placeholder, opts) =>\n\t\t\tcreateDialogPromise({\n\t\t\t\toutput,\n\t\t\t\tpendingExtensionRequests,\n\t\t\t\tdialogOptions: opts,\n\t\t\t\tdefaultValue: undefined,\n\t\t\t\trequest: { method: \"input\", title, placeholder, timeout: opts?.timeout },\n\t\t\t\tparseResponse: (response) =>\n\t\t\t\t\t\"cancelled\" in response && response.cancelled ? undefined : \"value\" in response ? response.value : undefined,\n\t\t\t}),\n\n\t\tnotify(message: string, type?: \"info\" | \"warning\" | \"error\"): void {\n\t\t\temitExtensionUIRequest(output, { method: \"notify\", message, notifyType: type });\n\t\t},\n\n\t\trequestRender(): void {\n\t\t\t// RPC mode does not own a local TUI renderer.\n\t\t},\n\n\t\tonTerminalInput(): () => void {\n\t\t\t// Raw terminal input not supported in RPC mode\n\t\t\treturn () => {};\n\t\t},\n\n\t\tsetStatus(key: string, text: string | undefined): void {\n\t\t\temitExtensionUIRequest(output, { method: \"setStatus\", statusKey: key, statusText: text });\n\t\t},\n\n\t\tsetWorkingMessage(_message?: string): void {\n\t\t\t// Working message not supported in RPC mode - requires TUI loader access\n\t\t},\n\n\t\tsetWorkingVisible(_visible: boolean): void {\n\t\t\t// Working visibility not supported in RPC mode - requires TUI loader access\n\t\t},\n\n\t\tsetWorkingIndicator(_options?: WorkingIndicatorOptions): void {\n\t\t\t// Working indicator customization not supported in RPC mode - requires TUI loader access\n\t\t},\n\n\t\tsetHiddenThinkingLabel(_label?: string): void {\n\t\t\t// Hidden thinking label not supported in RPC mode - requires TUI message rendering access\n\t\t},\n\n\t\tsetWidget(key: string, content: unknown, options?: ExtensionWidgetOptions): void {\n\t\t\t// Only support string arrays in RPC mode - factory functions are ignored\n\t\t\tif (content === undefined || Array.isArray(content)) {\n\t\t\t\temitExtensionUIRequest(output, {\n\t\t\t\t\tmethod: \"setWidget\",\n\t\t\t\t\twidgetKey: key,\n\t\t\t\t\twidgetLines: content as string[] | undefined,\n\t\t\t\t\twidgetPlacement: options?.placement,\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\tsetFooter(_factory: unknown): void {\n\t\t\t// Custom footer not supported in RPC mode - requires TUI access\n\t\t},\n\n\t\tsetHeader(_factory: unknown): void {\n\t\t\t// Custom header not supported in RPC mode - requires TUI access\n\t\t},\n\n\t\tsetTitle(title: string): void {\n\t\t\temitExtensionUIRequest(output, { method: \"setTitle\", title });\n\t\t},\n\n\t\tasync custom() {\n\t\t\t// Custom UI not supported in RPC mode\n\t\t\treturn undefined as never;\n\t\t},\n\n\t\tpasteToEditor(text: string): void {\n\t\t\t// Paste handling not supported in RPC mode - falls back to setEditorText\n\t\t\tthis.setEditorText(text);\n\t\t},\n\n\t\tsetEditorText(text: string): void {\n\t\t\temitExtensionUIRequest(output, { method: \"set_editor_text\", text });\n\t\t},\n\n\t\tgetEditorText(): string {\n\t\t\t// Synchronous method can't wait for RPC response; host should track editor state locally if needed.\n\t\t\treturn \"\";\n\t\t},\n\n\t\tasync editor(title: string, prefill?: string): Promise<string | undefined> {\n\t\t\tconst id = crypto.randomUUID();\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tpendingExtensionRequests.set(id, {\n\t\t\t\t\tresolve: (response: RpcExtensionUIResponse) => {\n\t\t\t\t\t\tif (\"cancelled\" in response && response.cancelled) {\n\t\t\t\t\t\t\tresolve(undefined);\n\t\t\t\t\t\t} else if (\"value\" in response) {\n\t\t\t\t\t\t\tresolve(response.value);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresolve(undefined);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\treject,\n\t\t\t\t});\n\t\t\t\toutput({ type: \"extension_ui_request\", id, method: \"editor\", title, prefill } as RpcExtensionUIRequest);\n\t\t\t});\n\t\t},\n\n\t\taddAutocompleteProvider(): void {\n\t\t\t// Autocomplete provider composition is not supported in RPC mode\n\t\t},\n\n\t\tsetEditorComponent(): void {\n\t\t\t// Custom editor components not supported in RPC mode\n\t\t},\n\n\t\tgetEditorComponent() {\n\t\t\t// Custom editor components not supported in RPC mode\n\t\t\treturn undefined;\n\t\t},\n\n\t\tgetFooterDataProvider() {\n\t\t\treturn {\n\t\t\t\tgetGitBranch: () => null,\n\t\t\t\tgetExtensionStatuses: () => new Map(),\n\t\t\t\tgetAvailableProviderCount: () => 1,\n\t\t\t\tonBranchChange: () => () => {},\n\t\t\t};\n\t\t},\n\n\t\tget theme() {\n\t\t\treturn theme;\n\t\t},\n\n\t\tgetAllThemes() {\n\t\t\treturn [];\n\t\t},\n\n\t\tgetTheme(_name: string) {\n\t\t\treturn undefined;\n\t\t},\n\n\t\tsetTheme(_theme: string | Theme) {\n\t\t\t// Theme switching not supported in RPC mode\n\t\t\treturn { success: false, error: \"Theme switching not supported in RPC mode\" };\n\t\t},\n\n\t\tgetToolsExpanded() {\n\t\t\t// Tool expansion not supported in RPC mode - no TUI\n\t\t\treturn false;\n\t\t},\n\n\t\tsetToolsExpanded(_expanded: boolean) {\n\t\t\t// Tool expansion not supported in RPC mode - no TUI\n\t\t},\n\n\t\tgetChatRenderSettings() {\n\t\t\treturn {\n\t\t\t\thideThinkingBlock: false,\n\t\t\t\thiddenThinkingLabel: \"Thinking...\",\n\t\t\t\ttoolOutputExpanded: false,\n\t\t\t\tshowImages: false,\n\t\t\t\timageWidthCells: 60,\n\t\t\t\tgetToolDefinition: () => undefined,\n\t\t\t\tgetCustomMessageRenderer: () => undefined,\n\t\t\t};\n\t\t},\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"rpc-extension-ui.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-extension-ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAUtC,OAAO,EAAc,KAAK,EAAE,MAAM,+BAA+B,CAAC;AA6BlE,SAAS,mBAAmB,CAAI,EAC/B,MAAM,EACN,wBAAwB,EACxB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,aAAa,GACY;IACzB,IAAI,aAAa,EAAE,MAAM,EAAE,OAAO;QAAE,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAEzE,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IAC/B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,IAAI,SAAoD,CAAC;QAEzD,MAAM,OAAO,GAAG,GAAG,EAAE;YACpB,IAAI,SAAS;gBAAE,YAAY,CAAC,SAAS,CAAC,CAAC;YACvC,aAAa,EAAE,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC7D,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACrC,CAAC,CAAC;QAEF,MAAM,OAAO,GAAG,GAAG,EAAE;YACpB,OAAO,EAAE,CAAC;YACV,OAAO,CAAC,YAAY,CAAC,CAAC;QACvB,CAAC,CAAC;QACF,aAAa,EAAE,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAE1E,IAAI,aAAa,EAAE,OAAO,EAAE,CAAC;YAC5B,SAAS,GAAG,UAAU,CAAC,GAAG,EA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,OAAO;gBACN,iBAAiB,EAAE,KAAK;gBACxB,mBAAmB,EAAE,aAAa;gBAClC,kBAAkB,EAAE,aAAa;gBACjC,UAAU,EAAE,KAAK;gBACjB,eAAe,EAAE,EAAE;gBACnB,iBAAiB,EAAE,GAAG,EAAE,CAAC,SAAS;gBAClC,wBAAwB,EAAE,GAAG,EAAE,CAAC,SAAS;aACzC,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["import * as crypto from \"node:crypto\";\nimport type { Component, TUI } from \"@earendil-works/pi-tui\";\nimport type {\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tHostInputFormRequest,\n\tHostSessionPickerRequest,\n\tWorkingIndicatorOptions,\n} from \"../../core/extensions/index.ts\";\nimport { type Theme, theme } from \"../interactive/theme/theme.ts\";\nimport type { EngineCustomUiService } from \"../interactive-engine/engine-custom-ui.ts\";\nimport type { EngineInputFormService } from \"../interactive-engine/engine-input-form.ts\";\nimport type { EngineSessionPickerService } from \"../interactive-engine/engine-session-picker.ts\";\nimport type { RpcExtensionUIRequest, RpcExtensionUIResponse } from \"./rpc-types.ts\";\nimport type { RpcOutput } from \"./rpc-responses.ts\";\n\nexport interface RpcPendingExtensionRequest {\n\tresolve: (value: RpcExtensionUIResponse) => void;\n\treject: (error: Error) => void;\n}\n\nexport type RpcPendingExtensionRequests = Map<string, RpcPendingExtensionRequest>;\n\ninterface CreateRpcExtensionUIContextOptions {\n\toutput: RpcOutput;\n\tpendingExtensionRequests: RpcPendingExtensionRequests;\n\tcustomUi?: EngineCustomUiService;\n\tsessionPicker?: EngineSessionPickerService;\n\tinputForm?: EngineInputFormService;\n}\n\ninterface DialogPromiseOptions<T> extends CreateRpcExtensionUIContextOptions {\n\tdialogOptions: ExtensionUIDialogOptions | undefined;\n\tdefaultValue: T;\n\trequest: Record<string, unknown>;\n\tparseResponse: (response: RpcExtensionUIResponse) => T;\n}\n\nfunction createDialogPromise<T>({\n\toutput,\n\tpendingExtensionRequests,\n\tdialogOptions,\n\tdefaultValue,\n\trequest,\n\tparseResponse,\n}: DialogPromiseOptions<T>): Promise<T> {\n\tif (dialogOptions?.signal?.aborted) return Promise.resolve(defaultValue);\n\n\tconst id = crypto.randomUUID();\n\treturn new Promise((resolve, reject) => {\n\t\tlet timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n\t\tconst cleanup = () => {\n\t\t\tif (timeoutId) clearTimeout(timeoutId);\n\t\t\tdialogOptions?.signal?.removeEventListener(\"abort\", onAbort);\n\t\t\tpendingExtensionRequests.delete(id);\n\t\t};\n\n\t\tconst onAbort = () => {\n\t\t\tcleanup();\n\t\t\tresolve(defaultValue);\n\t\t};\n\t\tdialogOptions?.signal?.addEventListener(\"abort\", onAbort, { once: true });\n\n\t\tif (dialogOptions?.timeout) {\n\t\t\ttimeoutId = setTimeout(() => {\n\t\t\t\tcleanup();\n\t\t\t\tresolve(defaultValue);\n\t\t\t}, dialogOptions.timeout);\n\t\t}\n\n\t\tpendingExtensionRequests.set(id, {\n\t\t\tresolve: (response: RpcExtensionUIResponse) => {\n\t\t\t\tcleanup();\n\t\t\t\tresolve(parseResponse(response));\n\t\t\t},\n\t\t\treject,\n\t\t});\n\t\toutput({ type: \"extension_ui_request\", id, ...request } as RpcExtensionUIRequest);\n\t});\n}\n\nfunction emitExtensionUIRequest(output: RpcOutput, request: Record<string, unknown>): void {\n\toutput({ type: \"extension_ui_request\", id: crypto.randomUUID(), ...request } as RpcExtensionUIRequest);\n}\n\nexport function createRpcExtensionUIContext({\n\toutput,\n\tpendingExtensionRequests,\n\tcustomUi,\n\tsessionPicker,\n\tinputForm,\n}: CreateRpcExtensionUIContextOptions): ExtensionUIContext {\n\tconst unsupportedWarnings = new Set<string>();\n\tlet toolsExpanded = false;\n\tconst warnUnsupported = (method: string): void => {\n\t\tif (!customUi || unsupportedWarnings.has(method)) return;\n\t\tunsupportedWarnings.add(method);\n\t\temitExtensionUIRequest(output, {\n\t\t\tmethod: \"notify\",\n\t\t\tmessage: `${method} is unavailable in isolated interactive mode because it requires a synchronous host callback`,\n\t\t\tnotifyType: \"warning\",\n\t\t});\n\t};\n\treturn {\n\t\tselect: (title, options, opts) =>\n\t\t\tcreateDialogPromise({\n\t\t\t\toutput,\n\t\t\t\tpendingExtensionRequests,\n\t\t\t\tdialogOptions: opts,\n\t\t\t\tdefaultValue: undefined,\n\t\t\t\trequest: { method: \"select\", title, options, timeout: opts?.timeout },\n\t\t\t\tparseResponse: (response) =>\n\t\t\t\t\t\"cancelled\" in response && response.cancelled ? undefined : \"value\" in response ? response.value : undefined,\n\t\t\t}),\n\n\t\tconfirm: (title, message, opts) =>\n\t\t\tcreateDialogPromise({\n\t\t\t\toutput,\n\t\t\t\tpendingExtensionRequests,\n\t\t\t\tdialogOptions: opts,\n\t\t\t\tdefaultValue: false,\n\t\t\t\trequest: { method: \"confirm\", title, message, timeout: opts?.timeout },\n\t\t\t\tparseResponse: (response) =>\n\t\t\t\t\t\"cancelled\" in response && response.cancelled ? false : \"confirmed\" in response ? response.confirmed : false,\n\t\t\t}),\n\n\t\tinput: (title, placeholder, opts) =>\n\t\t\tcreateDialogPromise({\n\t\t\t\toutput,\n\t\t\t\tpendingExtensionRequests,\n\t\t\t\tdialogOptions: opts,\n\t\t\t\tdefaultValue: undefined,\n\t\t\t\trequest: { method: \"input\", title, placeholder, timeout: opts?.timeout },\n\t\t\t\tparseResponse: (response) =>\n\t\t\t\t\t\"cancelled\" in response && response.cancelled ? undefined : \"value\" in response ? response.value : undefined,\n\t\t\t}),\n\n\t\tnotify(message: string, type?: \"info\" | \"warning\" | \"error\"): void {\n\t\t\temitExtensionUIRequest(output, { method: \"notify\", message, notifyType: type });\n\t\t},\n\n\t\trequestRender(): void { customUi?.requestRender(); },\n\n\t\tgetHostCustomUiState: () => customUi?.getHostCustomUiState() ?? {\n\t\t\tblockingInlineCustomUiDepth: 0,\n\t\t\tblockingInlineCustomUiActive: false,\n\t\t},\n\t\tonHostCustomUiStateChange: (listener) => customUi?.onHostCustomUiStateChange(listener) ?? (() => {}),\n\t\tfocusHostInlineCustomUi: () => customUi?.focusHostInlineCustomUi() ?? false,\n\n\t\tonTerminalInput(): () => void {\n\t\t\twarnUnsupported(\"ctx.ui.onTerminalInput\");\n\t\t\treturn () => {};\n\t\t},\n\n\t\tsetStatus(key: string, text: string | undefined): void {\n\t\t\temitExtensionUIRequest(output, { method: \"setStatus\", statusKey: key, statusText: text });\n\t\t},\n\n\t\tsetWorkingMessage(_message?: string): void {\n\t\t\t// Working message not supported in RPC mode - requires TUI loader access\n\t\t},\n\n\t\tsetWorkingVisible(_visible: boolean): void {\n\t\t\t// Working visibility not supported in RPC mode - requires TUI loader access\n\t\t},\n\n\t\tsetWorkingIndicator(_options?: WorkingIndicatorOptions): void {\n\t\t\t// Working indicator customization not supported in RPC mode - requires TUI loader access\n\t\t},\n\n\t\tsetHiddenThinkingLabel(_label?: string): void {\n\t\t\t// Hidden thinking label not supported in RPC mode - requires TUI message rendering access\n\t\t},\n\n\t\tsetWidget(key: string, content: unknown, options?: ExtensionWidgetOptions): void {\n\t\t\tif (content === undefined) {\n\t\t\t\tcustomUi?.setWidget(key, undefined, options?.placement);\n\t\t\t\temitExtensionUIRequest(output, {\n\t\t\t\t\tmethod: \"setWidget\", widgetKey: key, widgetLines: undefined, widgetPlacement: options?.placement,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (Array.isArray(content)) {\n\t\t\t\temitExtensionUIRequest(output, {\n\t\t\t\t\tmethod: \"setWidget\", widgetKey: key, widgetLines: content as string[], widgetPlacement: options?.placement,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (customUi && typeof content === \"function\") {\n\t\t\t\tcustomUi.setWidget(key, content as (tui: TUI, theme: Theme) => Component & { dispose?(): void }, options?.placement);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\twarnUnsupported(\"component-factory widgets\");\n\t\t},\n\n\t\tsetFooter(): void { warnUnsupported(\"ctx.ui.setFooter\"); },\n\n\t\tsetHeader(): void { warnUnsupported(\"ctx.ui.setHeader\"); },\n\n\t\tsetTitle(title: string): void {\n\t\t\temitExtensionUIRequest(output, { method: \"setTitle\", title });\n\t\t},\n\n\t\tcustom: (factory, options) => customUi\n\t\t\t? customUi.custom(factory, options)\n\t\t\t: Promise.resolve(undefined as never),\n\n\t\t// Exposed in the isolated engine child, where the terminal host mounts\n\t\t// the real session selector natively so picker navigation never crosses\n\t\t// the process boundary. Absent in plain headless RPC (no interactive\n\t\t// host); callers must fail with an actionable error, not degrade.\n\t\t...(sessionPicker ? { hostSessionPicker: (request: HostSessionPickerRequest) => sessionPicker.open(request) } : {}),\n\t\t...(inputForm ? { hostInputForm: (request: HostInputFormRequest) => inputForm.open(request) } : {}),\n\n\t\tpasteToEditor(text: string): void {\n\t\t\t// Paste handling not supported in RPC mode - falls back to setEditorText\n\t\t\tthis.setEditorText(text);\n\t\t},\n\n\t\tsetEditorText(text: string): void {\n\t\t\temitExtensionUIRequest(output, { method: \"set_editor_text\", text });\n\t\t},\n\n\t\tgetEditorText(): string {\n\t\t\twarnUnsupported(\"ctx.ui.getEditorText\");\n\t\t\treturn \"\";\n\t\t},\n\n\t\tasync editor(title: string, prefill?: string): Promise<string | undefined> {\n\t\t\tconst id = crypto.randomUUID();\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tpendingExtensionRequests.set(id, {\n\t\t\t\t\tresolve: (response: RpcExtensionUIResponse) => {\n\t\t\t\t\t\tif (\"cancelled\" in response && response.cancelled) {\n\t\t\t\t\t\t\tresolve(undefined);\n\t\t\t\t\t\t} else if (\"value\" in response) {\n\t\t\t\t\t\t\tresolve(response.value);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresolve(undefined);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\treject,\n\t\t\t\t});\n\t\t\t\toutput({ type: \"extension_ui_request\", id, method: \"editor\", title, prefill } as RpcExtensionUIRequest);\n\t\t\t});\n\t\t},\n\n\t\taddAutocompleteProvider(): void { warnUnsupported(\"ctx.ui.addAutocompleteProvider\"); },\n\n\t\tsetEditorComponent(): void { warnUnsupported(\"ctx.ui.setEditorComponent\"); },\n\n\t\tgetEditorComponent() {\n\t\t\t// Custom editor components not supported in RPC mode\n\t\t\treturn undefined;\n\t\t},\n\n\t\tgetFooterDataProvider() {\n\t\t\treturn {\n\t\t\t\tgetGitBranch: () => null,\n\t\t\t\tgetExtensionStatuses: () => new Map(),\n\t\t\t\tgetAvailableProviderCount: () => 1,\n\t\t\t\tonBranchChange: () => () => {},\n\t\t\t};\n\t\t},\n\n\t\tget theme() {\n\t\t\treturn theme;\n\t\t},\n\n\t\tgetAllThemes() {\n\t\t\treturn [];\n\t\t},\n\n\t\tgetTheme(_name: string) {\n\t\t\treturn undefined;\n\t\t},\n\n\t\tsetTheme(_theme: string | Theme) {\n\t\t\t// Theme switching not supported in RPC mode\n\t\t\treturn { success: false, error: \"Theme switching not supported in RPC mode\" };\n\t\t},\n\n\t\tgetToolsExpanded() {\n\t\t\treturn toolsExpanded;\n\t\t},\n\n\t\tsetToolsExpanded(expanded: boolean) {\n\t\t\ttoolsExpanded = expanded;\n\t\t\tcustomUi?.requestRender();\n\t\t},\n\n\t\tgetChatRenderSettings() {\n\t\t\treturn {\n\t\t\t\thideThinkingBlock: false,\n\t\t\t\thiddenThinkingLabel: \"Thinking...\",\n\t\t\t\ttoolOutputExpanded: toolsExpanded,\n\t\t\t\tshowImages: false,\n\t\t\t\timageWidthCells: 60,\n\t\t\t\tgetToolDefinition: () => undefined,\n\t\t\t\tgetCustomMessageRenderer: () => undefined,\n\t\t\t};\n\t\t},\n\t};\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RpcExtensionUIResponse } from "./rpc-types.ts";
|
|
2
|
+
export declare function isRpcExtensionUIResponse(value: unknown): value is RpcExtensionUIResponse;
|
|
3
|
+
/**
|
|
4
|
+
* Control frames must remain reachable while an ordinary RPC command is
|
|
5
|
+
* pending. Interrupts cancel that command, while host responses can unblock UI
|
|
6
|
+
* work awaited by it. Everything else stays on the ordered command lane.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isConcurrentRpcControlLine(line: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Runs ordinary RPC input one frame at a time while giving validated control
|
|
11
|
+
* frames an independent lane. The first ordinary frame starts synchronously,
|
|
12
|
+
* so a following interrupt cannot overtake initialization of the operation it
|
|
13
|
+
* is intended to cancel.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createRpcInputScheduler(handleLine: (line: string) => Promise<void>): (line: string) => void;
|
|
16
|
+
//# sourceMappingURL=rpc-input-scheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-input-scheduler.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-input-scheduler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAS7D,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,sBAAsB,CAIxF;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAWhE;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CA8B3G"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { parseInteractiveEngineCommand } from "../interactive-engine/protocol.js";
|
|
2
|
+
const INTERRUPT_COMMANDS = new Set([
|
|
3
|
+
"abort",
|
|
4
|
+
"abort_compaction",
|
|
5
|
+
"abort_retry",
|
|
6
|
+
"abort_bash",
|
|
7
|
+
]);
|
|
8
|
+
export function isRpcExtensionUIResponse(value) {
|
|
9
|
+
return typeof value === "object" && value !== null &&
|
|
10
|
+
"type" in value && value.type === "extension_ui_response" &&
|
|
11
|
+
"id" in value && typeof value.id === "string";
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Control frames must remain reachable while an ordinary RPC command is
|
|
15
|
+
* pending. Interrupts cancel that command, while host responses can unblock UI
|
|
16
|
+
* work awaited by it. Everything else stays on the ordered command lane.
|
|
17
|
+
*/
|
|
18
|
+
export function isConcurrentRpcControlLine(line) {
|
|
19
|
+
if (parseInteractiveEngineCommand(line))
|
|
20
|
+
return true;
|
|
21
|
+
let value;
|
|
22
|
+
try {
|
|
23
|
+
const parsed = JSON.parse(line);
|
|
24
|
+
value = typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
if (isRpcExtensionUIResponse(value))
|
|
30
|
+
return true;
|
|
31
|
+
return value !== null && "type" in value && typeof value.type === "string" && INTERRUPT_COMMANDS.has(value.type);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Runs ordinary RPC input one frame at a time while giving validated control
|
|
35
|
+
* frames an independent lane. The first ordinary frame starts synchronously,
|
|
36
|
+
* so a following interrupt cannot overtake initialization of the operation it
|
|
37
|
+
* is intended to cancel.
|
|
38
|
+
*/
|
|
39
|
+
export function createRpcInputScheduler(handleLine) {
|
|
40
|
+
const ordinaryQueue = [];
|
|
41
|
+
let ordinaryActive = false;
|
|
42
|
+
const invoke = (line) => {
|
|
43
|
+
try {
|
|
44
|
+
return handleLine(line);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
return Promise.reject(error);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const startNextOrdinary = () => {
|
|
51
|
+
const line = ordinaryQueue.shift();
|
|
52
|
+
if (line === undefined) {
|
|
53
|
+
ordinaryActive = false;
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
ordinaryActive = true;
|
|
57
|
+
void invoke(line).finally(startNextOrdinary).catch(() => { });
|
|
58
|
+
};
|
|
59
|
+
return (line) => {
|
|
60
|
+
if (isConcurrentRpcControlLine(line)) {
|
|
61
|
+
void invoke(line).catch(() => { });
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
ordinaryQueue.push(line);
|
|
65
|
+
if (!ordinaryActive)
|
|
66
|
+
startNextOrdinary();
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=rpc-input-scheduler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-input-scheduler.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-input-scheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AAGlF,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC;IACvD,OAAO;IACP,kBAAkB;IAClB,aAAa;IACb,YAAY;CACZ,CAAC,CAAC;AAEH,MAAM,UAAU,wBAAwB,CAAC,KAAc;IACtD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QACjD,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,uBAAuB;QACzD,IAAI,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAY;IACtD,IAAI,6BAA6B,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACrD,IAAI,KAAoB,CAAC;IACzB,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAA8C,CAAC;QAC7E,KAAK,GAAG,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAA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CAAC;QACD,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,cAAc;YAAE,iBAAiB,EAAE,CAAC;IAC1C,CAAC,CAAC;AACH,CAAC","sourcesContent":["import { parseInteractiveEngineCommand } from \"../interactive-engine/protocol.ts\";\nimport type { RpcExtensionUIResponse } from \"./rpc-types.ts\";\n\nconst INTERRUPT_COMMANDS: ReadonlySet<string> = new Set([\n\t\"abort\",\n\t\"abort_compaction\",\n\t\"abort_retry\",\n\t\"abort_bash\",\n]);\n\nexport function isRpcExtensionUIResponse(value: unknown): value is RpcExtensionUIResponse {\n\treturn typeof value === \"object\" && value !== null &&\n\t\t\"type\" in value && value.type === \"extension_ui_response\" &&\n\t\t\"id\" in value && typeof value.id === \"string\";\n}\n\n/**\n * Control frames must remain reachable while an ordinary RPC command is\n * pending. Interrupts cancel that command, while host responses can unblock UI\n * work awaited by it. Everything else stays on the ordered command lane.\n */\nexport function isConcurrentRpcControlLine(line: string): boolean {\n\tif (parseInteractiveEngineCommand(line)) return true;\n\tlet value: object | null;\n\ttry {\n\t\tconst parsed = JSON.parse(line) as object | boolean | null | number | string;\n\t\tvalue = typeof parsed === \"object\" && !Array.isArray(parsed) ? parsed : null;\n\t} catch {\n\t\treturn false;\n\t}\n\tif (isRpcExtensionUIResponse(value)) return true;\n\treturn value !== null && \"type\" in value && typeof value.type === \"string\" && INTERRUPT_COMMANDS.has(value.type);\n}\n\n/**\n * Runs ordinary RPC input one frame at a time while giving validated control\n * frames an independent lane. The first ordinary frame starts synchronously,\n * so a following interrupt cannot overtake initialization of the operation it\n * is intended to cancel.\n */\nexport function createRpcInputScheduler(handleLine: (line: string) => Promise<void>): (line: string) => void {\n\tconst ordinaryQueue: string[] = [];\n\tlet ordinaryActive = false;\n\n\tconst invoke = (line: string): Promise<void> => {\n\t\ttry {\n\t\t\treturn handleLine(line);\n\t\t} catch (error) {\n\t\t\treturn Promise.reject(error);\n\t\t}\n\t};\n\n\tconst startNextOrdinary = (): void => {\n\t\tconst line = ordinaryQueue.shift();\n\t\tif (line === undefined) {\n\t\t\tordinaryActive = false;\n\t\t\treturn;\n\t\t}\n\t\tordinaryActive = true;\n\t\tvoid invoke(line).finally(startNextOrdinary).catch(() => {});\n\t};\n\n\treturn (line: string): void => {\n\t\tif (isConcurrentRpcControlLine(line)) {\n\t\t\tvoid invoke(line).catch(() => {});\n\t\t\treturn;\n\t\t}\n\t\tordinaryQueue.push(line);\n\t\tif (!ordinaryActive) startNextOrdinary();\n\t};\n}\n"]}
|
|
@@ -6,7 +6,8 @@ interface RpcInputLineHandlerOptions {
|
|
|
6
6
|
pendingExtensionRequests: RpcPendingExtensionRequests;
|
|
7
7
|
handleCommand: RpcCommandHandler;
|
|
8
8
|
checkShutdownRequested: () => Promise<void>;
|
|
9
|
+
handleInteractiveEngineLine?: (line: string) => boolean;
|
|
9
10
|
}
|
|
10
|
-
export declare function createRpcInputLineHandler({ output, pendingExtensionRequests, handleCommand, checkShutdownRequested, }: RpcInputLineHandlerOptions): (line: string) => Promise<void>;
|
|
11
|
+
export declare function createRpcInputLineHandler({ output, pendingExtensionRequests, handleCommand, checkShutdownRequested, handleInteractiveEngineLine, }: RpcInputLineHandlerOptions): (line: string) => Promise<void>;
|
|
11
12
|
export {};
|
|
12
13
|
//# sourceMappingURL=rpc-input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-input.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-input.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAiD,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"rpc-input.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-input.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAiD,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAInG,UAAU,0BAA0B;IACnC,MAAM,EAAE,SAAS,CAAC;IAClB,wBAAwB,EAAE,2BAA2B,CAAC;IACtD,aAAa,EAAE,iBAAiB,CAAC;IACjC,sBAAsB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,2BAA2B,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CACxD;AAgBD,wBAAgB,yBAAyB,CAAC,EACzC,MAAM,EACN,wBAAwB,EACxB,aAAa,EACb,sBAAsB,EACtB,2BAA2B,GAC3B,EAAE,0BAA0B,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAmC9D"}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { waitForRawStdoutBackpressure } from "../../core/output-guard.js";
|
|
2
2
|
import { createRpcErrorResponse, formatRpcErrorMessage } from "./rpc-responses.js";
|
|
3
|
-
|
|
4
|
-
return (typeof value === "object" &&
|
|
5
|
-
value !== null &&
|
|
6
|
-
"type" in value &&
|
|
7
|
-
value.type === "extension_ui_response" &&
|
|
8
|
-
"id" in value &&
|
|
9
|
-
typeof value.id === "string");
|
|
10
|
-
}
|
|
3
|
+
import { isRpcExtensionUIResponse } from "./rpc-input-scheduler.js";
|
|
11
4
|
function getCommandIdentity(command) {
|
|
12
5
|
if (typeof command !== "object" || command === null) {
|
|
13
6
|
return { id: undefined, type: "unknown" };
|
|
@@ -16,8 +9,10 @@ function getCommandIdentity(command) {
|
|
|
16
9
|
const type = "type" in command && typeof command.type === "string" ? command.type : "unknown";
|
|
17
10
|
return { id, type };
|
|
18
11
|
}
|
|
19
|
-
export function createRpcInputLineHandler({ output, pendingExtensionRequests, handleCommand, checkShutdownRequested, }) {
|
|
12
|
+
export function createRpcInputLineHandler({ output, pendingExtensionRequests, handleCommand, checkShutdownRequested, handleInteractiveEngineLine, }) {
|
|
20
13
|
return async (line) => {
|
|
14
|
+
if (handleInteractiveEngineLine?.(line))
|
|
15
|
+
return;
|
|
21
16
|
let parsed;
|
|
22
17
|
try {
|
|
23
18
|
parsed = JSON.parse(line);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-input.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAG1E,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAkB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"rpc-input.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAG1E,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAkB,MAAM,oBAAoB,CAAC;AACnG,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAgBpE,SAAS,kBAAkB,CAAC,OAAgB;IAC3C,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrD,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3C,CAAC;IACD,MAAM,EAAE,GAAG,IAAI,IAAI,OAAO,IAAI,OAAO,OAAO,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACtF,MAAM,IAAI,GAAG,MAAM,IAAI,OAAO,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CA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,CAAC,OAAO,CAAC,CAAC;YAC7C,MAAM,CAAC,sBAAsB,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YAChG,MAAM,4BAA4B,EAAE,CAAC;QACtC,CAAC;IACF,CAAC,CAAC;AACH,CAAC","sourcesContent":["import { waitForRawStdoutBackpressure } from \"../../core/output-guard.ts\";\nimport type { RpcCommandHandler } from \"./rpc-command-handler.ts\";\nimport type { RpcPendingExtensionRequests } from \"./rpc-extension-ui.ts\";\nimport { createRpcErrorResponse, formatRpcErrorMessage, type RpcOutput } from \"./rpc-responses.ts\";\nimport { isRpcExtensionUIResponse } from \"./rpc-input-scheduler.ts\";\nimport type { RpcCommand } from \"./rpc-types.ts\";\n\ninterface RpcInputLineHandlerOptions {\n\toutput: RpcOutput;\n\tpendingExtensionRequests: RpcPendingExtensionRequests;\n\thandleCommand: RpcCommandHandler;\n\tcheckShutdownRequested: () => Promise<void>;\n\thandleInteractiveEngineLine?: (line: string) => boolean;\n}\n\ninterface CommandIdentity {\n\tid: string | undefined;\n\ttype: string;\n}\n\nfunction getCommandIdentity(command: unknown): CommandIdentity {\n\tif (typeof command !== \"object\" || command === null) {\n\t\treturn { id: undefined, type: \"unknown\" };\n\t}\n\tconst id = \"id\" in command && typeof command.id === \"string\" ? command.id : undefined;\n\tconst type = \"type\" in command && typeof command.type === \"string\" ? command.type : \"unknown\";\n\treturn { id, type };\n}\n\nexport function createRpcInputLineHandler({\n\toutput,\n\tpendingExtensionRequests,\n\thandleCommand,\n\tcheckShutdownRequested,\n\thandleInteractiveEngineLine,\n}: RpcInputLineHandlerOptions): (line: string) => Promise<void> {\n\treturn async (line: string): Promise<void> => {\n\t\tif (handleInteractiveEngineLine?.(line)) return;\n\t\tlet parsed: unknown;\n\t\ttry {\n\t\t\tparsed = JSON.parse(line);\n\t\t} catch (parseError: unknown) {\n\t\t\toutput(createRpcErrorResponse(undefined, \"parse\", `Failed to parse command: ${formatRpcErrorMessage(parseError)}`));\n\t\t\tawait waitForRawStdoutBackpressure();\n\t\t\treturn;\n\t\t}\n\n\t\tif (isRpcExtensionUIResponse(parsed)) {\n\t\t\tconst pending = pendingExtensionRequests.get(parsed.id);\n\t\t\tif (pending) {\n\t\t\t\tpendingExtensionRequests.delete(parsed.id);\n\t\t\t\tpending.resolve(parsed);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst command = parsed as RpcCommand;\n\t\ttry {\n\t\t\tconst response = await handleCommand(command);\n\t\t\tif (response) {\n\t\t\t\toutput(response);\n\t\t\t\tawait waitForRawStdoutBackpressure();\n\t\t\t}\n\t\t\tawait checkShutdownRequested();\n\t\t} catch (commandError: unknown) {\n\t\t\tconst identity = getCommandIdentity(command);\n\t\t\toutput(createRpcErrorResponse(identity.id, identity.type, formatRpcErrorMessage(commandError)));\n\t\t\tawait waitForRawStdoutBackpressure();\n\t\t}\n\t};\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AgentSessionReloadOptions } from "../../core/agent-session-types.ts";
|
|
2
|
+
import type { KeybindingsConfig, KeybindingsManager } from "../../core/keybindings.ts";
|
|
3
|
+
import type { EngineExtensionShortcut, EngineKeybindingState } from "../interactive-engine/protocol.ts";
|
|
4
|
+
export interface ReloadableSession {
|
|
5
|
+
reload(options?: AgentSessionReloadOptions): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
type ShortcutCatalogResolver<TSession extends ReloadableSession> = (session: TSession, effectiveBindings: KeybindingsConfig) => EngineExtensionShortcut[];
|
|
8
|
+
/**
|
|
9
|
+
* Serializes the full keybinding/session reload transaction for one shared
|
|
10
|
+
* manager. The queue survives rejection, mutates the manager in place, and
|
|
11
|
+
* publishes only state from a committed successful reload.
|
|
12
|
+
*/
|
|
13
|
+
export declare class KeybindingsReloadCoordinator<TSession extends ReloadableSession = ReloadableSession> {
|
|
14
|
+
private tail;
|
|
15
|
+
private readonly keybindings;
|
|
16
|
+
private readonly onCommitted;
|
|
17
|
+
private readonly resolveShortcuts;
|
|
18
|
+
constructor(keybindings: KeybindingsManager | undefined, onCommitted?: (state: EngineKeybindingState) => void, resolveShortcuts?: ShortcutCatalogResolver<TSession>);
|
|
19
|
+
reload(session: TSession): Promise<EngineKeybindingState | undefined>;
|
|
20
|
+
publishCurrentState(session: TSession): EngineKeybindingState | undefined;
|
|
21
|
+
private createState;
|
|
22
|
+
private runTransaction;
|
|
23
|
+
}
|
|
24
|
+
/** Compatibility helper for callers that do not share a longer-lived queue. */
|
|
25
|
+
export declare function reloadSessionWithKeybindings(session: ReloadableSession, keybindings: KeybindingsManager | undefined, onKeybindingsReloaded?: () => void): Promise<void>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=rpc-keybindings-reload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-keybindings-reload.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-keybindings-reload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AACnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,KAAK,EAAE,uBAAuB,EAAE,qBAAqB,EAAiC,MAAM,mCAAmC,CAAC;AAEvI,MAAM,WAAW,iBAAiB;IACjC,MAAM,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3D;AAUD,KAAK,uBAAuB,CAAC,QAAQ,SAAS,iBAAiB,IAAI,CAClE,OAAO,EAAE,QAAQ,EACjB,iBAAiB,EAAE,iBAAiB,KAChC,uBAAuB,EAAE,CAAC;AAE/B;;;;GAIG;AACH,qBAAa,4BAA4B,CAAC,QAAQ,SAAS,iBAAiB,GAAG,iBAAiB;IAC/F,OAAO,CAAC,IAAI,CAAoC;IAChD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiC;IAC7D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuD;IACnF,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAgD;IAEjF,YACC,WAAW,EAAE,kBAAkB,GAAG,SAAS,EAC3C,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,EACpD,gBAAgB,CAAC,EAAE,uBAAuB,CAAC,QAAQ,CAAC,EAKpD;IAED,MAAM,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAOpE;IAED,mBAAmB,CAAC,OAAO,EAAE,QAAQ,GAAG,qBAAqB,GAAG,SAAS,CAKxE;IAED,OAAO,CAAC,WAAW;YASL,cAAc;CAqB5B;AAED,+EAA+E;AAC/E,wBAAsB,4BAA4B,CACjD,OAAO,EAAE,iBAAiB,EAC1B,WAAW,EAAE,kBAAkB,GAAG,SAAS,EAC3C,qBAAqB,CAAC,EAAE,MAAM,IAAI,GAChC,OAAO,CAAC,IAAI,CAAC,CAMf"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
function serializeBindings(config) {
|
|
2
|
+
const serialized = {};
|
|
3
|
+
for (const [key, binding] of Object.entries(config)) {
|
|
4
|
+
if (binding !== undefined)
|
|
5
|
+
serialized[key] = Array.isArray(binding) ? [...binding] : binding;
|
|
6
|
+
}
|
|
7
|
+
return serialized;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Serializes the full keybinding/session reload transaction for one shared
|
|
11
|
+
* manager. The queue survives rejection, mutates the manager in place, and
|
|
12
|
+
* publishes only state from a committed successful reload.
|
|
13
|
+
*/
|
|
14
|
+
export class KeybindingsReloadCoordinator {
|
|
15
|
+
constructor(keybindings, onCommitted, resolveShortcuts) {
|
|
16
|
+
this.tail = Promise.resolve();
|
|
17
|
+
this.keybindings = keybindings;
|
|
18
|
+
this.onCommitted = onCommitted;
|
|
19
|
+
this.resolveShortcuts = resolveShortcuts;
|
|
20
|
+
}
|
|
21
|
+
reload(session) {
|
|
22
|
+
const transaction = this.tail.then(() => this.runTransaction(session), () => this.runTransaction(session));
|
|
23
|
+
this.tail = transaction.then(() => { }, () => { });
|
|
24
|
+
return transaction;
|
|
25
|
+
}
|
|
26
|
+
publishCurrentState(session) {
|
|
27
|
+
if (!this.keybindings)
|
|
28
|
+
return undefined;
|
|
29
|
+
const state = this.createState(session);
|
|
30
|
+
this.onCommitted?.(state);
|
|
31
|
+
return state;
|
|
32
|
+
}
|
|
33
|
+
createState(session) {
|
|
34
|
+
const effectiveBindings = this.keybindings.getEffectiveConfig();
|
|
35
|
+
return {
|
|
36
|
+
userBindings: serializeBindings(this.keybindings.getUserBindings()),
|
|
37
|
+
effectiveBindings: serializeBindings(effectiveBindings),
|
|
38
|
+
shortcuts: this.resolveShortcuts?.(session, effectiveBindings) ?? [],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async runTransaction(session) {
|
|
42
|
+
if (!this.keybindings) {
|
|
43
|
+
await session.reload();
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
const previousUserBindings = this.keybindings.getUserBindings();
|
|
47
|
+
let keybindingsApplied = false;
|
|
48
|
+
try {
|
|
49
|
+
await session.reload({
|
|
50
|
+
beforeSessionStart: () => {
|
|
51
|
+
this.keybindings.reload();
|
|
52
|
+
keybindingsApplied = true;
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
return this.publishCurrentState(session);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
if (keybindingsApplied)
|
|
59
|
+
this.keybindings.setUserBindings(previousUserBindings);
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/** Compatibility helper for callers that do not share a longer-lived queue. */
|
|
65
|
+
export async function reloadSessionWithKeybindings(session, keybindings, onKeybindingsReloaded) {
|
|
66
|
+
const coordinator = new KeybindingsReloadCoordinator(keybindings, onKeybindingsReloaded ? () => onKeybindingsReloaded() : undefined);
|
|
67
|
+
await coordinator.reload(session);
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=rpc-keybindings-reload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-keybindings-reload.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-keybindings-reload.ts"],"names":[],"mappings":"AAQA,SAAS,iBAAiB,CAAC,MAAyB;IACnD,MAAM,UAAU,GAAkC,EAAE,CAAC;IACrD,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACrD,IAAI,OAAO,KAAK,SAAS;YAAE,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAC9F,CAAC;IACD,OAAO,UAAU,CAAC;AACnB,CAAC;AAOD;;;;GAIG;AACH,MAAM,OAAO,4BAA4B;IAMxC,YACC,WAA2C,EAC3C,WAAoD,EACpD,gBAAoD;QAR7C,SAAI,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAC;QAU/C,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,OAAiB;QACvB,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CACjC,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAClC,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAClC,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,GAAE,CA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AE,CAAC;YAChB,IAAI,kBAAkB;gBAAE,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC;YAC/E,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;CACD;AAED,+EAA+E;AAC/E,MAAM,CAAC,KAAK,UAAU,4BAA4B,CACjD,OAA0B,EAC1B,WAA2C,EAC3C,qBAAkC;IAElC,MAAM,WAAW,GAAG,IAAI,4BAA4B,CACnD,WAAW,EACX,qBAAqB,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC,SAAS,CACjE,CAAC;IACF,MAAM,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import type { AgentSessionReloadOptions } from \"../../core/agent-session-types.ts\";\nimport type { KeybindingsConfig, KeybindingsManager } from \"../../core/keybindings.ts\";\nimport type { EngineExtensionShortcut, EngineKeybindingState, SerializableKeybindingsConfig } from \"../interactive-engine/protocol.ts\";\n\nexport interface ReloadableSession {\n\treload(options?: AgentSessionReloadOptions): Promise<void>;\n}\n\nfunction serializeBindings(config: KeybindingsConfig): SerializableKeybindingsConfig {\n\tconst serialized: SerializableKeybindingsConfig = {};\n\tfor (const [key, binding] of Object.entries(config)) {\n\t\tif (binding !== undefined) serialized[key] = Array.isArray(binding) ? [...binding] : binding;\n\t}\n\treturn serialized;\n}\n\ntype ShortcutCatalogResolver<TSession extends ReloadableSession> = (\n\tsession: TSession,\n\teffectiveBindings: KeybindingsConfig,\n) => EngineExtensionShortcut[];\n\n/**\n * Serializes the full keybinding/session reload transaction for one shared\n * manager. The queue survives rejection, mutates the manager in place, and\n * publishes only state from a committed successful reload.\n */\nexport class KeybindingsReloadCoordinator<TSession extends ReloadableSession = ReloadableSession> {\n\tprivate tail: Promise<void> = Promise.resolve();\n\tprivate readonly keybindings: KeybindingsManager | undefined;\n\tprivate readonly onCommitted: ((state: EngineKeybindingState) => void) | undefined;\n\tprivate readonly resolveShortcuts: ShortcutCatalogResolver<TSession> | undefined;\n\n\tconstructor(\n\t\tkeybindings: KeybindingsManager | undefined,\n\t\tonCommitted?: (state: EngineKeybindingState) => void,\n\t\tresolveShortcuts?: ShortcutCatalogResolver<TSession>,\n\t) {\n\t\tthis.keybindings = keybindings;\n\t\tthis.onCommitted = onCommitted;\n\t\tthis.resolveShortcuts = resolveShortcuts;\n\t}\n\n\treload(session: TSession): Promise<EngineKeybindingState | undefined> {\n\t\tconst transaction = this.tail.then(\n\t\t\t() => this.runTransaction(session),\n\t\t\t() => this.runTransaction(session),\n\t\t);\n\t\tthis.tail = transaction.then(() => {}, () => {});\n\t\treturn transaction;\n\t}\n\n\tpublishCurrentState(session: TSession): EngineKeybindingState | undefined {\n\t\tif (!this.keybindings) return undefined;\n\t\tconst state = this.createState(session);\n\t\tthis.onCommitted?.(state);\n\t\treturn state;\n\t}\n\n\tprivate createState(session: TSession): EngineKeybindingState {\n\t\tconst effectiveBindings = this.keybindings!.getEffectiveConfig();\n\t\treturn {\n\t\t\tuserBindings: serializeBindings(this.keybindings!.getUserBindings()),\n\t\t\teffectiveBindings: serializeBindings(effectiveBindings),\n\t\t\tshortcuts: this.resolveShortcuts?.(session, effectiveBindings) ?? [],\n\t\t};\n\t}\n\n\tprivate async runTransaction(session: TSession): Promise<EngineKeybindingState | undefined> {\n\t\tif (!this.keybindings) {\n\t\t\tawait session.reload();\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst previousUserBindings = this.keybindings.getUserBindings();\n\t\tlet keybindingsApplied = false;\n\t\ttry {\n\t\t\tawait session.reload({\n\t\t\t\tbeforeSessionStart: () => {\n\t\t\t\t\tthis.keybindings!.reload();\n\t\t\t\t\tkeybindingsApplied = true;\n\t\t\t\t},\n\t\t\t});\n\t\t\treturn this.publishCurrentState(session);\n\t\t} catch (error) {\n\t\t\tif (keybindingsApplied) this.keybindings.setUserBindings(previousUserBindings);\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n\n/** Compatibility helper for callers that do not share a longer-lived queue. */\nexport async function reloadSessionWithKeybindings(\n\tsession: ReloadableSession,\n\tkeybindings: KeybindingsManager | undefined,\n\tonKeybindingsReloaded?: () => void,\n): Promise<void> {\n\tconst coordinator = new KeybindingsReloadCoordinator(\n\t\tkeybindings,\n\t\tonKeybindingsReloaded ? () => onKeybindingsReloaded() : undefined,\n\t);\n\tawait coordinator.reload(session);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-mode.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"rpc-mode.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAqB/E,YAAY,EACX,UAAU,EACV,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,WAAW,EACX,eAAe,GACf,MAAM,gBAAgB,CAAC;AAExB;;;GAGG;AACH,wBAAsB,UAAU,CAAC,WAAW,EAAE,mBAAmB,GAAG,OAAO,CAAC,KAAK,CAAC,CAqJjF"}
|