@iowarp/clio-coder 0.4.6 → 0.4.7
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 +283 -0
- package/CHANGELOG.md +50 -0
- package/CONTRIBUTING.md +102 -29
- package/NOTICE +8 -0
- package/README.md +37 -5
- package/dist/{acp-UVEVWSDL.js → acp-W3Y3TRHD.js} +12 -12
- package/dist/{agents-VWY37DTK.js → agents-J4ICNLQ3.js} +52 -52
- package/dist/assets/codewiki.json +1 -1
- package/dist/assets/tui-notices/get-east-asian-width-LICENSE +9 -0
- package/dist/assets/tui-notices/marked-LICENSE +44 -0
- package/dist/assets/tui-notices/pi-tui-LICENSE +21 -0
- package/dist/{auth-PCV2XQDV.js → auth-X2UJUMOC.js} +24 -24
- package/dist/{builtins-PD652MTK.js → builtins-XLXWWSRF.js} +6 -6
- package/dist/{chunk-DZK63TZJ.js → chunk-24S3DN22.js} +336 -612
- package/dist/{chunk-NTK3WTHM.js → chunk-24TOGHPO.js} +2 -2
- package/dist/{chunk-M6TAYK66.js → chunk-2O2LVQQK.js} +11 -4
- package/dist/{chunk-OQM5IVJY.js → chunk-34XHRVKG.js} +3 -3
- package/dist/{chunk-LY4N4TTL.js → chunk-3LXJOICS.js} +2 -2
- package/dist/{chunk-3BJGMT2D.js → chunk-3XE4NRLF.js} +1 -1
- package/dist/{chunk-N2OKBREN.js → chunk-4MFBBY2Z.js} +3 -3
- package/dist/{chunk-5VTJP36Q.js → chunk-4N2RZ4TO.js} +2 -2
- package/dist/{chunk-WNGF5AJX.js → chunk-4QKAITQT.js} +3 -3
- package/dist/chunk-4UHVS5T7.js +207 -0
- package/dist/{chunk-GLYBJ4RQ.js → chunk-5AJPUR72.js} +6 -6
- package/dist/{chunk-5CY4Q6QI.js → chunk-5EQO5NWP.js} +105 -3
- package/dist/{chunk-6HAO6X5B.js → chunk-65BGHOUR.js} +8 -5
- package/dist/{chunk-6VRRJT7L.js → chunk-6CA2BHOR.js} +2 -2
- package/dist/{chunk-HL26ADLH.js → chunk-6CB2IL4N.js} +2 -1
- package/dist/{chunk-E7RF4KBO.js → chunk-6LRLOJHQ.js} +3 -3
- package/dist/{chunk-HXHFDHB6.js → chunk-6TAATXXH.js} +6 -6
- package/dist/{chunk-P6M7RKMI.js → chunk-6YHPAAZR.js} +3 -3
- package/dist/{chunk-5QRX7SLS.js → chunk-7EEGBKV4.js} +7 -7
- package/dist/{chunk-BS4GAMUB.js → chunk-A67NR5AT.js} +2 -2
- package/dist/{chunk-WJIMKGD6.js → chunk-BAU36233.js} +8 -8
- package/dist/{chunk-PZN2LQY6.js → chunk-BO4XV5VX.js} +4 -4
- package/dist/{chunk-I2K2NCZQ.js → chunk-BQQ5MXUC.js} +6 -6
- package/dist/{chunk-X3BI7HTV.js → chunk-C3G5PNUO.js} +21 -21
- package/dist/{chunk-SRZOW5L2.js → chunk-C6GEXX4L.js} +1 -1
- package/dist/{chunk-6RYDAVQT.js → chunk-CE64C5K5.js} +219 -64
- package/dist/chunk-CP3HIR5H.js +2119 -0
- package/dist/{chunk-BBV5TKE6.js → chunk-CPXGJI2A.js} +2 -2
- package/dist/{chunk-IGLVVNEG.js → chunk-CULVKYTK.js} +4 -4
- package/dist/{chunk-DXLUVUD4.js → chunk-D2T66PDV.js} +5 -5
- package/dist/{chunk-NF3BK5WR.js → chunk-DACXIVVF.js} +5 -5
- package/dist/{chunk-IKRWLEDA.js → chunk-DLIYANB7.js} +20 -15
- package/dist/{chunk-RGZNQ5CT.js → chunk-DO7M3LSX.js} +9 -9
- package/dist/{chunk-2QPI3TR3.js → chunk-DVJL77SO.js} +2 -2
- package/dist/{chunk-ODUTYZIU.js → chunk-EUEXGXXR.js} +5 -5
- package/dist/{chunk-WKUYQBCG.js → chunk-EUZRMP4Y.js} +18 -16
- package/dist/{chunk-JMPL7NUB.js → chunk-G4LGUTOE.js} +4 -4
- package/dist/{chunk-CBSKDFWL.js → chunk-GEVQNST4.js} +2 -2
- package/dist/{chunk-NNWJYUNO.js → chunk-GFQ7P2UF.js} +7 -7
- package/dist/{chunk-SXQKNKRA.js → chunk-GI5RRMAH.js} +14 -14
- package/dist/{chunk-HPTJF6DG.js → chunk-GVZFCJHE.js} +336 -83
- package/dist/{chunk-ACCKVSHU.js → chunk-GXIWHXDB.js} +3 -3
- package/dist/{chunk-LUL5Z66S.js → chunk-HOX4YZ2K.js} +6 -5
- package/dist/chunk-HRAKUPIH.js +57 -0
- package/dist/{chunk-F5Z7EWMN.js → chunk-IJMW64DX.js} +50 -50
- package/dist/{chunk-QNWRHOMF.js → chunk-IMOD2YPV.js} +16 -9
- package/dist/{chunk-HZ2T2YED.js → chunk-IQCNVLO6.js} +28 -8
- package/dist/{chunk-HZFBVU5X.js → chunk-ISNCCX42.js} +8 -8
- package/dist/{chunk-7JSSKXG2.js → chunk-IZYTT3CD.js} +7 -3
- package/dist/chunk-KKEYGFX4.js +915 -0
- package/dist/{chunk-HHVJNVUJ.js → chunk-KS7ETA3P.js} +2 -2
- package/dist/{chunk-BLTEAUCB.js → chunk-L3Z5ANCV.js} +7 -7
- package/dist/{chunk-4VMV6OS6.js → chunk-LBFQMYS3.js} +2 -2
- package/dist/{chunk-URBGEOH3.js → chunk-M6Z2V6YU.js} +5 -5
- package/dist/{chunk-BT7HGDOX.js → chunk-MBJO5VNZ.js} +12 -12
- package/dist/chunk-MNQN3X6Y.js +595 -0
- package/dist/{chunk-3QKXHCGS.js → chunk-MZHXENL7.js} +5 -5
- package/dist/chunk-MZNWZUJM.js +1801 -0
- package/dist/{chunk-7YJWEF2L.js → chunk-N37QC5FV.js} +5 -5
- package/dist/{chunk-TJFDL26W.js → chunk-NCCQ6DVS.js} +7 -7
- package/dist/{chunk-P5JMBPDJ.js → chunk-NO7J45X6.js} +162 -47
- package/dist/chunk-OH3YYA3B.js +15 -0
- package/dist/{chunk-22PQ4TX4.js → chunk-P4DL2LM5.js} +16 -77
- package/dist/{chunk-LIN2K3EL.js → chunk-PFLOULP3.js} +4 -4
- package/dist/{chunk-QXFBABFJ.js → chunk-QKWL7SYE.js} +11 -11
- package/dist/chunk-RFCKPS2V.js +26 -0
- package/dist/{chunk-ZS43Y2FT.js → chunk-RTLNFZMD.js} +12 -4
- package/dist/{chunk-U7H5WRG5.js → chunk-RXFPB32E.js} +8 -6
- package/dist/{chunk-Q7NNUHQV.js → chunk-SEDI5K5B.js} +16 -16
- package/dist/{chunk-WV6TDAPN.js → chunk-SELG4SUR.js} +7 -7
- package/dist/{chunk-3WBALRQH.js → chunk-SER7RRAE.js} +27 -832
- package/dist/{chunk-K2HL3GBL.js → chunk-T4TY5GG3.js} +165 -15
- package/dist/chunk-T7QQBNLH.js +691 -0
- package/dist/{chunk-6OII3LOK.js → chunk-TLTGZTXI.js} +3 -3
- package/dist/chunk-TZ6UVP2H.js +637 -0
- package/dist/{chunk-3JLFK5MW.js → chunk-TZHN5ITX.js} +13 -41
- package/dist/{chunk-VANN3GDP.js → chunk-U3TPUXOQ.js} +399 -234
- package/dist/{chunk-VHMX7SXF.js → chunk-UA3W4FGC.js} +6 -6
- package/dist/{chunk-3O2ZAUGQ.js → chunk-UA6W4XFJ.js} +2 -2
- package/dist/chunk-UWD3JD5X.js +709 -0
- package/dist/chunk-V4ZKOKRB.js +13433 -0
- package/dist/{chunk-NC4KV7EL.js → chunk-VCRVEDUC.js} +5 -5
- package/dist/{chunk-4DU2TVI4.js → chunk-VMATUZB6.js} +12 -10
- package/dist/{chunk-J2FYEQ5L.js → chunk-VTYHHQ57.js} +2 -2
- package/dist/chunk-WB7POC6M.js +891 -0
- package/dist/{chunk-3HQVBIKD.js → chunk-WBVKKTUT.js} +2 -2
- package/dist/{chunk-EHOSNVVM.js → chunk-WLHX3MM5.js} +6 -2
- package/dist/{chunk-24T2YZ7A.js → chunk-WN552PKN.js} +553 -298
- package/dist/{chunk-4U4TKZFR.js → chunk-WT5TRMO4.js} +51 -26
- package/dist/{chunk-XWMSPJYN.js → chunk-WURGVOZJ.js} +56 -12
- package/dist/{chunk-7WUZEB2M.js → chunk-XR3XJN2M.js} +2 -2
- package/dist/chunk-XW2UZICE.js +372 -0
- package/dist/{chunk-2AKYFREM.js → chunk-XZ6UFQ52.js} +11 -11
- package/dist/chunk-Y3JU5RPK.js +8 -0
- package/dist/chunk-YKRJTYNP.js +1143 -0
- package/dist/{chunk-PWWSIB2A.js → chunk-ZGIGW4ZG.js} +5 -5
- package/dist/cli/index.js +34 -36
- package/dist/{clio-QQCMTUZE.js → clio-L2P7S2R2.js} +9 -9
- package/dist/{code-nav-GUPM6766.js → code-nav-B5LNX4KU.js} +25 -25
- package/dist/{components-TNIKXCBH.js → components-63MMQKUT.js} +6 -6
- package/dist/{config-IIM7YOD3.js → config-YXARKGTX.js} +70 -67
- package/dist/{configure-4ZM5HWJX.js → configure-LMVQJ46J.js} +47 -35
- package/dist/{context-OL5P3HEP.js → context-7HJEWTTP.js} +87 -44
- package/dist/{context-44BZLJ3J.js → context-XSZKKFBW.js} +14 -14
- package/dist/{context-AIDVQKMW.js → context-YG2LZDYZ.js} +60 -58
- package/dist/{context-clear-OQV76MYP.js → context-clear-AC5NXHM2.js} +57 -55
- package/dist/{context-index-HP2JFUWA.js → context-index-KKTPRV5G.js} +3 -3
- package/dist/{context-map-INTXD54D.js → context-map-T7ROR5D5.js} +4 -4
- package/dist/{context-working-set-ZUW3EGLS.js → context-working-set-F4Q4J3NS.js} +12 -10
- package/dist/{detail-UXPWRANG.js → detail-H73BEF2N.js} +58 -56
- package/dist/{dispatch-runner-P3ZW6G77.js → dispatch-runner-3RY5FSJC.js} +74 -72
- package/dist/{doctor-JJVGPZWT.js → doctor-EQYJOGUG.js} +44 -30
- package/dist/{eval-V2RTN3UH.js → eval-4P7O6CCE.js} +109 -46
- package/dist/{evidence-35PYWGSO.js → evidence-D6GUSYJW.js} +57 -55
- package/dist/{evidence-CIGGKI6J.js → evidence-O76QF7TZ.js} +62 -59
- package/dist/{evolve-33SM3NJP.js → evolve-H47BCETS.js} +58 -56
- package/dist/{extensions-YVRHX6ZI.js → extensions-NNL3ZOCU.js} +98 -20
- package/dist/{fleet-LFO7SIPC.js → fleet-KMNS6NOM.js} +106 -99
- package/dist/{fleet-commands-RLK72GU3.js → fleet-commands-DOWSYCBX.js} +14 -14
- package/dist/{fleet-decisions-3SBSCTCW.js → fleet-decisions-S3PTZV2D.js} +9 -9
- package/dist/{fleet-graph-JZIBCGMW.js → fleet-graph-F2DE2TME.js} +26 -24
- package/dist/{fleet-inspect-2L5YGGZJ.js → fleet-inspect-EN2Q6IVB.js} +60 -57
- package/dist/{fleet-preflight-QRSHIIDE.js → fleet-preflight-FRLETDD3.js} +3 -3
- package/dist/{fleet-validate-LIAVKDUU.js → fleet-validate-B2XDLS57.js} +28 -29
- package/dist/{fleet-verify-JIK3OQZR.js → fleet-verify-4JKUWGJ7.js} +57 -55
- package/dist/{fleet-view-IWHYGQKK.js → fleet-view-BHJFW26B.js} +60 -57
- package/dist/{init-NJEDOTQW.js → init-XAT5N5YM.js} +79 -74
- package/dist/interop-FVECHFKG.js +246 -0
- package/dist/{inventory-74UL7UHU.js → inventory-7KFQGLCV.js} +60 -57
- package/dist/library-NY2XOT75.js +492 -0
- package/dist/library-QAPAO23R.js +306 -0
- package/dist/library-import-5Y6MAS3R.js +183 -0
- package/dist/library-inventory-JT6HWITQ.js +56 -0
- package/dist/library-validation-EQUH25DC.js +42 -0
- package/dist/{memory-I76I5VUH.js → memory-DYVTTCP6.js} +58 -56
- package/dist/{models-D4YDIQZQ.js → models-MASFJ6Y2.js} +48 -36
- package/dist/{monitor-NKVD55HX.js → monitor-YMP4NXJJ.js} +64 -61
- package/dist/{orchestrator-I6OATVPK.js → orchestrator-AFQRRTEI.js} +3685 -1841
- package/dist/{panes-7BTYH3XQ.js → panes-D3Y2KFG5.js} +4 -4
- package/dist/{panes-WPOMEMRH.js → panes-NICTHQCV.js} +7 -7
- package/dist/{paths-J3KN7UAO.js → paths-PSFAUIGO.js} +5 -5
- package/dist/{preload-EJAWJEIO.js → preload-5Q7VXRFJ.js} +57 -55
- package/dist/{reset-4XMQKDNZ.js → reset-7NKZK7JN.js} +9 -9
- package/dist/{resources-TVYVXK3Q.js → resources-NILSIZAT.js} +94 -38
- package/dist/{run-OWQNNSJU.js → run-BPZGEBZV.js} +121 -105
- package/dist/{share-NPZZMUXG.js → share-EZ6ERBMH.js} +31 -28
- package/dist/skills-BTVVNYVM.js +100 -0
- package/dist/{skills-eval-J5TCKSJA.js → skills-eval-UY34MNK7.js} +110 -72
- package/dist/{skills-inventory-7II4DM57.js → skills-inventory-JDHSIA7I.js} +30 -25
- package/dist/{slash-commands-MDSDSWYF.js → slash-commands-K4FNQ2AT.js} +49 -46
- package/dist/{steer-S7D7IKPU.js → steer-2B3EQGFH.js} +4 -4
- package/dist/{support-5VAEC32W.js → support-L2SOL3IE.js} +7 -7
- package/dist/{targets-KILZEOCE.js → targets-44VKGFLN.js} +64 -58
- package/dist/{tasks-R6P6OV22.js → tasks-3KODKFU7.js} +12 -12
- package/dist/{terminal-lease-LZCG2KN3.js → terminal-lease-LXA7MMPO.js} +32 -19
- package/dist/{tools-6OCQ6SVB.js → tools-3UB7TEVR.js} +7 -7
- package/dist/{trace-JHLXWUMN.js → trace-TAMIU4OJ.js} +5 -4
- package/dist/{tui-primitives-RCY2HN7G.js → tui-primitives-A6MUW32V.js} +3 -2
- package/dist/{uninstall-FXYMFFRT.js → uninstall-QYVRPEM4.js} +9 -9
- package/dist/{upgrade-D2OZH6IQ.js → upgrade-7PMKM2JH.js} +15 -16
- package/dist/{usage-PIASNUS4.js → usage-6EQV7EQK.js} +70 -67
- package/dist/{verifiers-LTHUY2PX.js → verifiers-JLITWSHU.js} +15 -15
- package/dist/{verify-HYF7KBVE.js → verify-T7NAEVIG.js} +13 -13
- package/dist/{web-fetch-MQN4FH3X.js → web-fetch-W4TNW4Q7.js} +4 -4
- package/dist/{wiki-generate-RK7JQ5NP.js → wiki-generate-T2TJQJUA.js} +81 -76
- package/dist/{with-panes-OFTNAR4Y.js → with-panes-CHFC7HGI.js} +4 -4
- package/dist/worker/entry.js +283 -76
- package/docs/README.md +43 -0
- package/docs/architecture/architecture.md +8 -7
- package/docs/architecture/artifact-versions.md +3 -3
- package/docs/architecture/context-engine.md +35 -1
- package/docs/architecture/library.md +32 -0
- package/docs/architecture/middleware-and-components.md +1 -1
- package/docs/architecture/model-catalog.md +21 -1
- package/docs/architecture/pi-boundary.md +18 -0
- package/docs/architecture/prompt-envelope-and-tools.md +5 -5
- package/docs/architecture/safety-model.md +21 -2
- package/docs/architecture/session-lifecycle.md +12 -1
- package/docs/architecture/tui-design.md +108 -9
- package/docs/architecture/worker-context.md +106 -0
- package/docs/guide/authoring-plugins.md +160 -0
- package/docs/guide/built-in-agents.md +5 -5
- package/docs/guide/commands-and-modes.md +161 -56
- package/docs/guide/configuration-and-targets.md +1 -1
- package/docs/guide/configuration-reference.md +27 -34
- package/docs/guide/environment-variables.md +2 -2
- package/docs/guide/exit-codes-and-output.md +1 -1
- package/docs/guide/extensions-and-sharing.md +93 -53
- package/docs/guide/fleet-dispatch.md +31 -4
- package/docs/guide/glossary.md +1 -1
- package/docs/guide/harness-extensions.md +291 -0
- package/docs/guide/installation-and-lifecycle.md +9 -9
- package/docs/guide/interop.md +243 -0
- package/docs/guide/panes-and-files.md +3 -3
- package/docs/guide/plugins.md +80 -0
- package/docs/guide/resource-library.md +111 -45
- package/docs/guide/skills-marketplace.md +35 -72
- package/docs/guide/tool-usage.md +19 -7
- package/docs/guide/troubleshooting.md +1 -1
- package/docs/process/development-pipeline.md +14 -14
- package/docs/process/documentation-coverage.md +28 -1
- package/docs/process/documentation-guide.md +15 -7
- package/docs/process/eval-runner.md +8 -3
- package/docs/process/performance-methodology.md +1 -1
- package/docs/process/release-cut-checklist.md +4 -0
- package/docs/process/scientific-validation.md +23 -0
- package/evals/scalar-decision-machinery.ts +1 -1
- package/examples/extensions/README.md +67 -0
- package/examples/extensions/lab-status/clio-coder-extension.json +14 -0
- package/examples/extensions/lab-status/extension.mjs +68 -0
- package/examples/extensions/lab-status/jobs.synthetic.json +9 -0
- package/examples/extensions/measurements/clio-coder-extension.json +28 -0
- package/examples/extensions/measurements/summarize.cjs +23 -0
- package/library/README.md +109 -0
- package/library/_authoring/templates/agent/README.md +28 -0
- package/library/_authoring/templates/agent/agents/benchmark-scout.md +30 -0
- package/library/_authoring/templates/agent/plugin.json +23 -0
- package/library/_authoring/templates/fleet/README.md +29 -0
- package/library/_authoring/templates/fleet/fleets/pipeline-review.md +31 -0
- package/library/_authoring/templates/fleet/plugin.json +23 -0
- package/library/_authoring/templates/plugin/README.md +37 -0
- package/library/_authoring/templates/plugin/agents/data-curator.md +31 -0
- package/library/_authoring/templates/plugin/assets/curation-guide.md +22 -0
- package/library/_authoring/templates/plugin/plugin.json +42 -0
- package/library/_authoring/templates/plugin/prompts/inspect-dataset.md +15 -0
- package/library/_authoring/templates/plugin/skills/dataset-curation/SKILL.md +36 -0
- package/library/_authoring/templates/plugin/skills/dataset-curation/evals.md +17 -0
- package/library/_authoring/templates/prompt/README.md +28 -0
- package/library/_authoring/templates/prompt/plugin.json +23 -0
- package/library/_authoring/templates/prompt/prompts/paper-summary.md +26 -0
- package/library/_authoring/templates/skill/README.md +24 -0
- package/library/_authoring/templates/skill/SKILL.md +39 -0
- package/library/_authoring/templates/skill/evals.md +30 -0
- package/library/_authoring/templates/skill/plugin.json +23 -0
- package/library/agents/README.md +7 -0
- package/library/fleets/README.md +7 -0
- package/library/plugins/materio/README.md +137 -0
- package/library/plugins/materio/ai.iowarp.clio/agents/materio-lab-definer.md +208 -0
- package/library/plugins/materio/ai.iowarp.clio/agents/materio-literature-reviewer.md +308 -0
- package/library/plugins/materio/ai.iowarp.clio/agents/materio-research-explorer.md +249 -0
- package/library/plugins/materio/ai.iowarp.clio/agents/materio-task-executor.md +416 -0
- package/library/plugins/materio/ai.iowarp.clio/agents/materio-task-verifier.md +60 -0
- package/library/plugins/materio/ai.iowarp.clio/agents/materio-workflow-planner.md +238 -0
- package/library/plugins/materio/ai.iowarp.clio/fleets/materio-execute-task.md +50 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/add-task.md +66 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/archive-task.md +65 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/checkpoint.md +26 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/define-research-tasks.md +230 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/define-virtual-lab.md +181 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/execute-task.md +292 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/help.md +129 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/identify-research.md +206 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/literature-review.md +201 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/pause-research.md +12 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/progress.md +105 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/remove-task.md +63 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/resume-research.md +64 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/settings.md +16 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/status.md +92 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/upload-data.md +104 -0
- package/library/plugins/materio/ai.iowarp.clio/prompts/materio/wtfp.md +145 -0
- package/library/plugins/materio/ai.iowarp.clio/references/execution.md +56 -0
- package/library/plugins/materio/ai.iowarp.portability/provenance.json +9 -0
- package/library/plugins/materio/assets/actions/add-task.md +86 -0
- package/library/plugins/materio/assets/actions/archive-task.md +84 -0
- package/library/plugins/materio/assets/actions/checkpoint.md +47 -0
- package/library/plugins/materio/assets/actions/define-research-tasks.md +228 -0
- package/library/plugins/materio/assets/actions/define-virtual-lab.md +179 -0
- package/library/plugins/materio/assets/actions/execute-task.md +290 -0
- package/library/plugins/materio/assets/actions/help.md +140 -0
- package/library/plugins/materio/assets/actions/identify-research.md +204 -0
- package/library/plugins/materio/assets/actions/literature-review.md +199 -0
- package/library/plugins/materio/assets/actions/pause-research.md +34 -0
- package/library/plugins/materio/assets/actions/progress.md +125 -0
- package/library/plugins/materio/assets/actions/remove-task.md +82 -0
- package/library/plugins/materio/assets/actions/resume-research.md +84 -0
- package/library/plugins/materio/assets/actions/settings.md +38 -0
- package/library/plugins/materio/assets/actions/status.md +112 -0
- package/library/plugins/materio/assets/actions/upload-data.md +123 -0
- package/library/plugins/materio/assets/actions/wtfp.md +179 -0
- package/library/plugins/materio/assets/references/research-domains.md +134 -0
- package/library/plugins/materio/assets/references/research-policy.md +77 -0
- package/library/plugins/materio/assets/references/traditional-workflows.md +146 -0
- package/library/plugins/materio/assets/scripts/check_physics.py +271 -0
- package/library/plugins/materio/assets/scripts/check_scripts.py +248 -0
- package/library/plugins/materio/assets/scripts/project_plugin.py +165 -0
- package/library/plugins/materio/assets/scripts/research_state.py +400 -0
- package/library/plugins/materio/assets/scripts/verify_citations.py +616 -0
- package/library/plugins/materio/assets/templates/RESEARCH.md +39 -0
- package/library/plugins/materio/assets/templates/VIRTUAL-LAB.md +120 -0
- package/library/plugins/materio/assets/templates/WORKFLOW.md +42 -0
- package/library/plugins/materio/assets/templates/config.json +5 -0
- package/library/plugins/materio/evals/scripts.yaml +29 -0
- package/library/plugins/materio/plugin.json +530 -0
- package/library/plugins/materio/skills/materio-lab-definer/SKILL.md +74 -0
- package/library/plugins/materio/skills/materio-literature-reviewer/SKILL.md +64 -0
- package/library/plugins/materio/skills/materio-research-explorer/SKILL.md +74 -0
- package/library/plugins/materio/skills/materio-task-executor/SKILL.md +214 -0
- package/library/plugins/materio/skills/materio-task-verifier/SKILL.md +46 -0
- package/library/plugins/materio/skills/materio-workflow-planner/SKILL.md +79 -0
- package/library/plugins/materio/tests/test_check_physics.py +139 -0
- package/library/plugins/materio/tests/test_check_scripts.py +140 -0
- package/library/plugins/materio/tests/test_research_state.py +291 -0
- package/library/plugins/materio/tests/test_verify_citations.py +337 -0
- package/library/prompts/README.md +7 -0
- package/library/registry.yaml +921 -0
- package/library/skills/README.md +120 -0
- package/{skills → library/skills}/coding/ast-grep/SKILL.md +1 -1
- package/{skills → library/skills}/coding/ast-grep/evals.md +1 -1
- package/library/skills/coding/ast-grep/plugin.json +23 -0
- package/{skills → library/skills}/coding/coding-standards/SKILL.md +1 -1
- package/{skills → library/skills}/coding/coding-standards/evals.md +1 -1
- package/library/skills/coding/coding-standards/plugin.json +23 -0
- package/{skills → library/skills}/coding/prototype/SKILL.md +1 -1
- package/{skills → library/skills}/coding/prototype/evals.md +1 -1
- package/library/skills/coding/prototype/plugin.json +23 -0
- package/{skills → library/skills}/coding/tdd/SKILL.md +1 -1
- package/{skills → library/skills}/coding/tdd/evals.md +1 -1
- package/library/skills/coding/tdd/plugin.json +23 -0
- package/{skills → library/skills}/context/context-handoff/SKILL.md +1 -1
- package/{skills → library/skills}/context/context-handoff/evals.md +1 -1
- package/library/skills/context/context-handoff/plugin.json +23 -0
- package/{skills → library/skills}/context/context-prime/SKILL.md +1 -1
- package/{skills → library/skills}/context/context-prime/evals.md +1 -1
- package/library/skills/context/context-prime/plugin.json +23 -0
- package/{skills → library/skills}/git/branch-closeout/SKILL.md +1 -1
- package/library/skills/git/branch-closeout/plugin.json +23 -0
- package/{skills → library/skills}/git/file-ticket/SKILL.md +1 -1
- package/library/skills/git/file-ticket/plugin.json +23 -0
- package/{skills → library/skills}/git/fix-issue/SKILL.md +1 -1
- package/library/skills/git/fix-issue/plugin.json +23 -0
- package/{skills → library/skills}/git/resolve-merge-conflicts/SKILL.md +1 -1
- package/{skills → library/skills}/git/resolve-merge-conflicts/evals.md +1 -1
- package/library/skills/git/resolve-merge-conflicts/plugin.json +23 -0
- package/{skills → library/skills}/git/ship/SKILL.md +1 -1
- package/library/skills/git/ship/plugin.json +23 -0
- package/{skills → library/skills}/git/worktree-create/SKILL.md +1 -1
- package/library/skills/git/worktree-create/plugin.json +23 -0
- package/{skills → library/skills}/git/worktree-merge/SKILL.md +1 -1
- package/library/skills/git/worktree-merge/plugin.json +23 -0
- package/{skills → library/skills}/meta/clio-coder-dev/SKILL.md +1 -1
- package/{skills → library/skills}/meta/clio-coder-dev/evals.md +1 -1
- package/library/skills/meta/clio-coder-dev/plugin.json +23 -0
- package/{skills → library/skills}/meta/clio-coder-test/SKILL.md +1 -1
- package/{skills → library/skills}/meta/clio-coder-test/evals.md +1 -1
- package/library/skills/meta/clio-coder-test/plugin.json +23 -0
- package/{skills → library/skills}/meta/credentials/SKILL.md +1 -1
- package/{skills → library/skills}/meta/credentials/evals.md +1 -1
- package/library/skills/meta/credentials/plugin.json +23 -0
- package/library/skills/meta/find-skills/SKILL.md +85 -0
- package/library/skills/meta/find-skills/evals.md +65 -0
- package/library/skills/meta/find-skills/plugin.json +23 -0
- package/{skills → library/skills}/meta/herdr/SKILL.md +1 -1
- package/{skills → library/skills}/meta/herdr/evals.md +1 -1
- package/library/skills/meta/herdr/plugin.json +23 -0
- package/{skills → library/skills}/meta/skill-craft/SKILL.md +23 -9
- package/{skills → library/skills}/meta/skill-craft/evals.md +11 -3
- package/library/skills/meta/skill-craft/plugin.json +23 -0
- package/{skills → library/skills}/planning/archify/SKILL.md +13 -13
- package/library/skills/planning/archify/plugin.json +23 -0
- package/{skills → library/skills}/planning/architecture/SKILL.md +1 -1
- package/{skills → library/skills}/planning/architecture/evals.md +1 -1
- package/library/skills/planning/architecture/plugin.json +23 -0
- package/{skills → library/skills}/planning/backlog/SKILL.md +1 -1
- package/{skills → library/skills}/planning/backlog/evals.md +1 -1
- package/library/skills/planning/backlog/plugin.json +23 -0
- package/{skills → library/skills}/planning/prd/SKILL.md +1 -1
- package/{skills → library/skills}/planning/prd/evals.md +1 -1
- package/library/skills/planning/prd/plugin.json +23 -0
- package/{skills → library/skills}/planning/product-intent/SKILL.md +1 -1
- package/{skills → library/skills}/planning/product-intent/evals.md +1 -1
- package/library/skills/planning/product-intent/plugin.json +23 -0
- package/{skills → library/skills}/planning/tech-spec/SKILL.md +1 -1
- package/{skills → library/skills}/planning/tech-spec/evals.md +1 -1
- package/library/skills/planning/tech-spec/plugin.json +23 -0
- package/{skills → library/skills}/registry.yaml +7 -7
- package/{skills → library/skills}/remote.yaml +1 -1
- package/{skills → library/skills}/research/arxiv-literature/SKILL.md +1 -1
- package/{skills → library/skills}/research/arxiv-literature/evals.md +1 -1
- package/library/skills/research/arxiv-literature/plugin.json +23 -0
- package/{skills → library/skills}/research/experiment-protocol/SKILL.md +1 -1
- package/{skills → library/skills}/research/experiment-protocol/evals.md +1 -1
- package/library/skills/research/experiment-protocol/plugin.json +23 -0
- package/{skills → library/skills}/research/scientific-debugging/SKILL.md +1 -1
- package/{skills → library/skills}/research/scientific-debugging/evals.md +1 -1
- package/library/skills/research/scientific-debugging/plugin.json +23 -0
- package/{skills → library/skills}/research/scientific-modernization/SKILL.md +1 -1
- package/{skills → library/skills}/research/scientific-modernization/evals.md +1 -1
- package/library/skills/research/scientific-modernization/plugin.json +23 -0
- package/{skills → library/skills}/skill-marketplace.json +37 -37
- package/{skills → library/skills}/workflow/cut-it/SKILL.md +1 -1
- package/{skills → library/skills}/workflow/cut-it/evals.md +1 -1
- package/library/skills/workflow/cut-it/plugin.json +23 -0
- package/{skills → library/skills}/workflow/design-council/SKILL.md +1 -1
- package/{skills → library/skills}/workflow/design-council/evals.md +1 -1
- package/library/skills/workflow/design-council/plugin.json +23 -0
- package/{skills → library/skills}/workflow/grill-me/SKILL.md +1 -1
- package/{skills → library/skills}/workflow/grill-me/evals.md +1 -1
- package/library/skills/workflow/grill-me/plugin.json +23 -0
- package/{skills → library/skills}/workflow/workflow-distiller/SKILL.md +14 -11
- package/{skills → library/skills}/workflow/workflow-distiller/evals.md +14 -6
- package/library/skills/workflow/workflow-distiller/plugin.json +23 -0
- package/package.json +12 -5
- package/src/cli/agents.ts +1 -1
- package/src/cli/config-inspect.ts +1 -1
- package/src/cli/configure.ts +2 -2
- package/src/cli/eval.ts +40 -6
- package/src/cli/extensions.ts +74 -8
- package/src/cli/fleet-preflight.ts +2 -0
- package/src/cli/fleet.ts +2 -0
- package/src/cli/index.ts +1 -3
- package/src/cli/interop-inspect.ts +61 -33
- package/src/cli/interop.ts +79 -9
- package/src/cli/library-import.ts +139 -0
- package/src/cli/library.ts +418 -120
- package/src/cli/run.ts +26 -9
- package/src/cli/skills-eval.ts +43 -6
- package/src/cli/skills-inventory.ts +6 -2
- package/src/cli/skills.ts +44 -491
- package/src/core/bus-events.ts +5 -0
- package/src/core/defaults.ts +1 -1
- package/src/core/recent-models.ts +2 -2
- package/src/core/session-routing.ts +3 -3
- package/src/core/state-file-lock.ts +1 -1
- package/src/core/tool-names.ts +5 -0
- package/src/domains/agents/extension.ts +42 -6
- package/src/domains/agents/fleet-commands.ts +92 -1
- package/src/domains/agents/fleet-contract.ts +87 -19
- package/src/domains/agents/recipe.ts +5 -4
- package/src/domains/agents/registry.ts +80 -24
- package/src/domains/config/keybindings.ts +155 -95
- package/src/domains/context/worker/contract.ts +91 -0
- package/src/domains/context/worker/pressure.ts +120 -0
- package/src/domains/context/worker/recall.ts +62 -0
- package/src/domains/context/worker/select.ts +164 -0
- package/src/domains/context/worker/snapshot.ts +35 -0
- package/src/domains/context/worker/store.ts +16 -0
- package/src/domains/context/working-set/replay/synthetic.ts +2 -1
- package/src/domains/dispatch/active-route-planner.ts +2 -0
- package/src/domains/dispatch/backoff.ts +1 -0
- package/src/domains/dispatch/code-step.ts +12 -2
- package/src/domains/dispatch/contract.ts +3 -0
- package/src/domains/dispatch/execution-plan.ts +2 -0
- package/src/domains/dispatch/extension.ts +109 -27
- package/src/domains/dispatch/fleet-plan.ts +10 -0
- package/src/domains/dispatch/fleet-run.ts +1 -0
- 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 +5 -0
- package/src/domains/dispatch/validation.ts +12 -0
- package/src/domains/dispatch/workspace-checkpoint.ts +1 -1
- package/src/domains/evidence/failure-attribution.ts +1 -0
- package/src/domains/evidence/trust-status.ts +22 -3
- package/src/domains/extensions/command-schema.ts +145 -0
- package/src/domains/extensions/command-tools.ts +15 -0
- package/src/domains/extensions/compatibility.ts +7 -0
- package/src/domains/extensions/contract.ts +0 -4
- package/src/domains/extensions/discovery.ts +69 -205
- package/src/domains/extensions/extension.ts +0 -4
- package/src/domains/extensions/index.ts +1 -5
- package/src/domains/extensions/manager.ts +1 -6
- package/src/domains/extensions/operator-commands.ts +29 -0
- package/src/domains/extensions/operator-runtime.ts +483 -0
- package/src/domains/extensions/public-api.ts +53 -0
- package/src/domains/extensions/runtime-child.mjs +114 -0
- package/src/domains/extensions/runtime-process.ts +306 -0
- package/src/domains/extensions/runtime-schema.ts +146 -0
- package/src/domains/extensions/{resources.ts → snapshot-access.ts} +1 -17
- package/src/domains/extensions/snapshot.ts +4 -32
- package/src/domains/extensions/state.ts +5 -83
- package/src/domains/extensions/types.ts +33 -34
- package/src/domains/interop/adopt.ts +546 -0
- package/src/domains/interop/detect.ts +50 -12
- package/src/domains/interop/foreign.ts +554 -0
- package/src/domains/interop/import.ts +277 -0
- package/src/domains/interop/index.ts +24 -0
- package/src/domains/interop/install.ts +6 -0
- package/src/domains/interop/inventory.ts +351 -0
- package/src/domains/interop/projection.ts +360 -0
- package/src/domains/interop/registry.ts +106 -3
- package/src/domains/interop/types.ts +51 -0
- package/src/domains/lifecycle/migrations/index.ts +0 -2
- package/src/domains/lifecycle/naming-resources.ts +1 -1
- package/src/domains/middleware/marketplace-offer.ts +1 -1
- package/src/domains/mux/contract.ts +1 -1
- package/src/domains/plugins/catalog.ts +204 -0
- package/src/domains/plugins/contract.ts +24 -0
- package/src/domains/plugins/discovery.ts +316 -0
- package/src/domains/plugins/extension.ts +40 -0
- package/src/domains/plugins/index.ts +77 -0
- package/src/domains/plugins/integrity.ts +6 -0
- package/src/domains/plugins/manifest.ts +3 -0
- package/src/domains/plugins/resources.ts +102 -0
- package/src/domains/plugins/state.ts +753 -0
- package/src/domains/plugins/types.ts +217 -0
- package/src/domains/prompts/extension.ts +9 -2
- package/src/domains/prompts/fragments/operating/skills.md +10 -10
- package/src/domains/resources/common-loader.ts +9 -6
- package/src/domains/resources/index.ts +67 -0
- package/src/domains/resources/library-actions.ts +836 -0
- package/src/domains/resources/library-evals.ts +38 -0
- package/src/domains/resources/library-inventory.ts +1048 -0
- package/src/domains/resources/library-types.ts +50 -0
- package/src/domains/resources/library-validation.ts +634 -0
- package/src/domains/resources/library.ts +437 -156
- package/src/domains/resources/package-references.ts +66 -0
- package/src/domains/resources/prompts/loader.ts +75 -41
- package/src/domains/resources/skills/install.ts +2 -2
- package/src/domains/resources/skills/loader.ts +77 -22
- package/src/domains/resources/skills/marketplace.ts +48 -57
- package/src/domains/resources/skills/promotion.ts +2 -2
- package/src/domains/resources/skills/provenance-pin.ts +17 -4
- package/src/domains/safety/action-classifier.ts +2 -2
- package/src/domains/safety/default-path-policy.ts +3 -1
- package/src/domains/safety/policy-engine.ts +1 -1
- package/src/domains/safety/protected-artifacts.ts +21 -5
- package/src/domains/safety/skill-authority.ts +5 -2
- package/src/domains/share/archive.ts +1 -1
- package/src/engine/apis/openai-completions.ts +52 -2
- package/src/engine/notices/pi-tui-LICENSE +21 -0
- package/src/engine/tui.ts +3 -0
- package/src/engine/worker-runtime.ts +58 -14
- package/src/engine/worker-tools.ts +5 -0
- package/src/entry/orchestrator.ts +26 -5
- package/src/entry/plugin-reload.ts +18 -0
- package/src/interactive/application-controller.ts +67 -21
- package/src/interactive/chat-loop.ts +32 -5
- package/src/interactive/chat-panel.ts +5 -1
- package/src/interactive/clio-editor.ts +53 -21
- package/src/interactive/command-output.ts +56 -1
- package/src/interactive/editor-submit.ts +65 -28
- package/src/interactive/fleet-run-preview.ts +2 -0
- package/src/interactive/follow-up-queue-panel.ts +3 -3
- package/src/interactive/footer/dashboard.ts +4 -1
- package/src/interactive/footer/notifications.ts +2 -2
- package/src/interactive/footer/widgets.ts +2 -2
- package/src/interactive/interactive-application.ts +209 -21
- package/src/interactive/interactive-input-runtime.ts +254 -7
- package/src/interactive/interactive-presentation.ts +41 -12
- package/src/interactive/interactive-slash-runtime.ts +37 -8
- package/src/interactive/keybinding-manager.ts +156 -79
- package/src/interactive/keyboard-owner.ts +37 -0
- package/src/interactive/leader-key.ts +49 -102
- package/src/interactive/leader-menu.ts +45 -0
- package/src/interactive/overlay-ask-user-lifecycle.ts +9 -1
- package/src/interactive/overlay-frame.ts +15 -0
- package/src/interactive/overlay-key-routing.ts +46 -47
- package/src/interactive/overlay-lifecycle.ts +30 -15
- package/src/interactive/overlay-resource-openers.ts +56 -46
- package/src/interactive/overlays/ask-user.ts +630 -556
- package/src/interactive/overlays/extension-panel.ts +70 -0
- package/src/interactive/overlays/extensions.ts +28 -5
- package/src/interactive/overlays/fleet-run-approval.ts +7 -3
- package/src/interactive/overlays/help-reference.ts +89 -40
- package/src/interactive/overlays/interop.ts +122 -3
- package/src/interactive/overlays/keybinding-detail.ts +2 -2
- package/src/interactive/overlays/library-lifecycle.ts +90 -0
- package/src/interactive/overlays/library-model.ts +574 -0
- package/src/interactive/overlays/library-review.ts +557 -0
- package/src/interactive/overlays/library-tabs.ts +3 -15
- package/src/interactive/overlays/library.ts +602 -0
- package/src/interactive/overlays/list-overlay.ts +218 -39
- package/src/interactive/overlays/model-selector.ts +28 -25
- package/src/interactive/overlays/session-selector.ts +9 -3
- package/src/interactive/overlays/settings.ts +25 -18
- package/src/interactive/overlays/tree-selector.ts +16 -11
- package/src/interactive/permission-hint.ts +13 -0
- package/src/interactive/permission-overlay.ts +77 -28
- package/src/interactive/prompt-source-label.ts +21 -0
- package/src/interactive/renderers/reference-card.ts +35 -0
- package/src/interactive/renderers/worker-entry.ts +35 -3
- package/src/interactive/slash-autocomplete.ts +99 -1
- package/src/interactive/slash-commands.ts +390 -67
- package/src/interactive/slash-spec.ts +0 -1
- package/src/interactive/terminal-lease.ts +44 -12
- package/src/interactive/turn-queues.ts +8 -7
- package/src/interactive/turn-runtime.ts +1 -1
- package/src/interactive/view/view-overlay.ts +19 -14
- package/src/interactive/welcome-dashboard.ts +525 -408
- package/src/tools/bootstrap.ts +8 -0
- package/src/tools/builtin-tool-catalog.ts +7 -2
- package/src/tools/context/index.ts +58 -5
- package/src/tools/context/library.ts +465 -0
- package/src/tools/context/surface.ts +20 -6
- package/src/tools/core-bootstrap.ts +3 -0
- package/src/tools/dispatch-admission.ts +24 -1
- package/src/tools/dispatch-arguments.ts +8 -0
- package/src/tools/dispatch-plan.ts +32 -0
- package/src/tools/dispatch-schema.ts +31 -1
- package/src/tools/dispatch-types.ts +3 -0
- package/src/tools/dispatch.ts +1 -1
- package/src/tools/harness-extensions.ts +169 -0
- package/src/tools/observation.ts +4 -0
- package/src/tools/policy.ts +7 -1
- package/src/tools/registry.ts +19 -1
- package/src/tools/worker-evidence.ts +5 -0
- package/src/worker/context-seed.ts +192 -0
- package/src/worker/entry.ts +1 -0
- package/src/worker/spec-contract.ts +8 -1
- package/dist/chunk-3UW3KU4A.js +0 -21
- package/dist/chunk-536HXRFE.js +0 -1257
- package/dist/chunk-B3MOMLJ4.js +0 -433
- package/dist/chunk-CXQ37WJH.js +0 -45
- package/dist/chunk-KTFSFCVN.js +0 -46
- package/dist/chunk-QCOV5DFY.js +0 -911
- package/dist/chunk-QRFXEO6Y.js +0 -17
- package/dist/chunk-VAHLPXPY.js +0 -399
- package/dist/interop-RVCAYECG.js +0 -115
- package/dist/library-CTKZA7K3.js +0 -226
- package/dist/skills-OXFEAWMT.js +0 -510
- package/skills/README.md +0 -418
- package/skills/meta/find-skills/SKILL.md +0 -78
- package/skills/meta/find-skills/evals.md +0 -47
- package/src/domains/extensions/resource-path.ts +0 -27
- package/src/domains/lifecycle/migrations/2026-09-01-extension-install-digests.ts +0 -27
- package/src/interactive/overlays/agents.ts +0 -70
- package/src/interactive/overlays/library-install-confirm.ts +0 -152
- package/src/interactive/overlays/prompts.ts +0 -89
- package/src/interactive/overlays/skills-hub.ts +0 -615
- /package/{skills → library/skills}/coding/ast-grep/references/rule_reference.md +0 -0
- /package/{skills → library/skills}/coding/prototype/references/LOGIC.md +0 -0
- /package/{skills → library/skills}/coding/prototype/references/UI.md +0 -0
- /package/{skills → library/skills}/coding/tdd/references/mocking.md +0 -0
- /package/{skills → library/skills}/coding/tdd/references/tests.md +0 -0
- /package/{skills → library/skills}/context/context-handoff/scripts/new-handoff.sh +0 -0
- /package/{skills → library/skills}/git/branch-closeout/evals.md +0 -0
- /package/{skills → library/skills}/git/branch-closeout/references/closeout-checklist.md +0 -0
- /package/{skills → library/skills}/git/file-ticket/assets/issue-template.md +0 -0
- /package/{skills → library/skills}/git/file-ticket/evals.md +0 -0
- /package/{skills → library/skills}/git/file-ticket/references/issue-discovery.md +0 -0
- /package/{skills → library/skills}/git/fix-issue/evals.md +0 -0
- /package/{skills → library/skills}/git/fix-issue/references/diagnosis-and-rca.md +0 -0
- /package/{skills → library/skills}/git/resolve-merge-conflicts/references/conflict-matrix.md +0 -0
- /package/{skills → library/skills}/git/ship/assets/pr-template.md +0 -0
- /package/{skills → library/skills}/git/ship/evals.md +0 -0
- /package/{skills → library/skills}/git/ship/references/remote-and-branch-policy.md +0 -0
- /package/{skills → library/skills}/git/worktree-create/evals.md +0 -0
- /package/{skills → library/skills}/git/worktree-create/references/worktree-setup.md +0 -0
- /package/{skills → library/skills}/git/worktree-merge/evals.md +0 -0
- /package/{skills → library/skills}/git/worktree-merge/references/merge-strategies.md +0 -0
- /package/{skills → library/skills}/meta/clio-coder-test/references/harness.md +0 -0
- /package/{skills → library/skills}/meta/clio-coder-test/references/test-map.md +0 -0
- /package/{skills → library/skills}/planning/archify/evals.md +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WorkerRecall } from "../domains/context/worker/recall.js";
|
|
1
2
|
/**
|
|
2
3
|
* Worker-subprocess tool construction.
|
|
3
4
|
*
|
|
@@ -29,6 +30,7 @@ import {
|
|
|
29
30
|
import { CONFIRMED_SCOPE, isSubset, READONLY_SCOPE, WORKSPACE_SCOPE } from "../domains/safety/scope.js";
|
|
30
31
|
import { effectiveToolNames } from "../tools/agent-tools.js";
|
|
31
32
|
import { assertRegisteredBuiltinTools, registerCoreTools } from "../tools/core-bootstrap.js";
|
|
33
|
+
import { registerHarnessExtensionTools } from "../tools/harness-extensions.js";
|
|
32
34
|
import type { ToolProfileName } from "../tools/profiles.js";
|
|
33
35
|
import { createRegistry, type RegistryDeps, type ToolRegistry } from "../tools/registry.js";
|
|
34
36
|
import { type AgentLedgerPort, toolSignatureOf } from "../worker/protocol.js";
|
|
@@ -139,6 +141,7 @@ export function createWorkerToolRegistry(
|
|
|
139
141
|
autonomy?: AutonomyLevel,
|
|
140
142
|
onMiddlewareEffects?: RegistryDeps["onMiddlewareEffects"],
|
|
141
143
|
agentLedger?: AgentLedgerPort,
|
|
144
|
+
workerRecall?: WorkerRecall,
|
|
142
145
|
): ToolRegistry {
|
|
143
146
|
// A worker always gets a middleware contract, even without a snapshot from
|
|
144
147
|
// the orchestrator, because the loop guard rides on it as a before_tool
|
|
@@ -163,6 +166,7 @@ export function createWorkerToolRegistry(
|
|
|
163
166
|
// is what keeps that true now that the session registry omits the tool.
|
|
164
167
|
const registration = registerCoreTools(registry, {
|
|
165
168
|
includeLedgerTools: true,
|
|
169
|
+
...(workerRecall ? { workerRecall } : {}),
|
|
166
170
|
...(agentLedger ? { agentLedger } : {}),
|
|
167
171
|
// A worker cannot install a skill or reach the operator who could, so
|
|
168
172
|
// its skill listing carries installed (or bound) skills only; the
|
|
@@ -177,6 +181,7 @@ export function createWorkerToolRegistry(
|
|
|
177
181
|
}),
|
|
178
182
|
});
|
|
179
183
|
assertRegisteredBuiltinTools(registry, registration, false);
|
|
184
|
+
registerHarnessExtensionTools(registry);
|
|
180
185
|
return registry;
|
|
181
186
|
}
|
|
182
187
|
|
|
@@ -108,6 +108,7 @@ import type { BackgroundMemoryUsageSink } from "../domains/observability/backgro
|
|
|
108
108
|
import { recordFailedCompactionCalls } from "../domains/observability/compaction-usage.js";
|
|
109
109
|
import type { ObservabilityContract } from "../domains/observability/index.js";
|
|
110
110
|
import { ObservabilityDomainModule } from "../domains/observability/index.js";
|
|
111
|
+
import { PluginsDomainModule } from "../domains/plugins/index.js";
|
|
111
112
|
import type { PromptsContract } from "../domains/prompts/contract.js";
|
|
112
113
|
import { createPromptsDomainModule } from "../domains/prompts/index.js";
|
|
113
114
|
import type { ProvidersContract, TargetDescriptor, ThinkingLevel } from "../domains/providers/index.js";
|
|
@@ -199,6 +200,7 @@ import type { BootOptions } from "./boot-options.js";
|
|
|
199
200
|
import { readCompactionSystemPrompt } from "./compaction-prompt.js";
|
|
200
201
|
import { createExtensionReloadCoordinator } from "./extension-reload.js";
|
|
201
202
|
import { resolvePanesEnablement } from "./panes-activation.js";
|
|
203
|
+
import { reloadPluginResourcesAndNotify } from "./plugin-reload.js";
|
|
202
204
|
import { bindTaskMemoryLifecycle, captureTaskMemoryUsage } from "./task-memory-lifecycle.js";
|
|
203
205
|
|
|
204
206
|
export type { BootOptions, HeadlessSamplingOverrides } from "./boot-options.js";
|
|
@@ -1005,7 +1007,7 @@ function estimateTokensAfterCompaction(entries: ReadonlyArray<SessionEntry>, res
|
|
|
1005
1007
|
}
|
|
1006
1008
|
|
|
1007
1009
|
/**
|
|
1008
|
-
*
|
|
1010
|
+
* Scoped model cycle actions step the orchestrator through the `scope` list of target
|
|
1009
1011
|
* ids or target/model refs. Absent scope is a no-op so unconfigured users
|
|
1010
1012
|
* feel nothing.
|
|
1011
1013
|
*/
|
|
@@ -1140,6 +1142,7 @@ export async function bootOrchestrator(options: BootOptions = {}): Promise<BootR
|
|
|
1140
1142
|
[
|
|
1141
1143
|
options.startupSettings ? createConfigDomainModule(options.startupSettings) : ConfigDomainModule,
|
|
1142
1144
|
ExtensionsDomainModule,
|
|
1145
|
+
PluginsDomainModule,
|
|
1143
1146
|
InteropDomainModule,
|
|
1144
1147
|
createResourcesDomainModule({
|
|
1145
1148
|
reservedPromptNames: new Set(BUILTIN_SLASH_COMMANDS.map((entry) => entry.name)),
|
|
@@ -1535,6 +1538,8 @@ export async function bootOrchestrator(options: BootOptions = {}): Promise<BootR
|
|
|
1535
1538
|
// keep evaluating after the guards and before the assessors below.
|
|
1536
1539
|
const hookReceiptLog = createHookReceiptLog({ persistPath: join(clioStateDir(), "hook-receipts.json") });
|
|
1537
1540
|
let bootHookNotices = true;
|
|
1541
|
+
const reloadPlugins = () =>
|
|
1542
|
+
reloadPluginResourcesAndNotify(process.cwd(), (event) => bus.emit(BusChannels.PluginsReloaded, event));
|
|
1538
1543
|
const extensionReload = createExtensionReloadCoordinator({
|
|
1539
1544
|
extensions,
|
|
1540
1545
|
middleware,
|
|
@@ -1545,7 +1550,10 @@ export async function bootOrchestrator(options: BootOptions = {}): Promise<BootR
|
|
|
1545
1550
|
else if (bootHookNotices) initialNotices.push(line);
|
|
1546
1551
|
else bus.emit(BusChannels.ExtensionsLoadIssue, { message: line });
|
|
1547
1552
|
},
|
|
1548
|
-
onCommitted: (event) =>
|
|
1553
|
+
onCommitted: (event) => {
|
|
1554
|
+
reloadPlugins();
|
|
1555
|
+
bus.emit(BusChannels.ExtensionsReloaded, event);
|
|
1556
|
+
},
|
|
1549
1557
|
});
|
|
1550
1558
|
extensionReload.applyBoot();
|
|
1551
1559
|
bootHookNotices = false;
|
|
@@ -1593,7 +1601,7 @@ export async function bootOrchestrator(options: BootOptions = {}): Promise<BootR
|
|
|
1593
1601
|
listInstalledSkillNames: () => resources.skills(process.cwd()).items.map((skill) => skill.name),
|
|
1594
1602
|
listMarketplaceEntries: () => discoverMarketplaceSkills({ cwd: process.cwd() }).skills,
|
|
1595
1603
|
installEntry: (entry, scope) => {
|
|
1596
|
-
const installed = installSkill({ source: entry.
|
|
1604
|
+
const installed = installSkill({ source: `skill:${entry.name}`, scope, name: entry.name, cwd: process.cwd() });
|
|
1597
1605
|
return { path: installed.path, sourceUrl: installed.sourceUrl, installedHash: installed.installedHash };
|
|
1598
1606
|
},
|
|
1599
1607
|
}),
|
|
@@ -1718,6 +1726,7 @@ export async function bootOrchestrator(options: BootOptions = {}): Promise<BootR
|
|
|
1718
1726
|
})
|
|
1719
1727
|
: null;
|
|
1720
1728
|
registerAllTools(toolRegistry, {
|
|
1729
|
+
captureWorkerContext: () => chat.captureWorkerContext?.() ?? null,
|
|
1721
1730
|
...(session
|
|
1722
1731
|
? {
|
|
1723
1732
|
session,
|
|
@@ -1803,7 +1812,7 @@ export async function bootOrchestrator(options: BootOptions = {}): Promise<BootR
|
|
|
1803
1812
|
const getCurrentSettings = (): ClioSettings => {
|
|
1804
1813
|
// Recents live in the data dir (core/recent-models.ts), never in
|
|
1805
1814
|
// settings.yaml; consumers that need them call listRecentModels
|
|
1806
|
-
// directly, so an Alt+
|
|
1815
|
+
// directly, so an Alt+M pick in another session does not churn the
|
|
1807
1816
|
// config watcher here.
|
|
1808
1817
|
const base = config?.get();
|
|
1809
1818
|
// No config domain (unit tests, degraded boot): readSettings() returns a
|
|
@@ -2000,7 +2009,7 @@ export async function bootOrchestrator(options: BootOptions = {}): Promise<BootR
|
|
|
2000
2009
|
bumpSessionState();
|
|
2001
2010
|
persistSavedMutation((saved) => setAtPath(saved, id, value));
|
|
2002
2011
|
};
|
|
2003
|
-
/**
|
|
2012
|
+
/** Scoped model cycle actions: step this session's orchestrator through the scope list. */
|
|
2004
2013
|
const cycleScopedSession = (direction: "forward" | "backward"): boolean => {
|
|
2005
2014
|
const next = advanceScopedTarget(getCurrentSettings(), direction);
|
|
2006
2015
|
if (!next) return false;
|
|
@@ -2323,6 +2332,14 @@ export async function bootOrchestrator(options: BootOptions = {}): Promise<BootR
|
|
|
2323
2332
|
await termination.shutdown(1);
|
|
2324
2333
|
return { exitCode: 1, bootTimeMs: timer.snapshot().totalMs };
|
|
2325
2334
|
}
|
|
2335
|
+
// A display-only template that reached boot (the CLI preflight answers
|
|
2336
|
+
// most of them earlier) is printed for the operator and the run ends;
|
|
2337
|
+
// its body was never model text.
|
|
2338
|
+
if (promptExpansion?.expanded === false && promptExpansion.display) {
|
|
2339
|
+
process.stdout.write(`${promptExpansion.display.text}\n`);
|
|
2340
|
+
await termination.shutdown(0);
|
|
2341
|
+
return { exitCode: 0, bootTimeMs: timer.snapshot().totalMs };
|
|
2342
|
+
}
|
|
2326
2343
|
const fileExpansion = await expandInlineFileReferencesAsync(
|
|
2327
2344
|
promptExpansion?.expanded ? promptExpansion.text : parsedSkillRequest.text,
|
|
2328
2345
|
{
|
|
@@ -2382,6 +2399,7 @@ export async function bootOrchestrator(options: BootOptions = {}): Promise<BootR
|
|
|
2382
2399
|
...(resources ? { resources } : {}),
|
|
2383
2400
|
...(extensions ? { extensions } : {}),
|
|
2384
2401
|
reloadExtensions: () => extensionReload.reload(),
|
|
2402
|
+
reloadPlugins,
|
|
2385
2403
|
...(interop ? { interop } : {}),
|
|
2386
2404
|
...(share ? { share } : {}),
|
|
2387
2405
|
...(mux ? { mux } : {}),
|
|
@@ -2435,6 +2453,9 @@ export async function bootOrchestrator(options: BootOptions = {}): Promise<BootR
|
|
|
2435
2453
|
getSettings: getCurrentSettings,
|
|
2436
2454
|
getFleetNodes: () => result.getContract<SchedulingContract>("scheduling")?.fleet?.list() ?? [],
|
|
2437
2455
|
onBackgroundDispatch: () => dispatchBackground.backgroundNewest(),
|
|
2456
|
+
// A boot-time resume opens onto an existing conversation, so the welcome
|
|
2457
|
+
// header starts collapsed rather than offering fresh-start onboarding.
|
|
2458
|
+
...(resumedSessionAtBoot ? { startsResumed: true } : {}),
|
|
2438
2459
|
...(session ? { getSessionId: () => session.current()?.id ?? null } : {}),
|
|
2439
2460
|
...(contextDomain
|
|
2440
2461
|
? {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PluginsReloadedPayload } from "../core/bus-events.js";
|
|
2
|
+
import { type PluginSnapshot, pluginSnapshotFor, reloadPluginResources } from "../domains/plugins/index.js";
|
|
3
|
+
|
|
4
|
+
/** Publish data-only plugin resources before asking session caches to refresh. */
|
|
5
|
+
export function reloadPluginResourcesAndNotify(
|
|
6
|
+
cwd: string,
|
|
7
|
+
notify: (event: PluginsReloadedPayload) => void,
|
|
8
|
+
): PluginSnapshot {
|
|
9
|
+
const previous = pluginSnapshotFor(cwd);
|
|
10
|
+
const next = reloadPluginResources(cwd);
|
|
11
|
+
notify({
|
|
12
|
+
generation: next.generation,
|
|
13
|
+
previousGeneration: previous.generation,
|
|
14
|
+
changed: previous.generation === 0 || previous.digest !== next.digest,
|
|
15
|
+
digest: next.digest,
|
|
16
|
+
});
|
|
17
|
+
return next;
|
|
18
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ClioKeybinding } from "../domains/config/keybindings.js";
|
|
2
|
-
import { isKeyRelease, matchesKey } from "../engine/tui.js";
|
|
2
|
+
import { isKeyRelease, isKeyRepeat, matchesKey } from "../engine/tui.js";
|
|
3
3
|
import type { LeaderKeyController } from "./leader-key.js";
|
|
4
4
|
import { isEscapeKey, type OverlayState, overlayOwnsInput } from "./overlay-lifecycle.js";
|
|
5
5
|
|
|
6
6
|
export const APPLICATION_DOUBLE_TAP_MS = 500;
|
|
7
7
|
|
|
8
|
-
const CLOSED_ACTION_ORDER = [
|
|
8
|
+
export const CLOSED_ACTION_ORDER = [
|
|
9
9
|
"clio-coder.output.cycle",
|
|
10
10
|
"clio-coder.notifications.dismiss",
|
|
11
11
|
"clio-coder.editor.external",
|
|
@@ -24,6 +24,7 @@ export const GLOBAL_ACTION_ORDER = [
|
|
|
24
24
|
"clio-coder.decisions.open",
|
|
25
25
|
"clio-coder.dispatch.background",
|
|
26
26
|
"clio-coder.model.select",
|
|
27
|
+
"clio-coder.library.toggle",
|
|
27
28
|
// Backward stays ahead of forward so prefix-overlapping user bindings keep
|
|
28
29
|
// the same more-specific-first behavior as the original input listener.
|
|
29
30
|
"clio-coder.model.cycleBackward",
|
|
@@ -31,7 +32,13 @@ export const GLOBAL_ACTION_ORDER = [
|
|
|
31
32
|
"clio-coder.exit",
|
|
32
33
|
] as const satisfies ReadonlyArray<ClioKeybinding>;
|
|
33
34
|
|
|
34
|
-
export type CtrlCAction =
|
|
35
|
+
export type CtrlCAction =
|
|
36
|
+
| "cancel-stream"
|
|
37
|
+
| "close-overlay"
|
|
38
|
+
| "clear-editor"
|
|
39
|
+
| "arm-shutdown"
|
|
40
|
+
| "shutdown"
|
|
41
|
+
| "protect-queue";
|
|
35
42
|
|
|
36
43
|
export interface CtrlCActionState {
|
|
37
44
|
overlayState: OverlayState;
|
|
@@ -39,13 +46,15 @@ export interface CtrlCActionState {
|
|
|
39
46
|
editorText: string;
|
|
40
47
|
lastCtrlCAt: number;
|
|
41
48
|
now: number;
|
|
49
|
+
hasQueuedMessages?: boolean;
|
|
42
50
|
}
|
|
43
51
|
|
|
44
52
|
function resolveApplicationCtrlCAction(state: CtrlCActionState): CtrlCAction {
|
|
45
53
|
if (state.overlayState !== "closed") return "close-overlay";
|
|
46
|
-
if (state.lastCtrlCAt > 0 && state.now - state.lastCtrlCAt <= APPLICATION_DOUBLE_TAP_MS) return "shutdown";
|
|
47
54
|
if (state.streaming) return "cancel-stream";
|
|
48
55
|
if (state.editorText.length > 0) return "clear-editor";
|
|
56
|
+
if (state.hasQueuedMessages) return "protect-queue";
|
|
57
|
+
if (state.lastCtrlCAt > 0 && state.now - state.lastCtrlCAt <= APPLICATION_DOUBLE_TAP_MS) return "shutdown";
|
|
49
58
|
return "arm-shutdown";
|
|
50
59
|
}
|
|
51
60
|
|
|
@@ -78,6 +87,15 @@ export interface ApplicationControllerDeps {
|
|
|
78
87
|
intervals: ApplicationIntervalCoordinator;
|
|
79
88
|
intervalsToClear: ReadonlyArray<ApplicationIntervalHandle>;
|
|
80
89
|
leaderKeys: LeaderKeyController;
|
|
90
|
+
isSearchFocused?: () => boolean;
|
|
91
|
+
closeSearch?: () => void;
|
|
92
|
+
forwardFocusedInput?: (data: string) => void;
|
|
93
|
+
cancelFocusedOwner?: () => void;
|
|
94
|
+
isAutocompleteVisible?: () => boolean;
|
|
95
|
+
matchesRepeatableInput?: (data: string) => boolean;
|
|
96
|
+
routeComposerKey?: (data: string) => boolean;
|
|
97
|
+
hasQueuedMessages?: () => boolean;
|
|
98
|
+
explainProtectedExit?: () => void;
|
|
81
99
|
getOverlayState: () => OverlayState;
|
|
82
100
|
routeOverlayKey: (data: string) => boolean;
|
|
83
101
|
/** Let pi-tui's focused Editor own dedicated prompt-history actions before app bindings. */
|
|
@@ -136,7 +154,7 @@ export interface ApplicationController {
|
|
|
136
154
|
run: Promise<number>;
|
|
137
155
|
handleInput(data: string): ApplicationInputResult;
|
|
138
156
|
handleCtrlC(): void;
|
|
139
|
-
dismissNotifications(): void;
|
|
157
|
+
dismissNotifications(all?: boolean): void;
|
|
140
158
|
shutdown(): Promise<void>;
|
|
141
159
|
}
|
|
142
160
|
|
|
@@ -152,9 +170,6 @@ export function createApplicationController(deps: ApplicationControllerDeps): Ap
|
|
|
152
170
|
const keepAlive = deps.intervals.setInterval(() => {}, 1 << 30);
|
|
153
171
|
let shuttingDown = false;
|
|
154
172
|
let lastCtrlCAt = 0;
|
|
155
|
-
let lastNotificationDismissAt = 0;
|
|
156
|
-
|
|
157
|
-
const isDoubleTap = (lastAt: number, now: number): boolean => lastAt > 0 && now - lastAt <= APPLICATION_DOUBLE_TAP_MS;
|
|
158
173
|
|
|
159
174
|
let shutdownArmed = false;
|
|
160
175
|
let armedIndicator: ApplicationIntervalHandle | null = null;
|
|
@@ -273,12 +288,31 @@ export function createApplicationController(deps: ApplicationControllerDeps): Ap
|
|
|
273
288
|
};
|
|
274
289
|
|
|
275
290
|
const handleCtrlC = (): void => {
|
|
291
|
+
deps.leaderKeys.reset();
|
|
292
|
+
if (deps.isSearchFocused?.()) {
|
|
293
|
+
deps.closeSearch?.();
|
|
294
|
+
lastCtrlCAt = 0;
|
|
295
|
+
setShutdownArmed(false);
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
if (deps.getOverlayState() !== "closed" && deps.cancelFocusedOwner) {
|
|
299
|
+
deps.cancelFocusedOwner();
|
|
300
|
+
lastCtrlCAt = 0;
|
|
301
|
+
setShutdownArmed(false);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
if (deps.getOverlayState() === "closed" && deps.cancelActiveEditorBash()) {
|
|
305
|
+
lastCtrlCAt = 0;
|
|
306
|
+
setShutdownArmed(false);
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
276
309
|
const action = resolveApplicationCtrlCAction({
|
|
277
310
|
overlayState: deps.getOverlayState(),
|
|
278
311
|
streaming: deps.isStreaming(),
|
|
279
312
|
editorText: deps.getEditorText(),
|
|
280
313
|
lastCtrlCAt,
|
|
281
314
|
now: deps.clock.now(),
|
|
315
|
+
hasQueuedMessages: deps.hasQueuedMessages?.() ?? false,
|
|
282
316
|
});
|
|
283
317
|
if (action === "shutdown") {
|
|
284
318
|
lastCtrlCAt = 0;
|
|
@@ -317,16 +351,19 @@ export function createApplicationController(deps: ApplicationControllerDeps): Ap
|
|
|
317
351
|
deps.requestRender();
|
|
318
352
|
return;
|
|
319
353
|
}
|
|
354
|
+
if (action === "protect-queue") {
|
|
355
|
+
lastCtrlCAt = 0;
|
|
356
|
+
setShutdownArmed(false);
|
|
357
|
+
deps.explainProtectedExit?.();
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
320
360
|
// arm-shutdown. The one branch that used to fall off the end of this
|
|
321
361
|
// function with nothing to show for the press.
|
|
322
362
|
setShutdownArmed(true);
|
|
323
363
|
};
|
|
324
364
|
|
|
325
|
-
const dismissNotifications = (): void => {
|
|
326
|
-
|
|
327
|
-
const doubleTap = isDoubleTap(lastNotificationDismissAt, now);
|
|
328
|
-
lastNotificationDismissAt = now;
|
|
329
|
-
if (doubleTap) {
|
|
365
|
+
const dismissNotifications = (all = false): void => {
|
|
366
|
+
if (all) {
|
|
330
367
|
deps.dismissAllNotifications();
|
|
331
368
|
return;
|
|
332
369
|
}
|
|
@@ -335,19 +372,27 @@ export function createApplicationController(deps: ApplicationControllerDeps): Ap
|
|
|
335
372
|
};
|
|
336
373
|
|
|
337
374
|
const handleInput = (data: string): ApplicationInputResult => {
|
|
338
|
-
|
|
339
|
-
if (
|
|
340
|
-
if (
|
|
375
|
+
if (isKeyRelease(data)) return { consume: true };
|
|
376
|
+
if (isKeyRepeat(data) && !(deps.matchesRepeatableInput?.(data) ?? false)) return { consume: true };
|
|
377
|
+
if (matchesKey(data, "ctrl+c")) {
|
|
378
|
+
handleCtrlC();
|
|
341
379
|
return { consume: true };
|
|
342
380
|
}
|
|
343
|
-
|
|
344
|
-
if (
|
|
345
|
-
|
|
381
|
+
if (deps.leaderKeys.isPending() && deps.leaderKeys.route(data)) return { consume: true };
|
|
382
|
+
if (deps.leaderKeys.route(data)) return { consume: true };
|
|
383
|
+
if (deps.isSearchFocused?.()) {
|
|
384
|
+
deps.forwardFocusedInput?.(data);
|
|
346
385
|
return { consume: true };
|
|
347
386
|
}
|
|
348
387
|
if (deps.routeOverlayKey(data)) return { consume: true };
|
|
349
|
-
if (overlayOwnsInput(deps.getOverlayState()))
|
|
350
|
-
|
|
388
|
+
if (overlayOwnsInput(deps.getOverlayState())) {
|
|
389
|
+
if (deps.forwardFocusedInput) {
|
|
390
|
+
deps.forwardFocusedInput(data);
|
|
391
|
+
return { consume: true };
|
|
392
|
+
}
|
|
393
|
+
return undefined;
|
|
394
|
+
}
|
|
395
|
+
if (isEscapeKey(data) && deps.isAutocompleteVisible?.()) return undefined;
|
|
351
396
|
if (isEscapeKey(data) && deps.cancelActiveEditorBash()) return { consume: true };
|
|
352
397
|
if (isEscapeKey(data) && deps.isStreaming()) {
|
|
353
398
|
deps.cancelActiveRun();
|
|
@@ -369,6 +414,7 @@ export function createApplicationController(deps: ApplicationControllerDeps): Ap
|
|
|
369
414
|
if (!deps.matchesAction(data, id)) continue;
|
|
370
415
|
return deps.dispatchAction(id) ? { consume: true } : undefined;
|
|
371
416
|
}
|
|
417
|
+
if (deps.routeComposerKey?.(data)) return { consume: true };
|
|
372
418
|
return undefined;
|
|
373
419
|
};
|
|
374
420
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { WorkerContextSnapshot } from "../domains/context/worker/contract.js";
|
|
2
|
+
import { captureWorkerContext } from "../domains/context/worker/snapshot.js";
|
|
1
3
|
/**
|
|
2
4
|
* The chat loop: one turn's state machine.
|
|
3
5
|
*
|
|
@@ -129,6 +131,7 @@ export interface QueueUpdateEvent {
|
|
|
129
131
|
* same beat. Enqueue time shows the text only in the steering-queue panel.
|
|
130
132
|
*/
|
|
131
133
|
export interface QueuedUserTurnEvent {
|
|
134
|
+
display?: { text: string; note: string };
|
|
132
135
|
type: "queued_user_turn";
|
|
133
136
|
text: string;
|
|
134
137
|
/** `interrupt` marks a message that cancelled the run and was submitted as a fresh prompt. */
|
|
@@ -198,6 +201,8 @@ export type ChatLoopEvent =
|
|
|
198
201
|
| ToolApprovalStateEvent;
|
|
199
202
|
|
|
200
203
|
export interface ChatSubmitOptions {
|
|
204
|
+
/** Presentation only; never part of the model message or persisted text. */
|
|
205
|
+
display?: { text: string; note: string };
|
|
201
206
|
/** Host-owned run identity, scoped to this submit and its internal continuations. */
|
|
202
207
|
hostRun?: ToolInvokeOptions["hostRun"];
|
|
203
208
|
images?: ReadonlyArray<ImageContent>;
|
|
@@ -315,6 +320,7 @@ export interface ChatLoop {
|
|
|
315
320
|
cancel(options?: ChatCancelOptions): void;
|
|
316
321
|
onEvent(handler: (event: ChatLoopEvent) => void): () => void;
|
|
317
322
|
getSessionId(): string | null;
|
|
323
|
+
captureWorkerContext?(): WorkerContextSnapshot | null;
|
|
318
324
|
lastRunSnapshot?(): ChatLoopRunSnapshot | null;
|
|
319
325
|
isStreaming(): boolean;
|
|
320
326
|
/**
|
|
@@ -751,7 +757,7 @@ export function createChatLoop(deps: CreateChatLoopDeps): ChatLoop {
|
|
|
751
757
|
const queues = createTurnQueues({
|
|
752
758
|
state,
|
|
753
759
|
emitQueueUpdateEvent: (messages) => emit({ type: "queue_update", messages }),
|
|
754
|
-
emitQueuedUserTurn: (entry) => emit({ type: "queued_user_turn",
|
|
760
|
+
emitQueuedUserTurn: (entry) => emit({ type: "queued_user_turn", ...entry }),
|
|
755
761
|
emitNotice,
|
|
756
762
|
// The loop's own resubmits (stranded steers, continuation requests) run
|
|
757
763
|
// from submit's finally and bypass the admission gate: an interrupt that
|
|
@@ -863,6 +869,11 @@ export function createChatLoop(deps: CreateChatLoopDeps): ChatLoop {
|
|
|
863
869
|
if (payload.changed) context.invalidateSessionPromptCache();
|
|
864
870
|
}) ?? null;
|
|
865
871
|
|
|
872
|
+
const unsubscribePluginsReload =
|
|
873
|
+
deps.bus?.on(BusChannels.PluginsReloaded, () => {
|
|
874
|
+
context.invalidateSessionPromptCache();
|
|
875
|
+
}) ?? null;
|
|
876
|
+
|
|
866
877
|
const unsubscribeSynthesisLock =
|
|
867
878
|
deps.bus?.on(BusChannels.LoopBlocked, (payload) => {
|
|
868
879
|
const disposition = (payload as { disposition?: unknown } | null)?.disposition;
|
|
@@ -1097,13 +1108,13 @@ export function createChatLoop(deps: CreateChatLoopDeps): ChatLoop {
|
|
|
1097
1108
|
// Enter while streaming means "correct it now": the engine
|
|
1098
1109
|
// steering queue drains after every tool batch, so the text
|
|
1099
1110
|
// lands as a user message before the next model turn.
|
|
1100
|
-
//
|
|
1111
|
+
// Ctrl+Q (queueFollowUp) keeps the after-this-run intent.
|
|
1101
1112
|
if (isWorkerShareNote(trimmed)) state.turnSharedWorkerNote = true;
|
|
1102
1113
|
// The queue carries the submitted bytes, not the trimmed copy the
|
|
1103
1114
|
// guard above reads: a steer is a model-facing turn and the
|
|
1104
1115
|
// payload contract applies to it too (issue #244).
|
|
1105
|
-
if (mode === "end-of-turn") queues.queueFollowUp(text);
|
|
1106
|
-
else queues.steer(text);
|
|
1116
|
+
if (mode === "end-of-turn") queues.queueFollowUp(text, options.display);
|
|
1117
|
+
else queues.steer(text, options.display);
|
|
1107
1118
|
return;
|
|
1108
1119
|
}
|
|
1109
1120
|
emitNotice("[Clio Coder] response already in progress. Press Esc to cancel the active run.");
|
|
@@ -1287,7 +1298,13 @@ export function createChatLoop(deps: CreateChatLoopDeps): ChatLoop {
|
|
|
1287
1298
|
// An interrupt was submitted while a run was active, so no caller drew
|
|
1288
1299
|
// it in the transcript; render it here, after the cancel notice and the
|
|
1289
1300
|
// cancelled run's leftovers, which is the order the ledger has.
|
|
1290
|
-
if (interrupted)
|
|
1301
|
+
if (interrupted)
|
|
1302
|
+
emit({
|
|
1303
|
+
type: "queued_user_turn",
|
|
1304
|
+
text,
|
|
1305
|
+
kind: "interrupt",
|
|
1306
|
+
...(options.display ? { display: options.display } : {}),
|
|
1307
|
+
});
|
|
1291
1308
|
context.logPromptCompileIfPending();
|
|
1292
1309
|
const previousThinkingLevel = previousRunSnapshot?.runtimeResolution?.effectiveThinkingLevel;
|
|
1293
1310
|
if (
|
|
@@ -1484,6 +1501,15 @@ export function createChatLoop(deps: CreateChatLoopDeps): ChatLoop {
|
|
|
1484
1501
|
};
|
|
1485
1502
|
},
|
|
1486
1503
|
|
|
1504
|
+
captureWorkerContext(): WorkerContextSnapshot | null {
|
|
1505
|
+
const meta = deps.session?.current();
|
|
1506
|
+
if (!meta) return null;
|
|
1507
|
+
return captureWorkerContext(
|
|
1508
|
+
{ sessionId: meta.id, leafTurnId: state.lastTurnId, cwd: meta.cwd },
|
|
1509
|
+
state.runtime?.agent.state.messages ?? state.replayedContextMessages,
|
|
1510
|
+
);
|
|
1511
|
+
},
|
|
1512
|
+
|
|
1487
1513
|
getSessionId(): string | null {
|
|
1488
1514
|
return deps.session?.current()?.id ?? null;
|
|
1489
1515
|
},
|
|
@@ -1547,6 +1573,7 @@ export function createChatLoop(deps: CreateChatLoopDeps): ChatLoop {
|
|
|
1547
1573
|
dispose(): void {
|
|
1548
1574
|
unsubscribeConfigReload?.();
|
|
1549
1575
|
unsubscribeExtensionsReload?.();
|
|
1576
|
+
unsubscribePluginsReload?.();
|
|
1550
1577
|
unsubscribeSynthesisLock?.();
|
|
1551
1578
|
unsubscribePrewarmCompaction();
|
|
1552
1579
|
prewarm.dispose();
|
|
@@ -1401,7 +1401,11 @@ export function createChatPanel(options: ChatPanelOptions = {}): ChatPanel {
|
|
|
1401
1401
|
// A queued steer or follow-up the engine just injected. Rendering it
|
|
1402
1402
|
// here, at injection time, keeps the transcript in the order the
|
|
1403
1403
|
// model saw: enqueue time shows the text only in the queue panel.
|
|
1404
|
-
transcript.push({ role: "user", text: event.text });
|
|
1404
|
+
transcript.push({ role: "user", text: event.display?.text ?? event.text });
|
|
1405
|
+
if (event.display) {
|
|
1406
|
+
const note = event.display.note;
|
|
1407
|
+
transcript.push({ role: "replayBlock", renderBlock: (width) => wrapTextWithAnsi(` ${note}`, width) });
|
|
1408
|
+
}
|
|
1405
1409
|
markDirty();
|
|
1406
1410
|
return;
|
|
1407
1411
|
}
|
|
@@ -112,7 +112,7 @@ function composerMode(chrome: EditorChrome, text: string): ComposerMode {
|
|
|
112
112
|
function lowerRailHint(theme: ClioTheme, chrome: EditorChrome): string {
|
|
113
113
|
return theme.fg(
|
|
114
114
|
"dim",
|
|
115
|
-
`${chrome.getSubmitKeyLabel?.() ?? "Enter"} send · ${chrome.getNewlineKeyLabel?.() ?? "
|
|
115
|
+
`${chrome.getSubmitKeyLabel?.() ?? "Enter"} send · ${chrome.getNewlineKeyLabel?.() ?? "Ctrl+J"} newline`,
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -205,6 +205,25 @@ function startsWithPastedOperator(text: string, pastedBangOffsets: ReadonlySet<n
|
|
|
205
205
|
export class ClioEditor extends Editor {
|
|
206
206
|
private pastedBangOffsets = new Set<number>();
|
|
207
207
|
private bracketedPasteActive = false;
|
|
208
|
+
private revision = 0;
|
|
209
|
+
private pastedOperatorTokens = new Set<string>();
|
|
210
|
+
|
|
211
|
+
get draftRevision(): number {
|
|
212
|
+
return this.revision;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** Restored queues and external buffers are literal editor content. */
|
|
216
|
+
setLiteralText(text: string): void {
|
|
217
|
+
this.setText(text);
|
|
218
|
+
this.pastedBangOffsets = new Set([...text.matchAll(/!/gu)].map((match) => match.index));
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
override applyEdit(operation: Parameters<Editor["applyEdit"]>[0]): void {
|
|
222
|
+
const before = this.getText();
|
|
223
|
+
super.applyEdit(operation);
|
|
224
|
+
this.revision += 1;
|
|
225
|
+
this.pastedBangOffsets = remapPastedBangOffsets(before, this.getText(), this.pastedBangOffsets, operation === "undo");
|
|
226
|
+
}
|
|
208
227
|
|
|
209
228
|
constructor(
|
|
210
229
|
tui: TUI,
|
|
@@ -270,18 +289,20 @@ export class ClioEditor extends Editor {
|
|
|
270
289
|
*/
|
|
271
290
|
getTextForSubmit(): string {
|
|
272
291
|
const text = this.getExpandedText();
|
|
273
|
-
return
|
|
292
|
+
return this.startsWithLiteralOperator() ? guardPastedEditorOperator(text) : text;
|
|
274
293
|
}
|
|
275
294
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
295
|
+
private startsWithLiteralOperator(): boolean {
|
|
296
|
+
const visible = this.getText();
|
|
297
|
+
return (
|
|
298
|
+
startsWithPastedOperator(visible, this.pastedBangOffsets) ||
|
|
299
|
+
[...this.pastedOperatorTokens].some((token) => visible.trimStart().startsWith(token))
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/** Paste is always literal; a later deliberate key submits it. */
|
|
284
304
|
override handleInput(data: string): void {
|
|
305
|
+
this.revision += 1;
|
|
285
306
|
const openedPaste = data.includes("\x1b[200~");
|
|
286
307
|
const closedPaste = data.includes("\x1b[201~");
|
|
287
308
|
const pasteMutation = this.bracketedPasteActive || openedPaste;
|
|
@@ -291,10 +312,7 @@ export class ClioEditor extends Editor {
|
|
|
291
312
|
// pasted bang draft for that synchronous handoff so the Bash parser can
|
|
292
313
|
// distinguish it from a typed operator; the submit controller unwraps it
|
|
293
314
|
// before sending the literal prompt onward.
|
|
294
|
-
if (
|
|
295
|
-
startsWithPastedOperator(textBeforeInput, this.pastedBangOffsets) &&
|
|
296
|
-
keybindings.matches(data, "tui.input.submit")
|
|
297
|
-
) {
|
|
315
|
+
if (this.startsWithLiteralOperator() && keybindings.matches(data, "tui.input.submit")) {
|
|
298
316
|
const pastedText = this.getTextForSubmit();
|
|
299
317
|
this.pastedBangOffsets.clear();
|
|
300
318
|
this.bracketedPasteActive = false;
|
|
@@ -322,16 +340,30 @@ export class ClioEditor extends Editor {
|
|
|
322
340
|
);
|
|
323
341
|
if (openedPaste) this.bracketedPasteActive = true;
|
|
324
342
|
if (closedPaste) this.bracketedPasteActive = false;
|
|
325
|
-
if (
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
343
|
+
if (pasteMutation && textAfterInput !== this.getExpandedText()) {
|
|
344
|
+
// A large paste is represented by an opaque visible token. Remember the
|
|
345
|
+
// inserted token through edits and undo, without depending on its format.
|
|
346
|
+
let start = 0;
|
|
347
|
+
while (
|
|
348
|
+
start < textBeforeInput.length &&
|
|
349
|
+
start < textAfterInput.length &&
|
|
350
|
+
textBeforeInput[start] === textAfterInput[start]
|
|
351
|
+
)
|
|
352
|
+
start++;
|
|
353
|
+
let oldEnd = textBeforeInput.length,
|
|
354
|
+
end = textAfterInput.length;
|
|
355
|
+
while (oldEnd > start && end > start && textBeforeInput[oldEnd - 1] === textAfterInput[end - 1]) {
|
|
356
|
+
oldEnd--;
|
|
357
|
+
end--;
|
|
358
|
+
}
|
|
359
|
+
const token = textAfterInput.slice(start, end).trimStart();
|
|
360
|
+
if (token && !token.startsWith("!")) this.pastedOperatorTokens.add(token);
|
|
361
|
+
}
|
|
332
362
|
}
|
|
333
363
|
|
|
334
364
|
override setText(text: string): void {
|
|
365
|
+
this.revision += 1;
|
|
366
|
+
this.pastedOperatorTokens.clear();
|
|
335
367
|
this.pastedBangOffsets.clear();
|
|
336
368
|
this.bracketedPasteActive = false;
|
|
337
369
|
super.setText(text);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { wrapTextWithAnsi } from "../engine/tui.js";
|
|
2
|
-
import
|
|
2
|
+
import { renderReferenceCard } from "./renderers/reference-card.js";
|
|
3
|
+
import type { PromptReferenceCard, RunIo } from "./slash-commands.js";
|
|
3
4
|
import { type ClioToken, clioTheme, GLYPH } from "./theme/index.js";
|
|
4
5
|
|
|
5
6
|
export type NoticeLevel = "info" | "success" | "warn" | "error";
|
|
@@ -54,6 +55,60 @@ export function appendOperatorCommand(text: string, sink: CommandOutputSink): vo
|
|
|
54
55
|
sink.requestRender();
|
|
55
56
|
}
|
|
56
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Render a display-only prompt template for the operator. A replay block like
|
|
60
|
+
* the command echo above: it is never persisted as a session entry and never
|
|
61
|
+
* reaches the model, which is what "display only" promises the author.
|
|
62
|
+
*/
|
|
63
|
+
export function appendReferenceCard(card: PromptReferenceCard, sink: CommandOutputSink): void {
|
|
64
|
+
sink.appendReplayBlock((width) => renderReferenceCard(card, width));
|
|
65
|
+
sink.requestRender();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* A dim line under an operator turn, in the prose gutter, saying something
|
|
70
|
+
* about the turn that the operator did not type: which template expanded, how
|
|
71
|
+
* long it was. Transcript-only, like the echo above.
|
|
72
|
+
*/
|
|
73
|
+
export function appendOperatorAside(text: string, sink: CommandOutputSink): void {
|
|
74
|
+
const normalized = text.replace(/\r/g, "").replace(/\n+/gu, " ").trim();
|
|
75
|
+
if (normalized.length === 0) return;
|
|
76
|
+
sink.appendReplayBlock((width) => {
|
|
77
|
+
const theme = clioTheme();
|
|
78
|
+
return wrapTextWithAnsi(theme.fg("dim", normalized), Math.max(1, width - 2)).map((line) => ` ${line}`);
|
|
79
|
+
});
|
|
80
|
+
sink.requestRender();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface InterviewRecordEntry {
|
|
84
|
+
/** The question's header, or its first line when it has none. */
|
|
85
|
+
label: string;
|
|
86
|
+
answer: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* What a round of an interview asked and what the operator answered, kept in
|
|
91
|
+
* the transcript once the overlay has moved on. Without it the round left
|
|
92
|
+
* only a tool row reading `▸ tool action {"action":"ask",…`, and the answers
|
|
93
|
+
* lived on `/decisions` alone.
|
|
94
|
+
*/
|
|
95
|
+
export function appendInterviewRecord(entries: ReadonlyArray<InterviewRecordEntry>, sink: CommandOutputSink): void {
|
|
96
|
+
const kept = entries.filter((entry) => entry.answer.trim().length > 0);
|
|
97
|
+
if (kept.length === 0) return;
|
|
98
|
+
sink.appendReplayBlock((width) => {
|
|
99
|
+
const theme = clioTheme();
|
|
100
|
+
const lines: string[] = [];
|
|
101
|
+
const inner = Math.max(1, width - 2);
|
|
102
|
+
for (const entry of kept) {
|
|
103
|
+
const label = entry.label.replace(/\s+/gu, " ").trim();
|
|
104
|
+
lines.push(...wrapTextWithAnsi(`${theme.fg("accent", GLYPH.cursor)} ${theme.fg("dim", label)}`, width));
|
|
105
|
+
lines.push(...wrapTextWithAnsi(theme.fg("muted", entry.answer.trim()), inner).map((line) => ` ${line}`));
|
|
106
|
+
}
|
|
107
|
+
return lines;
|
|
108
|
+
});
|
|
109
|
+
sink.requestRender();
|
|
110
|
+
}
|
|
111
|
+
|
|
57
112
|
export type CommandOutputReplayBlock = (width: number) => string[];
|
|
58
113
|
|
|
59
114
|
export interface CommandOutputSink {
|