@bastani/atomic 0.9.9 → 0.9.10
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 +132 -0
- package/README.md +2 -0
- package/dist/builtin/cursor/CHANGELOG.md +12 -0
- package/dist/builtin/cursor/package.json +3 -3
- package/dist/builtin/intercom/CHANGELOG.md +30 -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 +22 -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 +42 -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 +22 -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 +153 -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
package/dist/core/tools/write.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Container, Text } from "@earendil-works/pi-tui";
|
|
|
2
2
|
import { chmod as fsChmod, mkdir as fsMkdir, readFile as fsReadFile, readdir as fsReaddir, stat as fsStat, writeFile as fsWriteFile } from "fs/promises";
|
|
3
3
|
import { dirname, join } from "path";
|
|
4
4
|
import { Type } from "typebox";
|
|
5
|
-
import {
|
|
5
|
+
import { parenthesizedKeyHint } from "../../modes/interactive/components/keybinding-hints.js";
|
|
6
6
|
import { getLanguageFromPath, highlightCode } from "../../modes/interactive/theme/theme.js";
|
|
7
7
|
import { getRegisteredConflictBlocks, parseConflictBlocks } from "./conflict-registry.js";
|
|
8
8
|
import { withFileMutationQueue } from "./file-mutation-queue.js";
|
|
@@ -194,7 +194,7 @@ function formatWriteCall(args, options, theme, cache) {
|
|
|
194
194
|
const remaining = lines.length - maxLines;
|
|
195
195
|
text += `\n\n${displayLines.map((line) => (lang ? line : theme.fg("toolOutput", replaceTabs(line)))).join("\n")}`;
|
|
196
196
|
if (remaining > 0) {
|
|
197
|
-
text +=
|
|
197
|
+
text += theme.fg("muted", "\n... ") + parenthesizedKeyHint("app.tools.expand", "Expand", `${remaining} more lines, ${totalLines} total`);
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
return text;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.js","sourceRoot":"","sources":["../../../src/core/tools/write.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,OAAO,IAAI,SAAS,EAAE,IAAI,IAAI,MAAM,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AACzJ,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,wDAAwD,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAE5F,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAsB,MAAM,wBAAwB,CAAC;AAC9G,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,uCAAuC,EAA8B,MAAM,eAAe,CAAC;AACjN,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/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7B,CAAC;YACD,SAAS,CAAC,OAAO,CAChB,eAAe,CACd,UAAU,EACV,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,EAC5D,KAAK,EACL,SAAS,CAAC,KAAK,CACf,CACD,CAAC;YACF,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO;YAC5C,MAAM,MAAM,GAAG,iBAAiB,CAAC,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC;YACjF,IAAI,CAAC,MAAM,EAAE,CAAC;gBACb,MAAM,SAAS,GAAI,OAAO,CAAC,aAAuC,IAAI,IAAI,SAAS,EAAE,CAAC;gBACtF,SAAS,CAAC,KAAK,EAAE,CAAC;gBAClB,OAAO,SAAS,CAAC;YAClB,CAAC;YACD,MAAM,IAAI,GAAI,OAAO,CAAC,aAAkC,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC/E,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACrB,OAAO,IAAI,CAAC;QACb,CAAC;KACD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,GAAW,EAAE,OAA0B;IACtE,OAAO,kBAAkB,CAAC,yBAAyB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import type { AgentTool } from \"@earendil-works/pi-agent-core\";\nimport { Container, Text } from \"@earendil-works/pi-tui\";\nimport { chmod as fsChmod, mkdir as fsMkdir, readFile as fsReadFile, readdir as fsReaddir, stat as fsStat, writeFile as fsWriteFile } from \"fs/promises\";\nimport { dirname, join } from \"path\";\nimport { type Static, Type } from \"typebox\";\nimport { keyHint } from \"../../modes/interactive/components/keybinding-hints.ts\";\nimport { getLanguageFromPath, highlightCode } from \"../../modes/interactive/theme/theme.ts\";\nimport type { ToolDefinition, ToolRenderResultOptions } from \"../extensions/types.ts\";\nimport { getRegisteredConflictBlocks, parseConflictBlocks, type ConflictBlock } from \"./conflict-registry.ts\";\nimport { withFileMutationQueue } from \"./file-mutation-queue.ts\";\nimport { createHashlineSnapshotStore, formatHashlineContent, recordHashlineSnapshot, stripKnownHashlineCopiedContent, stripKnownHashlineCopiedContentWithMeta, type HashlineSnapshotStore } from \"./hashline.ts\";\nimport { resolveToCwd } from \"./path-utils.ts\";\nimport { parseArchiveSelector, parseSqliteSelector, resolveArchiveSelector, resolveInternalSelector, sqliteSelectorForPath, writeArchiveSelector, writeInternalSelector, writeSqliteSelector, type InternalResourceContext } from \"./resource-selectors.ts\";\nimport { invalidateNativeSearchCache } from \"./search-native.ts\";\nimport { invalidArgText, normalizeDisplayText, replaceTabs, shortenPath, str } from \"./render-utils.ts\";\nimport { wrapToolDefinition } from \"./tool-definition-wrapper.ts\";\n\nconst writeSchema = Type.Object({\n\tpath: Type.String({ description: \"File path, writable internal resource, archive entry, SQLite row selector, or conflict resolution target.\" }),\n\tcontent: Type.String({ description: \"Full replacement content. SQLite non-delete writes parse as a JSON5 object; empty content deletes a SQLite row when a row key exists.\" }),\n}, { additionalProperties: false });\n\nexport type WriteToolInput = Static<typeof writeSchema>;\nexport interface WriteToolDetails { resolvedPath?: string; madeExecutable?: boolean; meta?: { sourcePath?: string; diagnostics?: unknown }; diagnostics?: unknown }\n\n/**\n * Pluggable operations for the write tool.\n * Override these to delegate file writing to remote systems (for example SSH).\n */\nexport interface WriteOperations {\n\t/** Write content to a file */\n\twriteFile: (absolutePath: string, content: string) => Promise<void>;\n\tmkdir: (dir: string) => Promise<void>;\n}\n\n\nasync function findConflictBlocks(root: string, limit = 100): Promise<ConflictBlock[]> {\n\tconst out: ConflictBlock[] = [];\n\tasync function walk(dir: string): Promise<void> { for (const entry of await fsReaddir(dir, { withFileTypes: true }).catch(() => [])) { if (out.length >= limit || entry.name === \".git\" || entry.name === \"node_modules\") continue; const full = join(dir, entry.name); if (entry.isDirectory()) await walk(full); else if (entry.isFile()) { const text = await fsReadFile(full, \"utf8\").catch(() => \"\"); if (text.includes(\"<<<<<<<\") && text.includes(\"=======\") && text.includes(\">>>>>>>\")) out.push(...parseConflictBlocks(full, text)); } } }\n\tawait walk(root); return out;\n}\n/**\n * Reconcile the read-time conflict view (registry, populated by `read\n * …:conflicts`) against the live tree-walk snapshot. A registered block is\n * only trustworthy when the markers still sit at its recorded file+offset —\n * otherwise the file drifted and the id→block mapping would be wrong. When\n * any registered block is still live, resolve ids against the registered\n * ordering (what the agent actually saw); otherwise fall back to the fresh\n * tree walk. This closes the divergent id-space where `conflict://2` could\n * resolve a different block than the read displayed.\n */\nfunction reconcileConflictBlocks(live: ConflictBlock[], cwd: string): ConflictBlock[] {\n\tconst registered = getRegisteredConflictBlocks(cwd);\n\tif (registered.length === 0) return live;\n\tconst liveKeys = new Set(live.map((block) => `${block.file}\\0${block.start}\\0${block.end}`));\n\tconst registeredLive = registered.filter((block) => liveKeys.has(`${block.file}\\0${block.start}\\0${block.end}`));\n\t// If the registered view no longer matches the live tree at all, the file\n\t// changed under us — trust the live walk rather than a stale id mapping.\n\treturn registeredLive.length > 0 ? registeredLive : live;\n}\nfunction conflictReplacement(content: string, block: ConflictBlock): string[] {\n\tconst token = content.trim();\n\tif (token === \"@ours\") return block.ours;\n\tif (token === \"@theirs\") return block.theirs;\n\tif (token === \"@base\") return block.base;\n\tconst normalized = content.endsWith(\"\\n\") ? content.slice(0, -1) : content;\n\treturn normalized === \"\" ? [] : normalized.split(\"\\n\");\n}\nasync function resolveConflictBlocks(blocks: ConflictBlock[], content: string): Promise<string[]> {\n\tconst byFile = new Map<string, ConflictBlock[]>();\n\tfor (const block of blocks) byFile.set(block.file, [...(byFile.get(block.file) ?? []), block]);\n\tconst written: string[] = [];\n\tfor (const [file, fileBlocks] of byFile) {\n\t\tconst text = await fsReadFile(file, \"utf8\"), lines = text.split(\"\\n\");\n\t\tfor (const block of fileBlocks.sort((a, b) => b.start - a.start)) lines.splice(block.start, block.end - block.start + 1, ...conflictReplacement(content, block));\n\t\tawait fsWriteFile(file, lines.join(\"\\n\"), \"utf8\"); written.push(file);\n\t}\n\treturn written;\n}\nasync function conflictSnapshotHeaders(files: string[], cwd: string, store: HashlineSnapshotStore): Promise<string[]> {\n\tconst headers: string[] = [];\n\tfor (const file of [...new Set(files)]) { invalidateNativeSearchCache(file); const text = await fsReadFile(file, \"utf8\").catch(() => undefined); if (text !== undefined) headers.push(formatHashlineContent(recordHashlineSnapshot(file, cwd, text, store)).split(\"\\n\")[0]!); }\n\treturn headers;\n}\nconst GENERATED_MARKER_BYTES = 1024;\nconst GENERATED_MARKER_LINES = 40;\nfunction hasGeneratedMarker(text: string): boolean {\n\tconst header = text.slice(0, GENERATED_MARKER_BYTES).split(\"\\n\").slice(0, GENERATED_MARKER_LINES);\n\treturn header.some((line) => /@generated|auto-generated|DO NOT EDIT|GENERATED -- do not edit/i.test(line));\n}\nfunction strippedHashlineNote(stripped: boolean): string { return stripped ? \"\\n\\nNote: stripped copied hashline headers and line prefixes before writing.\" : \"\"; }\nfunction hashlineHeaderForWrite(path: string, cwd: string, content: string, store: HashlineSnapshotStore): string { const snapshot = recordHashlineSnapshot(path, cwd, content, store); return `[${snapshot.displayPath}#${snapshot.tag}]`; }\nconst defaultWriteOperations: WriteOperations = {\n\twriteFile: (path, content) => fsWriteFile(path, content, \"utf-8\"),\n\tmkdir: (dir) => fsMkdir(dir, { recursive: true }).then(() => {}),\n};\n\nexport interface WriteToolOptions {\n\t/** Custom operations for file writing. Default: local filesystem */\n\toperations?: WriteOperations;\n\thashlineStore?: HashlineSnapshotStore;\n}\n\ntype WriteHighlightCache = {\n\trawPath: string | null;\n\tlang: string;\n\trawContent: string;\n\tnormalizedLines: string[];\n\thighlightedLines: string[];\n};\n\nclass WriteCallRenderComponent extends Text {\n\tcache?: WriteHighlightCache;\n\n\tconstructor() {\n\t\tsuper(\"\", 0, 0);\n\t}\n}\n\nconst WRITE_PARTIAL_FULL_HIGHLIGHT_LINES = 50;\n\nfunction highlightSingleLine(line: string, lang: string): string {\n\tconst highlighted = highlightCode(line, lang);\n\treturn highlighted[0] ?? \"\";\n}\n\nfunction refreshWriteHighlightPrefix(cache: WriteHighlightCache): void {\n\tconst prefixCount = Math.min(WRITE_PARTIAL_FULL_HIGHLIGHT_LINES, cache.normalizedLines.length);\n\tif (prefixCount === 0) return;\n\tconst prefixSource = cache.normalizedLines.slice(0, prefixCount).join(\"\\n\");\n\tconst prefixHighlighted = highlightCode(prefixSource, cache.lang);\n\tfor (let i = 0; i < prefixCount; i++) {\n\t\tcache.highlightedLines[i] =\n\t\t\tprefixHighlighted[i] ?? highlightSingleLine(cache.normalizedLines[i] ?? \"\", cache.lang);\n\t}\n}\n\nfunction rebuildWriteHighlightCacheFull(rawPath: string | null, fileContent: string): WriteHighlightCache | undefined {\n\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\tif (!lang) return undefined;\n\tconst displayContent = normalizeDisplayText(fileContent);\n\tconst normalized = replaceTabs(displayContent);\n\treturn {\n\t\trawPath,\n\t\tlang,\n\t\trawContent: fileContent,\n\t\tnormalizedLines: normalized.split(\"\\n\"),\n\t\thighlightedLines: highlightCode(normalized, lang),\n\t};\n}\n\nfunction updateWriteHighlightCacheIncremental(\n\tcache: WriteHighlightCache | undefined,\n\trawPath: string | null,\n\tfileContent: string,\n): WriteHighlightCache | undefined {\n\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\tif (!lang) return undefined;\n\tif (!cache) return rebuildWriteHighlightCacheFull(rawPath, fileContent);\n\tif (cache.lang !== lang || cache.rawPath !== rawPath) return rebuildWriteHighlightCacheFull(rawPath, fileContent);\n\tif (!fileContent.startsWith(cache.rawContent)) return rebuildWriteHighlightCacheFull(rawPath, fileContent);\n\tif (fileContent.length === cache.rawContent.length) return cache;\n\n\tconst deltaRaw = fileContent.slice(cache.rawContent.length);\n\tconst deltaDisplay = normalizeDisplayText(deltaRaw);\n\tconst deltaNormalized = replaceTabs(deltaDisplay);\n\tcache.rawContent = fileContent;\n\tif (cache.normalizedLines.length === 0) {\n\t\tcache.normalizedLines.push(\"\");\n\t\tcache.highlightedLines.push(\"\");\n\t}\n\n\tconst segments = deltaNormalized.split(\"\\n\");\n\tconst lastIndex = cache.normalizedLines.length - 1;\n\tcache.normalizedLines[lastIndex] += segments[0];\n\tcache.highlightedLines[lastIndex] = highlightSingleLine(cache.normalizedLines[lastIndex], cache.lang);\n\tfor (let i = 1; i < segments.length; i++) {\n\t\tcache.normalizedLines.push(segments[i]);\n\t\tcache.highlightedLines.push(highlightSingleLine(segments[i], cache.lang));\n\t}\n\trefreshWriteHighlightPrefix(cache);\n\treturn cache;\n}\n\nfunction trimTrailingEmptyLines(lines: string[]): string[] {\n\tlet end = lines.length;\n\twhile (end > 0 && lines[end - 1] === \"\") {\n\t\tend--;\n\t}\n\treturn lines.slice(0, end);\n}\n\nfunction formatWriteCall(\n\targs: { path?: string; content?: string } | undefined,\n\toptions: ToolRenderResultOptions,\n\ttheme: typeof import(\"../../modes/interactive/theme/theme.ts\").theme,\n\tcache: WriteHighlightCache | undefined,\n): string {\n\tconst rawPath = str(args?.path);\n\tconst fileContent = str(args?.content);\n\tconst path = rawPath !== null ? shortenPath(rawPath) : null;\n\tconst invalidArg = invalidArgText(theme);\n\tlet text = `${theme.fg(\"toolTitle\", theme.bold(\"write\"))} ${path === null ? invalidArg : path ? theme.fg(\"accent\", path) : theme.fg(\"toolOutput\", \"...\")}`;\n\n\tif (fileContent === null) {\n\t\ttext += `\\n\\n${theme.fg(\"error\", \"[invalid content arg - expected string]\")}`;\n\t} else if (fileContent) {\n\t\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\t\tconst renderedLines = lang\n\t\t\t? (cache?.highlightedLines ?? highlightCode(replaceTabs(normalizeDisplayText(fileContent)), lang))\n\t\t\t: normalizeDisplayText(fileContent).split(\"\\n\");\n\t\tconst lines = trimTrailingEmptyLines(renderedLines);\n\t\tconst totalLines = lines.length;\n\t\tconst maxLines = options.expanded ? lines.length : 10;\n\t\tconst displayLines = lines.slice(0, maxLines);\n\t\tconst remaining = lines.length - maxLines;\n\t\ttext += `\\n\\n${displayLines.map((line) => (lang ? line : theme.fg(\"toolOutput\", replaceTabs(line)))).join(\"\\n\")}`;\n\t\tif (remaining > 0) {\n\t\t\ttext += `${theme.fg(\"muted\", `\\n... (${remaining} more lines, ${totalLines} total,`)} ${keyHint(\"app.tools.expand\", \"Expand\")}${theme.fg(\"muted\", \")\")}`;\n\t\t}\n\t}\n\n\treturn text;\n}\n\nfunction formatWriteResult(\n\tresult: { content: Array<{ type: string; text?: string; data?: string; mimeType?: string }>; isError?: boolean },\n\ttheme: typeof import(\"../../modes/interactive/theme/theme.ts\").theme,\n): string | undefined {\n\tif (!result.isError) {\n\t\treturn undefined;\n\t}\n\tconst output = result.content\n\t\t.filter((c) => c.type === \"text\")\n\t\t.map((c) => c.text || \"\")\n\t\t.join(\"\\n\");\n\tif (!output) {\n\t\treturn undefined;\n\t}\n\treturn `\\n${theme.fg(\"error\", output)}`;\n}\n\nexport function createWriteToolDefinition(\n\tcwd: string,\n\toptions?: WriteToolOptions,\n): ToolDefinition<typeof writeSchema, WriteToolDetails | undefined> {\n\tconst ops = options?.operations ?? defaultWriteOperations;\n\tconst hashlineStore = options?.hashlineStore ?? createHashlineSnapshotStore();\n\treturn {\n\t\tname: \"write\",\n\t\tlabel: \"write\",\n\t\tdescription: \"Create or overwrite a file, writable internal resource, archive entry, SQLite row, or merge-conflict resolution.\",\n\t\tpromptSnippet: \"Create or overwrite a writable path selector.\",\n\t\tpromptGuidelines: [\"Use write when replacing the full content of a target; use edit for source edits anchored to existing hashline snapshots.\"],\n\t\tparameters: writeSchema,\n\t\tasync execute(\n\t\t\t_toolCallId,\n\t\t\t{ path, content }: { path: string; content: string },\n\t\t\tsignal?: AbortSignal,\n\t\t\t_onUpdate?,\n\t\t\t_ctx?,\n\t\t) {\n\t\t\tconst resourceCtx = _ctx as InternalResourceContext | undefined;\n\t\t\tconst archive = parseArchiveSelector(path);\n\t\t\tconst parsedSqlite = parseSqliteSelector(path);\n\t\t\tif (parsedSqlite?.table && path.includes(\"?\")) throw new Error(\"SQLite write selectors must not include query parameters.\");\n\t\t\tif (parsedSqlite?.table && (parsedSqlite.limit !== undefined || parsedSqlite.offset !== undefined || parsedSqlite.where || parsedSqlite.order || parsedSqlite.schema || parsedSqlite.sampleRows !== undefined || parsedSqlite.query)) throw new Error(\"SQLite write selectors must not include query parameters.\");\n\t\t\tconst sqlite = sqliteSelectorForPath(path, cwd);\n\t\t\tif (!sqlite && parsedSqlite?.table) throw new Error(`SQLite database not found or is not SQLite: ${path}`);\n\t\t\tif (sqlite) {\n\t\t\t\tconst stripped = stripKnownHashlineCopiedContentWithMeta(content, \"\", cwd, hashlineStore);\n\t\t\t\tconst message = writeSqliteSelector(sqlite, stripped.content);\n\t\t\t\treturn { content: [{ type: \"text\", text: `${message}${strippedHashlineNote(stripped.stripped)}` }], details: { meta: { sourcePath: sqlite.databasePath } } };\n\t\t\t}\n\t\t\tif (archive) {\n\t\t\t\tconst stripped = stripKnownHashlineCopiedContentWithMeta(content, \"\", cwd, hashlineStore);\n\t\t\t\tconst resolvedArchive = resolveArchiveSelector(archive, cwd);\n\t\t\t\twriteArchiveSelector(resolvedArchive, stripped.content);\n\t\t\t\treturn { content: [{ type: \"text\", text: `Successfully wrote ${stripped.content.length} bytes to ${path}${strippedHashlineNote(stripped.stripped)}` }], details: { resolvedPath: resolvedArchive.archivePath } };\n\t\t\t}\n\t\t\tif (path.startsWith(\"conflict://\")) {\n\t\t\t\tconst writeContent = stripKnownHashlineCopiedContent(content, \"\", cwd, hashlineStore);\n\t\t\t\tconst target = decodeURIComponent(path.slice(\"conflict://\".length));\n\t\t\t\tif (!target) throw new Error(\"conflict:// target is required.\");\n\t\t\t\tif (target.includes(\"/\")) throw new Error(\"Scoped conflict resources are read-only; write conflict://<id> or conflict://*.\");\n\t\t\t\tconst liveBlocks = await findConflictBlocks(cwd);\n\t\t\t\tif (liveBlocks.length === 0) throw new Error(\"No conflict markers found.\");\n\t\t\t\tconst blocks = reconcileConflictBlocks(liveBlocks, cwd);\n\t\t\t\tif (target === \"*\") { const headers = await conflictSnapshotHeaders(await resolveConflictBlocks(blocks, writeContent), cwd, hashlineStore); return { content: [{ type: \"text\", text: `Resolved ${blocks.length} conflict${blocks.length === 1 ? \"\" : \"s\"}${headers.length > 0 ? `\\n\\nSnapshots:\\n${headers.join(\"\\n\")}` : \"\"}` }], details: undefined }; }\n\t\t\t\tif (!/^\\d+$/.test(target)) throw new Error(\"Conflict writes must target conflict://<id> or conflict://*.\");\n\t\t\t\tconst id = Number.parseInt(target, 10);\n\t\t\t\tconst block = blocks[id - 1];\n\t\t\t\tif (!block) throw new Error(`Conflict id not found: ${target}`);\n\t\t\t\tconst headers = await conflictSnapshotHeaders(await resolveConflictBlocks([block], writeContent), cwd, hashlineStore);\n\t\t\t\treturn { content: [{ type: \"text\", text: `Resolved conflict ${target}${headers[0] ? `\\n\\n${headers[0]}` : \"\"}` }], details: undefined };\n\t\t\t}\n\t\t\tif (/^[a-z]+:\\/\\//i.test(path)) {\n\t\t\t\tconst sourcePath = path.startsWith(\"local://\") ? resolveInternalSelector(path, cwd) : undefined;\n\t\t\t\tif (sourcePath) return createWriteToolDefinition(cwd, options).execute(_toolCallId, { path: sourcePath, content }, signal, _onUpdate, _ctx as never);\n\t\t\t\tconst stripped = stripKnownHashlineCopiedContentWithMeta(content, \"\", cwd, hashlineStore);\n\t\t\t\tawait writeInternalSelector(path, cwd, stripped.content, resourceCtx);\n\t\t\t\treturn { content: [{ type: \"text\", text: `Successfully wrote ${stripped.content.length} bytes to ${path}${strippedHashlineNote(stripped.stripped)}` }], details: {} };\n\t\t\t}\n\t\t\tconst absolutePath = resolveToCwd(path, cwd);\n\t\t\tconst dir = dirname(absolutePath);\n\t\t\treturn withFileMutationQueue(absolutePath, async () => {\n\t\t\t\t// Do not reject from an abort event listener here: that would release the\n\t\t\t\t// mutation queue while an in-flight filesystem operation may still finish.\n\t\t\t\t// Checking signal.aborted after each await observes the same aborts while\n\t\t\t\t// keeping the queue locked until the current operation has settled.\n\t\t\t\tconst throwIfAborted = (): void => {\n\t\t\t\t\tif (signal?.aborted) throw new Error(\"Operation aborted\");\n\t\t\t\t};\n\n\t\t\t\tthrowIfAborted();\n\t\t\t\t// Create parent directories if needed.\n\t\t\t\tawait ops.mkdir(dir);\n\t\t\t\tthrowIfAborted();\n\n\t\t\t\tconst existing = await fsReadFile(absolutePath, \"utf8\").catch(() => undefined);\n\t\t\t\tif (existing !== undefined && hasGeneratedMarker(existing)) throw new Error(`Refusing to overwrite generated file: ${path}`);\n\t\t\t\tconst stripped = stripKnownHashlineCopiedContentWithMeta(content, absolutePath, cwd, hashlineStore);\n\t\t\t\tconst writeContent = stripped.content;\n\t\t\t\tawait ops.writeFile(absolutePath, writeContent);\n\t\t\t\tinvalidateNativeSearchCache(absolutePath);\n\t\t\t\tlet madeExecutable = false;\n\t\t\t\tif (writeContent.startsWith(\"#!\")) {\n\t\t\t\t\tconst mode = await fsStat(absolutePath).then((stat) => stat.mode).catch(() => undefined);\n\t\t\t\t\tif (mode !== undefined) { await fsChmod(absolutePath, mode | 0o111); madeExecutable = true; }\n\t\t\t\t}\n\t\t\t\tthrowIfAborted();\n\n\t\t\t\tconst header = hashlineHeaderForWrite(absolutePath, cwd, writeContent, hashlineStore);\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [{ type: \"text\", text: `${header}\\nSuccessfully wrote ${writeContent.length} bytes to ${path}${strippedHashlineNote(stripped.stripped)}` }],\n\t\t\t\t\tdetails: { resolvedPath: absolutePath, ...(madeExecutable ? { madeExecutable } : {}) },\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\trenderCall(args, theme, context) {\n\t\t\tconst renderArgs = args as { path?: string; content?: string } | undefined;\n\t\t\tconst rawPath = str(renderArgs?.path);\n\t\t\tconst fileContent = str(renderArgs?.content);\n\t\t\tconst component =\n\t\t\t\t(context.lastComponent as WriteCallRenderComponent | undefined) ?? new WriteCallRenderComponent();\n\t\t\tif (fileContent !== null) {\n\t\t\t\tcomponent.cache = context.argsComplete\n\t\t\t\t\t? rebuildWriteHighlightCacheFull(rawPath, fileContent)\n\t\t\t\t\t: updateWriteHighlightCacheIncremental(component.cache, rawPath, fileContent);\n\t\t\t} else {\n\t\t\t\tcomponent.cache = undefined;\n\t\t\t}\n\t\t\tcomponent.setText(\n\t\t\t\tformatWriteCall(\n\t\t\t\t\trenderArgs,\n\t\t\t\t\t{ expanded: context.expanded, isPartial: context.isPartial },\n\t\t\t\t\ttheme,\n\t\t\t\t\tcomponent.cache,\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn component;\n\t\t},\n\t\trenderResult(result, _options, theme, context) {\n\t\t\tconst output = formatWriteResult({ ...result, isError: context.isError }, theme);\n\t\t\tif (!output) {\n\t\t\t\tconst component = (context.lastComponent as Container | undefined) ?? new Container();\n\t\t\t\tcomponent.clear();\n\t\t\t\treturn component;\n\t\t\t}\n\t\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\t\ttext.setText(output);\n\t\t\treturn text;\n\t\t},\n\t};\n}\n\nexport function createWriteTool(cwd: string, options?: WriteToolOptions): AgentTool<typeof writeSchema> {\n\treturn wrapToolDefinition(createWriteToolDefinition(cwd, options));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"write.js","sourceRoot":"","sources":["../../../src/core/tools/write.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,OAAO,IAAI,SAAS,EAAE,IAAI,IAAI,MAAM,EAAE,SAAS,IAAI,WAAW,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M,CAAC,CAAC;YACrB,OAAO,IAAI,CAAC;QACb,CAAC;KACD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,GAAW,EAAE,OAA0B;IACtE,OAAO,kBAAkB,CAAC,yBAAyB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import type { AgentTool } from \"@earendil-works/pi-agent-core\";\nimport { Container, Text } from \"@earendil-works/pi-tui\";\nimport { chmod as fsChmod, mkdir as fsMkdir, readFile as fsReadFile, readdir as fsReaddir, stat as fsStat, writeFile as fsWriteFile } from \"fs/promises\";\nimport { dirname, join } from \"path\";\nimport { type Static, Type } from \"typebox\";\nimport { parenthesizedKeyHint } from \"../../modes/interactive/components/keybinding-hints.ts\";\nimport { getLanguageFromPath, highlightCode } from \"../../modes/interactive/theme/theme.ts\";\nimport type { ToolDefinition, ToolRenderResultOptions } from \"../extensions/types.ts\";\nimport { getRegisteredConflictBlocks, parseConflictBlocks, type ConflictBlock } from \"./conflict-registry.ts\";\nimport { withFileMutationQueue } from \"./file-mutation-queue.ts\";\nimport { createHashlineSnapshotStore, formatHashlineContent, recordHashlineSnapshot, stripKnownHashlineCopiedContent, stripKnownHashlineCopiedContentWithMeta, type HashlineSnapshotStore } from \"./hashline.ts\";\nimport { resolveToCwd } from \"./path-utils.ts\";\nimport { parseArchiveSelector, parseSqliteSelector, resolveArchiveSelector, resolveInternalSelector, sqliteSelectorForPath, writeArchiveSelector, writeInternalSelector, writeSqliteSelector, type InternalResourceContext } from \"./resource-selectors.ts\";\nimport { invalidateNativeSearchCache } from \"./search-native.ts\";\nimport { invalidArgText, normalizeDisplayText, replaceTabs, shortenPath, str } from \"./render-utils.ts\";\nimport { wrapToolDefinition } from \"./tool-definition-wrapper.ts\";\n\nconst writeSchema = Type.Object({\n\tpath: Type.String({ description: \"File path, writable internal resource, archive entry, SQLite row selector, or conflict resolution target.\" }),\n\tcontent: Type.String({ description: \"Full replacement content. SQLite non-delete writes parse as a JSON5 object; empty content deletes a SQLite row when a row key exists.\" }),\n}, { additionalProperties: false });\n\nexport type WriteToolInput = Static<typeof writeSchema>;\nexport interface WriteToolDetails { resolvedPath?: string; madeExecutable?: boolean; meta?: { sourcePath?: string; diagnostics?: unknown }; diagnostics?: unknown }\n\n/**\n * Pluggable operations for the write tool.\n * Override these to delegate file writing to remote systems (for example SSH).\n */\nexport interface WriteOperations {\n\t/** Write content to a file */\n\twriteFile: (absolutePath: string, content: string) => Promise<void>;\n\tmkdir: (dir: string) => Promise<void>;\n}\n\n\nasync function findConflictBlocks(root: string, limit = 100): Promise<ConflictBlock[]> {\n\tconst out: ConflictBlock[] = [];\n\tasync function walk(dir: string): Promise<void> { for (const entry of await fsReaddir(dir, { withFileTypes: true }).catch(() => [])) { if (out.length >= limit || entry.name === \".git\" || entry.name === \"node_modules\") continue; const full = join(dir, entry.name); if (entry.isDirectory()) await walk(full); else if (entry.isFile()) { const text = await fsReadFile(full, \"utf8\").catch(() => \"\"); if (text.includes(\"<<<<<<<\") && text.includes(\"=======\") && text.includes(\">>>>>>>\")) out.push(...parseConflictBlocks(full, text)); } } }\n\tawait walk(root); return out;\n}\n/**\n * Reconcile the read-time conflict view (registry, populated by `read\n * …:conflicts`) against the live tree-walk snapshot. A registered block is\n * only trustworthy when the markers still sit at its recorded file+offset —\n * otherwise the file drifted and the id→block mapping would be wrong. When\n * any registered block is still live, resolve ids against the registered\n * ordering (what the agent actually saw); otherwise fall back to the fresh\n * tree walk. This closes the divergent id-space where `conflict://2` could\n * resolve a different block than the read displayed.\n */\nfunction reconcileConflictBlocks(live: ConflictBlock[], cwd: string): ConflictBlock[] {\n\tconst registered = getRegisteredConflictBlocks(cwd);\n\tif (registered.length === 0) return live;\n\tconst liveKeys = new Set(live.map((block) => `${block.file}\\0${block.start}\\0${block.end}`));\n\tconst registeredLive = registered.filter((block) => liveKeys.has(`${block.file}\\0${block.start}\\0${block.end}`));\n\t// If the registered view no longer matches the live tree at all, the file\n\t// changed under us — trust the live walk rather than a stale id mapping.\n\treturn registeredLive.length > 0 ? registeredLive : live;\n}\nfunction conflictReplacement(content: string, block: ConflictBlock): string[] {\n\tconst token = content.trim();\n\tif (token === \"@ours\") return block.ours;\n\tif (token === \"@theirs\") return block.theirs;\n\tif (token === \"@base\") return block.base;\n\tconst normalized = content.endsWith(\"\\n\") ? content.slice(0, -1) : content;\n\treturn normalized === \"\" ? [] : normalized.split(\"\\n\");\n}\nasync function resolveConflictBlocks(blocks: ConflictBlock[], content: string): Promise<string[]> {\n\tconst byFile = new Map<string, ConflictBlock[]>();\n\tfor (const block of blocks) byFile.set(block.file, [...(byFile.get(block.file) ?? []), block]);\n\tconst written: string[] = [];\n\tfor (const [file, fileBlocks] of byFile) {\n\t\tconst text = await fsReadFile(file, \"utf8\"), lines = text.split(\"\\n\");\n\t\tfor (const block of fileBlocks.sort((a, b) => b.start - a.start)) lines.splice(block.start, block.end - block.start + 1, ...conflictReplacement(content, block));\n\t\tawait fsWriteFile(file, lines.join(\"\\n\"), \"utf8\"); written.push(file);\n\t}\n\treturn written;\n}\nasync function conflictSnapshotHeaders(files: string[], cwd: string, store: HashlineSnapshotStore): Promise<string[]> {\n\tconst headers: string[] = [];\n\tfor (const file of [...new Set(files)]) { invalidateNativeSearchCache(file); const text = await fsReadFile(file, \"utf8\").catch(() => undefined); if (text !== undefined) headers.push(formatHashlineContent(recordHashlineSnapshot(file, cwd, text, store)).split(\"\\n\")[0]!); }\n\treturn headers;\n}\nconst GENERATED_MARKER_BYTES = 1024;\nconst GENERATED_MARKER_LINES = 40;\nfunction hasGeneratedMarker(text: string): boolean {\n\tconst header = text.slice(0, GENERATED_MARKER_BYTES).split(\"\\n\").slice(0, GENERATED_MARKER_LINES);\n\treturn header.some((line) => /@generated|auto-generated|DO NOT EDIT|GENERATED -- do not edit/i.test(line));\n}\nfunction strippedHashlineNote(stripped: boolean): string { return stripped ? \"\\n\\nNote: stripped copied hashline headers and line prefixes before writing.\" : \"\"; }\nfunction hashlineHeaderForWrite(path: string, cwd: string, content: string, store: HashlineSnapshotStore): string { const snapshot = recordHashlineSnapshot(path, cwd, content, store); return `[${snapshot.displayPath}#${snapshot.tag}]`; }\nconst defaultWriteOperations: WriteOperations = {\n\twriteFile: (path, content) => fsWriteFile(path, content, \"utf-8\"),\n\tmkdir: (dir) => fsMkdir(dir, { recursive: true }).then(() => {}),\n};\n\nexport interface WriteToolOptions {\n\t/** Custom operations for file writing. Default: local filesystem */\n\toperations?: WriteOperations;\n\thashlineStore?: HashlineSnapshotStore;\n}\n\ntype WriteHighlightCache = {\n\trawPath: string | null;\n\tlang: string;\n\trawContent: string;\n\tnormalizedLines: string[];\n\thighlightedLines: string[];\n};\n\nclass WriteCallRenderComponent extends Text {\n\tcache?: WriteHighlightCache;\n\n\tconstructor() {\n\t\tsuper(\"\", 0, 0);\n\t}\n}\n\nconst WRITE_PARTIAL_FULL_HIGHLIGHT_LINES = 50;\n\nfunction highlightSingleLine(line: string, lang: string): string {\n\tconst highlighted = highlightCode(line, lang);\n\treturn highlighted[0] ?? \"\";\n}\n\nfunction refreshWriteHighlightPrefix(cache: WriteHighlightCache): void {\n\tconst prefixCount = Math.min(WRITE_PARTIAL_FULL_HIGHLIGHT_LINES, cache.normalizedLines.length);\n\tif (prefixCount === 0) return;\n\tconst prefixSource = cache.normalizedLines.slice(0, prefixCount).join(\"\\n\");\n\tconst prefixHighlighted = highlightCode(prefixSource, cache.lang);\n\tfor (let i = 0; i < prefixCount; i++) {\n\t\tcache.highlightedLines[i] =\n\t\t\tprefixHighlighted[i] ?? highlightSingleLine(cache.normalizedLines[i] ?? \"\", cache.lang);\n\t}\n}\n\nfunction rebuildWriteHighlightCacheFull(rawPath: string | null, fileContent: string): WriteHighlightCache | undefined {\n\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\tif (!lang) return undefined;\n\tconst displayContent = normalizeDisplayText(fileContent);\n\tconst normalized = replaceTabs(displayContent);\n\treturn {\n\t\trawPath,\n\t\tlang,\n\t\trawContent: fileContent,\n\t\tnormalizedLines: normalized.split(\"\\n\"),\n\t\thighlightedLines: highlightCode(normalized, lang),\n\t};\n}\n\nfunction updateWriteHighlightCacheIncremental(\n\tcache: WriteHighlightCache | undefined,\n\trawPath: string | null,\n\tfileContent: string,\n): WriteHighlightCache | undefined {\n\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\tif (!lang) return undefined;\n\tif (!cache) return rebuildWriteHighlightCacheFull(rawPath, fileContent);\n\tif (cache.lang !== lang || cache.rawPath !== rawPath) return rebuildWriteHighlightCacheFull(rawPath, fileContent);\n\tif (!fileContent.startsWith(cache.rawContent)) return rebuildWriteHighlightCacheFull(rawPath, fileContent);\n\tif (fileContent.length === cache.rawContent.length) return cache;\n\n\tconst deltaRaw = fileContent.slice(cache.rawContent.length);\n\tconst deltaDisplay = normalizeDisplayText(deltaRaw);\n\tconst deltaNormalized = replaceTabs(deltaDisplay);\n\tcache.rawContent = fileContent;\n\tif (cache.normalizedLines.length === 0) {\n\t\tcache.normalizedLines.push(\"\");\n\t\tcache.highlightedLines.push(\"\");\n\t}\n\n\tconst segments = deltaNormalized.split(\"\\n\");\n\tconst lastIndex = cache.normalizedLines.length - 1;\n\tcache.normalizedLines[lastIndex] += segments[0];\n\tcache.highlightedLines[lastIndex] = highlightSingleLine(cache.normalizedLines[lastIndex], cache.lang);\n\tfor (let i = 1; i < segments.length; i++) {\n\t\tcache.normalizedLines.push(segments[i]);\n\t\tcache.highlightedLines.push(highlightSingleLine(segments[i], cache.lang));\n\t}\n\trefreshWriteHighlightPrefix(cache);\n\treturn cache;\n}\n\nfunction trimTrailingEmptyLines(lines: string[]): string[] {\n\tlet end = lines.length;\n\twhile (end > 0 && lines[end - 1] === \"\") {\n\t\tend--;\n\t}\n\treturn lines.slice(0, end);\n}\n\nfunction formatWriteCall(\n\targs: { path?: string; content?: string } | undefined,\n\toptions: ToolRenderResultOptions,\n\ttheme: typeof import(\"../../modes/interactive/theme/theme.ts\").theme,\n\tcache: WriteHighlightCache | undefined,\n): string {\n\tconst rawPath = str(args?.path);\n\tconst fileContent = str(args?.content);\n\tconst path = rawPath !== null ? shortenPath(rawPath) : null;\n\tconst invalidArg = invalidArgText(theme);\n\tlet text = `${theme.fg(\"toolTitle\", theme.bold(\"write\"))} ${path === null ? invalidArg : path ? theme.fg(\"accent\", path) : theme.fg(\"toolOutput\", \"...\")}`;\n\n\tif (fileContent === null) {\n\t\ttext += `\\n\\n${theme.fg(\"error\", \"[invalid content arg - expected string]\")}`;\n\t} else if (fileContent) {\n\t\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\t\tconst renderedLines = lang\n\t\t\t? (cache?.highlightedLines ?? highlightCode(replaceTabs(normalizeDisplayText(fileContent)), lang))\n\t\t\t: normalizeDisplayText(fileContent).split(\"\\n\");\n\t\tconst lines = trimTrailingEmptyLines(renderedLines);\n\t\tconst totalLines = lines.length;\n\t\tconst maxLines = options.expanded ? lines.length : 10;\n\t\tconst displayLines = lines.slice(0, maxLines);\n\t\tconst remaining = lines.length - maxLines;\n\t\ttext += `\\n\\n${displayLines.map((line) => (lang ? line : theme.fg(\"toolOutput\", replaceTabs(line)))).join(\"\\n\")}`;\n\t\tif (remaining > 0) {\n\t\t\ttext += theme.fg(\"muted\", \"\\n... \") + parenthesizedKeyHint(\"app.tools.expand\", \"Expand\", `${remaining} more lines, ${totalLines} total`);\n\t\t}\n\t}\n\n\treturn text;\n}\n\nfunction formatWriteResult(\n\tresult: { content: Array<{ type: string; text?: string; data?: string; mimeType?: string }>; isError?: boolean },\n\ttheme: typeof import(\"../../modes/interactive/theme/theme.ts\").theme,\n): string | undefined {\n\tif (!result.isError) {\n\t\treturn undefined;\n\t}\n\tconst output = result.content\n\t\t.filter((c) => c.type === \"text\")\n\t\t.map((c) => c.text || \"\")\n\t\t.join(\"\\n\");\n\tif (!output) {\n\t\treturn undefined;\n\t}\n\treturn `\\n${theme.fg(\"error\", output)}`;\n}\n\nexport function createWriteToolDefinition(\n\tcwd: string,\n\toptions?: WriteToolOptions,\n): ToolDefinition<typeof writeSchema, WriteToolDetails | undefined> {\n\tconst ops = options?.operations ?? defaultWriteOperations;\n\tconst hashlineStore = options?.hashlineStore ?? createHashlineSnapshotStore();\n\treturn {\n\t\tname: \"write\",\n\t\tlabel: \"write\",\n\t\tdescription: \"Create or overwrite a file, writable internal resource, archive entry, SQLite row, or merge-conflict resolution.\",\n\t\tpromptSnippet: \"Create or overwrite a writable path selector.\",\n\t\tpromptGuidelines: [\"Use write when replacing the full content of a target; use edit for source edits anchored to existing hashline snapshots.\"],\n\t\tparameters: writeSchema,\n\t\tasync execute(\n\t\t\t_toolCallId,\n\t\t\t{ path, content }: { path: string; content: string },\n\t\t\tsignal?: AbortSignal,\n\t\t\t_onUpdate?,\n\t\t\t_ctx?,\n\t\t) {\n\t\t\tconst resourceCtx = _ctx as InternalResourceContext | undefined;\n\t\t\tconst archive = parseArchiveSelector(path);\n\t\t\tconst parsedSqlite = parseSqliteSelector(path);\n\t\t\tif (parsedSqlite?.table && path.includes(\"?\")) throw new Error(\"SQLite write selectors must not include query parameters.\");\n\t\t\tif (parsedSqlite?.table && (parsedSqlite.limit !== undefined || parsedSqlite.offset !== undefined || parsedSqlite.where || parsedSqlite.order || parsedSqlite.schema || parsedSqlite.sampleRows !== undefined || parsedSqlite.query)) throw new Error(\"SQLite write selectors must not include query parameters.\");\n\t\t\tconst sqlite = sqliteSelectorForPath(path, cwd);\n\t\t\tif (!sqlite && parsedSqlite?.table) throw new Error(`SQLite database not found or is not SQLite: ${path}`);\n\t\t\tif (sqlite) {\n\t\t\t\tconst stripped = stripKnownHashlineCopiedContentWithMeta(content, \"\", cwd, hashlineStore);\n\t\t\t\tconst message = writeSqliteSelector(sqlite, stripped.content);\n\t\t\t\treturn { content: [{ type: \"text\", text: `${message}${strippedHashlineNote(stripped.stripped)}` }], details: { meta: { sourcePath: sqlite.databasePath } } };\n\t\t\t}\n\t\t\tif (archive) {\n\t\t\t\tconst stripped = stripKnownHashlineCopiedContentWithMeta(content, \"\", cwd, hashlineStore);\n\t\t\t\tconst resolvedArchive = resolveArchiveSelector(archive, cwd);\n\t\t\t\twriteArchiveSelector(resolvedArchive, stripped.content);\n\t\t\t\treturn { content: [{ type: \"text\", text: `Successfully wrote ${stripped.content.length} bytes to ${path}${strippedHashlineNote(stripped.stripped)}` }], details: { resolvedPath: resolvedArchive.archivePath } };\n\t\t\t}\n\t\t\tif (path.startsWith(\"conflict://\")) {\n\t\t\t\tconst writeContent = stripKnownHashlineCopiedContent(content, \"\", cwd, hashlineStore);\n\t\t\t\tconst target = decodeURIComponent(path.slice(\"conflict://\".length));\n\t\t\t\tif (!target) throw new Error(\"conflict:// target is required.\");\n\t\t\t\tif (target.includes(\"/\")) throw new Error(\"Scoped conflict resources are read-only; write conflict://<id> or conflict://*.\");\n\t\t\t\tconst liveBlocks = await findConflictBlocks(cwd);\n\t\t\t\tif (liveBlocks.length === 0) throw new Error(\"No conflict markers found.\");\n\t\t\t\tconst blocks = reconcileConflictBlocks(liveBlocks, cwd);\n\t\t\t\tif (target === \"*\") { const headers = await conflictSnapshotHeaders(await resolveConflictBlocks(blocks, writeContent), cwd, hashlineStore); return { content: [{ type: \"text\", text: `Resolved ${blocks.length} conflict${blocks.length === 1 ? \"\" : \"s\"}${headers.length > 0 ? `\\n\\nSnapshots:\\n${headers.join(\"\\n\")}` : \"\"}` }], details: undefined }; }\n\t\t\t\tif (!/^\\d+$/.test(target)) throw new Error(\"Conflict writes must target conflict://<id> or conflict://*.\");\n\t\t\t\tconst id = Number.parseInt(target, 10);\n\t\t\t\tconst block = blocks[id - 1];\n\t\t\t\tif (!block) throw new Error(`Conflict id not found: ${target}`);\n\t\t\t\tconst headers = await conflictSnapshotHeaders(await resolveConflictBlocks([block], writeContent), cwd, hashlineStore);\n\t\t\t\treturn { content: [{ type: \"text\", text: `Resolved conflict ${target}${headers[0] ? `\\n\\n${headers[0]}` : \"\"}` }], details: undefined };\n\t\t\t}\n\t\t\tif (/^[a-z]+:\\/\\//i.test(path)) {\n\t\t\t\tconst sourcePath = path.startsWith(\"local://\") ? resolveInternalSelector(path, cwd) : undefined;\n\t\t\t\tif (sourcePath) return createWriteToolDefinition(cwd, options).execute(_toolCallId, { path: sourcePath, content }, signal, _onUpdate, _ctx as never);\n\t\t\t\tconst stripped = stripKnownHashlineCopiedContentWithMeta(content, \"\", cwd, hashlineStore);\n\t\t\t\tawait writeInternalSelector(path, cwd, stripped.content, resourceCtx);\n\t\t\t\treturn { content: [{ type: \"text\", text: `Successfully wrote ${stripped.content.length} bytes to ${path}${strippedHashlineNote(stripped.stripped)}` }], details: {} };\n\t\t\t}\n\t\t\tconst absolutePath = resolveToCwd(path, cwd);\n\t\t\tconst dir = dirname(absolutePath);\n\t\t\treturn withFileMutationQueue(absolutePath, async () => {\n\t\t\t\t// Do not reject from an abort event listener here: that would release the\n\t\t\t\t// mutation queue while an in-flight filesystem operation may still finish.\n\t\t\t\t// Checking signal.aborted after each await observes the same aborts while\n\t\t\t\t// keeping the queue locked until the current operation has settled.\n\t\t\t\tconst throwIfAborted = (): void => {\n\t\t\t\t\tif (signal?.aborted) throw new Error(\"Operation aborted\");\n\t\t\t\t};\n\n\t\t\t\tthrowIfAborted();\n\t\t\t\t// Create parent directories if needed.\n\t\t\t\tawait ops.mkdir(dir);\n\t\t\t\tthrowIfAborted();\n\n\t\t\t\tconst existing = await fsReadFile(absolutePath, \"utf8\").catch(() => undefined);\n\t\t\t\tif (existing !== undefined && hasGeneratedMarker(existing)) throw new Error(`Refusing to overwrite generated file: ${path}`);\n\t\t\t\tconst stripped = stripKnownHashlineCopiedContentWithMeta(content, absolutePath, cwd, hashlineStore);\n\t\t\t\tconst writeContent = stripped.content;\n\t\t\t\tawait ops.writeFile(absolutePath, writeContent);\n\t\t\t\tinvalidateNativeSearchCache(absolutePath);\n\t\t\t\tlet madeExecutable = false;\n\t\t\t\tif (writeContent.startsWith(\"#!\")) {\n\t\t\t\t\tconst mode = await fsStat(absolutePath).then((stat) => stat.mode).catch(() => undefined);\n\t\t\t\t\tif (mode !== undefined) { await fsChmod(absolutePath, mode | 0o111); madeExecutable = true; }\n\t\t\t\t}\n\t\t\t\tthrowIfAborted();\n\n\t\t\t\tconst header = hashlineHeaderForWrite(absolutePath, cwd, writeContent, hashlineStore);\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [{ type: \"text\", text: `${header}\\nSuccessfully wrote ${writeContent.length} bytes to ${path}${strippedHashlineNote(stripped.stripped)}` }],\n\t\t\t\t\tdetails: { resolvedPath: absolutePath, ...(madeExecutable ? { madeExecutable } : {}) },\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\trenderCall(args, theme, context) {\n\t\t\tconst renderArgs = args as { path?: string; content?: string } | undefined;\n\t\t\tconst rawPath = str(renderArgs?.path);\n\t\t\tconst fileContent = str(renderArgs?.content);\n\t\t\tconst component =\n\t\t\t\t(context.lastComponent as WriteCallRenderComponent | undefined) ?? new WriteCallRenderComponent();\n\t\t\tif (fileContent !== null) {\n\t\t\t\tcomponent.cache = context.argsComplete\n\t\t\t\t\t? rebuildWriteHighlightCacheFull(rawPath, fileContent)\n\t\t\t\t\t: updateWriteHighlightCacheIncremental(component.cache, rawPath, fileContent);\n\t\t\t} else {\n\t\t\t\tcomponent.cache = undefined;\n\t\t\t}\n\t\t\tcomponent.setText(\n\t\t\t\tformatWriteCall(\n\t\t\t\t\trenderArgs,\n\t\t\t\t\t{ expanded: context.expanded, isPartial: context.isPartial },\n\t\t\t\t\ttheme,\n\t\t\t\t\tcomponent.cache,\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn component;\n\t\t},\n\t\trenderResult(result, _options, theme, context) {\n\t\t\tconst output = formatWriteResult({ ...result, isError: context.isError }, theme);\n\t\t\tif (!output) {\n\t\t\t\tconst component = (context.lastComponent as Container | undefined) ?? new Container();\n\t\t\t\tcomponent.clear();\n\t\t\t\treturn component;\n\t\t\t}\n\t\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\t\ttext.setText(output);\n\t\t\treturn text;\n\t\t},\n\t};\n}\n\nexport function createWriteTool(cwd: string, options?: WriteToolOptions): AgentTool<typeof writeSchema> {\n\treturn wrapToolDefinition(createWriteToolDefinition(cwd, options));\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type WorkflowStageAdmissionDecision = "admitted" | "late" | "duplicate";
|
|
2
|
+
export interface WorkflowStageAdmissionResult {
|
|
3
|
+
readonly decision: WorkflowStageAdmissionDecision;
|
|
4
|
+
readonly completion: Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Linearizable admission boundary for externally-produced workflow-stage traffic.
|
|
8
|
+
* JavaScript execution between the state check and state transition is synchronous:
|
|
9
|
+
* an enqueue that wins belongs to the stage, while close makes every later enqueue
|
|
10
|
+
* use the external route. Stable keys make either outcome exactly-once.
|
|
11
|
+
*/
|
|
12
|
+
export declare class WorkflowStageAdmissionBoundary {
|
|
13
|
+
private open;
|
|
14
|
+
private readonly completed;
|
|
15
|
+
private readonly inFlight;
|
|
16
|
+
private readonly pending;
|
|
17
|
+
private readonly invocationContext;
|
|
18
|
+
private closePromise;
|
|
19
|
+
private readonly drainAdmittedWork;
|
|
20
|
+
constructor(drainAdmittedWork?: () => Promise<void>);
|
|
21
|
+
admit(key: string | undefined, deliver: () => void | Promise<void>, routeLate: () => void | Promise<void>): WorkflowStageAdmissionResult;
|
|
22
|
+
trackAdmittedWork(completion: Promise<void>): void;
|
|
23
|
+
isOpen(): boolean;
|
|
24
|
+
seal(): void;
|
|
25
|
+
close(): Promise<void>;
|
|
26
|
+
private finishClose;
|
|
27
|
+
private invoke;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=workflow-stage-admission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-stage-admission.d.ts","sourceRoot":"","sources":["../../src/core/workflow-stage-admission.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,8BAA8B,GAAG,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;AAE/E,MAAM,WAAW,4BAA4B;IAC5C,QAAQ,CAAC,QAAQ,EAAE,8BAA8B,CAAC;IAClD,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAED;;;;;GAKG;AACH,qBAAa,8BAA8B;IAC1C,OAAO,CAAC,IAAI,CAAQ;IACpB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;IAC/C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoC;IAC7D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4B;IACpD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmC;IACrE,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAsB;IAExD,YAAY,iBAAiB,GAAE,MAAM,OAAO,CAAC,IAAI,CAAkB,EAElE;IAED,KAAK,CACJ,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EACnC,SAAS,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GACnC,4BAA4B,CAiC9B;IAED,iBAAiB,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAMjD;IAED,MAAM,IAAI,OAAO,CAEhB;IAED,IAAI,IAAI,IAAI,CAEX;IAED,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAIrB;YAEa,WAAW;IAMzB,OAAO,CAAC,MAAM;CAOd"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
/**
|
|
3
|
+
* Linearizable admission boundary for externally-produced workflow-stage traffic.
|
|
4
|
+
* JavaScript execution between the state check and state transition is synchronous:
|
|
5
|
+
* an enqueue that wins belongs to the stage, while close makes every later enqueue
|
|
6
|
+
* use the external route. Stable keys make either outcome exactly-once.
|
|
7
|
+
*/
|
|
8
|
+
export class WorkflowStageAdmissionBoundary {
|
|
9
|
+
constructor(drainAdmittedWork = async () => { }) {
|
|
10
|
+
this.open = true;
|
|
11
|
+
this.completed = new Set();
|
|
12
|
+
this.inFlight = new Map();
|
|
13
|
+
this.pending = new Set();
|
|
14
|
+
this.invocationContext = new AsyncLocalStorage();
|
|
15
|
+
this.drainAdmittedWork = drainAdmittedWork;
|
|
16
|
+
}
|
|
17
|
+
admit(key, deliver, routeLate) {
|
|
18
|
+
if (key !== undefined) {
|
|
19
|
+
if (this.completed.has(key))
|
|
20
|
+
return { decision: "duplicate", completion: Promise.resolve() };
|
|
21
|
+
const inFlight = this.inFlight.get(key);
|
|
22
|
+
if (inFlight) {
|
|
23
|
+
return { decision: "duplicate", completion: this.invocationContext.getStore() === key ? Promise.resolve() : inFlight };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const decision = this.open ? "admitted" : "late";
|
|
27
|
+
let completion;
|
|
28
|
+
if (key === undefined) {
|
|
29
|
+
completion = this.invoke(this.open ? deliver : routeLate);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
let resolveCompletion;
|
|
33
|
+
let rejectCompletion;
|
|
34
|
+
completion = new Promise((resolve, reject) => { resolveCompletion = resolve; rejectCompletion = reject; });
|
|
35
|
+
void completion.catch(() => { });
|
|
36
|
+
this.inFlight.set(key, completion);
|
|
37
|
+
const delivery = this.invocationContext.run(key, () => this.invoke(this.open ? deliver : routeLate));
|
|
38
|
+
void delivery.then(resolveCompletion, rejectCompletion);
|
|
39
|
+
void completion.then(() => {
|
|
40
|
+
if (this.inFlight.get(key) !== completion)
|
|
41
|
+
return;
|
|
42
|
+
this.inFlight.delete(key);
|
|
43
|
+
this.completed.add(key);
|
|
44
|
+
}, () => {
|
|
45
|
+
if (this.inFlight.get(key) === completion)
|
|
46
|
+
this.inFlight.delete(key);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
if (decision === "admitted")
|
|
50
|
+
this.trackAdmittedWork(completion);
|
|
51
|
+
return { decision, completion };
|
|
52
|
+
}
|
|
53
|
+
trackAdmittedWork(completion) {
|
|
54
|
+
this.pending.add(completion);
|
|
55
|
+
void completion.then(() => this.pending.delete(completion), () => this.pending.delete(completion));
|
|
56
|
+
}
|
|
57
|
+
isOpen() {
|
|
58
|
+
return this.open;
|
|
59
|
+
}
|
|
60
|
+
seal() {
|
|
61
|
+
this.open = false;
|
|
62
|
+
}
|
|
63
|
+
close() {
|
|
64
|
+
this.seal();
|
|
65
|
+
this.closePromise ??= this.finishClose();
|
|
66
|
+
return this.closePromise;
|
|
67
|
+
}
|
|
68
|
+
async finishClose() {
|
|
69
|
+
await Promise.allSettled([...this.pending]);
|
|
70
|
+
await this.drainAdmittedWork();
|
|
71
|
+
}
|
|
72
|
+
invoke(callback) {
|
|
73
|
+
try {
|
|
74
|
+
return Promise.resolve(callback());
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
return Promise.reject(error);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=workflow-stage-admission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-stage-admission.js","sourceRoot":"","sources":["../../src/core/workflow-stage-admission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AASrD;;;;;GAKG;AACH,MAAM,OAAO,8BAA8B;IAS1C,YAAY,iBAAiB,GAAwB,KAAK,IAAI,EAAE,GAAE,CAAC;QAR3D,SAAI,GAAG,IAAI,CAAC;QACH,cAAS,GAAG,IAAI,GAAG,EAAU,CAAC;QAC9B,aAAQ,GAAG,IAAI,GAAG,EAAyB,CAAC;QAC5C,YAAO,GAAG,IAAI,GAAG,EAAiB,CAAC;QACnC,sBAAiB,GAAG,IAAI,iBAAiB,E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ACH,CAAC;IAED,MAAM;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAED,IAAI;QACH,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IACnB,CAAC;IAED,KAAK;QACJ,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;IAEO,KAAK,CAAC,WAAW;QACxB,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAC5C,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAChC,CAAC;IAGO,MAAM,CAAC,QAAoC;QAClD,IAAI,CAAC;YACJ,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QACpC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC;CACD","sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\n\nexport type WorkflowStageAdmissionDecision = \"admitted\" | \"late\" | \"duplicate\";\n\nexport interface WorkflowStageAdmissionResult {\n\treadonly decision: WorkflowStageAdmissionDecision;\n\treadonly completion: Promise<void>;\n}\n\n/**\n * Linearizable admission boundary for externally-produced workflow-stage traffic.\n * JavaScript execution between the state check and state transition is synchronous:\n * an enqueue that wins belongs to the stage, while close makes every later enqueue\n * use the external route. Stable keys make either outcome exactly-once.\n */\nexport class WorkflowStageAdmissionBoundary {\n\tprivate open = true;\n\tprivate readonly completed = new Set<string>();\n\tprivate readonly inFlight = new Map<string, Promise<void>>();\n\tprivate readonly pending = new Set<Promise<void>>();\n\tprivate readonly invocationContext = new AsyncLocalStorage<string>();\n\tprivate closePromise: Promise<void> | undefined;\n\tprivate readonly drainAdmittedWork: () => Promise<void>;\n\n\tconstructor(drainAdmittedWork: () => Promise<void> = async () => {}) {\n\t\tthis.drainAdmittedWork = drainAdmittedWork;\n\t}\n\n\tadmit(\n\t\tkey: string | undefined,\n\t\tdeliver: () => void | Promise<void>,\n\t\trouteLate: () => void | Promise<void>,\n\t): WorkflowStageAdmissionResult {\n\t\tif (key !== undefined) {\n\t\t\tif (this.completed.has(key)) return { decision: \"duplicate\", completion: Promise.resolve() };\n\t\t\tconst inFlight = this.inFlight.get(key);\n\t\t\tif (inFlight) {\n\t\t\t\treturn { decision: \"duplicate\", completion: this.invocationContext.getStore() === key ? Promise.resolve() : inFlight };\n\t\t\t}\n\t\t}\n\t\tconst decision: WorkflowStageAdmissionDecision = this.open ? \"admitted\" : \"late\";\n\t\tlet completion: Promise<void>;\n\t\tif (key === undefined) {\n\t\t\tcompletion = this.invoke(this.open ? deliver : routeLate);\n\t\t} else {\n\t\t\tlet resolveCompletion!: () => void;\n\t\t\tlet rejectCompletion!: (reason?: unknown) => void;\n\t\t\tcompletion = new Promise<void>((resolve, reject) => { resolveCompletion = resolve; rejectCompletion = reject; });\n\t\t\tvoid completion.catch(() => {});\n\t\t\tthis.inFlight.set(key, completion);\n\t\t\tconst delivery = this.invocationContext.run(key, () => this.invoke(this.open ? deliver : routeLate));\n\t\t\tvoid delivery.then(resolveCompletion, rejectCompletion);\n\t\t\tvoid completion.then(\n\t\t\t\t() => {\n\t\t\t\t\tif (this.inFlight.get(key) !== completion) return;\n\t\t\t\t\tthis.inFlight.delete(key);\n\t\t\t\t\tthis.completed.add(key);\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tif (this.inFlight.get(key) === completion) this.inFlight.delete(key);\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t\tif (decision === \"admitted\") this.trackAdmittedWork(completion);\n\t\treturn { decision, completion };\n\t}\n\n\ttrackAdmittedWork(completion: Promise<void>): void {\n\t\tthis.pending.add(completion);\n\t\tvoid completion.then(\n\t\t\t() => this.pending.delete(completion),\n\t\t\t() => this.pending.delete(completion),\n\t\t);\n\t}\n\n\tisOpen(): boolean {\n\t\treturn this.open;\n\t}\n\n\tseal(): void {\n\t\tthis.open = false;\n\t}\n\n\tclose(): Promise<void> {\n\t\tthis.seal();\n\t\tthis.closePromise ??= this.finishClose();\n\t\treturn this.closePromise;\n\t}\n\n\tprivate async finishClose(): Promise<void> {\n\t\tawait Promise.allSettled([...this.pending]);\n\t\tawait this.drainAdmittedWork();\n\t}\n\n\n\tprivate invoke(callback: () => void | Promise<void>): Promise<void> {\n\t\ttry {\n\t\t\treturn Promise.resolve(callback());\n\t\t} catch (error) {\n\t\t\treturn Promise.reject(error);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { AgentEndEvent, AgentStartEvent, AgentToolResult, AgentToolUpdateCallback, AppKeybinding, AutocompleteProviderFactory, BashToolCallEvent, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, BuildSystemPromptOptions, CompactOptions, ContextEvent, ContextUsage, CustomToolCallEvent, EditToolCallEvent, ExecOptions, ExecResult, Extension, ExtensionActions, ExtensionAPI, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, WorkflowStageOrchestrationContext, ExtensionError, ExtensionEvent, ExtensionFactory, ExtensionFlag, ExtensionHandler, ExtensionRuntime, ExtensionShortcut, ExtensionUIContext, ExtensionUIDialogOptions, ExtensionWidgetOptions, FindToolCallEvent, InputEvent, InputEventResult, InputSource, KeybindingsManager, LoadExtensionsResult, LsToolCallEvent, MessageRenderer, MessageRenderOptions, ModelSelectEvent, OrchestrationContext, ProjectTrustContext, ProjectTrustEvent, ProjectTrustEventDecision, ProjectTrustEventResult, ProjectTrustHandler, ProviderConfig, ProviderModelConfig, ReactiveWidgetAction, ReactiveWidgetComponent, ReactiveWidgetController, ReactiveWidgetFactory, ReactiveWidgetRefreshReason, ReactiveWidgetRenderContext, ReactiveWidgetRenderState, ReactiveWidgetScheduler, ReactiveWidgetTimerApi, ReactiveWidgetTimerHandle, ReactiveWidgetUi, ReadToolCallEvent, RegisteredCommand, RegisteredTool, ResolvedCommand, SessionBeforeCompactEvent, SessionBeforeForkEvent, SessionBeforeSwitchEvent, SessionBeforeTreeEvent, SessionCompactEvent, SessionInfoChangedEvent, SessionShutdownEvent, SessionStartEvent, SessionTreeEvent, SlashCommandInfo, SlashCommandSource, SourceInfo, TerminalInputHandler, ToolCallEvent, ToolCallEventResult, ToolDefinition, ToolExecutionEndEvent, ToolExecutionStartEvent, ToolExecutionMode, InstallReactiveWidgetOptions, ToolInfo, ToolRenderResultOptions, ToolResultEvent, TurnEndEvent, TurnStartEvent, UserBashEvent, UserBashEventResult, WidgetPlacement, WorkingIndicatorOptions, WriteToolCallEvent, } from "./core/extensions/index.ts";
|
|
1
|
+
export type { AgentEndEvent, AgentStartEvent, AgentToolResult, AgentToolUpdateCallback, AppKeybinding, AutocompleteProviderFactory, BashToolCallEvent, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, BuildSystemPromptOptions, CompactOptions, ContextEvent, ContextUsage, CustomToolCallEvent, EditToolCallEvent, ExecOptions, ExecResult, Extension, ExtensionActions, ExtensionAPI, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, WorkflowStageOrchestrationContext, ExtensionError, ExtensionEvent, ExtensionFactory, ExtensionFlag, ExtensionHandler, ExtensionRuntime, ExtensionShortcut, ExtensionUIContext, ExtensionUIDialogOptions, ExtensionWidgetOptions, FindToolCallEvent, HostInputFormField, HostInputFormFieldType, HostInputFormRequest, HostSessionPickerHandle, HostSessionPickerRequest, HostSessionPickerRow, InputEvent, InputEventResult, InputSource, KeybindingsManager, LoadExtensionsResult, LsToolCallEvent, MessageRenderer, MessageRenderOptions, ModelSelectEvent, OrchestrationContext, ProjectTrustContext, ProjectTrustEvent, ProjectTrustEventDecision, ProjectTrustEventResult, ProjectTrustHandler, ProviderConfig, ProviderModelConfig, ReactiveWidgetAction, ReactiveWidgetComponent, ReactiveWidgetController, ReactiveWidgetFactory, ReactiveWidgetRefreshReason, ReactiveWidgetRenderContext, ReactiveWidgetRenderState, ReactiveWidgetScheduler, ReactiveWidgetTimerApi, ReactiveWidgetTimerHandle, ReactiveWidgetUi, ReadToolCallEvent, RegisteredCommand, RegisteredTool, ResolvedCommand, SessionBeforeCompactEvent, SessionBeforeForkEvent, SessionBeforeSwitchEvent, SessionBeforeTreeEvent, SessionCompactEvent, SessionInfoChangedEvent, SessionShutdownEvent, SessionStartEvent, SessionTreeEvent, SlashCommandInfo, SlashCommandSource, SourceInfo, TerminalInputHandler, ToolCallEvent, ToolCallEventResult, ToolDefinition, ToolExecutionEndEvent, ToolExecutionStartEvent, ToolExecutionMode, InstallReactiveWidgetOptions, ToolInfo, ToolRenderResultOptions, ToolResultEvent, TurnEndEvent, TurnStartEvent, UserBashEvent, UserBashEventResult, WidgetPlacement, WorkingIndicatorOptions, WriteToolCallEvent, } from "./core/extensions/index.ts";
|
|
2
2
|
export { createExtensionRuntime, decideReactiveWidgetAction, defineTool, discoverAndLoadExtensions, ExtensionRunner, isBashToolResult, isEditToolResult, isFindToolResult, isLsToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, installReactiveWidget, wrapRegisteredTool, wrapRegisteredTools, } from "./core/extensions/index.ts";
|
|
3
3
|
//# sourceMappingURL=index-extensions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-extensions.d.ts","sourceRoot":"","sources":["../src/index-extensions.ts"],"names":[],"mappings":"AACA,YAAY,EACX,aAAa,EACb,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,2BAA2B,EAC3B,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC3B,0BAA0B,EAC1B,gCAAgC,EAChC,wBAAwB,EACxB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACn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,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index-extensions.d.ts","sourceRoot":"","sources":["../src/index-extensions.ts"],"names":[],"mappings":"AACA,YAAY,EACX,aAAa,EACb,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,2BAA2B,EAC3B,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC3B,0BAA0B,EAC1B,gCAAgC,EAChC,wBAAwB,EACxB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,EACvB,8BAA8B,EAC9B,gBAAgB,EAChB,uBAAuB,EACvB,iCAAiC,EACjC,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,4BAA4B,EAC5B,QAAQ,EACR,uBAAuB,EACvB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,uBAAuB,EACvB,kBAAkB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,sBAAsB,EACtB,0BAA0B,EAC1B,UAAU,EACV,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,4BAA4B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-extensions.js","sourceRoot":"","sources":["../src/index-extensions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index-extensions.js","sourceRoot":"","sources":["../src/index-extensions.ts"],"names":[],"mappings":"AA6GA,OAAO,EACN,sBAAsB,EACtB,0BAA0B,EAC1B,UAAU,EACV,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,4BAA4B,CAAC","sourcesContent":["// Extension system\nexport type {\n\tAgentEndEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBuildSystemPromptOptions,\n\tCompactOptions,\n\tContextEvent,\n\tContextUsage,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tExecOptions,\n\tExecResult,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tWorkflowStageOrchestrationContext,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tFindToolCallEvent,\n\tHostInputFormField,\n\tHostInputFormFieldType,\n\tHostInputFormRequest,\n\tHostSessionPickerHandle,\n\tHostSessionPickerRequest,\n\tHostSessionPickerRow,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tModelSelectEvent,\n\tOrchestrationContext,\n\tProjectTrustContext,\n\tProjectTrustEvent,\n\tProjectTrustEventDecision,\n\tProjectTrustEventResult,\n\tProjectTrustHandler,\n\tProviderConfig,\n\tProviderModelConfig,\n\tReactiveWidgetAction,\n\tReactiveWidgetComponent,\n\tReactiveWidgetController,\n\tReactiveWidgetFactory,\n\tReactiveWidgetRefreshReason,\n\tReactiveWidgetRenderContext,\n\tReactiveWidgetRenderState,\n\tReactiveWidgetScheduler,\n\tReactiveWidgetTimerApi,\n\tReactiveWidgetTimerHandle,\n\tReactiveWidgetUi,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeForkEvent,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeTreeEvent,\n\tSessionCompactEvent,\n\tSessionInfoChangedEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionEndEvent,\n\tToolExecutionStartEvent,\n\tToolExecutionMode,\n\tInstallReactiveWidgetOptions,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tTurnEndEvent,\n\tTurnStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tcreateExtensionRuntime,\n\tdecideReactiveWidgetAction,\n\tdefineTool,\n\tdiscoverAndLoadExtensions,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisLsToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\tinstallReactiveWidget,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.ts\";\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,11 +6,14 @@ export { parseFlattenedKeyPath, reconstructFlattenedKeys, unflattenArgumentsWith
|
|
|
6
6
|
export { StringEnum, type StringEnumOptions } from "./core/typebox-compat.ts";
|
|
7
7
|
export { AgentSession, type AgentSessionConfig, type AgentSessionEvent, type AgentSessionEventListener, type ModelCycleResult, type ParsedSkillBlock, type PromptOptions, parseSkillBlock, type SessionStats, } from "./core/agent-session.ts";
|
|
8
8
|
export { type ApiKeyCredential, type AuthCredential, type AuthStatus, AuthStorage, type AuthStorageBackend, FileAuthStorageBackend, InMemoryAuthStorageBackend, type OAuthCredential, } from "./core/auth-storage.ts";
|
|
9
|
+
import "./core/oauth-compat.js";
|
|
10
|
+
export { getOAuthApiKey, getOAuthProvider, getOAuthProviders, type LegacyOAuthProvider, type OAuthProviderDescriptor, registerOAuthProvider, resetOAuthProviders, } from "./core/oauth-provider-bridge.ts";
|
|
9
11
|
export { type BranchPreparation, type BranchSummaryResult, type CollectEntriesResult, type CompactedTranscript, type CompactionPlanOptions, type VerbatimCompactionDetails, type VerbatimCompactionParameters, type VerbatimCompactionPreparation, type VerbatimCompactionResult, type LineRange, calculateContextTokens, collectEntriesForBranchSummary, DEFAULT_COMPACTION_SETTINGS, estimateTokens, type FileOperations, type GenerateBranchSummaryOptions, generateBranchSummary, getLastAssistantUsage, prepareBranchEntries, prepareCompactionBoundary, runVerbatimCompaction, serializeConversation, serializeConversationForCompaction, shouldCompact, } from "./core/compaction/index.ts";
|
|
10
12
|
export { CODEX_FAST_MODE_SERVICE_TIER, formatCodexFastModeModelLabel, getCodexFastModeScope, hasSupportedCodexFastModeModel, isCodexFastModeEnabledForScope, isCodexFastModeCandidateModelId, isCodexFastModeSupportedModel, isCodexFastModeSupportedProvider, shouldApplyCodexFastMode, shouldApplyCodexFastModeForScope, type CodexFastModeResolvedSettings, type CodexFastModeScope, } from "./core/codex-fast-mode.ts";
|
|
11
13
|
export { formatContextWindow, getEffectiveInputBudget, getModelDefaultContextWindow, getSupportedContextWindows, normalizeContextWindowOptions, parseContextWindowValue, selectContextWindow, validateContextWindowValue, withContextWindowOptions, type ContextWindowParseResult, type ContextWindowSelection, type ContextWindowSelectionError, type ContextWindowSelectionOptions, } from "./core/context-window.ts";
|
|
12
14
|
export { createEventBus, type EventBus, type EventBusController } from "./core/event-bus.ts";
|
|
13
15
|
export { areExperimentalFeaturesEnabled } from "./core/experimental.ts";
|
|
16
|
+
export { runCallback, runSynchronousCallback, type CallbackActivityDescriptor, type CallbackActivityKind, } from "./core/callback-activity.ts";
|
|
14
17
|
export * from "./index-extensions.js";
|
|
15
18
|
export { createAskUserQuestionToolDefinition } from "./core/tools/index.ts";
|
|
16
19
|
export type { ReadonlyFooterDataProvider } from "./core/footer-data-provider.ts";
|
|
@@ -34,7 +37,7 @@ export { type EditDiffResult, generateDiffString, generateUnifiedPatch } from ".
|
|
|
34
37
|
export { type MainOptions, main } from "./main.ts";
|
|
35
38
|
export { pickWhimsicalWorkingMessage } from "./modes/interactive/whimsical-messages.ts";
|
|
36
39
|
export { InteractiveMode, type InteractiveModeOptions, type ModelInfo, type PrintModeOptions, RpcClient, type RpcClientOptions, type RpcCommand, type RpcContextWindowInfo, type RpcEvent, type RpcEventListener, type RpcExtensionUIRequest, type RpcExtensionUIResponse, type RpcResponse, type RpcSessionState, runPrintMode, runRpcMode, } from "./modes/index.ts";
|
|
37
|
-
export { ArminComponent, AssistantMessageComponent, BashExecutionComponent, BorderedLoader, chatEntriesFromAgentMessages, ChatSessionHost, type ChatSessionHostBashRequest, type ChatSessionHostCommands, type ChatSessionHostEntry, type ChatSessionHostOpts, type ChatSessionHostStyle, ChatTranscriptComponent, LiveChatEntriesController, renderChatMessageEntry, type ChatMessageEntry, type ChatMessageRenderOptions, ScrollableChatTranscriptComponent, ScrollableComponentViewport, type ChatTranscriptEntryLike, type ChatTranscriptRenderer, type ChatTranscriptRole, BranchSummaryMessageComponent, CustomEditor, CustomMessageComponent, DynamicBorder, ExtensionEditorComponent, ExtensionInputComponent, ExtensionSelectorComponent, FooterComponent, UsageMeterComponent, keyHint, keyText, LoginDialogComponent, ModelSelectorComponent, OAuthSelectorComponent, type RenderDiffOptions, rawKeyHint, renderDiff, SessionSelectorComponent, type SettingsCallbacks, type SettingsConfig, SettingsSelectorComponent, ShowImagesSelectorComponent, SkillInvocationMessageComponent, ThemeSelectorComponent, ThinkingSelectorComponent, ToolExecutionComponent, type ToolExecutionOptions, TreeSelectorComponent, truncateToVisualLines, UserMessageComponent, UserMessageSelectorComponent, WorkingStatusComponent, type WorkingStatusComponentOptions, type VisualTruncateResult, } from "./modes/interactive/components/index.ts";
|
|
40
|
+
export { ArminComponent, AssistantMessageComponent, BashExecutionComponent, BorderedLoader, chatEntriesFromAgentMessages, ChatSessionHost, type ChatSessionHostBashRequest, type ChatSessionHostCommands, type ChatSessionHostEntry, type ChatSessionHostOpts, type ChatSessionHostStyle, ChatTranscriptComponent, LiveChatEntriesController, renderChatMessageEntry, type ChatMessageEntry, type ChatMessageRenderOptions, ScrollableChatTranscriptComponent, ScrollableComponentViewport, type ChatTranscriptEntryLike, type ChatTranscriptRenderer, type ChatTranscriptRole, BranchSummaryMessageComponent, CustomEditor, CustomMessageComponent, DynamicBorder, ExtensionEditorComponent, ExtensionInputComponent, ExtensionSelectorComponent, FooterComponent, UsageMeterComponent, keyHint, keyHintIfBound, keyText, LoginDialogComponent, ModelSelectorComponent, OAuthSelectorComponent, type RenderDiffOptions, rawKeyHint, renderDiff, SessionSelectorComponent, type SettingsCallbacks, type SettingsConfig, SettingsSelectorComponent, ShowImagesSelectorComponent, SkillInvocationMessageComponent, ThemeSelectorComponent, ThinkingSelectorComponent, ToolExecutionComponent, type ToolExecutionOptions, TreeSelectorComponent, truncateToVisualLines, UserMessageComponent, UserMessageSelectorComponent, WorkingStatusComponent, type WorkingStatusComponentOptions, type VisualTruncateResult, } from "./modes/interactive/components/index.ts";
|
|
38
41
|
export { getLanguageFromPath, getMarkdownTheme, getSelectListTheme, getSettingsListTheme, highlightCode, initTheme, Theme, type ThemeColor, } from "./modes/interactive/theme/theme.ts";
|
|
39
42
|
export { copyToClipboard } from "./utils/clipboard.ts";
|
|
40
43
|
export { parseFrontmatter, stripFrontmatter } from "./utils/frontmatter.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EACN,QAAQ,EACR,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,8BAA8B,EAC9B,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,iCAAiC,EACjC,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,OAAO,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,UAAU,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EACN,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,eAAe,EACf,KAAK,YAAY,GACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,WAAW,EACX,KAAK,kBAAkB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,KAAK,eAAe,GACpB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EACN,QAAQ,EACR,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB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AAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE9F,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,12 +8,15 @@ export { StringEnum } from "./core/typebox-compat.js";
|
|
|
8
8
|
export { AgentSession, parseSkillBlock, } from "./core/agent-session.js";
|
|
9
9
|
// Auth and model registry
|
|
10
10
|
export { AuthStorage, FileAuthStorageBackend, InMemoryAuthStorageBackend, } from "./core/auth-storage.js";
|
|
11
|
+
import "./core/oauth-compat.js";
|
|
12
|
+
export { getOAuthApiKey, getOAuthProvider, getOAuthProviders, registerOAuthProvider, resetOAuthProviders, } from "./core/oauth-provider-bridge.js";
|
|
11
13
|
// Compaction
|
|
12
14
|
export { calculateContextTokens, collectEntriesForBranchSummary, DEFAULT_COMPACTION_SETTINGS, estimateTokens, generateBranchSummary, getLastAssistantUsage, prepareBranchEntries, prepareCompactionBoundary, runVerbatimCompaction, serializeConversation, serializeConversationForCompaction, shouldCompact, } from "./core/compaction/index.js";
|
|
13
15
|
export { CODEX_FAST_MODE_SERVICE_TIER, formatCodexFastModeModelLabel, getCodexFastModeScope, hasSupportedCodexFastModeModel, isCodexFastModeEnabledForScope, isCodexFastModeCandidateModelId, isCodexFastModeSupportedModel, isCodexFastModeSupportedProvider, shouldApplyCodexFastMode, shouldApplyCodexFastModeForScope, } from "./core/codex-fast-mode.js";
|
|
14
16
|
export { formatContextWindow, getEffectiveInputBudget, getModelDefaultContextWindow, getSupportedContextWindows, normalizeContextWindowOptions, parseContextWindowValue, selectContextWindow, validateContextWindowValue, withContextWindowOptions, } from "./core/context-window.js";
|
|
15
17
|
export { createEventBus } from "./core/event-bus.js";
|
|
16
18
|
export { areExperimentalFeaturesEnabled } from "./core/experimental.js";
|
|
19
|
+
export { runCallback, runSynchronousCallback, } from "./core/callback-activity.js";
|
|
17
20
|
export * from "./index-extensions.js";
|
|
18
21
|
// Builtin tool definitions reusable by first-party extensions (e.g. workflows
|
|
19
22
|
// invoking the structured ask_user_question UI deterministically).
|
|
@@ -47,7 +50,7 @@ export { InteractiveMode, RpcClient, runPrintMode, runRpcMode, } from "./modes/i
|
|
|
47
50
|
// UI components for extensions
|
|
48
51
|
export { ArminComponent, AssistantMessageComponent, BashExecutionComponent, BorderedLoader, chatEntriesFromAgentMessages,
|
|
49
52
|
// Internal host seam for bundled workflow stage chat; not yet a stable extension API.
|
|
50
|
-
ChatSessionHost, ChatTranscriptComponent, LiveChatEntriesController, renderChatMessageEntry, ScrollableChatTranscriptComponent, ScrollableComponentViewport, BranchSummaryMessageComponent, CustomEditor, CustomMessageComponent, DynamicBorder, ExtensionEditorComponent, ExtensionInputComponent, ExtensionSelectorComponent, FooterComponent, UsageMeterComponent, keyHint, keyText, LoginDialogComponent, ModelSelectorComponent, OAuthSelectorComponent, rawKeyHint, renderDiff, SessionSelectorComponent, SettingsSelectorComponent, ShowImagesSelectorComponent, SkillInvocationMessageComponent, ThemeSelectorComponent, ThinkingSelectorComponent, ToolExecutionComponent, TreeSelectorComponent, truncateToVisualLines, UserMessageComponent, UserMessageSelectorComponent, WorkingStatusComponent, } from "./modes/interactive/components/index.js";
|
|
53
|
+
ChatSessionHost, ChatTranscriptComponent, LiveChatEntriesController, renderChatMessageEntry, ScrollableChatTranscriptComponent, ScrollableComponentViewport, BranchSummaryMessageComponent, CustomEditor, CustomMessageComponent, DynamicBorder, ExtensionEditorComponent, ExtensionInputComponent, ExtensionSelectorComponent, FooterComponent, UsageMeterComponent, keyHint, keyHintIfBound, keyText, LoginDialogComponent, ModelSelectorComponent, OAuthSelectorComponent, rawKeyHint, renderDiff, SessionSelectorComponent, SettingsSelectorComponent, ShowImagesSelectorComponent, SkillInvocationMessageComponent, ThemeSelectorComponent, ThinkingSelectorComponent, ToolExecutionComponent, TreeSelectorComponent, truncateToVisualLines, UserMessageComponent, UserMessageSelectorComponent, WorkingStatusComponent, } from "./modes/interactive/components/index.js";
|
|
51
54
|
// Theme utilities for custom tools and extensions
|
|
52
55
|
export { getLanguageFromPath, getMarkdownTheme, getSelectListTheme, getSettingsListTheme, highlightCode, initTheme, Theme, } from "./modes/interactive/theme/theme.js";
|
|
53
56
|
// Clipboard utilities
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAa,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,eAAe;AACf,OAAO,EACN,QAAQ,EACR,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,8BAA8B,EAC9B,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,iCAAiC,EACjC,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,OAAO,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAmB,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,UAAU,EAA0B,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EACN,YAAY,EAOZ,eAAe,GAEf,MAAM,yBAAyB,CAAC;AACjC,0BAA0B;AAC1B,OAAO,EAIN,WAAW,EAEX,sBAAsB,EACtB,0BAA0B,GAE1B,MAAM,wBAAwB,CAAC;AAChC,aAAa;AACb,OAAO,EAWN,sBAAsB,EACtB,8BAA8B,EAC9B,2BAA2B,EAC3B,cAAc,EA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uB,EACvB,yBAAyB,EACzB,sBAAsB,EAGtB,iCAAiC,EACjC,2BAA2B,EAI3B,6BAA6B,EAC7B,YAAY,EACZ,sBAAsB,EACtB,aAAa,EACb,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,eAAe,EACf,mBAAmB,EACnB,OAAO,EACP,OAAO,EACP,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EAEtB,UAAU,EACV,UAAU,EACV,wBAAwB,EAGxB,yBAAyB,EACzB,2BAA2B,EAC3B,+BAA+B,EAC/B,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EAEtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,EAC5B,sBAAsB,GAGtB,MAAM,yCAAyC,CAAC;AACjD,kDAAkD;AAClD,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,KAAK,GAEL,MAAM,oCAAoC,CAAC;AAC5C,sBAAsB;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EACN,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,qCAAqC,EACrC,uCAAuC,EACvC,qBAAqB,GAGrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAqB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,kBAAkB;AAClB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// Core session management\n\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n// Config paths\nexport {\n\tAPP_NAME,\n\tAPP_TITLE,\n\tCONFIG_DIR_NAME,\n\tCONFIG_DIR_NAMES,\n\tLEGACY_CONFIG_DIR_NAME,\n\tLEGACY_ENV_PREFIX,\n\tgetAgentConfigPaths,\n\tgetAgentDir,\n\tgetAgentDirs,\n\tgetBundledInteractiveAssetPath,\n\tgetChangelogPath,\n\tgetDocsPath,\n\tgetExamplesPath,\n\tgetExportTemplateDir,\n\tgetInteractiveAssetsDir,\n\tgetLegacyAgentDir,\n\tgetPackageDir,\n\tgetPackageJsonPath,\n\tgetProjectConfigDirs,\n\tgetProjectConfigPaths,\n\tgetReadmePath,\n\tgetThemesDir,\n\tgetEnvNames,\n\tgetEnvValue,\n\tENV_CODEX_FAST_MODE,\n\tWORKFLOW_STAGE_SUBAGENT_GUARD_ENV,\n\tisBunBinary,\n\tgetUserConfigDirs,\n\tgetUserConfigPaths,\n\thasEnvValue,\n\tPACKAGE_NAME,\n\tsetEnvValue,\n\tVERSION,\n} from \"./config.ts\";\nexport { type BashResult, executeBashWithOperations } from \"./core/bash-executor.ts\";\nexport {\n parseFlattenedKeyPath,\n reconstructFlattenedKeys,\n unflattenArgumentsWithSchema,\n} from \"./core/flattened-tool-arguments.ts\";\nexport { StringEnum, type StringEnumOptions } from \"./core/typebox-compat.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.ts\";\n// Auth and model registry\nexport {\n\ttype ApiKeyCredential,\n\ttype AuthCredential,\n\ttype AuthStatus,\n\tAuthStorage,\n\ttype AuthStorageBackend,\n\tFileAuthStorageBackend,\n\tInMemoryAuthStorageBackend,\n\ttype OAuthCredential,\n} from \"./core/auth-storage.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactedTranscript,\n\ttype CompactionPlanOptions,\n\ttype VerbatimCompactionDetails,\n\ttype VerbatimCompactionParameters,\n\ttype VerbatimCompactionPreparation,\n\ttype VerbatimCompactionResult,\n\ttype LineRange,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgetLastAssistantUsage,\n\tprepareBranchEntries,\n\tprepareCompactionBoundary,\n\trunVerbatimCompaction,\n\tserializeConversation,\n\tserializeConversationForCompaction,\n\tshouldCompact,\n} from \"./core/compaction/index.ts\";\nexport {\n\tCODEX_FAST_MODE_SERVICE_TIER,\n\tformatCodexFastModeModelLabel,\n\tgetCodexFastModeScope,\n\thasSupportedCodexFastModeModel,\n\tisCodexFastModeEnabledForScope,\n\tisCodexFastModeCandidateModelId,\n\tisCodexFastModeSupportedModel,\n\tisCodexFastModeSupportedProvider,\n\tshouldApplyCodexFastMode,\n\tshouldApplyCodexFastModeForScope,\n\ttype CodexFastModeResolvedSettings,\n\ttype CodexFastModeScope,\n} from \"./core/codex-fast-mode.ts\";\nexport {\n\tformatContextWindow,\n\tgetEffectiveInputBudget,\n\tgetModelDefaultContextWindow,\n\tgetSupportedContextWindows,\n\tnormalizeContextWindowOptions,\n\tparseContextWindowValue,\n\tselectContextWindow,\n\tvalidateContextWindowValue,\n\twithContextWindowOptions,\n\ttype ContextWindowParseResult,\n\ttype ContextWindowSelection,\n\ttype ContextWindowSelectionError,\n\ttype ContextWindowSelectionOptions,\n} from \"./core/context-window.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\nexport { areExperimentalFeaturesEnabled } from \"./core/experimental.ts\";\nexport * from \"./index-extensions.js\";\n// Builtin tool definitions reusable by first-party extensions (e.g. workflows\n// invoking the structured ask_user_question UI deterministically).\nexport { createAskUserQuestionToolDefinition } from \"./core/tools/index.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport type { DefaultProjectTrust } from \"./core/settings-manager.ts\";\nexport {\n\thasProjectTrustInputs,\n\thasTrustRequiringProjectResources,\n\tTRUST_REQUIRING_PROJECT_CONFIG_RESOURCES,\n\ttype ProjectTrustDecision,\n\tProjectTrustStore,\n\ttype ProjectTrustStoreEntry,\n\ttype ProjectTrustUpdate,\n} from \"./core/trust-manager.ts\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { getBuiltinPackagePaths } from \"./core/builtin-packages.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport type {\n\tDefaultResourceLoaderInheritanceSnapshot,\n\tResourceCollision,\n\tResourceDiagnostic,\n\tResourceLoader,\n} from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateSearchTool,\n\tcreateLsTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateStructuredOutputCapture,\n\tSTRUCTURED_OUTPUT_TOOL_NAME,\n\tcreateStructuredOutputTool,\n\tcreateWriteTool,\n\ttype JsonObject,\n\ttype JsonPrimitive,\n\ttype JsonValue,\n\ttype PromptTemplate,\n\ttype StructuredOutputCapture,\n\ttype StructuredOutputFileCapture,\n\ttype StructuredOutputToolOptions,\n} from \"./core/sdk.ts\";\nexport {\n\tWORKFLOW_SESSION_METADATA_ENV,\n\tworkflowSessionMetadataFromEnv,\n} from \"./core/session-manager-classification.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildSessionContext,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetLatestCompactionBoundaryEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype SessionWorkflowMetadata,\n\ttype SessionTreeNode,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\ttype CompactionSettings,\n\ttype ImageSettings,\n\ttype PackageSource,\n\ttype RetrySettings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateSearchToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLsToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatSize,\n\ttype SearchToolDetails,\n\ttype SearchToolInput,\n\ttype SearchToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport { type EditDiffResult, generateDiffString, generateUnifiedPatch } from \"./core/tools/edit-diff.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport { pickWhimsicalWorkingMessage } from \"./modes/interactive/whimsical-messages.ts\";\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcContextWindowInfo,\n\ttype RpcEvent,\n\ttype RpcEventListener,\n\ttype RpcExtensionUIRequest,\n\ttype RpcExtensionUIResponse,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tchatEntriesFromAgentMessages,\n\t// Internal host seam for bundled workflow stage chat; not yet a stable extension API.\n\tChatSessionHost,\n\ttype ChatSessionHostBashRequest,\n\ttype ChatSessionHostCommands,\n\ttype ChatSessionHostEntry,\n\ttype ChatSessionHostOpts,\n\ttype ChatSessionHostStyle,\n\tChatTranscriptComponent,\n\tLiveChatEntriesController,\n\trenderChatMessageEntry,\n\ttype ChatMessageEntry,\n\ttype ChatMessageRenderOptions,\n\tScrollableChatTranscriptComponent,\n\tScrollableComponentViewport,\n\ttype ChatTranscriptEntryLike,\n\ttype ChatTranscriptRenderer,\n\ttype ChatTranscriptRole,\n\tBranchSummaryMessageComponent,\n\tCustomEditor,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tUsageMeterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\tWorkingStatusComponent,\n\ttype WorkingStatusComponentOptions,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { createGitEnvironment, GIT_LOCAL_ENV_VARS } from \"./utils/git-env.ts\";\nexport {\n\tisSafeFsWatchPathError,\n\tisUnsafeWindowsShortPath,\n\tresolveNativeWatchPath,\n\tSAFE_FS_WATCH_CANONICALIZATION_FAILED,\n\tSAFE_FS_WATCH_UNSAFE_WINDOWS_SHORT_PATH,\n\twatchWithErrorHandler,\n\ttype SafeFsWatchErrorCode,\n\ttype SafeFsWatchPathError,\n} from \"./utils/fs-watch.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\n// Shell utilities\nexport { getShellConfig } from \"./utils/shell.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAa,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,eAAe;AACf,OAAO,EACN,QAAQ,EACR,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,8BAA8B,EAC9B,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,iCAAiC,EACjC,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,OAAO,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAmB,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,UAAU,EAA0B,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EACN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B,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EACN,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,qCAAqC,EACrC,uCAAuC,EACvC,qBAAqB,GAGrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAqB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,kBAAkB;AAClB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// Core session management\n\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n// Config paths\nexport {\n\tAPP_NAME,\n\tAPP_TITLE,\n\tCONFIG_DIR_NAME,\n\tCONFIG_DIR_NAMES,\n\tLEGACY_CONFIG_DIR_NAME,\n\tLEGACY_ENV_PREFIX,\n\tgetAgentConfigPaths,\n\tgetAgentDir,\n\tgetAgentDirs,\n\tgetBundledInteractiveAssetPath,\n\tgetChangelogPath,\n\tgetDocsPath,\n\tgetExamplesPath,\n\tgetExportTemplateDir,\n\tgetInteractiveAssetsDir,\n\tgetLegacyAgentDir,\n\tgetPackageDir,\n\tgetPackageJsonPath,\n\tgetProjectConfigDirs,\n\tgetProjectConfigPaths,\n\tgetReadmePath,\n\tgetThemesDir,\n\tgetEnvNames,\n\tgetEnvValue,\n\tENV_CODEX_FAST_MODE,\n\tWORKFLOW_STAGE_SUBAGENT_GUARD_ENV,\n\tisBunBinary,\n\tgetUserConfigDirs,\n\tgetUserConfigPaths,\n\thasEnvValue,\n\tPACKAGE_NAME,\n\tsetEnvValue,\n\tVERSION,\n} from \"./config.ts\";\nexport { type BashResult, executeBashWithOperations } from \"./core/bash-executor.ts\";\nexport {\n parseFlattenedKeyPath,\n reconstructFlattenedKeys,\n unflattenArgumentsWithSchema,\n} from \"./core/flattened-tool-arguments.ts\";\nexport { StringEnum, type StringEnumOptions } from \"./core/typebox-compat.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.ts\";\n// Auth and model registry\nexport {\n\ttype ApiKeyCredential,\n\ttype AuthCredential,\n\ttype AuthStatus,\n\tAuthStorage,\n\ttype AuthStorageBackend,\n\tFileAuthStorageBackend,\n\tInMemoryAuthStorageBackend,\n\ttype OAuthCredential,\n} from \"./core/auth-storage.ts\";\nimport \"./core/oauth-compat.js\";\nexport {\n\tgetOAuthApiKey,\n\tgetOAuthProvider,\n\tgetOAuthProviders,\n\ttype LegacyOAuthProvider,\n\ttype OAuthProviderDescriptor,\n\tregisterOAuthProvider,\n\tresetOAuthProviders,\n} from \"./core/oauth-provider-bridge.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactedTranscript,\n\ttype CompactionPlanOptions,\n\ttype VerbatimCompactionDetails,\n\ttype VerbatimCompactionParameters,\n\ttype VerbatimCompactionPreparation,\n\ttype VerbatimCompactionResult,\n\ttype LineRange,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgetLastAssistantUsage,\n\tprepareBranchEntries,\n\tprepareCompactionBoundary,\n\trunVerbatimCompaction,\n\tserializeConversation,\n\tserializeConversationForCompaction,\n\tshouldCompact,\n} from \"./core/compaction/index.ts\";\nexport {\n\tCODEX_FAST_MODE_SERVICE_TIER,\n\tformatCodexFastModeModelLabel,\n\tgetCodexFastModeScope,\n\thasSupportedCodexFastModeModel,\n\tisCodexFastModeEnabledForScope,\n\tisCodexFastModeCandidateModelId,\n\tisCodexFastModeSupportedModel,\n\tisCodexFastModeSupportedProvider,\n\tshouldApplyCodexFastMode,\n\tshouldApplyCodexFastModeForScope,\n\ttype CodexFastModeResolvedSettings,\n\ttype CodexFastModeScope,\n} from \"./core/codex-fast-mode.ts\";\nexport {\n\tformatContextWindow,\n\tgetEffectiveInputBudget,\n\tgetModelDefaultContextWindow,\n\tgetSupportedContextWindows,\n\tnormalizeContextWindowOptions,\n\tparseContextWindowValue,\n\tselectContextWindow,\n\tvalidateContextWindowValue,\n\twithContextWindowOptions,\n\ttype ContextWindowParseResult,\n\ttype ContextWindowSelection,\n\ttype ContextWindowSelectionError,\n\ttype ContextWindowSelectionOptions,\n} from \"./core/context-window.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\nexport { areExperimentalFeaturesEnabled } from \"./core/experimental.ts\";\nexport {\n\trunCallback,\n\trunSynchronousCallback,\n\ttype CallbackActivityDescriptor,\n\ttype CallbackActivityKind,\n} from \"./core/callback-activity.ts\";\nexport * from \"./index-extensions.js\";\n// Builtin tool definitions reusable by first-party extensions (e.g. workflows\n// invoking the structured ask_user_question UI deterministically).\nexport { createAskUserQuestionToolDefinition } from \"./core/tools/index.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport type { DefaultProjectTrust } from \"./core/settings-manager.ts\";\nexport {\n\thasProjectTrustInputs,\n\thasTrustRequiringProjectResources,\n\tTRUST_REQUIRING_PROJECT_CONFIG_RESOURCES,\n\ttype ProjectTrustDecision,\n\tProjectTrustStore,\n\ttype ProjectTrustStoreEntry,\n\ttype ProjectTrustUpdate,\n} from \"./core/trust-manager.ts\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { getBuiltinPackagePaths } from \"./core/builtin-packages.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport type {\n\tDefaultResourceLoaderInheritanceSnapshot,\n\tResourceCollision,\n\tResourceDiagnostic,\n\tResourceLoader,\n} from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateSearchTool,\n\tcreateLsTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateStructuredOutputCapture,\n\tSTRUCTURED_OUTPUT_TOOL_NAME,\n\tcreateStructuredOutputTool,\n\tcreateWriteTool,\n\ttype JsonObject,\n\ttype JsonPrimitive,\n\ttype JsonValue,\n\ttype PromptTemplate,\n\ttype StructuredOutputCapture,\n\ttype StructuredOutputFileCapture,\n\ttype StructuredOutputToolOptions,\n} from \"./core/sdk.ts\";\nexport {\n\tWORKFLOW_SESSION_METADATA_ENV,\n\tworkflowSessionMetadataFromEnv,\n} from \"./core/session-manager-classification.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildSessionContext,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetLatestCompactionBoundaryEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype SessionWorkflowMetadata,\n\ttype SessionTreeNode,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\ttype CompactionSettings,\n\ttype ImageSettings,\n\ttype PackageSource,\n\ttype RetrySettings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateSearchToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLsToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatSize,\n\ttype SearchToolDetails,\n\ttype SearchToolInput,\n\ttype SearchToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport { type EditDiffResult, generateDiffString, generateUnifiedPatch } from \"./core/tools/edit-diff.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport { pickWhimsicalWorkingMessage } from \"./modes/interactive/whimsical-messages.ts\";\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcContextWindowInfo,\n\ttype RpcEvent,\n\ttype RpcEventListener,\n\ttype RpcExtensionUIRequest,\n\ttype RpcExtensionUIResponse,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tchatEntriesFromAgentMessages,\n\t// Internal host seam for bundled workflow stage chat; not yet a stable extension API.\n\tChatSessionHost,\n\ttype ChatSessionHostBashRequest,\n\ttype ChatSessionHostCommands,\n\ttype ChatSessionHostEntry,\n\ttype ChatSessionHostOpts,\n\ttype ChatSessionHostStyle,\n\tChatTranscriptComponent,\n\tLiveChatEntriesController,\n\trenderChatMessageEntry,\n\ttype ChatMessageEntry,\n\ttype ChatMessageRenderOptions,\n\tScrollableChatTranscriptComponent,\n\tScrollableComponentViewport,\n\ttype ChatTranscriptEntryLike,\n\ttype ChatTranscriptRenderer,\n\ttype ChatTranscriptRole,\n\tBranchSummaryMessageComponent,\n\tCustomEditor,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tUsageMeterComponent,\n\tkeyHint,\n\tkeyHintIfBound,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\tWorkingStatusComponent,\n\ttype WorkingStatusComponentOptions,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { createGitEnvironment, GIT_LOCAL_ENV_VARS } from \"./utils/git-env.ts\";\nexport {\n\tisSafeFsWatchPathError,\n\tisUnsafeWindowsShortPath,\n\tresolveNativeWatchPath,\n\tSAFE_FS_WATCH_CANONICALIZATION_FAILED,\n\tSAFE_FS_WATCH_UNSAFE_WINDOWS_SHORT_PATH,\n\twatchWithErrorHandler,\n\ttype SafeFsWatchErrorCode,\n\ttype SafeFsWatchPathError,\n} from \"./utils/fs-watch.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\n// Shell utilities\nexport { getShellConfig } from \"./utils/shell.ts\";\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Terminal } from "@earendil-works/pi-tui";
|
|
2
|
+
import type { ExtensionFactory } from "./core/extensions/types.ts";
|
|
3
|
+
import type { InteractiveMode } from "./modes/index.ts";
|
|
4
|
+
export interface MainOptions {
|
|
5
|
+
extensionFactories?: ExtensionFactory[];
|
|
6
|
+
builtinPackagePaths?: string[];
|
|
7
|
+
internalInteractiveHarness?: {
|
|
8
|
+
forceInteractive: true;
|
|
9
|
+
terminal: Terminal;
|
|
10
|
+
onMode?: (mode: InteractiveMode) => void;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=main-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-types.d.ts","sourceRoot":"","sources":["../src/main-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,WAAW,WAAW;IAC3B,kBAAkB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACxC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,0BAA0B,CAAC,EAAE;QAC5B,gBAAgB,EAAE,IAAI,CAAC;QACvB,QAAQ,EAAE,QAAQ,CAAC;QACnB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;KACzC,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-types.js","sourceRoot":"","sources":["../src/main-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Terminal } from \"@earendil-works/pi-tui\";\nimport type { ExtensionFactory } from \"./core/extensions/types.ts\";\nimport type { InteractiveMode } from \"./modes/index.ts\";\n\nexport interface MainOptions {\n\textensionFactories?: ExtensionFactory[];\n\tbuiltinPackagePaths?: string[];\n\tinternalInteractiveHarness?: {\n\t\tforceInteractive: true;\n\t\tterminal: Terminal;\n\t\tonMode?: (mode: InteractiveMode) => void;\n\t};\n}\n"]}
|