@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
|
@@ -88,6 +88,9 @@ export interface WorkflowRuntimeConfig {
|
|
|
88
88
|
readonly statusFile: boolean;
|
|
89
89
|
readonly statusFilePath?: string;
|
|
90
90
|
readonly resumeInFlight: "ask" | "auto" | "never";
|
|
91
|
+
readonly worktree?: {
|
|
92
|
+
readonly symlinkDirectories: readonly string[];
|
|
93
|
+
};
|
|
91
94
|
}
|
|
92
95
|
export interface WorkflowWorktreeInputBinding {
|
|
93
96
|
readonly gitWorktreeDir: string;
|
|
@@ -191,6 +194,8 @@ export interface WorkflowDetails extends WorkflowSerializableObject {
|
|
|
191
194
|
readonly controlEvents?: readonly WorkflowControlEvent[];
|
|
192
195
|
readonly intercom?: WorkflowIntercomSummary;
|
|
193
196
|
readonly warnings?: readonly string[];
|
|
197
|
+
/** Actionable user guidance for accepted background execution. */
|
|
198
|
+
readonly message?: string;
|
|
194
199
|
readonly error?: string;
|
|
195
200
|
/** True when the run reached its terminal status through ctx.exit(). */
|
|
196
201
|
readonly exited?: boolean;
|
|
@@ -148,6 +148,9 @@ export interface WorkflowRuntimeConfig {
|
|
|
148
148
|
readonly statusFile: boolean;
|
|
149
149
|
readonly statusFilePath?: string;
|
|
150
150
|
readonly resumeInFlight: "ask" | "auto" | "never";
|
|
151
|
+
readonly worktree?: {
|
|
152
|
+
readonly symlinkDirectories: readonly string[];
|
|
153
|
+
};
|
|
151
154
|
}
|
|
152
155
|
|
|
153
156
|
export interface WorkflowWorktreeInputBinding {
|
|
@@ -268,6 +271,8 @@ export interface WorkflowDetails extends WorkflowSerializableObject {
|
|
|
268
271
|
readonly controlEvents?: readonly WorkflowControlEvent[];
|
|
269
272
|
readonly intercom?: WorkflowIntercomSummary;
|
|
270
273
|
readonly warnings?: readonly string[];
|
|
274
|
+
/** Actionable user guidance for accepted background execution. */
|
|
275
|
+
readonly message?: string;
|
|
271
276
|
readonly error?: string;
|
|
272
277
|
/** True when the run reached its terminal status through ctx.exit(). */
|
|
273
278
|
readonly exited?: boolean;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import type { StageOptions } from "./types.js";
|
|
3
|
+
|
|
4
|
+
/** The implicit group shared by every ungrouped session. */
|
|
5
|
+
export const DEFAULT_INTERCOM_GROUP = "default";
|
|
6
|
+
|
|
7
|
+
/** Normalize authored or agent-serialized auto-group sentinels without changing real group names. */
|
|
8
|
+
export function normalizeAutoGroupSentinel(group: string | true): string | true {
|
|
9
|
+
if (group === true) return true;
|
|
10
|
+
const sentinel = group.trim().toLowerCase();
|
|
11
|
+
return sentinel === "true" || sentinel === "auto" ? true : group;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Trim; empty/undefined collapses to the shared default group. */
|
|
15
|
+
export function normalizeGroup(value?: string | null): string {
|
|
16
|
+
if (typeof value !== "string") return DEFAULT_INTERCOM_GROUP;
|
|
17
|
+
const trimmed = value.trim();
|
|
18
|
+
return trimmed.length > 0 ? trimmed : DEFAULT_INTERCOM_GROUP;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Resolve a stage's `group` option to a concrete home-group string, or undefined
|
|
23
|
+
* when the stage did not request a group (so the intercom layer falls back to
|
|
24
|
+
* env/config/default). A named string is trimmed; a bare `true` that survives to
|
|
25
|
+
* this point (a single, non-parallel stage) mints one fresh UUID for that stage.
|
|
26
|
+
* Parallel sets resolve `true` to one shared UUID upstream, so it never reaches
|
|
27
|
+
* here as `true`.
|
|
28
|
+
*/
|
|
29
|
+
export function resolveStageGroup(stageOptions?: { group?: string | true }): string | undefined {
|
|
30
|
+
if (!stageOptions) return undefined;
|
|
31
|
+
const group = stageOptions.group;
|
|
32
|
+
if (group === undefined) return undefined;
|
|
33
|
+
if (group === true) return randomUUID();
|
|
34
|
+
const trimmed = group.trim();
|
|
35
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Whether a stage session will actually have an intercom tool available. Group
|
|
40
|
+
* assignment is skipped for stages without intercom access so an agent is never
|
|
41
|
+
* placed into an isolated group it cannot use.
|
|
42
|
+
*/
|
|
43
|
+
export function stageHasIntercomAccess(stageOptions?: StageOptions): boolean {
|
|
44
|
+
if (!stageOptions) return true;
|
|
45
|
+
if (stageOptions.noTools === "all" || stageOptions.noTools === "builtin") return false;
|
|
46
|
+
const tools = stageOptions.tools;
|
|
47
|
+
if (Array.isArray(tools) && !tools.includes("intercom")) return false;
|
|
48
|
+
const excluded = stageOptions.excludedTools;
|
|
49
|
+
if (Array.isArray(excluded) && excluded.includes("intercom")) return false;
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
@@ -357,6 +357,7 @@ export function restoreTerminalRuns(entries: readonly SessionEntry[], store: Sto
|
|
|
357
357
|
...(runMeta.rootRunId !== undefined ? { rootRunId: runMeta.rootRunId } : {}),
|
|
358
358
|
...(runMeta.resumedFromRunId !== undefined ? { resumedFromRunId: runMeta.resumedFromRunId } : {}),
|
|
359
359
|
...(runMeta.resumeFromStageId !== undefined ? { resumeFromStageId: runMeta.resumeFromStageId } : {}),
|
|
360
|
+
...(runMeta.accumulatedDurationMs !== undefined ? { accumulatedDurationMs: runMeta.accumulatedDurationMs } : {}),
|
|
360
361
|
});
|
|
361
362
|
|
|
362
363
|
const error = end["error"];
|
|
@@ -425,6 +426,7 @@ export function findRunStartMetadata(
|
|
|
425
426
|
readonly rootRunId?: string;
|
|
426
427
|
readonly resumedFromRunId?: string;
|
|
427
428
|
readonly resumeFromStageId?: string;
|
|
429
|
+
readonly accumulatedDurationMs?: number;
|
|
428
430
|
} {
|
|
429
431
|
for (const entry of entries) {
|
|
430
432
|
if (entry.type !== "workflow.run.start" || entry.payload["runId"] !== runId) continue;
|
|
@@ -433,12 +435,16 @@ export function findRunStartMetadata(
|
|
|
433
435
|
const rootRunId = entry.payload["rootRunId"];
|
|
434
436
|
const resumedFromRunId = entry.payload["resumedFromRunId"];
|
|
435
437
|
const resumeFromStageId = entry.payload["resumeFromStageId"];
|
|
438
|
+
const accumulatedDurationMs = entry.payload["accumulatedDurationMs"];
|
|
436
439
|
return {
|
|
437
440
|
...(typeof parentRunId === "string" ? { parentRunId } : {}),
|
|
438
441
|
...(typeof parentStageId === "string" ? { parentStageId } : {}),
|
|
439
442
|
...(typeof rootRunId === "string" ? { rootRunId } : {}),
|
|
440
443
|
...(typeof resumedFromRunId === "string" ? { resumedFromRunId } : {}),
|
|
441
444
|
...(typeof resumeFromStageId === "string" ? { resumeFromStageId } : {}),
|
|
445
|
+
...(typeof accumulatedDurationMs === "number" && Number.isFinite(accumulatedDurationMs) && accumulatedDurationMs > 0
|
|
446
|
+
? { accumulatedDurationMs }
|
|
447
|
+
: {}),
|
|
442
448
|
};
|
|
443
449
|
}
|
|
444
450
|
return {};
|
|
@@ -55,6 +55,7 @@ export function normalizeSessionEntries(entries: readonly SessionEntry[]): reado
|
|
|
55
55
|
|
|
56
56
|
/** Structural type for pi's sessionManager (optional — degrades gracefully). */
|
|
57
57
|
export interface SessionManager {
|
|
58
|
+
getCwd?: () => string;
|
|
58
59
|
getEntries?: () => SessionEntry[] | readonly SessionEntry[];
|
|
59
60
|
getSessionDir?: () => string;
|
|
60
61
|
usesDefaultSessionDir?: () => boolean;
|
|
@@ -210,6 +211,7 @@ export function restoreOnSessionStart(
|
|
|
210
211
|
...(runMeta.rootRunId !== undefined ? { rootRunId: runMeta.rootRunId } : {}),
|
|
211
212
|
...(runMeta.resumedFromRunId !== undefined ? { resumedFromRunId: runMeta.resumedFromRunId } : {}),
|
|
212
213
|
...(runMeta.resumeFromStageId !== undefined ? { resumeFromStageId: runMeta.resumeFromStageId } : {}),
|
|
214
|
+
...(runMeta.accumulatedDurationMs !== undefined ? { accumulatedDurationMs: runMeta.accumulatedDurationMs } : {}),
|
|
213
215
|
};
|
|
214
216
|
store.recordRunStart(runSnapshot);
|
|
215
217
|
store.recordRunBlocked(run.runId, blockedMeta.error, {
|
|
@@ -240,6 +242,7 @@ export function restoreOnSessionStart(
|
|
|
240
242
|
...(runMeta.rootRunId !== undefined ? { rootRunId: runMeta.rootRunId } : {}),
|
|
241
243
|
...(runMeta.resumedFromRunId !== undefined ? { resumedFromRunId: runMeta.resumedFromRunId } : {}),
|
|
242
244
|
...(runMeta.resumeFromStageId !== undefined ? { resumeFromStageId: runMeta.resumeFromStageId } : {}),
|
|
245
|
+
...(runMeta.accumulatedDurationMs !== undefined ? { accumulatedDurationMs: runMeta.accumulatedDurationMs } : {}),
|
|
243
246
|
};
|
|
244
247
|
store.recordRunStart(runSnapshot);
|
|
245
248
|
callbacks.onResume?.(run);
|
|
@@ -261,6 +264,7 @@ export function restoreOnSessionStart(
|
|
|
261
264
|
...(runMeta.rootRunId !== undefined ? { rootRunId: runMeta.rootRunId } : {}),
|
|
262
265
|
...(runMeta.resumedFromRunId !== undefined ? { resumedFromRunId: runMeta.resumedFromRunId } : {}),
|
|
263
266
|
...(runMeta.resumeFromStageId !== undefined ? { resumeFromStageId: runMeta.resumeFromStageId } : {}),
|
|
267
|
+
...(runMeta.accumulatedDurationMs !== undefined ? { accumulatedDurationMs: runMeta.accumulatedDurationMs } : {}),
|
|
264
268
|
};
|
|
265
269
|
store.recordRunStart(runSnapshot);
|
|
266
270
|
store.recordRunEnd(run.runId, "failed");
|
|
@@ -43,6 +43,8 @@ export interface RunStartPayload {
|
|
|
43
43
|
readonly rootRunId?: string;
|
|
44
44
|
readonly resumedFromRunId?: string;
|
|
45
45
|
readonly resumeFromStageId?: string;
|
|
46
|
+
/** Elapsed ms inherited from prior sessions of a resumed run. */
|
|
47
|
+
readonly accumulatedDurationMs?: number;
|
|
46
48
|
readonly ts: number;
|
|
47
49
|
}
|
|
48
50
|
|
|
@@ -150,6 +152,7 @@ export function appendRunStart(api: PersistenceAPI, payload: RunStartPayload): v
|
|
|
150
152
|
...(payload.rootRunId !== undefined ? { rootRunId: payload.rootRunId } : {}),
|
|
151
153
|
...(payload.resumedFromRunId !== undefined ? { resumedFromRunId: payload.resumedFromRunId } : {}),
|
|
152
154
|
...(payload.resumeFromStageId !== undefined ? { resumeFromStageId: payload.resumeFromStageId } : {}),
|
|
155
|
+
...(payload.accumulatedDurationMs !== undefined ? { accumulatedDurationMs: payload.accumulatedDurationMs } : {}),
|
|
153
156
|
ts: payload.ts,
|
|
154
157
|
});
|
|
155
158
|
if (entryId && typeof api.setLabel === "function") {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
|
|
3
|
+
const promptCallerStacks = new AsyncLocalStorage<string>();
|
|
4
|
+
|
|
5
|
+
/** Preserve the workflow-author stack across durable writes before a prompt delegates. */
|
|
6
|
+
export function withPromptCallerStack<T>(stack: string | undefined, delegate: () => T): T {
|
|
7
|
+
if (stack === undefined) return delegate();
|
|
8
|
+
return promptCallerStacks.run(stack, delegate);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function currentPromptCallerStack(): string | undefined {
|
|
12
|
+
return promptCallerStacks.getStore();
|
|
13
|
+
}
|
|
@@ -73,8 +73,9 @@ export function structuredRecoverableWorkflowFailureText(
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
export function effectiveRunStatus(run: RunSnapshot): RunStatus {
|
|
76
|
+
if ((run.status === "running" || run.status === "completed")
|
|
77
|
+
&& structuredRecoverableWorkflowFailure(run) !== undefined) return "blocked";
|
|
76
78
|
if (run.status !== "completed") return run.status;
|
|
77
|
-
if (structuredRecoverableWorkflowFailure(run) !== undefined) return "blocked";
|
|
78
79
|
const returnedStatus = normalizeReturnedWorkflowStatus(run.result?.["status"]);
|
|
79
80
|
if (returnedStatus === "failed") return "failed";
|
|
80
81
|
if (returnedStatus !== undefined && isReturnedBlockedWorkflowStatus(returnedStatus)) return "blocked";
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared retained-session transcript validation.
|
|
3
|
+
*
|
|
4
|
+
* A stage snapshot's `sessionFile` is only reopenable as a post-mortem chat
|
|
5
|
+
* when the referenced path is an existing, readable, regular file whose JSONL
|
|
6
|
+
* contents parse into a genuine Atomic session with at least one usable
|
|
7
|
+
* context-bearing message. This guards the completed-workflow catalog and the
|
|
8
|
+
* post-mortem stage-chat resolver against blank / missing / truncated
|
|
9
|
+
* transcripts, and prevents `SessionManager.open()` from turning a missing path
|
|
10
|
+
* into an empty session.
|
|
11
|
+
*
|
|
12
|
+
* cross-ref:
|
|
13
|
+
* - src/durable/completed-catalog.ts (catalog eligibility)
|
|
14
|
+
* - src/runs/foreground/postmortem-stage-chat.ts (revival eligibility)
|
|
15
|
+
*/
|
|
16
|
+
import { readFileSync, statSync } from "node:fs";
|
|
17
|
+
|
|
18
|
+
interface SessionTranscriptEntry {
|
|
19
|
+
readonly type?: string;
|
|
20
|
+
readonly id?: string;
|
|
21
|
+
readonly timestamp?: string;
|
|
22
|
+
readonly message?: {
|
|
23
|
+
readonly role?: string;
|
|
24
|
+
readonly content?: string | object;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* True when `path` points at a readable regular file containing a parseable
|
|
30
|
+
* Atomic session header plus at least one usable context message.
|
|
31
|
+
*/
|
|
32
|
+
export function isReopenableSessionTranscript(path: string): boolean {
|
|
33
|
+
try {
|
|
34
|
+
const stats = statSync(path);
|
|
35
|
+
if (!stats.isFile() || stats.size === 0) return false;
|
|
36
|
+
const lines = readFileSync(path, "utf8").split("\n").filter((line) => line.trim().length > 0);
|
|
37
|
+
if (lines.length < 2) return false;
|
|
38
|
+
const entries: SessionTranscriptEntry[] = [];
|
|
39
|
+
for (const line of lines) {
|
|
40
|
+
const parsed = JSON.parse(line) as object;
|
|
41
|
+
if (typeof parsed !== "object" || parsed === null) return false;
|
|
42
|
+
entries.push(parsed as SessionTranscriptEntry);
|
|
43
|
+
}
|
|
44
|
+
const header = entries[0];
|
|
45
|
+
return header?.type === "session" && typeof header.id === "string" && entries.some(isUsableContextMessage);
|
|
46
|
+
} catch {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function isUsableContextMessage(entry: SessionTranscriptEntry): boolean {
|
|
52
|
+
return entry.type === "message"
|
|
53
|
+
&& typeof entry.id === "string"
|
|
54
|
+
&& typeof entry.timestamp === "string"
|
|
55
|
+
&& typeof entry.message?.role === "string"
|
|
56
|
+
&& hasUsableMessageContent(entry.message.content);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function hasUsableMessageContent(content: string | object | undefined): boolean {
|
|
60
|
+
if (typeof content === "string") return content.trim().length > 0;
|
|
61
|
+
return Array.isArray(content) && content.some(hasUsableContentBlock);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function hasUsableContentBlock(block: object): boolean {
|
|
65
|
+
if (typeof block !== "object" || block === null) return false;
|
|
66
|
+
const contentBlock = block as {
|
|
67
|
+
readonly text?: string;
|
|
68
|
+
readonly thinking?: string;
|
|
69
|
+
readonly data?: string;
|
|
70
|
+
readonly name?: string;
|
|
71
|
+
};
|
|
72
|
+
return [contentBlock.text, contentBlock.thinking, contentBlock.data, contentBlock.name]
|
|
73
|
+
.some((value) => typeof value === "string" && value.trim().length > 0);
|
|
74
|
+
}
|
|
@@ -286,6 +286,7 @@ export function createStageStoreMethods(context: StoreContext): StageStoreMethod
|
|
|
286
286
|
recordStageResumed(runId: string, stageId: string, resumedAt?: number): boolean {
|
|
287
287
|
const run = context.findRun(runId);
|
|
288
288
|
if (!run) return false;
|
|
289
|
+
if (TERMINAL_STATUSES.has(run.status)) return false;
|
|
289
290
|
const stage = context.findStage(run, stageId);
|
|
290
291
|
if (!stage) return false;
|
|
291
292
|
if (stage.status !== "paused" && stage.status !== "blocked") return false;
|
|
@@ -142,6 +142,8 @@ export interface StageSnapshot {
|
|
|
142
142
|
* refreshes parents, so do not cache this reference across store updates.
|
|
143
143
|
*/
|
|
144
144
|
parentIds: readonly string[];
|
|
145
|
+
/** Set when durable inspection cannot safely determine the original stage lineage. */
|
|
146
|
+
topologyState?: "unavailable";
|
|
145
147
|
startedAt?: number;
|
|
146
148
|
endedAt?: number;
|
|
147
149
|
durationMs?: number;
|
|
@@ -238,6 +240,12 @@ export interface RunSnapshot {
|
|
|
238
240
|
startedAt: number;
|
|
239
241
|
endedAt?: number;
|
|
240
242
|
durationMs?: number;
|
|
243
|
+
/**
|
|
244
|
+
* Elapsed milliseconds inherited from prior sessions of this run. Seeded on
|
|
245
|
+
* durable/continuation resume so `elapsedRunMs` reports prior + current
|
|
246
|
+
* elapsed instead of restarting the total workflow duration at zero.
|
|
247
|
+
*/
|
|
248
|
+
accumulatedDurationMs?: number;
|
|
241
249
|
/** Milliseconds spent paused across completed pause intervals. */
|
|
242
250
|
pausedDurationMs?: number;
|
|
243
251
|
/** Timestamp set when a controlled pause begins; cleared on resume. */
|
|
@@ -12,6 +12,8 @@ interface RunTimerSnapshot {
|
|
|
12
12
|
readonly durationMs?: number;
|
|
13
13
|
readonly pausedDurationMs?: number;
|
|
14
14
|
readonly pausedAt?: number;
|
|
15
|
+
/** Elapsed ms inherited from prior sessions of a resumed durable run. */
|
|
16
|
+
readonly accumulatedDurationMs?: number;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
function nonNegative(ms: number): number {
|
|
@@ -52,5 +54,6 @@ export function elapsedStageMs(stage: StageTimerSnapshot, now = Date.now()): num
|
|
|
52
54
|
export function elapsedRunMs(run: RunTimerSnapshot, now = Date.now()): number {
|
|
53
55
|
if (run.durationMs !== undefined) return nonNegative(run.durationMs);
|
|
54
56
|
const effectiveNow = run.endedAt ?? now;
|
|
55
|
-
return
|
|
57
|
+
return nonNegative(run.accumulatedDurationMs ?? 0)
|
|
58
|
+
+ elapsedFromStart(run.startedAt, effectiveNow, run.pausedDurationMs, run.pausedAt);
|
|
56
59
|
}
|
|
@@ -216,6 +216,8 @@ export interface StageExecutionMeta {
|
|
|
216
216
|
signal?: AbortSignal;
|
|
217
217
|
/** Runtime execution mode for policy-aware child sessions. */
|
|
218
218
|
executionMode?: WorkflowExecutionMode;
|
|
219
|
+
/** Internal stage-generation context reused across model-fallback sessions. */
|
|
220
|
+
orchestrationContext?: CreateAgentSessionOptions["orchestrationContext"];
|
|
219
221
|
}
|
|
220
222
|
|
|
221
223
|
export interface CompleteStageOpts extends WorkflowModelFallbackFields {
|
|
@@ -289,12 +291,6 @@ export type WorkflowAction = AuthoringContract.WorkflowAction;
|
|
|
289
291
|
export type WorkflowDetails = Mutable<AuthoringContract.WorkflowDetails>;
|
|
290
292
|
export type WorkflowTaskSessionFields = Mutable<AuthoringContract.WorkflowTaskSessionFields>;
|
|
291
293
|
export type WorkflowTaskSessionOptions = StageOptions & WorkflowTaskSessionFields;
|
|
292
|
-
export interface WorkflowDirectTaskItem extends WorkflowTaskOptions, Omit<Mutable<AuthoringContract.WorkflowDirectTaskItem>, keyof AuthoringContract.WorkflowTaskOptions> {}
|
|
293
|
-
export interface WorkflowParallelChainStep extends Omit<AuthoringContract.WorkflowParallelChainStep, "parallel"> {
|
|
294
|
-
readonly parallel: readonly WorkflowDirectTaskItem[];
|
|
295
|
-
}
|
|
296
|
-
export type WorkflowChainStep = WorkflowDirectTaskItem | WorkflowParallelChainStep;
|
|
297
|
-
export interface WorkflowDirectOptions extends StageOptions, Omit<Mutable<AuthoringContract.WorkflowDirectOptions>, keyof AuthoringContract.StageOptions> {}
|
|
298
294
|
|
|
299
295
|
// ---------------------------------------------------------------------------
|
|
300
296
|
// Stage context (provided to ctx.stage() calls)
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
import type { ExtensionAPI } from "../extension/index.js";
|
|
29
29
|
import type { RunDetail } from "../runs/background/status.js";
|
|
30
|
-
import type { RunSnapshot
|
|
30
|
+
import type { RunSnapshot } from "../shared/store-types.js";
|
|
31
31
|
import type { WorkflowInputValues } from "../shared/types.js";
|
|
32
32
|
import type { GraphTheme } from "./graph-theme.js";
|
|
33
33
|
import type { WorkflowListEntry } from "./workflow-list.js";
|
|
@@ -35,7 +35,6 @@ import { renderDispatchConfirm } from "./dispatch-confirm.js";
|
|
|
35
35
|
import { renderRunDetail } from "./run-detail.js";
|
|
36
36
|
import { renderStatusList } from "./status-list.js";
|
|
37
37
|
import { renderWorkflowList } from "./workflow-list.js";
|
|
38
|
-
import { renderWorkflowKilledNotice } from "./session-confirm.js";
|
|
39
38
|
|
|
40
39
|
/** Custom message type wired to {@link registerChatSurfaceRenderer}. */
|
|
41
40
|
export const CHAT_SURFACE_CUSTOM_TYPE = "workflows:chat-surface";
|
|
@@ -82,19 +81,11 @@ export interface DetailPayload {
|
|
|
82
81
|
detail: RunDetail;
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
/** Inline notice after a workflow run is killed and retained for inspection. */
|
|
86
|
-
export interface KilledPayload {
|
|
87
|
-
kind: "killed";
|
|
88
|
-
run: RunSnapshot;
|
|
89
|
-
previousStatus: RunStatus;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
84
|
export type ChatSurfacePayload =
|
|
93
85
|
| DispatchPayload
|
|
94
86
|
| StatusPayload
|
|
95
87
|
| ListPayload
|
|
96
|
-
| DetailPayload
|
|
97
|
-
| KilledPayload;
|
|
88
|
+
| DetailPayload;
|
|
98
89
|
|
|
99
90
|
// ---------------------------------------------------------------------------
|
|
100
91
|
// Renderer registration
|
|
@@ -218,16 +209,6 @@ export function renderChatSurfacePlainText(
|
|
|
218
209
|
}
|
|
219
210
|
return lines.join("\n");
|
|
220
211
|
}
|
|
221
|
-
case "killed":
|
|
222
|
-
if (options.theme !== undefined) {
|
|
223
|
-
return renderWorkflowKilledNotice({
|
|
224
|
-
width: width ?? 80,
|
|
225
|
-
theme: options.theme,
|
|
226
|
-
run: payload.run,
|
|
227
|
-
previousStatus: payload.previousStatus,
|
|
228
|
-
}).join("\n");
|
|
229
|
-
}
|
|
230
|
-
return renderKilledPlainText(payload);
|
|
231
212
|
}
|
|
232
213
|
}
|
|
233
214
|
|
|
@@ -274,20 +255,6 @@ function formatWorkflowEntryPlain(entry: WorkflowListEntry): string {
|
|
|
274
255
|
return `workflow: ${entry.name} · description: ${entry.description} · ${inputSummary}`;
|
|
275
256
|
}
|
|
276
257
|
|
|
277
|
-
function renderKilledPlainText(payload: KilledPayload): string {
|
|
278
|
-
const run = payload.run;
|
|
279
|
-
const stageCount = run.stages.length;
|
|
280
|
-
const runningStages = run.stages.filter((stage) => stage.status === "running").length;
|
|
281
|
-
return [
|
|
282
|
-
"Workflow killed",
|
|
283
|
-
`workflow: ${run.name}`,
|
|
284
|
-
`run id: ${run.id}`,
|
|
285
|
-
`status: ${payload.previousStatus} → killed`,
|
|
286
|
-
`active stages: ${runningStages}/${stageCount}`,
|
|
287
|
-
`inspect: /workflow status ${run.id}`,
|
|
288
|
-
].join("\n");
|
|
289
|
-
}
|
|
290
|
-
|
|
291
258
|
function formatPlainRecord(record: Readonly<WorkflowInputValues>): string {
|
|
292
259
|
const entries = Object.entries(record);
|
|
293
260
|
if (entries.length === 0) return "(none)";
|
|
@@ -353,12 +320,5 @@ function renderPayload(
|
|
|
353
320
|
return renderWorkflowList(payload.entries, { theme, width });
|
|
354
321
|
case "detail":
|
|
355
322
|
return renderRunDetail(payload.detail, { theme, width, now });
|
|
356
|
-
case "killed":
|
|
357
|
-
return renderWorkflowKilledNotice({
|
|
358
|
-
width,
|
|
359
|
-
theme,
|
|
360
|
-
run: payload.run,
|
|
361
|
-
previousStatus: payload.previousStatus,
|
|
362
|
-
}).join("\n");
|
|
363
323
|
}
|
|
364
324
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* title: runId8 · workflowName · ● running
|
|
9
9
|
* body: compact `k=v · k=v · +N more` input summary when present
|
|
10
10
|
* - One compact next-step hint:
|
|
11
|
-
* ▸ /workflow connect <id>
|
|
11
|
+
* ▸ /workflow connect <id> see agents working · chat with and steer each stage
|
|
12
12
|
*
|
|
13
13
|
* What we deliberately do NOT emit (was in the legacy 7-row layout):
|
|
14
14
|
* - the `✓ submitted · /workflow <name>` echo line — pi already shows
|
|
@@ -143,7 +143,7 @@ export function renderDispatchConfirm(opts: RenderDispatchConfirmOpts): string {
|
|
|
143
143
|
const titleLine = ` ● ${tag} ${opts.workflowName} ${trailing.text} `;
|
|
144
144
|
|
|
145
145
|
const hints = renderHintRows([
|
|
146
|
-
{ command: `/workflow connect ${tag}`, hint: "
|
|
146
|
+
{ command: `/workflow connect ${tag}`, hint: "see agents working · chat with and steer each stage" },
|
|
147
147
|
], theme)
|
|
148
148
|
.split("\n")
|
|
149
149
|
.map((line) => ` ${line} `);
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
export const HINT_KEYS: Array<{ key: string; label: string }> = [
|
|
2
|
+
{ key: "ctrl+x", label: "return to main chat" },
|
|
3
|
+
{ key: "↵", label: "open stage chat" },
|
|
2
4
|
{ key: "↑↓←→", label: "navigate" },
|
|
3
|
-
{ key: "↵", label: "attach" },
|
|
4
5
|
{ key: "/", label: "stages" },
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
];
|
|
7
|
+
|
|
8
|
+
export const COMPACT_HINT_KEYS: Array<{ key: string; label: string }> = [
|
|
9
|
+
{ key: "ctrl+x", label: "return to main chat" },
|
|
10
|
+
{ key: "↵", label: "stage chat" },
|
|
7
11
|
];
|
|
8
12
|
|
|
9
13
|
/**
|
|
@@ -5,6 +5,11 @@ import {
|
|
|
5
5
|
} from "./graph-view-constants.js";
|
|
6
6
|
import { GraphViewRenderer } from "./graph-view-render.js";
|
|
7
7
|
import { isKeybindingsLike, type KeybindingsLike } from "./keybindings-adapter.js";
|
|
8
|
+
import {
|
|
9
|
+
isTerminalLeftMousePress,
|
|
10
|
+
parseTerminalMouseInput,
|
|
11
|
+
terminalMouseWheelDirection,
|
|
12
|
+
} from "./mouse-input.js";
|
|
8
13
|
import {
|
|
9
14
|
defaultResponseFor,
|
|
10
15
|
handlePromptCardInput,
|
|
@@ -12,12 +17,6 @@ import {
|
|
|
12
17
|
import { filterStages, type SwitcherState } from "./switcher.js";
|
|
13
18
|
import { Key, matchesKey } from "./text-helpers.js";
|
|
14
19
|
|
|
15
|
-
interface SgrMouseEvent {
|
|
16
|
-
buttonCode: number;
|
|
17
|
-
col: number;
|
|
18
|
-
row: number;
|
|
19
|
-
final: "M" | "m";
|
|
20
|
-
}
|
|
21
20
|
|
|
22
21
|
interface MouseWheelDelta {
|
|
23
22
|
cols: number;
|
|
@@ -28,6 +27,10 @@ interface MouseWheelDelta {
|
|
|
28
27
|
export abstract class GraphViewInputController extends GraphViewRenderer {
|
|
29
28
|
/** Returns true if consumed. */
|
|
30
29
|
handleInput(data: string): boolean {
|
|
30
|
+
if (this._isReturnToMainChatInput(data)) {
|
|
31
|
+
this._returnToMainChat();
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
31
34
|
if (this.switcherOpen) {
|
|
32
35
|
return this._handleSwitcherInput(data);
|
|
33
36
|
}
|
|
@@ -52,7 +55,16 @@ export abstract class GraphViewInputController extends GraphViewRenderer {
|
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
private _isNonTextGraphControlBeforePrompt(data: string): boolean {
|
|
55
|
-
return this._mouseWheelDelta(data) !== null
|
|
58
|
+
return this._mouseWheelDelta(data) !== null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private _isReturnToMainChatInput(data: string): boolean {
|
|
62
|
+
return matchesKey(data, Key.ctrl("x"));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
private _returnToMainChat(): void {
|
|
66
|
+
if (this.onDetach) this.onDetach();
|
|
67
|
+
else this.onHide?.();
|
|
56
68
|
}
|
|
57
69
|
|
|
58
70
|
private _handlePromptInput(data: string): boolean {
|
|
@@ -138,27 +150,6 @@ export abstract class GraphViewInputController extends GraphViewRenderer {
|
|
|
138
150
|
this._activateFocusedNode();
|
|
139
151
|
return true;
|
|
140
152
|
}
|
|
141
|
-
// `ctrl+d` detaches the whole popup (host hides the overlay). This
|
|
142
|
-
// is the graph-mode counterpart of the in-chat back affordance.
|
|
143
|
-
if (matchesKey(data, Key.ctrl("d"))) {
|
|
144
|
-
if (this.onDetach) {
|
|
145
|
-
this.onDetach();
|
|
146
|
-
} else if (this.onHide) {
|
|
147
|
-
this.onHide();
|
|
148
|
-
}
|
|
149
|
-
return true;
|
|
150
|
-
}
|
|
151
|
-
// `q` quits/detaches the orchestrator view without authoritatively
|
|
152
|
-
// killing the workflow. The workflow remains resumable via
|
|
153
|
-
// `/workflow resume`; use `/workflow kill` for non-resumable disposal.
|
|
154
|
-
if (matchesKey(data, "q")) {
|
|
155
|
-
const run = this._getCurrentRun();
|
|
156
|
-
if (run && run.endedAt === undefined && this.onQuit) {
|
|
157
|
-
this.onQuit(run.id);
|
|
158
|
-
}
|
|
159
|
-
this.onClose?.();
|
|
160
|
-
return true;
|
|
161
|
-
}
|
|
162
153
|
if (matchesKey(data, "h") && this.onHide) {
|
|
163
154
|
this.onHide();
|
|
164
155
|
return true;
|
|
@@ -336,52 +327,23 @@ export abstract class GraphViewInputController extends GraphViewRenderer {
|
|
|
336
327
|
return null;
|
|
337
328
|
}
|
|
338
329
|
|
|
339
|
-
private _parseSgrMouse(data: string): SgrMouseEvent | null {
|
|
340
|
-
const sgr = data.match(/^\x1b\[<(\d+);(\d+);(\d+)([Mm])$/);
|
|
341
|
-
if (!sgr) return null;
|
|
342
|
-
const oneBasedCol = Number.parseInt(sgr[2]!, 10);
|
|
343
|
-
const oneBasedRow = Number.parseInt(sgr[3]!, 10);
|
|
344
|
-
const final = sgr[4];
|
|
345
|
-
if (oneBasedCol < 1 || oneBasedRow < 1) return null;
|
|
346
|
-
if (final !== "M" && final !== "m") return null;
|
|
347
|
-
return {
|
|
348
|
-
buttonCode: Number.parseInt(sgr[1]!, 10),
|
|
349
|
-
col: oneBasedCol - 1,
|
|
350
|
-
row: oneBasedRow - 1,
|
|
351
|
-
final,
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
|
|
355
330
|
private _sgrLeftMousePress(data: string): { col: number; row: number } | null {
|
|
356
|
-
const
|
|
357
|
-
if (!
|
|
358
|
-
|
|
359
|
-
if ((buttonCode & 64) !== 0 || (buttonCode & 32) !== 0 || (buttonCode & 3) !== 0) {
|
|
360
|
-
return null;
|
|
361
|
-
}
|
|
362
|
-
return { col: sgr.col, row: sgr.row };
|
|
331
|
+
const event = parseTerminalMouseInput(data);
|
|
332
|
+
if (!event || event.protocol !== "sgr" || !isTerminalLeftMousePress(event)) return null;
|
|
333
|
+
return { col: event.col, row: event.row };
|
|
363
334
|
}
|
|
364
335
|
|
|
365
336
|
private _mouseWheelDelta(data: string): MouseWheelDelta | null {
|
|
366
|
-
const
|
|
367
|
-
if (
|
|
368
|
-
|
|
369
|
-
}
|
|
370
|
-
if (
|
|
371
|
-
|
|
372
|
-
}
|
|
337
|
+
const event = parseTerminalMouseInput(data);
|
|
338
|
+
if (!event) return null;
|
|
339
|
+
const direction = terminalMouseWheelDirection(event);
|
|
340
|
+
if (direction === "up") return { cols: 0, rows: -GRAPH_SCROLL_STEP_ROWS };
|
|
341
|
+
if (direction === "down") return { cols: 0, rows: GRAPH_SCROLL_STEP_ROWS };
|
|
342
|
+
if (direction === "left") return { cols: -GRAPH_SCROLL_STEP_COLS, rows: 0 };
|
|
343
|
+
if (direction === "right") return { cols: GRAPH_SCROLL_STEP_COLS, rows: 0 };
|
|
373
344
|
return null;
|
|
374
345
|
}
|
|
375
346
|
|
|
376
|
-
private _wheelDeltaForButtonCode(code: number): MouseWheelDelta | null {
|
|
377
|
-
if ((code & 64) === 0) return null;
|
|
378
|
-
const direction = code & 3;
|
|
379
|
-
if (direction === 0) return { cols: 0, rows: -GRAPH_SCROLL_STEP_ROWS };
|
|
380
|
-
if (direction === 1) return { cols: 0, rows: GRAPH_SCROLL_STEP_ROWS };
|
|
381
|
-
if (direction === 2) return { cols: -GRAPH_SCROLL_STEP_COLS, rows: 0 };
|
|
382
|
-
return { cols: GRAPH_SCROLL_STEP_COLS, rows: 0 };
|
|
383
|
-
}
|
|
384
|
-
|
|
385
347
|
// ---- test seams ----
|
|
386
348
|
get _focusedIndex(): number {
|
|
387
349
|
return this.focusedIndex;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GraphCanvas } from "./graph-canvas.js";
|
|
2
2
|
import {
|
|
3
|
+
COMPACT_HINT_KEYS,
|
|
3
4
|
HINT_KEYS,
|
|
4
5
|
MODE_PILL_LABEL,
|
|
5
6
|
OVERLAY_LINE_COUNT,
|
|
@@ -105,22 +106,26 @@ export abstract class GraphViewRenderHelpers extends GraphViewState {
|
|
|
105
106
|
bot,
|
|
106
107
|
visibleWidth: pillW,
|
|
107
108
|
} = renderOutlinePill(MODE_PILL_LABEL, t.accent, chromeBg);
|
|
108
|
-
|
|
109
|
-
//
|
|
110
|
-
//
|
|
111
|
-
// ahead of the controls so fullscreen workflow overlays do not hide it.
|
|
109
|
+
// Hints use `<key> <label>` segments. Keep the hierarchy transition first,
|
|
110
|
+
// followed by extension status and secondary graph controls, so width
|
|
111
|
+
// pressure never hides the way back to main chat.
|
|
112
112
|
const sep = `${chromeBg} ${dim}·${RESET}${chromeBg} `;
|
|
113
|
+
const leftEdgePad = 1;
|
|
114
|
+
const rightEdgePad = 2;
|
|
115
|
+
const hintsBudget = Math.max(0, width - leftEdgePad - pillW - rightEdgePad);
|
|
116
|
+
const fullHierarchyHint = "ctrl+x return to main chat";
|
|
117
|
+
const hintKeys = hintsBudget >= visibleWidth(fullHierarchyHint)
|
|
118
|
+
? HINT_KEYS
|
|
119
|
+
: COMPACT_HINT_KEYS;
|
|
113
120
|
const statusText = this._externalStatusText();
|
|
114
121
|
const statusSegment = statusText ? [`${accent}${statusText}${RESET}${chromeBg}`] : [];
|
|
115
|
-
const hintSegments =
|
|
122
|
+
const hintSegments = hintKeys.map(
|
|
116
123
|
({ key, label }) =>
|
|
117
124
|
`${text}${BOLD}${key}${RESET}${chromeBg} ${muted}${label}${RESET}${chromeBg}`,
|
|
118
125
|
);
|
|
119
|
-
const hintsStyledRaw = [...statusSegment, ...hintSegments
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const rightEdgePad = 2;
|
|
123
|
-
const hintsBudget = Math.max(0, width - leftEdgePad - pillW - rightEdgePad);
|
|
126
|
+
const hintsStyledRaw = [hintSegments[0], ...statusSegment, ...hintSegments.slice(1)]
|
|
127
|
+
.filter((segment): segment is string => segment !== undefined)
|
|
128
|
+
.join(sep);
|
|
124
129
|
const hintsStyled = truncateToWidth(hintsStyledRaw, hintsBudget, "");
|
|
125
130
|
const hintsVisibleLen = visibleWidth(hintsStyled);
|
|
126
131
|
const fillerVisible = Math.max(0, hintsBudget - hintsVisibleLen);
|