@iowarp/clio-coder 0.3.3 → 0.3.6
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 +74 -0
- package/CONTRIBUTING.md +7 -7
- package/README.md +3 -3
- package/dist/{acp-P2AQILE2.js → acp-2BEHC4DL.js} +9 -8
- package/dist/{agents-72W3BI7I.js → agents-LNNFTM53.js} +29 -24
- package/dist/assets/codewiki.json +1 -1
- package/dist/{auth-5TWEIYDN.js → auth-KXXFI2VS.js} +14 -10
- package/dist/{chunk-GGXXDWE4.js → chunk-22NAGB7X.js} +2 -2
- package/dist/{chunk-YCWGATWI.js → chunk-24I7BN55.js} +2 -2
- package/dist/{chunk-EKMEHE4H.js → chunk-33YXPOE3.js} +2 -3
- package/dist/chunk-3BPUFZDL.js +37 -0
- package/dist/chunk-43AOLP7E.js +375 -0
- package/dist/{chunk-ZDOOVTXZ.js → chunk-4OC57DA6.js} +27 -4
- package/dist/{chunk-6SGHMWE3.js → chunk-5JGRAMKL.js} +5 -5
- package/dist/{chunk-V6RTAOC2.js → chunk-6US73PDB.js} +572 -51
- package/dist/{chunk-5UFT4SUX.js → chunk-6XXKFVSN.js} +3 -3
- package/dist/{chunk-A3CYT5EX.js → chunk-AD2SYQYC.js} +55 -2
- package/dist/chunk-AOCYTWAV.js +449 -0
- package/dist/chunk-CFGTUFWB.js +67 -0
- package/dist/chunk-CJUB2JJ2.js +1478 -0
- package/dist/{chunk-FNTMWMX5.js → chunk-CKXWIANG.js} +14 -12
- package/dist/{chunk-PIWWS5BL.js → chunk-CYQKWTG3.js} +63 -78
- package/dist/{chunk-LZSJBIVT.js → chunk-DJVECN66.js} +271 -762
- package/dist/{chunk-CBCAPZAA.js → chunk-E25LMLRW.js} +2 -2
- package/dist/{chunk-ZWMF7253.js → chunk-E2ER4LJF.js} +304 -9
- package/dist/{chunk-STBPMHSX.js → chunk-EKY57CSP.js} +51 -84
- package/dist/{chunk-DUYJ5IO6.js → chunk-EYPA3EGJ.js} +12 -4
- package/dist/{chunk-M6SHUN7Q.js → chunk-FO5ZOVUY.js} +2 -2
- package/dist/chunk-FYYLNIL5.js +313 -0
- package/dist/{chunk-OQ33BKR3.js → chunk-G7MUEIGA.js} +3 -60
- package/dist/chunk-GEYXPTRF.js +613 -0
- package/dist/chunk-GOXNB3AO.js +261 -0
- package/dist/{chunk-G4BMMOKF.js → chunk-HVDIIIQW.js} +2 -2
- package/dist/chunk-HWUFFB6L.js +83 -0
- package/dist/{chunk-4XUGQOHA.js → chunk-K7T3E2SR.js} +15 -8
- package/dist/chunk-K7VKOLQQ.js +15 -0
- package/dist/{chunk-UFIIWP2H.js → chunk-KHSFENX2.js} +8 -8
- package/dist/{chunk-BMEMKKIT.js → chunk-KOHPCX4K.js} +2 -2
- package/dist/chunk-LCGCVYZ4.js +57 -0
- package/dist/chunk-LL4KHSZI.js +22 -0
- package/dist/{chunk-PAJK6MAQ.js → chunk-LYF7OHWH.js} +42 -15
- package/dist/{chunk-POHLU5DW.js → chunk-M6L6IDJG.js} +3 -3
- package/dist/{chunk-5UUP6MWO.js → chunk-MV3K5QF2.js} +5 -436
- package/dist/{chunk-X4RCMKVQ.js → chunk-NDINPTJ4.js} +2 -2
- package/dist/{chunk-TZK7PACC.js → chunk-NILBFAPG.js} +14 -8
- package/dist/chunk-ODFEOB4F.js +1082 -0
- package/dist/{chunk-AGYYIBLL.js → chunk-OH3TOQTB.js} +6 -2
- package/dist/chunk-OZNBF4L3.js +23 -0
- package/dist/{chunk-DSELYM6W.js → chunk-PBTHKCPN.js} +30 -10
- package/dist/{verify-375KUB3Y.js → chunk-PCZJO5TI.js} +127 -42
- package/dist/{chunk-ED4KHGC3.js → chunk-PPAMZ32Z.js} +9 -2
- package/dist/{chunk-SRDMMSEP.js → chunk-QM3F2GKX.js} +1063 -1645
- package/dist/{chunk-X6IAEBZR.js → chunk-QNQHSOLF.js} +7 -7
- package/dist/{chunk-OC7FIQPC.js → chunk-R46L2BIR.js} +10 -7
- package/dist/{chunk-2TLUCQVG.js → chunk-RD5U66HV.js} +3 -3
- package/dist/{chunk-6N5PTWMY.js → chunk-RY3LY4J5.js} +50 -13
- package/dist/{chunk-OKGUZO2U.js → chunk-SPULKLCF.js} +4 -3
- package/dist/{chunk-OOJYHWRB.js → chunk-TSHXZTOQ.js} +6 -5
- package/dist/chunk-TZSKNMZG.js +434 -0
- package/dist/{chunk-7MNJORFF.js → chunk-UL3WSD3F.js} +6 -1
- package/dist/{chunk-VJWL6YS5.js → chunk-UUVG37B4.js} +2 -2
- package/dist/{chunk-COU2UHX6.js → chunk-VEZEGCGW.js} +170 -2
- package/dist/chunk-W6GROXXM.js +69 -0
- package/dist/{chunk-OAO4GE4M.js → chunk-WHGPSPT5.js} +2 -2
- package/dist/chunk-WHJYKASB.js +677 -0
- package/dist/{chunk-ORBHGJC5.js → chunk-WR67VIZY.js} +3 -3
- package/dist/{chunk-YHZX5GEU.js → chunk-XAKHZX5N.js} +2 -2
- package/dist/{chunk-TZTZS7QK.js → chunk-XE2VEJHX.js} +5 -3
- package/dist/{chunk-LM5TQCJZ.js → chunk-XF5N4U5A.js} +8 -7
- package/dist/{chunk-LWLEKMDQ.js → chunk-XXQNGV4M.js} +1073 -552
- package/dist/{chunk-KZWTDYJF.js → chunk-XYDYPRZI.js} +7 -7
- package/dist/chunk-ZGVHUX3M.js +66 -0
- package/dist/{chunk-LW6DSM3M.js → chunk-ZRGEBJ4T.js} +1192 -1119
- package/dist/{chunk-2DJ2KNFG.js → chunk-ZXF4XRKW.js} +202 -40
- package/dist/chunk-ZZMN5OM4.js +122 -0
- package/dist/cli/index.js +34 -30
- package/dist/{clio-JOU4FXVA.js → clio-M2KGYUFZ.js} +7 -6
- package/dist/{code-nav-7AX6FYE6.js → code-nav-GQNL7XA6.js} +8 -6
- package/dist/codewiki/build-worker.js +4 -4
- package/dist/{components-KELWS457.js → components-5TTYYX6G.js} +3 -3
- package/dist/{config-XCDVKR23.js → config-XUUYQIWO.js} +47 -35
- package/dist/{configure-4GAP54ZW.js → configure-IHJ7YOMV.js} +18 -15
- package/dist/{context-77FM5DV5.js → context-74JLXAWD.js} +18 -10
- package/dist/{context-4UOGGLQ5.js → context-75MIWW3U.js} +41 -29
- package/dist/{context-5VKGUVJJ.js → context-ZQ7SIFJV.js} +85 -9
- package/dist/{context-clear-XXJRLCJJ.js → context-clear-GYKWNUML.js} +41 -29
- package/dist/{context-index-BZ4UYMTC.js → context-index-SSR5ECNE.js} +3 -3
- package/dist/context-working-set-UX5KEP4J.js +1553 -0
- package/dist/{dispatch-runner-QPRDDBDX.js → dispatch-runner-GIJBHNFL.js} +47 -32
- package/dist/{docs-2C2LTVT2.js → docs-6FZSCG5B.js} +3 -3
- package/dist/{doctor-HR46URBJ.js → doctor-SVJ5BZCW.js} +12 -12
- package/dist/{eval-XSSNATB4.js → eval-CG6LLBLD.js} +54 -238
- package/dist/{evidence-6HG2PY2B.js → evidence-ZYFIEN42.js} +57 -28
- package/dist/{evolve-K7YU3NCY.js → evolve-QGEXEMDW.js} +36 -25
- package/dist/{extensions-QVDOHDGJ.js → extensions-ADGNCJJD.js} +3 -3
- package/dist/{fleet-VY3HHKN6.js → fleet-S5R4ZOQY.js} +73 -44
- package/dist/{fleet-preflight-DDN536IT.js → fleet-preflight-BHSNPBMH.js} +3 -3
- package/dist/{init-JYGXI3FK.js → init-5DRU55YR.js} +49 -37
- package/dist/memory-7YKKR6UC.js +467 -0
- package/dist/{models-I5QWSEOM.js → models-ZPOLRU2C.js} +24 -21
- package/dist/{monitor-GE4ID3IA.js → monitor-US5F5YGZ.js} +73 -46
- package/dist/{orchestrator-EM5MC3HM.js → orchestrator-E2AL4T5N.js} +1624 -1007
- package/dist/{paths-UXLN5YYZ.js → paths-E7KYAQWE.js} +3 -3
- package/dist/{reset-L2FQEE3E.js → reset-KZ652EK6.js} +6 -5
- package/dist/{run-ZU3QMZPZ.js → run-SRNBKDWD.js} +76 -54
- package/dist/{share-S5BZQC5I.js → share-CGZE33UP.js} +7 -6
- package/dist/{skills-X5VXCRNQ.js → skills-S2X4DLY5.js} +4 -4
- package/dist/{skills-eval-WKIHWTHR.js → skills-eval-W2GGIC4R.js} +40 -29
- package/dist/{targets-SNCPI2NR.js → targets-54SWINWB.js} +28 -23
- package/dist/{terminal-lease-BNAHVHBS.js → terminal-lease-SAIF2OGY.js} +6 -4
- package/dist/{uninstall-FZCQCDKC.js → uninstall-BVLWXKBT.js} +3 -3
- package/dist/{upgrade-JQHHPQ4K.js → upgrade-JKAR27XC.js} +20 -19
- package/dist/{usage-OR4O5SMZ.js → usage-MSAWCLX4.js} +79 -36
- package/dist/verifiers-NCBTHHN2.js +1220 -0
- package/dist/verify-X5HDROLA.js +25 -0
- package/dist/{wiki-generate-UEXP2ARI.js → wiki-generate-GUSOQ6ZP.js} +50 -37
- package/dist/worker/entry.js +90 -70
- package/dist/{workspace-G4ZWUIPR.js → workspace-ZJ6BFM3Q.js} +4 -4
- package/docs/README.md +8 -7
- package/docs/acp.md +1 -1
- package/docs/alcf-provider.md +1 -1
- package/docs/architecture.md +2 -2
- package/docs/artifact-placement.md +1 -2
- package/docs/artifact-versions.md +1 -1
- package/docs/built-in-agents.md +1 -1
- package/docs/capacity-and-scheduling.md +1 -1
- package/docs/commands-and-modes.md +60 -26
- package/docs/config-knobs-audit.md +1 -2
- package/docs/configuration-and-targets.md +26 -1
- package/docs/context-engine.md +67 -13
- package/docs/context-working-set.md +194 -0
- package/docs/development-pipeline.md +1 -1
- package/docs/documentation-coverage.md +6 -6
- package/docs/documentation-guide.md +7 -6
- package/docs/environment-variables.md +2 -1
- package/docs/eval-runner.md +1 -1
- package/docs/evals-internal.md +4 -32
- package/docs/evidence-and-memory.md +139 -7
- package/docs/evolution.md +1 -1
- package/docs/exit-codes-and-output.md +1 -1
- package/docs/extensions-and-sharing.md +2 -2
- package/docs/fleet-dispatch.md +49 -8
- package/docs/glossary.md +21 -1
- package/docs/installation-and-lifecycle.md +2 -2
- package/docs/middleware-and-components.md +19 -2
- package/docs/model-catalog.md +7 -9
- package/docs/observability.md +4 -4
- package/docs/proactive-memory.md +26 -16
- package/docs/prompt-envelope-and-tools.md +7 -5
- package/docs/provider-adapter-cookbook.md +1 -1
- package/docs/release-cut-checklist.md +43 -40
- package/docs/safety-model.md +49 -8
- package/docs/scientific-validation.md +21 -3
- package/docs/session-lifecycle.md +3 -3
- package/docs/skills-marketplace.md +1 -1
- package/docs/tool-usage.md +79 -12
- package/docs/trace-store.md +1 -1
- package/docs/troubleshooting.md +1 -1
- package/docs/tui-design.md +38 -4
- package/docs/worker-dispatch-mechanics.md +11 -1
- package/package.json +13 -13
- package/skills/meta/clio-test/SKILL.md +20 -17
- package/skills/meta/clio-test/evals.md +3 -3
- package/skills/meta/clio-test/references/harness.md +35 -6
- package/skills/meta/clio-test/references/test-map.md +20 -10
- package/skills/registry.yaml +2 -2
- package/skills/skill-marketplace.json +1 -1
- package/src/cli/agents.ts +2 -3
- package/src/cli/argv.ts +14 -1
- package/src/cli/context-working-set.ts +513 -0
- package/src/cli/context.ts +8 -0
- package/src/cli/evidence.ts +20 -2
- package/src/cli/fleet.ts +15 -0
- package/src/cli/index.ts +5 -1
- package/src/cli/memory.ts +272 -10
- package/src/cli/modes/json-stream.ts +2 -2
- package/src/cli/modes/print.ts +12 -1
- package/src/cli/run.ts +22 -2
- package/src/cli/targets.ts +12 -3
- package/src/cli/usage.ts +55 -7
- package/src/cli/verifiers.ts +325 -0
- package/src/core/bash-exec.ts +39 -14
- package/src/core/bus-events.ts +22 -4
- package/src/core/config.ts +54 -0
- package/src/core/defaults.ts +50 -3
- package/src/core/response-model-id.ts +134 -0
- package/src/core/toml.ts +62 -0
- package/src/core/verification-scripts.ts +6 -0
- package/src/core/workspace-files.ts +0 -1
- package/src/domains/agents/builtins/architect.md +1 -1
- package/src/domains/agents/builtins/verifier.md +3 -0
- package/src/domains/agents/catalog.ts +5 -4
- package/src/domains/agents/recipe.ts +54 -14
- package/src/domains/agents/result-contract.ts +7 -4
- package/src/domains/config/classify.ts +1 -0
- package/src/domains/context/bootstrap.ts +36 -27
- package/src/domains/context/project-metadata.ts +19 -63
- package/src/domains/context/prompt-context.ts +8 -0
- package/src/domains/context/working-set/contract.ts +161 -0
- package/src/domains/context/working-set/defaults.ts +28 -0
- package/src/domains/context/working-set/engine.ts +203 -0
- package/src/domains/context/working-set/fold.ts +62 -0
- package/src/domains/context/working-set/horizon.ts +38 -0
- package/src/domains/context/working-set/marker.ts +103 -0
- package/src/domains/context/working-set/path-index.ts +436 -0
- package/src/domains/context/working-set/payload.ts +152 -0
- package/src/domains/context/working-set/policies/age-horizon.ts +55 -0
- package/src/domains/context/working-set/policies/index.ts +20 -0
- package/src/domains/context/working-set/policies/structural.ts +160 -0
- package/src/domains/context/working-set/project.ts +132 -0
- package/src/domains/context/working-set/protect.ts +109 -0
- package/src/domains/context/working-set/recall.ts +177 -0
- package/src/domains/context/working-set/replay/controls.ts +112 -0
- package/src/domains/context/working-set/replay/load-clio.ts +199 -0
- package/src/domains/context/working-set/replay/metrics.ts +185 -0
- package/src/domains/context/working-set/replay/reference-graph.ts +79 -0
- package/src/domains/context/working-set/replay/report.ts +139 -0
- package/src/domains/context/working-set/replay/runner.ts +325 -0
- package/src/domains/context/working-set/replay/synthetic.ts +422 -0
- package/src/domains/context/working-set/replay/trace.ts +21 -0
- package/src/domains/context/working-set/visible.ts +54 -0
- package/src/domains/dispatch/budget-envelope.ts +396 -0
- package/src/domains/dispatch/contract.ts +2 -0
- package/src/domains/dispatch/extension.ts +81 -27
- package/src/domains/dispatch/orphan-recovery.ts +1 -0
- package/src/domains/dispatch/receipt-integrity.ts +4 -0
- package/src/domains/dispatch/state.ts +1 -0
- package/src/domains/dispatch/types.ts +10 -3
- package/src/domains/dispatch/validation.ts +14 -0
- package/src/domains/dispatch/worker-spawn.ts +14 -3
- package/src/domains/eval/metrics/evidence.ts +0 -116
- package/src/domains/eval/metrics/invariants.ts +1 -1
- package/src/domains/eval/runners/clio-run.ts +1 -10
- package/src/domains/eval/runners/external-command.ts +2 -29
- package/src/domains/eval/schema/suite.ts +0 -7
- package/src/domains/eval/suites/run.ts +1 -7
- package/src/domains/evidence/build.ts +112 -45
- package/src/domains/evidence/eval.ts +24 -7
- package/src/domains/evidence/index.ts +53 -0
- package/src/domains/evidence/ordering.ts +12 -0
- package/src/domains/evidence/run-trust.ts +221 -0
- package/src/domains/evidence/store.ts +46 -6
- package/src/domains/evidence/trust-status.ts +854 -0
- package/src/domains/evidence/types.ts +26 -0
- package/src/domains/memory/index.ts +22 -0
- package/src/domains/memory/operations.ts +58 -1
- package/src/domains/memory/promotion.ts +281 -0
- package/src/domains/memory/prompt-section.ts +25 -5
- package/src/domains/memory/proposal.ts +51 -7
- package/src/domains/memory/task-bank.ts +3 -2
- package/src/domains/memory/task-memory-handoff.ts +181 -24
- package/src/domains/memory/task-memory-policy.ts +3 -1
- package/src/domains/memory/types.ts +37 -0
- package/src/domains/memory/validate.ts +178 -0
- package/src/domains/middleware/memory-intervention.ts +38 -25
- package/src/domains/middleware/runtime.ts +6 -0
- package/src/domains/middleware/skills-reminder.ts +19 -4
- package/src/domains/middleware/stalled-turn.ts +208 -5
- package/src/domains/middleware/types.ts +10 -0
- package/src/domains/observability/contract.ts +6 -1
- package/src/domains/observability/cost.ts +20 -4
- package/src/domains/observability/extension.ts +2 -2
- package/src/domains/providers/index.ts +3 -0
- package/src/domains/providers/model-discovery.ts +9 -0
- package/src/domains/providers/runtime-resolution.ts +38 -1
- package/src/domains/providers/runtimes/common/probe-helpers.ts +97 -16
- package/src/domains/providers/types/context-window-slots.ts +18 -0
- package/src/domains/providers/types/runtime-descriptor.ts +3 -1
- package/src/domains/safety/autonomy.ts +1 -1
- package/src/domains/safety/call-target.ts +211 -14
- package/src/domains/safety/decision-presentation.ts +268 -0
- package/src/domains/safety/default-path-policy.ts +8 -0
- package/src/domains/safety/finish-contract.ts +4 -3
- package/src/domains/safety/policy-engine.ts +48 -6
- package/src/domains/safety/redaction.ts +73 -0
- package/src/domains/session/compaction/compact.ts +23 -1
- package/src/domains/session/compaction/cut-point.ts +2 -0
- package/src/domains/session/compaction/tokens.ts +16 -1
- package/src/domains/session/context-ledger.ts +12 -1
- package/src/domains/session/decision-board.ts +4 -0
- package/src/domains/session/entries.ts +110 -1
- package/src/domains/session/history.ts +68 -19
- package/src/domains/session/manager.ts +9 -2
- package/src/domains/session/migrations/index.ts +22 -3
- package/src/domains/session/usage.ts +24 -7
- package/src/engine/acp/event-mapper.ts +7 -0
- package/src/engine/acp/server.ts +32 -2
- package/src/engine/agent.ts +18 -1
- package/src/engine/apis/lmstudio.ts +25 -4
- package/src/engine/apis/openai-completions.ts +147 -22
- package/src/engine/claude/sdk-runtime.ts +8 -2
- package/src/engine/claude/tool-safety.ts +13 -0
- package/src/engine/loop-guard.ts +27 -3
- package/src/engine/session.ts +9 -3
- package/src/engine/worker-events.ts +4 -3
- package/src/engine/worker-runtime.ts +59 -54
- package/src/entry/orchestrator.ts +34 -5
- package/src/interactive/chat-loop-messages.ts +40 -6
- package/src/interactive/chat-loop.ts +13 -0
- package/src/interactive/chat-panel.ts +17 -1
- package/src/interactive/chat-renderer.ts +49 -24
- package/src/interactive/clio-editor.ts +44 -7
- package/src/interactive/context-meter.ts +10 -0
- package/src/interactive/context-overlay.ts +120 -7
- package/src/interactive/context-recall-command.ts +110 -0
- package/src/interactive/cost-overlay.ts +39 -8
- package/src/interactive/dispatch-board.ts +212 -35
- package/src/interactive/footer/widgets.ts +13 -0
- package/src/interactive/interactive-application.ts +6 -1
- package/src/interactive/interactive-input-runtime.ts +11 -1
- package/src/interactive/interactive-presentation.ts +11 -1
- package/src/interactive/interactive-slash-runtime.ts +37 -1
- package/src/interactive/memory-overlay.ts +89 -4
- package/src/interactive/model-session-replay.ts +21 -0
- package/src/interactive/overlay-ask-user-lifecycle.ts +1 -1
- package/src/interactive/overlay-frame.ts +5 -2
- package/src/interactive/overlay-general-openers.ts +46 -1
- package/src/interactive/overlay-key-routing.ts +41 -1
- package/src/interactive/overlay-lifecycle.ts +11 -4
- package/src/interactive/overlay-permission-lifecycle.ts +23 -8
- package/src/interactive/overlay-session-lifecycle.ts +8 -4
- package/src/interactive/overlay-transitions.ts +11 -0
- package/src/interactive/overlays/ask-user.ts +74 -30
- package/src/interactive/overlays/decisions.ts +3 -1
- package/src/interactive/permission-hint.ts +35 -0
- package/src/interactive/permission-overlay.ts +95 -45
- package/src/interactive/renderers/tool-execution.ts +37 -51
- package/src/interactive/session-last-turn.ts +8 -1
- package/src/interactive/session-transcript.ts +2 -2
- package/src/interactive/session-usage-reseed.ts +36 -10
- package/src/interactive/slash-commands.ts +31 -4
- package/src/interactive/status/summary.ts +5 -0
- package/src/interactive/status/types.ts +5 -0
- package/src/interactive/terminal-lease.ts +1 -0
- package/src/interactive/turn-context.ts +333 -110
- package/src/interactive/turn-middleware.ts +7 -6
- package/src/interactive/turn-runtime.ts +37 -8
- package/src/interactive/turn-state.ts +3 -0
- package/src/interactive/worker-progress.ts +440 -0
- package/src/interactive/worker-stream.ts +51 -110
- package/src/tools/agent-tools.ts +39 -7
- package/src/tools/ask-user.ts +21 -1
- package/src/tools/bash.ts +144 -82
- package/src/tools/builtin-tool-catalog.ts +11 -5
- package/src/tools/context/index.ts +107 -5
- package/src/tools/context/surface.ts +3 -2
- package/src/tools/core-bootstrap.ts +21 -0
- package/src/tools/dispatch-arguments.ts +8 -0
- package/src/tools/dispatch-event-text.ts +19 -0
- package/src/tools/dispatch-runner.ts +9 -7
- package/src/tools/dispatch.ts +24 -1
- package/src/tools/monitor.ts +43 -20
- package/src/tools/registry.ts +72 -10
- package/src/tools/result-disposition.ts +706 -0
- package/src/tools/result-shaping.ts +321 -20
- package/src/tools/safe-exec.ts +2 -0
- package/src/tools/verify/authoring.ts +1120 -0
- package/src/tools/verify/catalog.ts +346 -0
- package/src/tools/verify/index.ts +13 -3
- package/src/tools/verify/scripts.ts +135 -37
- package/src/tools/verify/surface.ts +9 -5
- package/src/tools/worker-evidence.ts +54 -12
- package/src/worker/spec-contract.ts +43 -3
- package/dist/chunk-J7CWMCQD.js +0 -255
- package/dist/chunk-T6YILFSB.js +0 -80
- package/dist/chunk-VAKQQHWR.js +0 -434
- package/dist/chunk-VPAYEGVX.js +0 -184
- package/dist/chunk-XBXAASKX.js +0 -18
- package/dist/memory-WFZMGYHX.js +0 -236
- package/src/domains/eval/metrics/chaos-stream.ts +0 -93
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
AUTONOMY_EXPOSURES
|
|
4
|
+
} from "./chunk-HWUFFB6L.js";
|
|
5
|
+
import {
|
|
6
|
+
init_esm_shims
|
|
7
|
+
} from "./chunk-3R73A4XB.js";
|
|
8
|
+
|
|
9
|
+
// src/core/skill-activation.ts
|
|
10
|
+
init_esm_shims();
|
|
11
|
+
var SKILL_SUGGESTION_ANCHOR = "Suggested skill: /skill <name>";
|
|
12
|
+
var SKILL_SUGGESTION_PREFIX = SKILL_SUGGESTION_ANCHOR.slice(0, SKILL_SUGGESTION_ANCHOR.indexOf("<name>"));
|
|
13
|
+
var SKILL_SURFACE_EXEMPT_TOOLS = /* @__PURE__ */ new Set(["context", "ask_user"]);
|
|
14
|
+
function evaluateSkillToolSurface(policy, tool) {
|
|
15
|
+
if (!policy || policy.loadedSkillPolicies.size === 0) return null;
|
|
16
|
+
if (SKILL_SURFACE_EXEMPT_TOOLS.has(tool)) return null;
|
|
17
|
+
const entries = [...policy.loadedSkillPolicies.entries()];
|
|
18
|
+
const skills = entries.map(([name]) => name);
|
|
19
|
+
const disallowedBy = entries.filter(([, declared]) => declared.disallowedTools?.includes(tool) === true).map(([name]) => name);
|
|
20
|
+
if (disallowedBy.length > 0) return { skills, mergedAllowedTools: null, disallowedBy };
|
|
21
|
+
const allowLists = entries.map(([, declared]) => declared.allowedTools);
|
|
22
|
+
if (allowLists.some((list) => list === void 0 || list.length === 0)) return null;
|
|
23
|
+
const merged = [...new Set(allowLists.flatMap((list) => [...list ?? []]))];
|
|
24
|
+
if (merged.includes(tool)) return null;
|
|
25
|
+
return { skills, mergedAllowedTools: merged, disallowedBy: [] };
|
|
26
|
+
}
|
|
27
|
+
function agentSkillToolPolicy(skillNames) {
|
|
28
|
+
const allowedSkillNames = [...new Set(skillNames.map((name) => name.trim()).filter((name) => name.length > 0))];
|
|
29
|
+
if (allowedSkillNames.length === 0) return void 0;
|
|
30
|
+
return {
|
|
31
|
+
allowedSkillNames,
|
|
32
|
+
requests: allowedSkillNames.map((name) => ({ name, args: "", source: "recipe", installed: true })),
|
|
33
|
+
loadedSkillNames: /* @__PURE__ */ new Set(),
|
|
34
|
+
loadedSkillPolicies: /* @__PURE__ */ new Map()
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function trimmedString(value) {
|
|
38
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : null;
|
|
39
|
+
}
|
|
40
|
+
function skillActivationFromSource(source, triggeredBy, turnId) {
|
|
41
|
+
const sourceOrigin = trimmedString(source.sourceOrigin) ?? trimmedString(source.sourceInfo?.source);
|
|
42
|
+
return {
|
|
43
|
+
name: source.name,
|
|
44
|
+
filePath: source.filePath,
|
|
45
|
+
hash: source.hash,
|
|
46
|
+
source: source.source,
|
|
47
|
+
...sourceOrigin ? { sourceOrigin } : {},
|
|
48
|
+
triggeredBy,
|
|
49
|
+
...turnId ? { turnId } : {}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function skillActivationFromToolDetails(details, turnId) {
|
|
53
|
+
if (!details || typeof details !== "object" || Array.isArray(details)) return null;
|
|
54
|
+
const record = details;
|
|
55
|
+
const name = trimmedString(record.name);
|
|
56
|
+
const filePath = trimmedString(record.filePath) ?? trimmedString(record.path);
|
|
57
|
+
const hash = trimmedString(record.hash);
|
|
58
|
+
const source = trimmedString(record.source);
|
|
59
|
+
const sourceOrigin = trimmedString(record.sourceOrigin) ?? trimmedString(record.origin);
|
|
60
|
+
if (!name || !filePath || !hash || !source) return null;
|
|
61
|
+
const activation = skillActivationFromSource(
|
|
62
|
+
{ name, filePath, hash, source, ...sourceOrigin ? { sourceOrigin } : {} },
|
|
63
|
+
"tool",
|
|
64
|
+
turnId
|
|
65
|
+
);
|
|
66
|
+
if (record.drift === "match" || record.drift === "mismatch") activation.drift = record.drift;
|
|
67
|
+
return activation;
|
|
68
|
+
}
|
|
69
|
+
function isSkillActivation(value) {
|
|
70
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
71
|
+
const record = value;
|
|
72
|
+
return typeof record.name === "string" && typeof record.filePath === "string" && typeof record.hash === "string" && typeof record.source === "string" && (record.sourceOrigin === void 0 || typeof record.sourceOrigin === "string") && (record.triggeredBy === "slash-command" || record.triggeredBy === "tool") && (record.turnId === void 0 || typeof record.turnId === "string") && (record.runId === void 0 || typeof record.runId === "string");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// src/domains/session/entries.ts
|
|
76
|
+
init_esm_shims();
|
|
77
|
+
var EVICTION_REASONS = [
|
|
78
|
+
"superseded_read",
|
|
79
|
+
"stale_after_mutation",
|
|
80
|
+
"listing_consumed",
|
|
81
|
+
"failure_resolved",
|
|
82
|
+
"thinking_turn_closed",
|
|
83
|
+
"age_horizon",
|
|
84
|
+
"operator"
|
|
85
|
+
];
|
|
86
|
+
var EVICTION_TRIGGERS = ["pressure", "operator"];
|
|
87
|
+
var RECALL_TRIGGERS = ["tool", "operator"];
|
|
88
|
+
var SESSION_ENTRY_KINDS = [
|
|
89
|
+
"message",
|
|
90
|
+
"bashExecution",
|
|
91
|
+
"custom",
|
|
92
|
+
"modelChange",
|
|
93
|
+
"thinkingLevelChange",
|
|
94
|
+
"fileEntry",
|
|
95
|
+
"branchSummary",
|
|
96
|
+
"compactionSummary",
|
|
97
|
+
"sessionInfo",
|
|
98
|
+
"label",
|
|
99
|
+
"protectedArtifact",
|
|
100
|
+
"skillActivation",
|
|
101
|
+
"taskLedger",
|
|
102
|
+
"decisionLedger",
|
|
103
|
+
"workerRun",
|
|
104
|
+
"contextEviction",
|
|
105
|
+
"contextRecall"
|
|
106
|
+
];
|
|
107
|
+
function isRecord(value) {
|
|
108
|
+
return !!value && typeof value === "object";
|
|
109
|
+
}
|
|
110
|
+
function isString(value) {
|
|
111
|
+
return typeof value === "string";
|
|
112
|
+
}
|
|
113
|
+
function isOptionalString(value) {
|
|
114
|
+
return value === void 0 || typeof value === "string";
|
|
115
|
+
}
|
|
116
|
+
function isOptionalBoolean(value) {
|
|
117
|
+
return value === void 0 || typeof value === "boolean";
|
|
118
|
+
}
|
|
119
|
+
function isNumber(value) {
|
|
120
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
121
|
+
}
|
|
122
|
+
function isPositiveInteger(value) {
|
|
123
|
+
return isNumber(value) && Number.isInteger(value) && value > 0;
|
|
124
|
+
}
|
|
125
|
+
function isOptionalNumber(value) {
|
|
126
|
+
return value === void 0 || isNumber(value);
|
|
127
|
+
}
|
|
128
|
+
function isNullableString(value) {
|
|
129
|
+
return value === null || typeof value === "string";
|
|
130
|
+
}
|
|
131
|
+
function isOneOf(value, allowed) {
|
|
132
|
+
return typeof value === "string" && allowed.includes(value);
|
|
133
|
+
}
|
|
134
|
+
function isStringArray(value) {
|
|
135
|
+
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
136
|
+
}
|
|
137
|
+
function hasBaseSessionEntryFields(v) {
|
|
138
|
+
return isString(v.turnId) && isNullableString(v.parentTurnId) && isString(v.timestamp);
|
|
139
|
+
}
|
|
140
|
+
var MESSAGE_ROLES = ["user", "assistant", "tool_call", "tool_result", "system", "checkpoint"];
|
|
141
|
+
var FILE_OPERATIONS = ["read", "write", "edit", "create", "delete"];
|
|
142
|
+
var COMPACTION_TRIGGERS = ["auto", "force", "overflow"];
|
|
143
|
+
var PROTECTED_ARTIFACT_SOURCES = [
|
|
144
|
+
"validation",
|
|
145
|
+
"middleware",
|
|
146
|
+
"user",
|
|
147
|
+
"session"
|
|
148
|
+
];
|
|
149
|
+
var TASK_LEDGER_STATUSES = ["pending", "active", "completed", "blocked", "cancelled"];
|
|
150
|
+
var TASK_LEDGER_EVIDENCE_STATUSES = [
|
|
151
|
+
"required",
|
|
152
|
+
"pending",
|
|
153
|
+
"passed",
|
|
154
|
+
"failed",
|
|
155
|
+
"missing"
|
|
156
|
+
];
|
|
157
|
+
var DECISION_STATUSES = ["active", "superseded"];
|
|
158
|
+
var DECISION_INTERVIEW_STATUSES = ["complete", "cancelled"];
|
|
159
|
+
var WORKER_RUN_ORIGINS = ["user", "agent"];
|
|
160
|
+
var WORKER_RUN_RUNTIME_KINDS = ["clio", "acp", "claude-sdk", "claude-code"];
|
|
161
|
+
function isWorkerRunRuntime(value) {
|
|
162
|
+
if (!isRecord(value)) return false;
|
|
163
|
+
return isOneOf(value.kind, WORKER_RUN_RUNTIME_KINDS) && isOptionalString(value.targetId) && isOptionalString(value.wireModelId) && isOptionalString(value.peerId);
|
|
164
|
+
}
|
|
165
|
+
function isTaskLedgerGoal(value) {
|
|
166
|
+
if (!isRecord(value)) return false;
|
|
167
|
+
if (!isString(value.id) || !isString(value.title)) return false;
|
|
168
|
+
if (!isOneOf(value.status, TASK_LEDGER_STATUSES)) return false;
|
|
169
|
+
if (value.parentGoalId !== void 0 && !isNullableString(value.parentGoalId)) return false;
|
|
170
|
+
const hasPairedProvenance = value.origin === "user" ? isString(value.userTaskId) && /^u[1-9]\d*$/.test(value.userTaskId) : (value.origin === void 0 || value.origin === "agent") && value.userTaskId === void 0;
|
|
171
|
+
return isOptionalString(value.description) && hasPairedProvenance;
|
|
172
|
+
}
|
|
173
|
+
function isTaskLedgerEvidence(value) {
|
|
174
|
+
if (!isRecord(value)) return false;
|
|
175
|
+
if (!isString(value.id) || !isString(value.description)) return false;
|
|
176
|
+
if (!isOneOf(value.status, TASK_LEDGER_EVIDENCE_STATUSES)) return false;
|
|
177
|
+
return isOptionalString(value.command) && isOptionalString(value.artifactPath) && isOptionalString(value.observedAt) && isOptionalString(value.notes);
|
|
178
|
+
}
|
|
179
|
+
function isDecisionRecord(value) {
|
|
180
|
+
if (!isRecord(value)) return false;
|
|
181
|
+
if (!isString(value.key) || !/^[a-z0-9]+(?:_[a-z0-9]+)*$/.test(value.key)) return false;
|
|
182
|
+
if (!isString(value.value) || !isOneOf(value.status, DECISION_STATUSES) || !isString(value.decidedAt)) return false;
|
|
183
|
+
if (!isOptionalString(value.label) || !isOptionalString(value.source_question)) return false;
|
|
184
|
+
if (!isOptionalString(value.revisedAt) || !isOptionalString(value.correction)) return false;
|
|
185
|
+
return value.status === "superseded" ? isString(value.revisedAt) : value.revisedAt === void 0 && value.correction === void 0;
|
|
186
|
+
}
|
|
187
|
+
function isOptionalCompactionUsage(value) {
|
|
188
|
+
if (value === void 0) return true;
|
|
189
|
+
if (!isRecord(value)) return false;
|
|
190
|
+
const cost = value.cost;
|
|
191
|
+
return isNumber(value.input) && isNumber(value.output) && isNumber(value.cacheRead) && isNumber(value.cacheWrite) && isNumber(value.reasoning) && isNumber(value.totalTokens) && isNumber(value.apiCalls) && isRecord(cost) && isNumber(cost.total);
|
|
192
|
+
}
|
|
193
|
+
function isProtectedArtifact(value) {
|
|
194
|
+
if (!isRecord(value)) return false;
|
|
195
|
+
return isString(value.path) && isString(value.protectedAt) && isString(value.reason) && isOneOf(value.source, PROTECTED_ARTIFACT_SOURCES) && isOptionalString(value.validationCommand) && isOptionalNumber(value.validationExitCode);
|
|
196
|
+
}
|
|
197
|
+
function isSessionHeader(value) {
|
|
198
|
+
if (!isRecord(value)) return false;
|
|
199
|
+
return value.type === "session" && isPositiveInteger(value.version) && isString(value.id) && isString(value.timestamp) && isString(value.cwd) && isOptionalString(value.parentSession) && isOptionalString(value.parentTurnId);
|
|
200
|
+
}
|
|
201
|
+
function isWorkingSetRef(value) {
|
|
202
|
+
return isRecord(value) && isString(value.entry);
|
|
203
|
+
}
|
|
204
|
+
function isEvictedItem(value) {
|
|
205
|
+
return isRecord(value) && isWorkingSetRef(value.ref) && isOneOf(value.reason, EVICTION_REASONS) && isNumber(value.tokensFreed) && isString(value.marker) && isOptionalString(value.by);
|
|
206
|
+
}
|
|
207
|
+
function isSessionEntry(value) {
|
|
208
|
+
if (!value || typeof value !== "object") return false;
|
|
209
|
+
const v = value;
|
|
210
|
+
if (!hasBaseSessionEntryFields(v)) return false;
|
|
211
|
+
if (!isOneOf(v.kind, SESSION_ENTRY_KINDS)) return false;
|
|
212
|
+
switch (v.kind) {
|
|
213
|
+
case "message":
|
|
214
|
+
return Object.hasOwn(v, "payload") && isOneOf(v.role, MESSAGE_ROLES);
|
|
215
|
+
case "bashExecution":
|
|
216
|
+
return isString(v.command) && isString(v.output) && (v.exitCode === null || isNumber(v.exitCode)) && typeof v.cancelled === "boolean" && typeof v.truncated === "boolean" && isOptionalString(v.fullOutputPath) && isOptionalBoolean(v.excludeFromContext);
|
|
217
|
+
case "custom":
|
|
218
|
+
return isString(v.customType) && isOptionalBoolean(v.display);
|
|
219
|
+
case "modelChange":
|
|
220
|
+
return isString(v.provider) && isString(v.modelId) && isOptionalString(v.target);
|
|
221
|
+
case "thinkingLevelChange":
|
|
222
|
+
return isString(v.thinkingLevel);
|
|
223
|
+
case "fileEntry":
|
|
224
|
+
return isString(v.path) && isOneOf(v.operation, FILE_OPERATIONS) && isOptionalNumber(v.bytes) && isOptionalString(v.hash);
|
|
225
|
+
case "branchSummary":
|
|
226
|
+
return isString(v.fromTurnId) && isString(v.summary);
|
|
227
|
+
case "compactionSummary":
|
|
228
|
+
return isString(v.summary) && isNumber(v.tokensBefore) && isString(v.firstKeptTurnId) && isOptionalCompactionUsage(v.usage) && (v.trigger === void 0 || isOneOf(v.trigger, COMPACTION_TRIGGERS)) && isOptionalNumber(v.tokensAfter) && isOptionalNumber(v.messagesSummarized) && isOptionalBoolean(v.isSplitTurn);
|
|
229
|
+
case "sessionInfo":
|
|
230
|
+
return isOptionalString(v.name) && isOptionalString(v.targetTurnId) && isOptionalString(v.label);
|
|
231
|
+
case "label":
|
|
232
|
+
return isString(v.targetTurnId) && isOptionalString(v.label);
|
|
233
|
+
case "protectedArtifact":
|
|
234
|
+
return v.action === "protect" && isProtectedArtifact(v.artifact) && isOptionalString(v.toolName) && isOptionalString(v.toolCallId) && isOptionalString(v.runId) && isOptionalString(v.correlationId);
|
|
235
|
+
case "skillActivation":
|
|
236
|
+
return isSkillActivation(v.activation);
|
|
237
|
+
case "taskLedger":
|
|
238
|
+
return isOptionalString(v.boardId) && Array.isArray(v.goals) && v.goals.every(isTaskLedgerGoal) && Array.isArray(v.subgoals) && v.subgoals.every(isTaskLedgerGoal) && isStringArray(v.activeRunIds) && Array.isArray(v.requiredValidationEvidence) && v.requiredValidationEvidence.every(isTaskLedgerEvidence);
|
|
239
|
+
case "decisionLedger":
|
|
240
|
+
return isString(v.interviewId) && isOneOf(v.interviewStatus, DECISION_INTERVIEW_STATUSES) && isString(v.startedAt) && isString(v.endedAt) && isNumber(v.roundCount) && Number.isInteger(v.roundCount) && v.roundCount >= 0 && isOptionalString(v.summary) && isOptionalString(v.transcriptPath) && (v.exposure === void 0 || isOneOf(v.exposure, AUTONOMY_EXPOSURES)) && Array.isArray(v.decisions) && v.decisions.every(isDecisionRecord);
|
|
241
|
+
case "workerRun":
|
|
242
|
+
return isString(v.assignmentId) && isString(v.runId) && isOneOf(v.origin, WORKER_RUN_ORIGINS) && isString(v.agentId) && isWorkerRunRuntime(v.runtime) && isOptionalString(v.parentToolCallId);
|
|
243
|
+
case "contextEviction":
|
|
244
|
+
return isString(v.policyId) && isOneOf(v.trigger, EVICTION_TRIGGERS) && Array.isArray(v.evicted) && v.evicted.every(isEvictedItem) && isNumber(v.tokensBefore) && isNumber(v.tokensAfter) && (v.pressureBefore === null || isNumber(v.pressureBefore)) && (v.snapshotIdBefore === null || isString(v.snapshotIdBefore));
|
|
245
|
+
case "contextRecall":
|
|
246
|
+
return isWorkingSetRef(v.ref) && isOneOf(v.trigger, RECALL_TRIGGERS) && isNumber(v.tokensReadmitted) && isOptionalString(v.toolCallId);
|
|
247
|
+
}
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export {
|
|
252
|
+
SKILL_SUGGESTION_ANCHOR,
|
|
253
|
+
SKILL_SUGGESTION_PREFIX,
|
|
254
|
+
evaluateSkillToolSurface,
|
|
255
|
+
agentSkillToolPolicy,
|
|
256
|
+
skillActivationFromToolDetails,
|
|
257
|
+
isSkillActivation,
|
|
258
|
+
isSessionHeader,
|
|
259
|
+
isSessionEntry
|
|
260
|
+
};
|
|
261
|
+
//# sourceMappingURL=chunk-GOXNB3AO.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
detectProjectType
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XAKHZX5N.js";
|
|
5
5
|
import {
|
|
6
6
|
init_esm_shims
|
|
7
7
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -179,4 +179,4 @@ export {
|
|
|
179
179
|
probeWorkspace,
|
|
180
180
|
probeWorkspaceAsync
|
|
181
181
|
};
|
|
182
|
-
//# sourceMappingURL=chunk-
|
|
182
|
+
//# sourceMappingURL=chunk-HVDIIIQW.js.map
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
init_esm_shims
|
|
4
|
+
} from "./chunk-3R73A4XB.js";
|
|
5
|
+
|
|
6
|
+
// src/domains/safety/autonomy.ts
|
|
7
|
+
init_esm_shims();
|
|
8
|
+
var AUTONOMY_LEVELS = ["read-only", "suggest", "auto-edit", "full-auto"];
|
|
9
|
+
var DEFAULT_AUTONOMY_LEVEL = "auto-edit";
|
|
10
|
+
function isAutonomyLevel(value) {
|
|
11
|
+
return typeof value === "string" && AUTONOMY_LEVELS.includes(value);
|
|
12
|
+
}
|
|
13
|
+
var AUTONOMY_EXPOSURES = ["local", "outward"];
|
|
14
|
+
var DEFAULT_AUTONOMY_EXPOSURE = "local";
|
|
15
|
+
function mapAutonomy(level, actionClass, options = {}) {
|
|
16
|
+
if (actionClass === "git_destructive") return "deny";
|
|
17
|
+
if ((level === "auto-edit" || level === "suggest") && options.exposure === "outward") return "ask";
|
|
18
|
+
if (actionClass === "read") return "allow";
|
|
19
|
+
if (level === "read-only") return "deny";
|
|
20
|
+
if (level === "suggest") return "ask";
|
|
21
|
+
switch (actionClass) {
|
|
22
|
+
case "write":
|
|
23
|
+
return "allow";
|
|
24
|
+
case "dispatch":
|
|
25
|
+
if (options.dispatchPlanScale === true && level !== "full-auto") return "ask";
|
|
26
|
+
return "allow";
|
|
27
|
+
case "execute": {
|
|
28
|
+
if (options.executeRecognized !== false) return "allow";
|
|
29
|
+
return level === "full-auto" ? "allow" : "ask";
|
|
30
|
+
}
|
|
31
|
+
case "unknown":
|
|
32
|
+
return "ask";
|
|
33
|
+
default:
|
|
34
|
+
return "ask";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function autonomyDenyRejection(level, tool, actionClass) {
|
|
38
|
+
return {
|
|
39
|
+
short: `${tool} denied: autonomy level is ${level}`,
|
|
40
|
+
detail: `Clio is at autonomy ${level}: ${actionClass} actions are denied without prompting. Describe the change you would make instead, so the operator can apply it or raise the autonomy level.`,
|
|
41
|
+
hints: ["Propose the exact edit or command as text.", "The operator can change the level in /settings."]
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function autonomyAskRejection(level, tool, actionClass, exposure = DEFAULT_AUTONOMY_EXPOSURE) {
|
|
45
|
+
if (exposure === "outward") {
|
|
46
|
+
return {
|
|
47
|
+
short: `${tool} needs approval: outward-facing gate at autonomy ${level}`,
|
|
48
|
+
detail: `The call declared exposure=outward, so answering it publishes or sends something outside the workspace. Autonomy ${level} auto-answers local gates and parks outward-facing ones for the operator.`,
|
|
49
|
+
hints: [
|
|
50
|
+
"Approving resumes only this call.",
|
|
51
|
+
"Autonomy full-auto answers outward gates too; the safety net still applies there."
|
|
52
|
+
]
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
short: `${tool} needs approval (${actionClass}) at autonomy ${level}`,
|
|
57
|
+
detail: `Autonomy ${level} routes ${actionClass} actions through operator approval. The call is parked until the operator approves it once or cancels it.`,
|
|
58
|
+
hints: [
|
|
59
|
+
"Approving resumes only this call.",
|
|
60
|
+
"Recognized commands can be added to .clio-coder/safety.yaml.",
|
|
61
|
+
// The sanctioned pivots for a gated shell command: typed verification
|
|
62
|
+
// and read-class observe tools run without approval at this level,
|
|
63
|
+
// and models otherwise stall retrying denied bash for checks or
|
|
64
|
+
// directory listings.
|
|
65
|
+
...actionClass === "execute" ? [
|
|
66
|
+
'A declared package or project-catalog check runs without approval through the verify tool: verify(check="<id>").',
|
|
67
|
+
"Read-only inspection runs without approval through the ls, read, grep, and find tools."
|
|
68
|
+
] : []
|
|
69
|
+
]
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
AUTONOMY_LEVELS,
|
|
75
|
+
DEFAULT_AUTONOMY_LEVEL,
|
|
76
|
+
isAutonomyLevel,
|
|
77
|
+
AUTONOMY_EXPOSURES,
|
|
78
|
+
DEFAULT_AUTONOMY_EXPOSURE,
|
|
79
|
+
mapAutonomy,
|
|
80
|
+
autonomyDenyRejection,
|
|
81
|
+
autonomyAskRejection
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=chunk-HWUFFB6L.js.map
|
|
@@ -10,17 +10,17 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
FAILURE_CAUSE_TAGS,
|
|
12
12
|
buildEvidence
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QM3F2GKX.js";
|
|
14
14
|
import {
|
|
15
15
|
normalizeCostProvenance
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-DJVECN66.js";
|
|
17
17
|
import {
|
|
18
18
|
clioDataDir,
|
|
19
19
|
clioStateDir
|
|
20
20
|
} from "./chunk-BNAZZHFG.js";
|
|
21
21
|
import {
|
|
22
22
|
BusChannels
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-G7MUEIGA.js";
|
|
24
24
|
import {
|
|
25
25
|
init_esm_shims
|
|
26
26
|
} from "./chunk-3R73A4XB.js";
|
|
@@ -71,7 +71,7 @@ function createCostTracker() {
|
|
|
71
71
|
let total = 0;
|
|
72
72
|
const totals = emptyBreakdown();
|
|
73
73
|
return {
|
|
74
|
-
accumulate(providerId,
|
|
74
|
+
accumulate(providerId, attributedModelId, tokens, usd, breakdown, costProvenance, modelIdFacts) {
|
|
75
75
|
const resolvedUsd = usd ?? 0;
|
|
76
76
|
const provenance = normalizeCostProvenance(costProvenance);
|
|
77
77
|
const input = breakdown?.input ?? 0;
|
|
@@ -82,7 +82,14 @@ function createCostTracker() {
|
|
|
82
82
|
const apiCalls = breakdown?.apiCalls;
|
|
83
83
|
log.push({
|
|
84
84
|
providerId,
|
|
85
|
-
|
|
85
|
+
attributedModelId,
|
|
86
|
+
requestedModelIds: [...modelIdFacts?.requestedModelIds ?? [attributedModelId]],
|
|
87
|
+
responseModelIdObservationCounts: modelIdFacts ? { ...modelIdFacts.responseModelIdObservationCounts } : {
|
|
88
|
+
reportedCalls: 0,
|
|
89
|
+
notReportedCalls: 0,
|
|
90
|
+
notObservedCalls: apiCalls ?? 1,
|
|
91
|
+
legacyDifferenceOnlyCalls: 0
|
|
92
|
+
},
|
|
86
93
|
tokens,
|
|
87
94
|
usd: resolvedUsd,
|
|
88
95
|
provenance,
|
|
@@ -742,9 +749,9 @@ function createObservabilityBundle(context, options = {}) {
|
|
|
742
749
|
latestThroughput = null;
|
|
743
750
|
projection.refresh();
|
|
744
751
|
},
|
|
745
|
-
recordTokens(providerId,
|
|
752
|
+
recordTokens(providerId, attributedModelId, tokens, costUsd, breakdown, costProvenance, modelIdFacts) {
|
|
746
753
|
telemetry.record("counter", "tokens.total", tokens);
|
|
747
|
-
cost.accumulate(providerId,
|
|
754
|
+
cost.accumulate(providerId, attributedModelId, tokens, costUsd, breakdown, costProvenance, modelIdFacts);
|
|
748
755
|
projection.refresh();
|
|
749
756
|
},
|
|
750
757
|
recordSessionTurn(sessionTurn) {
|
|
@@ -794,4 +801,4 @@ export {
|
|
|
794
801
|
ObservabilityDomainModule,
|
|
795
802
|
createObservabilityDomainModule
|
|
796
803
|
};
|
|
797
|
-
//# sourceMappingURL=chunk-
|
|
804
|
+
//# sourceMappingURL=chunk-K7T3E2SR.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
init_esm_shims
|
|
4
|
+
} from "./chunk-3R73A4XB.js";
|
|
5
|
+
|
|
6
|
+
// src/core/headless-permission.ts
|
|
7
|
+
init_esm_shims();
|
|
8
|
+
var HEADLESS_PERMISSION_DENIED_REASON = "clio-coder run cannot confirm permission requests; rerun interactively to approve this action.";
|
|
9
|
+
var HEADLESS_PERMISSION_DENIED_MARKER = "clio-coder run cannot confirm permission requests";
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
HEADLESS_PERMISSION_DENIED_REASON,
|
|
13
|
+
HEADLESS_PERMISSION_DENIED_MARKER
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=chunk-K7VKOLQQ.js.map
|
|
@@ -9,24 +9,24 @@ import {
|
|
|
9
9
|
detectInteropAgents,
|
|
10
10
|
fingerprintNativeRuntime,
|
|
11
11
|
resolveOnPath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RD5U66HV.js";
|
|
13
13
|
import {
|
|
14
14
|
initializeClioHome
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-KOHPCX4K.js";
|
|
16
16
|
import {
|
|
17
17
|
formatSettingsIssues,
|
|
18
18
|
readSettings,
|
|
19
19
|
validateSettingsFile
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-AD2SYQYC.js";
|
|
21
21
|
import {
|
|
22
22
|
openAuthStorage
|
|
23
23
|
} from "./chunk-4VP4KH3K.js";
|
|
24
|
-
import {
|
|
25
|
-
readSessionFileEntries
|
|
26
|
-
} from "./chunk-M6SHUN7Q.js";
|
|
27
24
|
import {
|
|
28
25
|
interopAgentKind
|
|
29
26
|
} from "./chunk-IHXBNWMM.js";
|
|
27
|
+
import {
|
|
28
|
+
readSessionFileEntries
|
|
29
|
+
} from "./chunk-FO5ZOVUY.js";
|
|
30
30
|
import {
|
|
31
31
|
clioStatePath,
|
|
32
32
|
resolveClioDirs
|
|
@@ -337,7 +337,7 @@ async function runDoctorFleetChecks(projectRoot = process.cwd()) {
|
|
|
337
337
|
}
|
|
338
338
|
const nodes = settings.fleet?.nodes ?? [];
|
|
339
339
|
if (nodes.length === 0) return [];
|
|
340
|
-
const { recordFleetPreflight, runFleetNodePreflight } = await import("./fleet-preflight-
|
|
340
|
+
const { recordFleetPreflight, runFleetNodePreflight } = await import("./fleet-preflight-BHSNPBMH.js");
|
|
341
341
|
const targets = (settings.targets ?? []).map((target) => ({
|
|
342
342
|
id: target.id,
|
|
343
343
|
runtimeId: target.runtime,
|
|
@@ -437,4 +437,4 @@ export {
|
|
|
437
437
|
runDoctorInteropChecks,
|
|
438
438
|
runDoctorRuntimeChecks
|
|
439
439
|
};
|
|
440
|
-
//# sourceMappingURL=chunk-
|
|
440
|
+
//# sourceMappingURL=chunk-KHSFENX2.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
DEFAULT_SETTINGS_YAML
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4OC57DA6.js";
|
|
5
5
|
import {
|
|
6
6
|
clioCacheDir,
|
|
7
7
|
clioConfigDir,
|
|
@@ -143,4 +143,4 @@ function enforceHomePrefixGuard() {
|
|
|
143
143
|
export {
|
|
144
144
|
initializeClioHome
|
|
145
145
|
};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-KOHPCX4K.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
init_esm_shims
|
|
4
|
+
} from "./chunk-3R73A4XB.js";
|
|
5
|
+
|
|
6
|
+
// src/core/toml.ts
|
|
7
|
+
init_esm_shims();
|
|
8
|
+
import { readFileSync } from "node:fs";
|
|
9
|
+
import { createRequire } from "node:module";
|
|
10
|
+
import { join } from "node:path";
|
|
11
|
+
var require2 = createRequire(import.meta.url);
|
|
12
|
+
var parse;
|
|
13
|
+
function parser() {
|
|
14
|
+
parse ??= require2("smol-toml").parse;
|
|
15
|
+
return parse;
|
|
16
|
+
}
|
|
17
|
+
function parseTomlDocument(raw) {
|
|
18
|
+
try {
|
|
19
|
+
return parser()(raw);
|
|
20
|
+
} catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function isTomlTable(value) {
|
|
25
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof Date);
|
|
26
|
+
}
|
|
27
|
+
function tomlTableAt(document, path) {
|
|
28
|
+
let value = document;
|
|
29
|
+
for (const segment of path) {
|
|
30
|
+
if (!isTomlTable(value) || !Object.hasOwn(value, segment)) return null;
|
|
31
|
+
value = value[segment];
|
|
32
|
+
}
|
|
33
|
+
return isTomlTable(value) ? value : null;
|
|
34
|
+
}
|
|
35
|
+
function createTomlFileReader(root) {
|
|
36
|
+
const documents = /* @__PURE__ */ new Map();
|
|
37
|
+
return {
|
|
38
|
+
read(relativePath) {
|
|
39
|
+
if (documents.has(relativePath)) return documents.get(relativePath) ?? null;
|
|
40
|
+
let document = null;
|
|
41
|
+
try {
|
|
42
|
+
document = parseTomlDocument(readFileSync(join(root, relativePath), "utf8"));
|
|
43
|
+
} catch {
|
|
44
|
+
document = null;
|
|
45
|
+
}
|
|
46
|
+
documents.set(relativePath, document);
|
|
47
|
+
return document;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
parseTomlDocument,
|
|
54
|
+
tomlTableAt,
|
|
55
|
+
createTomlFileReader
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=chunk-LCGCVYZ4.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
init_esm_shims
|
|
4
|
+
} from "./chunk-3R73A4XB.js";
|
|
5
|
+
|
|
6
|
+
// src/domains/context/working-set/defaults.ts
|
|
7
|
+
init_esm_shims();
|
|
8
|
+
var DEFAULT_WORKING_SET_SETTINGS = {
|
|
9
|
+
enabled: true,
|
|
10
|
+
policy: "structural-v1",
|
|
11
|
+
target: 0.6,
|
|
12
|
+
protectLastTurns: 6,
|
|
13
|
+
// The procedural floor sweep found marker break-even near 50 tokens. A zero
|
|
14
|
+
// floor saved only 0.167 summaries at 64k and none at 128k while reducing
|
|
15
|
+
// covered retention by 0.0076 and 0.0237. Keep 200 as the churn guard.
|
|
16
|
+
minEvictableTokens: 200
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
DEFAULT_WORKING_SET_SETTINGS
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=chunk-LL4KHSZI.js.map
|