@bastani/atomic 0.9.19 → 0.9.20-alpha.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 +313 -0
- package/README.md +52 -7
- package/dist/builtin/intercom/CHANGELOG.md +40 -0
- package/dist/builtin/intercom/README.md +2 -2
- package/dist/builtin/intercom/broker/broker.ts +110 -39
- package/dist/builtin/intercom/broker/client.ts +8 -1
- package/dist/builtin/intercom/broker/send-handler.ts +59 -2
- package/dist/builtin/intercom/index.bundle.mjs +177 -19
- package/dist/builtin/intercom/live-route-refusal.ts +69 -0
- package/dist/builtin/intercom/package.json +3 -5
- package/dist/builtin/intercom/recoverable-disconnect.ts +16 -4
- package/dist/builtin/intercom/session-target.ts +34 -9
- package/dist/builtin/intercom/skills/intercom/SKILL.md +47 -16
- package/dist/builtin/intercom/types.ts +3 -1
- package/dist/builtin/mcp/CHANGELOG.md +13 -0
- package/dist/builtin/mcp/OAUTH.md +1 -1
- package/dist/builtin/mcp/README.md +3 -1
- package/dist/builtin/mcp/index.bundle.mjs +412 -64
- package/dist/builtin/mcp/package.json +4 -4
- package/dist/builtin/subagents/CHANGELOG.md +63 -0
- package/dist/builtin/subagents/README.md +4 -2
- package/dist/builtin/subagents/agents/code-simplifier.md +3 -4
- package/dist/builtin/subagents/agents/codebase-analyzer.md +3 -4
- package/dist/builtin/subagents/agents/codebase-locator.md +2 -3
- package/dist/builtin/subagents/agents/codebase-online-researcher.md +5 -6
- package/dist/builtin/subagents/agents/codebase-pattern-finder.md +2 -3
- package/dist/builtin/subagents/agents/codebase-research-analyzer.md +2 -3
- package/dist/builtin/subagents/agents/codebase-research-locator.md +2 -3
- package/dist/builtin/subagents/agents/debugger.md +8 -7
- package/dist/builtin/subagents/agents/worker.md +5 -4
- package/dist/builtin/subagents/package.json +4 -4
- package/dist/builtin/subagents/skills/agent-browser/SKILL.md +56 -0
- package/dist/builtin/subagents/skills/cua-driver/BROWSER.md +494 -0
- package/dist/builtin/subagents/skills/cua-driver/EMBEDDING.md +578 -0
- package/dist/builtin/subagents/skills/cua-driver/LINUX.md +364 -0
- package/dist/builtin/subagents/skills/cua-driver/MACOS.md +509 -0
- package/dist/builtin/subagents/skills/cua-driver/README.md +113 -0
- package/dist/builtin/subagents/skills/cua-driver/RECORDING.md +162 -0
- package/dist/builtin/subagents/skills/cua-driver/SKILL.md +1105 -0
- package/dist/builtin/subagents/skills/cua-driver/WINDOWS.md +866 -0
- package/dist/builtin/subagents/skills/feedback/SKILL.md +49 -0
- package/dist/builtin/subagents/skills/feedback/scripts/scrub.mjs +498 -0
- package/dist/builtin/subagents/skills/subagent/SKILL.md +45 -19
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +276 -68
- package/dist/builtin/web-access/CHANGELOG.md +18 -0
- package/dist/builtin/web-access/index.bundle.mjs +372 -300
- package/dist/builtin/web-access/package.json +3 -3
- package/dist/builtin/workflows/CHANGELOG.md +177 -0
- package/dist/builtin/workflows/README.md +20 -33
- package/dist/builtin/workflows/builtin/adversarial-verification.js +3 -3
- package/dist/builtin/workflows/builtin/{chunk-g0csgs7w.js → chunk-18yz7r43.js} +8 -10
- package/dist/builtin/workflows/builtin/{chunk-31j2gs7h.js → chunk-1pd5zcfa.js} +4 -6
- package/dist/builtin/workflows/builtin/{chunk-xtxcq5tj.js → chunk-24c235x7.js} +17 -1
- package/dist/builtin/workflows/builtin/{chunk-6w6cvk6b.js → chunk-2jv44yz7.js} +4 -6
- package/dist/builtin/workflows/builtin/{chunk-yeee2jrc.js → chunk-2npg6daz.js} +76 -90
- package/dist/builtin/workflows/builtin/{chunk-z29qbehr.js → chunk-7ps7bnb4.js} +4 -6
- package/dist/builtin/workflows/builtin/{chunk-1jth021m.js → chunk-ad864596.js} +13 -218
- package/dist/builtin/workflows/builtin/{chunk-fg9esgkj.js → chunk-f8jjd90r.js} +4 -6
- package/dist/builtin/workflows/builtin/{chunk-a2kdsqn8.js → chunk-gxrhbnaj.js} +5 -3
- package/dist/builtin/workflows/builtin/chunk-twefqrv0.js +10666 -0
- package/dist/builtin/workflows/builtin/{chunk-nkrafh9s.js → chunk-ynded223.js} +40 -111
- package/dist/builtin/workflows/builtin/{chunk-wf741bv3.js → chunk-z5xdqrs6.js} +4 -6
- package/dist/builtin/workflows/builtin/classify-and-act.js +3 -3
- package/dist/builtin/workflows/builtin/fan-out-and-synthesize.js +3 -3
- package/dist/builtin/workflows/builtin/generate-and-filter.js +3 -3
- package/dist/builtin/workflows/builtin/goal.js +4 -4
- package/dist/builtin/workflows/builtin/index.d.ts +1 -1
- package/dist/builtin/workflows/builtin/index.js +12 -12
- package/dist/builtin/workflows/builtin/loop-until-done.js +3 -3
- package/dist/builtin/workflows/builtin/open-claude-design.d.ts +1 -1
- package/dist/builtin/workflows/builtin/open-claude-design.js +3 -3
- package/dist/builtin/workflows/builtin/ralph.js +4 -4
- package/dist/builtin/workflows/builtin/steering-context.js +1 -1
- package/dist/builtin/workflows/builtin/tournament.js +3 -3
- package/dist/builtin/workflows/package.json +4 -4
- package/dist/builtin/workflows/skills/impeccable/SKILL.md +18 -11
- package/dist/builtin/workflows/skills/impeccable/reference/adapt.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/adapt.native.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/animate.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/audit.md +5 -5
- package/dist/builtin/workflows/skills/impeccable/reference/audit.native.md +6 -6
- package/dist/builtin/workflows/skills/impeccable/reference/bolder.md +2 -2
- package/dist/builtin/workflows/skills/impeccable/reference/clarify.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/colorize.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/craft-floor.md +0 -6
- package/dist/builtin/workflows/skills/impeccable/reference/critique.md +19 -41
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/asset-producer.md +11 -65
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/documenter.md +3 -3
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/finish-reviewer.md +4 -4
- package/dist/builtin/workflows/skills/impeccable/reference/degraded/manual-edit-applier.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/delight.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/distill.md +2 -2
- package/dist/builtin/workflows/skills/impeccable/reference/doctor.md +4 -4
- package/dist/builtin/workflows/skills/impeccable/reference/document.md +4 -4
- package/dist/builtin/workflows/skills/impeccable/reference/extract.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/harden.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +21 -21
- package/dist/builtin/workflows/skills/impeccable/reference/init.md +8 -8
- package/dist/builtin/workflows/skills/impeccable/reference/layout.md +2 -2
- package/dist/builtin/workflows/skills/impeccable/reference/live-setup.md +10 -8
- package/dist/builtin/workflows/skills/impeccable/reference/live.md +39 -38
- package/dist/builtin/workflows/skills/impeccable/reference/new-work.md +48 -21
- package/dist/builtin/workflows/skills/impeccable/reference/onboard.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/optimize.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/overdrive.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/polish.md +11 -3
- package/dist/builtin/workflows/skills/impeccable/reference/quieter.md +2 -2
- package/dist/builtin/workflows/skills/impeccable/reference/routing.md +13 -7
- package/dist/builtin/workflows/skills/impeccable/reference/typeset.md +2 -2
- package/dist/builtin/workflows/skills/impeccable/reference/visualize.md +13 -19
- package/dist/builtin/workflows/skills/impeccable/scripts/VERSION +1 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/data/font-index-failures.json +121 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/data/font-index.json +1 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/impeccable +212 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/impeccable.cmd +218 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-dom.js +21 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-ignores.js +242 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/live-browser-session.js +25 -4
- package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +666 -197
- package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +10 -9
- package/dist/builtin/workflows/skills/prompt-engineer/references/advanced_patterns.md +4 -4
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5.md +96 -23
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_fable_5_1.md +75 -27
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_4_8.md +72 -26
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5.md +58 -22
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_opus_5_5.md +118 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_sonnet_5.md +70 -29
- package/dist/builtin/workflows/skills/prompt-engineer/references/core_prompting.md +1 -1
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_5.md +95 -32
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_5_6.md +79 -30
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6.md +139 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/quality_improvement.md +4 -4
- package/dist/builtin/workflows/skills/research-codebase/SKILL.md +1 -1
- package/dist/builtin/workflows/src/authoring.d.ts +6 -1
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +26185 -21957
- package/dist/builtin/workflows/src/index.js +43264 -6482
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +11 -0
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +17 -1
- package/dist/bun/split-loader.js +13 -0
- package/dist/bun/split-loader.js.map +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +17 -6
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/file-processor.d.ts +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-accessors.d.ts.map +1 -1
- package/dist/core/agent-session-accessors.js +2 -1
- package/dist/core/agent-session-accessors.js.map +1 -1
- package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-auto-compaction.js +49 -14
- package/dist/core/agent-session-auto-compaction.js.map +1 -1
- package/dist/core/agent-session-bash.d.ts +3 -1
- package/dist/core/agent-session-bash.d.ts.map +1 -1
- package/dist/core/agent-session-bash.js +27 -14
- package/dist/core/agent-session-bash.js.map +1 -1
- package/dist/core/agent-session-boundaries.d.ts +68 -0
- package/dist/core/agent-session-boundaries.d.ts.map +1 -0
- package/dist/core/agent-session-boundaries.js +339 -0
- package/dist/core/agent-session-boundaries.js.map +1 -0
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +38 -15
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-events.d.ts +6 -6
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +175 -74
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-export.d.ts +1 -1
- package/dist/core/agent-session-export.d.ts.map +1 -1
- package/dist/core/agent-session-export.js +34 -39
- package/dist/core/agent-session-export.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts +3 -2
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +274 -70
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-message-queue.d.ts +1 -1
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js +36 -7
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +55 -15
- 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 +2 -2
- package/dist/core/agent-session-models.d.ts.map +1 -1
- package/dist/core/agent-session-models.js +38 -29
- package/dist/core/agent-session-models.js.map +1 -1
- package/dist/core/agent-session-persistent-custom-messages.d.ts +1 -1
- package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -1
- package/dist/core/agent-session-persistent-custom-messages.js +2 -1
- package/dist/core/agent-session-persistent-custom-messages.js.map +1 -1
- package/dist/core/agent-session-post-tool-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-post-tool-compaction.js +18 -1
- package/dist/core/agent-session-post-tool-compaction.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +186 -36
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-queue-pause.d.ts +2 -0
- package/dist/core/agent-session-queue-pause.d.ts.map +1 -1
- package/dist/core/agent-session-queue-pause.js +15 -3
- package/dist/core/agent-session-queue-pause.js.map +1 -1
- package/dist/core/agent-session-retry.d.ts +0 -3
- package/dist/core/agent-session-retry.d.ts.map +1 -1
- package/dist/core/agent-session-retry.js +28 -20
- package/dist/core/agent-session-retry.js.map +1 -1
- package/dist/core/agent-session-runtime-auth.d.ts.map +1 -1
- package/dist/core/agent-session-runtime-auth.js +10 -0
- package/dist/core/agent-session-runtime-auth.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +21 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +434 -197
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +4 -0
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +31 -2
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session-state.d.ts +10 -2
- package/dist/core/agent-session-state.d.ts.map +1 -1
- package/dist/core/agent-session-state.js +32 -22
- package/dist/core/agent-session-state.js.map +1 -1
- package/dist/core/agent-session-summary.d.ts.map +1 -1
- package/dist/core/agent-session-summary.js +9 -2
- package/dist/core/agent-session-summary.js.map +1 -1
- package/dist/core/agent-session-tasks.d.ts +10 -0
- package/dist/core/agent-session-tasks.d.ts.map +1 -1
- package/dist/core/agent-session-tasks.js +94 -21
- package/dist/core/agent-session-tasks.js.map +1 -1
- package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
- package/dist/core/agent-session-tool-hooks.js +41 -8
- package/dist/core/agent-session-tool-hooks.js.map +1 -1
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +13 -26
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/agent-session-transfer.js.map +1 -1
- package/dist/core/agent-session-tree.d.ts.map +1 -1
- package/dist/core/agent-session-tree.js +8 -3
- package/dist/core/agent-session-tree.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +13 -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 +36 -10
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +137 -68
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +5 -3
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +18 -5
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/builtin-diagnostics.d.ts +2 -0
- package/dist/core/builtin-diagnostics.d.ts.map +1 -0
- package/dist/core/builtin-diagnostics.js +14 -0
- package/dist/core/builtin-diagnostics.js.map +1 -0
- package/dist/core/builtin-packages.d.ts +5 -2
- package/dist/core/builtin-packages.d.ts.map +1 -1
- package/dist/core/builtin-packages.js +24 -3
- package/dist/core/builtin-packages.js.map +1 -1
- package/dist/core/builtin-resource-loader.d.ts +4 -0
- package/dist/core/builtin-resource-loader.d.ts.map +1 -0
- package/dist/core/builtin-resource-loader.js +239 -0
- package/dist/core/builtin-resource-loader.js.map +1 -0
- package/dist/core/cache-retention.d.ts +4 -0
- package/dist/core/cache-retention.d.ts.map +1 -0
- package/dist/core/cache-retention.js +58 -0
- package/dist/core/cache-retention.js.map +1 -0
- package/dist/core/cache-stats.d.ts +7 -1
- package/dist/core/cache-stats.d.ts.map +1 -1
- package/dist/core/cache-stats.js +34 -4
- package/dist/core/cache-stats.js.map +1 -1
- package/dist/core/cache-warmer.d.ts +66 -0
- package/dist/core/cache-warmer.d.ts.map +1 -0
- package/dist/core/cache-warmer.js +313 -0
- package/dist/core/cache-warmer.js.map +1 -0
- package/dist/core/child-session-options.d.ts +5 -0
- package/dist/core/child-session-options.d.ts.map +1 -0
- package/dist/core/child-session-options.js +30 -0
- package/dist/core/child-session-options.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +3 -2
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction-boundary.d.ts +29 -1
- package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
- package/dist/core/compaction/compaction-boundary.js +48 -10
- package/dist/core/compaction/compaction-boundary.js.map +1 -1
- package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
- package/dist/core/compaction/compaction-runner.js +18 -5
- package/dist/core/compaction/compaction-runner.js.map +1 -1
- package/dist/core/compaction/compaction-types.d.ts +7 -0
- 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 +3 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +55 -0
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/fallback-planner.d.ts +1 -0
- package/dist/core/compaction/fallback-planner.d.ts.map +1 -1
- package/dist/core/compaction/fallback-planner.js +2 -0
- package/dist/core/compaction/fallback-planner.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.d.ts.map +1 -1
- package/dist/core/compaction/range-planner.js +3 -3
- package/dist/core/compaction/range-planner.js.map +1 -1
- package/dist/core/compaction/session-summarization.d.ts.map +1 -1
- package/dist/core/compaction/session-summarization.js +2 -1
- package/dist/core/compaction/session-summarization.js.map +1 -1
- package/dist/core/compaction/whole-context-stats.d.ts +21 -0
- package/dist/core/compaction/whole-context-stats.d.ts.map +1 -0
- package/dist/core/compaction/whole-context-stats.js +32 -0
- package/dist/core/compaction/whole-context-stats.js.map +1 -0
- package/dist/core/crash-log.d.ts +6 -0
- package/dist/core/crash-log.d.ts.map +1 -0
- package/dist/core/crash-log.js +69 -0
- package/dist/core/crash-log.js.map +1 -0
- package/dist/core/credential-screening.d.ts +17 -0
- package/dist/core/credential-screening.d.ts.map +1 -0
- package/dist/core/credential-screening.js +30 -0
- package/dist/core/credential-screening.js.map +1 -0
- package/dist/core/execution-model-router.d.ts +45 -0
- package/dist/core/execution-model-router.d.ts.map +1 -0
- package/dist/core/execution-model-router.js +249 -0
- package/dist/core/execution-model-router.js.map +1 -0
- package/dist/core/export-html/template-js/tree-filter-render.js +6 -1
- package/dist/core/export-html/template.js +6 -1
- package/dist/core/extensions/agent-events.d.ts +82 -8
- package/dist/core/extensions/agent-events.d.ts.map +1 -1
- package/dist/core/extensions/agent-events.js.map +1 -1
- package/dist/core/extensions/api-types.d.ts +51 -42
- 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 +7 -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/event-results.d.ts +10 -6
- package/dist/core/extensions/event-results.d.ts.map +1 -1
- package/dist/core/extensions/event-results.js.map +1 -1
- package/dist/core/extensions/event-types.d.ts +3 -2
- package/dist/core/extensions/event-types.d.ts.map +1 -1
- package/dist/core/extensions/event-types.js.map +1 -1
- package/dist/core/extensions/extension-work.d.ts +14 -0
- package/dist/core/extensions/extension-work.d.ts.map +1 -0
- package/dist/core/extensions/extension-work.js +73 -0
- package/dist/core/extensions/extension-work.js.map +1 -0
- package/dist/core/extensions/herdr-file-integration.d.ts +36 -0
- package/dist/core/extensions/herdr-file-integration.d.ts.map +1 -0
- package/dist/core/extensions/herdr-file-integration.js +60 -0
- package/dist/core/extensions/herdr-file-integration.js.map +1 -0
- package/dist/core/extensions/host-input.d.ts +51 -0
- package/dist/core/extensions/host-input.d.ts.map +1 -0
- package/dist/core/extensions/host-input.js +211 -0
- package/dist/core/extensions/host-input.js.map +1 -0
- package/dist/core/extensions/index.d.ts +4 -2
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +0 -3
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/jiti-loader.d.ts +2 -0
- package/dist/core/extensions/jiti-loader.d.ts.map +1 -0
- package/dist/core/extensions/jiti-loader.js +3 -0
- package/dist/core/extensions/jiti-loader.js.map +1 -0
- package/dist/core/extensions/jiti-static-loader.d.ts +2 -0
- package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -0
- package/dist/core/extensions/jiti-static-loader.js +3 -0
- package/dist/core/extensions/jiti-static-loader.js.map +1 -0
- package/dist/core/extensions/loader-api.d.ts +7 -0
- package/dist/core/extensions/loader-api.d.ts.map +1 -1
- package/dist/core/extensions/loader-api.js +154 -28
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/loader-bindings.d.ts +24 -0
- package/dist/core/extensions/loader-bindings.d.ts.map +1 -0
- package/dist/core/extensions/loader-bindings.js +128 -0
- package/dist/core/extensions/loader-bindings.js.map +1 -0
- package/dist/core/extensions/loader-core.d.ts +2 -1
- package/dist/core/extensions/loader-core.d.ts.map +1 -1
- package/dist/core/extensions/loader-core.js +92 -14
- package/dist/core/extensions/loader-core.js.map +1 -1
- package/dist/core/extensions/loader-host-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-host-modules.js +3 -1
- package/dist/core/extensions/loader-host-modules.js.map +1 -1
- package/dist/core/extensions/loader-rollback.d.ts +14 -0
- package/dist/core/extensions/loader-rollback.d.ts.map +1 -0
- package/dist/core/extensions/loader-rollback.js +95 -0
- package/dist/core/extensions/loader-rollback.js.map +1 -0
- package/dist/core/extensions/loader-runtime.d.ts +3 -1
- package/dist/core/extensions/loader-runtime.d.ts.map +1 -1
- package/dist/core/extensions/loader-runtime.js +38 -14
- package/dist/core/extensions/loader-runtime.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 -2
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/provider-types.d.ts +34 -14
- 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/reactive-widget.d.ts +1 -1
- package/dist/core/extensions/reactive-widget.js.map +1 -1
- package/dist/core/extensions/runner-context.d.ts +4 -0
- package/dist/core/extensions/runner-context.d.ts.map +1 -1
- package/dist/core/extensions/runner-context.js +25 -0
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner-events.d.ts +24 -6
- package/dist/core/extensions/runner-events.d.ts.map +1 -1
- package/dist/core/extensions/runner-events.js +153 -58
- package/dist/core/extensions/runner-events.js.map +1 -1
- package/dist/core/extensions/runner-project-trust.d.ts.map +1 -1
- package/dist/core/extensions/runner-project-trust.js +2 -4
- package/dist/core/extensions/runner-project-trust.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +34 -6
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +223 -24
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/runtime-types.d.ts +6 -0
- 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/tool-types.d.ts +9 -0
- package/dist/core/extensions/tool-types.d.ts.map +1 -1
- package/dist/core/extensions/tool-types.js.map +1 -1
- package/dist/core/extensions/types.d.ts +3 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js +0 -12
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/workflow-activity-hub.d.ts +2 -0
- package/dist/core/extensions/workflow-activity-hub.d.ts.map +1 -1
- package/dist/core/extensions/workflow-activity-hub.js +5 -3
- package/dist/core/extensions/workflow-activity-hub.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +5 -3
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/fast-model-routing.d.ts +3 -3
- package/dist/core/fast-model-routing.d.ts.map +1 -1
- package/dist/core/fast-model-routing.js +4 -3
- package/dist/core/fast-model-routing.js.map +1 -1
- package/dist/core/fast-model-variants.d.ts +30 -0
- package/dist/core/fast-model-variants.d.ts.map +1 -1
- package/dist/core/fast-model-variants.js +43 -1
- package/dist/core/fast-model-variants.js.map +1 -1
- package/dist/core/index.d.ts +4 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/mandatory-resource-loader.d.ts +4 -0
- package/dist/core/mandatory-resource-loader.d.ts.map +1 -1
- package/dist/core/mandatory-resource-loader.js +29 -1
- package/dist/core/mandatory-resource-loader.js.map +1 -1
- package/dist/core/mandatory-runtime-tools.d.ts +1 -4
- package/dist/core/mandatory-runtime-tools.d.ts.map +1 -1
- package/dist/core/mandatory-runtime-tools.js +1 -9
- package/dist/core/mandatory-runtime-tools.js.map +1 -1
- package/dist/core/messages.d.ts +10 -0
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +76 -2
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts +178 -10
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +48 -19
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +6 -2
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +12 -2
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver-defaults.d.ts.map +1 -1
- package/dist/core/model-resolver-defaults.js +2 -1
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/model-routing-constraints.d.ts +24 -0
- package/dist/core/model-routing-constraints.d.ts.map +1 -0
- package/dist/core/model-routing-constraints.js +46 -0
- package/dist/core/model-routing-constraints.js.map +1 -0
- package/dist/core/model-routing-task.d.ts +4 -0
- package/dist/core/model-routing-task.d.ts.map +1 -0
- package/dist/core/model-routing-task.js +77 -0
- package/dist/core/model-routing-task.js.map +1 -0
- package/dist/core/model-runtime-auth.d.ts +2 -2
- package/dist/core/model-runtime-auth.d.ts.map +1 -1
- package/dist/core/model-runtime-auth.js.map +1 -1
- package/dist/core/model-runtime-streaming.d.ts +13 -3
- package/dist/core/model-runtime-streaming.d.ts.map +1 -1
- package/dist/core/model-runtime-streaming.js +16 -5
- package/dist/core/model-runtime-streaming.js.map +1 -1
- package/dist/core/model-runtime-types.d.ts +2 -2
- package/dist/core/model-runtime-types.d.ts.map +1 -1
- package/dist/core/model-runtime-types.js.map +1 -1
- package/dist/core/model-runtime.d.ts +29 -6
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +84 -7
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager-npm.d.ts.map +1 -1
- package/dist/core/package-manager-npm.js +32 -8
- package/dist/core/package-manager-npm.js.map +1 -1
- package/dist/core/package-manager-resolver.js +3 -1
- package/dist/core/package-manager-resolver.js.map +1 -1
- package/dist/core/package-manager-types.d.ts +1 -0
- package/dist/core/package-manager-types.d.ts.map +1 -1
- package/dist/core/package-manager-types.js.map +1 -1
- package/dist/core/prompt-templates-async.d.ts +2 -2
- package/dist/core/prompt-templates-async.d.ts.map +1 -1
- package/dist/core/prompt-templates-async.js +57 -29
- package/dist/core/prompt-templates-async.js.map +1 -1
- package/dist/core/prompt-templates.d.ts +6 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +61 -35
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-composer-internal.d.ts +41 -20
- package/dist/core/provider-composer-internal.d.ts.map +1 -1
- package/dist/core/provider-composer-internal.js +43 -20
- package/dist/core/provider-composer-internal.js.map +1 -1
- package/dist/core/provider-composer.d.ts +3 -3
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +54 -10
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +8 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +46 -4
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resolve-config-value.d.ts +2 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +23 -1
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader-assets.d.ts.map +1 -1
- package/dist/core/resource-loader-assets.js +6 -6
- package/dist/core/resource-loader-assets.js.map +1 -1
- package/dist/core/resource-loader-core.d.ts +6 -0
- package/dist/core/resource-loader-core.d.ts.map +1 -1
- package/dist/core/resource-loader-core.js +41 -6
- package/dist/core/resource-loader-core.js.map +1 -1
- package/dist/core/resource-loader-extension-warnings.d.ts +9 -0
- package/dist/core/resource-loader-extension-warnings.d.ts.map +1 -0
- package/dist/core/resource-loader-extension-warnings.js +54 -0
- package/dist/core/resource-loader-extension-warnings.js.map +1 -0
- package/dist/core/resource-loader-extensions.d.ts.map +1 -1
- package/dist/core/resource-loader-extensions.js +3 -0
- package/dist/core/resource-loader-extensions.js.map +1 -1
- package/dist/core/resource-loader-reload.d.ts.map +1 -1
- package/dist/core/resource-loader-reload.js +13 -2
- package/dist/core/resource-loader-reload.js.map +1 -1
- package/dist/core/resource-loader.d.ts +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +1 -1
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts +2 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/runtime-credentials.js +18 -1
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/core/sdk-types.d.ts +18 -5
- package/dist/core/sdk-types.d.ts.map +1 -1
- package/dist/core/sdk-types.js.map +1 -1
- package/dist/core/sdk.d.ts +3 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +231 -42
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-lifecycle-scope.d.ts +15 -0
- package/dist/core/session-lifecycle-scope.d.ts.map +1 -0
- package/dist/core/session-lifecycle-scope.js +13 -0
- package/dist/core/session-lifecycle-scope.js.map +1 -0
- package/dist/core/session-lifecycle-work.d.ts +17 -0
- package/dist/core/session-lifecycle-work.d.ts.map +1 -0
- package/dist/core/session-lifecycle-work.js +144 -0
- package/dist/core/session-lifecycle-work.js.map +1 -0
- package/dist/core/session-manager-core.d.ts +19 -6
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +117 -12
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-entries.d.ts +4 -1
- package/dist/core/session-manager-entries.d.ts.map +1 -1
- package/dist/core/session-manager-entries.js +8 -0
- package/dist/core/session-manager-entries.js.map +1 -1
- package/dist/core/session-manager-history.d.ts +16 -1
- package/dist/core/session-manager-history.d.ts.map +1 -1
- package/dist/core/session-manager-history.js +106 -40
- package/dist/core/session-manager-history.js.map +1 -1
- package/dist/core/session-manager-list.d.ts +3 -3
- package/dist/core/session-manager-list.d.ts.map +1 -1
- package/dist/core/session-manager-list.js +89 -74
- package/dist/core/session-manager-list.js.map +1 -1
- package/dist/core/session-manager-storage.d.ts.map +1 -1
- package/dist/core/session-manager-storage.js +10 -7
- package/dist/core/session-manager-storage.js.map +1 -1
- package/dist/core/session-manager-types.d.ts +41 -4
- package/dist/core/session-manager-types.d.ts.map +1 -1
- package/dist/core/session-manager-types.js.map +1 -1
- package/dist/core/session-manager.d.ts +2 -2
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +1 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-startup-rollback.d.ts +5 -0
- package/dist/core/session-startup-rollback.d.ts.map +1 -0
- package/dist/core/session-startup-rollback.js +16 -0
- package/dist/core/session-startup-rollback.js.map +1 -0
- package/dist/core/settings-manager-basic-accessors.d.ts +5 -0
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +35 -0
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-manager-core.d.ts.map +1 -1
- package/dist/core/settings-manager-core.js +4 -0
- package/dist/core/settings-manager-core.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +1 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-types.d.ts +4 -0
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/settings-write-ownership.d.ts +7 -0
- package/dist/core/settings-write-ownership.d.ts.map +1 -0
- package/dist/core/settings-write-ownership.js +24 -0
- package/dist/core/settings-write-ownership.js.map +1 -0
- package/dist/core/skill-catalog.d.ts.map +1 -1
- package/dist/core/skill-catalog.js +18 -6
- package/dist/core/skill-catalog.js.map +1 -1
- package/dist/core/slash-commands.js +1 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/structured-output/choice-schema.d.ts +8 -0
- package/dist/core/structured-output/choice-schema.d.ts.map +1 -0
- package/dist/core/structured-output/choice-schema.js +79 -0
- package/dist/core/structured-output/choice-schema.js.map +1 -0
- package/dist/core/structured-output/index.d.ts +10 -0
- package/dist/core/structured-output/index.d.ts.map +1 -0
- package/dist/core/structured-output/index.js +424 -0
- package/dist/core/structured-output/index.js.map +1 -0
- package/dist/core/structured-output/invalid-output.d.ts +8 -0
- package/dist/core/structured-output/invalid-output.d.ts.map +1 -0
- package/dist/core/structured-output/invalid-output.js +4 -0
- package/dist/core/structured-output/invalid-output.js.map +1 -0
- package/dist/core/structured-output/resolver.d.ts +3 -0
- package/dist/core/structured-output/resolver.d.ts.map +1 -0
- package/dist/core/structured-output/resolver.js +26 -0
- package/dist/core/structured-output/resolver.js.map +1 -0
- package/dist/core/structured-output/types.d.ts +76 -0
- package/dist/core/structured-output/types.d.ts.map +1 -0
- package/dist/core/structured-output/types.js +2 -0
- package/dist/core/structured-output/types.js.map +1 -0
- package/dist/core/system-prompt.d.ts +48 -5
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +141 -100
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tasks/child-command-owner.d.ts +34 -0
- package/dist/core/tasks/child-command-owner.d.ts.map +1 -0
- package/dist/core/tasks/child-command-owner.js +70 -0
- package/dist/core/tasks/child-command-owner.js.map +1 -0
- package/dist/core/tasks/contracts.d.ts +6 -0
- package/dist/core/tasks/contracts.d.ts.map +1 -1
- package/dist/core/tasks/contracts.js.map +1 -1
- package/dist/core/tasks/owner-store.d.ts +6 -0
- package/dist/core/tasks/owner-store.d.ts.map +1 -1
- package/dist/core/tasks/owner-store.js +16 -3
- package/dist/core/tasks/owner-store.js.map +1 -1
- package/dist/core/tasks/pause.js +1 -1
- package/dist/core/tasks/pause.js.map +1 -1
- package/dist/core/tasks/supervisor.d.ts +4 -2
- package/dist/core/tasks/supervisor.d.ts.map +1 -1
- package/dist/core/tasks/supervisor.js +16 -3
- package/dist/core/tasks/supervisor.js.map +1 -1
- package/dist/core/tools/ask-user-question/ask-user-question.d.ts +4 -1
- package/dist/core/tools/ask-user-question/ask-user-question.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/ask-user-question.js +32 -35
- package/dist/core/tools/ask-user-question/ask-user-question.js.map +1 -1
- package/dist/core/tools/ask-user-question/index.d.ts +1 -1
- package/dist/core/tools/ask-user-question/index.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/build-questionnaire.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/build-questionnaire.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/key-router.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/key-router.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/questionnaire-session.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/questionnaire-session.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/row-intent.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/row-intent.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/selectors/contract.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/selectors/contract.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/selectors/derivations.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/selectors/derivations.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/state-reducer.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/state-reducer.js.map +1 -1
- package/dist/core/tools/ask-user-question/state/state.d.ts +1 -1
- package/dist/core/tools/ask-user-question/state/state.js.map +1 -1
- package/dist/core/tools/ask-user-question/tool/format-answer.d.ts +1 -1
- package/dist/core/tools/ask-user-question/tool/format-answer.js.map +1 -1
- package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts +1 -1
- package/dist/core/tools/ask-user-question/tool/response-envelope.js.map +1 -1
- package/dist/core/tools/ask-user-question/tool/validate-questionnaire.d.ts +1 -1
- package/dist/core/tools/ask-user-question/tool/validate-questionnaire.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/multi-select-view.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/multi-select-view.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/markdown-content-cache.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/markdown-content-cache.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-block-renderer.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-block-renderer.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-layout-decider.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-layout-decider.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-pane.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-pane.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/submit-picker.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/wrapping-select.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/dialog-builder.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/dialog-builder.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/props-adapter.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/props-adapter.js.map +1 -1
- package/dist/core/tools/ask-user-question/view/tab-content-strategy.d.ts +1 -1
- package/dist/core/tools/ask-user-question/view/tab-content-strategy.js.map +1 -1
- package/dist/core/tools/bash-pty-native.d.ts +5 -1
- package/dist/core/tools/bash-pty-native.d.ts.map +1 -1
- package/dist/core/tools/bash-pty-native.js +15 -7
- package/dist/core/tools/bash-pty-native.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +32 -24
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +1 -0
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/file-mutation-coordinator.d.ts +4 -3
- package/dist/core/tools/file-mutation-coordinator.d.ts.map +1 -1
- package/dist/core/tools/file-mutation-coordinator.js +45 -38
- package/dist/core/tools/file-mutation-coordinator.js.map +1 -1
- package/dist/core/tools/find.d.ts +2 -2
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +1 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/kill.d.ts +2 -2
- package/dist/core/tools/kill.d.ts.map +1 -1
- package/dist/core/tools/kill.js +3 -4
- package/dist/core/tools/kill.js.map +1 -1
- package/dist/core/tools/powershell.d.ts +16 -0
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/read.d.ts +4 -0
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +5 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/structured-output.d.ts +9 -6
- package/dist/core/tools/structured-output.d.ts.map +1 -1
- package/dist/core/tools/structured-output.js +36 -8
- package/dist/core/tools/structured-output.js.map +1 -1
- package/dist/core/tools/todos.d.ts.map +1 -1
- package/dist/core/tools/todos.js +1 -0
- package/dist/core/tools/todos.js.map +1 -1
- package/dist/core/tools/tool-concurrency.d.ts +23 -0
- package/dist/core/tools/tool-concurrency.d.ts.map +1 -0
- package/dist/core/tools/tool-concurrency.js +58 -0
- package/dist/core/tools/tool-concurrency.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +4 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +2 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +1 -0
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +4 -0
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/herdr/index.d.ts.map +1 -1
- package/dist/extensions/herdr/index.js +0 -7
- package/dist/extensions/herdr/index.js.map +1 -1
- package/dist/extensions/llama/client.d.ts +2 -0
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +6 -2
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +18 -4
- package/dist/extensions/llama/provider.js.map +1 -1
- 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 +13 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/main-app-mode.d.ts +1 -1
- package/dist/main-app-mode.d.ts.map +1 -1
- package/dist/main-app-mode.js +3 -2
- package/dist/main-app-mode.js.map +1 -1
- package/dist/main-session.d.ts.map +1 -1
- package/dist/main-session.js +24 -16
- package/dist/main-session.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +9 -6
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/atomic-banner.d.ts.map +1 -1
- package/dist/modes/interactive/components/atomic-banner.js +3 -2
- package/dist/modes/interactive/components/atomic-banner.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 +12 -5
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.d.ts +5 -1
- 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 +2 -2
- package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.d.ts +2 -0
- package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.js +30 -12
- package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +6 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +17 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/host-input-form-mount.d.ts +1 -1
- package/dist/modes/interactive/components/host-input-form-mount.js.map +1 -1
- package/dist/modes/interactive/components/host-input-form.d.ts +1 -1
- package/dist/modes/interactive/components/host-input-form.js.map +1 -1
- package/dist/modes/interactive/components/host-session-picker.d.ts +1 -1
- package/dist/modes/interactive/components/host-session-picker.js.map +1 -1
- package/dist/modes/interactive/components/reserved-bottom-overlay.d.ts +1 -1
- package/dist/modes/interactive/components/reserved-bottom-overlay.js.map +1 -1
- package/dist/modes/interactive/components/scroll-widget.d.ts +1 -1
- package/dist/modes/interactive/components/scroll-widget.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-handlers.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-handlers.js +3 -0
- package/dist/modes/interactive/components/settings-selector-handlers.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.js +52 -1
- package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-submenus.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-submenus.js +2 -1
- package/dist/modes/interactive/components/settings-selector-submenus.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.d.ts +8 -2
- package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.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 +11 -4
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/startup-identity.d.ts +3 -0
- package/dist/modes/interactive/components/startup-identity.d.ts.map +1 -1
- package/dist/modes/interactive/components/startup-identity.js +11 -2
- package/dist/modes/interactive/components/startup-identity.js.map +1 -1
- package/dist/modes/interactive/components/task-inspector.d.ts +1 -0
- package/dist/modes/interactive/components/task-inspector.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-inspector.js +11 -11
- package/dist/modes/interactive/components/task-inspector.js.map +1 -1
- package/dist/modes/interactive/components/task-list.d.ts +9 -3
- package/dist/modes/interactive/components/task-list.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-list.js +26 -2
- package/dist/modes/interactive/components/task-list.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +14 -9
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-content.js +6 -0
- package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector-model.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-model.js +1 -0
- package/dist/modes/interactive/components/tree-selector-model.js.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.js +20 -10
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.js +3 -5
- package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.js +2 -2
- package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-autocomplete.js +4 -0
- package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
- package/dist/modes/interactive/interactive-bash-compact.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-bash-compact.js +13 -6
- package/dist/modes/interactive/interactive-bash-compact.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +5 -0
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +2 -2
- package/dist/modes/interactive/interactive-input-handling.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-mode-helpers.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.js +16 -0
- package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +2 -1
- 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-process-lifecycle.js +13 -1
- package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +30 -34
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-resource-rendering.js +6 -9
- package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
- package/dist/modes/interactive/interactive-selectors.js +11 -0
- package/dist/modes/interactive/interactive-selectors.js.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js +5 -1
- package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +2 -4
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +2 -2
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-tui.d.ts +3 -6
- package/dist/modes/interactive/interactive-tui.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-tui.js +15 -5
- package/dist/modes/interactive/interactive-tui.js.map +1 -1
- package/dist/modes/interactive/overlay-line-composite.d.ts +7 -0
- package/dist/modes/interactive/overlay-line-composite.d.ts.map +1 -0
- package/dist/modes/interactive/overlay-line-composite.js +24 -0
- package/dist/modes/interactive/overlay-line-composite.js.map +1 -0
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.js +3 -1
- package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
- package/dist/modes/interactive-engine/engine-input-form.d.ts +1 -1
- package/dist/modes/interactive-engine/engine-input-form.js.map +1 -1
- package/dist/modes/interactive-engine/engine-session-picker.d.ts +1 -1
- package/dist/modes/interactive-engine/engine-session-picker.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-auth.d.ts +16 -0
- package/dist/modes/interactive-engine/isolated-auth.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-auth.js +27 -0
- package/dist/modes/interactive-engine/isolated-auth.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +5 -0
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +19 -2
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts +1 -1
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/interactive-engine/remote-component.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +2 -1
- package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-api.js +7 -2
- package/dist/modes/rpc/rpc-client-api.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +3 -1
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-keybindings-reload.d.ts +1 -1
- package/dist/modes/rpc/rpc-keybindings-reload.js.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.d.ts +3 -2
- package/dist/modes/rpc/rpc-provider-auth.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.js +2 -2
- package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +2 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/session-id-target.d.ts +31 -0
- package/dist/session-id-target.d.ts.map +1 -0
- package/dist/session-id-target.js +57 -0
- package/dist/session-id-target.js.map +1 -0
- package/dist/utils/abort.d.ts.map +1 -1
- package/dist/utils/abort.js +29 -4
- package/dist/utils/abort.js.map +1 -1
- package/dist/utils/child-process.d.ts +1 -0
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js +7 -8
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +15 -29
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +88 -12
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/mime.js +1 -1
- package/dist/utils/mime.js.map +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +18 -1
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/tool-result-images.d.ts +3 -1
- package/dist/utils/tool-result-images.d.ts.map +1 -1
- package/dist/utils/tool-result-images.js +4 -1
- package/dist/utils/tool-result-images.js.map +1 -1
- package/dist/utils/wsl.d.ts +3 -0
- package/dist/utils/wsl.d.ts.map +1 -0
- package/dist/utils/wsl.js +15 -0
- package/dist/utils/wsl.js.map +1 -0
- package/docs/background-tasks.md +38 -16
- package/docs/build.md +6 -16
- package/docs/compaction/reference.md +12 -12
- package/docs/compaction.md +33 -109
- package/docs/computer-use.md +124 -76
- package/docs/containerization.md +4 -5
- package/docs/custom-provider/api-reference.md +10 -1
- package/docs/custom-provider/oauth.md +4 -2
- package/docs/custom-provider/registration.md +1 -1
- package/docs/custom-provider/streaming.md +8 -3
- package/docs/custom-provider.md +44 -2
- package/docs/development.md +13 -138
- package/docs/docs.json +19 -4
- package/docs/environment-variables.md +21 -5
- package/docs/extensions/api-reference.md +6 -2
- package/docs/extensions/authoring.md +29 -7
- package/docs/extensions/events.md +107 -31
- package/docs/extensions/examples.md +1 -0
- package/docs/extensions/ui.md +3 -4
- package/docs/extensions.md +28 -20
- package/docs/getting-started/authentication.md +4 -1
- package/docs/getting-started/first-session.md +11 -8
- package/docs/getting-started/installation.md +14 -6
- package/docs/getting-started/project-instructions.md +5 -1
- package/docs/guides/configuration.md +10 -5
- package/docs/guides/non-interactive.md +2 -2
- package/docs/guides.md +8 -17
- package/docs/herdr.md +2 -1
- package/docs/index.md +2 -2
- package/docs/intercom/operations.md +25 -67
- package/docs/intercom/reference.md +15 -5
- package/docs/intercom.md +16 -7
- package/docs/json.md +12 -2
- package/docs/keybindings.md +15 -8
- package/docs/llama-cpp.md +6 -2
- package/docs/mcp-servers.md +93 -0
- package/docs/models/evals.md +75 -465
- package/docs/models/model-selection.md +35 -116
- package/docs/models/reference.md +70 -24
- package/docs/models.md +7 -4
- package/docs/packages/authoring.md +8 -2
- package/docs/packages/reference.md +5 -1
- package/docs/packages.md +7 -3
- package/docs/programmatic.md +3 -1
- package/docs/prompt-templates.md +3 -2
- package/docs/providers/reference.md +2 -2
- package/docs/providers.md +55 -18
- package/docs/quickstart.md +8 -4
- package/docs/reference/cli.md +21 -13
- package/docs/reference.md +3 -6
- package/docs/rpc/examples.md +2 -0
- package/docs/rpc/protocol.md +11 -13
- package/docs/rpc.md +5 -1
- package/docs/sdk/reference.md +62 -267
- package/docs/sdk/structured-decisions.md +94 -0
- package/docs/sdk.md +194 -19
- package/docs/security.md +7 -4
- package/docs/session-format.md +35 -7
- package/docs/sessions.md +12 -6
- package/docs/settings.md +68 -16
- package/docs/skills/authoring.md +7 -1
- package/docs/skills.md +33 -8
- package/docs/subagents/authoring.md +11 -1
- package/docs/subagents/reference.md +97 -10
- package/docs/subagents.md +52 -36
- package/docs/terminal-setup.md +4 -2
- package/docs/termux.md +3 -1
- package/docs/themes/reference.md +4 -1
- package/docs/themes.md +1 -1
- package/docs/tools.md +431 -20
- package/docs/tui/reference.md +13 -14
- package/docs/tui.md +10 -6
- package/docs/usage.md +34 -7
- package/docs/web-access.md +5 -1
- package/docs/windows.md +18 -11
- package/docs/workflows/api-reference.md +112 -27
- package/docs/workflows/authoring.md +345 -33
- package/docs/workflows/builtins.md +22 -28
- package/docs/workflows/operations.md +259 -138
- package/docs/workflows/reliable-design.md +59 -130
- package/docs/workflows/verification.md +40 -14
- package/docs/workflows.md +12 -17
- package/examples/extensions/README.md +1 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +15 -10
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +2 -2
- package/examples/extensions/debug-provider.ts +90 -0
- package/examples/extensions/prompt-customizer.ts +17 -37
- package/examples/extensions/structured-output.ts +6 -0
- package/examples/rpc-client.ts +38 -0
- package/examples/rpc-extension-ui.ts +19 -5
- package/examples/sdk/README.md +1 -1
- package/npm-shrinkwrap.json +506 -713
- package/package.json +13 -11
- package/dist/builtin/subagents/skills/playwright-cli/SKILL.md +0 -420
- package/dist/builtin/subagents/skills/playwright-cli/references/element-attributes.md +0 -23
- package/dist/builtin/subagents/skills/playwright-cli/references/playwright-tests.md +0 -39
- package/dist/builtin/subagents/skills/playwright-cli/references/request-mocking.md +0 -87
- package/dist/builtin/subagents/skills/playwright-cli/references/running-code.md +0 -241
- package/dist/builtin/subagents/skills/playwright-cli/references/session-management.md +0 -225
- package/dist/builtin/subagents/skills/playwright-cli/references/storage-state.md +0 -275
- package/dist/builtin/subagents/skills/playwright-cli/references/test-generation.md +0 -433
- package/dist/builtin/subagents/skills/playwright-cli/references/tracing.md +0 -139
- package/dist/builtin/subagents/skills/playwright-cli/references/video-recording.md +0 -143
- package/dist/builtin/workflows/builtin/chunk-ngkqkzej.js +0 -2813
- package/dist/builtin/workflows/skills/impeccable/agents/impeccable_asset_producer.toml +0 -94
- package/dist/builtin/workflows/skills/impeccable/agents/impeccable_documenter.toml +0 -27
- package/dist/builtin/workflows/skills/impeccable/agents/impeccable_finish_reviewer.toml +0 -41
- package/dist/builtin/workflows/skills/impeccable/agents/impeccable_manual_edit_applier.toml +0 -95
- package/dist/builtin/workflows/skills/impeccable/agents/openai.yaml +0 -4
- package/dist/builtin/workflows/skills/impeccable/scripts/concept-seed.mjs +0 -695
- package/dist/builtin/workflows/skills/impeccable/scripts/context-signals.mjs +0 -325
- package/dist/builtin/workflows/skills/impeccable/scripts/context.mjs +0 -1503
- package/dist/builtin/workflows/skills/impeccable/scripts/critique-storage.mjs +0 -222
- package/dist/builtin/workflows/skills/impeccable/scripts/detect-csp.mjs +0 -198
- package/dist/builtin/workflows/skills/impeccable/scripts/detect.mjs +0 -21
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/browser/injected/index.mjs +0 -2073
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/cli/main.mjs +0 -432
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/design-system.mjs +0 -1121
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/detect-antipatterns-browser.js +0 -8746
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/detect-antipatterns.mjs +0 -51
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/browser/detect-url.mjs +0 -376
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/regex/detect-text.mjs +0 -1168
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/static-html/css-cascade.mjs +0 -1192
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/static-html/detect-html.mjs +0 -290
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/visual/screenshot-contrast.mjs +0 -189
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/findings.mjs +0 -18
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/node/file-system.mjs +0 -213
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/profile/profiler.mjs +0 -166
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/registry/antipatterns.mjs +0 -617
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/rules/checks.mjs +0 -5534
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/color.mjs +0 -588
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/constants.mjs +0 -112
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/fonts.mjs +0 -30
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/inline-ignores.mjs +0 -148
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/page.mjs +0 -35
- package/dist/builtin/workflows/skills/impeccable/scripts/doctor.mjs +0 -338
- package/dist/builtin/workflows/skills/impeccable/scripts/embed-prompt.mjs +0 -270
- package/dist/builtin/workflows/skills/impeccable/scripts/generate-image.mjs +0 -277
- package/dist/builtin/workflows/skills/impeccable/scripts/hook-admin.mjs +0 -783
- package/dist/builtin/workflows/skills/impeccable/scripts/hook-lib.mjs +0 -2305
- package/dist/builtin/workflows/skills/impeccable/scripts/hook.mjs +0 -78
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/artifact-schema.mjs +0 -93
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/composition-catalog.mjs +0 -200
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/concept-catalog.mjs +0 -395
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/design-parser.mjs +0 -925
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/impeccable-config.mjs +0 -640
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/impeccable-paths.mjs +0 -137
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/is-generated.mjs +0 -72
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/open-system-browser.mjs +0 -57
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/provider.mjs +0 -5
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/roll-selection.mjs +0 -369
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness-deep.mjs +0 -483
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness-notice.mjs +0 -169
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness.mjs +0 -528
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/surface-briefs.mjs +0 -151
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/target-args.mjs +0 -42
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/target-slug.mjs +0 -33
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/template-extensions.mjs +0 -146
- package/dist/builtin/workflows/skills/impeccable/scripts/live/accept-css.mjs +0 -617
- package/dist/builtin/workflows/skills/impeccable/scripts/live/accept-verify.mjs +0 -71
- package/dist/builtin/workflows/skills/impeccable/scripts/live/browser-script-parts.mjs +0 -77
- package/dist/builtin/workflows/skills/impeccable/scripts/live/completion.mjs +0 -28
- package/dist/builtin/workflows/skills/impeccable/scripts/live/event-validation.mjs +0 -199
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/astro.mjs +0 -47
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/detect-utils.mjs +0 -157
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/index.mjs +0 -143
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/journal.mjs +0 -205
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/nextjs.mjs +0 -49
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/nuxt.mjs +0 -170
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/script-src.mjs +0 -26
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/static-html.mjs +0 -26
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/sveltekit.mjs +0 -71
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/tag-strategy.mjs +0 -247
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/tanstack-start.mjs +0 -70
- package/dist/builtin/workflows/skills/impeccable/scripts/live/frameworks/vite-generic.mjs +0 -42
- package/dist/builtin/workflows/skills/impeccable/scripts/live/generation-preflight.mjs +0 -149
- package/dist/builtin/workflows/skills/impeccable/scripts/live/insert-ui.mjs +0 -458
- package/dist/builtin/workflows/skills/impeccable/scripts/live/instructions.mjs +0 -169
- package/dist/builtin/workflows/skills/impeccable/scripts/live/manual-apply.mjs +0 -939
- package/dist/builtin/workflows/skills/impeccable/scripts/live/manual-edit-routes.mjs +0 -357
- package/dist/builtin/workflows/skills/impeccable/scripts/live/manual-edits-buffer.mjs +0 -152
- package/dist/builtin/workflows/skills/impeccable/scripts/live/poll-lanes.mjs +0 -14
- package/dist/builtin/workflows/skills/impeccable/scripts/live/roots.mjs +0 -670
- package/dist/builtin/workflows/skills/impeccable/scripts/live/session-store.mjs +0 -563
- package/dist/builtin/workflows/skills/impeccable/scripts/live/source-lock.mjs +0 -105
- package/dist/builtin/workflows/skills/impeccable/scripts/live/source-search.mjs +0 -105
- package/dist/builtin/workflows/skills/impeccable/scripts/live/svelte-ast.mjs +0 -969
- package/dist/builtin/workflows/skills/impeccable/scripts/live/svelte-component.mjs +0 -1401
- package/dist/builtin/workflows/skills/impeccable/scripts/live/sveltekit-adapter.mjs +0 -314
- package/dist/builtin/workflows/skills/impeccable/scripts/live/tanstack-adapter.mjs +0 -280
- package/dist/builtin/workflows/skills/impeccable/scripts/live/ui-surfaces.mjs +0 -75
- package/dist/builtin/workflows/skills/impeccable/scripts/live/vocabulary.mjs +0 -171
- package/dist/builtin/workflows/skills/impeccable/scripts/live-accept.mjs +0 -961
- package/dist/builtin/workflows/skills/impeccable/scripts/live-commit-manual-edits.mjs +0 -1244
- package/dist/builtin/workflows/skills/impeccable/scripts/live-complete.mjs +0 -107
- package/dist/builtin/workflows/skills/impeccable/scripts/live-copy-edit-agent.mjs +0 -800
- package/dist/builtin/workflows/skills/impeccable/scripts/live-discard-manual-edits.mjs +0 -51
- package/dist/builtin/workflows/skills/impeccable/scripts/live-inject.mjs +0 -515
- package/dist/builtin/workflows/skills/impeccable/scripts/live-insert.mjs +0 -292
- package/dist/builtin/workflows/skills/impeccable/scripts/live-manual-edit-evidence.mjs +0 -371
- package/dist/builtin/workflows/skills/impeccable/scripts/live-poll.mjs +0 -427
- package/dist/builtin/workflows/skills/impeccable/scripts/live-resume.mjs +0 -123
- package/dist/builtin/workflows/skills/impeccable/scripts/live-server.mjs +0 -1675
- package/dist/builtin/workflows/skills/impeccable/scripts/live-status.mjs +0 -71
- package/dist/builtin/workflows/skills/impeccable/scripts/live-target.mjs +0 -30
- package/dist/builtin/workflows/skills/impeccable/scripts/live-wrap.mjs +0 -927
- package/dist/builtin/workflows/skills/impeccable/scripts/live.mjs +0 -365
- package/dist/builtin/workflows/skills/impeccable/scripts/palette.mjs +0 -628
- package/dist/builtin/workflows/skills/impeccable/scripts/pin.mjs +0 -224
- package/dist/builtin/workflows/skills/impeccable/scripts/serve-question.mjs +0 -1540
- package/dist/builtin/workflows/skills/impeccable/scripts/surface-brief.mjs +0 -74
- package/dist/builtin/workflows/skills/prompt-engineer/references/gpt_6_astra.md +0 -58
- package/docs/models/artificial-analysis-index.md +0 -89
- package/docs/models/pareto-efficiency.md +0 -90
- package/docs/tools/edit.md +0 -378
|
@@ -22,6 +22,7 @@ export class StartupIdentityComponent {
|
|
|
22
22
|
constructor(ui, compose, animate = startupMotionEnabled()) {
|
|
23
23
|
this.startedAt = Date.now();
|
|
24
24
|
this.settled = false;
|
|
25
|
+
this.renderedLines = [];
|
|
25
26
|
this.ui = ui;
|
|
26
27
|
this.compose = compose;
|
|
27
28
|
this.settled = !animate;
|
|
@@ -41,7 +42,13 @@ export class StartupIdentityComponent {
|
|
|
41
42
|
markLifecycleTiming("startup-coherent");
|
|
42
43
|
if (state.complete)
|
|
43
44
|
markLifecycleTiming("startup-complete");
|
|
44
|
-
|
|
45
|
+
const text = this.compose(width, state);
|
|
46
|
+
if (text !== this.renderedText || width !== this.renderedWidth) {
|
|
47
|
+
this.renderedText = text;
|
|
48
|
+
this.renderedWidth = width;
|
|
49
|
+
this.renderedLines = new Text(text, 1, 0).render(width);
|
|
50
|
+
}
|
|
51
|
+
return this.renderedLines;
|
|
45
52
|
}
|
|
46
53
|
settle() {
|
|
47
54
|
if (this.settled)
|
|
@@ -57,6 +64,8 @@ export class StartupIdentityComponent {
|
|
|
57
64
|
this.ui.requestRender();
|
|
58
65
|
}
|
|
59
66
|
setExpanded(_expanded) { }
|
|
60
|
-
invalidate() {
|
|
67
|
+
invalidate() {
|
|
68
|
+
this.renderedText = undefined;
|
|
69
|
+
}
|
|
61
70
|
}
|
|
62
71
|
//# sourceMappingURL=startup-identity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startup-identity.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/startup-identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAAY,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAQ7E,MAAM,UAAU,qBAAqB,CAAC,SAAiB;IACtD,IAAI,SAAS,IAAI,IAAI;QAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5E,IAAI,SAAS,IAAI,GAAG;QAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC5E,IAAI,SAAS,IAAI,GAAG;QAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC5E,IAAI,SAAS,IAAI,GAAG;QAAE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AAI,IAAI,CAAC,KAAK;YAAE,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO;QACN,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;IAED,WAAW,CAAC,SAAkB,IAAS,CAAC;IACxC,UAAU;QACT,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;IAC/B,CAAC;CACD","sourcesContent":["import { type Component, Text, type TUI } from \"@earendil-works/pi-tui\";\nimport { markLifecycleTiming } from \"../../../core/lifecycle-timings.ts\";\nimport { STARTUP_ASSEMBLY_GAPS, STARTUP_FRAME_MS } from \"./atomic-banner.ts\";\n\nexport interface StartupAnimationState {\n\tgap: number;\n\tmanifestoPhase: number;\n\tcomplete: boolean;\n}\n\nexport function startupStateAtElapsed(elapsedMs: number): StartupAnimationState {\n\tif (elapsedMs >= 1040) return { gap: 0, manifestoPhase: 4, complete: true };\n\tif (elapsedMs >= 960) return { gap: 0, manifestoPhase: 3, complete: false };\n\tif (elapsedMs >= 880) return { gap: 0, manifestoPhase: 2, complete: false };\n\tif (elapsedMs >= 800) return { gap: 0, manifestoPhase: 1, complete: false };\n\tif (elapsedMs >= 640) return { gap: 0, manifestoPhase: 0, complete: false };\n\tconst frame = Math.min(7, Math.floor(Math.max(0, elapsedMs) / STARTUP_FRAME_MS));\n\treturn { gap: STARTUP_ASSEMBLY_GAPS[frame]!, manifestoPhase: 0, complete: false };\n}\n\nexport function startupMotionEnabled(): boolean {\n\treturn process.stdout.isTTY === true && process.env.ATOMIC_REDUCED_MOTION !== \"1\";\n}\n\nexport class StartupIdentityComponent implements Component {\n\tprivate readonly ui: TUI;\n\tprivate readonly compose: (width: number, state: StartupAnimationState) => string;\n\tprivate readonly startedAt = Date.now();\n\tprivate settled = false;\n\tprivate timer: ReturnType<typeof setInterval> | undefined;\n\tprivate renderedText: string | undefined;\n\tprivate renderedWidth: number | undefined;\n\tprivate renderedLines: string[] = [];\n\n\tconstructor(\n\t\tui: TUI,\n\t\tcompose: (width: number, state: StartupAnimationState) => string,\n\t\tanimate = startupMotionEnabled(),\n\t) {\n\t\tthis.ui = ui;\n\t\tthis.compose = compose;\n\t\tthis.settled = !animate;\n\t\tif (animate) {\n\t\t\tthis.timer = setInterval(() => {\n\t\t\t\tif (Date.now() - this.startedAt >= 1040) this.settle();\n\t\t\t\tthis.ui.requestRender();\n\t\t\t}, STARTUP_FRAME_MS);\n\t\t\tthis.timer.unref?.();\n\t\t}\n\t}\n\n\trender(width: number): string[] {\n\t\tconst state = this.settled\n\t\t\t? { gap: 0, manifestoPhase: 4, complete: true }\n\t\t\t: startupStateAtElapsed(Date.now() - this.startedAt);\n\t\tmarkLifecycleTiming(\"startup-coherent\");\n\t\tif (state.complete) markLifecycleTiming(\"startup-complete\");\n\t\tconst text = this.compose(width, state);\n\t\tif (text !== this.renderedText || width !== this.renderedWidth) {\n\t\t\tthis.renderedText = text;\n\t\t\tthis.renderedWidth = width;\n\t\t\tthis.renderedLines = new Text(text, 1, 0).render(width);\n\t\t}\n\t\treturn this.renderedLines;\n\t}\n\n\tsettle(): boolean {\n\t\tif (this.settled) return false;\n\t\tthis.settled = true;\n\t\tif (this.timer) clearInterval(this.timer);\n\t\tthis.timer = undefined;\n\t\tthis.ui.requestRender();\n\t\treturn true;\n\t}\n\n\trefresh(): void {\n\t\tthis.ui.requestRender();\n\t}\n\n\tsetExpanded(_expanded: boolean): void {}\n\tinvalidate(): void {\n\t\tthis.renderedText = undefined;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-inspector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/task-inspector.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,KAAK,SAAS,EAOd,MAAM,wBAAwB,CAAC;AAG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,CAEtB;IACD,OAAO,IAAI,IAAI,CAKd;IACD,UAAU,IAAI,IAAI,CAEjB;IACD,OAAO,CAAC,QAAQ;IAGhB,OAAO,CAAC,cAAc;YAMR,SAAS;IAkBvB,OAAO,CAAC,qBAAqB;IAK7B,OAAO,CAAC,iBAAiB;YAWX,cAAc;YAyGd,UAAU;
|
|
1
|
+
{"version":3,"file":"task-inspector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/task-inspector.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,KAAK,SAAS,EAOd,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAgBzE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,gFAAgF;AAChF,qBAAa,aAAc,YAAW,SAAS;IAC9C,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IACpC,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,YAAY,CAAC,CAA4B;IACjD,OAAO,CAAC,UAAU,CAAC,CAAc;IACjC,OAAO,CAAC,cAAc,CAAC,CAAqB;IAC5C,OAAO,CAAC,wBAAwB,CAAS;IACzC,OAAO,CAAC,mBAAmB,CAAS;IACpC,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,oBAAoB,CAAS;IACrC,OAAO,CAAC,kBAAkB,CAAK;IAC/B,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,aAAa,CAAiD;IACtE,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;IACzC,YACC,YAAY,EAAE,cAAc,EAC5B,aAAa,EAAE,MAAM,IAAI,EACzB,YAAY,EAAE,MAAM,IAAI,EACxB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,EAgE3C;IACD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiB;IACvC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAa;IAC3C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAEtB;IACD,OAAO,CAAC,eAAe;IAGvB,OAAO,IAAI,IAAI,CAKd;IACD,UAAU,IAAI,IAAI,CAEjB;IACD,OAAO,CAAC,QAAQ;IAGhB,OAAO,CAAC,cAAc;YAMR,SAAS;IAkBvB,OAAO,CAAC,qBAAqB;IAK7B,OAAO,CAAC,iBAAiB;YAWX,cAAc;YAyGd,UAAU;IA2DxB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAwFjC;IACD,OAAO,CAAC,iBAAiB;IAKzB,qFAAqF;IACrF,IAAI,UAAU,IAAI,OAAO,CAMxB;IACD,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,CAE3D;IACD,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAE9B;IACD,OAAO,CAAC,wBAAwB;IAkChC,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAmEtD;IACD,OAAO,CAAC,SAAS;CAsDjB"}
|
|
@@ -2,7 +2,7 @@ import { randomUUID } from "node:crypto";
|
|
|
2
2
|
import { stripVTControlCharacters } from "node:util";
|
|
3
3
|
import { getKeybindings, Input, matchesKey, Text, truncateToWidth, visibleWidth, } from "@earendil-works/pi-tui";
|
|
4
4
|
import { taskOutputText } from "../../../core/tasks/command-output.js";
|
|
5
|
-
import { taskTranscriptSource } from "../../../core/tasks/supervisor.js";
|
|
5
|
+
import { taskOwnTranscriptEntries, taskTranscriptSource } from "../../../core/tasks/supervisor.js";
|
|
6
6
|
import { readTaskTranscriptSnapshot } from "../../../core/tasks/transcript.js";
|
|
7
7
|
import { theme } from "../theme/theme.js";
|
|
8
8
|
import { chatEntriesFromAgentMessages, renderChatMessageEntry } from "./chat-message-renderer.js";
|
|
@@ -81,7 +81,7 @@ export class TaskInspector {
|
|
|
81
81
|
},
|
|
82
82
|
});
|
|
83
83
|
this.unsubscribe = this.store.subscribe(() => {
|
|
84
|
-
this.navigation.update(this.
|
|
84
|
+
this.navigation.update(this.orderedSections().flatMap((section) => section.tasks));
|
|
85
85
|
if (this.transcriptRequested) {
|
|
86
86
|
this.refreshTranscript();
|
|
87
87
|
}
|
|
@@ -89,7 +89,7 @@ export class TaskInspector {
|
|
|
89
89
|
void this.loadDetail();
|
|
90
90
|
this.requestRender();
|
|
91
91
|
});
|
|
92
|
-
this.navigation.update(this.
|
|
92
|
+
this.navigation.update(this.orderedSections().flatMap((section) => section.tasks));
|
|
93
93
|
this.navigation.open();
|
|
94
94
|
this.input.onSubmit = (text) => {
|
|
95
95
|
void this.sendInput(text);
|
|
@@ -98,6 +98,9 @@ export class TaskInspector {
|
|
|
98
98
|
open(id) {
|
|
99
99
|
this.navigation.open(id);
|
|
100
100
|
}
|
|
101
|
+
orderedSections() {
|
|
102
|
+
return taskListSections(this.store.backgroundTasks, this.store.settlementOrder);
|
|
103
|
+
}
|
|
101
104
|
dispose() {
|
|
102
105
|
this.disposed = true;
|
|
103
106
|
this.releaseLiveTranscript();
|
|
@@ -280,11 +283,9 @@ export class TaskInspector {
|
|
|
280
283
|
const lease = this.store.resolveTask(task.ref.taskId);
|
|
281
284
|
if (!lease.ok)
|
|
282
285
|
return;
|
|
283
|
-
const
|
|
284
|
-
if (
|
|
285
|
-
const prompt =
|
|
286
|
-
.getEntries()
|
|
287
|
-
.find((entry) => entry.type === "message" && entry.message.role === "user");
|
|
286
|
+
const ownEntries = taskOwnTranscriptEntries(lease.value);
|
|
287
|
+
if (ownEntries) {
|
|
288
|
+
const prompt = ownEntries.find((entry) => entry.type === "message" && entry.message.role === "user");
|
|
288
289
|
if (prompt?.type === "message" && prompt.message.role === "user")
|
|
289
290
|
this.detailContent.prompt =
|
|
290
291
|
typeof prompt.message.content === "string"
|
|
@@ -293,8 +294,7 @@ export class TaskInspector {
|
|
|
293
294
|
.filter((block) => block.type === "text")
|
|
294
295
|
.map((block) => block.text)
|
|
295
296
|
.join("");
|
|
296
|
-
const response =
|
|
297
|
-
.getEntries()
|
|
297
|
+
const response = ownEntries
|
|
298
298
|
.slice()
|
|
299
299
|
.reverse()
|
|
300
300
|
.find((entry) => entry.type === "message" && entry.message.role === "assistant");
|
|
@@ -565,7 +565,7 @@ export class TaskInspector {
|
|
|
565
565
|
this.status,
|
|
566
566
|
];
|
|
567
567
|
}
|
|
568
|
-
const sections =
|
|
568
|
+
const sections = this.orderedSections();
|
|
569
569
|
if (!sections.length)
|
|
570
570
|
return new Text("No background tasks.\nBackground agents and shells will appear here.", 0, 0).render(width);
|
|
571
571
|
return sections.flatMap((section) => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-inspector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/task-inspector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,EAEN,cAAc,EACd,KAAK,EACL,UAAU,EACV,IAAI,EACJ,eAAe,EACf,YAAY,GACZ,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAGvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,O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C,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC;gBAClL,MAAM,QAAQ,GAAG;oBAChB,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC9B,SAAS,CAAC,IAAI,CAAC;oBACf,eAAe,CAAC,IAAI,CAAC;oBACrB,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE;iBACjF;qBACC,MAAM,CAAC,OAAO,CAAC;qBACf,IAAI,CAAC,KAAK,CAAC,CAAC;gBACd,OAAO;oBACN,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC;oBAC3B,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,KAAK,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBACvG,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,KAAK,eAAe,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;iBAChG,CAAC;YACH,CAAC,CAAC;SACF,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { stripVTControlCharacters } from \"node:util\";\nimport type { AgentMessage } from \"@earendil-works/pi-agent-core\";\nimport {\n\ttype Component,\n\tgetKeybindings,\n\tInput,\n\tmatchesKey,\n\tText,\n\ttruncateToWidth,\n\tvisibleWidth,\n} from \"@earendil-works/pi-tui\";\nimport type { KeybindingsManager } from \"../../../core/keybindings.ts\";\nimport { taskOutputText } from \"../../../core/tasks/command-output.js\";\nimport type { OperationId, PromptRoute, TaskId } from \"../../../core/tasks/contracts.js\";\nimport type { OwnerTaskStore } from \"../../../core/tasks/owner-store.js\";\nimport { taskTranscriptSource } from \"../../../core/tasks/supervisor.js\";\nimport { readTaskTranscriptSnapshot } from \"../../../core/tasks/transcript.js\";\nimport { theme } from \"../theme/theme.js\";\nimport { chatEntriesFromAgentMessages, renderChatMessageEntry } from \"./chat-message-renderer.ts\";\nimport { mouseWheelDeltaRows } from \"./chat-transcript.js\";\nimport { keyHintIfBound } from \"./keybinding-hints.js\";\nimport {\n\tTaskDetail,\n\ttype TaskDetailContent,\n\ttaskDetailActions,\n\ttaskDetailLabels,\n\ttaskDetailSummary,\n} from \"./task-detail.js\";\nimport { taskListSections } from \"./task-list.js\";\nimport { TaskLiveTranscript } from \"./task-live-transcript.js\";\nimport { TaskNavigation } from \"./task-navigation.js\";\nimport { taskDisplayText, taskLabel, taskMetricsText, taskModelText, taskStatusAppearance } from \"./task-row.js\";\n\n/** Focused view only. The store and original session remain the authorities. */\nexport class TaskInspector implements Component {\n\treadonly navigation: TaskNavigation;\n\tprivate actionIndex = 0;\n\tprivate confirmation?: (answer: boolean) => void;\n\tprivate transcript?: Component[];\n\tprivate liveTranscript?: TaskLiveTranscript;\n\tprivate transcriptRefreshPending = false;\n\tprivate transcriptRequested = false;\n\tprivate transcriptLoading = false;\n\tprivate transcriptHistorical = false;\n\tprivate transcriptPageRows = 5;\n\tprivate cursor?: string;\n\tprivate status = \"\";\n\tprivate scroll = 0;\n\tprivate detailContent: Omit<TaskDetailContent, \"stdinAvailable\"> = {};\n\tprivate detailTaskId?: TaskId;\n\tprivate detailGeneration = 0;\n\tprivate disposed = false;\n\tprivate readonly input = new Input();\n\tprivate readonly unsubscribe: () => void;\n\tconstructor(\n\t\tprivateStore: OwnerTaskStore,\n\t\tprivateRender: () => void,\n\t\tprivateClose: () => void,\n\t\topenQuestion?: (route: PromptRoute) => void,\n\t) {\n\t\tthis.store = privateStore;\n\t\tthis.requestRender = privateRender;\n\t\tthis.close = privateClose;\n\t\tthis.navigation = new TaskNavigation(getKeybindings() as KeybindingsManager, {\n\t\t\tinspect: () => {\n\t\t\t\tthis.releaseLiveTranscript();\n\t\t\t\tthis.actionIndex = 0;\n\t\t\t\tthis.scroll = 0;\n\t\t\t\tthis.transcript = undefined;\n\t\t\t\tthis.transcriptRequested = false;\n\t\t\t\tthis.transcriptLoading = false;\n\t\t\t\tthis.transcriptHistorical = false;\n\t\t\t\tvoid this.loadDetail();\n\t\t\t},\n\t\t\ttranscript: () => {\n\t\t\t\tthis.detailGeneration++;\n\t\t\t\tthis.scroll = 0;\n\t\t\t\tvoid this.loadTranscript();\n\t\t\t},\n\t\t\tforeground: (task) => {\n\t\t\t\tconst lease = this.store.resolveTask(task.ref.taskId);\n\t\t\t\tif (lease.ok)\n\t\t\t\t\tvoid this.store.supervisor.foregroundTask(lease.value).then((result) => {\n\t\t\t\t\t\tthis.status = result.ok ? result.value.kind : result.error.message;\n\t\t\t\t\t\tthis.requestRender();\n\t\t\t\t\t});\n\t\t\t},\n\t\t\tconfirmCancel: () =>\n\t\t\t\tnew Promise<boolean>((resolve) => {\n\t\t\t\t\tthis.confirmation = resolve;\n\t\t\t\t\tthis.requestRender();\n\t\t\t\t}),\n\t\t\tcancel: (task) => {\n\t\t\t\tconst lease = this.store.resolveTask(task.ref.taskId);\n\t\t\t\tif (lease.ok) void this.store.supervisor.cancelTask(lease.value, \"user\").then(() => this.requestRender());\n\t\t\t},\n\t\t\tstdinAvailable: (task) => {\n\t\t\t\tconst lease = this.store.resolveTask(task.ref.taskId);\n\t\t\t\treturn lease.ok && this.store.supervisor.taskStdin(lease.value).ok;\n\t\t\t},\n\t\t\tinput: () => {\n\t\t\t\tthis.input.setValue(\"\");\n\t\t\t},\n\t\t\topenQuestion: (route) => {\n\t\t\t\tif (openQuestion) {\n\t\t\t\t\tthis.close();\n\t\t\t\t\topenQuestion(route);\n\t\t\t\t} else this.status = \"Question is available in its owning session.\";\n\t\t\t},\n\t\t});\n\t\tthis.unsubscribe = this.store.subscribe(() => {\n\t\t\tthis.navigation.update(this.store.backgroundTasks);\n\t\t\tif (this.transcriptRequested) {\n\t\t\t\tthis.refreshTranscript();\n\t\t\t} else if (this.navigation.focus.kind === \"detail\") void this.loadDetail();\n\t\t\tthis.requestRender();\n\t\t});\n\t\tthis.navigation.update(this.store.backgroundTasks);\n\t\tthis.navigation.open();\n\t\tthis.input.onSubmit = (text) => {\n\t\t\tvoid this.sendInput(text);\n\t\t};\n\t}\n\tprivate readonly store: OwnerTaskStore;\n\tprivate readonly requestRender: () => void;\n\tprivate readonly close: () => void;\n\topen(id?: TaskId): void {\n\t\tthis.navigation.open(id);\n\t}\n\tdispose(): void {\n\t\tthis.disposed = true;\n\t\tthis.releaseLiveTranscript();\n\t\tthis.confirmation?.(false);\n\t\tthis.unsubscribe();\n\t}\n\tinvalidate(): void {\n\t\tfor (const component of this.transcript ?? []) component.invalidate();\n\t}\n\tprivate selected() {\n\t\treturn this.store.backgroundTasks.find((task) => task.ref.taskId === this.navigation.selectedTaskId);\n\t}\n\tprivate stdinAvailable(): boolean {\n\t\tconst task = this.selected();\n\t\tif (!task || task.execution.kind === \"settled\") return false;\n\t\tconst lease = this.store.resolveTask(task.ref.taskId);\n\t\treturn lease.ok && this.store.supervisor.taskStdin(lease.value).ok;\n\t}\n\tprivate async sendInput(text: string): Promise<void> {\n\t\tconst task = this.selected();\n\t\tif (!task) return;\n\t\tconst lease = this.store.resolveTask(task.ref.taskId);\n\t\tif (!lease.ok) return;\n\t\tconst stdin = this.store.supervisor.taskStdin(lease.value);\n\t\tif (!stdin.ok) {\n\t\t\tthis.status = stdin.error.message;\n\t\t\treturn;\n\t\t}\n\t\tconst result = await this.store.supervisor.writeTaskInput(stdin.value, randomUUID() as OperationId, {\n\t\t\tkind: \"bytes\",\n\t\t\tbytes: Buffer.from(`${text}\\n`),\n\t\t});\n\t\tthis.status = result.ok ? `Sent ${result.value.acceptedBytes} bytes` : result.error.message;\n\t\tthis.input.setValue(\"\");\n\t\tthis.requestRender();\n\t}\n\tprivate releaseLiveTranscript(): void {\n\t\tthis.liveTranscript?.dispose();\n\t\tthis.liveTranscript = undefined;\n\t\tthis.transcriptRefreshPending = false;\n\t}\n\tprivate refreshTranscript(): void {\n\t\tif (this.disposed || !this.transcriptRequested) return;\n\t\tconst task = this.selected();\n\t\tconst lease = task && this.store.resolveTask(task.ref.taskId);\n\t\tconst bound = lease?.ok ? taskTranscriptSource(lease.value) : undefined;\n\t\tif (bound?.ok && this.liveTranscript?.source === bound.value.session) return;\n\t\t// Legacy history-only sources have no live tail; keep their retained page anchored.\n\t\tif (bound?.ok && !bound.value.session.subscribe && this.transcriptHistorical) return;\n\t\tif (this.transcriptLoading) this.transcriptRefreshPending = true;\n\t\telse void this.loadTranscript();\n\t}\n\tprivate async loadTranscript(earlier = false): Promise<void> {\n\t\tconst task = this.selected();\n\t\tif (!task) return;\n\t\tconst generation = ++this.detailGeneration;\n\t\tconst focus = this.navigation.focus;\n\t\tthis.transcriptRequested = true;\n\t\tthis.transcriptLoading = true;\n\t\tif (earlier) this.transcriptHistorical = true;\n\t\tthis.requestRender();\n\t\ttry {\n\t\t\tconst lease = this.store.resolveTask(task.ref.taskId);\n\t\t\tif (!lease.ok) {\n\t\t\t\tthis.status = lease.error.message;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (task.kind === \"command\") {\n\t\t\t\tconst count = BigInt(task.output.byteCount);\n\t\t\t\tconst page = await this.store.supervisor.readTaskOutput(lease.value, {\n\t\t\t\t\tstart: String(count > 8192n ? count - 8192n : 0n),\n\t\t\t\t\tmaximumBytes: 8192,\n\t\t\t\t});\n\t\t\t\tif (\n\t\t\t\t\tthis.disposed ||\n\t\t\t\t\tgeneration !== this.detailGeneration ||\n\t\t\t\t\tfocus !== this.navigation.focus ||\n\t\t\t\t\ttask.ref.taskId !== this.navigation.selectedTaskId\n\t\t\t\t)\n\t\t\t\t\treturn;\n\t\t\t\tconst text = page.ok ? taskOutputText(page.value) : page.error.message;\n\t\t\t\tthis.transcript = [\n\t\t\t\t\tnew Text(text.split(\"\\n\").map(taskDisplayText).join(\"\\n\") || \"No output available\", 0, 0),\n\t\t\t\t];\n\t\t\t\tthis.cursor = undefined;\n\t\t\t\tthis.status =\n\t\t\t\t\tcount > 8192n ? \"Earlier output omitted · showing retained 8 KiB tail\" : \"Retained shell output\";\n\t\t\t\tthis.requestRender();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst page = readTaskTranscriptSnapshot(lease.value, earlier ? this.cursor : undefined);\n\t\t\tif (\n\t\t\t\tthis.disposed ||\n\t\t\t\tgeneration !== this.detailGeneration ||\n\t\t\t\tfocus !== this.navigation.focus ||\n\t\t\t\ttask.ref.taskId !== this.navigation.selectedTaskId\n\t\t\t)\n\t\t\t\treturn;\n\t\t\tconst bound = taskTranscriptSource(lease.value);\n\t\t\tif (!bound.ok || (!page.ok && !bound.value.session.subscribe)) {\n\t\t\t\tthis.status = \"Transcript unavailable\";\n\t\t\t\tthis.requestRender();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst ids = new Set(page.ok ? page.value.items.map((item) => item.source.entryId) : []);\n\t\t\tconst messages = bound.value.session.getEntries().flatMap<AgentMessage>((entry) => {\n\t\t\t\tif (entry.type !== \"message\" || !ids.has(entry.id)) return [];\n\t\t\t\tconst message = entry.message;\n\t\t\t\tif (message.role === \"assistant\")\n\t\t\t\t\treturn [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...message,\n\t\t\t\t\t\t\tcontent: message.content.filter(\n\t\t\t\t\t\t\t\t(block, index) =>\n\t\t\t\t\t\t\t\t\tblock.type !== \"thinking\" &&\n\t\t\t\t\t\t\t\t\tpage.ok &&\n\t\t\t\t\t\t\t\t\tpage.value.items.some(\n\t\t\t\t\t\t\t\t\t\t(item) => item.source.entryId === entry.id && item.source.contentIndex === index,\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t];\n\t\t\t\treturn message.role === \"user\" || message.role === \"toolResult\" ? [message] : [];\n\t\t\t});\n\t\t\tconst components = chatEntriesFromAgentMessages(messages).map((entry) =>\n\t\t\t\trenderChatMessageEntry(entry, {\n\t\t\t\t\tui: { requestRender: this.requestRender },\n\t\t\t\t\tcwd: process.cwd(),\n\t\t\t\t\thideThinkingBlock: true,\n\t\t\t\t\ttoolOutputExpanded: true,\n\t\t\t\t\tshowImages: false,\n\t\t\t\t}),\n\t\t\t);\n\t\t\tif (!earlier && bound.value.session.subscribe) {\n\t\t\t\tthis.releaseLiveTranscript();\n\t\t\t\tthis.liveTranscript = new TaskLiveTranscript(bound.value.session, messages, this.requestRender);\n\t\t\t\tthis.transcript = [this.liveTranscript];\n\t\t\t} else this.transcript = earlier ? [...components, ...(this.transcript ?? [])] : components;\n\t\t\tthis.cursor = page.ok ? page.value.nextCursor : undefined;\n\t\t\tthis.status = this.cursor ? \"PageUp: earlier retained messages\" : \"\";\n\t\t\tthis.requestRender();\n\t\t} catch {\n\t\t\tif (!this.disposed && generation === this.detailGeneration && focus === this.navigation.focus) {\n\t\t\t\tthis.transcript = [];\n\t\t\t\tthis.status = \"Task output unavailable\";\n\t\t\t\tthis.requestRender();\n\t\t\t}\n\t\t} finally {\n\t\t\tif (generation === this.detailGeneration) {\n\t\t\t\tthis.transcriptLoading = false;\n\t\t\t\tif (this.transcriptRefreshPending) {\n\t\t\t\t\tthis.transcriptRefreshPending = false;\n\t\t\t\t\tthis.refreshTranscript();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tprivate async loadDetail(): Promise<void> {\n\t\tconst selectedId = this.selected()?.ref.taskId;\n\t\tif (selectedId !== this.detailTaskId) {\n\t\t\tthis.detailContent = {};\n\t\t\tthis.detailTaskId = selectedId;\n\t\t}\n\t\tthis.status = \"\";\n\t\tconst generation = ++this.detailGeneration;\n\t\tconst focus = this.navigation.focus;\n\t\tconst task = this.selected();\n\t\tif (!task) return;\n\t\tconst current = () =>\n\t\t\t!this.disposed &&\n\t\t\tgeneration === this.detailGeneration &&\n\t\t\tthis.navigation.focus === focus &&\n\t\t\tfocus.kind === \"detail\" &&\n\t\t\tthis.navigation.selectedTaskId === task.ref.taskId;\n\t\tconst lease = this.store.resolveTask(task.ref.taskId);\n\t\tif (!lease.ok) return;\n\t\tconst source = taskTranscriptSource(lease.value);\n\t\tif (source.ok) {\n\t\t\tconst prompt = source.value.session\n\t\t\t\t.getEntries()\n\t\t\t\t.find((entry) => entry.type === \"message\" && entry.message.role === \"user\");\n\t\t\tif (prompt?.type === \"message\" && prompt.message.role === \"user\")\n\t\t\t\tthis.detailContent.prompt =\n\t\t\t\t\ttypeof prompt.message.content === \"string\"\n\t\t\t\t\t\t? prompt.message.content\n\t\t\t\t\t\t: prompt.message.content\n\t\t\t\t\t\t\t\t.filter((block) => block.type === \"text\")\n\t\t\t\t\t\t\t\t.map((block) => block.text)\n\t\t\t\t\t\t\t\t.join(\"\");\n\t\t\tconst response = source.value.session\n\t\t\t\t.getEntries()\n\t\t\t\t.slice()\n\t\t\t\t.reverse()\n\t\t\t\t.find((entry) => entry.type === \"message\" && entry.message.role === \"assistant\");\n\t\t\tif (response?.type === \"message\" && response.message.role === \"assistant\")\n\t\t\t\tthis.detailContent.output = response.message.content\n\t\t\t\t\t.filter((block) => block.type === \"text\")\n\t\t\t\t\t.map((block) => block.text)\n\t\t\t\t\t.join(\"\");\n\t\t}\n\t\tif (task.kind === \"command\") {\n\t\t\ttry {\n\t\t\t\tconst count = BigInt(task.output.byteCount);\n\t\t\t\tconst output = await this.store.supervisor.readTaskOutput(lease.value, {\n\t\t\t\t\tstart: String(count > 8192n ? count - 8192n : 0n),\n\t\t\t\t\tmaximumBytes: 8192,\n\t\t\t\t});\n\t\t\t\tif (!current()) return;\n\t\t\t\tif (output.ok) {\n\t\t\t\t\tthis.detailContent.output = taskOutputText(output.value);\n\t\t\t\t\tthis.detailContent.outputOmitted = count > 8192n || output.value.omittedRanges.length > 0;\n\t\t\t\t} else this.status = output.error.message;\n\t\t\t} catch {\n\t\t\t\tif (!current()) return;\n\t\t\t\tthis.status = \"Command output unavailable\";\n\t\t\t}\n\t\t}\n\t\tif (current()) this.requestRender();\n\t}\n\thandleInput(data: string): boolean {\n\t\tif (this.confirmation) {\n\t\t\tif (data === \"y\" || data === \"n\" || matchesKey(data, \"escape\")) {\n\t\t\t\tconst answer = this.confirmation;\n\t\t\t\tthis.confirmation = undefined;\n\t\t\t\tanswer(data === \"y\");\n\t\t\t}\n\t\t\tthis.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\tconst wheel = mouseWheelDeltaRows(data);\n\t\tif (wheel !== 0) {\n\t\t\tif (this.navigation.focus.kind === \"tasks\") this.navigation.moveSelection(Math.sign(wheel));\n\t\t\telse if (this.navigation.focus.kind === \"detail\") {\n\t\t\t\tif (this.transcriptRequested && wheel < 0 && this.scroll === 0 && this.cursor && !this.transcriptLoading)\n\t\t\t\t\tvoid this.loadTranscript(true);\n\t\t\t\telse this.scroll = Math.max(0, this.scroll + wheel);\n\t\t\t}\n\t\t\tthis.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\t// Mouse reports are never text input, including horizontal wheel/release.\n\t\tif (/^\\x1b\\[<\\d+;\\d+;\\d+[mM]$/.test(data) || data.startsWith(\"\\x1b[M\")) return true;\n\t\tif (\n\t\t\tmatchesKey(data, \"escape\") ||\n\t\t\t(matchesKey(data, \"left\") && this.navigation.focus.kind !== \"stdin\" && !this.configuredTaskKey(data))\n\t\t) {\n\t\t\tif (this.transcriptRequested) {\n\t\t\t\tthis.releaseLiveTranscript();\n\t\t\t\tthis.detailGeneration++;\n\t\t\t\tthis.transcript = undefined;\n\t\t\t\tthis.transcriptRequested = false;\n\t\t\t\tthis.transcriptLoading = false;\n\t\t\t\tthis.transcriptHistorical = false;\n\t\t\t\tthis.scroll = 0;\n\t\t\t\tvoid this.loadDetail();\n\t\t\t} else {\n\t\t\t\tthis.navigation.handleInput(\"\\x1b\", \"tasks\");\n\t\t\t\tif (this.navigation.focus.kind === \"composer\") this.close();\n\t\t\t}\n\t\t\tthis.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\tif (this.navigation.focus.kind === \"stdin\") {\n\t\t\tthis.input.handleInput(data);\n\t\t\tthis.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\tif (data === \"x\" && !this.configuredTaskKey(data)) {\n\t\t\tvoid this.navigation.activate(\"cancel\");\n\t\t\treturn true;\n\t\t}\n\t\tif (this.transcriptRequested) {\n\t\t\tif (this.configuredTaskKey(data)) this.navigation.handleInput(data, \"tasks\");\n\t\t\telse if (matchesKey(data, \"up\")) this.scroll = Math.max(0, this.scroll - 1);\n\t\t\telse if (matchesKey(data, \"down\")) this.scroll++;\n\t\t\telse if (matchesKey(data, \"pageUp\")) {\n\t\t\t\tif (this.scroll === 0 && this.cursor && !this.transcriptLoading) void this.loadTranscript(true);\n\t\t\t\telse this.scroll = Math.max(0, this.scroll - this.transcriptPageRows);\n\t\t\t} else if (matchesKey(data, \"pageDown\")) this.scroll += this.transcriptPageRows;\n\t\t\telse if (matchesKey(data, \"home\")) this.scroll = 0;\n\t\t\telse if (matchesKey(data, \"end\")) this.scroll = Number.MAX_SAFE_INTEGER;\n\t\t\tthis.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\tconst task = this.selected();\n\t\tif (task && this.navigation.focus.kind === \"detail\") {\n\t\t\tconst actions = taskDetailActions(task.execution, task.attention, this.stdinAvailable());\n\t\t\tif (this.configuredTaskKey(data)) {\n\t\t\t\tif (getKeybindings().matches(data, \"app.tasks.inspect\"))\n\t\t\t\t\tvoid this.navigation.activate(actions[Math.min(this.actionIndex, actions.length - 1)]);\n\t\t\t\telse this.navigation.handleInput(data, \"tasks\");\n\t\t\t\tthis.requestRender();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (matchesKey(data, \"pageUp\") || matchesKey(data, \"pageDown\")) {\n\t\t\t\tthis.scroll = Math.max(0, this.scroll + (matchesKey(data, \"pageUp\") ? -5 : 5));\n\t\t\t\tthis.requestRender();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (matchesKey(data, \"up\")) this.actionIndex = Math.max(0, this.actionIndex - 1);\n\t\t\telse if (matchesKey(data, \"down\")) this.actionIndex = Math.min(actions.length - 1, this.actionIndex + 1);\n\t\t\telse if (getKeybindings().matches(data, \"app.tasks.inspect\"))\n\t\t\t\tvoid this.navigation.activate(actions[Math.min(this.actionIndex, actions.length - 1)]);\n\t\t\telse if (!this.navigation.handleInput(data, \"tasks\")) return false;\n\t\t} else if (!this.navigation.handleInput(data, \"tasks\")) return false;\n\t\tthis.requestRender();\n\t\treturn true;\n\t}\n\tprivate configuredTaskKey(data: string): boolean {\n\t\treturn ([\"app.tasks.inspect\", \"app.tasks.foreground\", \"app.tasks.cancel\", \"app.tasks.input\"] as const).some(\n\t\t\t(key) => getKeybindings().matches(data, key),\n\t\t);\n\t}\n\t/** Only the task picker stays inline; drill-down and confirmation own the screen. */\n\tget fullscreen(): boolean {\n\t\treturn (\n\t\t\tthis.confirmation !== undefined ||\n\t\t\tthis.navigation.focus.kind === \"detail\" ||\n\t\t\tthis.navigation.focus.kind === \"stdin\"\n\t\t);\n\t}\n\trenderPicker(width: number, availableRows: number): string[] {\n\t\treturn this.renderViewport(width, Math.max(1, Math.min(12, availableRows)));\n\t}\n\trender(width: number): string[] {\n\t\treturn this.renderViewport(width, Math.max(3, (process.stdout.rows || 24) - 5));\n\t}\n\tprivate renderTranscriptViewport(width: number, budget: number): string[] {\n\t\tconst task = this.selected();\n\t\tconst room = Math.max(1, budget - 5);\n\t\tthis.transcriptPageRows = room;\n\t\tconst rows = this.transcript?.flatMap((component) => component.render(width)) ?? [\n\t\t\tthis.transcriptLoading ? \"Loading transcript…\" : this.status,\n\t\t];\n\t\tthis.scroll = Math.min(this.scroll, Math.max(0, rows.length - room));\n\t\tconst visible = rows.slice(this.scroll, this.scroll + room);\n\t\t// Transcript tools own their backgrounds. Keep them out of a nested box,\n\t\t// strip terminal movement, and reset styles at every viewport row boundary.\n\t\tconst safeLine = (line: string) =>\n\t\t\tline\n\t\t\t\t.split(/(\\x1b\\[[0-9;:]*m)/g)\n\t\t\t\t.map((part, index) =>\n\t\t\t\t\tindex % 2 ? part : stripVTControlCharacters(part).replace(/[\\x00-\\x1f\\x7f-\\x9f]/g, \" \"),\n\t\t\t\t)\n\t\t\t\t.join(\"\");\n\t\tconst fit = (line: string) => truncateToWidth(safeLine(line), Math.max(1, width)) + \"\\x1b[0m\";\n\t\treturn [\n\t\t\ttheme.bold(`Transcript · ${task ? taskDisplayText(taskLabel(task)) : \"Task\"}`),\n\t\t\ttask ? taskDetailSummary(task) : \"\",\n\t\t\ttheme.fg(\"borderMuted\", \"─\".repeat(Math.max(0, width))),\n\t\t\t...visible,\n\t\t\t...Array.from({ length: Math.max(0, room - visible.length) }, () => \"\"),\n\t\t\ttheme.fg(\n\t\t\t\t\"dim\",\n\t\t\t\t`Lines ${rows.length ? this.scroll + 1 : 0}–${Math.min(rows.length, this.scroll + room)} of ${rows.length}${this.cursor ? \" · PgUp at top: earlier history\" : \"\"}${this.status ? ` · ${this.status}` : \"\"}`,\n\t\t\t),\n\t\t\ttheme.fg(\"dim\", \"↑↓ scroll · PgUp/PgDn page · Home/End · ←/Esc back\"),\n\t\t]\n\t\t\t.map(fit)\n\t\t\t.slice(0, Math.max(1, budget));\n\t}\n\trenderViewport(width: number, budget: number): string[] {\n\t\tif (this.transcriptRequested && !this.confirmation && this.navigation.focus.kind === \"detail\")\n\t\t\treturn this.renderTranscriptViewport(width, budget);\n\t\tconst framed = width >= 20 && budget >= 7;\n\t\tconst inner = Math.max(1, width - (framed ? 4 : 0));\n\t\tconst current = this.selected();\n\t\tconst detail = this.navigation.focus.kind === \"detail\";\n\t\tconst selectingAction = current && detail && !this.transcriptRequested && !this.confirmation;\n\t\tconst actions = selectingAction\n\t\t\t? taskDetailActions(current.execution, current.attention, this.stdinAvailable())\n\t\t\t: [];\n\t\tthis.actionIndex = Math.max(0, Math.min(this.actionIndex, actions.length - 1));\n\t\tconst action = actions[this.actionIndex];\n\t\tconst actionRow = action ? [theme.fg(\"accent\", `› ${taskDetailLabels[action]}`)] : [];\n\t\tconst rows = this.renderAll(inner);\n\t\tconst compactSummary = !framed && detail && current && budget >= 4 ? [taskDetailSummary(current)] : [];\n\t\tconst height = Math.max(0, budget - (framed ? 4 : 1) - actionRow.length - compactSummary.length);\n\t\tconst selected = detail ? -1 : rows.findIndex((row) => stripVTControlCharacters(row).startsWith(\"›\"));\n\t\tthis.scroll = Math.min(this.scroll, Math.max(0, rows.length - height));\n\t\tconst selectionRows = Math.min(height, current?.kind === \"agent\" ? 3 : 2);\n\t\tconst offset = detail ? this.scroll : Math.max(0, selected + selectionRows - height);\n\t\tconst view = rows.slice(offset, offset + height);\n\t\tconst inspect = keyHintIfBound(\"app.tasks.inspect\", detail ? \"select\" : \"view\");\n\t\tconst hints = this.confirmation\n\t\t\t? \"y confirm · n/Esc keep running\"\n\t\t\t: this.navigation.focus.kind === \"stdin\"\n\t\t\t\t? \"Enter send · Esc back\"\n\t\t\t\t: this.transcriptRequested\n\t\t\t\t\t? \"↑↓ scroll · PgUp/PgDn page · ←/Esc back\"\n\t\t\t\t\t: [\n\t\t\t\t\t\t\tdetail ? \"PgUp/PgDn scroll · ↑↓ actions\" : \"↑↓ select\",\n\t\t\t\t\t\t\tinspect,\n\t\t\t\t\t\t\tcurrent && current.execution.kind !== \"settled\"\n\t\t\t\t\t\t\t\t? keyHintIfBound(\"app.tasks.cancel\", \"stop\") || (!this.configuredTaskKey(\"x\") ? \"x stop\" : \"\")\n\t\t\t\t\t\t\t\t: \"\",\n\t\t\t\t\t\t\t\"Esc back\",\n\t\t\t\t\t\t]\n\t\t\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t\t\t.join(\" · \");\n\t\tconst footer = theme.fg(\"dim\", truncateToWidth(`/tasks · ${hints}`, width));\n\t\tif (!framed)\n\t\t\treturn [...compactSummary, ...view, ...actionRow, footer]\n\t\t\t\t.map((line) => truncateToWidth(line, width))\n\t\t\t\t.slice(-Math.max(1, budget));\n\t\tconst live = this.store.backgroundTasks.filter((task) => task.execution.kind !== \"settled\").length;\n\t\tconst title =\n\t\t\tdetail && current\n\t\t\t\t? `${taskDisplayText(taskLabel(current))} › ${taskDisplayText(current.title)}`\n\t\t\t\t: \"Background tasks\";\n\t\tconst heading = ` ${truncateToWidth(title, Math.max(1, width - 5))} `;\n\t\tconst border = (text: string) => theme.fg(\"borderMuted\", text);\n\t\tconst frameRow = (line: string) => {\n\t\t\tconst text = truncateToWidth(line, inner);\n\t\t\treturn border(\"│ \") + text + \" \".repeat(Math.max(0, inner - visibleWidth(text))) + border(\" │\");\n\t\t};\n\t\treturn [\n\t\t\tborder(\"╭─\") + theme.bold(heading) + border(`${\"─\".repeat(Math.max(0, width - visibleWidth(heading) - 3))}╮`),\n\t\t\tframeRow(\n\t\t\t\tdetail && current\n\t\t\t\t\t? taskDetailSummary(current)\n\t\t\t\t\t: theme.fg(\"muted\", `${live} active · ${this.store.backgroundTasks.length} total`),\n\t\t\t),\n\t\t\t...view.map(frameRow),\n\t\t\t...actionRow.map(frameRow),\n\t\t\tborder(`╰${\"─\".repeat(Math.max(0, width - 2))}╯`),\n\t\t\tfooter,\n\t\t].map((line) => truncateToWidth(line, width));\n\t}\n\tprivate renderAll(width: number): string[] {\n\t\tconst task = this.selected();\n\t\tif (this.confirmation)\n\t\t\treturn new Text(\n\t\t\t\t`Cancel ${task?.title}\\nTask ${task?.ref.taskId}\\ny: confirm · n/Escape: keep running`,\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t).render(width);\n\t\tif (this.navigation.focus.kind === \"stdin\")\n\t\t\treturn [`Input to ${task?.title} · Escape: tasks`, ...this.input.render(width), this.status];\n\t\tif (this.transcript) return [...this.transcript.flatMap((component) => component.render(width)), this.status];\n\t\tif (this.transcriptRequested)\n\t\t\treturn [this.transcriptLoading ? \"Loading transcript…\" : this.status || \"Transcript unavailable\"];\n\t\tif (task && this.navigation.focus.kind === \"detail\") {\n\t\t\treturn [\n\t\t\t\t...new TaskDetail(task, {\n\t\t\t\t\t...this.detailContent,\n\t\t\t\t\tstdinAvailable: this.stdinAvailable(),\n\t\t\t\t\tactivity: this.store.recentActivity(task.ref.taskId),\n\t\t\t\t\tactivityOmitted: this.store.activityOmitted(task.ref.taskId),\n\t\t\t\t}).renderContent(width),\n\t\t\t\tthis.status,\n\t\t\t];\n\t\t}\n\t\tconst sections = taskListSections(this.store.backgroundTasks);\n\t\tif (!sections.length)\n\t\t\treturn new Text(\"No background tasks.\\nBackground agents and shells will appear here.\", 0, 0).render(width);\n\t\treturn sections.flatMap((section) => [\n\t\t\t\"\",\n\t\t\ttheme.fg(\"muted\", theme.bold(`${section.title} (${section.tasks.length})`)),\n\t\t\t...section.tasks.flatMap((item) => {\n\t\t\t\tconst selected = item.ref.taskId === this.navigation.selectedTaskId;\n\t\t\t\tconst { label: state, color, icon } = taskStatusAppearance(item);\n\t\t\t\tconst status = width < 32 ? ` ${icon}` : ` ${icon} ${state}`;\n\t\t\t\tconst name = taskDisplayText(item.title || taskLabel(item));\n\t\t\t\tconst marker = selected ? \"› \" : \" \";\n\t\t\t\tconst title = marker + truncateToWidth(name, Math.max(1, width - visibleWidth(status) - 3));\n\t\t\t\tconst row = `${selected ? theme.fg(\"accent\", theme.bold(title)) : title}${\" \".repeat(Math.max(1, width - visibleWidth(title) - visibleWidth(status)))}${theme.fg(color, status)}`;\n\t\t\t\tconst metadata = [\n\t\t\t\t\t...(width < 32 ? [state] : []),\n\t\t\t\t\ttaskLabel(item),\n\t\t\t\t\ttaskMetricsText(item),\n\t\t\t\t\titem.currentAction ? `${item.currentAction.tool} ${item.currentAction.text}` : \"\",\n\t\t\t\t]\n\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t.join(\" · \");\n\t\t\t\treturn [\n\t\t\t\t\ttruncateToWidth(row, width),\n\t\t\t\t\t...(item.kind === \"agent\" ? [theme.fg(\"dim\", truncateToWidth(` ${taskModelText(item)}`, width))] : []),\n\t\t\t\t\t...(selected ? [theme.fg(\"dim\", truncateToWidth(` ${taskDisplayText(metadata)}`, width))] : []),\n\t\t\t\t];\n\t\t\t}),\n\t\t]);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"task-inspector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/task-inspector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,EAEN,cAAc,EACd,KAAK,EACL,UAAU,EACV,IAAI,EACJ,eAAe,EACf,YAAY,GACZ,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAGvE,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EACN,UAAU,EAEV,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAwB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,SAAS,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AAC,CAAC,EAAE;iBACjF;qBACC,MAAM,CAAC,OAAO,CAAC;qBACf,IAAI,CAAC,KAAK,CAAC,CAAC;gBACd,OAAO;oBACN,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC;oBAC3B,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,KAAK,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBACvG,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,KAAK,eAAe,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;iBAChG,CAAC;YACH,CAAC,CAAC;SACF,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { stripVTControlCharacters } from \"node:util\";\nimport type { AgentMessage } from \"@earendil-works/pi-agent-core\";\nimport {\n\ttype Component,\n\tgetKeybindings,\n\tInput,\n\tmatchesKey,\n\tText,\n\ttruncateToWidth,\n\tvisibleWidth,\n} from \"@earendil-works/pi-tui\";\nimport type { KeybindingsManager } from \"../../../core/keybindings.ts\";\nimport { taskOutputText } from \"../../../core/tasks/command-output.js\";\nimport type { OperationId, PromptRoute, TaskId } from \"../../../core/tasks/contracts.js\";\nimport type { OwnerTaskStore } from \"../../../core/tasks/owner-store.js\";\nimport { taskOwnTranscriptEntries, taskTranscriptSource } from \"../../../core/tasks/supervisor.js\";\nimport { readTaskTranscriptSnapshot } from \"../../../core/tasks/transcript.js\";\nimport { theme } from \"../theme/theme.js\";\nimport { chatEntriesFromAgentMessages, renderChatMessageEntry } from \"./chat-message-renderer.ts\";\nimport { mouseWheelDeltaRows } from \"./chat-transcript.js\";\nimport { keyHintIfBound } from \"./keybinding-hints.js\";\nimport {\n\tTaskDetail,\n\ttype TaskDetailContent,\n\ttaskDetailActions,\n\ttaskDetailLabels,\n\ttaskDetailSummary,\n} from \"./task-detail.js\";\nimport { type TaskListSection, taskListSections } from \"./task-list.js\";\nimport { TaskLiveTranscript } from \"./task-live-transcript.js\";\nimport { TaskNavigation } from \"./task-navigation.js\";\nimport { taskDisplayText, taskLabel, taskMetricsText, taskModelText, taskStatusAppearance } from \"./task-row.js\";\n\n/** Focused view only. The store and original session remain the authorities. */\nexport class TaskInspector implements Component {\n\treadonly navigation: TaskNavigation;\n\tprivate actionIndex = 0;\n\tprivate confirmation?: (answer: boolean) => void;\n\tprivate transcript?: Component[];\n\tprivate liveTranscript?: TaskLiveTranscript;\n\tprivate transcriptRefreshPending = false;\n\tprivate transcriptRequested = false;\n\tprivate transcriptLoading = false;\n\tprivate transcriptHistorical = false;\n\tprivate transcriptPageRows = 5;\n\tprivate cursor?: string;\n\tprivate status = \"\";\n\tprivate scroll = 0;\n\tprivate detailContent: Omit<TaskDetailContent, \"stdinAvailable\"> = {};\n\tprivate detailTaskId?: TaskId;\n\tprivate detailGeneration = 0;\n\tprivate disposed = false;\n\tprivate readonly input = new Input();\n\tprivate readonly unsubscribe: () => void;\n\tconstructor(\n\t\tprivateStore: OwnerTaskStore,\n\t\tprivateRender: () => void,\n\t\tprivateClose: () => void,\n\t\topenQuestion?: (route: PromptRoute) => void,\n\t) {\n\t\tthis.store = privateStore;\n\t\tthis.requestRender = privateRender;\n\t\tthis.close = privateClose;\n\t\tthis.navigation = new TaskNavigation(getKeybindings() as KeybindingsManager, {\n\t\t\tinspect: () => {\n\t\t\t\tthis.releaseLiveTranscript();\n\t\t\t\tthis.actionIndex = 0;\n\t\t\t\tthis.scroll = 0;\n\t\t\t\tthis.transcript = undefined;\n\t\t\t\tthis.transcriptRequested = false;\n\t\t\t\tthis.transcriptLoading = false;\n\t\t\t\tthis.transcriptHistorical = false;\n\t\t\t\tvoid this.loadDetail();\n\t\t\t},\n\t\t\ttranscript: () => {\n\t\t\t\tthis.detailGeneration++;\n\t\t\t\tthis.scroll = 0;\n\t\t\t\tvoid this.loadTranscript();\n\t\t\t},\n\t\t\tforeground: (task) => {\n\t\t\t\tconst lease = this.store.resolveTask(task.ref.taskId);\n\t\t\t\tif (lease.ok)\n\t\t\t\t\tvoid this.store.supervisor.foregroundTask(lease.value).then((result) => {\n\t\t\t\t\t\tthis.status = result.ok ? result.value.kind : result.error.message;\n\t\t\t\t\t\tthis.requestRender();\n\t\t\t\t\t});\n\t\t\t},\n\t\t\tconfirmCancel: () =>\n\t\t\t\tnew Promise<boolean>((resolve) => {\n\t\t\t\t\tthis.confirmation = resolve;\n\t\t\t\t\tthis.requestRender();\n\t\t\t\t}),\n\t\t\tcancel: (task) => {\n\t\t\t\tconst lease = this.store.resolveTask(task.ref.taskId);\n\t\t\t\tif (lease.ok) void this.store.supervisor.cancelTask(lease.value, \"user\").then(() => this.requestRender());\n\t\t\t},\n\t\t\tstdinAvailable: (task) => {\n\t\t\t\tconst lease = this.store.resolveTask(task.ref.taskId);\n\t\t\t\treturn lease.ok && this.store.supervisor.taskStdin(lease.value).ok;\n\t\t\t},\n\t\t\tinput: () => {\n\t\t\t\tthis.input.setValue(\"\");\n\t\t\t},\n\t\t\topenQuestion: (route) => {\n\t\t\t\tif (openQuestion) {\n\t\t\t\t\tthis.close();\n\t\t\t\t\topenQuestion(route);\n\t\t\t\t} else this.status = \"Question is available in its owning session.\";\n\t\t\t},\n\t\t});\n\t\tthis.unsubscribe = this.store.subscribe(() => {\n\t\t\tthis.navigation.update(this.orderedSections().flatMap((section) => section.tasks));\n\t\t\tif (this.transcriptRequested) {\n\t\t\t\tthis.refreshTranscript();\n\t\t\t} else if (this.navigation.focus.kind === \"detail\") void this.loadDetail();\n\t\t\tthis.requestRender();\n\t\t});\n\t\tthis.navigation.update(this.orderedSections().flatMap((section) => section.tasks));\n\t\tthis.navigation.open();\n\t\tthis.input.onSubmit = (text) => {\n\t\t\tvoid this.sendInput(text);\n\t\t};\n\t}\n\tprivate readonly store: OwnerTaskStore;\n\tprivate readonly requestRender: () => void;\n\tprivate readonly close: () => void;\n\topen(id?: TaskId): void {\n\t\tthis.navigation.open(id);\n\t}\n\tprivate orderedSections(): TaskListSection[] {\n\t\treturn taskListSections(this.store.backgroundTasks, this.store.settlementOrder);\n\t}\n\tdispose(): void {\n\t\tthis.disposed = true;\n\t\tthis.releaseLiveTranscript();\n\t\tthis.confirmation?.(false);\n\t\tthis.unsubscribe();\n\t}\n\tinvalidate(): void {\n\t\tfor (const component of this.transcript ?? []) component.invalidate();\n\t}\n\tprivate selected() {\n\t\treturn this.store.backgroundTasks.find((task) => task.ref.taskId === this.navigation.selectedTaskId);\n\t}\n\tprivate stdinAvailable(): boolean {\n\t\tconst task = this.selected();\n\t\tif (!task || task.execution.kind === \"settled\") return false;\n\t\tconst lease = this.store.resolveTask(task.ref.taskId);\n\t\treturn lease.ok && this.store.supervisor.taskStdin(lease.value).ok;\n\t}\n\tprivate async sendInput(text: string): Promise<void> {\n\t\tconst task = this.selected();\n\t\tif (!task) return;\n\t\tconst lease = this.store.resolveTask(task.ref.taskId);\n\t\tif (!lease.ok) return;\n\t\tconst stdin = this.store.supervisor.taskStdin(lease.value);\n\t\tif (!stdin.ok) {\n\t\t\tthis.status = stdin.error.message;\n\t\t\treturn;\n\t\t}\n\t\tconst result = await this.store.supervisor.writeTaskInput(stdin.value, randomUUID() as OperationId, {\n\t\t\tkind: \"bytes\",\n\t\t\tbytes: Buffer.from(`${text}\\n`),\n\t\t});\n\t\tthis.status = result.ok ? `Sent ${result.value.acceptedBytes} bytes` : result.error.message;\n\t\tthis.input.setValue(\"\");\n\t\tthis.requestRender();\n\t}\n\tprivate releaseLiveTranscript(): void {\n\t\tthis.liveTranscript?.dispose();\n\t\tthis.liveTranscript = undefined;\n\t\tthis.transcriptRefreshPending = false;\n\t}\n\tprivate refreshTranscript(): void {\n\t\tif (this.disposed || !this.transcriptRequested) return;\n\t\tconst task = this.selected();\n\t\tconst lease = task && this.store.resolveTask(task.ref.taskId);\n\t\tconst bound = lease?.ok ? taskTranscriptSource(lease.value) : undefined;\n\t\tif (bound?.ok && this.liveTranscript?.source === bound.value.session) return;\n\t\t// Legacy history-only sources have no live tail; keep their retained page anchored.\n\t\tif (bound?.ok && !bound.value.session.subscribe && this.transcriptHistorical) return;\n\t\tif (this.transcriptLoading) this.transcriptRefreshPending = true;\n\t\telse void this.loadTranscript();\n\t}\n\tprivate async loadTranscript(earlier = false): Promise<void> {\n\t\tconst task = this.selected();\n\t\tif (!task) return;\n\t\tconst generation = ++this.detailGeneration;\n\t\tconst focus = this.navigation.focus;\n\t\tthis.transcriptRequested = true;\n\t\tthis.transcriptLoading = true;\n\t\tif (earlier) this.transcriptHistorical = true;\n\t\tthis.requestRender();\n\t\ttry {\n\t\t\tconst lease = this.store.resolveTask(task.ref.taskId);\n\t\t\tif (!lease.ok) {\n\t\t\t\tthis.status = lease.error.message;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (task.kind === \"command\") {\n\t\t\t\tconst count = BigInt(task.output.byteCount);\n\t\t\t\tconst page = await this.store.supervisor.readTaskOutput(lease.value, {\n\t\t\t\t\tstart: String(count > 8192n ? count - 8192n : 0n),\n\t\t\t\t\tmaximumBytes: 8192,\n\t\t\t\t});\n\t\t\t\tif (\n\t\t\t\t\tthis.disposed ||\n\t\t\t\t\tgeneration !== this.detailGeneration ||\n\t\t\t\t\tfocus !== this.navigation.focus ||\n\t\t\t\t\ttask.ref.taskId !== this.navigation.selectedTaskId\n\t\t\t\t)\n\t\t\t\t\treturn;\n\t\t\t\tconst text = page.ok ? taskOutputText(page.value) : page.error.message;\n\t\t\t\tthis.transcript = [\n\t\t\t\t\tnew Text(text.split(\"\\n\").map(taskDisplayText).join(\"\\n\") || \"No output available\", 0, 0),\n\t\t\t\t];\n\t\t\t\tthis.cursor = undefined;\n\t\t\t\tthis.status =\n\t\t\t\t\tcount > 8192n ? \"Earlier output omitted · showing retained 8 KiB tail\" : \"Retained shell output\";\n\t\t\t\tthis.requestRender();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst page = readTaskTranscriptSnapshot(lease.value, earlier ? this.cursor : undefined);\n\t\t\tif (\n\t\t\t\tthis.disposed ||\n\t\t\t\tgeneration !== this.detailGeneration ||\n\t\t\t\tfocus !== this.navigation.focus ||\n\t\t\t\ttask.ref.taskId !== this.navigation.selectedTaskId\n\t\t\t)\n\t\t\t\treturn;\n\t\t\tconst bound = taskTranscriptSource(lease.value);\n\t\t\tif (!bound.ok || (!page.ok && !bound.value.session.subscribe)) {\n\t\t\t\tthis.status = \"Transcript unavailable\";\n\t\t\t\tthis.requestRender();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst ids = new Set(page.ok ? page.value.items.map((item) => item.source.entryId) : []);\n\t\t\tconst messages = bound.value.session.getEntries().flatMap<AgentMessage>((entry) => {\n\t\t\t\tif (entry.type !== \"message\" || !ids.has(entry.id)) return [];\n\t\t\t\tconst message = entry.message;\n\t\t\t\tif (message.role === \"assistant\")\n\t\t\t\t\treturn [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...message,\n\t\t\t\t\t\t\tcontent: message.content.filter(\n\t\t\t\t\t\t\t\t(block, index) =>\n\t\t\t\t\t\t\t\t\tblock.type !== \"thinking\" &&\n\t\t\t\t\t\t\t\t\tpage.ok &&\n\t\t\t\t\t\t\t\t\tpage.value.items.some(\n\t\t\t\t\t\t\t\t\t\t(item) => item.source.entryId === entry.id && item.source.contentIndex === index,\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t];\n\t\t\t\treturn message.role === \"user\" || message.role === \"toolResult\" ? [message] : [];\n\t\t\t});\n\t\t\tconst components = chatEntriesFromAgentMessages(messages).map((entry) =>\n\t\t\t\trenderChatMessageEntry(entry, {\n\t\t\t\t\tui: { requestRender: this.requestRender },\n\t\t\t\t\tcwd: process.cwd(),\n\t\t\t\t\thideThinkingBlock: true,\n\t\t\t\t\ttoolOutputExpanded: true,\n\t\t\t\t\tshowImages: false,\n\t\t\t\t}),\n\t\t\t);\n\t\t\tif (!earlier && bound.value.session.subscribe) {\n\t\t\t\tthis.releaseLiveTranscript();\n\t\t\t\tthis.liveTranscript = new TaskLiveTranscript(bound.value.session, messages, this.requestRender);\n\t\t\t\tthis.transcript = [this.liveTranscript];\n\t\t\t} else this.transcript = earlier ? [...components, ...(this.transcript ?? [])] : components;\n\t\t\tthis.cursor = page.ok ? page.value.nextCursor : undefined;\n\t\t\tthis.status = this.cursor ? \"PageUp: earlier retained messages\" : \"\";\n\t\t\tthis.requestRender();\n\t\t} catch {\n\t\t\tif (!this.disposed && generation === this.detailGeneration && focus === this.navigation.focus) {\n\t\t\t\tthis.transcript = [];\n\t\t\t\tthis.status = \"Task output unavailable\";\n\t\t\t\tthis.requestRender();\n\t\t\t}\n\t\t} finally {\n\t\t\tif (generation === this.detailGeneration) {\n\t\t\t\tthis.transcriptLoading = false;\n\t\t\t\tif (this.transcriptRefreshPending) {\n\t\t\t\t\tthis.transcriptRefreshPending = false;\n\t\t\t\t\tthis.refreshTranscript();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tprivate async loadDetail(): Promise<void> {\n\t\tconst selectedId = this.selected()?.ref.taskId;\n\t\tif (selectedId !== this.detailTaskId) {\n\t\t\tthis.detailContent = {};\n\t\t\tthis.detailTaskId = selectedId;\n\t\t}\n\t\tthis.status = \"\";\n\t\tconst generation = ++this.detailGeneration;\n\t\tconst focus = this.navigation.focus;\n\t\tconst task = this.selected();\n\t\tif (!task) return;\n\t\tconst current = () =>\n\t\t\t!this.disposed &&\n\t\t\tgeneration === this.detailGeneration &&\n\t\t\tthis.navigation.focus === focus &&\n\t\t\tfocus.kind === \"detail\" &&\n\t\t\tthis.navigation.selectedTaskId === task.ref.taskId;\n\t\tconst lease = this.store.resolveTask(task.ref.taskId);\n\t\tif (!lease.ok) return;\n\t\tconst ownEntries = taskOwnTranscriptEntries(lease.value);\n\t\tif (ownEntries) {\n\t\t\tconst prompt = ownEntries.find((entry) => entry.type === \"message\" && entry.message.role === \"user\");\n\t\t\tif (prompt?.type === \"message\" && prompt.message.role === \"user\")\n\t\t\t\tthis.detailContent.prompt =\n\t\t\t\t\ttypeof prompt.message.content === \"string\"\n\t\t\t\t\t\t? prompt.message.content\n\t\t\t\t\t\t: prompt.message.content\n\t\t\t\t\t\t\t\t.filter((block) => block.type === \"text\")\n\t\t\t\t\t\t\t\t.map((block) => block.text)\n\t\t\t\t\t\t\t\t.join(\"\");\n\t\t\tconst response = ownEntries\n\t\t\t\t.slice()\n\t\t\t\t.reverse()\n\t\t\t\t.find((entry) => entry.type === \"message\" && entry.message.role === \"assistant\");\n\t\t\tif (response?.type === \"message\" && response.message.role === \"assistant\")\n\t\t\t\tthis.detailContent.output = response.message.content\n\t\t\t\t\t.filter((block) => block.type === \"text\")\n\t\t\t\t\t.map((block) => block.text)\n\t\t\t\t\t.join(\"\");\n\t\t}\n\t\tif (task.kind === \"command\") {\n\t\t\ttry {\n\t\t\t\tconst count = BigInt(task.output.byteCount);\n\t\t\t\tconst output = await this.store.supervisor.readTaskOutput(lease.value, {\n\t\t\t\t\tstart: String(count > 8192n ? count - 8192n : 0n),\n\t\t\t\t\tmaximumBytes: 8192,\n\t\t\t\t});\n\t\t\t\tif (!current()) return;\n\t\t\t\tif (output.ok) {\n\t\t\t\t\tthis.detailContent.output = taskOutputText(output.value);\n\t\t\t\t\tthis.detailContent.outputOmitted = count > 8192n || output.value.omittedRanges.length > 0;\n\t\t\t\t} else this.status = output.error.message;\n\t\t\t} catch {\n\t\t\t\tif (!current()) return;\n\t\t\t\tthis.status = \"Command output unavailable\";\n\t\t\t}\n\t\t}\n\t\tif (current()) this.requestRender();\n\t}\n\thandleInput(data: string): boolean {\n\t\tif (this.confirmation) {\n\t\t\tif (data === \"y\" || data === \"n\" || matchesKey(data, \"escape\")) {\n\t\t\t\tconst answer = this.confirmation;\n\t\t\t\tthis.confirmation = undefined;\n\t\t\t\tanswer(data === \"y\");\n\t\t\t}\n\t\t\tthis.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\tconst wheel = mouseWheelDeltaRows(data);\n\t\tif (wheel !== 0) {\n\t\t\tif (this.navigation.focus.kind === \"tasks\") this.navigation.moveSelection(Math.sign(wheel));\n\t\t\telse if (this.navigation.focus.kind === \"detail\") {\n\t\t\t\tif (this.transcriptRequested && wheel < 0 && this.scroll === 0 && this.cursor && !this.transcriptLoading)\n\t\t\t\t\tvoid this.loadTranscript(true);\n\t\t\t\telse this.scroll = Math.max(0, this.scroll + wheel);\n\t\t\t}\n\t\t\tthis.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\t// Mouse reports are never text input, including horizontal wheel/release.\n\t\tif (/^\\x1b\\[<\\d+;\\d+;\\d+[mM]$/.test(data) || data.startsWith(\"\\x1b[M\")) return true;\n\t\tif (\n\t\t\tmatchesKey(data, \"escape\") ||\n\t\t\t(matchesKey(data, \"left\") && this.navigation.focus.kind !== \"stdin\" && !this.configuredTaskKey(data))\n\t\t) {\n\t\t\tif (this.transcriptRequested) {\n\t\t\t\tthis.releaseLiveTranscript();\n\t\t\t\tthis.detailGeneration++;\n\t\t\t\tthis.transcript = undefined;\n\t\t\t\tthis.transcriptRequested = false;\n\t\t\t\tthis.transcriptLoading = false;\n\t\t\t\tthis.transcriptHistorical = false;\n\t\t\t\tthis.scroll = 0;\n\t\t\t\tvoid this.loadDetail();\n\t\t\t} else {\n\t\t\t\tthis.navigation.handleInput(\"\\x1b\", \"tasks\");\n\t\t\t\tif (this.navigation.focus.kind === \"composer\") this.close();\n\t\t\t}\n\t\t\tthis.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\tif (this.navigation.focus.kind === \"stdin\") {\n\t\t\tthis.input.handleInput(data);\n\t\t\tthis.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\tif (data === \"x\" && !this.configuredTaskKey(data)) {\n\t\t\tvoid this.navigation.activate(\"cancel\");\n\t\t\treturn true;\n\t\t}\n\t\tif (this.transcriptRequested) {\n\t\t\tif (this.configuredTaskKey(data)) this.navigation.handleInput(data, \"tasks\");\n\t\t\telse if (matchesKey(data, \"up\")) this.scroll = Math.max(0, this.scroll - 1);\n\t\t\telse if (matchesKey(data, \"down\")) this.scroll++;\n\t\t\telse if (matchesKey(data, \"pageUp\")) {\n\t\t\t\tif (this.scroll === 0 && this.cursor && !this.transcriptLoading) void this.loadTranscript(true);\n\t\t\t\telse this.scroll = Math.max(0, this.scroll - this.transcriptPageRows);\n\t\t\t} else if (matchesKey(data, \"pageDown\")) this.scroll += this.transcriptPageRows;\n\t\t\telse if (matchesKey(data, \"home\")) this.scroll = 0;\n\t\t\telse if (matchesKey(data, \"end\")) this.scroll = Number.MAX_SAFE_INTEGER;\n\t\t\tthis.requestRender();\n\t\t\treturn true;\n\t\t}\n\t\tconst task = this.selected();\n\t\tif (task && this.navigation.focus.kind === \"detail\") {\n\t\t\tconst actions = taskDetailActions(task.execution, task.attention, this.stdinAvailable());\n\t\t\tif (this.configuredTaskKey(data)) {\n\t\t\t\tif (getKeybindings().matches(data, \"app.tasks.inspect\"))\n\t\t\t\t\tvoid this.navigation.activate(actions[Math.min(this.actionIndex, actions.length - 1)]);\n\t\t\t\telse this.navigation.handleInput(data, \"tasks\");\n\t\t\t\tthis.requestRender();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (matchesKey(data, \"pageUp\") || matchesKey(data, \"pageDown\")) {\n\t\t\t\tthis.scroll = Math.max(0, this.scroll + (matchesKey(data, \"pageUp\") ? -5 : 5));\n\t\t\t\tthis.requestRender();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (matchesKey(data, \"up\")) this.actionIndex = Math.max(0, this.actionIndex - 1);\n\t\t\telse if (matchesKey(data, \"down\")) this.actionIndex = Math.min(actions.length - 1, this.actionIndex + 1);\n\t\t\telse if (getKeybindings().matches(data, \"app.tasks.inspect\"))\n\t\t\t\tvoid this.navigation.activate(actions[Math.min(this.actionIndex, actions.length - 1)]);\n\t\t\telse if (!this.navigation.handleInput(data, \"tasks\")) return false;\n\t\t} else if (!this.navigation.handleInput(data, \"tasks\")) return false;\n\t\tthis.requestRender();\n\t\treturn true;\n\t}\n\tprivate configuredTaskKey(data: string): boolean {\n\t\treturn ([\"app.tasks.inspect\", \"app.tasks.foreground\", \"app.tasks.cancel\", \"app.tasks.input\"] as const).some(\n\t\t\t(key) => getKeybindings().matches(data, key),\n\t\t);\n\t}\n\t/** Only the task picker stays inline; drill-down and confirmation own the screen. */\n\tget fullscreen(): boolean {\n\t\treturn (\n\t\t\tthis.confirmation !== undefined ||\n\t\t\tthis.navigation.focus.kind === \"detail\" ||\n\t\t\tthis.navigation.focus.kind === \"stdin\"\n\t\t);\n\t}\n\trenderPicker(width: number, availableRows: number): string[] {\n\t\treturn this.renderViewport(width, Math.max(1, Math.min(12, availableRows)));\n\t}\n\trender(width: number): string[] {\n\t\treturn this.renderViewport(width, Math.max(3, (process.stdout.rows || 24) - 5));\n\t}\n\tprivate renderTranscriptViewport(width: number, budget: number): string[] {\n\t\tconst task = this.selected();\n\t\tconst room = Math.max(1, budget - 5);\n\t\tthis.transcriptPageRows = room;\n\t\tconst rows = this.transcript?.flatMap((component) => component.render(width)) ?? [\n\t\t\tthis.transcriptLoading ? \"Loading transcript…\" : this.status,\n\t\t];\n\t\tthis.scroll = Math.min(this.scroll, Math.max(0, rows.length - room));\n\t\tconst visible = rows.slice(this.scroll, this.scroll + room);\n\t\t// Transcript tools own their backgrounds. Keep them out of a nested box,\n\t\t// strip terminal movement, and reset styles at every viewport row boundary.\n\t\tconst safeLine = (line: string) =>\n\t\t\tline\n\t\t\t\t.split(/(\\x1b\\[[0-9;:]*m)/g)\n\t\t\t\t.map((part, index) =>\n\t\t\t\t\tindex % 2 ? part : stripVTControlCharacters(part).replace(/[\\x00-\\x1f\\x7f-\\x9f]/g, \" \"),\n\t\t\t\t)\n\t\t\t\t.join(\"\");\n\t\tconst fit = (line: string) => truncateToWidth(safeLine(line), Math.max(1, width)) + \"\\x1b[0m\";\n\t\treturn [\n\t\t\ttheme.bold(`Transcript · ${task ? taskDisplayText(taskLabel(task)) : \"Task\"}`),\n\t\t\ttask ? taskDetailSummary(task) : \"\",\n\t\t\ttheme.fg(\"borderMuted\", \"─\".repeat(Math.max(0, width))),\n\t\t\t...visible,\n\t\t\t...Array.from({ length: Math.max(0, room - visible.length) }, () => \"\"),\n\t\t\ttheme.fg(\n\t\t\t\t\"dim\",\n\t\t\t\t`Lines ${rows.length ? this.scroll + 1 : 0}–${Math.min(rows.length, this.scroll + room)} of ${rows.length}${this.cursor ? \" · PgUp at top: earlier history\" : \"\"}${this.status ? ` · ${this.status}` : \"\"}`,\n\t\t\t),\n\t\t\ttheme.fg(\"dim\", \"↑↓ scroll · PgUp/PgDn page · Home/End · ←/Esc back\"),\n\t\t]\n\t\t\t.map(fit)\n\t\t\t.slice(0, Math.max(1, budget));\n\t}\n\trenderViewport(width: number, budget: number): string[] {\n\t\tif (this.transcriptRequested && !this.confirmation && this.navigation.focus.kind === \"detail\")\n\t\t\treturn this.renderTranscriptViewport(width, budget);\n\t\tconst framed = width >= 20 && budget >= 7;\n\t\tconst inner = Math.max(1, width - (framed ? 4 : 0));\n\t\tconst current = this.selected();\n\t\tconst detail = this.navigation.focus.kind === \"detail\";\n\t\tconst selectingAction = current && detail && !this.transcriptRequested && !this.confirmation;\n\t\tconst actions = selectingAction\n\t\t\t? taskDetailActions(current.execution, current.attention, this.stdinAvailable())\n\t\t\t: [];\n\t\tthis.actionIndex = Math.max(0, Math.min(this.actionIndex, actions.length - 1));\n\t\tconst action = actions[this.actionIndex];\n\t\tconst actionRow = action ? [theme.fg(\"accent\", `› ${taskDetailLabels[action]}`)] : [];\n\t\tconst rows = this.renderAll(inner);\n\t\tconst compactSummary = !framed && detail && current && budget >= 4 ? [taskDetailSummary(current)] : [];\n\t\tconst height = Math.max(0, budget - (framed ? 4 : 1) - actionRow.length - compactSummary.length);\n\t\tconst selected = detail ? -1 : rows.findIndex((row) => stripVTControlCharacters(row).startsWith(\"›\"));\n\t\tthis.scroll = Math.min(this.scroll, Math.max(0, rows.length - height));\n\t\tconst selectionRows = Math.min(height, current?.kind === \"agent\" ? 3 : 2);\n\t\tconst offset = detail ? this.scroll : Math.max(0, selected + selectionRows - height);\n\t\tconst view = rows.slice(offset, offset + height);\n\t\tconst inspect = keyHintIfBound(\"app.tasks.inspect\", detail ? \"select\" : \"view\");\n\t\tconst hints = this.confirmation\n\t\t\t? \"y confirm · n/Esc keep running\"\n\t\t\t: this.navigation.focus.kind === \"stdin\"\n\t\t\t\t? \"Enter send · Esc back\"\n\t\t\t\t: this.transcriptRequested\n\t\t\t\t\t? \"↑↓ scroll · PgUp/PgDn page · ←/Esc back\"\n\t\t\t\t\t: [\n\t\t\t\t\t\t\tdetail ? \"PgUp/PgDn scroll · ↑↓ actions\" : \"↑↓ select\",\n\t\t\t\t\t\t\tinspect,\n\t\t\t\t\t\t\tcurrent && current.execution.kind !== \"settled\"\n\t\t\t\t\t\t\t\t? keyHintIfBound(\"app.tasks.cancel\", \"stop\") || (!this.configuredTaskKey(\"x\") ? \"x stop\" : \"\")\n\t\t\t\t\t\t\t\t: \"\",\n\t\t\t\t\t\t\t\"Esc back\",\n\t\t\t\t\t\t]\n\t\t\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t\t\t.join(\" · \");\n\t\tconst footer = theme.fg(\"dim\", truncateToWidth(`/tasks · ${hints}`, width));\n\t\tif (!framed)\n\t\t\treturn [...compactSummary, ...view, ...actionRow, footer]\n\t\t\t\t.map((line) => truncateToWidth(line, width))\n\t\t\t\t.slice(-Math.max(1, budget));\n\t\tconst live = this.store.backgroundTasks.filter((task) => task.execution.kind !== \"settled\").length;\n\t\tconst title =\n\t\t\tdetail && current\n\t\t\t\t? `${taskDisplayText(taskLabel(current))} › ${taskDisplayText(current.title)}`\n\t\t\t\t: \"Background tasks\";\n\t\tconst heading = ` ${truncateToWidth(title, Math.max(1, width - 5))} `;\n\t\tconst border = (text: string) => theme.fg(\"borderMuted\", text);\n\t\tconst frameRow = (line: string) => {\n\t\t\tconst text = truncateToWidth(line, inner);\n\t\t\treturn border(\"│ \") + text + \" \".repeat(Math.max(0, inner - visibleWidth(text))) + border(\" │\");\n\t\t};\n\t\treturn [\n\t\t\tborder(\"╭─\") + theme.bold(heading) + border(`${\"─\".repeat(Math.max(0, width - visibleWidth(heading) - 3))}╮`),\n\t\t\tframeRow(\n\t\t\t\tdetail && current\n\t\t\t\t\t? taskDetailSummary(current)\n\t\t\t\t\t: theme.fg(\"muted\", `${live} active · ${this.store.backgroundTasks.length} total`),\n\t\t\t),\n\t\t\t...view.map(frameRow),\n\t\t\t...actionRow.map(frameRow),\n\t\t\tborder(`╰${\"─\".repeat(Math.max(0, width - 2))}╯`),\n\t\t\tfooter,\n\t\t].map((line) => truncateToWidth(line, width));\n\t}\n\tprivate renderAll(width: number): string[] {\n\t\tconst task = this.selected();\n\t\tif (this.confirmation)\n\t\t\treturn new Text(\n\t\t\t\t`Cancel ${task?.title}\\nTask ${task?.ref.taskId}\\ny: confirm · n/Escape: keep running`,\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t).render(width);\n\t\tif (this.navigation.focus.kind === \"stdin\")\n\t\t\treturn [`Input to ${task?.title} · Escape: tasks`, ...this.input.render(width), this.status];\n\t\tif (this.transcript) return [...this.transcript.flatMap((component) => component.render(width)), this.status];\n\t\tif (this.transcriptRequested)\n\t\t\treturn [this.transcriptLoading ? \"Loading transcript…\" : this.status || \"Transcript unavailable\"];\n\t\tif (task && this.navigation.focus.kind === \"detail\") {\n\t\t\treturn [\n\t\t\t\t...new TaskDetail(task, {\n\t\t\t\t\t...this.detailContent,\n\t\t\t\t\tstdinAvailable: this.stdinAvailable(),\n\t\t\t\t\tactivity: this.store.recentActivity(task.ref.taskId),\n\t\t\t\t\tactivityOmitted: this.store.activityOmitted(task.ref.taskId),\n\t\t\t\t}).renderContent(width),\n\t\t\t\tthis.status,\n\t\t\t];\n\t\t}\n\t\tconst sections = this.orderedSections();\n\t\tif (!sections.length)\n\t\t\treturn new Text(\"No background tasks.\\nBackground agents and shells will appear here.\", 0, 0).render(width);\n\t\treturn sections.flatMap((section) => [\n\t\t\t\"\",\n\t\t\ttheme.fg(\"muted\", theme.bold(`${section.title} (${section.tasks.length})`)),\n\t\t\t...section.tasks.flatMap((item) => {\n\t\t\t\tconst selected = item.ref.taskId === this.navigation.selectedTaskId;\n\t\t\t\tconst { label: state, color, icon } = taskStatusAppearance(item);\n\t\t\t\tconst status = width < 32 ? ` ${icon}` : ` ${icon} ${state}`;\n\t\t\t\tconst name = taskDisplayText(item.title || taskLabel(item));\n\t\t\t\tconst marker = selected ? \"› \" : \" \";\n\t\t\t\tconst title = marker + truncateToWidth(name, Math.max(1, width - visibleWidth(status) - 3));\n\t\t\t\tconst row = `${selected ? theme.fg(\"accent\", theme.bold(title)) : title}${\" \".repeat(Math.max(1, width - visibleWidth(title) - visibleWidth(status)))}${theme.fg(color, status)}`;\n\t\t\t\tconst metadata = [\n\t\t\t\t\t...(width < 32 ? [state] : []),\n\t\t\t\t\ttaskLabel(item),\n\t\t\t\t\ttaskMetricsText(item),\n\t\t\t\t\titem.currentAction ? `${item.currentAction.tool} ${item.currentAction.text}` : \"\",\n\t\t\t\t]\n\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t.join(\" · \");\n\t\t\t\treturn [\n\t\t\t\t\ttruncateToWidth(row, width),\n\t\t\t\t\t...(item.kind === \"agent\" ? [theme.fg(\"dim\", truncateToWidth(` ${taskModelText(item)}`, width))] : []),\n\t\t\t\t\t...(selected ? [theme.fg(\"dim\", truncateToWidth(` ${taskDisplayText(metadata)}`, width))] : []),\n\t\t\t\t];\n\t\t\t}),\n\t\t]);\n\t}\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Component } from "@earendil-works/pi-tui";
|
|
2
|
-
import type { TaskRecord } from "../../../core/tasks/contracts.js";
|
|
2
|
+
import type { TaskId, TaskRecord } from "../../../core/tasks/contracts.js";
|
|
3
3
|
/** Complete projection; viewport owners, not this list, decide how much to mount. */
|
|
4
4
|
export declare class TaskList implements Component {
|
|
5
5
|
private readonly tasks;
|
|
@@ -8,10 +8,16 @@ export declare class TaskList implements Component {
|
|
|
8
8
|
invalidate(): void;
|
|
9
9
|
render(width: number): string[];
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export type TaskListSection = {
|
|
12
12
|
title: string;
|
|
13
13
|
tasks: TaskRecord[];
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Sections list running work first, then stopping, queued, failed, cancelled and completed tasks.
|
|
17
|
+
* Within a status, the latest launch comes first; settled tasks use the latest settlement when known,
|
|
18
|
+
* and fall back to launch order when their settlement sequences tie.
|
|
19
|
+
*/
|
|
20
|
+
export declare function taskListSections(tasks: readonly TaskRecord[], settlementOrder?: ReadonlyMap<TaskId, bigint>): TaskListSection[];
|
|
15
21
|
/** Terminal results remain inspectable but no longer advertise active work. */
|
|
16
22
|
export declare function isActiveBackgroundTask(task: TaskRecord): boolean;
|
|
17
23
|
export declare function renderTaskFooter(tasks: readonly TaskRecord[], width: number): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-list.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/task-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"task-list.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/task-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAI3E,qFAAqF;AACrF,qBAAa,QAAS,YAAW,SAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwB;IAC9C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,YAAY,KAAK,EAAE,SAAS,UAAU,EAAE,EAAE,QAAQ,UAAQ,EAGzD;IACD,UAAU,IAAI,IAAI,CAAG;IACrB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAO9B;CACD;AACD,MAAM,MAAM,eAAe,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,UAAU,EAAE,CAAA;CAAE,CAAC;AAUrE;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,eAAe,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAa,GACtD,eAAe,EAAE,CAcnB;AACD,+EAA+E;AAC/E,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAEhE;AACD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA2BtF"}
|
|
@@ -16,9 +16,33 @@ export class TaskList {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
function statusRank(task) {
|
|
20
|
+
const execution = task.execution;
|
|
21
|
+
if (execution.kind === "running")
|
|
22
|
+
return task.attention.kind === "none" ? 1 : 0;
|
|
23
|
+
if (execution.kind === "cancelling")
|
|
24
|
+
return 2;
|
|
25
|
+
if (execution.kind === "queued")
|
|
26
|
+
return 3;
|
|
27
|
+
return { failed: 4, cancelled: 5, completed: 6 }[execution.result.kind];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Sections list running work first, then stopping, queued, failed, cancelled and completed tasks.
|
|
31
|
+
* Within a status, the latest launch comes first; settled tasks use the latest settlement when known,
|
|
32
|
+
* and fall back to launch order when their settlement sequences tie.
|
|
33
|
+
*/
|
|
34
|
+
export function taskListSections(tasks, settlementOrder = new Map()) {
|
|
35
|
+
const launchOrder = new Map(tasks.map((task, index) => [task.ref.taskId, index]));
|
|
36
|
+
const newerFirst = (a, b) => {
|
|
37
|
+
const settledA = a.execution.kind === "settled" ? settlementOrder.get(a.ref.taskId) : undefined;
|
|
38
|
+
const settledB = b.execution.kind === "settled" ? settlementOrder.get(b.ref.taskId) : undefined;
|
|
39
|
+
if (settledA !== undefined && settledB !== undefined && settledA !== settledB)
|
|
40
|
+
return settledB > settledA ? 1 : -1;
|
|
41
|
+
return (launchOrder.get(b.ref.taskId) ?? 0) - (launchOrder.get(a.ref.taskId) ?? 0);
|
|
42
|
+
};
|
|
43
|
+
const ordered = [...tasks].sort((a, b) => statusRank(a) - statusRank(b) || newerFirst(a, b));
|
|
20
44
|
return ["agent", "command"].flatMap((kind) => {
|
|
21
|
-
const selected =
|
|
45
|
+
const selected = ordered.filter((task) => task.kind === kind);
|
|
22
46
|
return selected.length ? [{ title: kind === "agent" ? "Agents" : "Shells", tasks: selected }] : [];
|
|
23
47
|
});
|
|
24
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-list.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/task-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE9D,qFAAqF;AACrF,MAAM,OAAO,QAAQ;IAGpB,YAAY,KAA4B,EAAE,QAAQ,GAAG,KAAK;QACzD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,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AS,CAAC,CAAC,CAAC,QAAQ,EACrD,eAAe,CACd,eAAe,CAAC,UAAU,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,EACzF,KAAK,CACL,CACD;KACD,CAAC;AACH,CAAC","sourcesContent":["import { type Component, truncateToWidth } from \"@earendil-works/pi-tui\";\nimport type { TaskId, TaskRecord } from \"../../../core/tasks/contracts.js\";\nimport { theme } from \"../theme/theme.js\";\nimport { TaskRow, taskLabel, taskTitle } from \"./task-row.js\";\n\n/** Complete projection; viewport owners, not this list, decide how much to mount. */\nexport class TaskList implements Component {\n\tprivate readonly tasks: readonly TaskRecord[];\n\tprivate readonly expanded: boolean;\n\tconstructor(tasks: readonly TaskRecord[], expanded = false) {\n\t\tthis.tasks = tasks;\n\t\tthis.expanded = expanded;\n\t}\n\tinvalidate(): void {}\n\trender(width: number): string[] {\n\t\treturn this.tasks.flatMap((task) => {\n\t\t\tconst duplicate =\n\t\t\t\tthis.tasks.filter((item) => taskLabel(item) === taskLabel(task) && taskTitle(item) === taskTitle(task))\n\t\t\t\t\t.length > 1;\n\t\t\treturn new TaskRow(task, { expanded: this.expanded, duplicate, siblings: this.tasks }).render(width);\n\t\t});\n\t}\n}\nexport type TaskListSection = { title: string; tasks: TaskRecord[] };\n\nfunction statusRank(task: TaskRecord): number {\n\tconst execution = task.execution;\n\tif (execution.kind === \"running\") return task.attention.kind === \"none\" ? 1 : 0;\n\tif (execution.kind === \"cancelling\") return 2;\n\tif (execution.kind === \"queued\") return 3;\n\treturn { failed: 4, cancelled: 5, completed: 6 }[execution.result.kind];\n}\n\n/**\n * Sections list running work first, then stopping, queued, failed, cancelled and completed tasks.\n * Within a status, the latest launch comes first; settled tasks use the latest settlement when known,\n * and fall back to launch order when their settlement sequences tie.\n */\nexport function taskListSections(\n\ttasks: readonly TaskRecord[],\n\tsettlementOrder: ReadonlyMap<TaskId, bigint> = new Map(),\n): TaskListSection[] {\n\tconst launchOrder = new Map(tasks.map((task, index) => [task.ref.taskId, index]));\n\tconst newerFirst = (a: TaskRecord, b: TaskRecord) => {\n\t\tconst settledA = a.execution.kind === \"settled\" ? settlementOrder.get(a.ref.taskId) : undefined;\n\t\tconst settledB = b.execution.kind === \"settled\" ? settlementOrder.get(b.ref.taskId) : undefined;\n\t\tif (settledA !== undefined && settledB !== undefined && settledA !== settledB)\n\t\t\treturn settledB > settledA ? 1 : -1;\n\t\treturn (launchOrder.get(b.ref.taskId) ?? 0) - (launchOrder.get(a.ref.taskId) ?? 0);\n\t};\n\tconst ordered = [...tasks].sort((a, b) => statusRank(a) - statusRank(b) || newerFirst(a, b));\n\treturn ([\"agent\", \"command\"] as const).flatMap((kind) => {\n\t\tconst selected = ordered.filter((task) => task.kind === kind);\n\t\treturn selected.length ? [{ title: kind === \"agent\" ? \"Agents\" : \"Shells\", tasks: selected }] : [];\n\t});\n}\n/** Terminal results remain inspectable but no longer advertise active work. */\nexport function isActiveBackgroundTask(task: TaskRecord): boolean {\n\treturn task.observation.kind === \"background\" && task.execution.kind !== \"settled\";\n}\nexport function renderTaskFooter(tasks: readonly TaskRecord[], width: number): string[] {\n\tconst active = tasks.filter(isActiveBackgroundTask);\n\tconst background = active.filter((task) => task.execution.kind === \"running\" || task.execution.kind === \"queued\");\n\tconst attention = active.filter((task) => task.attention.kind !== \"none\");\n\tif (!active.length) return [];\n\tconst parts: string[] = [];\n\tif (attention.length) parts.push(`${attention.length} need attention`);\n\tconst agents = background.filter((task) => task.kind === \"agent\" && task.execution.kind === \"running\").length;\n\tconst shells = background.filter((task) => task.kind === \"command\" && task.execution.kind === \"running\").length;\n\tconst queued = background.filter((task) => task.execution.kind === \"queued\").length;\n\tif (agents && shells) parts.push(`${agents + shells} background tasks running`);\n\telse if (agents) parts.push(`${agents} ${agents === 1 ? \"local agent\" : \"local agents\"} running`);\n\telse if (shells) parts.push(`${shells} ${shells === 1 ? \"shell\" : \"shells\"} running`);\n\tif (queued) parts.push(`${queued} queued`);\n\tconst cancelling = active.filter((task) => task.execution.kind === \"cancelling\").length;\n\tif (cancelling) parts.push(`${cancelling} stopping`);\n\tif (!parts.length) parts.push(`${active.length} active`);\n\tconst route = \" · /tasks\";\n\treturn [\n\t\ttheme.fg(\n\t\t\tattention.length || cancelling ? \"warning\" : \"accent\",\n\t\t\ttruncateToWidth(\n\t\t\t\ttruncateToWidth(`Tasks ${parts.join(\" · \")}`, Math.max(1, width - route.length)) + route,\n\t\t\t\twidth,\n\t\t\t),\n\t\t),\n\t];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-execution.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAuB,SAAS,EAAwC,KAAK,GAAG,EAAE,MAAM,wBAAwB,CAAC;AACxH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,mCAAmC,CAAC;AAU3F,MAAM,WAAW,oBAAoB;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,KAAK,oBAAoB,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,GAAG;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CACjB,CAAC;AAaF,qBAAa,sBAAuB,SAAQ,SAAS;IACpD,OAAO,CAAC,UAAU,CAAM;IACxB,OAAO,CAAC,WAAW,CAAO;IAC1B,OAAO,CAAC,mBAAmB,CAAY;IACvC,OAAO,CAAC,qBAAqB,CAAC,CAAY;IAC1C,OAAO,CAAC,uBAAuB,CAAC,CAAY;IAC5C,OAAO,CAAC,aAAa,CAA+B;IACpD,OAAO,CAAC,eAAe,CAAe;IACtC,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,IAAI,CAAU;IACtB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAU;IAC5B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,cAAc,CAAC,CAAmC;IAC1D,OAAO,CAAC,qBAAqB,CAAC,CAAmC;IACjE,OAAO,CAAC,EAAE,CAAM;IAChB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,MAAM,CAAC,CAAuB;IACtC,OAAO,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"tool-execution.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAuB,SAAS,EAAwC,KAAK,GAAG,EAAE,MAAM,wBAAwB,CAAC;AACxH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,mCAAmC,CAAC;AAU3F,MAAM,WAAW,oBAAoB;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,KAAK,oBAAoB,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,GAAG;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CACjB,CAAC;AAaF,qBAAa,sBAAuB,SAAQ,SAAS;IACpD,OAAO,CAAC,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AAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAG9B;IAOD,oBAAoB,IAAI,IAAI,CAK3B;IAED,eAAe,IAAI,IAAI,CAKtB;IAED,YAAY,CAAC,MAAM,EAAE,oBAAoB,EAAE,SAAS,UAAQ,GAAG,IAAI,CAKlE;IAED,OAAO,CAAC,0BAA0B;IA0BlC,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAInC;IAED,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAIjC;IAED,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAKtC;IAEQ,UAAU,IAAI,IAAI,CAG1B;IAED,OAAO,IAAI,IAAI,CAMd;IAEQ,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA8BvC;IAED,OAAO,CAAC,aAAa;IA2ErB,OAAO,CAAC,mBAAmB;IAkD3B,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,uBAAuB;IAa/B,OAAO,CAAC,mBAAmB;CAY3B"}
|
|
@@ -152,17 +152,21 @@ export class ToolExecutionComponent extends Container {
|
|
|
152
152
|
const img = imageBlocks[i];
|
|
153
153
|
if (img === undefined || !img.data || !img.mimeType)
|
|
154
154
|
continue;
|
|
155
|
-
|
|
155
|
+
const sourceData = img.data;
|
|
156
|
+
const sourceMimeType = img.mimeType;
|
|
157
|
+
if (sourceMimeType === "image/png")
|
|
156
158
|
continue;
|
|
157
|
-
|
|
159
|
+
const cached = this.convertedImages.get(i);
|
|
160
|
+
if (cached?.sourceData === sourceData && cached.sourceMimeType === sourceMimeType)
|
|
158
161
|
continue;
|
|
159
162
|
const index = i;
|
|
160
|
-
convertToPng(
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
convertToPng(sourceData, sourceMimeType).then((converted) => {
|
|
164
|
+
const current = this.result?.content.filter((content) => content.type === "image")[index];
|
|
165
|
+
if (!converted || current?.data !== sourceData || current.mimeType !== sourceMimeType)
|
|
166
|
+
return;
|
|
167
|
+
this.convertedImages.set(index, { sourceData, sourceMimeType, ...converted });
|
|
168
|
+
this.updateDisplay();
|
|
169
|
+
this.ui.requestRender();
|
|
166
170
|
});
|
|
167
171
|
}
|
|
168
172
|
}
|
|
@@ -301,7 +305,8 @@ export class ToolExecutionComponent extends Container {
|
|
|
301
305
|
for (const [index, image] of imageBlocks.entries()) {
|
|
302
306
|
if (!image.data || !image.mimeType)
|
|
303
307
|
continue;
|
|
304
|
-
const
|
|
308
|
+
const cached = this.convertedImages.get(index);
|
|
309
|
+
const converted = cached?.sourceData === image.data && cached.sourceMimeType === image.mimeType ? cached : undefined;
|
|
305
310
|
const data = converted?.data ?? image.data;
|
|
306
311
|
const mimeType = converted?.mimeType ?? image.mimeType;
|
|
307
312
|
if (capabilities.images === "kitty" && mimeType !== "image/png")
|