@prestyj/cli 5.28.0 → 5.29.0
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/README.md +2 -2
- package/assets/motion/THIRD-PARTY.md +14 -19
- package/assets/motion/bin/contact-sheet.mjs +9 -3
- package/assets/motion/bin/cues.mjs +337 -0
- package/assets/motion/bin/flash-check.mjs +314 -0
- package/assets/motion/bin/fonts.mjs +17 -13
- package/assets/motion/bin/library.mjs +61 -18
- package/assets/motion/bin/motion-blur.mjs +943 -0
- package/assets/motion/bin/motion-check.mjs +366 -9
- package/assets/motion/bin/music-fit.mjs +436 -0
- package/assets/motion/bin/pdf-extract.mjs +22 -10
- package/assets/motion/bin/reference-study.mjs +346 -0
- package/assets/motion/bin/score-synth.mjs +1052 -93
- package/assets/motion/fonts/finger-paint/OFL.txt +93 -0
- package/assets/motion/fonts/finger-paint/finger-paint-normal.woff2 +0 -0
- package/assets/motion/fonts/fonts.json +56 -0
- package/assets/motion/fonts/short-stack/OFL.txt +94 -0
- package/assets/motion/fonts/short-stack/short-stack-normal.woff2 +0 -0
- package/assets/motion/fonts/sora/OFL.txt +93 -0
- package/assets/motion/fonts/sora/sora-normal.woff2 +0 -0
- package/assets/motion/fonts/specimen.jpg +0 -0
- package/assets/motion/fonts/unbounded/OFL.txt +93 -0
- package/assets/motion/fonts/unbounded/unbounded-normal.woff2 +0 -0
- package/assets/motion/library/README.md +52 -14
- package/assets/motion/library/kit/moves.js +1981 -0
- package/assets/motion/library/library.json +232 -0
- package/assets/motion/library/pieces/camera-rig/meta.json +13 -0
- package/assets/motion/library/pieces/camera-rig/piece.html +153 -0
- package/assets/motion/library/pieces/camera-rig/preview.jpg +0 -0
- package/assets/motion/library/pieces/chain-knock/meta.json +13 -0
- package/assets/motion/library/pieces/chain-knock/piece.html +195 -0
- package/assets/motion/library/pieces/chain-knock/preview.jpg +0 -0
- package/assets/motion/library/pieces/gather-to-logo/meta.json +13 -0
- package/assets/motion/library/pieces/gather-to-logo/piece.html +159 -0
- package/assets/motion/library/pieces/gather-to-logo/preview.jpg +0 -0
- package/assets/motion/library/pieces/morph-carry/meta.json +13 -0
- package/assets/motion/library/pieces/morph-carry/piece.html +173 -0
- package/assets/motion/library/pieces/morph-carry/preview.jpg +0 -0
- package/assets/motion/library/pieces/one-shape-journey/meta.json +13 -0
- package/assets/motion/library/pieces/one-shape-journey/piece.html +195 -0
- package/assets/motion/library/pieces/one-shape-journey/preview.jpg +0 -0
- package/assets/motion/library/pieces/open-from-subject/meta.json +13 -0
- package/assets/motion/library/pieces/open-from-subject/piece.html +168 -0
- package/assets/motion/library/pieces/open-from-subject/preview.jpg +0 -0
- package/assets/motion/library/pieces/request-to-result/meta.json +13 -0
- package/assets/motion/library/pieces/request-to-result/piece.html +212 -0
- package/assets/motion/library/pieces/request-to-result/preview.jpg +0 -0
- package/assets/motion/library/pieces/scale-dive/meta.json +13 -0
- package/assets/motion/library/pieces/scale-dive/piece.html +321 -0
- package/assets/motion/library/pieces/scale-dive/preview.jpg +0 -0
- package/assets/motion/library/pieces/screen-replica-steps/meta.json +13 -0
- package/assets/motion/library/pieces/screen-replica-steps/piece.html +366 -0
- package/assets/motion/library/pieces/screen-replica-steps/preview.jpg +0 -0
- package/assets/motion/library/pieces/zoom-into-card/meta.json +13 -0
- package/assets/motion/library/pieces/zoom-into-card/piece.html +179 -0
- package/assets/motion/library/pieces/zoom-into-card/preview.jpg +0 -0
- package/assets/motion/library/sheets/diagram.jpg +0 -0
- package/assets/motion/library/sheets/frame.jpg +0 -0
- package/assets/motion/library/sheets/transition.jpg +0 -0
- package/assets/motion/library/sheets/ui.jpg +0 -0
- package/assets/motion/plugin.json +1 -1
- package/assets/motion/references/build-sheet.md +206 -0
- package/assets/motion/references/runtime/determinism-rules.md +3 -3
- package/assets/motion/references/runtime/gsap-easing-and-stagger.md +28 -28
- package/assets/motion/references/runtime/gsap.md +3 -3
- package/assets/motion/references/runtime/inputs-and-assets.md +21 -16
- package/assets/motion/references/runtime/lint-validate-inspect.md +3 -3
- package/assets/motion/references/runtime/minimal-composition.md +6 -0
- package/assets/motion/references/runtime/preview-render.md +3 -3
- package/assets/motion/skills/app-walkthrough/SKILL.md +66 -0
- package/assets/motion/skills/before-after/SKILL.md +53 -0
- package/assets/motion/skills/brand-kit/SKILL.md +17 -16
- package/assets/motion/skills/dev-tool-video/SKILL.md +57 -0
- package/assets/motion/skills/launch-video/SKILL.md +62 -0
- package/assets/motion/skills/match-reference/SKILL.md +58 -0
- package/assets/motion/skills/motion/SKILL.md +167 -98
- package/assets/motion/skills/source-ingest/SKILL.md +23 -15
- package/assets/motion/skills/website-video/SKILL.md +59 -0
- package/assets/skills/bulletproof/SKILL.md +36 -11
- package/assets/skills/bulletproof/references/agent-surface.md +19 -9
- package/assets/skills/bulletproof/references/audit-protocol.md +20 -5
- package/assets/skills/bulletproof/references/platform-playbooks.md +5 -4
- package/assets/skills/bulletproof/references/provenance.md +26 -1
- package/assets/skills/bulletproof/references/secure-defaults.md +6 -5
- package/assets/skills/bulletproof/references/supply-chain.md +21 -17
- package/assets/skills/bulletproof/references/threat-landscape.md +28 -26
- package/assets/skills/bulletproof/references/verification.md +2 -0
- package/assets/skills/clarify/SKILL.md +25 -16
- package/assets/skills/code-review/SKILL.md +71 -13
- package/assets/skills/code-review/references/agent-diffs.md +27 -0
- package/assets/skills/code-review/references/tests.md +19 -0
- package/assets/skills/compliance-guard/SKILL.md +20 -5
- package/assets/skills/compliance-guard/references/artifacts.md +1 -1
- package/assets/skills/compliance-guard/references/eu-uk.md +16 -16
- package/assets/skills/compliance-guard/references/lawsuit-vectors.md +5 -5
- package/assets/skills/compliance-guard/references/provenance.md +41 -2
- package/assets/skills/compliance-guard/references/sector-gates.md +3 -3
- package/assets/skills/compliance-guard/references/security-baseline.md +2 -2
- package/assets/skills/compliance-guard/references/trigger-map.md +5 -5
- package/assets/skills/compliance-guard/references/us.md +27 -21
- package/assets/skills/durable/SKILL.md +87 -79
- package/assets/skills/durable/references/agent-db-safety.md +69 -0
- package/assets/skills/durable/references/backups-and-runtime.md +19 -12
- package/assets/skills/durable/references/migrations-and-schema.md +13 -6
- package/assets/skills/evidence-led-ui/SKILL.md +69 -127
- package/assets/skills/evidence-led-ui/references/anti-defaults.md +107 -208
- package/assets/skills/evidence-led-ui/references/direction.md +124 -0
- package/assets/skills/evidence-led-ui/references/production-contract.md +8 -0
- package/assets/skills/evidence-led-ui/references/provenance.md +24 -1
- package/assets/skills/lean/SKILL.md +90 -71
- package/assets/skills/lean/references/memory-and-processes.md +3 -2
- package/assets/skills/lean/references/playbooks.md +37 -12
- package/assets/skills/refactoring/SKILL.md +24 -3
- package/assets/skills/refactoring/references/agent-pitfalls.md +4 -1
- package/assets/skills/refactoring/references/legacy.md +21 -0
- package/assets/skills/root-cause/SKILL.md +20 -10
- package/assets/skills/shared-language/SKILL.md +16 -14
- package/assets/skills/tdd/SKILL.md +27 -15
- package/dist/app-sidecar.js +203 -47
- package/dist/app-sidecar.js.map +1 -1
- package/dist/cli.js +20 -28
- package/dist/cli.js.map +1 -1
- package/dist/core/acceptance-checks.d.ts +48 -0
- package/dist/core/acceptance-checks.js +144 -0
- package/dist/core/acceptance-checks.js.map +1 -0
- package/dist/core/agent-session.d.ts +119 -75
- package/dist/core/agent-session.js +561 -395
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/agents.d.ts +6 -5
- package/dist/core/agents.js +12 -3
- package/dist/core/agents.js.map +1 -1
- package/dist/core/ask-user.d.ts +90 -8
- package/dist/core/ask-user.js +124 -13
- package/dist/core/ask-user.js.map +1 -1
- package/dist/core/auth-providers.js +1 -1
- package/dist/core/auth-providers.js.map +1 -1
- package/dist/core/autopilot-verdict.d.ts +5 -1
- package/dist/core/autopilot-verdict.js +30 -13
- package/dist/core/autopilot-verdict.js.map +1 -1
- package/dist/core/bundled-agents.js +1 -3
- package/dist/core/bundled-agents.js.map +1 -1
- package/dist/core/cache-diagnostics.d.ts +68 -0
- package/dist/core/cache-diagnostics.js +196 -0
- package/dist/core/cache-diagnostics.js.map +1 -0
- package/dist/core/cache-expiry.d.ts +87 -0
- package/dist/core/cache-expiry.js +111 -0
- package/dist/core/cache-expiry.js.map +1 -0
- package/dist/core/compaction/compactor.js +78 -48
- package/dist/core/compaction/compactor.js.map +1 -1
- package/dist/core/compaction/plan-step-policy.d.ts +46 -0
- package/dist/core/compaction/plan-step-policy.js +57 -0
- package/dist/core/compaction/plan-step-policy.js.map +1 -0
- package/dist/core/destructive-git-guard.d.ts +90 -0
- package/dist/core/destructive-git-guard.js +871 -0
- package/dist/core/destructive-git-guard.js.map +1 -0
- package/dist/core/event-bus.d.ts +3 -0
- package/dist/core/event-bus.js +5 -0
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/fast-apply-benchmark.d.ts +1 -1
- package/dist/core/fast-apply-benchmark.js +2 -2
- package/dist/core/fast-apply-benchmark.js.map +1 -1
- package/dist/core/injection-detect.d.ts +38 -0
- package/dist/core/injection-detect.js +232 -0
- package/dist/core/injection-detect.js.map +1 -0
- package/dist/core/keep-awake.d.ts +88 -0
- package/dist/core/keep-awake.js +251 -0
- package/dist/core/keep-awake.js.map +1 -0
- package/dist/core/mcp/client.d.ts +72 -0
- package/dist/core/mcp/client.js +264 -41
- package/dist/core/mcp/client.js.map +1 -1
- package/dist/core/mcp/content.js +6 -2
- package/dist/core/mcp/content.js.map +1 -1
- package/dist/core/mcp/store.d.ts +6 -1
- package/dist/core/mcp/store.js +12 -1
- package/dist/core/mcp/store.js.map +1 -1
- package/dist/core/mcp/types.d.ts +18 -0
- package/dist/core/model-unavailable.d.ts +14 -0
- package/dist/core/model-unavailable.js +23 -0
- package/dist/core/model-unavailable.js.map +1 -0
- package/dist/core/node-debugger.d.ts +148 -0
- package/dist/core/node-debugger.js +642 -0
- package/dist/core/node-debugger.js.map +1 -0
- package/dist/core/nolan-context.d.ts +7 -5
- package/dist/core/nolan-context.js +106 -16
- package/dist/core/nolan-context.js.map +1 -1
- package/dist/core/nolan-prompt.js +24 -21
- package/dist/core/nolan-prompt.js.map +1 -1
- package/dist/core/package-threats.d.ts +18 -0
- package/dist/core/package-threats.js +168 -0
- package/dist/core/package-threats.js.map +1 -0
- package/dist/core/persistent-shell.d.ts +58 -6
- package/dist/core/persistent-shell.js +331 -49
- package/dist/core/persistent-shell.js.map +1 -1
- package/dist/core/process-manager.d.ts +14 -0
- package/dist/core/process-manager.js +61 -0
- package/dist/core/process-manager.js.map +1 -1
- package/dist/core/progress/git-xp.js +8 -14
- package/dist/core/progress/git-xp.js.map +1 -1
- package/dist/core/project-discovery.js +77 -26
- package/dist/core/project-discovery.js.map +1 -1
- package/dist/core/semantic-search-benchmark.d.ts +1 -1
- package/dist/core/semantic-search-benchmark.js +2 -2
- package/dist/core/semantic-search-benchmark.js.map +1 -1
- package/dist/core/session-history.d.ts +12 -0
- package/dist/core/session-history.js +27 -0
- package/dist/core/session-history.js.map +1 -1
- package/dist/core/session-manager.d.ts +13 -1
- package/dist/core/session-manager.js +38 -18
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-summary-index.d.ts +37 -0
- package/dist/core/session-summary-index.js +172 -0
- package/dist/core/session-summary-index.js.map +1 -0
- package/dist/core/settings-manager.d.ts +2 -0
- package/dist/core/settings-manager.js +10 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/shell-threats-popular-packages.d.ts +11 -0
- package/dist/core/shell-threats-popular-packages.js +675 -0
- package/dist/core/shell-threats-popular-packages.js.map +1 -0
- package/dist/core/shell-threats.d.ts +8 -0
- package/dist/core/shell-threats.js +186 -0
- package/dist/core/shell-threats.js.map +1 -0
- package/dist/core/skills.js +16 -4
- package/dist/core/skills.js.map +1 -1
- package/dist/core/stream-rules.d.ts +30 -0
- package/dist/core/stream-rules.js +151 -0
- package/dist/core/stream-rules.js.map +1 -0
- package/dist/core/subagent-manager.d.ts +23 -6
- package/dist/core/subagent-manager.js +25 -9
- package/dist/core/subagent-manager.js.map +1 -1
- package/dist/core/subagent-policy.js +1 -1
- package/dist/core/subagent-policy.js.map +1 -1
- package/dist/core/subagent-receipt.d.ts +54 -0
- package/dist/core/subagent-receipt.js +276 -0
- package/dist/core/subagent-receipt.js.map +1 -0
- package/dist/core/subagent-turn-record.d.ts +2 -0
- package/dist/core/subagent-turn-record.js.map +1 -1
- package/dist/core/test-impact.d.ts +73 -0
- package/dist/core/test-impact.js +467 -0
- package/dist/core/test-impact.js.map +1 -0
- package/dist/core/thinking-level.d.ts +1 -1
- package/dist/core/thinking-level.js +1 -1
- package/dist/core/thinking-level.js.map +1 -1
- package/dist/core/verification-gate.d.ts +2 -0
- package/dist/core/verification-gate.js +4 -0
- package/dist/core/verification-gate.js.map +1 -1
- package/dist/core/verification-snapshot.js +3 -5
- package/dist/core/verification-snapshot.js.map +1 -1
- package/dist/core/workspace-guard.d.ts +18 -7
- package/dist/core/workspace-guard.js +227 -60
- package/dist/core/workspace-guard.js.map +1 -1
- package/dist/core/worktree-setup.d.ts +23 -0
- package/dist/core/worktree-setup.js +128 -9
- package/dist/core/worktree-setup.js.map +1 -1
- package/dist/core/worktree.d.ts +20 -2
- package/dist/core/worktree.js +74 -31
- package/dist/core/worktree.js.map +1 -1
- package/dist/interactive.js +2 -1
- package/dist/interactive.js.map +1 -1
- package/dist/modes/json-mode.js +11 -2
- package/dist/modes/json-mode.js.map +1 -1
- package/dist/modes/subagent-worker-mode.d.ts +36 -1
- package/dist/modes/subagent-worker-mode.js +100 -42
- package/dist/modes/subagent-worker-mode.js.map +1 -1
- package/dist/motion-agent/motion-agent.d.ts +7 -3
- package/dist/motion-agent/motion-agent.js +6 -8
- package/dist/motion-agent/motion-agent.js.map +1 -1
- package/dist/motion-agent/motion-prompt.d.ts +1 -1
- package/dist/motion-agent/motion-prompt.js +16 -25
- package/dist/motion-agent/motion-prompt.js.map +1 -1
- package/dist/motion-agent/motion-review-session.js +1 -1
- package/dist/motion-agent/motion-review-session.js.map +1 -1
- package/dist/motion-agent/motion-review.d.ts +10 -3
- package/dist/motion-agent/motion-review.js +15 -7
- package/dist/motion-agent/motion-review.js.map +1 -1
- package/dist/motion-agent/motion-studio-context.js +1 -1
- package/dist/motion-agent/motion-studio-context.js.map +1 -1
- package/dist/system-prompt.d.ts +2 -1
- package/dist/system-prompt.js +15 -4
- package/dist/system-prompt.js.map +1 -1
- package/dist/test-support/keep-alive.d.ts +14 -0
- package/dist/test-support/keep-alive.js +17 -0
- package/dist/test-support/keep-alive.js.map +1 -0
- package/dist/tools/ask-user.js +3 -3
- package/dist/tools/ask-user.js.map +1 -1
- package/dist/tools/bash-read-evidence.d.ts +10 -0
- package/dist/tools/bash-read-evidence.js +133 -0
- package/dist/tools/bash-read-evidence.js.map +1 -0
- package/dist/tools/bash.d.ts +10 -1
- package/dist/tools/bash.js +179 -7
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/debug.d.ts +54 -0
- package/dist/tools/debug.js +233 -0
- package/dist/tools/debug.js.map +1 -0
- package/dist/tools/edit.js +13 -5
- package/dist/tools/edit.js.map +1 -1
- package/dist/tools/goals.d.ts +1 -1
- package/dist/tools/index.d.ts +25 -2
- package/dist/tools/index.js +48 -7
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/prompt-hints.js +2 -0
- package/dist/tools/prompt-hints.js.map +1 -1
- package/dist/tools/read-tracker.d.ts +35 -2
- package/dist/tools/read-tracker.js +108 -11
- package/dist/tools/read-tracker.js.map +1 -1
- package/dist/tools/read.js +39 -7
- package/dist/tools/read.js.map +1 -1
- package/dist/tools/skill.js +5 -0
- package/dist/tools/skill.js.map +1 -1
- package/dist/tools/subagent-control.js +44 -8
- package/dist/tools/subagent-control.js.map +1 -1
- package/dist/tools/subagent-shared.d.ts +48 -8
- package/dist/tools/subagent-shared.js +75 -14
- package/dist/tools/subagent-shared.js.map +1 -1
- package/dist/tools/subagent.d.ts +8 -2
- package/dist/tools/subagent.js +28 -10
- package/dist/tools/subagent.js.map +1 -1
- package/dist/tools/task-output.js +3 -2
- package/dist/tools/task-output.js.map +1 -1
- package/dist/tools/task-send.d.ts +1 -1
- package/dist/tools/task-send.js +15 -1
- package/dist/tools/task-send.js.map +1 -1
- package/dist/tools/tool-tiers.d.ts +2 -2
- package/dist/tools/tool-tiers.js +3 -2
- package/dist/tools/tool-tiers.js.map +1 -1
- package/dist/tools/truncate.d.ts +21 -0
- package/dist/tools/truncate.js +187 -0
- package/dist/tools/truncate.js.map +1 -1
- package/dist/tools/ui-adopt.js +2 -0
- package/dist/tools/ui-adopt.js.map +1 -1
- package/dist/tools/write.js +4 -3
- package/dist/tools/write.js.map +1 -1
- package/dist/ui/App.d.ts +0 -4
- package/dist/ui/App.js +5 -28
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/components/ActivityIndicator.js +1 -0
- package/dist/ui/components/ActivityIndicator.js.map +1 -1
- package/dist/ui/components/Footer.js +1 -1
- package/dist/ui/components/Footer.js.map +1 -1
- package/dist/ui/hooks/useAgentLoop.d.ts +1 -8
- package/dist/ui/hooks/useAgentLoop.js +1 -119
- package/dist/ui/hooks/useAgentLoop.js.map +1 -1
- package/dist/ui/render.d.ts +2 -4
- package/dist/ui/render.js +3 -2
- package/dist/ui/render.js.map +1 -1
- package/dist/utils/git.d.ts +77 -0
- package/dist/utils/git.js +285 -21
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/github-ci.js +2 -1
- package/dist/utils/github-ci.js.map +1 -1
- package/dist/utils/github.js +11 -9
- package/dist/utils/github.js.map +1 -1
- package/dist/utils/image.d.ts +14 -0
- package/dist/utils/image.js +16 -0
- package/dist/utils/image.js.map +1 -1
- package/dist/utils/process.d.ts +20 -0
- package/dist/utils/process.js +98 -0
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/text.d.ts +12 -0
- package/dist/utils/text.js +11 -0
- package/dist/utils/text.js.map +1 -1
- package/package.json +6 -6
- package/assets/motion/skills/mixkit-split-text-617/SKILL.md +0 -115
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-480.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-494.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-5.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-508.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6525.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6539.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6647.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6663.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6677.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6691.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6706.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6722.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6736.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6750.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6764.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6780.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6794.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6810.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6823.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6872.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-6936.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/compositions/comp-76.json +0 -1
- package/assets/motion/skills/mixkit-split-text-617/data/manifest.json +0 -495
- package/assets/motion/skills/mixkit-split-text-617/references/RECONSTRUCTION.md +0 -201
- package/assets/motion/skills/mixkit-split-text-617/references/VERIFICATION.md +0 -107
- package/assets/motion/skills/mixkit-split-text-617/tools/inspect_motion.py +0 -130
- package/assets/motion/skills/video-qa/SKILL.md +0 -66
- package/dist/core/ideal-review-subagent.d.ts +0 -42
- package/dist/core/ideal-review-subagent.js +0 -95
- package/dist/core/ideal-review-subagent.js.map +0 -1
- package/dist/core/ideal-review.d.ts +0 -82
- package/dist/core/ideal-review.js +0 -242
- package/dist/core/ideal-review.js.map +0 -1
- package/dist/motion-agent/motion-check-tool.d.ts +0 -21
- package/dist/motion-agent/motion-check-tool.js +0 -206
- package/dist/motion-agent/motion-check-tool.js.map +0 -1
package/dist/core/agents.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { BUNDLED_AGENTS } from "./bundled-agents.js";
|
|
2
2
|
/**
|
|
3
|
-
* Which model a sub-agent runs on.
|
|
3
|
+
* Which model a sub-agent runs on. Every sub-agent runs at the LOWEST thinking
|
|
4
|
+
* level of that model (never off), whatever the parent uses.
|
|
4
5
|
*
|
|
5
|
-
* - `"inherit"` (default) — the parent's model, so a delegated task is
|
|
6
|
-
*
|
|
7
|
-
* - `"fast"` —
|
|
8
|
-
*
|
|
6
|
+
* - `"inherit"` (default) — the parent's model, so a delegated task is never
|
|
7
|
+
* moved to a weaker model.
|
|
8
|
+
* - `"fast"` — legacy alias of `"inherit"`, still accepted so older agent files
|
|
9
|
+
* load. It no longer swaps in a cheaper model.
|
|
9
10
|
* - any other string — an explicit model id.
|
|
10
11
|
*/
|
|
11
12
|
export type AgentModelPreference = "inherit" | "fast" | (string & {});
|
package/dist/core/agents.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { cleanInstructionText } from "../utils/text.js";
|
|
4
4
|
import { parseFrontmatter } from "./frontmatter.js";
|
|
5
5
|
import { log } from "./logger.js";
|
|
6
6
|
import { BUILTIN_TOOL_NAMES } from "../tools/prompt-hints.js";
|
|
@@ -123,12 +123,21 @@ async function loadAgentsFromDir(dir, source) {
|
|
|
123
123
|
* ```
|
|
124
124
|
*/
|
|
125
125
|
export function parseAgentFile(rawInput, source) {
|
|
126
|
-
// A BOM before `---` would otherwise silently kill frontmatter parsing
|
|
127
|
-
|
|
126
|
+
// A BOM before `---` would otherwise silently kill frontmatter parsing, and a
|
|
127
|
+
// project agent file can hide instructions in invisible text.
|
|
128
|
+
const cleaned = cleanInstructionText(rawInput);
|
|
129
|
+
const { fields, body: systemPrompt } = parseFrontmatter(cleaned.text);
|
|
128
130
|
// Unknown keys are ignored on purpose: agent files stay forward-compatible
|
|
129
131
|
// with fields a newer EZ Coder understands.
|
|
130
132
|
const name = fields.name ?? "";
|
|
131
133
|
const description = fields.description ?? "";
|
|
134
|
+
if (cleaned.stripped > 0) {
|
|
135
|
+
log("WARN", "agents", "Stripped invisible characters from an agent file", {
|
|
136
|
+
name,
|
|
137
|
+
source,
|
|
138
|
+
stripped: cleaned.stripped,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
132
141
|
const tools = (fields.tools ?? "")
|
|
133
142
|
.replace(/^\[|\]$/g, "")
|
|
134
143
|
.split(",")
|
package/dist/core/agents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/core/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/core/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAA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AQ,EAAE,kDAAkD,EAAE;YACxE,IAAI;YACJ,MAAM;YACN,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC3B,CAAC,CAAC;IACL,CAAC;IACD,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;SAC/B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;SACvB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;SAChD,MAAM,CAAC,OAAO,CAAC,CAAC;IACnB,MAAM,KAAK,GAAqC,MAAM,CAAC,KAAK,IAAI,SAAS,CAAC;IAC1E,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,EAAE,WAAW,EAAE,CAAC;IACxD,MAAM,OAAO,GACX,iBAAiB,KAAK,SAAS,IAAI,iBAAiB,KAAK,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC;IAElG,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;AAC5E,CAAC;AAED,8DAA8D;AAC9D,iFAAiF;AACjF,0GAA0G;AAC1G,8DAA8D;AAC9D,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/core/ask-user.d.ts
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import { type ParkedRequests } from "./parked-requests.js";
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Soft deadline for an `ask_user` call when someone is likely watching (a
|
|
3
|
+
* plain interactive run). Past it the tool stops blocking: the agent proceeds
|
|
4
|
+
* on its best guess while the question stays answerable in the app.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ASK_USER_INTERACTIVE_DEADLINE_MS: number;
|
|
7
|
+
/**
|
|
8
|
+
* Soft deadline when nobody is watching — autopilot (Nolan), task run-all
|
|
9
|
+
* sweeps and scheduled prompts. Short, so an unattended run does not stall.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ASK_USER_UNATTENDED_DEADLINE_MS: number;
|
|
12
|
+
/**
|
|
13
|
+
* The longest an `ask_user` call can block (the largest soft deadline). The
|
|
14
|
+
* tool's own execution timeout is derived from this.
|
|
6
15
|
*/
|
|
7
16
|
export declare const ASK_USER_TIMEOUT_MS: number;
|
|
17
|
+
/** Pick the soft deadline for a run, by whether a human is likely watching. */
|
|
18
|
+
export declare function askSoftDeadlineMs(unattended: boolean): number;
|
|
8
19
|
/** One selectable answer. `value` is what the agent gets back; `label` is UI. */
|
|
9
20
|
export interface AskOption {
|
|
10
21
|
label: string;
|
|
@@ -45,13 +56,62 @@ export type AskUserResult = {
|
|
|
45
56
|
| {
|
|
46
57
|
action: "cancel";
|
|
47
58
|
superseded?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The soft deadline passed with no answer. The question stays open; a later
|
|
62
|
+
* answer is delivered to the agent as a message (see `onLateAnswer`).
|
|
63
|
+
*/
|
|
64
|
+
| {
|
|
65
|
+
action: "deferred";
|
|
48
66
|
};
|
|
49
|
-
|
|
50
|
-
export
|
|
67
|
+
/** An answer that arrived after the tool call had already moved on. */
|
|
68
|
+
export interface LateAskAnswer {
|
|
69
|
+
prompt: AskUserPrompt;
|
|
70
|
+
answers: Record<string, string | string[]>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Questions parked on the user. A question is either *pending* (the tool call
|
|
74
|
+
* is blocked on it) or *deferred* (its soft deadline passed, the agent moved
|
|
75
|
+
* on, but the user can still answer it).
|
|
76
|
+
*/
|
|
77
|
+
export interface AskUserBridge {
|
|
78
|
+
/** Park a question: broadcasts it, resolves on answer, cancel or soft deadline. */
|
|
79
|
+
park: (request: AskUserRequest) => Promise<AskUserResult>;
|
|
80
|
+
/**
|
|
81
|
+
* Answer or dismiss an open question. A deferred question's answer goes to
|
|
82
|
+
* `onLateAnswer`. False when the id is not open (settled, superseded, closed).
|
|
83
|
+
*/
|
|
84
|
+
settle: (id: string, result: AskUserResult) => boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Release every pending question with `result` (default: cancel) and close
|
|
87
|
+
* every deferred one — for run abort, a superseding user message, teardown.
|
|
88
|
+
*/
|
|
89
|
+
cancelAll: (result?: AskUserResult) => void;
|
|
90
|
+
/** Close deferred questions without touching a pending one (session reset). */
|
|
91
|
+
closeDeferred: () => void;
|
|
92
|
+
/** Questions the turn is currently blocked on. */
|
|
93
|
+
readonly pendingCount: number;
|
|
94
|
+
/** Questions past their soft deadline that can still be answered. */
|
|
95
|
+
readonly deferredCount: number;
|
|
96
|
+
}
|
|
97
|
+
export interface AskUserBridgeOptions {
|
|
51
98
|
broadcast: (prompt: AskUserPrompt) => void;
|
|
99
|
+
/** Soft deadline in ms, read when each question is parked. */
|
|
100
|
+
timeoutMs?: number | (() => number);
|
|
101
|
+
/** The soft deadline passed: the agent proceeds, the question stays open. */
|
|
52
102
|
onTimeout?: (prompt: AskUserPrompt) => void;
|
|
53
|
-
|
|
54
|
-
|
|
103
|
+
/** A deferred question was answered. Called at most once per question. */
|
|
104
|
+
onLateAnswer?: (late: LateAskAnswer) => void;
|
|
105
|
+
/** Deferred questions closed without an answer (superseded, cancelled, reset). */
|
|
106
|
+
onClosed?: (ids: string[]) => void;
|
|
107
|
+
}
|
|
108
|
+
export declare function createAskUserBridge(opts: AskUserBridgeOptions): AskUserBridge;
|
|
109
|
+
/**
|
|
110
|
+
* What the model reads when the soft deadline passes. Short on purpose; the
|
|
111
|
+
* safety line is the part that matters — a guessed answer must never license
|
|
112
|
+
* an action the user cannot take back.
|
|
113
|
+
*/
|
|
114
|
+
export declare const ASK_DEFERRED_RESULT: string;
|
|
55
115
|
/**
|
|
56
116
|
* Render the user's answers as the tool result the model reads.
|
|
57
117
|
*
|
|
@@ -60,3 +120,25 @@ export declare function createAskUserBridge(opts: {
|
|
|
60
120
|
* rather than silently missing.
|
|
61
121
|
*/
|
|
62
122
|
export declare function formatAskResult(questions: AskQuestion[], result: AskUserResult): string;
|
|
123
|
+
/**
|
|
124
|
+
* Frame a late answer as a message to the agent. It names the question it
|
|
125
|
+
* answers, because by now the agent has moved on and may have asked others.
|
|
126
|
+
*/
|
|
127
|
+
export declare function formatLateAnswer(late: LateAskAnswer): string;
|
|
128
|
+
/** Where a late answer goes: the host's existing user-message queue. */
|
|
129
|
+
export interface LateAnswerSink {
|
|
130
|
+
/** Queue a user message; drained as mid-run steering by a live run. */
|
|
131
|
+
queueMessage: (text: string) => number;
|
|
132
|
+
/** True while a run (or a run-owning cycle) can still drain the queue. */
|
|
133
|
+
isBusy: () => boolean;
|
|
134
|
+
/** The queue changed (so clients can refresh their queued strip). */
|
|
135
|
+
onQueued?: () => void;
|
|
136
|
+
/** No run is live: start one from the queue (the host's stranded-queue drain). */
|
|
137
|
+
startIdleRun: () => void;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Deliver a late answer through the existing queue rather than a new channel:
|
|
141
|
+
* a live run drains it at its next steering boundary; an idle session runs it
|
|
142
|
+
* as the next user turn.
|
|
143
|
+
*/
|
|
144
|
+
export declare function deliverLateAnswer(late: LateAskAnswer, sink: LateAnswerSink): void;
|
package/dist/core/ask-user.js
CHANGED
|
@@ -1,19 +1,101 @@
|
|
|
1
|
-
import { createParkedRequests } from "./parked-requests.js";
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Soft deadline for an `ask_user` call when someone is likely watching (a
|
|
3
|
+
* plain interactive run). Past it the tool stops blocking: the agent proceeds
|
|
4
|
+
* on its best guess while the question stays answerable in the app.
|
|
6
5
|
*/
|
|
7
|
-
export const
|
|
6
|
+
export const ASK_USER_INTERACTIVE_DEADLINE_MS = 10 * 60_000;
|
|
7
|
+
/**
|
|
8
|
+
* Soft deadline when nobody is watching — autopilot (Nolan), task run-all
|
|
9
|
+
* sweeps and scheduled prompts. Short, so an unattended run does not stall.
|
|
10
|
+
*/
|
|
11
|
+
export const ASK_USER_UNATTENDED_DEADLINE_MS = 2 * 60_000;
|
|
12
|
+
/**
|
|
13
|
+
* The longest an `ask_user` call can block (the largest soft deadline). The
|
|
14
|
+
* tool's own execution timeout is derived from this.
|
|
15
|
+
*/
|
|
16
|
+
export const ASK_USER_TIMEOUT_MS = Math.max(ASK_USER_INTERACTIVE_DEADLINE_MS, ASK_USER_UNATTENDED_DEADLINE_MS);
|
|
17
|
+
/** Pick the soft deadline for a run, by whether a human is likely watching. */
|
|
18
|
+
export function askSoftDeadlineMs(unattended) {
|
|
19
|
+
return unattended ? ASK_USER_UNATTENDED_DEADLINE_MS : ASK_USER_INTERACTIVE_DEADLINE_MS;
|
|
20
|
+
}
|
|
8
21
|
export function createAskUserBridge(opts) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
const pending = new Map();
|
|
23
|
+
const deferred = new Map();
|
|
24
|
+
let seq = 0;
|
|
25
|
+
const deadline = () => {
|
|
26
|
+
const t = opts.timeoutMs;
|
|
27
|
+
if (typeof t === "function")
|
|
28
|
+
return t();
|
|
29
|
+
return t ?? ASK_USER_INTERACTIVE_DEADLINE_MS;
|
|
30
|
+
};
|
|
31
|
+
const release = (id, result) => {
|
|
32
|
+
const entry = pending.get(id);
|
|
33
|
+
if (!entry)
|
|
34
|
+
return false;
|
|
35
|
+
pending.delete(id);
|
|
36
|
+
clearTimeout(entry.timer);
|
|
37
|
+
entry.resolve(result);
|
|
38
|
+
return true;
|
|
39
|
+
};
|
|
40
|
+
const closeDeferred = () => {
|
|
41
|
+
if (deferred.size === 0)
|
|
42
|
+
return;
|
|
43
|
+
const ids = [...deferred.keys()];
|
|
44
|
+
deferred.clear();
|
|
45
|
+
opts.onClosed?.(ids);
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
park: (request) => new Promise((resolve) => {
|
|
49
|
+
// A newer question supersedes any older one still waiting past its
|
|
50
|
+
// deadline: the agent has moved on to a new decision point.
|
|
51
|
+
closeDeferred();
|
|
52
|
+
const prompt = { ...request, id: `ask-${++seq}` };
|
|
53
|
+
const timer = setTimeout(() => {
|
|
54
|
+
if (!pending.has(prompt.id))
|
|
55
|
+
return;
|
|
56
|
+
deferred.set(prompt.id, prompt);
|
|
57
|
+
opts.onTimeout?.(prompt);
|
|
58
|
+
release(prompt.id, { action: "deferred" });
|
|
59
|
+
}, deadline());
|
|
60
|
+
timer.unref?.();
|
|
61
|
+
pending.set(prompt.id, { resolve, timer });
|
|
62
|
+
opts.broadcast(prompt);
|
|
63
|
+
}),
|
|
64
|
+
settle: (id, result) => {
|
|
65
|
+
if (release(id, result))
|
|
66
|
+
return true;
|
|
67
|
+
const prompt = deferred.get(id);
|
|
68
|
+
if (!prompt)
|
|
69
|
+
return false;
|
|
70
|
+
deferred.delete(id);
|
|
71
|
+
if (result.action === "answer")
|
|
72
|
+
opts.onLateAnswer?.({ prompt, answers: result.answers });
|
|
73
|
+
return true;
|
|
74
|
+
},
|
|
75
|
+
cancelAll: (result) => {
|
|
76
|
+
for (const id of [...pending.keys()])
|
|
77
|
+
release(id, result ?? { action: "cancel" });
|
|
78
|
+
closeDeferred();
|
|
79
|
+
},
|
|
80
|
+
closeDeferred,
|
|
81
|
+
get pendingCount() {
|
|
82
|
+
return pending.size;
|
|
83
|
+
},
|
|
84
|
+
get deferredCount() {
|
|
85
|
+
return deferred.size;
|
|
86
|
+
},
|
|
87
|
+
};
|
|
16
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* What the model reads when the soft deadline passes. Short on purpose; the
|
|
91
|
+
* safety line is the part that matters — a guessed answer must never license
|
|
92
|
+
* an action the user cannot take back.
|
|
93
|
+
*/
|
|
94
|
+
export const ASK_DEFERRED_RESULT = "No answer yet — the user has not responded. Do not wait and do not ask again: proceed " +
|
|
95
|
+
"on your best judgment and state the assumption you made. The question stays open; a " +
|
|
96
|
+
'later reply arrives as a message starting "Late answer to:". On a guessed answer do only ' +
|
|
97
|
+
"safe, reversible work. Do NOT delete data, push, publish, deploy, pay, send messages or " +
|
|
98
|
+
"take any other destructive, costly or externally visible action — leave those for the user.";
|
|
17
99
|
/**
|
|
18
100
|
* Render the user's answers as the tool result the model reads.
|
|
19
101
|
*
|
|
@@ -22,12 +104,14 @@ export function createAskUserBridge(opts) {
|
|
|
22
104
|
* rather than silently missing.
|
|
23
105
|
*/
|
|
24
106
|
export function formatAskResult(questions, result) {
|
|
107
|
+
if (result.action === "deferred")
|
|
108
|
+
return ASK_DEFERRED_RESULT;
|
|
25
109
|
if (result.action === "cancel") {
|
|
26
110
|
if (result.superseded) {
|
|
27
111
|
return ("The user ignored the question and sent their own message instead. " +
|
|
28
112
|
"It arrives next — treat it as their answer and continue. Do not ask this again.");
|
|
29
113
|
}
|
|
30
|
-
return ("The user did not answer (dismissed
|
|
114
|
+
return ("The user did not answer (they dismissed the question). Do not ask again — " +
|
|
31
115
|
"state the assumption you are proceeding with, or stop and wait for them.");
|
|
32
116
|
}
|
|
33
117
|
const lines = questions.map((q) => {
|
|
@@ -37,4 +121,31 @@ export function formatAskResult(questions, result) {
|
|
|
37
121
|
});
|
|
38
122
|
return `The user answered:\n\n${lines.join("\n\n")}`;
|
|
39
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Frame a late answer as a message to the agent. It names the question it
|
|
126
|
+
* answers, because by now the agent has moved on and may have asked others.
|
|
127
|
+
*/
|
|
128
|
+
export function formatLateAnswer(late) {
|
|
129
|
+
const body = late.prompt.questions
|
|
130
|
+
.map((q) => {
|
|
131
|
+
const answer = late.answers[q.id];
|
|
132
|
+
const text = Array.isArray(answer) ? answer.join(", ") : answer;
|
|
133
|
+
return `Late answer to: ${q.question}\n→ ${text?.trim() ? text.trim() : "(no answer)"}`;
|
|
134
|
+
})
|
|
135
|
+
.join("\n\n");
|
|
136
|
+
return (`${body}\n\n` +
|
|
137
|
+
"(You asked this earlier and continued on an assumption. If this answer differs, " +
|
|
138
|
+
"adjust the affected work; if it matches, carry on.)");
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Deliver a late answer through the existing queue rather than a new channel:
|
|
142
|
+
* a live run drains it at its next steering boundary; an idle session runs it
|
|
143
|
+
* as the next user turn.
|
|
144
|
+
*/
|
|
145
|
+
export function deliverLateAnswer(late, sink) {
|
|
146
|
+
sink.queueMessage(formatLateAnswer(late));
|
|
147
|
+
sink.onQueued?.();
|
|
148
|
+
if (!sink.isBusy())
|
|
149
|
+
sink.startIdleRun();
|
|
150
|
+
}
|
|
40
151
|
//# sourceMappingURL=ask-user.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user.js","sourceRoot":"","sources":["../../src/core/ask-user.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"ask-user.js","sourceRoot":"","sources":["../../src/core/ask-user.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,GAAG,MAAM,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,GAAG,MAAM,CAAC;AAE1D;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,GAAG,CACzC,gCAAgC,EAChC,+BAA+B,CAChC,CAAC;AAEF,+EAA+E;AAC/E,MAAM,UAAU,iBAAiB,CAAC,UAAmB;IACnD,OAAO,UAAU,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,gCAAgC,CAAC;AACzF,CAAC;AA6FD,MAAM,UAAU,mBAAmB,CAAC,IAA0B;IAC5D,MAAM,OAAO,GAAG,IAAI,GAAG,EAGpB,CAAC;IACJ,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAyB,CAAC;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,WAAW,EAAE,mDAAmD;QAChE,OAAO,EAAE,CAAC,OAAO,CAAC;KACnB;IACD;QACE,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"auth-providers.js","sourceRoot":"","sources":["../../src/core/auth-providers.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,gFAAgF;AAChF,6EAA6E;AAC7E,0EAA0E;AAE1E,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AA+DrE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAuB;IAChD;QACE,KAAK,EAAE,WAAW;QAClB,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,mDAAmD;QAChE,OAAO,EAAE,CAAC,OAAO,CAAC;KACnB;IACD;QACE,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,sCAAsC;QACnD,OAAO,EAAE,CAAC,OAAO,CAAC;KACnB;IACD;QACE,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,QAAQ;QACf,WAAW,EACT,2FAA2F;QAC7F,OAAO,EAAE,CAAC,OAAO,CAAC;KACnB;IACD;QACE,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,6BAA6B;QAC1C,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;QAC5B,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE;YACb,KAAK,EAAE;gBACL,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,mBAAmB;gBAC1B,OAAO,EAAE,uCAAuC;gBAChD,IAAI,EAAE,EAAE;aACT;YACD,MAAM,EAAE;gBACN,MAAM,EAAE,QAAQ;gBAChB,KAAK,EAAE,aAAa;gBACpB,OAAO,EAAE,wCAAwC;gBACjD,IAAI,EAAE,EAAE;aACT;SACF;KACF;IACD;QACE,KAAK,EAAE,UAAU;QACjB,KAAK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AAW,IAAI,IAAI,CAAC,KAAK,UAAU;gBAClD,OAAO,EAAE,+CAA+C;gBACxD,IAAI,EAAE,EAAE;aACT,CAAC;IACR,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,MAAM,IAAI,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACxC,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,OAAO,QAAQ,IAAI,CAAC,UAAU,eAAe,IAAI,CAAC,WAAW,mDAAmD,CAAC;AACnH,CAAC"}
|
|
@@ -6,10 +6,14 @@
|
|
|
6
6
|
* first non-empty line carries the keyword; anything after is the payload.
|
|
7
7
|
*
|
|
8
8
|
* PROMPT
|
|
9
|
-
* <runnable EZ Coder prompt body,
|
|
9
|
+
* <runnable EZ Coder prompt body: a few lines, or a short bullet list>
|
|
10
10
|
*
|
|
11
11
|
* ALL_CLEAR
|
|
12
12
|
*
|
|
13
|
+
* ALL_CLEAR CORPUS_UNVERIFIED
|
|
14
|
+
* (approval whose real-world cross-check was impossible; the flag rides on
|
|
15
|
+
* the verdict line so it can't be lost the way a separate JSON reply was)
|
|
16
|
+
*
|
|
13
17
|
* IGNORE
|
|
14
18
|
*
|
|
15
19
|
* HUMAN
|
|
@@ -6,10 +6,14 @@
|
|
|
6
6
|
* first non-empty line carries the keyword; anything after is the payload.
|
|
7
7
|
*
|
|
8
8
|
* PROMPT
|
|
9
|
-
* <runnable EZ Coder prompt body,
|
|
9
|
+
* <runnable EZ Coder prompt body: a few lines, or a short bullet list>
|
|
10
10
|
*
|
|
11
11
|
* ALL_CLEAR
|
|
12
12
|
*
|
|
13
|
+
* ALL_CLEAR CORPUS_UNVERIFIED
|
|
14
|
+
* (approval whose real-world cross-check was impossible; the flag rides on
|
|
15
|
+
* the verdict line so it can't be lost the way a separate JSON reply was)
|
|
16
|
+
*
|
|
13
17
|
* IGNORE
|
|
14
18
|
*
|
|
15
19
|
* HUMAN
|
|
@@ -64,24 +68,37 @@ function normalizeKeywordLine(line) {
|
|
|
64
68
|
.trim()
|
|
65
69
|
.replace(/\s+/g, "_");
|
|
66
70
|
}
|
|
71
|
+
/** The flagged approval, e.g. `ALL_CLEAR CORPUS_UNVERIFIED` or
|
|
72
|
+
* `all clear: corpus_unverified`, after {@link normalizeKeywordLine}. */
|
|
73
|
+
const FLAGGED_ALL_CLEAR_RE = /^ALL_CLEAR[_:,-]*CORPUS_UNVERIFIED$/;
|
|
74
|
+
/** The flag anywhere in an approval reply: on the verdict line, or drifted
|
|
75
|
+
* below it (the benchmarked failure). Keeping a warning is always safe. */
|
|
76
|
+
const CORPUS_FLAG_RE = /corpus_unverified/i;
|
|
77
|
+
function allClear(flagged) {
|
|
78
|
+
return flagged
|
|
79
|
+
? { kind: "all_clear", evidenceLimitation: "corpus_unverified" }
|
|
80
|
+
: { kind: "all_clear" };
|
|
81
|
+
}
|
|
67
82
|
/**
|
|
68
83
|
* Fallback for when Nolan ignores the "keyword-first, nothing before it"
|
|
69
84
|
* instruction and buries a bare ALL_CLEAR/IGNORE/SKIP line after a recap or
|
|
70
85
|
* explanation (a real drift pattern models fall into despite the system
|
|
71
|
-
* prompt). Only matches a line that is EXACTLY one of these bare keywords
|
|
72
|
-
* PROMPT/HUMAN carry payloads and get their own
|
|
73
|
-
* parseAutopilotVerdict. Returns the LAST such
|
|
74
|
-
* conventionally lands at the end of the drift), or null if
|
|
75
|
-
*
|
|
86
|
+
* prompt). Only matches a line that is EXACTLY one of these bare keywords (or
|
|
87
|
+
* the flagged approval). PROMPT/HUMAN carry payloads and get their own
|
|
88
|
+
* dedicated recovery passes in parseAutopilotVerdict. Returns the LAST such
|
|
89
|
+
* line (the verdict conventionally lands at the end of the drift), or null if
|
|
90
|
+
* none is present.
|
|
76
91
|
*/
|
|
77
92
|
function findTrailingBareVerdict(lines) {
|
|
78
93
|
let found = null;
|
|
79
94
|
for (const line of lines) {
|
|
80
95
|
const normalized = normalizeKeywordLine(line);
|
|
81
96
|
if (normalized === "ALL_CLEAR")
|
|
82
|
-
found =
|
|
97
|
+
found = allClear(false);
|
|
98
|
+
else if (FLAGGED_ALL_CLEAR_RE.test(normalized))
|
|
99
|
+
found = allClear(true);
|
|
83
100
|
else if (normalized === "IGNORE" || normalized === "SKIP")
|
|
84
|
-
found = "ignore";
|
|
101
|
+
found = { kind: "ignore" };
|
|
85
102
|
}
|
|
86
103
|
return found;
|
|
87
104
|
}
|
|
@@ -136,7 +153,9 @@ export function parseAutopilotVerdict(reply) {
|
|
|
136
153
|
.join("\n")
|
|
137
154
|
.trim();
|
|
138
155
|
if (collapsed === "ALL_CLEAR" || collapsed.startsWith("ALL_CLEAR")) {
|
|
139
|
-
|
|
156
|
+
// Lines before the keyword line are blank, so `raw` is the keyword line plus
|
|
157
|
+
// the rest: catches the flag on the verdict line and any later drift.
|
|
158
|
+
return allClear(CORPUS_FLAG_RE.test(raw));
|
|
140
159
|
}
|
|
141
160
|
// IGNORE / SKIP: the turn wasn't real work — nothing to say, nothing to show.
|
|
142
161
|
if (collapsed === "IGNORE" ||
|
|
@@ -171,10 +190,8 @@ export function parseAutopilotVerdict(reply) {
|
|
|
171
190
|
// shape that used to leak raw commentary + "ALL_CLEAR" into a HUMAN bubble
|
|
172
191
|
// instead of rendering the normal all-clear/ignore marker.
|
|
173
192
|
const trailing = findTrailingBareVerdict(lines);
|
|
174
|
-
if (trailing
|
|
175
|
-
return
|
|
176
|
-
if (trailing === "ignore")
|
|
177
|
-
return { kind: "ignore" };
|
|
193
|
+
if (trailing)
|
|
194
|
+
return trailing;
|
|
178
195
|
// A buried bare HUMAN line (Nolan wrote his reasoning first, THEN the verdict).
|
|
179
196
|
// Take the lines after the LAST exact-"HUMAN" line as the reason and drop the
|
|
180
197
|
// leading prose. Safe to recover unlike a buried PROMPT: HUMAN stops the cycle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autopilot-verdict.js","sourceRoot":"","sources":["../../src/core/autopilot-verdict.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"autopilot-verdict.js","sourceRoot":"","sources":["../../src/core/autopilot-verdict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAQH;iFACiF;AACjF,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,MAAM,CAAC,MAAM,wBAAwB,GAAG,uDAAuD,CAAC;AAEhG,MAAM,oBAAoB,GAAG,oDAAoD,CAAC;AAElF;4CAC4C;AAC5C,SAAS,gBAAgB,CAAC,IAAY;IACpC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,MAAM,SAAS,GAAG,eAAe,CAAC;IAClC,MAAM,UAAU,GAAG,SAAS,CAAC;IAC7B,IAAI,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACxD,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACvE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,wDAAwD;AACxD,SAAS,GAAG,CAAC,IAAY,EAAE,GAAG,GAAG,cAAc;IAC7C,IAAI,IAAI,CAAC,MAAM,IAAI,GAAG;QAAE,OAAO,IAAI,CAAC;IACpC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,GAAG,GAAG,cAAc,CAAC;AACpE,CAAC;AAED;iEACiE;AACjE,SAAS,oBAAoB,CAAC,IAAY;IACxC,OAAO,IAAI;SACR,IAAI,EAAE;SACN,WAAW,EAAE;SACb,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;SACxB,IAAI,EAAE;SACN,OAAO,CAAC,MAAM,EA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C5E,2EAA2E;IAC3E,2EAA2E;IAC3E,wEAAwE;IACxE,0EAA0E;IAC1E,2EAA2E;IAC3E,iDAAiD;IACjD,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;IAChD,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;YAC3C,OAAO,qBAAqB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IAED,kFAAkF;IAClF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -201,9 +201,7 @@ export const BUNDLED_AGENTS = [
|
|
|
201
201
|
name: "owl",
|
|
202
202
|
description: 'Use for read-only questions about THIS repository: "where is X implemented", "what calls Y", "how does module Z fit together", tracing a data flow or mapping a directory. Never edits and never uses the web.',
|
|
203
203
|
tools: ["read", "grep", "find", "ls", "code_search", "source_path"],
|
|
204
|
-
|
|
205
|
-
// well and keeps wide fan-out affordable.
|
|
206
|
-
model: "fast",
|
|
204
|
+
model: "inherit",
|
|
207
205
|
// Conventions and style rules don't change where a symbol is defined, and
|
|
208
206
|
// skipping them keeps recon fast (matching Claude Code's Explore agent).
|
|
209
207
|
context: "none",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundled-agents.js","sourceRoot":"","sources":["../../src/core/bundled-agents.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;8DAgB2C,CAAC;AAE/D,MAAM,UAAU,GAAG;;;;;;;;;;;;;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E,SAAS;QACf,WAAW,EACT,qMAAqM;QACvM,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC;QACvF,KAAK,EAAE,SAAS;QAChB,YAAY,EAAE,cAAc;QAC5B,MAAM,EAAE,SAAS;KAClB;IACD;QACE,IAAI,EAAE,SAAS;QACf,WAAW,EACT,kNAAkN;QACpN,KAAK,EAAE;YACL,MAAM;YACN,MAAM;YACN,MAAM;YACN,IAAI;YACJ,aAAa;YACb,MAAM;YACN,WAAW;YACX,YAAY;YACZ,UAAU;SACX;QACD,KAAK,EAAE,SAAS;QAChB,YAAY,EAAE,cAAc;QAC5B,MAAM,EAAE,SAAS;KAClB;CACF,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { CacheRetention, PreparedContext, Usage } from "@prestyj/ai";
|
|
2
|
+
import { type CacheTouch } from "./cache-expiry.js";
|
|
3
|
+
export interface CacheRequestObservation {
|
|
4
|
+
provider: string;
|
|
5
|
+
model: string;
|
|
6
|
+
at: number;
|
|
7
|
+
cacheRetention: CacheRetention;
|
|
8
|
+
/** Request-shaping settings only; digested in memory, never logged. */
|
|
9
|
+
settings: unknown;
|
|
10
|
+
/** Route/account identity, digested in memory. Never pass credentials. */
|
|
11
|
+
route: unknown;
|
|
12
|
+
}
|
|
13
|
+
type HistoryEdit = "tool_prune" | "compaction";
|
|
14
|
+
export interface CacheContextReport {
|
|
15
|
+
stage: "prepared_context";
|
|
16
|
+
request: number;
|
|
17
|
+
changes: string[];
|
|
18
|
+
messageCount: number;
|
|
19
|
+
previousMessageCount: number;
|
|
20
|
+
/** Logical-message prefix, NOT a provider token offset or exact HTTP-body comparison. */
|
|
21
|
+
unchangedMessages: number;
|
|
22
|
+
imagesBefore: number;
|
|
23
|
+
imagesAfter: number;
|
|
24
|
+
imagesDropped: number;
|
|
25
|
+
pruneFreedTokensEstimate: number;
|
|
26
|
+
sincePreviousRequestMs: number | null;
|
|
27
|
+
requestedTtlExceeded: boolean;
|
|
28
|
+
/** Possible signed-thinking prefix mismatch; not a server-confirmed rejection. */
|
|
29
|
+
thinkingPrefixRiskBlocks: number;
|
|
30
|
+
/** Existing Anthropic encoding removes these signed blocks from settled turns. */
|
|
31
|
+
settledThinkingBlocks: number;
|
|
32
|
+
fingerprintMs: number;
|
|
33
|
+
}
|
|
34
|
+
export interface CacheUsageReport extends CacheContextReport {
|
|
35
|
+
promptTokens: number;
|
|
36
|
+
cacheRead: number;
|
|
37
|
+
cacheWrite: number;
|
|
38
|
+
comparison: "first_request" | "compaction" | "route_changed" | "cache_unreported" | "comparable";
|
|
39
|
+
/** Upper-bound proxy for repeated input not read from cache, not proven avoidable waste. */
|
|
40
|
+
reprocessedPromptTokensEstimate: number | null;
|
|
41
|
+
costStatus: "unavailable";
|
|
42
|
+
ttftMs: number | null;
|
|
43
|
+
providerDurationMs: number;
|
|
44
|
+
}
|
|
45
|
+
/** One per session. Retains only one completed snapshot and one in-flight snapshot, no payloads.
|
|
46
|
+
* Failed/retried attempts never replace the last successful usage baseline. */
|
|
47
|
+
export declare class CacheDiagnostics {
|
|
48
|
+
private completed;
|
|
49
|
+
private pending;
|
|
50
|
+
private edits;
|
|
51
|
+
private freedTokens;
|
|
52
|
+
private requests;
|
|
53
|
+
private reportedCache;
|
|
54
|
+
private lastTouch;
|
|
55
|
+
/** Last successful cache-using request (real turn or prewarm), or null. */
|
|
56
|
+
lastCacheTouch(): CacheTouch | null;
|
|
57
|
+
/** Record a successful cache-using request that bypassed prepare/complete (prewarm). */
|
|
58
|
+
noteCacheTouch(touch: CacheTouch): void;
|
|
59
|
+
reset(): void;
|
|
60
|
+
discardAttempt(): void;
|
|
61
|
+
noteEdit(edit: HistoryEdit, freedTokens?: number): void;
|
|
62
|
+
prepare(context: PreparedContext, input: CacheRequestObservation): CacheContextReport;
|
|
63
|
+
complete(usage: Usage, timing: {
|
|
64
|
+
ttftMs?: number;
|
|
65
|
+
providerDurationMs: number;
|
|
66
|
+
}): CacheUsageReport | undefined;
|
|
67
|
+
}
|
|
68
|
+
export {};
|