@bastani/atomic 0.9.5-alpha.9 → 0.9.5
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 +106 -0
- package/README.md +2 -2
- package/dist/builtin/cursor/CHANGELOG.md +12 -0
- package/dist/builtin/cursor/package.json +3 -3
- package/dist/builtin/cursor/src/model-mapper.ts +6 -3
- package/dist/builtin/intercom/CHANGELOG.md +37 -0
- package/dist/builtin/intercom/README.md +4 -2
- package/dist/builtin/intercom/broker/broker.ts +6 -114
- package/dist/builtin/intercom/broker/client.ts +29 -54
- package/dist/builtin/intercom/broker/delivered-message-cache.ts +44 -0
- package/dist/builtin/intercom/broker/pending-send-registry.ts +142 -0
- package/dist/builtin/intercom/broker/send-handler.ts +106 -0
- package/dist/builtin/intercom/broker/send-signature.ts +37 -0
- package/dist/builtin/intercom/foreground-detach-handoff.ts +136 -0
- package/dist/builtin/intercom/index-heavy.ts +49 -53
- package/dist/builtin/intercom/index.ts +278 -262
- package/dist/builtin/intercom/lazy-heavy-proxy.ts +114 -0
- package/dist/builtin/intercom/lazy-subagent-ack.ts +20 -0
- package/dist/builtin/intercom/lazy-tool-execution.ts +39 -0
- package/dist/builtin/intercom/lifecycle-lease.ts +51 -0
- package/dist/builtin/intercom/lifecycle.ts +37 -20
- package/dist/builtin/intercom/package.json +3 -6
- package/dist/builtin/intercom/reply-routing.ts +17 -0
- package/dist/builtin/intercom/subagent-relay.ts +58 -12
- package/dist/builtin/intercom/types.ts +3 -3
- package/dist/builtin/mcp/CHANGELOG.md +27 -0
- package/dist/builtin/mcp/OAUTH.md +1 -0
- package/dist/builtin/mcp/README.md +4 -0
- package/dist/builtin/mcp/apps-cancellation.ts +32 -0
- package/dist/builtin/mcp/call-tool-result.ts +9 -0
- package/dist/builtin/mcp/caller-wait.ts +50 -0
- package/dist/builtin/mcp/command-registration.ts +82 -0
- package/dist/builtin/mcp/direct-tool-executor.ts +279 -0
- package/dist/builtin/mcp/direct-tools.ts +6 -239
- package/dist/builtin/mcp/host-html-template.ts +4 -2
- package/dist/builtin/mcp/index.ts +258 -250
- package/dist/builtin/mcp/init.ts +96 -87
- package/dist/builtin/mcp/mcp-auth-flow.ts +247 -237
- package/dist/builtin/mcp/mcp-callback-server.ts +89 -68
- package/dist/builtin/mcp/mcp-oauth-provider.ts +23 -1
- package/dist/builtin/mcp/metadata-hydration.ts +21 -6
- package/dist/builtin/mcp/package.json +3 -3
- package/dist/builtin/mcp/proxy-auth.ts +4 -4
- package/dist/builtin/mcp/proxy-call.ts +111 -40
- package/dist/builtin/mcp/proxy-connect.ts +35 -15
- package/dist/builtin/mcp/proxy-info-modes.ts +49 -19
- package/dist/builtin/mcp/proxy-modes.ts +3 -3
- package/dist/builtin/mcp/session-cleanup-barrier.ts +43 -0
- package/dist/builtin/mcp/state-lease.ts +12 -0
- package/dist/builtin/mcp/ui-server.ts +8 -8
- package/dist/builtin/mcp/ui-session.ts +9 -18
- package/dist/builtin/subagents/CHANGELOG.md +66 -0
- package/dist/builtin/subagents/README.md +30 -29
- package/dist/builtin/subagents/agents/code-simplifier.md +2 -2
- package/dist/builtin/subagents/agents/codebase-analyzer.md +2 -2
- package/dist/builtin/subagents/agents/codebase-locator.md +2 -2
- package/dist/builtin/subagents/agents/codebase-online-researcher.md +2 -2
- package/dist/builtin/subagents/agents/codebase-pattern-finder.md +2 -2
- package/dist/builtin/subagents/agents/codebase-research-analyzer.md +2 -2
- package/dist/builtin/subagents/agents/codebase-research-locator.md +2 -2
- package/dist/builtin/subagents/agents/debugger.md +2 -2
- package/dist/builtin/subagents/agents/worker.md +2 -2
- package/dist/builtin/subagents/package.json +5 -5
- package/dist/builtin/subagents/prompts/review-loop.md +1 -1
- package/dist/builtin/subagents/skills/subagent/SKILL.md +37 -36
- package/dist/builtin/subagents/src/extension/api-lifecycle.ts +64 -0
- package/dist/builtin/subagents/src/extension/fanout-child.ts +44 -51
- package/dist/builtin/subagents/src/extension/index.ts +287 -307
- package/dist/builtin/subagents/src/extension/prompt-guidance.ts +7 -10
- package/dist/builtin/subagents/src/extension/schemas.ts +22 -5
- package/dist/builtin/subagents/src/extension/tool-description.ts +29 -0
- package/dist/builtin/subagents/src/intercom/intercom-bridge.ts +13 -2
- package/dist/builtin/subagents/src/intercom/result-intercom.ts +4 -4
- package/dist/builtin/subagents/src/runs/background/async-event-journal.ts +106 -0
- package/dist/builtin/subagents/src/runs/background/async-execution-common.ts +3 -2
- package/dist/builtin/subagents/src/runs/background/async-execution-single.ts +13 -2
- package/dist/builtin/subagents/src/runs/background/async-execution-types.ts +3 -0
- package/dist/builtin/subagents/src/runs/background/async-job-tracker.ts +1 -1
- package/dist/builtin/subagents/src/runs/background/completion-claims.ts +189 -0
- package/dist/builtin/subagents/src/runs/background/completion-dedupe.ts +44 -7
- package/dist/builtin/subagents/src/runs/background/completion-notification.ts +34 -0
- package/dist/builtin/subagents/src/runs/background/notify.ts +72 -22
- package/dist/builtin/subagents/src/runs/background/result-delivery-processor.ts +232 -0
- package/dist/builtin/subagents/src/runs/background/result-file-claims.ts +151 -0
- package/dist/builtin/subagents/src/runs/background/result-quarantine.ts +72 -0
- package/dist/builtin/subagents/src/runs/background/result-retry-scheduler.ts +48 -0
- package/dist/builtin/subagents/src/runs/background/result-status.ts +81 -0
- package/dist/builtin/subagents/src/runs/background/result-watcher-data.ts +59 -0
- package/dist/builtin/subagents/src/runs/background/result-watcher.ts +172 -238
- package/dist/builtin/subagents/src/runs/background/run-id-resolver.ts +3 -2
- package/dist/builtin/subagents/src/runs/background/stale-run-reconciler.ts +73 -14
- package/dist/builtin/subagents/src/runs/background/subagent-runner-streaming.ts +17 -13
- package/dist/builtin/subagents/src/runs/background/top-level-async.ts +1 -2
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-dynamic-step.ts +1 -0
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-runner.ts +1 -0
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-step.ts +1 -0
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-sequential-step.ts +7 -9
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-types.ts +3 -13
- package/dist/builtin/subagents/src/runs/foreground/chain-execution.ts +2 -15
- package/dist/builtin/subagents/src/runs/foreground/execution-attempt-finalize.ts +2 -2
- package/dist/builtin/subagents/src/runs/foreground/execution-attempt.ts +53 -44
- package/dist/builtin/subagents/src/runs/foreground/execution-detach-reservations.ts +48 -0
- package/dist/builtin/subagents/src/runs/foreground/execution-detach-route.ts +17 -0
- package/dist/builtin/subagents/src/runs/foreground/execution-run-sync.ts +39 -26
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-async.ts +3 -1
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-chain.ts +3 -51
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-context.ts +6 -11
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-input.ts +11 -2
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts +2 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel.ts +5 -112
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-resume.ts +2 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +68 -118
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-status.ts +79 -7
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-types.ts +2 -2
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +3 -0
- package/dist/builtin/subagents/src/runs/shared/pi-args.ts +2 -2
- package/dist/builtin/subagents/src/runs/shared/pi-spawn.ts +27 -11
- package/dist/builtin/subagents/src/shared/artifacts.ts +22 -11
- package/dist/builtin/subagents/src/shared/event-jsonl-writer.ts +294 -0
- package/dist/builtin/subagents/src/shared/exclusive-file-publication.ts +44 -0
- package/dist/builtin/subagents/src/shared/jsonl-writer.ts +1 -0
- package/dist/builtin/subagents/src/shared/model-info.ts +2 -2
- package/dist/builtin/subagents/src/shared/settings.ts +20 -10
- package/dist/builtin/subagents/src/shared/types-async.ts +3 -1
- package/dist/builtin/subagents/src/shared/types-config.ts +2 -0
- package/dist/builtin/subagents/src/shared/types-runtime.ts +3 -2
- package/dist/builtin/subagents/src/slash/slash-commands.ts +9 -12
- package/dist/builtin/subagents/src/slash/slash-live-state.ts +63 -32
- package/dist/builtin/subagents/src/tui/render-result.ts +7 -0
- package/dist/builtin/subagents/src/tui/render-stable-output.ts +1 -0
- package/dist/builtin/subagents/src/tui/render-widget.ts +128 -89
- package/dist/builtin/web-access/CHANGELOG.md +28 -0
- package/dist/builtin/web-access/README.md +4 -0
- package/dist/builtin/web-access/content-tools.ts +8 -3
- package/dist/builtin/web-access/index-heavy.ts +1 -1
- package/dist/builtin/web-access/index.ts +190 -46
- package/dist/builtin/web-access/lifecycle-lease.ts +38 -0
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/web-access/result-renderers.ts +1 -1
- package/dist/builtin/web-access/summary-review.ts +1 -1
- package/dist/builtin/web-access/web-search-activity.ts +1 -1
- package/dist/builtin/web-access/web-search-return.ts +7 -0
- package/dist/builtin/web-access/web-search-summary.ts +1 -1
- package/dist/builtin/web-access/web-search-tool.ts +4 -2
- package/dist/builtin/workflows/CHANGELOG.md +68 -0
- package/dist/builtin/workflows/README.md +4 -4
- package/dist/builtin/workflows/builtin/deep-research-codebase-utils.ts +27 -4
- package/dist/builtin/workflows/builtin/goal-runner.ts +47 -26
- package/dist/builtin/workflows/builtin/open-claude-design-runner.ts +10 -0
- package/dist/builtin/workflows/builtin/ralph-core.ts +9 -9
- package/dist/builtin/workflows/builtin/ralph-models.ts +71 -36
- package/dist/builtin/workflows/builtin/ralph-runner.ts +20 -31
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/src/durable/stage-primitive.ts +2 -1
- package/dist/builtin/workflows/src/engine/primitives/task.ts +2 -1
- package/dist/builtin/workflows/src/extension/workflow-prompts.ts +17 -22
- package/dist/builtin/workflows/src/extension/workflow-schema.ts +15 -2
- package/dist/builtin/workflows/src/runs/foreground/executor-hil.ts +1 -2
- package/dist/builtin/workflows/src/runs/shared/model-fallback-candidates.ts +1 -1
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +2 -2
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.ts +2 -2
- package/dist/builtin/workflows/src/shared/resume-continuation.ts +2 -0
- package/dist/builtin/workflows/src/tui/stage-chat-view-archive-history.ts +1 -23
- package/dist/builtin/workflows/src/tui/stage-chat-view-footer-status.ts +54 -9
- package/dist/builtin/workflows/src/tui/stage-chat-view.ts +5 -2
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +2 -2
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +2 -1
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js +1 -1
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +1 -1
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-retry.d.ts.map +1 -1
- package/dist/core/agent-session-retry.js +1 -1
- package/dist/core/agent-session-retry.js.map +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +3 -2
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js +1 -1
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/anthropic-thinking-guard.d.ts +5 -5
- package/dist/core/anthropic-thinking-guard.d.ts.map +1 -1
- package/dist/core/anthropic-thinking-guard.js +42 -32
- package/dist/core/anthropic-thinking-guard.js.map +1 -1
- package/dist/core/atomic-guide-command.d.ts.map +1 -1
- package/dist/core/atomic-guide-command.js +15 -15
- package/dist/core/atomic-guide-command.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +14 -9
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +2 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +79 -46
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/context-assistant-turns.d.ts +42 -0
- package/dist/core/compaction/context-assistant-turns.d.ts.map +1 -0
- package/dist/core/compaction/context-assistant-turns.js +87 -0
- package/dist/core/compaction/context-assistant-turns.js.map +1 -0
- package/dist/core/compaction/context-compaction-critical.d.ts +1 -1
- package/dist/core/compaction/context-compaction-critical.d.ts.map +1 -1
- package/dist/core/compaction/context-compaction-critical.js +2 -2
- package/dist/core/compaction/context-compaction-critical.js.map +1 -1
- package/dist/core/compaction/context-compaction-eviction-alternates.d.ts +18 -0
- package/dist/core/compaction/context-compaction-eviction-alternates.d.ts.map +1 -0
- package/dist/core/compaction/context-compaction-eviction-alternates.js +186 -0
- package/dist/core/compaction/context-compaction-eviction-alternates.js.map +1 -0
- package/dist/core/compaction/context-compaction-eviction.d.ts +10 -2
- package/dist/core/compaction/context-compaction-eviction.d.ts.map +1 -1
- package/dist/core/compaction/context-compaction-eviction.js +196 -146
- package/dist/core/compaction/context-compaction-eviction.js.map +1 -1
- package/dist/core/compaction/context-compaction-prompt.d.ts.map +1 -1
- package/dist/core/compaction/context-compaction-prompt.js +1 -1
- package/dist/core/compaction/context-compaction-prompt.js.map +1 -1
- package/dist/core/compaction/context-compaction-types.d.ts +2 -0
- package/dist/core/compaction/context-compaction-types.d.ts.map +1 -1
- package/dist/core/compaction/context-compaction-types.js.map +1 -1
- package/dist/core/compaction/context-deletion-application.d.ts +5 -4
- package/dist/core/compaction/context-deletion-application.d.ts.map +1 -1
- package/dist/core/compaction/context-deletion-application.js +17 -15
- package/dist/core/compaction/context-deletion-application.js.map +1 -1
- package/dist/core/compaction/context-deletion-store.d.ts.map +1 -1
- package/dist/core/compaction/context-deletion-store.js +1 -1
- package/dist/core/compaction/context-deletion-store.js.map +1 -1
- package/dist/core/compaction/context-deletion-targets.d.ts +2 -1
- package/dist/core/compaction/context-deletion-targets.d.ts.map +1 -1
- package/dist/core/compaction/context-deletion-targets.js +36 -31
- package/dist/core/compaction/context-deletion-targets.js.map +1 -1
- package/dist/core/compaction/context-deletion-tool-helpers.d.ts.map +1 -1
- package/dist/core/compaction/context-deletion-tool-helpers.js +116 -43
- package/dist/core/compaction/context-deletion-tool-helpers.js.map +1 -1
- package/dist/core/compaction/context-transcript-analysis.d.ts +1 -2
- package/dist/core/compaction/context-transcript-analysis.d.ts.map +1 -1
- package/dist/core/compaction/context-transcript-analysis.js +33 -37
- package/dist/core/compaction/context-transcript-analysis.js.map +1 -1
- package/dist/core/copilot-model-synthesis.d.ts.map +1 -1
- package/dist/core/copilot-model-synthesis.js +3 -1
- package/dist/core/copilot-model-synthesis.js.map +1 -1
- package/dist/core/extensions/provider-types.d.ts +2 -7
- package/dist/core/extensions/provider-types.d.ts.map +1 -1
- package/dist/core/extensions/provider-types.js.map +1 -1
- package/dist/core/messages.d.ts +9 -0
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +100 -18
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-registry-builtins.d.ts.map +1 -1
- package/dist/core/model-registry-builtins.js +5 -0
- package/dist/core/model-registry-builtins.js.map +1 -1
- package/dist/core/model-registry-custom-loader.d.ts.map +1 -1
- package/dist/core/model-registry-custom-loader.js +49 -8
- package/dist/core/model-registry-custom-loader.js.map +1 -1
- package/dist/core/model-registry-dynamic.d.ts.map +1 -1
- package/dist/core/model-registry-dynamic.js +11 -5
- package/dist/core/model-registry-dynamic.js.map +1 -1
- package/dist/core/model-registry-loader.d.ts.map +1 -1
- package/dist/core/model-registry-loader.js +8 -0
- package/dist/core/model-registry-loader.js.map +1 -1
- package/dist/core/model-registry-schemas.d.ts +93 -8
- package/dist/core/model-registry-schemas.d.ts.map +1 -1
- package/dist/core/model-registry-schemas.js +24 -12
- package/dist/core/model-registry-schemas.js.map +1 -1
- package/dist/core/model-registry-types.d.ts +7 -6
- 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 +5 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +23 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver-cli.d.ts.map +1 -1
- package/dist/core/model-resolver-cli.js +33 -5
- package/dist/core/model-resolver-cli.js.map +1 -1
- package/dist/core/model-resolver-initial.d.ts +6 -1
- package/dist/core/model-resolver-initial.d.ts.map +1 -1
- package/dist/core/model-resolver-initial.js +12 -7
- package/dist/core/model-resolver-initial.js.map +1 -1
- package/dist/core/model-resolver.d.ts +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/resource-loader-context-files.d.ts +1 -0
- package/dist/core/resource-loader-context-files.d.ts.map +1 -1
- package/dist/core/resource-loader-context-files.js +13 -10
- package/dist/core/resource-loader-context-files.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +2 -2
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-entry-normalization.d.ts +7 -0
- package/dist/core/session-entry-normalization.d.ts.map +1 -0
- package/dist/core/session-entry-normalization.js +14 -0
- package/dist/core/session-entry-normalization.js.map +1 -0
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +1 -0
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-history.d.ts +2 -2
- package/dist/core/session-manager-history.d.ts.map +1 -1
- package/dist/core/session-manager-history.js +127 -108
- package/dist/core/session-manager-history.js.map +1 -1
- package/dist/core/settings-manager-basic-accessors.d.ts +2 -2
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-types.d.ts +1 -1
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +11 -8
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/main-session.d.ts.map +1 -1
- package/dist/main-session.js +1 -0
- package/dist/main-session.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-options.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-options.js +3 -1
- package/dist/modes/interactive/components/settings-selector-options.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +2 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.js +2 -1
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-child-ordering.d.ts +7 -0
- package/dist/modes/interactive/interactive-child-ordering.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-child-ordering.js +26 -0
- package/dist/modes/interactive/interactive-child-ordering.js.map +1 -0
- package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.js +2 -2
- package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.js +8 -3
- package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
- package/dist/modes/interactive/theme/theme-class.d.ts +1 -1
- package/dist/modes/interactive/theme/theme-class.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-class.js +2 -0
- package/dist/modes/interactive/theme/theme-class.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +3 -0
- package/dist/utils/clipboard-image.js.map +1 -1
- package/docs/changelog.mdx +19 -0
- package/docs/compaction.md +55 -48
- package/docs/custom-provider.md +18 -5
- package/docs/extensions.md +7 -3
- package/docs/models.md +69 -10
- package/docs/providers.md +1 -1
- package/docs/quickstart.md +11 -7
- package/docs/rpc.md +2 -2
- package/docs/sdk.md +1 -1
- package/docs/settings.md +3 -3
- package/docs/subagents.md +36 -5
- package/docs/tools.md +1 -1
- package/docs/usage.md +4 -2
- package/docs/workflows.md +26 -43
- package/examples/extensions/preset.ts +2 -2
- package/examples/extensions/subagent/README.md +2 -2
- package/examples/extensions/subagent/index.ts +1 -2
- package/examples/extensions/subagent/schemas.ts +4 -1
- package/examples/sdk/12-full-control.ts +1 -1
- package/npm-shrinkwrap.json +48 -51
- package/package.json +7 -7
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-behavior.ts +0 -75
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-component.ts +0 -202
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-edit.ts +0 -97
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-editor.ts +0 -160
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-frame.ts +0 -72
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-render-modes.ts +0 -161
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-render-selectors.ts +0 -203
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-selectors.ts +0 -234
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-state.ts +0 -103
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-types.ts +0 -29
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify.ts +0 -9
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-clarify.ts +0 -117
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.9.5
|
|
3
|
+
"version": "0.9.5",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@bastani/atomic",
|
|
9
|
-
"version": "0.9.5
|
|
9
|
+
"version": "0.9.5",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@bastani/atomic-natives": "0.9.5
|
|
12
|
+
"@bastani/atomic-natives": "0.9.5",
|
|
13
13
|
"@bufbuild/protobuf": "^2.12.1",
|
|
14
|
-
"@earendil-works/pi-agent-core": "^0.80.
|
|
15
|
-
"@earendil-works/pi-ai": "^0.80.
|
|
16
|
-
"@earendil-works/pi-tui": "^0.80.
|
|
14
|
+
"@earendil-works/pi-agent-core": "^0.80.6",
|
|
15
|
+
"@earendil-works/pi-ai": "^0.80.6",
|
|
16
|
+
"@earendil-works/pi-tui": "^0.80.6",
|
|
17
17
|
"@modelcontextprotocol/ext-apps": "^1.7.4",
|
|
18
18
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
19
19
|
"@mozilla/readability": "^0.6.0",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"ignore": "7.0.5",
|
|
28
28
|
"jiti": "2.7.0",
|
|
29
29
|
"linkedom": "^0.18.12",
|
|
30
|
-
"lru-cache": "11.
|
|
30
|
+
"lru-cache": "11.5.2",
|
|
31
31
|
"markit-ai": "0.5.3",
|
|
32
32
|
"minimatch": "10.2.5",
|
|
33
33
|
"open": "^11.0.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"optionalDependencies": {
|
|
46
46
|
"@mariozechner/clipboard": "0.3.9",
|
|
47
|
-
"@dbos-inc/dbos-sdk": "4.
|
|
47
|
+
"@dbos-inc/dbos-sdk": "4.23.6"
|
|
48
48
|
},
|
|
49
49
|
"bin": {
|
|
50
50
|
"atomic": "dist/cli.js"
|
|
@@ -515,16 +515,16 @@
|
|
|
515
515
|
}
|
|
516
516
|
},
|
|
517
517
|
"node_modules/@bastani/atomic-natives": {
|
|
518
|
-
"version": "0.9.5
|
|
519
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.5
|
|
518
|
+
"version": "0.9.5",
|
|
519
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.5.tgz",
|
|
520
520
|
"license": "MIT",
|
|
521
521
|
"optionalDependencies": {
|
|
522
|
-
"@bastani/atomic-natives-darwin-arm64": "0.9.5
|
|
523
|
-
"@bastani/atomic-natives-darwin-x64": "0.9.5
|
|
524
|
-
"@bastani/atomic-natives-linux-arm64-gnu": "0.9.5
|
|
525
|
-
"@bastani/atomic-natives-linux-x64-gnu": "0.9.5
|
|
526
|
-
"@bastani/atomic-natives-win32-arm64-msvc": "0.9.5
|
|
527
|
-
"@bastani/atomic-natives-win32-x64-msvc": "0.9.5
|
|
522
|
+
"@bastani/atomic-natives-darwin-arm64": "0.9.5",
|
|
523
|
+
"@bastani/atomic-natives-darwin-x64": "0.9.5",
|
|
524
|
+
"@bastani/atomic-natives-linux-arm64-gnu": "0.9.5",
|
|
525
|
+
"@bastani/atomic-natives-linux-x64-gnu": "0.9.5",
|
|
526
|
+
"@bastani/atomic-natives-win32-arm64-msvc": "0.9.5",
|
|
527
|
+
"@bastani/atomic-natives-win32-x64-msvc": "0.9.5"
|
|
528
528
|
},
|
|
529
529
|
"engines": {
|
|
530
530
|
"bun": ">=1.3.14",
|
|
@@ -532,8 +532,8 @@
|
|
|
532
532
|
}
|
|
533
533
|
},
|
|
534
534
|
"node_modules/@bastani/atomic-natives-darwin-arm64": {
|
|
535
|
-
"version": "0.9.5
|
|
536
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.5
|
|
535
|
+
"version": "0.9.5",
|
|
536
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.5.tgz",
|
|
537
537
|
"license": "MIT",
|
|
538
538
|
"os": [
|
|
539
539
|
"darwin"
|
|
@@ -544,8 +544,8 @@
|
|
|
544
544
|
"optional": true
|
|
545
545
|
},
|
|
546
546
|
"node_modules/@bastani/atomic-natives-darwin-x64": {
|
|
547
|
-
"version": "0.9.5
|
|
548
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.5
|
|
547
|
+
"version": "0.9.5",
|
|
548
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.5.tgz",
|
|
549
549
|
"license": "MIT",
|
|
550
550
|
"os": [
|
|
551
551
|
"darwin"
|
|
@@ -556,8 +556,8 @@
|
|
|
556
556
|
"optional": true
|
|
557
557
|
},
|
|
558
558
|
"node_modules/@bastani/atomic-natives-linux-arm64-gnu": {
|
|
559
|
-
"version": "0.9.5
|
|
560
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.5
|
|
559
|
+
"version": "0.9.5",
|
|
560
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.5.tgz",
|
|
561
561
|
"license": "MIT",
|
|
562
562
|
"os": [
|
|
563
563
|
"linux"
|
|
@@ -571,8 +571,8 @@
|
|
|
571
571
|
"optional": true
|
|
572
572
|
},
|
|
573
573
|
"node_modules/@bastani/atomic-natives-linux-x64-gnu": {
|
|
574
|
-
"version": "0.9.5
|
|
575
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.5
|
|
574
|
+
"version": "0.9.5",
|
|
575
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.5.tgz",
|
|
576
576
|
"license": "MIT",
|
|
577
577
|
"os": [
|
|
578
578
|
"linux"
|
|
@@ -586,8 +586,8 @@
|
|
|
586
586
|
"optional": true
|
|
587
587
|
},
|
|
588
588
|
"node_modules/@bastani/atomic-natives-win32-arm64-msvc": {
|
|
589
|
-
"version": "0.9.5
|
|
590
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.5
|
|
589
|
+
"version": "0.9.5",
|
|
590
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.5.tgz",
|
|
591
591
|
"license": "MIT",
|
|
592
592
|
"os": [
|
|
593
593
|
"win32"
|
|
@@ -598,8 +598,8 @@
|
|
|
598
598
|
"optional": true
|
|
599
599
|
},
|
|
600
600
|
"node_modules/@bastani/atomic-natives-win32-x64-msvc": {
|
|
601
|
-
"version": "0.9.5
|
|
602
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.5
|
|
601
|
+
"version": "0.9.5",
|
|
602
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.5.tgz",
|
|
603
603
|
"license": "MIT",
|
|
604
604
|
"os": [
|
|
605
605
|
"win32"
|
|
@@ -626,9 +626,9 @@
|
|
|
626
626
|
"license": "(Apache-2.0 AND BSD-3-Clause)"
|
|
627
627
|
},
|
|
628
628
|
"node_modules/@dbos-inc/dbos-sdk": {
|
|
629
|
-
"version": "4.
|
|
630
|
-
"resolved": "https://registry.npmjs.org/@dbos-inc/dbos-sdk/-/dbos-sdk-4.
|
|
631
|
-
"integrity": "sha512-
|
|
629
|
+
"version": "4.23.6",
|
|
630
|
+
"resolved": "https://registry.npmjs.org/@dbos-inc/dbos-sdk/-/dbos-sdk-4.23.6.tgz",
|
|
631
|
+
"integrity": "sha512-Hrdm/WM7DUMqb517ib+msv/pIGnUepP/h3Q62T0j8/LYHRXS2PyOSd76emn1wccPDuTwhUhNyzBfbxoTbW0DJQ==",
|
|
632
632
|
"license": "MIT",
|
|
633
633
|
"dependencies": {
|
|
634
634
|
"commander": "^12.0.0",
|
|
@@ -639,24 +639,21 @@
|
|
|
639
639
|
"yaml": "^2.8.3"
|
|
640
640
|
},
|
|
641
641
|
"bin": {
|
|
642
|
-
"dbos": "dist/src/cli/cli.js",
|
|
643
|
-
"dbos-sdk": "dist/src/cli/cli.js"
|
|
642
|
+
"dbos": "./dist/src/cli/cli.js",
|
|
643
|
+
"dbos-sdk": "./dist/src/cli/cli.js"
|
|
644
644
|
},
|
|
645
645
|
"engines": {
|
|
646
646
|
"node": ">=20"
|
|
647
647
|
},
|
|
648
|
-
"optional": true
|
|
649
|
-
"workspaces": [
|
|
650
|
-
"packages/*"
|
|
651
|
-
]
|
|
648
|
+
"optional": true
|
|
652
649
|
},
|
|
653
650
|
"node_modules/@earendil-works/pi-agent-core": {
|
|
654
|
-
"version": "0.80.
|
|
655
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.80.
|
|
656
|
-
"integrity": "sha512-
|
|
651
|
+
"version": "0.80.6",
|
|
652
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.80.6.tgz",
|
|
653
|
+
"integrity": "sha512-Lvn89ko42h5ETUb6Z0Ku6ldskEqXaTdQBYvSa0+7bdG9V6rUEpXptv5e0OVZ1HDcvi8s6/2lGCQWsxKX+DFHNw==",
|
|
657
654
|
"license": "MIT",
|
|
658
655
|
"dependencies": {
|
|
659
|
-
"@earendil-works/pi-ai": "^0.80.
|
|
656
|
+
"@earendil-works/pi-ai": "^0.80.6",
|
|
660
657
|
"ignore": "7.0.5",
|
|
661
658
|
"typebox": "1.1.38",
|
|
662
659
|
"yaml": "2.9.0"
|
|
@@ -666,9 +663,9 @@
|
|
|
666
663
|
}
|
|
667
664
|
},
|
|
668
665
|
"node_modules/@earendil-works/pi-ai": {
|
|
669
|
-
"version": "0.80.
|
|
670
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.80.
|
|
671
|
-
"integrity": "sha512-
|
|
666
|
+
"version": "0.80.6",
|
|
667
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.80.6.tgz",
|
|
668
|
+
"integrity": "sha512-7xfLk8sANBp+bpPEbjoOZTbPxsa+++b1JXAoSJsNa3vbs9AHHEclmvg54XLQcxH+fuwaeti/g2jeIfJ+mVYLpA==",
|
|
672
669
|
"license": "MIT",
|
|
673
670
|
"dependencies": {
|
|
674
671
|
"@anthropic-ai/sdk": "0.91.1",
|
|
@@ -684,16 +681,16 @@
|
|
|
684
681
|
"typebox": "1.1.38"
|
|
685
682
|
},
|
|
686
683
|
"bin": {
|
|
687
|
-
"pi-ai": "dist/cli.js"
|
|
684
|
+
"pi-ai": "./dist/cli.js"
|
|
688
685
|
},
|
|
689
686
|
"engines": {
|
|
690
687
|
"node": ">=22.19.0"
|
|
691
688
|
}
|
|
692
689
|
},
|
|
693
690
|
"node_modules/@earendil-works/pi-tui": {
|
|
694
|
-
"version": "0.80.
|
|
695
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.80.
|
|
696
|
-
"integrity": "sha512-
|
|
691
|
+
"version": "0.80.6",
|
|
692
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.80.6.tgz",
|
|
693
|
+
"integrity": "sha512-bSuzS4EVSqEPj/Qr/p9eqCESfKsGuDNbl77EGci8Iaqqt/C/XCBZL1MjXaxSWW1NsT5afjp/Cb0NTPzOLv/aPA==",
|
|
697
694
|
"license": "MIT",
|
|
698
695
|
"dependencies": {
|
|
699
696
|
"get-east-asian-width": "1.6.0",
|
|
@@ -3235,9 +3232,9 @@
|
|
|
3235
3232
|
}
|
|
3236
3233
|
},
|
|
3237
3234
|
"node_modules/lru-cache": {
|
|
3238
|
-
"version": "11.
|
|
3239
|
-
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.
|
|
3240
|
-
"integrity": "sha512-
|
|
3235
|
+
"version": "11.5.2",
|
|
3236
|
+
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz",
|
|
3237
|
+
"integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==",
|
|
3241
3238
|
"license": "BlueOak-1.0.0",
|
|
3242
3239
|
"engines": {
|
|
3243
3240
|
"node": "20 || >=22"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.9.5
|
|
3
|
+
"version": "0.9.5",
|
|
4
4
|
"description": "Atomic coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"atomicConfig": {
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"prepublishOnly": "bun run clean && bun run build && bun run shrinkwrap"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@bastani/atomic-natives": "0.9.5
|
|
80
|
+
"@bastani/atomic-natives": "0.9.5",
|
|
81
81
|
"@bufbuild/protobuf": "^2.12.1",
|
|
82
|
-
"@earendil-works/pi-agent-core": "^0.80.
|
|
83
|
-
"@earendil-works/pi-ai": "^0.80.
|
|
84
|
-
"@earendil-works/pi-tui": "^0.80.
|
|
82
|
+
"@earendil-works/pi-agent-core": "^0.80.6",
|
|
83
|
+
"@earendil-works/pi-ai": "^0.80.6",
|
|
84
|
+
"@earendil-works/pi-tui": "^0.80.6",
|
|
85
85
|
"@modelcontextprotocol/ext-apps": "^1.7.4",
|
|
86
86
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
87
87
|
"@mozilla/readability": "^0.6.0",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"ignore": "7.0.5",
|
|
96
96
|
"jiti": "2.7.0",
|
|
97
97
|
"linkedom": "^0.18.12",
|
|
98
|
-
"lru-cache": "11.
|
|
98
|
+
"lru-cache": "11.5.2",
|
|
99
99
|
"markit-ai": "0.5.3",
|
|
100
100
|
"minimatch": "10.2.5",
|
|
101
101
|
"open": "^11.0.0",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
},
|
|
119
119
|
"optionalDependencies": {
|
|
120
120
|
"@mariozechner/clipboard": "0.3.9",
|
|
121
|
-
"@dbos-inc/dbos-sdk": "4.
|
|
121
|
+
"@dbos-inc/dbos-sdk": "4.23.6"
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
124
|
"@types/cross-spawn": "6.0.6",
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { findModelInfo, getSupportedThinkingLevels, splitKnownThinkingSuffix, type ThinkingLevel } from "../../shared/model-info.ts";
|
|
2
|
-
import type { ResolvedStepBehavior } from "../../shared/settings.ts";
|
|
3
|
-
import { resolveModelCandidate } from "../shared/model-fallback.ts";
|
|
4
|
-
import type { ChainClarifyState } from "./chain-clarify-state.ts";
|
|
5
|
-
import type { BehaviorOverride } from "./chain-clarify-types.ts";
|
|
6
|
-
|
|
7
|
-
export function getEffectiveBehavior(state: ChainClarifyState, stepIndex: number): ResolvedStepBehavior {
|
|
8
|
-
const base = state.resolvedBehaviors[stepIndex]!;
|
|
9
|
-
const override = state.behaviorOverrides.get(stepIndex);
|
|
10
|
-
if (!override) return base;
|
|
11
|
-
|
|
12
|
-
return {
|
|
13
|
-
output: override.output !== undefined ? override.output : base.output,
|
|
14
|
-
outputMode: base.outputMode,
|
|
15
|
-
reads: override.reads !== undefined ? override.reads : base.reads,
|
|
16
|
-
progress: override.progress !== undefined ? override.progress : base.progress,
|
|
17
|
-
skills: override.skills !== undefined ? override.skills : base.skills,
|
|
18
|
-
model: override.model !== undefined ? override.model : base.model,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function resolveModelFullId(state: ChainClarifyState, modelName: string): string {
|
|
23
|
-
return resolveModelCandidate(modelName, state.availableModels, state.preferredProvider) ?? modelName;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function getEffectiveModel(state: ChainClarifyState, stepIndex: number): string {
|
|
27
|
-
const override = state.behaviorOverrides.get(stepIndex);
|
|
28
|
-
if (override?.model) return resolveModelFullId(state, override.model);
|
|
29
|
-
|
|
30
|
-
const baseModel = state.resolvedBehaviors[stepIndex]?.model;
|
|
31
|
-
if (baseModel) return resolveModelFullId(state, baseModel);
|
|
32
|
-
return "default";
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function updateBehavior<K extends keyof BehaviorOverride>(
|
|
36
|
-
state: ChainClarifyState,
|
|
37
|
-
stepIndex: number,
|
|
38
|
-
field: K,
|
|
39
|
-
value: Exclude<BehaviorOverride[K], undefined>,
|
|
40
|
-
): void {
|
|
41
|
-
const existing = state.behaviorOverrides.get(stepIndex) ?? {};
|
|
42
|
-
state.behaviorOverrides.set(stepIndex, { ...existing, [field]: value });
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function getAvailableThinkingLevels(state: ChainClarifyState, stepIndex: number): ThinkingLevel[] {
|
|
46
|
-
const model = findModelInfo(getEffectiveModel(state, stepIndex), state.availableModels, state.preferredProvider);
|
|
47
|
-
return getSupportedThinkingLevels(model);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function applyThinkingLevel(state: ChainClarifyState, stepIndex: number, level: ThinkingLevel): void {
|
|
51
|
-
const currentModel = getEffectiveBehavior(state, stepIndex).model;
|
|
52
|
-
if (!currentModel) return;
|
|
53
|
-
|
|
54
|
-
const { baseModel } = splitKnownThinkingSuffix(currentModel);
|
|
55
|
-
const newModel = level === "off" ? baseModel : `${baseModel}:${level}`;
|
|
56
|
-
updateBehavior(state, stepIndex, "model", newModel);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function propagateOutputChange(state: ChainClarifyState, changedStepIndex: number, oldOutput: string, newOutput: string): void {
|
|
60
|
-
for (let i = changedStepIndex + 1; i < state.agentConfigs.length; i++) {
|
|
61
|
-
const behavior = getEffectiveBehavior(state, i);
|
|
62
|
-
|
|
63
|
-
if (behavior.reads === false || !behavior.reads || behavior.reads.length === 0) {
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const readsArray = behavior.reads;
|
|
68
|
-
const oldIndex = readsArray.indexOf(oldOutput);
|
|
69
|
-
if (oldIndex !== -1) {
|
|
70
|
-
const newReads = [...readsArray];
|
|
71
|
-
newReads[oldIndex] = newOutput;
|
|
72
|
-
updateBehavior(state, i, "reads", newReads);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import type { Theme } from "@bastani/atomic";
|
|
2
|
-
import type { Component, TUI } from "@earendil-works/pi-tui";
|
|
3
|
-
import { matchesKey } from "@earendil-works/pi-tui";
|
|
4
|
-
import type { AgentConfig } from "../../agents/agents.ts";
|
|
5
|
-
import type { ModelInfo } from "../../shared/model-info.ts";
|
|
6
|
-
import type { ResolvedStepBehavior } from "../../shared/settings.ts";
|
|
7
|
-
import { updateBehavior } from "./chain-clarify-behavior.ts";
|
|
8
|
-
import { enterEditMode, handleEditInput } from "./chain-clarify-edit.ts";
|
|
9
|
-
import { renderChainMode, renderParallelMode, renderSingleMode } from "./chain-clarify-render-modes.ts";
|
|
10
|
-
import { renderFullEditMode, renderModelSelector, renderSkillSelector, renderThinkingSelector } from "./chain-clarify-render-selectors.ts";
|
|
11
|
-
import { enterModelSelector, enterSkillSelector, enterThinkingSelector, handleModelSelectorInput, handleSkillSelectorInput, handleThinkingSelectorInput } from "./chain-clarify-selectors.ts";
|
|
12
|
-
import { CHAIN_CLARIFY_WIDTH, createChainClarifyState, disposeNoticeTimer, type ChainClarifyState } from "./chain-clarify-state.ts";
|
|
13
|
-
import type { BehaviorOverride, ChainClarifyResult, ClarifyMode, SkillOption } from "./chain-clarify-types.ts";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* TUI component for chain clarification.
|
|
17
|
-
* Factory signature matches ctx.ui.custom: (tui, theme, kb, done) => Component
|
|
18
|
-
*/
|
|
19
|
-
export class ChainClarifyComponent implements Component {
|
|
20
|
-
readonly width = CHAIN_CLARIFY_WIDTH;
|
|
21
|
-
private readonly state: ChainClarifyState;
|
|
22
|
-
|
|
23
|
-
constructor(
|
|
24
|
-
tui: TUI,
|
|
25
|
-
theme: Theme,
|
|
26
|
-
agentConfigs: AgentConfig[],
|
|
27
|
-
templates: string[],
|
|
28
|
-
originalTask: string,
|
|
29
|
-
chainDir: string | undefined,
|
|
30
|
-
resolvedBehaviors: ResolvedStepBehavior[],
|
|
31
|
-
availableModels: ModelInfo[],
|
|
32
|
-
preferredProvider: string | undefined,
|
|
33
|
-
availableSkills: SkillOption[],
|
|
34
|
-
done: (result: ChainClarifyResult) => void,
|
|
35
|
-
mode: ClarifyMode = "chain",
|
|
36
|
-
) {
|
|
37
|
-
this.state = createChainClarifyState({
|
|
38
|
-
tui,
|
|
39
|
-
theme,
|
|
40
|
-
agentConfigs,
|
|
41
|
-
templates,
|
|
42
|
-
originalTask,
|
|
43
|
-
chainDir,
|
|
44
|
-
resolvedBehaviors,
|
|
45
|
-
availableModels,
|
|
46
|
-
preferredProvider,
|
|
47
|
-
availableSkills,
|
|
48
|
-
done,
|
|
49
|
-
mode,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
handleInput(data: string): void {
|
|
54
|
-
const state = this.state;
|
|
55
|
-
if (state.editingStep !== null) {
|
|
56
|
-
this.handleModalInput(data);
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (matchesKey(data, "escape") || matchesKey(data, "ctrl+c")) {
|
|
61
|
-
state.done({ confirmed: false, templates: [], behaviorOverrides: [] });
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (matchesKey(data, "return")) {
|
|
66
|
-
const overrides: (BehaviorOverride | undefined)[] = [];
|
|
67
|
-
for (let i = 0; i < state.agentConfigs.length; i++) {
|
|
68
|
-
overrides.push(state.behaviorOverrides.get(i));
|
|
69
|
-
}
|
|
70
|
-
state.done({
|
|
71
|
-
confirmed: true,
|
|
72
|
-
templates: state.templates,
|
|
73
|
-
behaviorOverrides: overrides,
|
|
74
|
-
runInBackground: state.runInBackground,
|
|
75
|
-
});
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (matchesKey(data, "up")) {
|
|
80
|
-
state.selectedStep = Math.max(0, state.selectedStep - 1);
|
|
81
|
-
state.tui.requestRender();
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (matchesKey(data, "down")) {
|
|
86
|
-
const maxStep = Math.max(0, state.agentConfigs.length - 1);
|
|
87
|
-
state.selectedStep = Math.min(maxStep, state.selectedStep + 1);
|
|
88
|
-
state.tui.requestRender();
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
this.handleMainShortcut(data);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
private handleModalInput(data: string): void {
|
|
96
|
-
const state = this.state;
|
|
97
|
-
if (state.editMode === "model") {
|
|
98
|
-
handleModelSelectorInput(state, data);
|
|
99
|
-
} else if (state.editMode === "thinking") {
|
|
100
|
-
handleThinkingSelectorInput(state, data);
|
|
101
|
-
} else if (state.editMode === "skills") {
|
|
102
|
-
handleSkillSelectorInput(state, data);
|
|
103
|
-
} else {
|
|
104
|
-
handleEditInput(state, data);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
private handleMainShortcut(data: string): void {
|
|
109
|
-
const state = this.state;
|
|
110
|
-
if (data === "e") {
|
|
111
|
-
enterEditMode(state, "template");
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (data === "m") {
|
|
116
|
-
enterModelSelector(state);
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if (data === "t") {
|
|
121
|
-
enterThinkingSelector(state);
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (data === "s") {
|
|
126
|
-
enterSkillSelector(state);
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (data === "w" && state.mode !== "parallel") {
|
|
131
|
-
enterEditMode(state, "output");
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (data === "r" && state.mode === "chain") {
|
|
136
|
-
enterEditMode(state, "reads");
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (data === "p" && state.mode === "chain") {
|
|
141
|
-
this.toggleProgressForAllSteps();
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if (data === "b") {
|
|
146
|
-
state.runInBackground = !state.runInBackground;
|
|
147
|
-
state.tui.requestRender();
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
private toggleProgressForAllSteps(): void {
|
|
152
|
-
const state = this.state;
|
|
153
|
-
const anyEnabled = state.agentConfigs.some((_, i) => {
|
|
154
|
-
const override = state.behaviorOverrides.get(i);
|
|
155
|
-
const base = state.resolvedBehaviors[i]!;
|
|
156
|
-
return override?.progress !== undefined ? override.progress : base.progress;
|
|
157
|
-
});
|
|
158
|
-
const newState = !anyEnabled;
|
|
159
|
-
for (let i = 0; i < state.agentConfigs.length; i++) {
|
|
160
|
-
updateBehavior(state, i, "progress", newState);
|
|
161
|
-
}
|
|
162
|
-
state.tui.requestRender();
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
render(_width: number): string[] {
|
|
166
|
-
const state = this.state;
|
|
167
|
-
if (state.editingStep !== null) {
|
|
168
|
-
return this.renderModal();
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
switch (state.mode) {
|
|
172
|
-
case "single":
|
|
173
|
-
return renderSingleMode(state);
|
|
174
|
-
case "parallel":
|
|
175
|
-
return renderParallelMode(state);
|
|
176
|
-
case "chain":
|
|
177
|
-
return renderChainMode(state);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
private renderModal(): string[] {
|
|
182
|
-
const state = this.state;
|
|
183
|
-
switch (state.editMode) {
|
|
184
|
-
case "model":
|
|
185
|
-
return renderModelSelector(state);
|
|
186
|
-
case "thinking":
|
|
187
|
-
return renderThinkingSelector(state);
|
|
188
|
-
case "skills":
|
|
189
|
-
return renderSkillSelector(state);
|
|
190
|
-
case "template":
|
|
191
|
-
case "output":
|
|
192
|
-
case "reads":
|
|
193
|
-
return renderFullEditMode(state);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
invalidate(): void {}
|
|
198
|
-
|
|
199
|
-
dispose(): void {
|
|
200
|
-
disposeNoticeTimer(this.state);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { matchesKey } from "@earendil-works/pi-tui";
|
|
2
|
-
import { getCursorDisplayPos, handleEditorInput, wrapText } from "./chain-clarify-editor.ts";
|
|
3
|
-
import { getEffectiveBehavior, propagateOutputChange, updateBehavior } from "./chain-clarify-behavior.ts";
|
|
4
|
-
import { EDIT_VIEWPORT_HEIGHT, exitEditMode, type ChainClarifyState } from "./chain-clarify-state.ts";
|
|
5
|
-
import type { EditMode } from "./chain-clarify-types.ts";
|
|
6
|
-
|
|
7
|
-
export function enterEditMode(state: ChainClarifyState, mode: EditMode): void {
|
|
8
|
-
state.editingStep = state.selectedStep;
|
|
9
|
-
state.editMode = mode;
|
|
10
|
-
let buffer = "";
|
|
11
|
-
|
|
12
|
-
if (mode === "template") {
|
|
13
|
-
const template = state.templates[state.selectedStep] ?? "";
|
|
14
|
-
buffer = template.split("\n")[0] ?? "";
|
|
15
|
-
} else if (mode === "output") {
|
|
16
|
-
const behavior = getEffectiveBehavior(state, state.selectedStep);
|
|
17
|
-
buffer = behavior.output === false ? "" : (behavior.output || "");
|
|
18
|
-
} else if (mode === "reads") {
|
|
19
|
-
const behavior = getEffectiveBehavior(state, state.selectedStep);
|
|
20
|
-
buffer = behavior.reads === false ? "" : (behavior.reads?.join(", ") || "");
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
state.editState = { buffer, cursor: 0, viewportOffset: 0 };
|
|
24
|
-
state.tui.requestRender();
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function handleEditInput(state: ChainClarifyState, data: string): void {
|
|
28
|
-
const textWidth = state.width - 4;
|
|
29
|
-
if (matchesKey(data, "shift+up") || matchesKey(data, "pageUp")) {
|
|
30
|
-
const { lines: wrapped, starts } = wrapText(state.editState.buffer, textWidth);
|
|
31
|
-
const cursorPos = getCursorDisplayPos(state.editState.cursor, starts);
|
|
32
|
-
const targetLine = Math.max(0, cursorPos.line - EDIT_VIEWPORT_HEIGHT);
|
|
33
|
-
const targetCol = Math.min(cursorPos.col, wrapped[targetLine]?.length ?? 0);
|
|
34
|
-
state.editState = { ...state.editState, cursor: starts[targetLine]! + targetCol };
|
|
35
|
-
state.tui.requestRender();
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (matchesKey(data, "shift+down") || matchesKey(data, "pageDown")) {
|
|
40
|
-
const { lines: wrapped, starts } = wrapText(state.editState.buffer, textWidth);
|
|
41
|
-
const cursorPos = getCursorDisplayPos(state.editState.cursor, starts);
|
|
42
|
-
const targetLine = Math.min(wrapped.length - 1, cursorPos.line + EDIT_VIEWPORT_HEIGHT);
|
|
43
|
-
const targetCol = Math.min(cursorPos.col, wrapped[targetLine]?.length ?? 0);
|
|
44
|
-
state.editState = { ...state.editState, cursor: starts[targetLine]! + targetCol };
|
|
45
|
-
state.tui.requestRender();
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (matchesKey(data, "tab")) return;
|
|
50
|
-
|
|
51
|
-
const nextState = handleEditorInput(state.editState, data, textWidth);
|
|
52
|
-
if (nextState) {
|
|
53
|
-
state.editState = nextState;
|
|
54
|
-
state.tui.requestRender();
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (matchesKey(data, "escape")) {
|
|
59
|
-
saveEdit(state);
|
|
60
|
-
exitEditMode(state);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (matchesKey(data, "ctrl+c")) {
|
|
65
|
-
exitEditMode(state);
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function saveEdit(state: ChainClarifyState): void {
|
|
71
|
-
const stepIndex = state.editingStep!;
|
|
72
|
-
|
|
73
|
-
if (state.editMode === "template") {
|
|
74
|
-
const original = state.templates[stepIndex] ?? "";
|
|
75
|
-
const originalLines = original.split("\n");
|
|
76
|
-
originalLines[0] = state.editState.buffer;
|
|
77
|
-
state.templates[stepIndex] = originalLines.join("\n");
|
|
78
|
-
} else if (state.editMode === "output") {
|
|
79
|
-
const oldBehavior = getEffectiveBehavior(state, stepIndex);
|
|
80
|
-
const oldOutput = typeof oldBehavior.output === "string" ? oldBehavior.output : null;
|
|
81
|
-
const trimmed = state.editState.buffer.trim();
|
|
82
|
-
const newOutput = trimmed === "" ? false : trimmed;
|
|
83
|
-
updateBehavior(state, stepIndex, "output", newOutput);
|
|
84
|
-
|
|
85
|
-
if (oldOutput && typeof newOutput === "string" && oldOutput !== newOutput) {
|
|
86
|
-
propagateOutputChange(state, stepIndex, oldOutput, newOutput);
|
|
87
|
-
}
|
|
88
|
-
} else if (state.editMode === "reads") {
|
|
89
|
-
const trimmed = state.editState.buffer.trim();
|
|
90
|
-
if (trimmed === "") {
|
|
91
|
-
updateBehavior(state, stepIndex, "reads", false);
|
|
92
|
-
} else {
|
|
93
|
-
const files = trimmed.split(",").map((f) => f.trim()).filter((f) => f !== "");
|
|
94
|
-
updateBehavior(state, stepIndex, "reads", files.length > 0 ? files : false);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|