@bastani/atomic 0.9.20-alpha.1 → 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 +307 -0
- package/README.md +52 -7
- package/dist/builtin/intercom/CHANGELOG.md +34 -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 +162 -18
- 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 +169 -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-zqtm1d2c.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-ewkkkbak.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 +25892 -21909
- package/dist/builtin/workflows/src/index.js +43029 -6422
- 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 +36 -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 +253 -140
- 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-m0xfsef8.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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { SupervisedCommandOwner } from "../tools/bash-pty-native.js";
|
|
2
|
+
import type { AgentTaskHost } from "./agent-adapter.js";
|
|
3
|
+
import type { TaskId, YieldReason } from "./contracts.js";
|
|
4
|
+
import type { TaskSupervisor, WaitLease } from "./supervisor.js";
|
|
5
|
+
export type TaskCompletionMessage = {
|
|
6
|
+
customType: string;
|
|
7
|
+
content: string;
|
|
8
|
+
details: object;
|
|
9
|
+
display: true;
|
|
10
|
+
};
|
|
11
|
+
/** Live delivery into the child that launched a shell task, while that child still runs. */
|
|
12
|
+
export interface ChildTaskCompletionRoute {
|
|
13
|
+
isOpen(): boolean;
|
|
14
|
+
deliver(message: TaskCompletionMessage): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Parent-issued capability that lets an in-process subagent child run shell tasks
|
|
18
|
+
* in the parent's task owner, so they appear in the parent's `/tasks` and outlive
|
|
19
|
+
* the child. It never authorizes agent launches.
|
|
20
|
+
*/
|
|
21
|
+
export interface ChildCommandTaskOwner {
|
|
22
|
+
bind(childId: string, route: ChildTaskCompletionRoute, waits: ChildTaskWaits): SupervisedCommandOwner;
|
|
23
|
+
}
|
|
24
|
+
/** Completion route for a task a child launched in this owner, only while that child accepts messages. */
|
|
25
|
+
export declare function childTaskCompletionRoute(host: AgentTaskHost, taskId: TaskId): ChildTaskCompletionRoute | undefined;
|
|
26
|
+
/** Resolve the parent's live owner per call so session replacement is followed like the parent's own shells. */
|
|
27
|
+
export declare function createChildCommandTaskOwner(resolveHost: () => AgentTaskHost): ChildCommandTaskOwner;
|
|
28
|
+
/** Child-side waits on parent-owned tasks; inbound child messages release observation, never execution. */
|
|
29
|
+
export declare class ChildTaskWaits {
|
|
30
|
+
private readonly waits;
|
|
31
|
+
track(supervisor: TaskSupervisor, wait: WaitLease): void;
|
|
32
|
+
yieldAll(reason: YieldReason): void;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=child-command-owner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child-command-owner.d.ts","sourceRoot":"","sources":["../../../src/core/tasks/child-command-owner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjE,MAAM,MAAM,qBAAqB,GAAG;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;CACd,CAAC;AAEF,4FAA4F;AAC5F,MAAM,WAAW,wBAAwB;IACxC,MAAM,IAAI,OAAO,CAAC;IAClB,OAAO,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACrC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,wBAAwB,EAAE,KAAK,EAAE,cAAc,GAAG,sBAAsB,CAAC;CACtG;AAoCD,0GAA0G;AAC1G,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS,CAElH;AAED,gHAAgH;AAChH,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,aAAa,GAAG,qBAAqB,CAoBnG;AAED,2GAA2G;AAC3G,qBAAa,cAAc;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwC;IAE9D,KAAK,CAAC,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,CAIvD;IAED,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAElC;CACD"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
class ChildCommandTaskRoutes {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.launchedBy = new Map();
|
|
4
|
+
this.routes = new Map();
|
|
5
|
+
}
|
|
6
|
+
bind(childId, route) {
|
|
7
|
+
this.routes.set(childId, route);
|
|
8
|
+
}
|
|
9
|
+
recordLaunch(taskId, childId) {
|
|
10
|
+
this.launchedBy.set(taskId, childId);
|
|
11
|
+
}
|
|
12
|
+
launchedByChild(taskId, childId) {
|
|
13
|
+
return this.launchedBy.get(taskId) === childId;
|
|
14
|
+
}
|
|
15
|
+
openRoute(taskId) {
|
|
16
|
+
const childId = this.launchedBy.get(taskId);
|
|
17
|
+
const route = childId === undefined ? undefined : this.routes.get(childId);
|
|
18
|
+
return route?.isOpen() ? route : undefined;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const routesByHost = new WeakMap();
|
|
22
|
+
function routesFor(host) {
|
|
23
|
+
let routes = routesByHost.get(host);
|
|
24
|
+
if (!routes) {
|
|
25
|
+
routes = new ChildCommandTaskRoutes();
|
|
26
|
+
routesByHost.set(host, routes);
|
|
27
|
+
}
|
|
28
|
+
return routes;
|
|
29
|
+
}
|
|
30
|
+
/** Completion route for a task a child launched in this owner, only while that child accepts messages. */
|
|
31
|
+
export function childTaskCompletionRoute(host, taskId) {
|
|
32
|
+
return routesByHost.get(host)?.openRoute(taskId);
|
|
33
|
+
}
|
|
34
|
+
/** Resolve the parent's live owner per call so session replacement is followed like the parent's own shells. */
|
|
35
|
+
export function createChildCommandTaskOwner(resolveHost) {
|
|
36
|
+
return {
|
|
37
|
+
bind(childId, route, waits) {
|
|
38
|
+
const host = resolveHost();
|
|
39
|
+
const routes = routesFor(host);
|
|
40
|
+
routes.bind(childId, route);
|
|
41
|
+
const { supervisor, owner } = host.ownerBinding;
|
|
42
|
+
return {
|
|
43
|
+
supervisor,
|
|
44
|
+
owner,
|
|
45
|
+
ownsTask: (taskId) => routes.launchedByChild(taskId, childId),
|
|
46
|
+
onCommandStarted: (taskId) => routes.recordLaunch(taskId, childId),
|
|
47
|
+
waitForTask: (taskId, budgetMs, onRegistered) => supervisor.waitForTaskId(owner, taskId, budgetMs, (wait) => {
|
|
48
|
+
waits.track(supervisor, wait);
|
|
49
|
+
onRegistered?.(wait);
|
|
50
|
+
}),
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** Child-side waits on parent-owned tasks; inbound child messages release observation, never execution. */
|
|
56
|
+
export class ChildTaskWaits {
|
|
57
|
+
constructor() {
|
|
58
|
+
this.waits = new Map();
|
|
59
|
+
}
|
|
60
|
+
track(supervisor, wait) {
|
|
61
|
+
this.waits.set(wait, supervisor);
|
|
62
|
+
const remove = () => this.waits.delete(wait);
|
|
63
|
+
void supervisor.observeTaskWait(wait).then(remove, remove);
|
|
64
|
+
}
|
|
65
|
+
yieldAll(reason) {
|
|
66
|
+
for (const [wait, supervisor] of this.waits)
|
|
67
|
+
supervisor.yieldTaskWait(wait, reason);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=child-command-owner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child-command-owner.js","sourceRoot":"","sources":["../../../src/core/tasks/child-command-owner.ts"],"names":[],"mappings":"AA2BA,MAAM,sBAAsB;IAA5B;QACkB,eAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;QACvC,WAAM,GAAG,IAAI,GAAG,EAAoC,CAAC;IAmBvE,CAAC;IAjBA,IAAI,CAAC,OAAe,EAAE,KAA+B;QACpD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,YAAY,CAAC,MAAc,EAAE,OAAe;QAC3C,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,eAAe,CAAC,MAAc,EAAE,OAAe;QAC9C,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,OAAO,CAAC;IAChD,CAAC;IAED,SAAS,CAAC,MAAc;QACvB,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC5C,MAAM,KAAK,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,C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,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,CAC/C,UAAU,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;oBAC1D,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;oBAC9B,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC;gBACtB,CAAC,CAAC;aACH,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC;AAED,2GAA2G;AAC3G,MAAM,OAAO,cAAc;IAA3B;QACkB,UAAK,GAAG,IAAI,GAAG,EAA6B,CAAC;IAW/D,CAAC;IATA,KAAK,CAAC,UAA0B,EAAE,IAAe;QAChD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACjC,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC7C,KAAK,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC;IAED,QAAQ,CAAC,MAAmB;QAC3B,KAAK,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC,KAAK;YAAE,UAAU,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACrF,CAAC;CACD","sourcesContent":["import type { SupervisedCommandOwner } from \"../tools/bash-pty-native.js\";\nimport type { AgentTaskHost } from \"./agent-adapter.js\";\nimport type { TaskId, YieldReason } from \"./contracts.js\";\nimport type { TaskSupervisor, WaitLease } from \"./supervisor.js\";\n\nexport type TaskCompletionMessage = {\n\tcustomType: string;\n\tcontent: string;\n\tdetails: object;\n\tdisplay: true;\n};\n\n/** Live delivery into the child that launched a shell task, while that child still runs. */\nexport interface ChildTaskCompletionRoute {\n\tisOpen(): boolean;\n\tdeliver(message: TaskCompletionMessage): Promise<void>;\n}\n\n/**\n * Parent-issued capability that lets an in-process subagent child run shell tasks\n * in the parent's task owner, so they appear in the parent's `/tasks` and outlive\n * the child. It never authorizes agent launches.\n */\nexport interface ChildCommandTaskOwner {\n\tbind(childId: string, route: ChildTaskCompletionRoute, waits: ChildTaskWaits): SupervisedCommandOwner;\n}\n\nclass ChildCommandTaskRoutes {\n\tprivate readonly launchedBy = new Map<TaskId, string>();\n\tprivate readonly routes = new Map<string, ChildTaskCompletionRoute>();\n\n\tbind(childId: string, route: ChildTaskCompletionRoute): void {\n\t\tthis.routes.set(childId, route);\n\t}\n\n\trecordLaunch(taskId: TaskId, childId: string): void {\n\t\tthis.launchedBy.set(taskId, childId);\n\t}\n\n\tlaunchedByChild(taskId: TaskId, childId: string): boolean {\n\t\treturn this.launchedBy.get(taskId) === childId;\n\t}\n\n\topenRoute(taskId: TaskId): ChildTaskCompletionRoute | undefined {\n\t\tconst childId = this.launchedBy.get(taskId);\n\t\tconst route = childId === undefined ? undefined : this.routes.get(childId);\n\t\treturn route?.isOpen() ? route : undefined;\n\t}\n}\n\nconst routesByHost = new WeakMap<AgentTaskHost, ChildCommandTaskRoutes>();\n\nfunction routesFor(host: AgentTaskHost): ChildCommandTaskRoutes {\n\tlet routes = routesByHost.get(host);\n\tif (!routes) {\n\t\troutes = new ChildCommandTaskRoutes();\n\t\troutesByHost.set(host, routes);\n\t}\n\treturn routes;\n}\n\n/** Completion route for a task a child launched in this owner, only while that child accepts messages. */\nexport function childTaskCompletionRoute(host: AgentTaskHost, taskId: TaskId): ChildTaskCompletionRoute | undefined {\n\treturn routesByHost.get(host)?.openRoute(taskId);\n}\n\n/** Resolve the parent's live owner per call so session replacement is followed like the parent's own shells. */\nexport function createChildCommandTaskOwner(resolveHost: () => AgentTaskHost): ChildCommandTaskOwner {\n\treturn {\n\t\tbind(childId, route, waits) {\n\t\t\tconst host = resolveHost();\n\t\t\tconst routes = routesFor(host);\n\t\t\troutes.bind(childId, route);\n\t\t\tconst { supervisor, owner } = host.ownerBinding;\n\t\t\treturn {\n\t\t\t\tsupervisor,\n\t\t\t\towner,\n\t\t\t\townsTask: (taskId) => routes.launchedByChild(taskId, childId),\n\t\t\t\tonCommandStarted: (taskId) => routes.recordLaunch(taskId, childId),\n\t\t\t\twaitForTask: (taskId, budgetMs, onRegistered) =>\n\t\t\t\t\tsupervisor.waitForTaskId(owner, taskId, budgetMs, (wait) => {\n\t\t\t\t\t\twaits.track(supervisor, wait);\n\t\t\t\t\t\tonRegistered?.(wait);\n\t\t\t\t\t}),\n\t\t\t};\n\t\t},\n\t};\n}\n\n/** Child-side waits on parent-owned tasks; inbound child messages release observation, never execution. */\nexport class ChildTaskWaits {\n\tprivate readonly waits = new Map<WaitLease, TaskSupervisor>();\n\n\ttrack(supervisor: TaskSupervisor, wait: WaitLease): void {\n\t\tthis.waits.set(wait, supervisor);\n\t\tconst remove = () => this.waits.delete(wait);\n\t\tvoid supervisor.observeTaskWait(wait).then(remove, remove);\n\t}\n\n\tyieldAll(reason: YieldReason): void {\n\t\tfor (const [wait, supervisor] of this.waits) supervisor.yieldTaskWait(wait, reason);\n\t}\n}\n"]}
|
|
@@ -94,6 +94,10 @@ export type WaitOutcome = {
|
|
|
94
94
|
waitId: WaitId;
|
|
95
95
|
reason: YieldReason;
|
|
96
96
|
};
|
|
97
|
+
export type RouterSelection = {
|
|
98
|
+
readonly model: string;
|
|
99
|
+
readonly effort: string | null;
|
|
100
|
+
};
|
|
97
101
|
export type AgentIntent = {
|
|
98
102
|
kind: "agent";
|
|
99
103
|
agent: string;
|
|
@@ -101,6 +105,7 @@ export type AgentIntent = {
|
|
|
101
105
|
description?: string;
|
|
102
106
|
cwd?: string;
|
|
103
107
|
parentTaskId?: TaskId;
|
|
108
|
+
readonly routerSelection?: RouterSelection;
|
|
104
109
|
};
|
|
105
110
|
export type CommandIntent = {
|
|
106
111
|
kind: "command";
|
|
@@ -234,6 +239,7 @@ export type TaskRecord = {
|
|
|
234
239
|
/** Resolved execution settings, retained after completion. */
|
|
235
240
|
model?: string;
|
|
236
241
|
thinking?: string;
|
|
242
|
+
readonly routerSelection?: RouterSelection;
|
|
237
243
|
execution: Execution;
|
|
238
244
|
observation: HostObservation;
|
|
239
245
|
/** Retained native background membership, independent of the current wait. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/core/tasks/contracts.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,CAAC,MAAM,KAAK,EAAE,OAAO,MAAM,CAAC;AACnC,KAAK,KAAK,CAAC,IAAI,SAAS,MAAM,IAAI;IAAE,QAAQ,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAC7D,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;AAChD,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;AAC9C,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC;AACpD,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;AAC9C,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;AACxD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;AACtD,8CAA8C;AAC9C,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;AAClD,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC;AAC5E,MAAM,MAAM,OAAO,CAAC,IAAI,S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AAE,YAAY,CAAA;KAAE,CAAA;CAAE,CAAC;AACrG,MAAM,MAAM,cAAc,GACvB,aAAa,GACb;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,uBAAuB,CAAA;KAAE,CAAA;CAAE,CAAC;AACtF,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,aAAa,CAAC;AAChE,MAAM,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,aAAa,GAAG,cAAc,CAAA;KAAE,CAAC,CAAC;CAC3E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/core/tasks/contracts.ts"],"names":[],"mappings":"","sourcesContent":["/** Owner-bound task wire contracts. Capabilities are deliberately not wire DTOs. */\ndeclare const brand: unique symbol;\ntype Brand<Name extends string> = { readonly [brand]: Name };\nexport type OwnerId = string & Brand<\"OwnerId\">;\nexport type TaskId = string & Brand<\"TaskId\">;\nexport type AttemptId = string & Brand<\"AttemptId\">;\nexport type WaitId = string & Brand<\"WaitId\">;\nexport type OperationId = string & Brand<\"OperationId\">;\nexport type Generation = string & Brand<\"Generation\">;\n/** Decimal u64, never a JavaScript number. */\nexport type Sequence = string & Brand<\"Sequence\">;\nexport type Result<T, E> = { ok: true; value: T } | { ok: false; error: E };\nexport type Failure<Code extends string> = { code: Code; message: string };\nexport type OwnerError = Failure<\"ScopeMismatch\" | \"EnvironmentClosing\">;\nexport type StartError =\n\t| \"OwnerClosing\"\n\t| \"UnknownAgent\"\n\t| \"InvalidCwd\"\n\t| \"DepthExceeded\"\n\t| \"CapacityExhausted\"\n\t| \"DispatchGuardBusy\"\n\t| \"OperationConflict\"\n\t| \"RunnerUnavailable\"\n\t| \"SpawnFailed\"\n\t| \"ContainmentUnavailable\";\nexport type StartFailure = Failure<StartError>;\nexport type WaitError = Failure<\n\t\"UnknownTask\" | \"OwnerClosed\" | \"EnvironmentClosing\" | \"ScopeMismatch\" | \"ObserverCancelled\"\n>;\nexport type YieldError = Failure<\"UnknownWait\" | \"StaleGeneration\" | \"ObserverCancelled\">;\nexport type ForegroundError = Failure<\"TaskTerminal\" | \"OwnerClosing\" | \"UnknownTask\" | \"ObserverCancelled\">;\nexport type CancelError = Failure<\"UnknownTask\" | \"CleanupFailed\">;\nexport type CloseError = Failure<\"CleanupFailed\" | \"EnvironmentClosing\">;\nexport type WatchError = Failure<\"OwnerClosed\" | \"StaleGeneration\" | \"EnvironmentClosing\">;\nexport type ReportError = Failure<\"StaleAttempt\" | \"OwnerClosing\" | \"TaskTerminal\" | \"ReportConflict\">;\nexport type InputData = { kind: \"bytes\"; bytes: Uint8Array } | { kind: \"eof\" };\nexport type InputReceipt = { operationId: OperationId; acceptedBytes: number; kind: \"bytes\" | \"eof\" };\nexport type InputError = Failure<\n\t| \"TaskTerminal\"\n\t| \"StdinClosed\"\n\t| \"InputBackpressure\"\n\t| \"OperationConflict\"\n\t| \"InputDeliveryUnknown\"\n\t| \"UnknownTask\"\n\t| \"OutputUnavailable\"\n>;\nexport type OutputError = Failure<\"UnknownTask\" | \"OutputUnavailable\">;\nexport type OutputRange = { start: string; maximumBytes: number };\nexport type OutputPage = {\n\trequested: { start: string; end: string };\n\tchunks: Array<{ offsets: { start: string; end: string }; bytes: Uint8Array }>;\n\tomittedRanges: Array<{ start: string; end: string }>;\n\tnextOffset?: string;\n};\nexport type OwnerScope =\n\t| { kind: \"session\"; sessionId: string }\n\t| { kind: \"workflow-stage\"; sessionId: string; runId: string; stageId: string; stageAttemptId: string };\nexport type WaitPolicy = { kind: \"background\" } | { kind: \"foreground\"; budgetMs?: number };\nexport type YieldReason = \"explicit\" | \"default-background\" | \"elapsed\" | \"intercom-coordination\" | \"input-needed\";\nexport type WaitOutcome =\n\t| { kind: \"settled\"; taskId: TaskId; result: TaskResult }\n\t| { kind: \"yielded\"; taskId: TaskId; waitId: WaitId; reason: YieldReason };\nexport type AgentIntent = {\n\tkind: \"agent\";\n\tagent: string;\n\ttask: string;\n\tdescription?: string;\n\tcwd?: string;\n\tparentTaskId?: TaskId;\n};\nexport type CommandIntent = {\n\tkind: \"command\";\n\tcommand: string;\n\tdescription?: string;\n\tcwd?: string;\n\tenv?: Record<string, string>;\n\t/** Explicit executable and prefix arguments; command is appended as one argument. */\n\tshell?: { program: string; args: string[] };\n\t/** False replaces the inherited environment with env; omission preserves inheritance. */\n\tinheritEnv?: boolean;\n\tterminal: { kind: \"pipe\" } | { kind: \"pty\"; columns: number; rows: number };\n\texecutionTimeoutMs?: number;\n\tparentTaskId?: TaskId;\n};\nexport type TaskIntent = AgentIntent | CommandIntent;\nexport type TaskWaitConfiguration =\n\t| { kind: \"automatic\"; commandBudgetMs?: number; agentBudgetMs?: number }\n\t| { kind: \"until-settled\" };\nexport type CancelCause = \"user\" | \"owner-close\" | \"execution-timeout\" | \"output-limit\" | \"parent-handoff\" | \"shutdown\";\nexport type OwnerCloseCause = \"session-close\" | \"stage-close\" | \"app-shutdown\";\nexport type Cursor = { generation: Generation; sequence: Sequence };\nexport type NativeTaskRef = { ownerId: OwnerId; taskId: TaskId; attemptId: AttemptId; generation: Generation };\nexport type OutputRef = {\n\townerId: OwnerId;\n\ttaskId: TaskId;\n\tartifactId: string;\n\tbyteCount: string;\n\tomittedRanges: Array<{ start: string; end: string }>;\n};\nexport type TaskResult =\n\t| { kind: \"completed\"; output: OutputRef; exitCode?: number }\n\t| { kind: \"failed\"; code: string; message: string; output?: OutputRef; exitCode?: number }\n\t| { kind: \"cancelled\"; cause: CancelCause; output?: OutputRef };\nexport type Execution =\n\t| { kind: \"queued\" }\n\t| { kind: \"running\" }\n\t| { kind: \"cancelling\"; cause: CancelCause }\n\t| { kind: \"settled\"; result: TaskResult };\nexport type ResourceFailure = { resource: string; code: string; message: string };\nexport type Cleanup =\n\t| { kind: \"active\" }\n\t| { kind: \"draining\" }\n\t| { kind: \"reaped\" }\n\t| { kind: \"failed\"; resources: Array<ResourceFailure> };\nexport type PromptRoute = { sessionId: string; promptId: string; stageAttemptId?: string };\nexport type Attention =\n\t| { kind: \"none\" }\n\t| { kind: \"input-needed\"; requestId: string; prompt: string; route: PromptRoute }\n\t| { kind: \"no-recent-activity\"; lastActivityAt?: string };\nexport type HostObservation =\n\t| { kind: \"foreground\"; waitId: WaitId }\n\t| { kind: \"background\"; reason: YieldReason | \"not-observed\" | \"observer-cancelled\" }\n\t| { kind: \"none\"; reason: \"task-settled\" | \"owner-closing\" };\nexport type TaskRecord = {\n\tref: NativeTaskRef;\n\tlaunchOperationId: OperationId;\n\tparentTaskId?: TaskId;\n\tlaunchGroupId?: string;\n\tlaunchOrdinal: number;\n\tkind: \"agent\" | \"command\";\n\ttitle: string;\n\tagentName?: string;\n\t/** Resolved execution settings, retained after completion. */\n\tmodel?: string;\n\tthinking?: string;\n\texecution: Execution;\n\tobservation: HostObservation;\n\t/** Retained native background membership, independent of the current wait. */\n\twasBackground?: boolean;\n\tattention: Attention;\n\tcleanup: Cleanup;\n\tcurrentAction?: { tool: string; text: string };\n\tmetrics?: { elapsedMs?: number; toolCount?: number; tokenCount?: number };\n\toutput: OutputRef;\n};\n/**\n * The latest 256 accepted activity IDs per task retain SHA-256 payload hashes and receipts.\n * Identical replay is duplicate; changed payload conflicts, without events or retention refresh.\n * Evicted IDs are fresh reports, subject to existing terminal/owner guards, not task revival.\n */\nexport type ActivityReport = {\n\treportId: string;\n\tchange:\n\t\t| { kind: \"action\"; tool: string; text: string }\n\t\t| { kind: \"model\"; model?: string; thinking?: string }\n\t\t| { kind: \"metrics\"; elapsedMs?: number; toolCount?: number; tokenCount?: number }\n\t\t| { kind: \"output\"; offset: string; bytesBase64: string }\n\t\t| { kind: \"attention-set\"; attention: Exclude<Attention, { kind: \"none\" }> }\n\t\t| { kind: \"attention-clear\"; requestId: string };\n};\n/** Terminal reports and their receipts never expire while the task record exists. */\nexport type OutcomeReport = { reportId: string; result: TaskResult };\nexport type TaskEvent =\n\t| { kind: \"task-admitted\"; task: TaskRecord }\n\t| { kind: \"task-started\"; ref: NativeTaskRef }\n\t| { kind: \"wait-yielded\"; ref: NativeTaskRef; waitId: WaitId; reason: YieldReason }\n\t| { kind: \"wait-started\"; ref: NativeTaskRef; waitId: WaitId; observer: \"sdk\" | \"host\" }\n\t| { kind: \"host-observation-changed\"; ref: NativeTaskRef; observation: HostObservation }\n\t| { kind: \"task-activity\"; ref: NativeTaskRef; activity: ActivityReport }\n\t| { kind: \"task-cancelling\"; ref: NativeTaskRef; cause: CancelCause }\n\t| { kind: \"task-settled\"; ref: NativeTaskRef; result: TaskResult; completionId: string }\n\t| { kind: \"cleanup-changed\"; ref: NativeTaskRef; cleanup: Cleanup }\n\t| { kind: \"owner-closing\" }\n\t| { kind: \"owner-closed\" };\nexport type NativeEvent = {\n\tschemaVersion: 1;\n\tcursor: Cursor;\n\townerId: OwnerId;\n\ttaskId?: TaskId;\n\tpayload: TaskEvent;\n};\nexport type OwnerSnapshot = {\n\townerId: OwnerId;\n\tscope: OwnerScope;\n\tgeneration: Generation;\n\tstate: \"open\" | \"closing\" | \"closed\";\n\ttasks: Array<TaskRecord>;\n\tcursor: Cursor;\n};\nexport type ReportReceipt = { reportId: string; cursor: Cursor; disposition: \"accepted\" | \"duplicate\" };\nexport type SettlementReceipt = { taskId: TaskId; cursor: Cursor; result: TaskResult; completionId: string };\nexport type CancelReceipt = {\n\ttaskId: TaskId;\n\tdecision: \"already-settled\" | \"cancellation-requested\";\n\texecution: Execution;\n\tcleanup: Cleanup;\n};\nexport type OwnerCloseReceipt = { ownerId: OwnerId; state: \"closed\"; tasks: Array<CancelReceipt> };\nexport type ArtifactRef = { kind: \"transcript\" | \"result\"; uri: string };\nexport type ModelAdmitted = { kind: \"admitted\"; observation: WaitOutcome; artifacts?: Array<ArtifactRef> };\nexport type ModelRejected = { kind: \"unstarted\"; reason: { kind: \"rejected\"; error: StartFailure } };\nexport type ModelUnstarted =\n\t| ModelRejected\n\t| { kind: \"unstarted\"; reason: { kind: \"skipped\"; cause: \"parallel-group-detach\" } };\nexport type ModelSingleResponse = ModelAdmitted | ModelRejected;\nexport type ModelParallelResponse = {\n\tkind: \"parallel\";\n\tslots: Array<{ ordinal: number; outcome: ModelAdmitted | ModelUnstarted }>;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/core/tasks/contracts.ts"],"names":[],"mappings":"","sourcesContent":["/** Owner-bound task wire contracts. Capabilities are deliberately not wire DTOs. */\ndeclare const brand: unique symbol;\ntype Brand<Name extends string> = { readonly [brand]: Name };\nexport type OwnerId = string & Brand<\"OwnerId\">;\nexport type TaskId = string & Brand<\"TaskId\">;\nexport type AttemptId = string & Brand<\"AttemptId\">;\nexport type WaitId = string & Brand<\"WaitId\">;\nexport type OperationId = string & Brand<\"OperationId\">;\nexport type Generation = string & Brand<\"Generation\">;\n/** Decimal u64, never a JavaScript number. */\nexport type Sequence = string & Brand<\"Sequence\">;\nexport type Result<T, E> = { ok: true; value: T } | { ok: false; error: E };\nexport type Failure<Code extends string> = { code: Code; message: string };\nexport type OwnerError = Failure<\"ScopeMismatch\" | \"EnvironmentClosing\">;\nexport type StartError =\n\t| \"OwnerClosing\"\n\t| \"UnknownAgent\"\n\t| \"InvalidCwd\"\n\t| \"DepthExceeded\"\n\t| \"CapacityExhausted\"\n\t| \"DispatchGuardBusy\"\n\t| \"OperationConflict\"\n\t| \"RunnerUnavailable\"\n\t| \"SpawnFailed\"\n\t| \"ContainmentUnavailable\";\nexport type StartFailure = Failure<StartError>;\nexport type WaitError = Failure<\n\t\"UnknownTask\" | \"OwnerClosed\" | \"EnvironmentClosing\" | \"ScopeMismatch\" | \"ObserverCancelled\"\n>;\nexport type YieldError = Failure<\"UnknownWait\" | \"StaleGeneration\" | \"ObserverCancelled\">;\nexport type ForegroundError = Failure<\"TaskTerminal\" | \"OwnerClosing\" | \"UnknownTask\" | \"ObserverCancelled\">;\nexport type CancelError = Failure<\"UnknownTask\" | \"CleanupFailed\">;\nexport type CloseError = Failure<\"CleanupFailed\" | \"EnvironmentClosing\">;\nexport type WatchError = Failure<\"OwnerClosed\" | \"StaleGeneration\" | \"EnvironmentClosing\">;\nexport type ReportError = Failure<\"StaleAttempt\" | \"OwnerClosing\" | \"TaskTerminal\" | \"ReportConflict\">;\nexport type InputData = { kind: \"bytes\"; bytes: Uint8Array } | { kind: \"eof\" };\nexport type InputReceipt = { operationId: OperationId; acceptedBytes: number; kind: \"bytes\" | \"eof\" };\nexport type InputError = Failure<\n\t| \"TaskTerminal\"\n\t| \"StdinClosed\"\n\t| \"InputBackpressure\"\n\t| \"OperationConflict\"\n\t| \"InputDeliveryUnknown\"\n\t| \"UnknownTask\"\n\t| \"OutputUnavailable\"\n>;\nexport type OutputError = Failure<\"UnknownTask\" | \"OutputUnavailable\">;\nexport type OutputRange = { start: string; maximumBytes: number };\nexport type OutputPage = {\n\trequested: { start: string; end: string };\n\tchunks: Array<{ offsets: { start: string; end: string }; bytes: Uint8Array }>;\n\tomittedRanges: Array<{ start: string; end: string }>;\n\tnextOffset?: string;\n};\nexport type OwnerScope =\n\t| { kind: \"session\"; sessionId: string }\n\t| { kind: \"workflow-stage\"; sessionId: string; runId: string; stageId: string; stageAttemptId: string };\nexport type WaitPolicy = { kind: \"background\" } | { kind: \"foreground\"; budgetMs?: number };\nexport type YieldReason = \"explicit\" | \"default-background\" | \"elapsed\" | \"intercom-coordination\" | \"input-needed\";\nexport type WaitOutcome =\n\t| { kind: \"settled\"; taskId: TaskId; result: TaskResult }\n\t| { kind: \"yielded\"; taskId: TaskId; waitId: WaitId; reason: YieldReason };\nexport type RouterSelection = { readonly model: string; readonly effort: string | null };\nexport type AgentIntent = {\n\tkind: \"agent\";\n\tagent: string;\n\ttask: string;\n\tdescription?: string;\n\tcwd?: string;\n\tparentTaskId?: TaskId;\n\treadonly routerSelection?: RouterSelection;\n};\nexport type CommandIntent = {\n\tkind: \"command\";\n\tcommand: string;\n\tdescription?: string;\n\tcwd?: string;\n\tenv?: Record<string, string>;\n\t/** Explicit executable and prefix arguments; command is appended as one argument. */\n\tshell?: { program: string; args: string[] };\n\t/** False replaces the inherited environment with env; omission preserves inheritance. */\n\tinheritEnv?: boolean;\n\tterminal: { kind: \"pipe\" } | { kind: \"pty\"; columns: number; rows: number };\n\texecutionTimeoutMs?: number;\n\tparentTaskId?: TaskId;\n};\nexport type TaskIntent = AgentIntent | CommandIntent;\nexport type TaskWaitConfiguration =\n\t| { kind: \"automatic\"; commandBudgetMs?: number; agentBudgetMs?: number }\n\t| { kind: \"until-settled\" };\nexport type CancelCause = \"user\" | \"owner-close\" | \"execution-timeout\" | \"output-limit\" | \"parent-handoff\" | \"shutdown\";\nexport type OwnerCloseCause = \"session-close\" | \"stage-close\" | \"app-shutdown\";\nexport type Cursor = { generation: Generation; sequence: Sequence };\nexport type NativeTaskRef = { ownerId: OwnerId; taskId: TaskId; attemptId: AttemptId; generation: Generation };\nexport type OutputRef = {\n\townerId: OwnerId;\n\ttaskId: TaskId;\n\tartifactId: string;\n\tbyteCount: string;\n\tomittedRanges: Array<{ start: string; end: string }>;\n};\nexport type TaskResult =\n\t| { kind: \"completed\"; output: OutputRef; exitCode?: number }\n\t| { kind: \"failed\"; code: string; message: string; output?: OutputRef; exitCode?: number }\n\t| { kind: \"cancelled\"; cause: CancelCause; output?: OutputRef };\nexport type Execution =\n\t| { kind: \"queued\" }\n\t| { kind: \"running\" }\n\t| { kind: \"cancelling\"; cause: CancelCause }\n\t| { kind: \"settled\"; result: TaskResult };\nexport type ResourceFailure = { resource: string; code: string; message: string };\nexport type Cleanup =\n\t| { kind: \"active\" }\n\t| { kind: \"draining\" }\n\t| { kind: \"reaped\" }\n\t| { kind: \"failed\"; resources: Array<ResourceFailure> };\nexport type PromptRoute = { sessionId: string; promptId: string; stageAttemptId?: string };\nexport type Attention =\n\t| { kind: \"none\" }\n\t| { kind: \"input-needed\"; requestId: string; prompt: string; route: PromptRoute }\n\t| { kind: \"no-recent-activity\"; lastActivityAt?: string };\nexport type HostObservation =\n\t| { kind: \"foreground\"; waitId: WaitId }\n\t| { kind: \"background\"; reason: YieldReason | \"not-observed\" | \"observer-cancelled\" }\n\t| { kind: \"none\"; reason: \"task-settled\" | \"owner-closing\" };\nexport type TaskRecord = {\n\tref: NativeTaskRef;\n\tlaunchOperationId: OperationId;\n\tparentTaskId?: TaskId;\n\tlaunchGroupId?: string;\n\tlaunchOrdinal: number;\n\tkind: \"agent\" | \"command\";\n\ttitle: string;\n\tagentName?: string;\n\t/** Resolved execution settings, retained after completion. */\n\tmodel?: string;\n\tthinking?: string;\n\treadonly routerSelection?: RouterSelection;\n\texecution: Execution;\n\tobservation: HostObservation;\n\t/** Retained native background membership, independent of the current wait. */\n\twasBackground?: boolean;\n\tattention: Attention;\n\tcleanup: Cleanup;\n\tcurrentAction?: { tool: string; text: string };\n\tmetrics?: { elapsedMs?: number; toolCount?: number; tokenCount?: number };\n\toutput: OutputRef;\n};\n/**\n * The latest 256 accepted activity IDs per task retain SHA-256 payload hashes and receipts.\n * Identical replay is duplicate; changed payload conflicts, without events or retention refresh.\n * Evicted IDs are fresh reports, subject to existing terminal/owner guards, not task revival.\n */\nexport type ActivityReport = {\n\treportId: string;\n\tchange:\n\t\t| { kind: \"action\"; tool: string; text: string }\n\t\t| { kind: \"model\"; model?: string; thinking?: string }\n\t\t| { kind: \"metrics\"; elapsedMs?: number; toolCount?: number; tokenCount?: number }\n\t\t| { kind: \"output\"; offset: string; bytesBase64: string }\n\t\t| { kind: \"attention-set\"; attention: Exclude<Attention, { kind: \"none\" }> }\n\t\t| { kind: \"attention-clear\"; requestId: string };\n};\n/** Terminal reports and their receipts never expire while the task record exists. */\nexport type OutcomeReport = { reportId: string; result: TaskResult };\nexport type TaskEvent =\n\t| { kind: \"task-admitted\"; task: TaskRecord }\n\t| { kind: \"task-started\"; ref: NativeTaskRef }\n\t| { kind: \"wait-yielded\"; ref: NativeTaskRef; waitId: WaitId; reason: YieldReason }\n\t| { kind: \"wait-started\"; ref: NativeTaskRef; waitId: WaitId; observer: \"sdk\" | \"host\" }\n\t| { kind: \"host-observation-changed\"; ref: NativeTaskRef; observation: HostObservation }\n\t| { kind: \"task-activity\"; ref: NativeTaskRef; activity: ActivityReport }\n\t| { kind: \"task-cancelling\"; ref: NativeTaskRef; cause: CancelCause }\n\t| { kind: \"task-settled\"; ref: NativeTaskRef; result: TaskResult; completionId: string }\n\t| { kind: \"cleanup-changed\"; ref: NativeTaskRef; cleanup: Cleanup }\n\t| { kind: \"owner-closing\" }\n\t| { kind: \"owner-closed\" };\nexport type NativeEvent = {\n\tschemaVersion: 1;\n\tcursor: Cursor;\n\townerId: OwnerId;\n\ttaskId?: TaskId;\n\tpayload: TaskEvent;\n};\nexport type OwnerSnapshot = {\n\townerId: OwnerId;\n\tscope: OwnerScope;\n\tgeneration: Generation;\n\tstate: \"open\" | \"closing\" | \"closed\";\n\ttasks: Array<TaskRecord>;\n\tcursor: Cursor;\n};\nexport type ReportReceipt = { reportId: string; cursor: Cursor; disposition: \"accepted\" | \"duplicate\" };\nexport type SettlementReceipt = { taskId: TaskId; cursor: Cursor; result: TaskResult; completionId: string };\nexport type CancelReceipt = {\n\ttaskId: TaskId;\n\tdecision: \"already-settled\" | \"cancellation-requested\";\n\texecution: Execution;\n\tcleanup: Cleanup;\n};\nexport type OwnerCloseReceipt = { ownerId: OwnerId; state: \"closed\"; tasks: Array<CancelReceipt> };\nexport type ArtifactRef = { kind: \"transcript\" | \"result\"; uri: string };\nexport type ModelAdmitted = { kind: \"admitted\"; observation: WaitOutcome; artifacts?: Array<ArtifactRef> };\nexport type ModelRejected = { kind: \"unstarted\"; reason: { kind: \"rejected\"; error: StartFailure } };\nexport type ModelUnstarted =\n\t| ModelRejected\n\t| { kind: \"unstarted\"; reason: { kind: \"skipped\"; cause: \"parallel-group-detach\" } };\nexport type ModelSingleResponse = ModelAdmitted | ModelRejected;\nexport type ModelParallelResponse = {\n\tkind: \"parallel\";\n\tslots: Array<{ ordinal: number; outcome: ModelAdmitted | ModelUnstarted }>;\n};\n"]}
|
|
@@ -22,6 +22,7 @@ export declare class OwnerTaskStore {
|
|
|
22
22
|
private activityCursors;
|
|
23
23
|
private omittedActivity;
|
|
24
24
|
private backgroundIds;
|
|
25
|
+
private settlements;
|
|
25
26
|
readonly anchors: Map<TaskId, TaskAnchor>;
|
|
26
27
|
private current?;
|
|
27
28
|
readonly supervisor: TaskSupervisor;
|
|
@@ -32,6 +33,11 @@ export declare class OwnerTaskStore {
|
|
|
32
33
|
get tasks(): TaskRecord[];
|
|
33
34
|
/** Background membership survives foreground waits and terminal observation cleanup. */
|
|
34
35
|
get backgroundTasks(): TaskRecord[];
|
|
36
|
+
/**
|
|
37
|
+
* Journal sequence at which each task settled; higher is more recent. Tasks first seen settled in a
|
|
38
|
+
* snapshot without their settlement event share that snapshot's sequence, so their order is unknown.
|
|
39
|
+
*/
|
|
40
|
+
get settlementOrder(): ReadonlyMap<TaskId, bigint>;
|
|
35
41
|
/** Resolve only within the owner that authorized this store. */
|
|
36
42
|
resolveTask(id: TaskId): Result<TaskLease, WaitError>;
|
|
37
43
|
recentActivity(id: TaskId): TaskActivity[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"owner-store.d.ts","sourceRoot":"","sources":["../../../src/core/tasks/owner-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,cAAc,EACd,MAAM,EAEN,aAAa,EACb,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,UAAU,EACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAoB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE/F,oFAAoF;AACpF,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,eAAO,MAAM,mBAAmB,OAAO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nerTaskStore {
|
|
|
14
14
|
this.activityCursors = new Map();
|
|
15
15
|
this.omittedActivity = new Set();
|
|
16
16
|
this.backgroundIds = new Set();
|
|
17
|
+
this.settlements = new Map();
|
|
17
18
|
this.anchors = new Map();
|
|
18
19
|
this.supervisor = supervisor;
|
|
19
20
|
this.owner = owner;
|
|
@@ -31,6 +32,13 @@ export class OwnerTaskStore {
|
|
|
31
32
|
get backgroundTasks() {
|
|
32
33
|
return this.tasks.filter((task) => task.wasBackground || isBackground(task.observation) || this.backgroundIds.has(task.ref.taskId));
|
|
33
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Journal sequence at which each task settled; higher is more recent. Tasks first seen settled in a
|
|
37
|
+
* snapshot without their settlement event share that snapshot's sequence, so their order is unknown.
|
|
38
|
+
*/
|
|
39
|
+
get settlementOrder() {
|
|
40
|
+
return this.settlements;
|
|
41
|
+
}
|
|
34
42
|
/** Resolve only within the owner that authorized this store. */
|
|
35
43
|
resolveTask(id) {
|
|
36
44
|
return this.supervisor.lookupTask(this.owner, id);
|
|
@@ -54,8 +62,8 @@ export class OwnerTaskStore {
|
|
|
54
62
|
return watched;
|
|
55
63
|
const subscription = watched.value;
|
|
56
64
|
this.subscription = subscription;
|
|
57
|
-
this.reconcile(subscription.snapshot);
|
|
58
|
-
subscription.onReconcile = (snapshot) => this.reconcile(snapshot);
|
|
65
|
+
this.reconcile(subscription.snapshot, []);
|
|
66
|
+
subscription.onReconcile = (snapshot, events) => this.reconcile(snapshot, events);
|
|
59
67
|
void this.observe(subscription);
|
|
60
68
|
return { ok: true, value: undefined };
|
|
61
69
|
}
|
|
@@ -67,19 +75,24 @@ export class OwnerTaskStore {
|
|
|
67
75
|
this.subscription?.dispose();
|
|
68
76
|
this.subscription = undefined;
|
|
69
77
|
}
|
|
70
|
-
reconcile(snapshot) {
|
|
78
|
+
reconcile(snapshot, events) {
|
|
71
79
|
if (this.current &&
|
|
72
80
|
(snapshot.ownerId !== this.current.ownerId || snapshot.generation !== this.current.generation))
|
|
73
81
|
throw new Error("StaleGeneration: cannot replace a task owner projection");
|
|
74
82
|
if (this.current && BigInt(snapshot.cursor.sequence) <= BigInt(this.current.cursor.sequence))
|
|
75
83
|
return;
|
|
76
84
|
this.current = snapshot;
|
|
85
|
+
for (const event of events)
|
|
86
|
+
if (event.payload.kind === "task-settled" && !this.settlements.has(event.payload.ref.taskId))
|
|
87
|
+
this.settlements.set(event.payload.ref.taskId, BigInt(event.cursor.sequence));
|
|
77
88
|
for (const task of snapshot.tasks) {
|
|
78
89
|
const previous = this.records.get(task.ref.taskId);
|
|
79
90
|
if (isBackground(task.observation) || isBackground(previous?.observation))
|
|
80
91
|
this.backgroundIds.add(task.ref.taskId);
|
|
81
92
|
// Native settlement is immutable, even when recovering a view from a snapshot.
|
|
82
93
|
this.records.set(task.ref.taskId, previous?.execution.kind === "settled" ? { ...task, execution: previous.execution } : task);
|
|
94
|
+
if (task.execution.kind === "settled" && !this.settlements.has(task.ref.taskId))
|
|
95
|
+
this.settlements.set(task.ref.taskId, BigInt(snapshot.cursor.sequence));
|
|
83
96
|
if (!this.anchors.has(task.ref.taskId))
|
|
84
97
|
this.anchors.set(task.ref.taskId, {
|
|
85
98
|
taskId: task.ref.taskId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"owner-store.js","sourceRoot":"","sources":["../../../src/core/tasks/owner-store.ts"],"names":[],"mappings":"AAaA,oFAAoF;AACpF,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AASxC,SAAS,YAAY,CAAC,WAAkD;IACvE,4EAA4E;IAC5E,OAAO,WAAW,EAAE,IAAI,KAAK,YAAY,IAAI,WAAW,CAAC,MAAM,KAAK,cAAc,CAAC;AACpF,CAAC;AAED,qEAAqE;AACrE,MAAM,OAAO,cAAc;IAY1B,YAAY,UAA0B,EAAE,KAAiB;QAVjD,cAAS,GAAG,IAAI,GAAG,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oFAAoF;AACpF,MAAM,UAAU,0BAA0B,CAAC,OAAe,EAAE,QAAoB;IAC/E,IAAI,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC9C,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,gBAAgB,CAAC,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC;IACD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxB,OAAO,GAAG,EAAE;QACX,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC,CAAC;AACH,CAAC","sourcesContent":["import type {\n\tActivityReport,\n\tCursor,\n\tNativeEvent,\n\tOwnerSnapshot,\n\tResult,\n\tTaskId,\n\tTaskRecord,\n\tWaitError,\n\tWatchError,\n} from \"./contracts.js\";\nimport type { OwnerLease, TaskLease, TaskSubscription, TaskSupervisor } from \"./supervisor.js\";\n\n/** Activity previews are bounded independently of authoritative session history. */\nexport const TASK_ACTIVITY_LIMIT = 64;\nexport const TASK_ACTIVITY_BYTES = 8192;\nexport type TaskAnchor = {\n\ttaskId: TaskId;\n\tactivitySequence: Cursor[\"sequence\"];\n\tcellOffset: number;\n\tfollowBottom: boolean;\n};\nexport type TaskActivity = { cursor: Cursor; report: ActivityReport };\n\nfunction isBackground(observation: TaskRecord[\"observation\"] | undefined): boolean {\n\t// Admission starts unobserved; that placeholder is not a background launch.\n\treturn observation?.kind === \"background\" && observation.reason !== \"not-observed\";\n}\n\n/** A view subscription owns neither the owner nor its executions. */\nexport class OwnerTaskStore {\n\tprivate subscription?: TaskSubscription;\n\tprivate listeners = new Set<() => void>();\n\tprivate records = new Map<TaskId, TaskRecord>();\n\tprivate activity = new Map<TaskId, TaskActivity[]>();\n\tprivate activityCursors = new Map<TaskId, bigint>();\n\tprivate omittedActivity = new Set<TaskId>();\n\tprivate backgroundIds = new Set<TaskId>();\n\treadonly anchors = new Map<TaskId, TaskAnchor>();\n\tprivate current?: OwnerSnapshot;\n\treadonly supervisor: TaskSupervisor;\n\tprivate readonly owner: OwnerLease;\n\tconstructor(supervisor: TaskSupervisor, owner: OwnerLease) {\n\t\tthis.supervisor = supervisor;\n\t\tthis.owner = owner;\n\t}\n\n\tget snapshot(): OwnerSnapshot | undefined {\n\t\treturn this.current;\n\t}\n\tget cursor(): Cursor | undefined {\n\t\treturn this.current?.cursor;\n\t}\n\tget tasks(): TaskRecord[] {\n\t\treturn [...this.records.values()];\n\t}\n\t/** Background membership survives foreground waits and terminal observation cleanup. */\n\tget backgroundTasks(): TaskRecord[] {\n\t\treturn this.tasks.filter(\n\t\t\t(task) => task.wasBackground || isBackground(task.observation) || this.backgroundIds.has(task.ref.taskId),\n\t\t);\n\t}\n\t/** Resolve only within the owner that authorized this store. */\n\tresolveTask(id: TaskId): Result<TaskLease, WaitError> {\n\t\treturn this.supervisor.lookupTask(this.owner, id);\n\t}\n\trecentActivity(id: TaskId): TaskActivity[] {\n\t\treturn [...(this.activity.get(id) ?? [])];\n\t}\n\tactivityOmitted(id: TaskId): boolean {\n\t\treturn this.omittedActivity.has(id);\n\t}\n\tsubscribe(listener: () => void): () => void {\n\t\tthis.listeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.listeners.delete(listener);\n\t\t};\n\t}\n\tconnect(): Result<void, WatchError> {\n\t\tthis.dispose();\n\t\tconst watched = this.supervisor.watchOwnerTasks(this.owner, this.cursor);\n\t\tif (!watched.ok) return watched;\n\t\tconst subscription = watched.value;\n\t\tthis.subscription = subscription;\n\t\tthis.reconcile(subscription.snapshot);\n\t\tsubscription.onReconcile = (snapshot) => this.reconcile(snapshot);\n\t\tvoid this.observe(subscription);\n\t\treturn { ok: true, value: undefined };\n\t}\n\t/** Useful at explicit host barriers; no transcript repaint timer is installed. */\n\tdrain(): void {\n\t\tthis.subscription?.drain();\n\t}\n\tdispose(): void {\n\t\tthis.subscription?.dispose();\n\t\tthis.subscription = undefined;\n\t}\n\tprivate reconcile(snapshot: OwnerSnapshot): void {\n\t\tif (\n\t\t\tthis.current &&\n\t\t\t(snapshot.ownerId !== this.current.ownerId || snapshot.generation !== this.current.generation)\n\t\t)\n\t\t\tthrow new Error(\"StaleGeneration: cannot replace a task owner projection\");\n\t\tif (this.current && BigInt(snapshot.cursor.sequence) <= BigInt(this.current.cursor.sequence)) return;\n\t\tthis.current = snapshot;\n\t\tfor (const task of snapshot.tasks) {\n\t\t\tconst previous = this.records.get(task.ref.taskId);\n\t\t\tif (isBackground(task.observation) || isBackground(previous?.observation))\n\t\t\t\tthis.backgroundIds.add(task.ref.taskId);\n\t\t\t// Native settlement is immutable, even when recovering a view from a snapshot.\n\t\t\tthis.records.set(\n\t\t\t\ttask.ref.taskId,\n\t\t\t\tprevious?.execution.kind === \"settled\" ? { ...task, execution: previous.execution } : task,\n\t\t\t);\n\t\t\tif (!this.anchors.has(task.ref.taskId))\n\t\t\t\tthis.anchors.set(task.ref.taskId, {\n\t\t\t\t\ttaskId: task.ref.taskId,\n\t\t\t\t\tactivitySequence: snapshot.cursor.sequence,\n\t\t\t\t\tcellOffset: 0,\n\t\t\t\t\tfollowBottom: true,\n\t\t\t\t});\n\t\t}\n\t\tthis.notify();\n\t}\n\tprivate async observe(subscription: TaskSubscription): Promise<void> {\n\t\t// Journal overflow ends the old iterator after publishing a reset snapshot.\n\t\twhile (this.subscription === subscription && this.current?.state !== \"closed\") {\n\t\t\tfor await (const event of subscription.events) {\n\t\t\t\tif (this.subscription !== subscription) return;\n\t\t\t\tthis.retainActivity(event);\n\t\t\t}\n\t\t\tif (this.subscription !== subscription || this.snapshot?.state === \"closed\") return;\n\t\t\tawait new Promise<void>((resolve) => setImmediate(resolve));\n\t\t}\n\t}\n\tprivate retainActivity(event: NativeEvent): void {\n\t\tif (event.payload.kind === \"host-observation-changed\" && isBackground(event.payload.observation)) {\n\t\t\tthis.backgroundIds.add(event.payload.ref.taskId);\n\t\t\tthis.notify();\n\t\t}\n\t\tif (event.payload.kind !== \"task-activity\") return;\n\t\tconst id = event.payload.ref.taskId;\n\t\tconst sequence = BigInt(event.cursor.sequence);\n\t\tif (sequence <= (this.activityCursors.get(id) ?? -1n)) return;\n\t\tthis.activityCursors.set(id, sequence);\n\t\tconst entries = this.activity.get(id) ?? [];\n\t\tentries.push({ cursor: event.cursor, report: event.payload.activity });\n\t\twhile (entries.length > TASK_ACTIVITY_LIMIT || Buffer.byteLength(JSON.stringify(entries)) > TASK_ACTIVITY_BYTES) {\n\t\t\tentries.shift();\n\t\t\tthis.omittedActivity.add(id);\n\t\t}\n\t\tthis.activity.set(id, entries);\n\t\tthis.notify();\n\t}\n\tprivate notify(): void {\n\t\tfor (const listener of this.listeners) listener();\n\t}\n}\n\n// Host adapters bind their existing session object, never a model-provided owner id.\nconst sessionStores = new WeakMap<object, OwnerTaskStore>();\nconst bindingListeners = new WeakMap<object, Set<() => void>>();\nexport function bindOwnerTaskStore(session: object, store: OwnerTaskStore): void {\n\tsessionStores.set(session, store);\n\tfor (const listener of bindingListeners.get(session) ?? []) listener();\n}\nexport function getOwnerTaskStore(session: object): OwnerTaskStore | undefined {\n\treturn sessionStores.get(session);\n}\n\n/** Observe lazy producer binding without waiting for another tool/session event. */\nexport function watchOwnerTaskStoreBinding(session: object, listener: () => void): () => void {\n\tlet listeners = bindingListeners.get(session);\n\tif (!listeners) {\n\t\tlisteners = new Set();\n\t\tbindingListeners.set(session, listeners);\n\t}\n\tlisteners.add(listener);\n\treturn () => {\n\t\tlisteners.delete(listener);\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"owner-store.js","sourceRoot":"","sources":["../../../src/core/tasks/owner-store.ts"],"names":[],"mappings":"AAaA,oFAAoF;AACpF,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AASxC,SAAS,YAAY,CAAC,WAAkD;IACvE,4EAA4E;IAC5E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AAO,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC;IACD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxB,OAAO,GAAG,EAAE;QACX,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC,CAAC;AACH,CAAC","sourcesContent":["import type {\n\tActivityReport,\n\tCursor,\n\tNativeEvent,\n\tOwnerSnapshot,\n\tResult,\n\tTaskId,\n\tTaskRecord,\n\tWaitError,\n\tWatchError,\n} from \"./contracts.js\";\nimport type { OwnerLease, TaskLease, TaskSubscription, TaskSupervisor } from \"./supervisor.js\";\n\n/** Activity previews are bounded independently of authoritative session history. */\nexport const TASK_ACTIVITY_LIMIT = 64;\nexport const TASK_ACTIVITY_BYTES = 8192;\nexport type TaskAnchor = {\n\ttaskId: TaskId;\n\tactivitySequence: Cursor[\"sequence\"];\n\tcellOffset: number;\n\tfollowBottom: boolean;\n};\nexport type TaskActivity = { cursor: Cursor; report: ActivityReport };\n\nfunction isBackground(observation: TaskRecord[\"observation\"] | undefined): boolean {\n\t// Admission starts unobserved; that placeholder is not a background launch.\n\treturn observation?.kind === \"background\" && observation.reason !== \"not-observed\";\n}\n\n/** A view subscription owns neither the owner nor its executions. */\nexport class OwnerTaskStore {\n\tprivate subscription?: TaskSubscription;\n\tprivate listeners = new Set<() => void>();\n\tprivate records = new Map<TaskId, TaskRecord>();\n\tprivate activity = new Map<TaskId, TaskActivity[]>();\n\tprivate activityCursors = new Map<TaskId, bigint>();\n\tprivate omittedActivity = new Set<TaskId>();\n\tprivate backgroundIds = new Set<TaskId>();\n\tprivate settlements = new Map<TaskId, bigint>();\n\treadonly anchors = new Map<TaskId, TaskAnchor>();\n\tprivate current?: OwnerSnapshot;\n\treadonly supervisor: TaskSupervisor;\n\tprivate readonly owner: OwnerLease;\n\tconstructor(supervisor: TaskSupervisor, owner: OwnerLease) {\n\t\tthis.supervisor = supervisor;\n\t\tthis.owner = owner;\n\t}\n\n\tget snapshot(): OwnerSnapshot | undefined {\n\t\treturn this.current;\n\t}\n\tget cursor(): Cursor | undefined {\n\t\treturn this.current?.cursor;\n\t}\n\tget tasks(): TaskRecord[] {\n\t\treturn [...this.records.values()];\n\t}\n\t/** Background membership survives foreground waits and terminal observation cleanup. */\n\tget backgroundTasks(): TaskRecord[] {\n\t\treturn this.tasks.filter(\n\t\t\t(task) => task.wasBackground || isBackground(task.observation) || this.backgroundIds.has(task.ref.taskId),\n\t\t);\n\t}\n\t/**\n\t * Journal sequence at which each task settled; higher is more recent. Tasks first seen settled in a\n\t * snapshot without their settlement event share that snapshot's sequence, so their order is unknown.\n\t */\n\tget settlementOrder(): ReadonlyMap<TaskId, bigint> {\n\t\treturn this.settlements;\n\t}\n\t/** Resolve only within the owner that authorized this store. */\n\tresolveTask(id: TaskId): Result<TaskLease, WaitError> {\n\t\treturn this.supervisor.lookupTask(this.owner, id);\n\t}\n\trecentActivity(id: TaskId): TaskActivity[] {\n\t\treturn [...(this.activity.get(id) ?? [])];\n\t}\n\tactivityOmitted(id: TaskId): boolean {\n\t\treturn this.omittedActivity.has(id);\n\t}\n\tsubscribe(listener: () => void): () => void {\n\t\tthis.listeners.add(listener);\n\t\treturn () => {\n\t\t\tthis.listeners.delete(listener);\n\t\t};\n\t}\n\tconnect(): Result<void, WatchError> {\n\t\tthis.dispose();\n\t\tconst watched = this.supervisor.watchOwnerTasks(this.owner, this.cursor);\n\t\tif (!watched.ok) return watched;\n\t\tconst subscription = watched.value;\n\t\tthis.subscription = subscription;\n\t\tthis.reconcile(subscription.snapshot, []);\n\t\tsubscription.onReconcile = (snapshot, events) => this.reconcile(snapshot, events);\n\t\tvoid this.observe(subscription);\n\t\treturn { ok: true, value: undefined };\n\t}\n\t/** Useful at explicit host barriers; no transcript repaint timer is installed. */\n\tdrain(): void {\n\t\tthis.subscription?.drain();\n\t}\n\tdispose(): void {\n\t\tthis.subscription?.dispose();\n\t\tthis.subscription = undefined;\n\t}\n\tprivate reconcile(snapshot: OwnerSnapshot, events: readonly NativeEvent[]): void {\n\t\tif (\n\t\t\tthis.current &&\n\t\t\t(snapshot.ownerId !== this.current.ownerId || snapshot.generation !== this.current.generation)\n\t\t)\n\t\t\tthrow new Error(\"StaleGeneration: cannot replace a task owner projection\");\n\t\tif (this.current && BigInt(snapshot.cursor.sequence) <= BigInt(this.current.cursor.sequence)) return;\n\t\tthis.current = snapshot;\n\t\tfor (const event of events)\n\t\t\tif (event.payload.kind === \"task-settled\" && !this.settlements.has(event.payload.ref.taskId))\n\t\t\t\tthis.settlements.set(event.payload.ref.taskId, BigInt(event.cursor.sequence));\n\t\tfor (const task of snapshot.tasks) {\n\t\t\tconst previous = this.records.get(task.ref.taskId);\n\t\t\tif (isBackground(task.observation) || isBackground(previous?.observation))\n\t\t\t\tthis.backgroundIds.add(task.ref.taskId);\n\t\t\t// Native settlement is immutable, even when recovering a view from a snapshot.\n\t\t\tthis.records.set(\n\t\t\t\ttask.ref.taskId,\n\t\t\t\tprevious?.execution.kind === \"settled\" ? { ...task, execution: previous.execution } : task,\n\t\t\t);\n\t\t\tif (task.execution.kind === \"settled\" && !this.settlements.has(task.ref.taskId))\n\t\t\t\tthis.settlements.set(task.ref.taskId, BigInt(snapshot.cursor.sequence));\n\t\t\tif (!this.anchors.has(task.ref.taskId))\n\t\t\t\tthis.anchors.set(task.ref.taskId, {\n\t\t\t\t\ttaskId: task.ref.taskId,\n\t\t\t\t\tactivitySequence: snapshot.cursor.sequence,\n\t\t\t\t\tcellOffset: 0,\n\t\t\t\t\tfollowBottom: true,\n\t\t\t\t});\n\t\t}\n\t\tthis.notify();\n\t}\n\tprivate async observe(subscription: TaskSubscription): Promise<void> {\n\t\t// Journal overflow ends the old iterator after publishing a reset snapshot.\n\t\twhile (this.subscription === subscription && this.current?.state !== \"closed\") {\n\t\t\tfor await (const event of subscription.events) {\n\t\t\t\tif (this.subscription !== subscription) return;\n\t\t\t\tthis.retainActivity(event);\n\t\t\t}\n\t\t\tif (this.subscription !== subscription || this.snapshot?.state === \"closed\") return;\n\t\t\tawait new Promise<void>((resolve) => setImmediate(resolve));\n\t\t}\n\t}\n\tprivate retainActivity(event: NativeEvent): void {\n\t\tif (event.payload.kind === \"host-observation-changed\" && isBackground(event.payload.observation)) {\n\t\t\tthis.backgroundIds.add(event.payload.ref.taskId);\n\t\t\tthis.notify();\n\t\t}\n\t\tif (event.payload.kind !== \"task-activity\") return;\n\t\tconst id = event.payload.ref.taskId;\n\t\tconst sequence = BigInt(event.cursor.sequence);\n\t\tif (sequence <= (this.activityCursors.get(id) ?? -1n)) return;\n\t\tthis.activityCursors.set(id, sequence);\n\t\tconst entries = this.activity.get(id) ?? [];\n\t\tentries.push({ cursor: event.cursor, report: event.payload.activity });\n\t\twhile (entries.length > TASK_ACTIVITY_LIMIT || Buffer.byteLength(JSON.stringify(entries)) > TASK_ACTIVITY_BYTES) {\n\t\t\tentries.shift();\n\t\t\tthis.omittedActivity.add(id);\n\t\t}\n\t\tthis.activity.set(id, entries);\n\t\tthis.notify();\n\t}\n\tprivate notify(): void {\n\t\tfor (const listener of this.listeners) listener();\n\t}\n}\n\n// Host adapters bind their existing session object, never a model-provided owner id.\nconst sessionStores = new WeakMap<object, OwnerTaskStore>();\nconst bindingListeners = new WeakMap<object, Set<() => void>>();\nexport function bindOwnerTaskStore(session: object, store: OwnerTaskStore): void {\n\tsessionStores.set(session, store);\n\tfor (const listener of bindingListeners.get(session) ?? []) listener();\n}\nexport function getOwnerTaskStore(session: object): OwnerTaskStore | undefined {\n\treturn sessionStores.get(session);\n}\n\n/** Observe lazy producer binding without waiting for another tool/session event. */\nexport function watchOwnerTaskStoreBinding(session: object, listener: () => void): () => void {\n\tlet listeners = bindingListeners.get(session);\n\tif (!listeners) {\n\t\tlisteners = new Set();\n\t\tbindingListeners.set(session, listeners);\n\t}\n\tlisteners.add(listener);\n\treturn () => {\n\t\tlisteners.delete(listener);\n\t};\n}\n"]}
|
package/dist/core/tasks/pause.js
CHANGED
|
@@ -1 +1 @@
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KAAK,CAAC,KAAK,EAAE,CAAC;YACd,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACJ,CAAC;YAAS,CAAC;QACV,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;AACF,CAAC","sourcesContent":["import type { AgentTaskHost } from \"./agent-adapter.js\";\nimport type { OwnerSnapshot, TaskRecord } from \"./contracts.js\";\n\n/** The caller synchronously blocks new launches; this never closes the owner or its messages. */\nexport async function cancelPausedOwnerTasks(host: AgentTaskHost): Promise<void> {\n\tconst errors: Error[] = [];\n\tconst cancel = async (tasks: TaskRecord[]): Promise<void> => {\n\t\t// Cancel every queued agent before an active cancellation can free a dispatch slot.\n\t\tconst ordered = tasks.sort(\n\t\t\t(a, b) => Number(b.execution.kind === \"queued\") - Number(a.execution.kind === \"queued\"),\n\t\t);\n\t\tconst results = await Promise.allSettled(ordered.map((task) => host.cancelTask(task.ref.taskId, \"user\")));\n\t\tfor (const result of results) {\n\t\t\tif (result.status === \"rejected\") errors.push(new Error(String(result.reason)));\n\t\t\telse if (!result.value.ok) errors.push(new Error(`${result.value.error.code}: ${result.value.error.message}`));\n\t\t}\n\t};\n\tconst watched = host.watchOwnerTasks();\n\tif (!watched.ok) throw new Error(`${watched.error.code}: ${watched.error.message}`);\n\tconst watch = watched.value;\n\ttry {\n\t\tawait cancel(watch.snapshot.tasks.filter((task) => task.kind === \"agent\" && task.execution.kind !== \"settled\"));\n\t\tconst { supervisor, owner } = host.ownerBinding;\n\t\t// Already-started native setup may briefly launch during the transition. Wait for\n\t\t// every admitted lease before cancelling shells and certifying the final snapshot.\n\t\tawait supervisor.drainCommandAdmissions(owner);\n\t\twatch.drain();\n\t\tawait cancel(watch.snapshot.tasks.filter((task) => task.kind === \"command\" && task.execution.kind !== \"settled\"));\n\t\tif (errors.length) throw new AggregateError(errors, \"Workflow stage task cancellation failed\");\n\t\tawait new Promise<void>((resolve, reject) => {\n\t\t\twatch.onReconcile = (snapshot: OwnerSnapshot) => {\n\t\t\t\tif (\n\t\t\t\t\tsnapshot.tasks.some(\n\t\t\t\t\t\t(task) =>\n\t\t\t\t\t\t\ttask.cleanup.kind === \"active\" ||\n\t\t\t\t\t\t\ttask.cleanup.kind === \"draining\" ||\n\t\t\t\t\t\t\t(task.execution.kind !== \"settled\" && task.cleanup.kind !== \"failed\"),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t\treturn;\n\t\t\t\tconst failures = snapshot.tasks.flatMap((task) =>\n\t\t\t\t\ttask.cleanup.kind === \"failed\" ? task.cleanup.resources : [],\n\t\t\t\t);\n\t\t\t\tif (failures.length)\n\t\t\t\t\treject(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t`Workflow stage task cleanup failed: ${failures.map((failure) => `${failure.resource}: ${failure.message}`).join(\"; \")}`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\telse resolve();\n\t\t\t};\n\t\t\twatch.drain();\n\t\t\twatch.onReconcile(watch.snapshot, []);\n\t\t});\n\t} finally {\n\t\twatch.dispose();\n\t}\n}\n"]}
|
|
@@ -69,10 +69,12 @@ export declare function taskTranscriptSource(task: TaskLease): C.Result<{
|
|
|
69
69
|
session: TaskTranscriptSource;
|
|
70
70
|
taskId: C.TaskId;
|
|
71
71
|
}, C.Failure<"UnknownTask" | "TranscriptUnavailable">>;
|
|
72
|
+
/** History the runner produced; a forked child's inherited parent entries are excluded. */
|
|
73
|
+
export declare function taskOwnTranscriptEntries(task: TaskLease): ReturnType<TaskTranscriptSource["getEntries"]> | undefined;
|
|
72
74
|
export declare class TaskSubscription {
|
|
73
75
|
#private;
|
|
74
|
-
/** Reconciliation supplements the RFC snapshot/cursor/iterable contract. */
|
|
75
|
-
onReconcile: (snapshot: C.OwnerSnapshot) => void;
|
|
76
|
+
/** Reconciliation supplements the RFC snapshot/cursor/iterable contract with the events it applied. */
|
|
77
|
+
onReconcile: (snapshot: C.OwnerSnapshot, events: readonly C.NativeEvent[]) => void;
|
|
76
78
|
readonly events: AsyncIterable<C.NativeEvent>;
|
|
77
79
|
readonly lease: SubscriptionLease;
|
|
78
80
|
constructor(actor: native.TaskSupervisor, initial: native.NativeTaskSubscription, onDispose: () => void);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../../../src/core/tasks/supervisor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAEzC,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,cAAc,EAAE,cAAc,GAAG,YAAY,CAAC,GAAG;IACxF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;IACjD,6EAA6E;IAC7E,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACrE,mBAAmB,CAAC,IAAI,YAAY,GAAG,SAAS,CAAC;CACjD,CAAC;AAEF,eAAO,MAAM,4BAA4B,QAAQ,CAAC;AAClD,qFAAqF;AACrF,cAAM,UAAU;;IAEf,MAAM,IAAI,KAAK,CAEd;CACD;AACD,cAAM,cAAe,SAAQ,UAAU;IACtC,QAAQ,CAAC,IAAI,UAAU;CACvB;AACD,cAAM,eAAgB,SAAQ,UAAU;IACvC,QAAQ,CAAC,IAAI,WAAW;CACxB;AACD,cAAM,cAAe,SAAQ,UAAU;IACtC,QAAQ,CAA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MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC,UAAU,CAAC,CAc5F;CA2CD"}
|
|
@@ -64,6 +64,11 @@ export function taskTranscriptSource(task) {
|
|
|
64
64
|
return { ok: false, error: { code: "TranscriptUnavailable", message: "Transcript unavailable" } };
|
|
65
65
|
return { ok: true, value: { session: state.transcript, taskId: state.ref.taskId } };
|
|
66
66
|
}
|
|
67
|
+
/** History the runner produced; a forked child's inherited parent entries are excluded. */
|
|
68
|
+
export function taskOwnTranscriptEntries(task) {
|
|
69
|
+
const state = environment.tasks.get(task);
|
|
70
|
+
return state?.transcript?.getEntries().slice(state.inheritedEntryCount ?? 0);
|
|
71
|
+
}
|
|
67
72
|
/** Promise rejections, setup throws and consumer exceptions may be arbitrary JavaScript values. */
|
|
68
73
|
function rejectionMessage(reason) {
|
|
69
74
|
try {
|
|
@@ -164,9 +169,13 @@ function observation(value) {
|
|
|
164
169
|
return { kind: value.kind, reason };
|
|
165
170
|
throw new Error("Invalid native host observation");
|
|
166
171
|
}
|
|
172
|
+
// Native records own lifecycle and mutable execution metadata. Routing provenance is
|
|
173
|
+
// immutable host metadata, retained for the same environment lifetime as task records.
|
|
174
|
+
const routerSelections = new Map();
|
|
167
175
|
function record(value) {
|
|
168
176
|
if (value.kind !== "agent" && value.kind !== "command")
|
|
169
177
|
throw new Error(`Invalid native task kind: ${value.kind}`);
|
|
178
|
+
const routerSelection = routerSelections.get(value.ref.taskId);
|
|
170
179
|
return {
|
|
171
180
|
ref: reference(value.ref),
|
|
172
181
|
launchOperationId: value.launchOperationId,
|
|
@@ -178,6 +187,7 @@ function record(value) {
|
|
|
178
187
|
...(value.agentName === undefined ? {} : { agentName: value.agentName }),
|
|
179
188
|
...(value.model === undefined ? {} : { model: value.model }),
|
|
180
189
|
...(value.thinking === undefined ? {} : { thinking: value.thinking }),
|
|
190
|
+
...(routerSelection ? { routerSelection } : {}),
|
|
181
191
|
execution: execution(value.execution),
|
|
182
192
|
observation: observation(value.observation),
|
|
183
193
|
...(value.wasBackground === undefined ? {} : { wasBackground: value.wasBackground }),
|
|
@@ -387,7 +397,7 @@ export class TaskSubscription {
|
|
|
387
397
|
this.#queue = [];
|
|
388
398
|
this.#epoch = 0;
|
|
389
399
|
this.#disposed = false;
|
|
390
|
-
/** Reconciliation supplements the RFC snapshot/cursor/iterable contract. */
|
|
400
|
+
/** Reconciliation supplements the RFC snapshot/cursor/iterable contract with the events it applied. */
|
|
391
401
|
this.onReconcile = () => { };
|
|
392
402
|
this.lease = new SubscriptionCapability();
|
|
393
403
|
Object.freeze(this.lease);
|
|
@@ -477,7 +487,7 @@ export class TaskSubscription {
|
|
|
477
487
|
}
|
|
478
488
|
if (drained.value.snapshot || events.length) {
|
|
479
489
|
try {
|
|
480
|
-
this.#resource.runInAsyncScope(this.onReconcile, undefined, this.#snapshot);
|
|
490
|
+
this.#resource.runInAsyncScope(this.onReconcile, undefined, this.#snapshot, events);
|
|
481
491
|
}
|
|
482
492
|
catch (error) {
|
|
483
493
|
this.#failure = new Error(rejectionMessage(error));
|
|
@@ -599,7 +609,7 @@ export class TaskSupervisor {
|
|
|
599
609
|
if (failure)
|
|
600
610
|
throw failure;
|
|
601
611
|
};
|
|
602
|
-
watched.value.onReconcile(watched.value.snapshot);
|
|
612
|
+
watched.value.onReconcile(watched.value.snapshot, []);
|
|
603
613
|
return owner;
|
|
604
614
|
}, ownerErrors);
|
|
605
615
|
}
|
|
@@ -694,6 +704,8 @@ export class TaskSupervisor {
|
|
|
694
704
|
const existing = state.tasks.get(id);
|
|
695
705
|
if (existing)
|
|
696
706
|
return { ok: true, value: existing };
|
|
707
|
+
if (intent.routerSelection)
|
|
708
|
+
routerSelections.set(id, Object.freeze({ ...intent.routerSelection }));
|
|
697
709
|
const task = new TaskCapability();
|
|
698
710
|
Object.freeze(task);
|
|
699
711
|
const taskState = {
|
|
@@ -716,6 +728,7 @@ export class TaskSupervisor {
|
|
|
716
728
|
ref: reference(taskState.ref),
|
|
717
729
|
signal: taskState.controller.signal,
|
|
718
730
|
bindTranscript: (session) => {
|
|
731
|
+
taskState.inheritedEntryCount ??= session.getEntries().length;
|
|
719
732
|
taskState.transcript = session;
|
|
720
733
|
},
|
|
721
734
|
reportActivity: (report) => mapped(this.#native.reportTaskActivity(runner.value, report), reportReceipt, reportErrors),
|