@iowarp/clio-coder 0.5.0 → 0.5.2
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/.claude-plugin/marketplace.json +4 -4
- package/CHANGELOG.md +35 -0
- package/CONTRIBUTING.md +9 -0
- package/README.md +12 -9
- package/ROADMAP.md +30 -5
- package/dist/{acp-KS7ARGV6.js → acp-F6PGOFZ4.js} +2 -2
- package/dist/{agents-YOGJ2YEJ.js → agents-ZHP4R6EX.js} +22 -21
- package/dist/assets/codewiki.json +1 -1
- package/dist/{auth-CEDCO6O6.js → auth-N75U2H3Z.js} +4 -4
- package/dist/{chunk-D3KWFOUT.js → chunk-23UIXH6Z.js} +3 -3
- package/dist/{chunk-ZR5YA6ZF.js → chunk-36XVK5P5.js} +5 -5
- package/dist/{chunk-AVSR2HKI.js → chunk-3DZ4LPLS.js} +6 -6
- package/dist/{chunk-LYJJ6546.js → chunk-3GSPCWFX.js} +12 -12
- package/dist/{chunk-CRHPCPZP.js → chunk-4KC4CHKJ.js} +2 -2
- package/dist/{chunk-4VDHLCF5.js → chunk-4WJBWKMI.js} +2 -2
- package/dist/{chunk-KBUTSJSR.js → chunk-4XBYHXGK.js} +2 -2
- package/dist/{chunk-6W75D37F.js → chunk-53P775GE.js} +6 -3
- package/dist/{chunk-XZWSP67B.js → chunk-5APYAXCB.js} +2 -2
- package/dist/{chunk-D65E25JG.js → chunk-67HPYNTJ.js} +2 -2
- package/dist/{chunk-5JQR5B4D.js → chunk-6KV4KCQZ.js} +4 -4
- package/dist/{chunk-V4XJWDHR.js → chunk-6UKFRTXI.js} +2 -1
- package/dist/{chunk-NDPF2N2L.js → chunk-7DW7CJW2.js} +2 -2
- package/dist/{chunk-5KQEUIWM.js → chunk-7LUEQODV.js} +4 -4
- package/dist/{chunk-LNOXCGN2.js → chunk-7UFDIOBT.js} +3 -3
- package/dist/{chunk-DXSETN72.js → chunk-7WUGNN43.js} +2 -2
- package/dist/{chunk-V35KZDUZ.js → chunk-AA3GRZWS.js} +2 -2
- package/dist/{chunk-X4CEFOSG.js → chunk-ADO3OQIC.js} +4 -4
- package/dist/{chunk-UX2L5CUD.js → chunk-AI36V3ON.js} +3 -3
- package/dist/{chunk-B7GY6QER.js → chunk-B26OUMJW.js} +2 -2
- package/dist/{chunk-LAR7DX5E.js → chunk-B5TASTCK.js} +153 -62
- package/dist/{chunk-TGWZXJ7L.js → chunk-BEMQK5Q7.js} +92 -84
- package/dist/{chunk-RNDCROSG.js → chunk-CNXU7TR2.js} +3 -3
- package/dist/{chunk-3JLTRPN7.js → chunk-CVMUXT64.js} +35 -66
- package/dist/{chunk-733ZBT5P.js → chunk-E74MJF6G.js} +4 -4
- package/dist/{chunk-T2MDZES3.js → chunk-EBMTBE76.js} +3 -3
- package/dist/{chunk-OZ76TLGU.js → chunk-EEITU7S6.js} +2 -2
- package/dist/{chunk-GRHOXDKB.js → chunk-ELDJWJKM.js} +97 -14
- package/dist/{chunk-GCQFN7YI.js → chunk-EMYEQLWO.js} +2 -2
- package/dist/{chunk-LTWH2ACR.js → chunk-EQPFEDFV.js} +222 -127
- package/dist/{chunk-TDGYTWM6.js → chunk-F4I3H56H.js} +2 -2
- package/dist/chunk-F6KCJO3U.js +523 -0
- package/dist/{chunk-FGSQHUCK.js → chunk-F6VKWTTY.js} +5 -5
- package/dist/{chunk-UJD5MPP6.js → chunk-FLNXQQ5B.js} +2 -2
- package/dist/{chunk-EX57VVWW.js → chunk-FOSRJ2VZ.js} +4 -4
- package/dist/{chunk-ZARZ4POR.js → chunk-G5ZDQQE3.js} +3 -3
- package/dist/{chunk-HQVN7G4F.js → chunk-G62JBPXN.js} +7 -7
- package/dist/{chunk-ZJPORZTC.js → chunk-GIAI7A2K.js} +2 -2
- package/dist/chunk-GPTR6OTU.js +2551 -0
- package/dist/{chunk-EZD2BXGP.js → chunk-GUFQPTQK.js} +2 -2
- package/dist/{chunk-OPD7GL6F.js → chunk-H6FQVNZC.js} +8 -7
- package/dist/chunk-H7REJ7L5.js +80 -0
- package/dist/{chunk-EYTLV3W3.js → chunk-HTWTORF7.js} +2 -2
- package/dist/{chunk-DF6PI6GN.js → chunk-I6UKQPGS.js} +3 -3
- package/dist/{chunk-ISHUS7HC.js → chunk-JRW236JT.js} +3 -3
- package/dist/{chunk-DE2LU267.js → chunk-KKAJGT3B.js} +3 -2
- package/dist/{chunk-OV62D6KO.js → chunk-KQMYL5GR.js} +3 -3
- package/dist/{chunk-QDUUOZ3S.js → chunk-KWMFC7FN.js} +3 -3
- package/dist/{chunk-R7FGRZNF.js → chunk-LXYHCCIZ.js} +9 -9
- package/dist/{chunk-NFSK2VNU.js → chunk-LZMTVVN4.js} +2 -2
- package/dist/{chunk-62UK7AGW.js → chunk-M5PMRZSR.js} +397 -44
- package/dist/chunk-MMZMM6SW.js +131 -0
- package/dist/{chunk-FFYTC2KQ.js → chunk-MNABNEBX.js} +2 -2
- package/dist/{chunk-XMDBTYCH.js → chunk-N3CWOGVF.js} +3 -3
- package/dist/{chunk-VYRQHORQ.js → chunk-NMQSO6Z6.js} +4 -3
- package/dist/{chunk-R2UUNSNQ.js → chunk-O3ZAF7UY.js} +18 -5
- package/dist/{chunk-4SYHGVDE.js → chunk-OQNCLZI4.js} +4 -4
- package/dist/{chunk-EG4ARXPC.js → chunk-OX6QTA4N.js} +3 -3
- package/dist/{chunk-P4GNZPXO.js → chunk-OYUS3UZP.js} +2 -2
- package/dist/{chunk-OQ2EOAHA.js → chunk-PF36KOGI.js} +291 -112
- package/dist/{chunk-55RMDDFM.js → chunk-PGQG7ZMW.js} +2 -2
- package/dist/{chunk-CBAQPTDU.js → chunk-PIU6BXXW.js} +2 -2
- package/dist/{chunk-EKV4UBCM.js → chunk-PZBQUJ2F.js} +2 -2
- package/dist/{chunk-7RET77VB.js → chunk-Q2HKY32Y.js} +2 -2
- package/dist/{chunk-U6YTUVOX.js → chunk-Q4RMNWMZ.js} +4 -4
- package/dist/chunk-Q6FRR3AQ.js +48 -0
- package/dist/{chunk-6RJMYYIE.js → chunk-QJSIAJBY.js} +3 -3
- package/dist/{chunk-DOUISWEE.js → chunk-QOJ4ERMU.js} +5 -5
- package/dist/{chunk-IFPDAD7R.js → chunk-RWSRKXLT.js} +3 -3
- package/dist/{chunk-T33IYTZM.js → chunk-SAASVMIY.js} +3 -3
- package/dist/{chunk-2DTIWSAW.js → chunk-SEQDH6JC.js} +3 -3
- package/dist/{chunk-BRCOSE7O.js → chunk-SZUO5BSE.js} +2 -2
- package/dist/{chunk-HOEDA42N.js → chunk-T7HZ7KJF.js} +2 -2
- package/dist/{chunk-OJXOA6YU.js → chunk-TL6LNERH.js} +2 -2
- package/dist/{chunk-UCINIRHW.js → chunk-TPCZXWLT.js} +3 -3
- package/dist/{chunk-ZUKUCZYZ.js → chunk-TQ2KTH4A.js} +2 -2
- package/dist/{chunk-4WOOTKFD.js → chunk-U3FETNQB.js} +341 -20
- package/dist/{chunk-5B3RTYAK.js → chunk-UGDSB4AN.js} +2 -2
- package/dist/{chunk-VKHLUZNO.js → chunk-UZ7YBL43.js} +3 -3
- package/dist/{chunk-QNUQ7K7D.js → chunk-VKMSEO7Y.js} +4 -4
- package/dist/{chunk-IN7DGBVS.js → chunk-VLX5VZ35.js} +5 -5
- package/dist/{chunk-SJGS3GDI.js → chunk-WAGBMMNX.js} +5 -5
- package/dist/{chunk-BFOSV5EZ.js → chunk-WX2YCH7F.js} +2 -2
- package/dist/{chunk-3LT34CAM.js → chunk-XBIGUILU.js} +32 -17
- package/dist/{chunk-XDHUDE5K.js → chunk-XKYBFRWR.js} +5 -5
- package/dist/{chunk-U5QU5ZOD.js → chunk-XYPWFSU5.js} +3 -3
- package/dist/{chunk-YBUECLAF.js → chunk-YEJQDODA.js} +2 -2
- package/dist/{chunk-YQ6XEFVK.js → chunk-Z74OGONW.js} +39 -7
- package/dist/{chunk-I4ELN5BX.js → chunk-ZTNOEJRI.js} +2 -2
- package/dist/cli/index.js +26 -26
- package/dist/{clio-K2PBVCEM.js → clio-4IKFE25F.js} +2 -2
- package/dist/{clio-context-tools-GR4OHFSO.js → clio-context-tools-OHJXYX4R.js} +25 -23
- package/dist/{code-nav-4X3OI6DK.js → code-nav-XPM3MY5I.js} +7 -7
- package/dist/{config-Q5J7UBAB.js → config-343YS25T.js} +43 -41
- package/dist/{config-graph-P3555574.js → config-graph-WI263KDX.js} +43 -41
- package/dist/{configure-KIJ32ZO6.js → configure-GZDG4HER.js} +21 -21
- package/dist/{context-LFBQOSXT.js → context-4OFO7N7Y.js} +12 -12
- package/dist/{context-WBH3KSVR.js → context-JLK2RLOG.js} +42 -40
- package/dist/{context-NNLBES2Y.js → context-O6DIWCF6.js} +23 -21
- package/dist/{context-clear-YOHMQ6SQ.js → context-clear-MR7KOGQI.js} +42 -40
- package/dist/{context-working-set-MRAEVDNV.js → context-working-set-YZAD3KWO.js} +14 -13
- package/dist/{data-tool-JJPBGMQJ.js → data-tool-EKD7DFHG.js} +7 -7
- package/dist/{detail-RHJOTGN4.js → detail-YZPHFEVJ.js} +43 -41
- package/dist/{dispatch-runner-NC7PYNIO.js → dispatch-runner-VKVXVTWJ.js} +44 -42
- package/dist/{doctor-S5KZ2GTN.js → doctor-53AVQXAO.js} +17 -16
- package/dist/{doctor-deep-2EJQSHIZ.js → doctor-deep-BLRB2NCG.js} +5 -5
- package/dist/{eval-3D6M36N7.js → eval-P3BQSLQE.js} +21 -20
- package/dist/{evidence-XNVPPLVK.js → evidence-6LLI6SZH.js} +44 -42
- package/dist/{evidence-6IYN52ET.js → evidence-HTN3JLUO.js} +42 -40
- package/dist/{evidence-JVECPI3F.js → evidence-NJRE3R5H.js} +42 -40
- package/dist/{evolve-TLPUDJDM.js → evolve-WWZHJVJP.js} +42 -40
- package/dist/{fleet-WKVBF5SZ.js → fleet-GGZ4BVJE.js} +64 -62
- package/dist/{fleet-6RJWIOEO.js → fleet-QG3IIWWM.js} +44 -42
- package/dist/{fleet-commands-L6WFT7KZ.js → fleet-commands-J2ZIKISQ.js} +7 -7
- package/dist/{fleet-decisions-BTQMWU5A.js → fleet-decisions-Y2Q7375Q.js} +8 -8
- package/dist/{fleet-graph-553DZ67Q.js → fleet-graph-TCBCCCBP.js} +11 -11
- package/dist/{fleet-inspect-236FZPRB.js → fleet-inspect-KOLKBC56.js} +44 -42
- package/dist/{fleet-preflight-NZQHABWO.js → fleet-preflight-44UNCC4Y.js} +27 -25
- package/dist/{fleet-validate-7NLAE26R.js → fleet-validate-K2FXRZVA.js} +13 -13
- package/dist/{fleet-verify-E3RO6A5W.js → fleet-verify-AS444WDW.js} +42 -40
- package/dist/{fleet-view-KMZQY7YJ.js → fleet-view-X4JU4J6O.js} +43 -41
- package/dist/gui/ops-worker.js +9 -9
- package/dist/gui/reads-worker.js +9 -8
- package/dist/{init-DV5B6HQG.js → init-VSOWFHVL.js} +54 -52
- package/dist/{interactive-OXGYZYAS.js → interactive-JRCBENLZ.js} +1733 -577
- package/dist/{interop-J7UOBOSF.js → interop-JR6BCY7R.js} +10 -10
- package/dist/{inventory-OEGIL6PY.js → inventory-3JUGLVJI.js} +43 -41
- package/dist/{library-ROZAMUIL.js → library-7BOH3Y7N.js} +15 -15
- package/dist/{library-B3UPGY4V.js → library-7PFONXUI.js} +9 -9
- package/dist/{library-MXQA5DLT.js → library-TUYZMFIA.js} +7 -7
- package/dist/{library-import-2LTWOVBD.js → library-import-TJVXKLDK.js} +10 -10
- package/dist/{library-inventory-LJ3XHLWO.js → library-inventory-MD3AYTP4.js} +9 -9
- package/dist/{library-validation-DARHHUNW.js → library-validation-ZDLITEA3.js} +7 -7
- package/dist/{mcp-2GSPYQ54.js → mcp-EFCWUPUR.js} +3 -3
- package/dist/{memory-J3STUUIK.js → memory-Q2YVOKK5.js} +42 -40
- package/dist/{models-Y3GMFJ2V.js → models-M7BOCW7F.js} +17 -16
- package/dist/{monitor-LHNH577J.js → monitor-2HD3MC67.js} +47 -45
- package/dist/{orchestrator-DTAPXULA.js → orchestrator-OUW3ZN6Y.js} +1894 -226
- package/dist/{panes-A743ONZ5.js → panes-TTPPSYCL.js} +3 -3
- package/dist/{preload-OJBMAIXF.js → preload-A47C2NUF.js} +42 -40
- package/dist/{providers-CMETPZNS.js → providers-T43W7EL4.js} +4 -4
- package/dist/{resources-FY6XYFN2.js → resources-TP6X2V6W.js} +20 -11
- package/dist/{run-H64MEVTA.js → run-LDSBPMCS.js} +61 -59
- package/dist/{share-CAFMMQLM.js → share-URHKKMHR.js} +9 -9
- package/dist/{skills-ERKQUC7L.js → skills-E477MOOO.js} +13 -11
- package/dist/{skills-eval-CQ23MYQK.js → skills-eval-AIBR2L7H.js} +583 -93
- package/dist/{skills-inventory-TVUYJDVN.js → skills-inventory-HLMKY3R5.js} +13 -11
- package/dist/{slash-commands-ROG3KIFJ.js → slash-commands-LIIZKA5Y.js} +28 -26
- package/dist/{startup-background-KDWCQMWT.js → startup-background-JR2KDK6R.js} +43 -41
- package/dist/{steer-KKYXJSH4.js → steer-D7RTAPCM.js} +3 -3
- package/dist/{system-ZDW44ZGX.js → system-X2P5N4IY.js} +14 -13
- package/dist/{targets-AJWA6E7Z.js → targets-VFFAKUFM.js} +25 -24
- package/dist/{tasks-6L2JJRC5.js → tasks-ERAWZA22.js} +6 -6
- package/dist/{terminal-lease-YFUSDPAD.js → terminal-lease-V2N2BIKQ.js} +2 -2
- package/dist/{trace-LA5MVR4Y.js → trace-MA5BT7XY.js} +3 -3
- package/dist/{usage-XSILDHKF.js → usage-WYFY2L6M.js} +50 -48
- package/dist/{verifiers-ECA5GIHL.js → verifiers-TYIW2XKF.js} +7 -7
- package/dist/{verify-R6QQCCEB.js → verify-242UFYTP.js} +6 -6
- package/dist/{web-fetch-PVZNMBOB.js → web-fetch-LRAGYU6Y.js} +3 -3
- package/dist/{wiki-generate-RP22WP5K.js → wiki-generate-OFKOX2T6.js} +53 -51
- package/dist/worker/entry.js +31 -29
- package/docs/architecture/architecture.md +1 -0
- package/docs/architecture/context-engine.md +4 -2
- package/docs/architecture/observability.md +6 -4
- package/docs/architecture/prompt-envelope-and-tools.md +1 -1
- package/docs/architecture/session-lifecycle.md +1 -1
- package/docs/architecture/tui-design.md +12 -9
- package/docs/gui/parity/02-slash-and-surfaces.md +1 -1
- package/docs/guide/commands-and-modes.md +91 -5
- package/docs/guide/configuration-and-targets.md +2 -2
- package/docs/guide/context-continuity.md +49 -0
- package/docs/guide/proactive-memory.md +6 -3
- package/library/registry.yaml +292 -32
- package/library/skills/README.md +27 -2
- package/library/skills/context/context-handoff/SKILL.md +10 -4
- package/library/skills/meta/clio-coder-dev/SKILL.md +92 -88
- package/library/skills/meta/clio-coder-dev/evals.md +51 -46
- package/library/skills/meta/clio-coder-dev/plugin.json +2 -2
- package/library/skills/meta/clio-coder-dev/references/change-map.md +49 -0
- package/library/skills/meta/clio-coder-test/SKILL.md +89 -142
- package/library/skills/meta/clio-coder-test/evals.md +58 -62
- package/library/skills/meta/clio-coder-test/plugin.json +2 -2
- package/library/skills/meta/clio-coder-test/references/harness.md +3 -3
- package/library/skills/meta/clio-coder-test/references/lifecycle-validation.md +30 -0
- package/library/skills/meta/clio-coder-test/references/test-map.md +60 -89
- package/library/skills/registry.yaml +5 -5
- package/library/skills/skill-marketplace.json +12 -14
- package/package.json +1 -1
- package/src/cli/skills-eval.ts +1064 -54
- package/src/cli/usage.ts +2 -2
- package/src/core/clio-repo.ts +3 -0
- package/src/core/tool-names.ts +1 -0
- package/src/domains/context/budget/inspection.ts +9 -0
- package/src/domains/context/budget/live-view.ts +418 -0
- package/src/domains/context/budget/pressure.ts +393 -0
- package/src/domains/context/budget/request-fit.ts +15 -0
- package/src/domains/evidence/build.ts +24 -0
- package/src/domains/gateway/mcp/client.ts +1 -1
- package/src/domains/memory/commit-state.ts +160 -0
- package/src/domains/memory/operations.ts +18 -10
- package/src/domains/memory/prompt-cache.ts +95 -0
- package/src/domains/memory/prompt-section.ts +50 -7
- package/src/domains/memory/relevance.ts +93 -0
- package/src/domains/memory/restoration.ts +78 -0
- package/src/domains/memory/store.ts +39 -1
- package/src/domains/middleware/memory-intervention.ts +116 -24
- package/src/domains/observability/background-memory-usage.ts +1 -1
- package/src/domains/observability/cost.ts +3 -3
- package/src/domains/observability/extension.ts +1 -1
- package/src/domains/observability/metrics.ts +1 -1
- package/src/domains/prompts/compiler.ts +1 -1
- package/src/domains/prompts/extension.ts +38 -1
- package/src/domains/quota/anthropic-max-provider.ts +134 -0
- package/src/domains/quota/anthropic-usage.ts +220 -0
- package/src/domains/quota/antigravity-provider.ts +339 -0
- package/src/domains/quota/cache.ts +87 -0
- package/src/domains/quota/claude-code-provider.ts +169 -0
- package/src/domains/quota/codex-provider.ts +237 -0
- package/src/domains/quota/presentation.ts +240 -0
- package/src/domains/quota/registry.ts +23 -0
- package/src/domains/quota/service.ts +93 -0
- package/src/domains/quota/summary-feed.ts +86 -0
- package/src/domains/quota/types.ts +84 -0
- package/src/domains/resources/index.ts +11 -0
- package/src/domains/resources/skills/catalog-view.ts +571 -0
- package/src/domains/resources/skills/lexical-match.ts +136 -0
- package/src/domains/resources/skills/loader.ts +38 -0
- package/src/domains/resources/skills/promotion.ts +1 -55
- package/src/domains/resources/skills/provenance-pin.ts +50 -20
- package/src/domains/safety/action-classifier.ts +1 -0
- package/src/domains/session/compaction/branch-summary.ts +4 -1
- package/src/domains/session/compaction/compact.ts +18 -2
- package/src/domains/session/compaction/cut-point.ts +20 -1
- package/src/domains/session/compaction/tokens.ts +48 -3
- package/src/domains/session/context-accounting.ts +8 -1
- package/src/domains/session/continuity/carry.ts +59 -0
- package/src/domains/session/continuity/contract.ts +592 -0
- package/src/domains/session/continuity/evidence.ts +290 -0
- package/src/domains/session/continuity/fold.ts +1075 -0
- package/src/domains/session/continuity/note.ts +79 -0
- package/src/domains/session/continuity/operator-request.ts +104 -0
- package/src/domains/session/continuity/persistence.ts +408 -0
- package/src/domains/session/continuity/ports.ts +231 -0
- package/src/domains/session/continuity/projection.ts +538 -0
- package/src/domains/session/continuity/validate.ts +352 -0
- package/src/domains/session/entries.ts +50 -3
- package/src/domains/session/index.ts +48 -0
- package/src/domains/session/migrations/index.ts +7 -3
- package/src/domains/session/tree/fork.ts +15 -1
- package/src/domains/session/usage.ts +2 -2
- package/src/engine/acp/commands.ts +1 -1
- package/src/engine/agent.ts +133 -9
- package/src/engine/session.ts +13 -6
- package/src/entry/orchestrator.ts +116 -33
- package/src/interactive/chat-loop-messages.ts +2 -2
- package/src/interactive/chat-loop.ts +219 -63
- package/src/interactive/chat-renderer.ts +99 -8
- package/src/interactive/context-overlay.ts +24 -3
- package/src/interactive/continuity-controller.ts +526 -0
- package/src/interactive/dispatch-board.ts +21 -3
- package/src/interactive/footer/dashboard.ts +25 -1
- package/src/interactive/footer/key-hints.ts +2 -2
- package/src/interactive/footer/pages.ts +70 -27
- package/src/interactive/footer/widgets.ts +32 -7
- package/src/interactive/footer-panel.ts +1 -1
- package/src/interactive/interactive-application.ts +7 -2
- package/src/interactive/interactive-input-runtime.ts +2 -2
- package/src/interactive/interactive-presentation.ts +15 -0
- package/src/interactive/interactive-slash-runtime.ts +45 -8
- package/src/interactive/interactive-tickers.ts +7 -1
- package/src/interactive/model-session-replay.ts +130 -3
- package/src/interactive/output-reserve.ts +35 -0
- package/src/interactive/overlay-general-openers.ts +12 -8
- package/src/interactive/overlay-key-routing.ts +6 -9
- package/src/interactive/overlay-lifecycle.ts +10 -6
- package/src/interactive/overlay-session-lifecycle.ts +21 -14
- package/src/interactive/quota-view.ts +229 -0
- package/src/interactive/session-last-turn.ts +1 -1
- package/src/interactive/session-transcript.ts +2 -1
- package/src/interactive/session-usage-reseed.ts +2 -2
- package/src/interactive/side-question.ts +2 -2
- package/src/interactive/slash-commands.ts +28 -9
- package/src/interactive/turn-context.ts +686 -63
- package/src/interactive/turn-middleware.ts +39 -6
- package/src/interactive/turn-persistence.ts +15 -2
- package/src/interactive/turn-prewarm.ts +1 -1
- package/src/interactive/turn-runtime.ts +48 -5
- package/src/interactive/{cost-overlay.ts → usage-overlay.ts} +121 -33
- package/src/interactive/welcome-dashboard.ts +26 -3
- package/src/tools/agent-tools.ts +3 -1
- package/src/tools/bootstrap.ts +6 -0
- package/src/tools/builtin-tool-catalog.ts +9 -0
- package/src/tools/context/index.ts +148 -113
- package/src/tools/context/surface.ts +11 -7
- package/src/tools/core-bootstrap.ts +4 -0
- package/src/tools/observation.ts +8 -2
- package/src/tools/policy.ts +3 -0
- package/src/tools/self-compact.ts +31 -0
- package/src/tools/surface.ts +1 -0
- package/src/tools/tasks.ts +1 -1
- package/dist/chunk-CTFPFW3H.js +0 -44
- package/dist/chunk-EOJPDNUP.js +0 -1325
- package/dist/chunk-I4Y4WKZR.js +0 -386
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-L7G7K4I2.js";
|
|
5
5
|
import {
|
|
6
6
|
ToolNames
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6UKFRTXI.js";
|
|
8
8
|
import {
|
|
9
9
|
typebox_exports
|
|
10
10
|
} from "./chunk-GH5ZR6JP.js";
|
|
@@ -46,4 +46,4 @@ export {
|
|
|
46
46
|
clioDocsToolSurface,
|
|
47
47
|
clioLibraryToolSurface
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-F4I3H56H.js.map
|
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
AUTONOMY_EXPOSURES
|
|
4
|
+
} from "./chunk-UZVYEF57.js";
|
|
5
|
+
import {
|
|
6
|
+
isSkillActivation
|
|
7
|
+
} from "./chunk-MMZMM6SW.js";
|
|
8
|
+
import {
|
|
9
|
+
init_esm_shims
|
|
10
|
+
} from "./chunk-ECBHH7LU.js";
|
|
11
|
+
|
|
12
|
+
// src/domains/session/continuity/operator-request.ts
|
|
13
|
+
init_esm_shims();
|
|
14
|
+
var HANDOFF_RECOVERY_REQUEST_CUSTOM_TYPE = "contextHandoffRecoveryRequest";
|
|
15
|
+
function isRecord(value) {
|
|
16
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
17
|
+
}
|
|
18
|
+
function isNonEmptyString(value) {
|
|
19
|
+
return typeof value === "string" && value.length > 0;
|
|
20
|
+
}
|
|
21
|
+
function isNullableString(value) {
|
|
22
|
+
return value === null || isNonEmptyString(value);
|
|
23
|
+
}
|
|
24
|
+
function isHandoffRecoveryRequestData(value) {
|
|
25
|
+
if (!isRecord(value)) return false;
|
|
26
|
+
return value.version === 1 && value.requestKind === "handoff_recovery" && isNonEmptyString(value.handoffId) && (value.action === "reduce" || value.action === "deliver") && isNonEmptyString(value.sessionId) && Object.hasOwn(value, "branchAnchorTurnId") && isNullableString(value.branchAnchorTurnId) && Object.hasOwn(value, "selectedLeafTurnId") && isNullableString(value.selectedLeafTurnId) && isNonEmptyString(value.pausedOrFailedEntryId);
|
|
27
|
+
}
|
|
28
|
+
function isHandoffRecoveryRequestEntry(value) {
|
|
29
|
+
if (!isRecord(value)) return false;
|
|
30
|
+
return value.kind === "custom" && value.customType === HANDOFF_RECOVERY_REQUEST_CUSTOM_TYPE && isNonEmptyString(value.turnId) && isNullableString(value.parentTurnId) && isNonEmptyString(value.timestamp) && // §3.1 specifies `display: false`. A control record that renders is a
|
|
31
|
+
// different thing from the one the contract adopted, and the flag is part
|
|
32
|
+
// of the adopted envelope rather than a presentation preference: an
|
|
33
|
+
// authority carrier must not also be transcript text.
|
|
34
|
+
value.display === false && isHandoffRecoveryRequestData(value.data);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// src/domains/session/continuity/contract.ts
|
|
38
|
+
init_esm_shims();
|
|
39
|
+
var HANDOFF_SCHEMA_VERSION = 1;
|
|
40
|
+
var HANDOFF_NOTE_MAX_BYTES = 8192;
|
|
41
|
+
var HANDOFF_MAX_WINDOW_MS = 9e5;
|
|
42
|
+
var HANDOFF_POLICY_LIMITS = Object.freeze({
|
|
43
|
+
maxAttempts: 2,
|
|
44
|
+
maxSummaryCallsPerAttempt: 2,
|
|
45
|
+
additionalSummaryRetriesPerCall: 0,
|
|
46
|
+
maxSummaryStreamInvocations: 4,
|
|
47
|
+
flushRetryLimit: 3
|
|
48
|
+
});
|
|
49
|
+
var HANDOFF_MAX_FLUSH_RETRIES = 3;
|
|
50
|
+
|
|
51
|
+
// src/domains/session/continuity/validate.ts
|
|
52
|
+
init_esm_shims();
|
|
53
|
+
var OUTCOMES = /* @__PURE__ */ new Set(["summarized", "evicted", "continuity_only"]);
|
|
54
|
+
var PAUSE_REASONS = /* @__PURE__ */ new Set([
|
|
55
|
+
"operator_cancelled",
|
|
56
|
+
"origin_changed",
|
|
57
|
+
"delivery_uncertain"
|
|
58
|
+
]);
|
|
59
|
+
var FAILURE_REASONS = /* @__PURE__ */ new Set([
|
|
60
|
+
"invalid_note",
|
|
61
|
+
"note_exceeds_replay_budget",
|
|
62
|
+
"budget_unsafe_no_material",
|
|
63
|
+
"durability_unresolved",
|
|
64
|
+
"state_root_removed",
|
|
65
|
+
"origin_changed",
|
|
66
|
+
"provider_failed",
|
|
67
|
+
"attempts_exhausted",
|
|
68
|
+
"deadline_exceeded"
|
|
69
|
+
]);
|
|
70
|
+
function isRecord2(value) {
|
|
71
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
72
|
+
}
|
|
73
|
+
function isNonEmptyString2(value) {
|
|
74
|
+
return typeof value === "string" && value.length > 0;
|
|
75
|
+
}
|
|
76
|
+
function isNullableString2(value) {
|
|
77
|
+
return value === null || isNonEmptyString2(value);
|
|
78
|
+
}
|
|
79
|
+
function isFiniteInteger(value) {
|
|
80
|
+
return typeof value === "number" && Number.isSafeInteger(value);
|
|
81
|
+
}
|
|
82
|
+
function isNonNegativeInteger(value) {
|
|
83
|
+
return isFiniteInteger(value) && value >= 0;
|
|
84
|
+
}
|
|
85
|
+
function isPositiveInteger(value) {
|
|
86
|
+
return isFiniteInteger(value) && value > 0;
|
|
87
|
+
}
|
|
88
|
+
function hasEntryEnvelope(value, kind) {
|
|
89
|
+
if (!isRecord2(value)) return false;
|
|
90
|
+
return value.kind === kind && isNonEmptyString2(value.turnId) && isNullableString2(value.parentTurnId) && isNonEmptyString2(value.timestamp);
|
|
91
|
+
}
|
|
92
|
+
function isAcceptedNote(value) {
|
|
93
|
+
if (!isRecord2(value)) return false;
|
|
94
|
+
return typeof value.note === "string" && value.note.length > 0 && isPositiveInteger(value.noteBytes) && value.noteBytes <= HANDOFF_NOTE_MAX_BYTES && typeof value.noteSha256 === "string" && /^[0-9a-f]{64}$/.test(value.noteSha256);
|
|
95
|
+
}
|
|
96
|
+
function isHandoffIdentity(value) {
|
|
97
|
+
if (!isRecord2(value)) return false;
|
|
98
|
+
return isNonEmptyString2(value.handoffId) && isNonEmptyString2(value.preparedEntryId) && isNonEmptyString2(value.commitId) && isNonEmptyString2(value.commitEntryId) && isNonEmptyString2(value.originSessionId) && isNullableString2(value.branchAnchorTurnId) && isNonEmptyString2(value.initiatingTurnId) && isNonEmptyString2(value.toolCallId) && typeof value.sourceRevision === "string";
|
|
99
|
+
}
|
|
100
|
+
function isHandoffPolicy(value) {
|
|
101
|
+
if (!isRecord2(value)) return false;
|
|
102
|
+
if (!isNonNegativeInteger(value.preparedAtMs)) return false;
|
|
103
|
+
if (!isPositiveInteger(value.automaticDeadlineAtMs)) return false;
|
|
104
|
+
if (value.automaticDeadlineAtMs <= value.preparedAtMs) return false;
|
|
105
|
+
if (!isPositiveInteger(value.maxAttempts) || value.maxAttempts > HANDOFF_POLICY_LIMITS.maxAttempts) return false;
|
|
106
|
+
if (!isPositiveInteger(value.maxSummaryCallsPerAttempt) || value.maxSummaryCallsPerAttempt > HANDOFF_POLICY_LIMITS.maxSummaryCallsPerAttempt) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
if (value.additionalSummaryRetriesPerCall !== HANDOFF_POLICY_LIMITS.additionalSummaryRetriesPerCall) return false;
|
|
110
|
+
if (!isPositiveInteger(value.maxSummaryStreamInvocations) || value.maxSummaryStreamInvocations > HANDOFF_POLICY_LIMITS.maxSummaryStreamInvocations) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
return isNonNegativeInteger(value.flushRetryLimit) && value.flushRetryLimit <= HANDOFF_POLICY_LIMITS.flushRetryLimit;
|
|
114
|
+
}
|
|
115
|
+
function canonicalJson(value) {
|
|
116
|
+
if (value === void 0) return "undefined";
|
|
117
|
+
if (value === null || typeof value !== "object") return JSON.stringify(value) ?? "undefined";
|
|
118
|
+
if (Array.isArray(value)) return `[${value.map(canonicalJson).join(",")}]`;
|
|
119
|
+
const fields = Object.entries(value).filter(([, field]) => field !== void 0).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
120
|
+
return `{${fields.map(([key, field]) => `${JSON.stringify(key)}:${canonicalJson(field)}`).join(",")}}`;
|
|
121
|
+
}
|
|
122
|
+
function isTransitionLink(value) {
|
|
123
|
+
if (!isRecord2(value)) return false;
|
|
124
|
+
return isNonEmptyString2(value.entryId) && isNullableString2(value.prevEntryId) && isNonNegativeInteger(value.sequence) && isNonNegativeInteger(value.attempt);
|
|
125
|
+
}
|
|
126
|
+
function isResumeAuthority(value) {
|
|
127
|
+
if (!isRecord2(value)) return false;
|
|
128
|
+
return isNonEmptyString2(value.operatorRequestEntryId) && isNonEmptyString2(value.pausedOrFailedEntryId) && (value.action === "reduce" || value.action === "deliver") && isPositiveInteger(value.automaticDeadlineAtMs);
|
|
129
|
+
}
|
|
130
|
+
function isHandoffEvent(value) {
|
|
131
|
+
if (!isRecord2(value)) return false;
|
|
132
|
+
switch (value.phase) {
|
|
133
|
+
case "prepared":
|
|
134
|
+
return isAcceptedNote(value.accepted) && isHandoffPolicy(value.policy);
|
|
135
|
+
case "reducing":
|
|
136
|
+
return value.resumeRef === void 0 || isNonEmptyString2(value.resumeRef);
|
|
137
|
+
case "delivered":
|
|
138
|
+
return isNonEmptyString2(value.deliveryId) && isNonEmptyString2(value.continuationTurnId) && (value.resumeRef === void 0 || isNonEmptyString2(value.resumeRef));
|
|
139
|
+
case "acknowledged":
|
|
140
|
+
return isNonEmptyString2(value.deliveryId) && isNonEmptyString2(value.terminalResponseEntryId);
|
|
141
|
+
case "paused":
|
|
142
|
+
return typeof value.reason === "string" && PAUSE_REASONS.has(value.reason);
|
|
143
|
+
case "failed":
|
|
144
|
+
return typeof value.reason === "string" && FAILURE_REASONS.has(value.reason);
|
|
145
|
+
case "resumed":
|
|
146
|
+
return isResumeAuthority(value.authority);
|
|
147
|
+
default:
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function isHandoffTransactionEntry(value) {
|
|
152
|
+
if (!hasEntryEnvelope(value, "handoffTransaction")) return false;
|
|
153
|
+
if (value.schemaVersion !== HANDOFF_SCHEMA_VERSION) return false;
|
|
154
|
+
if (!isHandoffIdentity(value.identity)) return false;
|
|
155
|
+
if (!isTransitionLink(value.transition)) return false;
|
|
156
|
+
if (!isHandoffEvent(value.event)) return false;
|
|
157
|
+
if (value.transition.entryId !== value.turnId) return false;
|
|
158
|
+
if (value.event.phase === "prepared") {
|
|
159
|
+
return value.transition.entryId === value.identity.preparedEntryId && value.transition.prevEntryId === null && value.transition.sequence === 0 && value.transition.attempt === 0;
|
|
160
|
+
}
|
|
161
|
+
return value.transition.prevEntryId !== null && value.transition.sequence > 0;
|
|
162
|
+
}
|
|
163
|
+
function isCommitData(value) {
|
|
164
|
+
if (!isRecord2(value)) return false;
|
|
165
|
+
if (typeof value.outcome !== "string" || !OUTCOMES.has(value.outcome)) return false;
|
|
166
|
+
if (!isRecord2(value.entry)) return false;
|
|
167
|
+
if (!isNonEmptyString2(value.entry.turnId)) return false;
|
|
168
|
+
if (!isNullableString2(value.entry.parentTurnId)) return false;
|
|
169
|
+
if (!isNonEmptyString2(value.entry.timestamp)) return false;
|
|
170
|
+
if (!isTransitionLink(value.transition)) return false;
|
|
171
|
+
if (value.transition.entryId !== value.entry.turnId) return false;
|
|
172
|
+
if (!isNonNegativeInteger(value.tokensBefore) || !isNonNegativeInteger(value.tokensAfter)) return false;
|
|
173
|
+
if (value.outcome === "summarized") {
|
|
174
|
+
return isNonEmptyString2(value.summaryRef) && value.evictionRef === void 0;
|
|
175
|
+
}
|
|
176
|
+
if (value.outcome === "evicted") {
|
|
177
|
+
return isNonEmptyString2(value.evictionRef) && value.summaryRef === void 0;
|
|
178
|
+
}
|
|
179
|
+
return value.summaryRef === void 0 && value.evictionRef === void 0;
|
|
180
|
+
}
|
|
181
|
+
function isCarriedState(value) {
|
|
182
|
+
if (!isRecord2(value)) return false;
|
|
183
|
+
if (!isTransitionLink(value.transition)) return false;
|
|
184
|
+
if (!isRecord2(value.event)) return false;
|
|
185
|
+
if (value.event.phase !== "ready" && !isHandoffEvent(value.event)) return false;
|
|
186
|
+
if (value.event.phase === "ready" && Object.keys(value.event).length !== 1) return false;
|
|
187
|
+
if (value.activeResume !== null) {
|
|
188
|
+
if (!isRecord2(value.activeResume)) return false;
|
|
189
|
+
if (!isNonEmptyString2(value.activeResume.entryId)) return false;
|
|
190
|
+
if (!isResumeAuthority(value.activeResume.authority)) return false;
|
|
191
|
+
}
|
|
192
|
+
if (value.delivery !== null) {
|
|
193
|
+
if (!isRecord2(value.delivery)) return false;
|
|
194
|
+
if (!isNonEmptyString2(value.delivery.deliveryId)) return false;
|
|
195
|
+
if (!isNonEmptyString2(value.delivery.continuationTurnId)) return false;
|
|
196
|
+
}
|
|
197
|
+
if (value.event.phase === "resumed") {
|
|
198
|
+
const resume = value.activeResume;
|
|
199
|
+
if (!isRecord2(resume)) return false;
|
|
200
|
+
if (resume.entryId !== value.transition.entryId) return false;
|
|
201
|
+
if (canonicalJson(resume.authority) !== canonicalJson(value.event.authority)) return false;
|
|
202
|
+
}
|
|
203
|
+
if (value.event.phase === "delivered") {
|
|
204
|
+
const delivery = value.delivery;
|
|
205
|
+
if (!isRecord2(delivery)) return false;
|
|
206
|
+
if (delivery.deliveryId !== value.event.deliveryId) return false;
|
|
207
|
+
if (delivery.continuationTurnId !== value.event.continuationTurnId) return false;
|
|
208
|
+
}
|
|
209
|
+
return true;
|
|
210
|
+
}
|
|
211
|
+
function isContinuityCheckpointPayload(value) {
|
|
212
|
+
if (!isRecord2(value)) return false;
|
|
213
|
+
if (value.schemaVersion !== HANDOFF_SCHEMA_VERSION) return false;
|
|
214
|
+
if (!isHandoffIdentity(value.identity)) return false;
|
|
215
|
+
if (!isAcceptedNote(value.accepted)) return false;
|
|
216
|
+
if (!isHandoffPolicy(value.policy)) return false;
|
|
217
|
+
if (!isCommitData(value.commit)) return false;
|
|
218
|
+
if (!isCarriedState(value.state)) return false;
|
|
219
|
+
if (value.commit.entry.turnId !== value.identity.commitEntryId) return false;
|
|
220
|
+
if (value.commit.transition.attempt < 1 || value.commit.transition.attempt > value.policy.maxAttempts) return false;
|
|
221
|
+
if (value.state.transition.attempt > value.policy.maxAttempts) return false;
|
|
222
|
+
if (value.state.transition.sequence < value.commit.transition.sequence) return false;
|
|
223
|
+
if (value.state.event.phase === "ready") {
|
|
224
|
+
return canonicalJson(value.state.transition) === canonicalJson(value.commit.transition);
|
|
225
|
+
}
|
|
226
|
+
return value.state.transition.attempt >= value.commit.transition.attempt;
|
|
227
|
+
}
|
|
228
|
+
function isContinuityCommitEntry(value) {
|
|
229
|
+
if (!hasEntryEnvelope(value, "continuityCommit")) return false;
|
|
230
|
+
if (!isContinuityCheckpointPayload(value.continuity)) return false;
|
|
231
|
+
const payload = value.continuity;
|
|
232
|
+
if (payload.state.event.phase !== "ready") return false;
|
|
233
|
+
if (payload.state.activeResume !== null || payload.state.delivery !== null) return false;
|
|
234
|
+
return value.turnId === payload.commit.entry.turnId && value.parentTurnId === payload.commit.entry.parentTurnId && value.timestamp === payload.commit.entry.timestamp;
|
|
235
|
+
}
|
|
236
|
+
function isContinuityCarryingSummary(value) {
|
|
237
|
+
if (!hasEntryEnvelope(value, "compactionSummary")) return false;
|
|
238
|
+
return isContinuityCheckpointPayload(value.continuity);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// src/domains/session/entries.ts
|
|
242
|
+
init_esm_shims();
|
|
243
|
+
import { createHash } from "node:crypto";
|
|
244
|
+
var SKILL_CONTEXT_STATE = "skillContextState";
|
|
245
|
+
function skillContextContentHash(content) {
|
|
246
|
+
return createHash("sha256").update(JSON.stringify(content)).digest("hex");
|
|
247
|
+
}
|
|
248
|
+
function isSkillContextState(value) {
|
|
249
|
+
return isRecord3(value) && value.version === 1 && (value.unknown === void 0 || value.unknown === true) && Array.isArray(value.activationRefs) && value.activationRefs.every((ref) => typeof ref === "string");
|
|
250
|
+
}
|
|
251
|
+
function isSkillContextCheckpoint(value) {
|
|
252
|
+
return isRecord3(value) && value.version === 1 && Array.isArray(value.skills) && value.skills.every(
|
|
253
|
+
(skill) => isRecord3(skill) && [skill.activationRef, skill.requestRef, skill.callRef, skill.resultRef, skill.requestText, skill.contentHash].every(
|
|
254
|
+
isString
|
|
255
|
+
) && isSkillActivation(skill.activation) && Array.isArray(skill.content) && skill.content.every((block) => isRecord3(block) && block.type === "text" && typeof block.text === "string")
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
function verifiedSkillContextCheckpoint(value) {
|
|
259
|
+
if (!isSkillContextCheckpoint(value)) return false;
|
|
260
|
+
const refs = /* @__PURE__ */ new Set();
|
|
261
|
+
const names = /* @__PURE__ */ new Set();
|
|
262
|
+
return value.skills.every((skill) => {
|
|
263
|
+
const activation = skill.activation;
|
|
264
|
+
if (![skill.activationRef, skill.requestRef, skill.callRef, skill.resultRef].every((ref) => ref.length > 0) || activation.runId !== void 0 || activation.triggeredBy !== "tool" || activation.turnId !== skill.requestRef || !activation.name || !activation.filePath || !activation.source || !activation.sourceOrigin || !/^[a-f0-9]{64}$/.test(activation.hash) || activation.drift !== void 0 && activation.drift !== "match" || skill.content.length === 0 || skill.content.every((block) => block.text.length === 0) || skill.contentHash !== skillContextContentHash(skill.content) || refs.has(skill.activationRef) || names.has(activation.name))
|
|
265
|
+
return false;
|
|
266
|
+
refs.add(skill.activationRef);
|
|
267
|
+
names.add(activation.name);
|
|
268
|
+
return true;
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
function isPreservedUserContext(value) {
|
|
272
|
+
return isRecord3(value) && isString(value.turnId) && isString(value.text);
|
|
273
|
+
}
|
|
274
|
+
function mainSkillContextState(entries, policy) {
|
|
275
|
+
if (!policy) return latestSkillContextState(entries);
|
|
276
|
+
if (policy.modelActivation === true && policy.carriedSurface !== true && policy.requests.length === 0 && policy.loadedSkillNames.size === 0 && policy.loadedSkillPolicies.size === 0)
|
|
277
|
+
return latestSkillContextState(entries);
|
|
278
|
+
if (policy.requests.some((request) => !policy.loadedSkillNames.has(request.name))) return null;
|
|
279
|
+
const names = [...policy.loadedSkillNames];
|
|
280
|
+
if (names.length === 0) return null;
|
|
281
|
+
const activationRefs = [];
|
|
282
|
+
for (const name of names) {
|
|
283
|
+
const entry = [...entries].reverse().find(
|
|
284
|
+
(candidate) => candidate.kind === "skillActivation" && candidate.activation.runId === void 0 && candidate.activation.name === name
|
|
285
|
+
);
|
|
286
|
+
if (!entry) return null;
|
|
287
|
+
activationRefs.push(entry.turnId);
|
|
288
|
+
}
|
|
289
|
+
return { version: 1, activationRefs };
|
|
290
|
+
}
|
|
291
|
+
function latestSkillContextState(entries) {
|
|
292
|
+
for (let index = entries.length - 1; index >= 0; index--) {
|
|
293
|
+
const entry = entries[index];
|
|
294
|
+
if (entry?.kind === "custom" && entry.customType === SKILL_CONTEXT_STATE) {
|
|
295
|
+
return isSkillContextState(entry.data) ? entry.data : void 0;
|
|
296
|
+
}
|
|
297
|
+
if (entry?.kind === "compactionSummary" && entry.skillContext !== void 0) {
|
|
298
|
+
return verifiedSkillContextCheckpoint(entry.skillContext) ? { version: 1, activationRefs: entry.skillContext.skills.map((skill) => skill.activationRef) } : void 0;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return void 0;
|
|
302
|
+
}
|
|
303
|
+
function decisionRef(interviewId, key) {
|
|
304
|
+
return `${interviewId}/${key}`;
|
|
305
|
+
}
|
|
306
|
+
var EVICTION_REASONS = [
|
|
307
|
+
"superseded_read",
|
|
308
|
+
"stale_after_mutation",
|
|
309
|
+
"listing_consumed",
|
|
310
|
+
"failure_resolved",
|
|
311
|
+
"thinking_turn_closed",
|
|
312
|
+
"age_horizon",
|
|
313
|
+
"operator"
|
|
314
|
+
];
|
|
315
|
+
var EVICTION_TRIGGERS = ["pressure", "operator"];
|
|
316
|
+
var RECALL_TRIGGERS = ["tool", "operator"];
|
|
317
|
+
var SESSION_ENTRY_KINDS = [
|
|
318
|
+
"message",
|
|
319
|
+
"bashExecution",
|
|
320
|
+
"custom",
|
|
321
|
+
"modelChange",
|
|
322
|
+
"thinkingLevelChange",
|
|
323
|
+
"fileEntry",
|
|
324
|
+
"branchSummary",
|
|
325
|
+
"compactionSummary",
|
|
326
|
+
"sessionInfo",
|
|
327
|
+
"label",
|
|
328
|
+
"protectedArtifact",
|
|
329
|
+
"skillActivation",
|
|
330
|
+
"taskLedger",
|
|
331
|
+
"decisionLedger",
|
|
332
|
+
"workerRun",
|
|
333
|
+
"contextEviction",
|
|
334
|
+
"contextRecall",
|
|
335
|
+
// Durable continuity (CONTRACTS §3). Both are bookkeeping sidecars: they
|
|
336
|
+
// never become model messages by themselves, never move the message leaf,
|
|
337
|
+
// and never become a cut point. The accepted note reaches the model exactly
|
|
338
|
+
// once, through the continuity replay projection.
|
|
339
|
+
"handoffTransaction",
|
|
340
|
+
"continuityCommit"
|
|
341
|
+
];
|
|
342
|
+
function isRecord3(value) {
|
|
343
|
+
return !!value && typeof value === "object";
|
|
344
|
+
}
|
|
345
|
+
function isString(value) {
|
|
346
|
+
return typeof value === "string";
|
|
347
|
+
}
|
|
348
|
+
function isOptionalString(value) {
|
|
349
|
+
return value === void 0 || typeof value === "string";
|
|
350
|
+
}
|
|
351
|
+
function isOptionalBoolean(value) {
|
|
352
|
+
return value === void 0 || typeof value === "boolean";
|
|
353
|
+
}
|
|
354
|
+
function isNumber(value) {
|
|
355
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
356
|
+
}
|
|
357
|
+
function isPositiveInteger2(value) {
|
|
358
|
+
return isNumber(value) && Number.isInteger(value) && value > 0;
|
|
359
|
+
}
|
|
360
|
+
function isOptionalNumber(value) {
|
|
361
|
+
return value === void 0 || isNumber(value);
|
|
362
|
+
}
|
|
363
|
+
function isNullableString3(value) {
|
|
364
|
+
return value === null || typeof value === "string";
|
|
365
|
+
}
|
|
366
|
+
function isOneOf(value, allowed) {
|
|
367
|
+
return typeof value === "string" && allowed.includes(value);
|
|
368
|
+
}
|
|
369
|
+
function isStringArray(value) {
|
|
370
|
+
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
371
|
+
}
|
|
372
|
+
function hasBaseSessionEntryFields(v) {
|
|
373
|
+
return isString(v.turnId) && isNullableString3(v.parentTurnId) && isString(v.timestamp);
|
|
374
|
+
}
|
|
375
|
+
var MESSAGE_ROLES = ["user", "assistant", "tool_call", "tool_result", "system", "checkpoint"];
|
|
376
|
+
var FILE_OPERATIONS = ["read", "write", "edit", "create", "delete"];
|
|
377
|
+
var COMPACTION_TRIGGERS = ["auto", "force", "overflow"];
|
|
378
|
+
var PROTECTED_ARTIFACT_SOURCES = [
|
|
379
|
+
"validation",
|
|
380
|
+
"middleware",
|
|
381
|
+
"user",
|
|
382
|
+
"session"
|
|
383
|
+
];
|
|
384
|
+
var TASK_LEDGER_STATUSES = ["pending", "active", "completed", "blocked", "cancelled"];
|
|
385
|
+
var TASK_LEDGER_EVIDENCE_STATUSES = [
|
|
386
|
+
"required",
|
|
387
|
+
"pending",
|
|
388
|
+
"passed",
|
|
389
|
+
"failed",
|
|
390
|
+
"missing"
|
|
391
|
+
];
|
|
392
|
+
var DECISION_STATUSES = ["active", "superseded"];
|
|
393
|
+
var DECISION_INTERVIEW_STATUSES = ["complete", "cancelled"];
|
|
394
|
+
var WORKER_RUN_ORIGINS = ["user", "agent"];
|
|
395
|
+
var WORKER_RUN_RUNTIME_KINDS = ["clio", "acp", "claude-sdk", "claude-code"];
|
|
396
|
+
function isWorkerRunRuntime(value) {
|
|
397
|
+
if (!isRecord3(value)) return false;
|
|
398
|
+
return isOneOf(value.kind, WORKER_RUN_RUNTIME_KINDS) && isOptionalString(value.targetId) && isOptionalString(value.wireModelId) && isOptionalString(value.peerId);
|
|
399
|
+
}
|
|
400
|
+
function isTaskLedgerGoal(value) {
|
|
401
|
+
if (!isRecord3(value)) return false;
|
|
402
|
+
if (!isString(value.id) || !isString(value.title)) return false;
|
|
403
|
+
if (!isOneOf(value.status, TASK_LEDGER_STATUSES)) return false;
|
|
404
|
+
if (value.parentGoalId !== void 0 && !isNullableString3(value.parentGoalId)) return false;
|
|
405
|
+
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;
|
|
406
|
+
return isOptionalString(value.description) && hasPairedProvenance;
|
|
407
|
+
}
|
|
408
|
+
function isTaskLedgerEvidence(value) {
|
|
409
|
+
if (!isRecord3(value)) return false;
|
|
410
|
+
if (!isString(value.id) || !isString(value.description)) return false;
|
|
411
|
+
if (!isOneOf(value.status, TASK_LEDGER_EVIDENCE_STATUSES)) return false;
|
|
412
|
+
return isOptionalString(value.command) && isOptionalString(value.artifactPath) && isOptionalString(value.observedAt) && isOptionalString(value.notes);
|
|
413
|
+
}
|
|
414
|
+
function isDecisionRecord(value) {
|
|
415
|
+
if (!isRecord3(value)) return false;
|
|
416
|
+
if (!isString(value.key) || !/^[a-z0-9]+(?:[_-][a-z0-9]+)*$/.test(value.key)) return false;
|
|
417
|
+
if (!isString(value.value) || !isOneOf(value.status, DECISION_STATUSES) || !isString(value.decidedAt)) return false;
|
|
418
|
+
if (!isOptionalString(value.label) || !isOptionalString(value.source_question)) return false;
|
|
419
|
+
if (value.source !== void 0 && !isOneOf(value.source, ["operator", "agent"])) return false;
|
|
420
|
+
if (value.revisionSource !== void 0 && !isOneOf(value.revisionSource, ["operator", "agent"])) return false;
|
|
421
|
+
if (value.alternatives !== void 0 && !isStringArray(value.alternatives)) return false;
|
|
422
|
+
if (!isOptionalString(value.rationale)) return false;
|
|
423
|
+
if (!isOptionalString(value.revisedAt) || !isOptionalString(value.correction)) return false;
|
|
424
|
+
return value.status === "superseded" ? isString(value.revisedAt) : value.revisedAt === void 0 && value.revisionSource === void 0 && value.correction === void 0;
|
|
425
|
+
}
|
|
426
|
+
function isOptionalCompactionUsage(value) {
|
|
427
|
+
if (value === void 0) return true;
|
|
428
|
+
if (!isRecord3(value)) return false;
|
|
429
|
+
const cost = value.cost;
|
|
430
|
+
return isOptionalString(value.targetId) && isOptionalString(value.modelId) && isNumber(value.input) && isNumber(value.output) && isNumber(value.cacheRead) && isNumber(value.cacheWrite) && isNumber(value.reasoning) && isNumber(value.totalTokens) && isNumber(value.apiCalls) && isRecord3(cost) && isNumber(cost.total);
|
|
431
|
+
}
|
|
432
|
+
function isProtectedArtifact(value) {
|
|
433
|
+
if (!isRecord3(value)) return false;
|
|
434
|
+
return isString(value.path) && isString(value.protectedAt) && isString(value.reason) && isOneOf(value.source, PROTECTED_ARTIFACT_SOURCES) && isOptionalString(value.validationCommand) && isOptionalNumber(value.validationExitCode);
|
|
435
|
+
}
|
|
436
|
+
function isSessionHeader(value) {
|
|
437
|
+
if (!isRecord3(value)) return false;
|
|
438
|
+
return value.type === "session" && isPositiveInteger2(value.version) && isString(value.id) && isString(value.timestamp) && isString(value.cwd) && isOptionalString(value.parentSession) && isOptionalString(value.parentTurnId);
|
|
439
|
+
}
|
|
440
|
+
function isWorkingSetRef(value) {
|
|
441
|
+
return isRecord3(value) && isString(value.entry);
|
|
442
|
+
}
|
|
443
|
+
function isEvictedItem(value) {
|
|
444
|
+
return isRecord3(value) && isWorkingSetRef(value.ref) && isOneOf(value.reason, EVICTION_REASONS) && isNumber(value.tokensFreed) && isString(value.marker) && (value.alias === void 0 || typeof value.alias === "string" && /^r[1-9]\d*$/.test(value.alias)) && isOptionalString(value.by);
|
|
445
|
+
}
|
|
446
|
+
function isSessionEntry(value) {
|
|
447
|
+
if (!value || typeof value !== "object") return false;
|
|
448
|
+
const v = value;
|
|
449
|
+
if (!hasBaseSessionEntryFields(v)) return false;
|
|
450
|
+
if (!isOneOf(v.kind, SESSION_ENTRY_KINDS)) return false;
|
|
451
|
+
switch (v.kind) {
|
|
452
|
+
case "message":
|
|
453
|
+
return Object.hasOwn(v, "payload") && isOneOf(v.role, MESSAGE_ROLES);
|
|
454
|
+
case "bashExecution":
|
|
455
|
+
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);
|
|
456
|
+
case "custom":
|
|
457
|
+
return isString(v.customType) && isOptionalBoolean(v.display) && (v.customType !== SKILL_CONTEXT_STATE || isSkillContextState(v.data)) && // A reserved control subtype is strictly validated, because opaque
|
|
458
|
+
// custom data must never become resume authority by claiming the name.
|
|
459
|
+
(v.customType !== HANDOFF_RECOVERY_REQUEST_CUSTOM_TYPE || isHandoffRecoveryRequestData(v.data));
|
|
460
|
+
case "modelChange":
|
|
461
|
+
return isString(v.provider) && isString(v.modelId) && isOptionalString(v.target);
|
|
462
|
+
case "thinkingLevelChange":
|
|
463
|
+
return isString(v.thinkingLevel);
|
|
464
|
+
case "fileEntry":
|
|
465
|
+
return isString(v.path) && isOneOf(v.operation, FILE_OPERATIONS) && isOptionalNumber(v.bytes) && isOptionalString(v.hash);
|
|
466
|
+
case "branchSummary":
|
|
467
|
+
return isString(v.fromTurnId) && isString(v.summary);
|
|
468
|
+
case "compactionSummary":
|
|
469
|
+
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) && (v.skillContext === void 0 || isSkillContextCheckpoint(v.skillContext)) && (v.userContext === void 0 || isPreservedUserContext(v.userContext)) && (v.continuity === void 0 || isContinuityCheckpointPayload(v.continuity));
|
|
470
|
+
case "sessionInfo":
|
|
471
|
+
return isOptionalString(v.name) && isOptionalString(v.targetTurnId) && isOptionalString(v.label);
|
|
472
|
+
case "label":
|
|
473
|
+
return isString(v.targetTurnId) && isOptionalString(v.label);
|
|
474
|
+
case "protectedArtifact":
|
|
475
|
+
return v.action === "protect" && isProtectedArtifact(v.artifact) && isOptionalString(v.toolName) && isOptionalString(v.toolCallId) && isOptionalString(v.runId) && isOptionalString(v.correlationId);
|
|
476
|
+
case "skillActivation":
|
|
477
|
+
return isSkillActivation(v.activation);
|
|
478
|
+
case "taskLedger":
|
|
479
|
+
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);
|
|
480
|
+
case "decisionLedger":
|
|
481
|
+
return (v.origin === void 0 || isOneOf(v.origin, ["interview", "agent"])) && 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);
|
|
482
|
+
case "workerRun":
|
|
483
|
+
return (v.helper === void 0 || v.helper === true) && isOptionalString(v.task) && isString(v.assignmentId) && isString(v.runId) && isOneOf(v.origin, WORKER_RUN_ORIGINS) && isString(v.agentId) && isWorkerRunRuntime(v.runtime) && isOptionalString(v.parentToolCallId);
|
|
484
|
+
case "contextEviction":
|
|
485
|
+
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));
|
|
486
|
+
case "contextRecall":
|
|
487
|
+
return isWorkingSetRef(v.ref) && isOneOf(v.trigger, RECALL_TRIGGERS) && isNumber(v.tokensReadmitted) && isOptionalString(v.toolCallId);
|
|
488
|
+
// The continuity guards check payload structure and the identity/link
|
|
489
|
+
// equalities the chain depends on, not just the kind string. A record
|
|
490
|
+
// that says `continuityCommit` and carries nothing usable is rejected
|
|
491
|
+
// here rather than surfacing later as an empty-but-present commit.
|
|
492
|
+
case "handoffTransaction":
|
|
493
|
+
return isHandoffTransactionEntry(v);
|
|
494
|
+
case "continuityCommit":
|
|
495
|
+
return isContinuityCommitEntry(v);
|
|
496
|
+
}
|
|
497
|
+
return false;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
export {
|
|
501
|
+
HANDOFF_RECOVERY_REQUEST_CUSTOM_TYPE,
|
|
502
|
+
isHandoffRecoveryRequestEntry,
|
|
503
|
+
HANDOFF_SCHEMA_VERSION,
|
|
504
|
+
HANDOFF_NOTE_MAX_BYTES,
|
|
505
|
+
HANDOFF_MAX_WINDOW_MS,
|
|
506
|
+
HANDOFF_POLICY_LIMITS,
|
|
507
|
+
HANDOFF_MAX_FLUSH_RETRIES,
|
|
508
|
+
canonicalJson,
|
|
509
|
+
isHandoffTransactionEntry,
|
|
510
|
+
isContinuityCheckpointPayload,
|
|
511
|
+
isContinuityCommitEntry,
|
|
512
|
+
isContinuityCarryingSummary,
|
|
513
|
+
SKILL_CONTEXT_STATE,
|
|
514
|
+
skillContextContentHash,
|
|
515
|
+
verifiedSkillContextCheckpoint,
|
|
516
|
+
mainSkillContextState,
|
|
517
|
+
latestSkillContextState,
|
|
518
|
+
decisionRef,
|
|
519
|
+
isDecisionRecord,
|
|
520
|
+
isSessionHeader,
|
|
521
|
+
isSessionEntry
|
|
522
|
+
};
|
|
523
|
+
//# sourceMappingURL=chunk-F6KCJO3U.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
compileFleetExecutionPlan
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LZMTVVN4.js";
|
|
5
5
|
import {
|
|
6
6
|
discoverAgentRecipes
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-G5ZDQQE3.js";
|
|
8
8
|
import {
|
|
9
9
|
loadFleetCommands,
|
|
10
10
|
loadFleetContract,
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
requestExecutionRole,
|
|
15
15
|
withAttemptRole
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-SZUO5BSE.js";
|
|
17
17
|
import {
|
|
18
18
|
normalizeAgentSpec
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-7UFDIOBT.js";
|
|
20
20
|
import {
|
|
21
21
|
readSettings
|
|
22
22
|
} from "./chunk-56XP4FJU.js";
|
|
@@ -107,4 +107,4 @@ function inspectFleet(name, vars) {
|
|
|
107
107
|
export {
|
|
108
108
|
inspectFleet
|
|
109
109
|
};
|
|
110
|
-
//# sourceMappingURL=chunk-
|
|
110
|
+
//# sourceMappingURL=chunk-F6VKWTTY.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-L7G7K4I2.js";
|
|
5
5
|
import {
|
|
6
6
|
ToolNames
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6UKFRTXI.js";
|
|
8
8
|
import {
|
|
9
9
|
typebox_exports
|
|
10
10
|
} from "./chunk-GH5ZR6JP.js";
|
|
@@ -49,4 +49,4 @@ export {
|
|
|
49
49
|
CODE_NAV_MAX_LIMIT,
|
|
50
50
|
codeNavToolSurface
|
|
51
51
|
};
|
|
52
|
-
//# sourceMappingURL=chunk-
|
|
52
|
+
//# sourceMappingURL=chunk-FLNXQQ5B.js.map
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
declineInteropAgents,
|
|
37
37
|
interopProposals,
|
|
38
38
|
renderProposalEntry
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-EBMTBE76.js";
|
|
40
40
|
import {
|
|
41
41
|
detectInteropAgents,
|
|
42
42
|
resolveOnPath
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
probeCapabilitiesForModel,
|
|
81
81
|
readTargetModelSnapshot,
|
|
82
82
|
recordTargetModelSnapshot
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-HTWTORF7.js";
|
|
84
84
|
import {
|
|
85
85
|
credentialsPresent
|
|
86
86
|
} from "./chunk-DVTBERFY.js";
|
|
@@ -3151,7 +3151,7 @@ var DIAGNOSTICS_SECTION = {
|
|
|
3151
3151
|
label: "Run doctor",
|
|
3152
3152
|
hint: "read-only health check",
|
|
3153
3153
|
run: async (io) => {
|
|
3154
|
-
const { runDoctorCommand } = await import("./doctor-
|
|
3154
|
+
const { runDoctorCommand } = await import("./doctor-53AVQXAO.js");
|
|
3155
3155
|
await runDoctorCommand([]);
|
|
3156
3156
|
await io.rl.text("Press Enter to return");
|
|
3157
3157
|
}
|
|
@@ -4154,4 +4154,4 @@ export {
|
|
|
4154
4154
|
runTargetRename,
|
|
4155
4155
|
runConfigureCommand
|
|
4156
4156
|
};
|
|
4157
|
-
//# sourceMappingURL=chunk-
|
|
4157
|
+
//# sourceMappingURL=chunk-FOSRJ2VZ.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
loadSkills,
|
|
4
4
|
parseAgentRecipeSchema,
|
|
5
5
|
recipeIdFromPath
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-B5TASTCK.js";
|
|
7
7
|
import {
|
|
8
8
|
enabledPluginResourceRoots,
|
|
9
9
|
parseFrontmatter,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
assertAgentSpecPolicy,
|
|
14
14
|
isShadowAgent,
|
|
15
15
|
normalizeAgentSpec
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7UFDIOBT.js";
|
|
17
17
|
import {
|
|
18
18
|
readSettings
|
|
19
19
|
} from "./chunk-56XP4FJU.js";
|
|
@@ -207,4 +207,4 @@ function discoverAgentRecipes(cwd = process.cwd(), diagnostics = []) {
|
|
|
207
207
|
export {
|
|
208
208
|
discoverAgentRecipes
|
|
209
209
|
};
|
|
210
|
-
//# sourceMappingURL=chunk-
|
|
210
|
+
//# sourceMappingURL=chunk-G5ZDQQE3.js.map
|