@iowarp/clio-coder 0.4.5 → 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 +74 -0
- package/CONTRIBUTING.md +116 -38
- package/NOTICE +24 -0
- package/README.md +341 -682
- package/dist/{acp-H3CU2HBQ.js → acp-W3Y3TRHD.js} +12 -12
- package/dist/{agents-IXQQZ7BD.js → agents-J4ICNLQ3.js} +57 -56
- 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-R7KYF7N3.js → auth-X2UJUMOC.js} +25 -25
- package/dist/{builtins-CRFDQUVP.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-SE4ZKILO.js → chunk-3XE4NRLF.js} +30 -9
- package/dist/{chunk-YYB3MC65.js → chunk-4MFBBY2Z.js} +3 -3
- package/dist/{chunk-5VTJP36Q.js → chunk-4N2RZ4TO.js} +2 -2
- package/dist/{chunk-FKIOX6DS.js → chunk-4QKAITQT.js} +10 -5
- package/dist/chunk-4UHVS5T7.js +207 -0
- package/dist/{chunk-VLPTKCKT.js → chunk-5AJPUR72.js} +6 -6
- package/dist/{chunk-5CY4Q6QI.js → chunk-5EQO5NWP.js} +105 -3
- package/dist/{chunk-RXIOCVBZ.js → chunk-65BGHOUR.js} +8 -5
- package/dist/{chunk-T53XI6I7.js → chunk-6CA2BHOR.js} +2 -2
- package/dist/{chunk-HL26ADLH.js → chunk-6CB2IL4N.js} +2 -1
- package/dist/{chunk-HR3HPQ76.js → chunk-6LRLOJHQ.js} +3 -3
- package/dist/{chunk-HXHFDHB6.js → chunk-6TAATXXH.js} +6 -6
- package/dist/{chunk-WFKDPU7U.js → chunk-6YHPAAZR.js} +3 -3
- package/dist/{chunk-ZMZQEBKI.js → chunk-7EEGBKV4.js} +11 -11
- package/dist/{chunk-BS4GAMUB.js → chunk-A67NR5AT.js} +2 -2
- package/dist/{chunk-WJIMKGD6.js → chunk-BAU36233.js} +8 -8
- package/dist/{chunk-MDU3C27C.js → chunk-BO4XV5VX.js} +8 -8
- package/dist/{chunk-KF6GFW6O.js → chunk-BQQ5MXUC.js} +11 -11
- package/dist/{chunk-K6RDB7IA.js → chunk-C3G5PNUO.js} +23 -23
- package/dist/{chunk-SRZOW5L2.js → chunk-C6GEXX4L.js} +1 -1
- package/dist/{chunk-U2JOLB7O.js → chunk-CE64C5K5.js} +227 -72
- package/dist/chunk-CP3HIR5H.js +2119 -0
- package/dist/{chunk-BBV5TKE6.js → chunk-CPXGJI2A.js} +2 -2
- package/dist/{chunk-5DDOTTG4.js → chunk-CULVKYTK.js} +5 -5
- package/dist/{chunk-F34AR6O3.js → chunk-D2T66PDV.js} +6 -6
- package/dist/{chunk-NF3BK5WR.js → chunk-DACXIVVF.js} +5 -5
- package/dist/{chunk-4SVIVOMC.js → chunk-DLIYANB7.js} +20 -15
- package/dist/{chunk-E3BQTQUP.js → chunk-DO7M3LSX.js} +9 -9
- package/dist/{chunk-2QPI3TR3.js → chunk-DVJL77SO.js} +2 -2
- package/dist/chunk-EM2WNQS2.js +93 -0
- package/dist/{chunk-ODUTYZIU.js → chunk-EUEXGXXR.js} +5 -5
- package/dist/{chunk-UL36QJX6.js → chunk-EUZRMP4Y.js} +18 -16
- package/dist/{chunk-R6MAYTMS.js → chunk-G4LGUTOE.js} +4 -4
- package/dist/{chunk-CBSKDFWL.js → chunk-GEVQNST4.js} +2 -2
- package/dist/{chunk-XXBQKW32.js → chunk-GFQ7P2UF.js} +7 -7
- package/dist/{chunk-SBZX6ARC.js → chunk-GI5RRMAH.js} +14 -14
- package/dist/{chunk-KDWLXVMN.js → chunk-GVZFCJHE.js} +343 -113
- package/dist/{chunk-633EXGZA.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-KYKNBD4Y.js → chunk-IJMW64DX.js} +978 -258
- package/dist/{chunk-DIMRLNIC.js → chunk-IMOD2YPV.js} +16 -9
- package/dist/{chunk-6CDNRHWH.js → chunk-IQCNVLO6.js} +28 -8
- package/dist/{chunk-UTUNT5QL.js → chunk-ISNCCX42.js} +9 -9
- package/dist/{chunk-RLTT5GVY.js → chunk-IZYTT3CD.js} +9 -5
- package/dist/{chunk-5ZMXGW7P.js → chunk-KAFMW7WM.js} +4 -85
- package/dist/chunk-KKEYGFX4.js +915 -0
- package/dist/{chunk-HHVJNVUJ.js → chunk-KS7ETA3P.js} +2 -2
- package/dist/{chunk-UXAC2FX4.js → chunk-L3Z5ANCV.js} +7 -7
- package/dist/{chunk-EHCPSZJF.js → chunk-LBFQMYS3.js} +2 -2
- package/dist/{chunk-QEQISF75.js → chunk-LK2FN5JY.js} +1 -1
- package/dist/{chunk-URBGEOH3.js → chunk-M6Z2V6YU.js} +5 -5
- package/dist/{chunk-DRD2A54W.js → chunk-MBJO5VNZ.js} +18 -18
- package/dist/chunk-MNQN3X6Y.js +595 -0
- package/dist/{chunk-GXCCHKN6.js → chunk-MZHXENL7.js} +7 -7
- package/dist/chunk-MZNWZUJM.js +1801 -0
- package/dist/{chunk-7YJWEF2L.js → chunk-N37QC5FV.js} +5 -5
- package/dist/{chunk-WLMSOT73.js → chunk-NCCQ6DVS.js} +7 -7
- package/dist/{chunk-TZ7MFRG4.js → chunk-NO7J45X6.js} +170 -53
- package/dist/chunk-OH3YYA3B.js +15 -0
- package/dist/{chunk-22PQ4TX4.js → chunk-P4DL2LM5.js} +16 -77
- package/dist/{chunk-R6MICQYU.js → chunk-PFLOULP3.js} +4 -4
- package/dist/{chunk-MC3JSVR6.js → chunk-QJMRYTCX.js} +7 -7
- package/dist/{chunk-ILJ7DWGE.js → chunk-QKWL7SYE.js} +12 -12
- package/dist/chunk-R2CT5YDO.js +66 -0
- package/dist/chunk-RFCKPS2V.js +26 -0
- package/dist/{chunk-ONRTXOZY.js → chunk-RTLNFZMD.js} +12 -4
- package/dist/{chunk-U7H5WRG5.js → chunk-RXFPB32E.js} +8 -6
- package/dist/{chunk-S32UQ5GL.js → chunk-SEDI5K5B.js} +18 -18
- package/dist/{chunk-ICO4TQ2F.js → chunk-SELG4SUR.js} +41 -25
- package/dist/{chunk-YEJIG7LN.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-HGSLRG33.js → chunk-TLTGZTXI.js} +3 -3
- package/dist/chunk-TZ6UVP2H.js +637 -0
- package/dist/{chunk-EWD5P3GK.js → chunk-TZHN5ITX.js} +13 -41
- package/dist/{chunk-7TKWWPD7.js → chunk-U3TPUXOQ.js} +398 -253
- package/dist/{chunk-GNQRWTMY.js → chunk-UA3W4FGC.js} +6 -6
- package/dist/{chunk-O2RQ7LCK.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-I7VLWRK2.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-GVYWZNRK.js → chunk-WBVKKTUT.js} +2 -2
- package/dist/{chunk-EHOSNVVM.js → chunk-WLHX3MM5.js} +6 -2
- package/dist/{chunk-SDWNDICN.js → chunk-WN552PKN.js} +573 -316
- package/dist/{chunk-TEG3RYVZ.js → chunk-WT5TRMO4.js} +51 -26
- package/dist/{chunk-NY6IWDVU.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-FSTIBAGM.js → chunk-XZ6UFQ52.js} +11 -11
- package/dist/chunk-Y3JU5RPK.js +8 -0
- package/dist/chunk-YKRJTYNP.js +1143 -0
- package/dist/{chunk-7HBHHVCK.js → chunk-YPRSNUTC.js} +2 -2
- package/dist/{chunk-PWWSIB2A.js → chunk-ZGIGW4ZG.js} +5 -5
- package/dist/cli/index.js +34 -36
- package/dist/{clio-5I2IBFYL.js → clio-L2P7S2R2.js} +9 -9
- package/dist/{code-nav-YXIAEZVS.js → code-nav-B5LNX4KU.js} +25 -25
- package/dist/{components-TNIKXCBH.js → components-63MMQKUT.js} +6 -6
- package/dist/{config-Y2JDJ3JJ.js → config-YXARKGTX.js} +81 -77
- package/dist/configure-LMVQJ46J.js +85 -0
- package/dist/{context-QQ53HSGJ.js → context-7HJEWTTP.js} +92 -48
- package/dist/{context-S2EEC3EJ.js → context-XSZKKFBW.js} +14 -14
- package/dist/{context-P5YSEO55.js → context-YG2LZDYZ.js} +67 -64
- package/dist/{context-clear-TMEQCOTH.js → context-clear-AC5NXHM2.js} +64 -61
- 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-CNLSQN5K.js → context-working-set-F4Q4J3NS.js} +15 -12
- package/dist/{detail-5572VLBO.js → detail-H73BEF2N.js} +65 -62
- package/dist/{dispatch-runner-FRHD6P2O.js → dispatch-runner-3RY5FSJC.js} +83 -80
- package/dist/{doctor-N3LCM2LG.js → doctor-EQYJOGUG.js} +47 -32
- package/dist/{eval-BUU3ZOUZ.js → eval-4P7O6CCE.js} +114 -50
- package/dist/{evidence-DTGEN456.js → evidence-D6GUSYJW.js} +64 -61
- package/dist/{evidence-SQ5DNFEN.js → evidence-O76QF7TZ.js} +69 -65
- package/dist/{evolve-IJNUFZDS.js → evolve-H47BCETS.js} +65 -62
- package/dist/{extensions-YVRHX6ZI.js → extensions-NNL3ZOCU.js} +98 -20
- package/dist/{fleet-ZNNVSYFO.js → fleet-KMNS6NOM.js} +115 -107
- package/dist/{fleet-commands-5YE7NPJL.js → fleet-commands-DOWSYCBX.js} +15 -15
- package/dist/{fleet-decisions-3SBSCTCW.js → fleet-decisions-S3PTZV2D.js} +9 -9
- package/dist/{fleet-graph-6HHPWF5T.js → fleet-graph-F2DE2TME.js} +26 -24
- package/dist/{fleet-inspect-JEYMGCGC.js → fleet-inspect-EN2Q6IVB.js} +67 -63
- package/dist/{fleet-preflight-QRSHIIDE.js → fleet-preflight-FRLETDD3.js} +3 -3
- package/dist/{fleet-validate-4PM4GDDL.js → fleet-validate-B2XDLS57.js} +28 -29
- package/dist/{fleet-verify-NJDTHTO3.js → fleet-verify-4JKUWGJ7.js} +64 -61
- package/dist/{fleet-view-UP2BWQQY.js → fleet-view-BHJFW26B.js} +67 -63
- package/dist/{init-S3GZQ5ZF.js → init-XAT5N5YM.js} +86 -80
- package/dist/interop-FVECHFKG.js +246 -0
- package/dist/{inventory-K2OZ36YJ.js → inventory-7KFQGLCV.js} +67 -63
- 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-OQOXQGYD.js → memory-DYVTTCP6.js} +65 -62
- package/dist/{models-3IK2Y5WE.js → models-MASFJ6Y2.js} +51 -38
- package/dist/{monitor-FTJLTKCQ.js → monitor-YMP4NXJJ.js} +73 -69
- package/dist/{orchestrator-N47O7SFD.js → orchestrator-AFQRRTEI.js} +4255 -2845
- 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-65U34NG6.js → preload-5Q7VXRFJ.js} +64 -61
- package/dist/{reset-MUVQDLNL.js → reset-7NKZK7JN.js} +11 -9
- package/dist/{resources-LM76COAO.js → resources-NILSIZAT.js} +94 -38
- package/dist/{run-3VFZQ33N.js → run-BPZGEBZV.js} +131 -114
- package/dist/{share-4JUB4BL7.js → share-EZ6ERBMH.js} +31 -28
- package/dist/skills-BTVVNYVM.js +100 -0
- package/dist/{skills-eval-G6T57L7M.js → skills-eval-UY34MNK7.js} +117 -78
- package/dist/{skills-inventory-WLM46PJH.js → skills-inventory-JDHSIA7I.js} +30 -25
- package/dist/{slash-commands-GBARG3Y7.js → slash-commands-K4FNQ2AT.js} +53 -49
- package/dist/{steer-S7D7IKPU.js → steer-2B3EQGFH.js} +4 -4
- package/dist/{support-5VAEC32W.js → support-L2SOL3IE.js} +7 -7
- package/dist/{targets-N5REUETU.js → targets-44VKGFLN.js} +69 -47
- package/dist/{tasks-6BVY5YZF.js → tasks-3KODKFU7.js} +14 -14
- package/dist/{terminal-lease-57UEOJKS.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-4HD5HAIV.js → upgrade-7PMKM2JH.js} +17 -18
- package/dist/{usage-4GWM2WWP.js → usage-6EQV7EQK.js} +77 -73
- package/dist/{verifiers-GSKWKWVG.js → verifiers-JLITWSHU.js} +16 -16
- package/dist/{verify-3AS3ULCY.js → verify-T7NAEVIG.js} +13 -13
- package/dist/{web-fetch-MQN4FH3X.js → web-fetch-W4TNW4Q7.js} +4 -4
- package/dist/{wiki-generate-7BV7XWIY.js → wiki-generate-T2TJQJUA.js} +90 -84
- package/dist/{with-panes-OFTNAR4Y.js → with-panes-CHFC7HGI.js} +4 -4
- package/dist/worker/entry.js +297 -88
- 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 +36 -2
- 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 +153 -39
- 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 +186 -80
- package/docs/guide/configuration-and-targets.md +123 -28
- package/docs/guide/configuration-reference.md +36 -38
- 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 +32 -10
- package/docs/guide/glossary.md +2 -2
- package/docs/guide/harness-extensions.md +291 -0
- package/docs/guide/installation-and-lifecycle.md +53 -20
- 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 +15 -15
- package/docs/process/documentation-coverage.md +29 -2
- 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 +22 -6
- 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/ask.ts +10 -10
- package/src/cli/config-inspect.ts +1 -1
- package/src/cli/configure-editor.ts +51 -0
- package/src/cli/configure-interop.ts +1 -1
- package/src/cli/configure-oauth.ts +1 -1
- package/src/cli/configure-onboarding.ts +232 -96
- package/src/cli/configure-prompts.ts +76 -0
- package/src/cli/configure-quick.ts +274 -0
- package/src/cli/configure-target.ts +14 -2
- package/src/cli/configure.ts +415 -176
- 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/oauth-manual-input.ts +1 -1
- package/src/cli/reset.ts +2 -0
- package/src/cli/run.ts +26 -9
- package/src/cli/select.ts +35 -4
- 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/cli/upgrade.ts +2 -2
- package/src/core/bus-events.ts +5 -0
- package/src/core/config.ts +6 -1
- package/src/core/defaults.ts +34 -12
- package/src/{interactive → core}/external-editor.ts +4 -4
- 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/classify.ts +1 -1
- package/src/domains/config/keybindings.ts +156 -124
- 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/providers/probe/fingerprint.ts +13 -6
- package/src/domains/providers/probe/reasoning.ts +2 -0
- package/src/domains/providers/runtimes/common/probe-helpers.ts +23 -7
- package/src/domains/providers/runtimes/protocol/anthropic-compat.ts +7 -2
- package/src/domains/providers/runtimes/protocol/openai-compat.ts +10 -4
- 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 +68 -52
- package/src/interactive/chat-loop.ts +32 -5
- package/src/interactive/chat-panel.ts +168 -638
- package/src/interactive/chat-renderer.ts +13 -30
- package/src/interactive/clio-editor.ts +53 -21
- package/src/interactive/command-output.ts +56 -1
- package/src/interactive/dispatch-board.ts +1 -3
- package/src/interactive/editor-submit.ts +73 -59
- 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 +12 -4
- package/src/interactive/footer/notifications.ts +2 -2
- package/src/interactive/footer/widgets.ts +52 -93
- package/src/interactive/interactive-application.ts +225 -63
- package/src/interactive/interactive-event-projection.ts +2 -44
- package/src/interactive/interactive-input-runtime.ts +257 -35
- package/src/interactive/interactive-presentation.ts +71 -21
- package/src/interactive/interactive-slash-runtime.ts +40 -48
- package/src/interactive/keybinding-manager.ts +156 -79
- package/src/interactive/keyboard-owner.ts +37 -0
- package/src/interactive/layout.ts +29 -4
- 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-general-openers.ts +2 -0
- package/src/interactive/overlay-key-routing.ts +46 -47
- package/src/interactive/overlay-lifecycle.ts +31 -15
- package/src/interactive/overlay-resource-openers.ts +56 -46
- package/src/interactive/overlay-session-lifecycle.ts +1 -1
- 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 +34 -26
- 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/preview.ts +16 -0
- package/src/interactive/renderers/reference-card.ts +35 -0
- package/src/interactive/renderers/tool-execution.ts +67 -160
- package/src/interactive/renderers/worker-entry.ts +90 -42
- package/src/interactive/slash-autocomplete.ts +100 -7
- package/src/interactive/slash-commands.ts +396 -105
- package/src/interactive/slash-spec.ts +0 -1
- package/src/interactive/status/controller.ts +0 -5
- package/src/interactive/status/state-machine.ts +44 -26
- package/src/interactive/status/types.ts +3 -0
- package/src/interactive/status/verbs.ts +13 -12
- package/src/interactive/terminal-lease.ts +44 -12
- package/src/interactive/transcript-detail.ts +50 -112
- package/src/interactive/turn-queues.ts +8 -7
- package/src/interactive/turn-runtime.ts +1 -1
- package/src/interactive/view/artifacts.ts +4 -0
- package/src/interactive/view/view-overlay.ts +58 -43
- 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/presentation.ts +1 -1
- package/src/tools/registry.ts +20 -2
- package/src/tools/verify/numeric.ts +4 -4
- 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-6SYEGZI3.js +0 -433
- package/dist/chunk-CXQ37WJH.js +0 -45
- package/dist/chunk-EQEJJ53P.js +0 -399
- package/dist/chunk-KTFSFCVN.js +0 -46
- package/dist/chunk-QRFXEO6Y.js +0 -17
- package/dist/chunk-T7FDXNRU.js +0 -1257
- package/dist/chunk-U7VQ4NI4.js +0 -911
- package/dist/configure-SML6UBZ5.js +0 -55
- package/dist/interop-YOTGXFJM.js +0 -115
- package/dist/library-GJI6W6OK.js +0 -226
- package/dist/skills-S36AAJHU.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
|
@@ -0,0 +1,1143 @@
|
|
|
1
|
+
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
evaluateClioCompatibility,
|
|
4
|
+
extensionContentDigest,
|
|
5
|
+
extensionContentDigestWithCapture,
|
|
6
|
+
isSemanticVersion
|
|
7
|
+
} from "./chunk-XW2UZICE.js";
|
|
8
|
+
import {
|
|
9
|
+
canonicalizeExistingPath
|
|
10
|
+
} from "./chunk-KQ6IDQIB.js";
|
|
11
|
+
import {
|
|
12
|
+
require_dist
|
|
13
|
+
} from "./chunk-B5GGDIHT.js";
|
|
14
|
+
import {
|
|
15
|
+
safeResourceWrite
|
|
16
|
+
} from "./chunk-ZZFWWYLX.js";
|
|
17
|
+
import {
|
|
18
|
+
clioConfigDir
|
|
19
|
+
} from "./chunk-CTTI7G3T.js";
|
|
20
|
+
import {
|
|
21
|
+
__toESM,
|
|
22
|
+
init_esm_shims
|
|
23
|
+
} from "./chunk-ECBHH7LU.js";
|
|
24
|
+
|
|
25
|
+
// src/domains/resources/library-types.ts
|
|
26
|
+
init_esm_shims();
|
|
27
|
+
var LIBRARY_KINDS = ["plugin", "skill", "agent", "prompt", "fleet"];
|
|
28
|
+
function isLibraryKind(value) {
|
|
29
|
+
return typeof value === "string" && LIBRARY_KINDS.includes(value);
|
|
30
|
+
}
|
|
31
|
+
var LIBRARY_RESOURCE_KINDS = ["skill", "agent", "prompt", "fleet"];
|
|
32
|
+
function isLibraryResourceKind(value) {
|
|
33
|
+
return typeof value === "string" && LIBRARY_RESOURCE_KINDS.includes(value);
|
|
34
|
+
}
|
|
35
|
+
var LIBRARY_PROVIDES_LIMITS = { entries: 256, name: 128, description: 256 };
|
|
36
|
+
|
|
37
|
+
// src/domains/plugins/discovery.ts
|
|
38
|
+
init_esm_shims();
|
|
39
|
+
import { createHash } from "node:crypto";
|
|
40
|
+
import { existsSync, lstatSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
41
|
+
import path from "node:path";
|
|
42
|
+
|
|
43
|
+
// src/domains/plugins/integrity.ts
|
|
44
|
+
init_esm_shims();
|
|
45
|
+
|
|
46
|
+
// src/domains/plugins/discovery.ts
|
|
47
|
+
var PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
48
|
+
var PLUGIN_EXTENSION_KEY = "ai.iowarp.clio";
|
|
49
|
+
var PLUGIN_RESOURCE_KINDS = ["skills", "prompts", "agents", "fleets", "themes"];
|
|
50
|
+
var COMPONENT_KINDS = /* @__PURE__ */ new Set(["prompt", "agent", "skill", "fleet", "script", "resource", "tool"]);
|
|
51
|
+
var ROOT_KEYS = /* @__PURE__ */ new Set([
|
|
52
|
+
"$schema",
|
|
53
|
+
"name",
|
|
54
|
+
"version",
|
|
55
|
+
"description",
|
|
56
|
+
"author",
|
|
57
|
+
"homepage",
|
|
58
|
+
"repository",
|
|
59
|
+
"license",
|
|
60
|
+
"keywords",
|
|
61
|
+
"extensions"
|
|
62
|
+
]);
|
|
63
|
+
function isPluginId(value) {
|
|
64
|
+
return value.length <= 64 && /^(?!.*(?:--|\.\.))[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/u.test(value) && value !== "state.json";
|
|
65
|
+
}
|
|
66
|
+
function pluginPathContained(root, target) {
|
|
67
|
+
const relative = path.relative(root, target);
|
|
68
|
+
return relative === "" || relative !== ".." && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative);
|
|
69
|
+
}
|
|
70
|
+
function pluginResourcePath(root, value, allowRoot = false) {
|
|
71
|
+
if (!value || value.includes("\\") || path.isAbsolute(value))
|
|
72
|
+
throw new Error(`plugin path must be relative: ${value}`);
|
|
73
|
+
const lexicalRoot = path.resolve(root);
|
|
74
|
+
const lexical = path.resolve(lexicalRoot, value);
|
|
75
|
+
if (!allowRoot && lexical === lexicalRoot || !pluginPathContained(lexicalRoot, lexical))
|
|
76
|
+
throw new Error(`plugin path escapes root: ${value}`);
|
|
77
|
+
const canonicalRoot = realpathSync(lexicalRoot);
|
|
78
|
+
const canonical = realpathSync(lexical);
|
|
79
|
+
if (!pluginPathContained(canonicalRoot, canonical) || !allowRoot && canonical === canonicalRoot)
|
|
80
|
+
throw new Error(`plugin path escapes through a symbolic link: ${value}`);
|
|
81
|
+
return canonical;
|
|
82
|
+
}
|
|
83
|
+
function record(value) {
|
|
84
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
85
|
+
}
|
|
86
|
+
function requireKeys(value, allowed, label) {
|
|
87
|
+
for (const key of Object.keys(value)) if (!allowed.has(key)) throw new Error(`unknown ${label} key '${key}'`);
|
|
88
|
+
}
|
|
89
|
+
function components(value, root) {
|
|
90
|
+
if (value === void 0) return [];
|
|
91
|
+
if (!Array.isArray(value) || value.length > 1024)
|
|
92
|
+
throw new Error("components must be an array of at most 1024 entries");
|
|
93
|
+
const refs = /* @__PURE__ */ new Map();
|
|
94
|
+
for (const raw of value) {
|
|
95
|
+
if (!record(raw)) throw new Error("component must be an object");
|
|
96
|
+
requireKeys(raw, /* @__PURE__ */ new Set(["kind", "id", "path", "requires"]), "component");
|
|
97
|
+
if (typeof raw.kind !== "string" || !COMPONENT_KINDS.has(raw.kind)) throw new Error("unsupported component kind");
|
|
98
|
+
if (typeof raw.id !== "string" || raw.id.length > 80 || !/^[a-z0-9][a-z0-9._-]*$/u.test(raw.id))
|
|
99
|
+
throw new Error("component id must be a stable lowercase identifier");
|
|
100
|
+
if (typeof raw.path !== "string") throw new Error(`component ${raw.id} must have a relative path`);
|
|
101
|
+
const file = pluginResourcePath(root, raw.path);
|
|
102
|
+
if (!statSync(file).isFile()) throw new Error(`component ${raw.id} path must be a file`);
|
|
103
|
+
if (raw.kind === "skill" && path.basename(file) !== "SKILL.md")
|
|
104
|
+
throw new Error(`skill component ${raw.id} must point to SKILL.md`);
|
|
105
|
+
if (raw.requires !== void 0 && (!Array.isArray(raw.requires) || raw.requires.some((ref2) => typeof ref2 !== "string")))
|
|
106
|
+
throw new Error(`component ${raw.id} requires must be an array of component references`);
|
|
107
|
+
const item = {
|
|
108
|
+
kind: raw.kind,
|
|
109
|
+
id: raw.id,
|
|
110
|
+
path: raw.path,
|
|
111
|
+
...raw.requires !== void 0 ? { requires: raw.requires } : {}
|
|
112
|
+
};
|
|
113
|
+
const ref = `${item.kind}:${item.id}`;
|
|
114
|
+
if (refs.has(ref)) throw new Error(`duplicate component reference: ${ref}`);
|
|
115
|
+
refs.set(ref, item);
|
|
116
|
+
}
|
|
117
|
+
const visiting = /* @__PURE__ */ new Set();
|
|
118
|
+
const visited = /* @__PURE__ */ new Set();
|
|
119
|
+
const visit = (ref) => {
|
|
120
|
+
if (visiting.has(ref)) throw new Error(`component dependency cycle at ${ref}`);
|
|
121
|
+
if (visited.has(ref)) return;
|
|
122
|
+
const item = refs.get(ref);
|
|
123
|
+
if (!item) throw new Error(`missing component reference: ${ref}`);
|
|
124
|
+
visiting.add(ref);
|
|
125
|
+
for (const dependency of item.requires ?? []) visit(dependency);
|
|
126
|
+
visiting.delete(ref);
|
|
127
|
+
visited.add(ref);
|
|
128
|
+
};
|
|
129
|
+
for (const ref of refs.keys()) visit(ref);
|
|
130
|
+
return [...refs.values()];
|
|
131
|
+
}
|
|
132
|
+
function clioConfiguration(value, root) {
|
|
133
|
+
if (value !== void 0 && !record(value)) throw new Error(`${PLUGIN_EXTENSION_KEY} must be an object`);
|
|
134
|
+
const raw = value ?? {};
|
|
135
|
+
requireKeys(
|
|
136
|
+
raw,
|
|
137
|
+
/* @__PURE__ */ new Set(["manifestVersion", "kind", "requires", "evals", "compatibility", "resources", "components"]),
|
|
138
|
+
PLUGIN_EXTENSION_KEY
|
|
139
|
+
);
|
|
140
|
+
if (value !== void 0 && raw.manifestVersion !== 1) throw new Error("Clio plugin manifestVersion must be 1");
|
|
141
|
+
const kind = raw.kind ?? "plugin";
|
|
142
|
+
if (!isLibraryKind(kind)) throw new Error("package kind must be plugin, skill, agent, prompt, or fleet");
|
|
143
|
+
if (raw.requires !== void 0 && (!Array.isArray(raw.requires) || raw.requires.some(
|
|
144
|
+
(ref) => typeof ref !== "string" || !/^(plugin|skill|agent|prompt|fleet):[a-z0-9][a-z0-9.-]*$/.test(ref)
|
|
145
|
+
)))
|
|
146
|
+
throw new Error("package requires must contain kind:name references");
|
|
147
|
+
const evals = {};
|
|
148
|
+
if (raw.evals !== void 0) {
|
|
149
|
+
if (!record(raw.evals)) throw new Error("package evals must map names to Suite v2 files");
|
|
150
|
+
for (const [id, file] of Object.entries(raw.evals)) {
|
|
151
|
+
if (!isPluginId(id) || typeof file !== "string" || !statSync(pluginResourcePath(root, file)).isFile())
|
|
152
|
+
throw new Error(`invalid package eval: ${id}`);
|
|
153
|
+
evals[id] = file;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
let compatibility;
|
|
157
|
+
if (raw.compatibility !== void 0) {
|
|
158
|
+
if (!record(raw.compatibility)) throw new Error("compatibility must be an object");
|
|
159
|
+
requireKeys(raw.compatibility, /* @__PURE__ */ new Set(["clio"]), "compatibility");
|
|
160
|
+
if (raw.compatibility.clio !== void 0 && (typeof raw.compatibility.clio !== "string" || !evaluateClioCompatibility(raw.compatibility.clio).rangeValid))
|
|
161
|
+
throw new Error("compatibility.clio must be a valid SemVer range");
|
|
162
|
+
compatibility = raw.compatibility;
|
|
163
|
+
}
|
|
164
|
+
const resources = {};
|
|
165
|
+
if (existsSync(path.join(root, "skills"))) resources.skills = "skills";
|
|
166
|
+
if (raw.resources !== void 0) {
|
|
167
|
+
if (!record(raw.resources)) throw new Error("resources must be an object");
|
|
168
|
+
requireKeys(raw.resources, new Set(PLUGIN_RESOURCE_KINDS), "resources");
|
|
169
|
+
for (const kind2 of PLUGIN_RESOURCE_KINDS) {
|
|
170
|
+
const resource = raw.resources[kind2];
|
|
171
|
+
if (resource === void 0) continue;
|
|
172
|
+
if (typeof resource !== "string") throw new Error(`resources.${kind2} must be a relative directory`);
|
|
173
|
+
resources[kind2] = resource;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
for (const [resourceKind, relative] of Object.entries(resources)) {
|
|
177
|
+
const full = pluginResourcePath(root, relative, kind === "skill" && relative === ".");
|
|
178
|
+
if (!statSync(full).isDirectory()) throw new Error(`resources.${resourceKind} must be a directory`);
|
|
179
|
+
if (resourceKind === "skills" && relative !== "." && path.resolve(root, relative) !== path.join(path.resolve(root), "skills"))
|
|
180
|
+
throw new Error("portable skills must use the root skills directory");
|
|
181
|
+
}
|
|
182
|
+
const inventory = components(raw.components, root);
|
|
183
|
+
const componentRoots = {
|
|
184
|
+
prompt: "prompts",
|
|
185
|
+
agent: "agents",
|
|
186
|
+
skill: "skills",
|
|
187
|
+
fleet: "fleets"
|
|
188
|
+
};
|
|
189
|
+
for (const item of inventory) {
|
|
190
|
+
const resourceKind = componentRoots[item.kind];
|
|
191
|
+
if (!resourceKind) continue;
|
|
192
|
+
const resource = resources[resourceKind];
|
|
193
|
+
if (!resource || !pluginPathContained(
|
|
194
|
+
pluginResourcePath(root, resource, kind === "skill" && resource === "."),
|
|
195
|
+
pluginResourcePath(root, item.path)
|
|
196
|
+
))
|
|
197
|
+
throw new Error(`component ${item.kind}:${item.id} is outside its declared resource root`);
|
|
198
|
+
}
|
|
199
|
+
if (kind !== "plugin") {
|
|
200
|
+
const publicItems = inventory.filter((item) => ["prompt", "agent", "skill", "fleet"].includes(item.kind));
|
|
201
|
+
if (publicItems.length !== 1 || publicItems[0]?.kind !== kind)
|
|
202
|
+
throw new Error(`a ${kind} package must declare exactly one public ${kind} component`);
|
|
203
|
+
if (Object.keys(resources).some((resource2) => resource2 !== `${kind}s`))
|
|
204
|
+
throw new Error(`a ${kind} package may only declare its ${kind}s resource root`);
|
|
205
|
+
const resource = resources[`${kind}s`];
|
|
206
|
+
if (!resource) throw new Error(`a ${kind} package must declare its resource root`);
|
|
207
|
+
const discovered = [];
|
|
208
|
+
const scan = (directory, ancestors) => {
|
|
209
|
+
const canonical = realpathSync(directory);
|
|
210
|
+
if (ancestors.has(canonical)) throw new Error("cyclic package resource directory");
|
|
211
|
+
const visited = /* @__PURE__ */ new Set([...ancestors, canonical]);
|
|
212
|
+
for (const item of readdirSync(directory)) {
|
|
213
|
+
const file = path.join(directory, item);
|
|
214
|
+
if (statSync(file).isDirectory()) scan(file, visited);
|
|
215
|
+
else if (kind === "skill" ? item === "SKILL.md" : item.endsWith(".md")) discovered.push(file);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
scan(pluginResourcePath(root, resource, kind === "skill" && resource === "."), /* @__PURE__ */ new Set());
|
|
219
|
+
const declared = publicItems[0];
|
|
220
|
+
if (discovered.length !== 1 || !declared || path.resolve(discovered[0]) !== pluginResourcePath(root, declared.path))
|
|
221
|
+
throw new Error(`a ${kind} package must expose only its declared ${kind} file`);
|
|
222
|
+
}
|
|
223
|
+
return {
|
|
224
|
+
manifestVersion: 1,
|
|
225
|
+
kind,
|
|
226
|
+
resources,
|
|
227
|
+
components: inventory,
|
|
228
|
+
...raw.requires ? { requires: raw.requires } : {},
|
|
229
|
+
...raw.evals ? { evals } : {},
|
|
230
|
+
...compatibility ? { compatibility } : {}
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
function parsePluginManifest(raw, root) {
|
|
234
|
+
const value = JSON.parse(raw);
|
|
235
|
+
if (!record(value)) throw new Error("plugin manifest must be an object");
|
|
236
|
+
requireKeys(value, ROOT_KEYS, "plugin manifest");
|
|
237
|
+
if (value.$schema !== PLUGIN_SCHEMA) throw new Error(`plugin $schema must be ${PLUGIN_SCHEMA}`);
|
|
238
|
+
if (typeof value.name !== "string" || !isPluginId(value.name))
|
|
239
|
+
throw new Error("plugin name must be a portable identifier of 1 to 64 characters and may not be state.json");
|
|
240
|
+
for (const field of ["version", "description", "homepage", "repository", "license"]) {
|
|
241
|
+
if (value[field] !== void 0 && typeof value[field] !== "string") throw new Error(`${field} must be a string`);
|
|
242
|
+
}
|
|
243
|
+
if (!isSemanticVersion(value.version))
|
|
244
|
+
throw new Error("package version must be an explicit Semantic Version (for example 1.0.0)");
|
|
245
|
+
if (value.author !== void 0) {
|
|
246
|
+
if (!record(value.author)) throw new Error("author must be an object");
|
|
247
|
+
requireKeys(value.author, /* @__PURE__ */ new Set(["name", "email", "url"]), "author");
|
|
248
|
+
if (Object.values(value.author).some((field) => typeof field !== "string"))
|
|
249
|
+
throw new Error("author fields must be strings");
|
|
250
|
+
}
|
|
251
|
+
if (value.keywords !== void 0 && (!Array.isArray(value.keywords) || value.keywords.some((field) => typeof field !== "string")))
|
|
252
|
+
throw new Error("keywords must be an array of strings");
|
|
253
|
+
if (value.extensions !== void 0 && (!record(value.extensions) || Object.values(value.extensions).some((field) => !record(field))))
|
|
254
|
+
throw new Error("extensions must contain namespaced objects");
|
|
255
|
+
const extensions = value.extensions;
|
|
256
|
+
const clio = clioConfiguration(extensions?.[PLUGIN_EXTENSION_KEY], root);
|
|
257
|
+
return { ...value, clio };
|
|
258
|
+
}
|
|
259
|
+
function readPluginManifest(root) {
|
|
260
|
+
const resolved = path.resolve(root);
|
|
261
|
+
const manifestPath = path.join(resolved, "plugin.json");
|
|
262
|
+
const diagnostics = [];
|
|
263
|
+
try {
|
|
264
|
+
if (existsSync(path.join(resolved, "state.json")))
|
|
265
|
+
throw new Error("root state.json is reserved for plugin installation state");
|
|
266
|
+
const digest = extensionContentDigestWithCapture(resolved, { capture: ["plugin.json"] });
|
|
267
|
+
const bytes = digest.captured.get("plugin.json");
|
|
268
|
+
if (!bytes) throw new Error("plugin.json must be a regular file at the plugin root");
|
|
269
|
+
const manifest = parsePluginManifest(bytes.toString("utf8"), resolved);
|
|
270
|
+
if (existsSync(path.join(resolved, "mcp.json")))
|
|
271
|
+
diagnostics.push({
|
|
272
|
+
type: "warning",
|
|
273
|
+
message: "MCP declarations are preserved; this Clio version does not execute MCP servers",
|
|
274
|
+
path: path.join(resolved, "mcp.json")
|
|
275
|
+
});
|
|
276
|
+
return {
|
|
277
|
+
path: resolved,
|
|
278
|
+
manifestPath,
|
|
279
|
+
manifest,
|
|
280
|
+
valid: true,
|
|
281
|
+
diagnostics,
|
|
282
|
+
contentDigest: digest.digest,
|
|
283
|
+
manifestDigest: createHash("sha256").update(bytes).digest("hex")
|
|
284
|
+
};
|
|
285
|
+
} catch (error) {
|
|
286
|
+
diagnostics.push({
|
|
287
|
+
type: "error",
|
|
288
|
+
message: error instanceof Error ? error.message : String(error),
|
|
289
|
+
path: manifestPath
|
|
290
|
+
});
|
|
291
|
+
return { path: resolved, manifestPath, valid: false, diagnostics };
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
function discoverPluginPackages(root) {
|
|
295
|
+
if (existsSync(path.join(root, "plugin.json"))) return [readPluginManifest(root)];
|
|
296
|
+
try {
|
|
297
|
+
return readdirSync(root).sort().filter((name) => !name.startsWith(".") && lstatSync(path.join(root, name)).isDirectory()).map((name) => readPluginManifest(path.join(root, name)));
|
|
298
|
+
} catch {
|
|
299
|
+
return [readPluginManifest(root)];
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// src/domains/plugins/state.ts
|
|
304
|
+
init_esm_shims();
|
|
305
|
+
import { randomBytes } from "node:crypto";
|
|
306
|
+
import {
|
|
307
|
+
closeSync,
|
|
308
|
+
cpSync,
|
|
309
|
+
existsSync as existsSync2,
|
|
310
|
+
lstatSync as lstatSync2,
|
|
311
|
+
mkdirSync,
|
|
312
|
+
openSync,
|
|
313
|
+
readdirSync as readdirSync2,
|
|
314
|
+
readFileSync,
|
|
315
|
+
realpathSync as realpathSync2,
|
|
316
|
+
renameSync,
|
|
317
|
+
rmSync
|
|
318
|
+
} from "node:fs";
|
|
319
|
+
import path2 from "node:path";
|
|
320
|
+
|
|
321
|
+
// src/domains/plugins/types.ts
|
|
322
|
+
init_esm_shims();
|
|
323
|
+
function isForeignPluginOrigin(origin) {
|
|
324
|
+
return typeof origin === "object" && (origin.kind === "interop" || origin.kind === "import");
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// src/domains/plugins/state.ts
|
|
328
|
+
function installLibraryPackage(input) {
|
|
329
|
+
const { kind, sourcePath, ...options } = input;
|
|
330
|
+
return installPlugin(sourcePath, { ...options, expectedKind: kind });
|
|
331
|
+
}
|
|
332
|
+
function pluginBaseDir(scope, cwd = process.cwd()) {
|
|
333
|
+
return scope === "user" ? path2.join(clioConfigDir(), "plugins") : path2.join(path2.resolve(cwd), ".clio-coder", "plugins");
|
|
334
|
+
}
|
|
335
|
+
function pluginStatePath(scope, cwd = process.cwd()) {
|
|
336
|
+
return path2.join(pluginBaseDir(scope, cwd), "state.json");
|
|
337
|
+
}
|
|
338
|
+
function record2(value) {
|
|
339
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
340
|
+
}
|
|
341
|
+
function plainFile(file) {
|
|
342
|
+
const stat = lstatSync2(file);
|
|
343
|
+
if (!stat.isFile() || stat.isSymbolicLink() || stat.nlink !== 1)
|
|
344
|
+
throw new Error(`plugin state must be a regular unlinked file: ${file}`);
|
|
345
|
+
}
|
|
346
|
+
function stateBytes(file) {
|
|
347
|
+
if (!existsSync2(file)) return void 0;
|
|
348
|
+
plainFile(file);
|
|
349
|
+
return readFileSync(file, "utf8");
|
|
350
|
+
}
|
|
351
|
+
function readState(scope, cwd) {
|
|
352
|
+
const bytes = stateBytes(pluginStatePath(scope, cwd));
|
|
353
|
+
if (bytes === void 0) return { state: { version: 1, disabled: [], installed: {} } };
|
|
354
|
+
const raw = JSON.parse(bytes);
|
|
355
|
+
if (!record2(raw) || raw.version !== 1 || !Array.isArray(raw.disabled) || !raw.disabled.every((id) => typeof id === "string" && isPluginId(id)) || !record2(raw.installed))
|
|
356
|
+
throw new Error("plugin install state is malformed");
|
|
357
|
+
for (const [id, entry] of Object.entries(raw.installed)) {
|
|
358
|
+
if (!isPluginId(id) || !record2(entry) || typeof entry.installedAt !== "string" || typeof entry.source !== "string" || typeof entry.contentDigest !== "string" || !/^[a-f0-9]{64}$/u.test(entry.contentDigest))
|
|
359
|
+
throw new Error(`invalid plugin install record: ${id}`);
|
|
360
|
+
if (entry.origin !== void 0 && typeof entry.origin !== "string" && !validOrigin(entry.origin))
|
|
361
|
+
throw new Error(`invalid plugin origin: ${id}`);
|
|
362
|
+
if (entry.kind !== void 0 && !isLibraryKind(entry.kind)) throw new Error(`invalid package kind: ${id}`);
|
|
363
|
+
if (entry.trust !== void 0 && entry.trust !== "trusted" && entry.trust !== "foreign")
|
|
364
|
+
throw new Error(`invalid package trust: ${id}`);
|
|
365
|
+
}
|
|
366
|
+
return { state: raw, bytes };
|
|
367
|
+
}
|
|
368
|
+
var FOREIGN_FORMATS = /* @__PURE__ */ new Set(["portable", "claude-code", "codex"]);
|
|
369
|
+
function validOrigin(origin) {
|
|
370
|
+
if (!record2(origin) || typeof origin.source !== "string") return false;
|
|
371
|
+
const optional = (origin.marketplace === void 0 || typeof origin.marketplace === "string") && (origin.host === void 0 || typeof origin.host === "string");
|
|
372
|
+
switch (origin.kind) {
|
|
373
|
+
case "local":
|
|
374
|
+
case "catalog":
|
|
375
|
+
case "github":
|
|
376
|
+
return true;
|
|
377
|
+
case "interop":
|
|
378
|
+
return typeof origin.host === "string" && path2.isAbsolute(origin.source) && optional && (origin.format === void 0 || FOREIGN_FORMATS.has(String(origin.format)));
|
|
379
|
+
case "import":
|
|
380
|
+
return FOREIGN_FORMATS.has(String(origin.format)) && optional && (origin.transport === "local" && path2.isAbsolute(origin.source) || origin.transport === "github" && /^https:\/\/github\.com\//u.test(origin.source));
|
|
381
|
+
default:
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
function assertUnchangedState(file, expected) {
|
|
386
|
+
if (stateBytes(file) !== expected)
|
|
387
|
+
throw new Error("plugin install state changed during the operation; retry after reviewing concurrent edits");
|
|
388
|
+
}
|
|
389
|
+
function writeState(scope, cwd, state, expected) {
|
|
390
|
+
const file = pluginStatePath(scope, cwd);
|
|
391
|
+
assertUnchangedState(file, expected);
|
|
392
|
+
safeResourceWrite(file, `${JSON.stringify(state, null, 2)}
|
|
393
|
+
`, {
|
|
394
|
+
mode: 384,
|
|
395
|
+
beforeRename: () => assertUnchangedState(file, expected)
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
function assertManagedBase(scope, cwd) {
|
|
399
|
+
const boundary = scope === "user" ? path2.resolve(clioConfigDir()) : path2.resolve(cwd);
|
|
400
|
+
const base = pluginBaseDir(scope, cwd);
|
|
401
|
+
let cursor = boundary;
|
|
402
|
+
for (const part of path2.relative(boundary, base).split(path2.sep)) {
|
|
403
|
+
cursor = path2.join(cursor, part);
|
|
404
|
+
try {
|
|
405
|
+
const stat = lstatSync2(cursor);
|
|
406
|
+
if (stat.isSymbolicLink() || !stat.isDirectory())
|
|
407
|
+
throw new Error(`plugin managed path must be a directory without symbolic links: ${cursor}`);
|
|
408
|
+
} catch (error) {
|
|
409
|
+
if (error.code !== "ENOENT") throw error;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
var PluginWriterRefusal = class extends Error {
|
|
414
|
+
constructor(code, message, changed) {
|
|
415
|
+
super(message);
|
|
416
|
+
this.code = code;
|
|
417
|
+
this.changed = changed;
|
|
418
|
+
this.name = "PluginWriterRefusal";
|
|
419
|
+
}
|
|
420
|
+
code;
|
|
421
|
+
changed;
|
|
422
|
+
};
|
|
423
|
+
function acquireScopeLock(scope, cwd) {
|
|
424
|
+
assertManagedBase(scope, cwd);
|
|
425
|
+
mkdirSync(pluginBaseDir(scope, cwd), { recursive: true });
|
|
426
|
+
const lock = path2.join(pluginBaseDir(scope, cwd), ".mutation.lock");
|
|
427
|
+
let fd;
|
|
428
|
+
try {
|
|
429
|
+
fd = openSync(lock, "wx", 384);
|
|
430
|
+
} catch (error) {
|
|
431
|
+
if (error.code === "EEXIST")
|
|
432
|
+
throw new PluginWriterRefusal("locked", "another plugin operation holds the installation lock");
|
|
433
|
+
throw error;
|
|
434
|
+
}
|
|
435
|
+
return () => {
|
|
436
|
+
closeSync(fd);
|
|
437
|
+
rmSync(lock, { force: true });
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
function withPluginScopeLock(scope, cwd, fn) {
|
|
441
|
+
const release = acquireScopeLock(scope, cwd);
|
|
442
|
+
try {
|
|
443
|
+
return fn();
|
|
444
|
+
} finally {
|
|
445
|
+
release();
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
function withMutation(scope, cwd, work) {
|
|
449
|
+
try {
|
|
450
|
+
return withPluginScopeLock(scope, cwd, work);
|
|
451
|
+
} catch (error) {
|
|
452
|
+
return {
|
|
453
|
+
diagnostics: [
|
|
454
|
+
{
|
|
455
|
+
type: "error",
|
|
456
|
+
message: error instanceof Error ? error.message : String(error),
|
|
457
|
+
...error instanceof PluginWriterRefusal ? { code: error.code } : {},
|
|
458
|
+
...error instanceof PluginWriterRefusal && error.changed ? { changed: error.changed } : {}
|
|
459
|
+
}
|
|
460
|
+
]
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
function observePluginCopy(scope, id, cwd) {
|
|
465
|
+
const saved = readState(scope, cwd).state.installed[id];
|
|
466
|
+
const target = path2.join(pluginBaseDir(scope, cwd), id);
|
|
467
|
+
let tree = "absent";
|
|
468
|
+
if (existsSync2(target)) {
|
|
469
|
+
try {
|
|
470
|
+
tree = extensionContentDigest(target);
|
|
471
|
+
} catch {
|
|
472
|
+
tree = "unreadable";
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
return {
|
|
476
|
+
scope,
|
|
477
|
+
id,
|
|
478
|
+
recorded: saved !== void 0,
|
|
479
|
+
tree,
|
|
480
|
+
enabled: !readState(scope, cwd).state.disabled.includes(id),
|
|
481
|
+
...saved ? { recordedDigest: saved.contentDigest } : {},
|
|
482
|
+
...saved?.kind ? { kind: saved.kind } : {},
|
|
483
|
+
...saved?.trust ? { trust: saved.trust } : {},
|
|
484
|
+
...saved?.origin !== void 0 ? { origin: saved.origin } : {}
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
function assertExpectedState(expect, cwd) {
|
|
488
|
+
for (const expected of expect?.copies ?? []) {
|
|
489
|
+
let observed;
|
|
490
|
+
try {
|
|
491
|
+
observed = observePluginCopy(expected.scope, expected.id, cwd);
|
|
492
|
+
} catch (error) {
|
|
493
|
+
throw new PluginWriterRefusal(
|
|
494
|
+
"stale_plan",
|
|
495
|
+
`reviewed state for ${expected.scope}:${expected.id} is no longer readable: ${error instanceof Error ? error.message : String(error)}; review a fresh plan`
|
|
496
|
+
);
|
|
497
|
+
}
|
|
498
|
+
const facts = new Set(
|
|
499
|
+
expected.partial ? Object.keys(expected) : [...Object.keys(expected), ...Object.keys(observed)]
|
|
500
|
+
);
|
|
501
|
+
for (const fact of facts) {
|
|
502
|
+
if (fact === "scope" || fact === "id" || fact === "partial") continue;
|
|
503
|
+
const want = JSON.stringify(expected[fact] ?? null);
|
|
504
|
+
const have = JSON.stringify(observed[fact] ?? null);
|
|
505
|
+
if (want !== have)
|
|
506
|
+
throw new PluginWriterRefusal(
|
|
507
|
+
"stale_plan",
|
|
508
|
+
`reviewed ${fact} changed for ${expected.scope}:${expected.id} (expected ${want}, observed ${have}); review a fresh plan`,
|
|
509
|
+
{ scope: expected.scope, id: expected.id, fact, expected: expected[fact], observed: observed[fact] }
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
function resolvePluginPrecedence(entries) {
|
|
515
|
+
for (const entry of entries) {
|
|
516
|
+
const winner = entries.filter((peer) => peer.id === entry.id && peer.valid && peer.compatible).sort((a, b) => Number(a.scope === "project") - Number(b.scope === "project")).at(-1);
|
|
517
|
+
entry.effective = entry === winner;
|
|
518
|
+
entry.loadable = entry.valid && entry.compatible && entry.enabled && entry.effective;
|
|
519
|
+
delete entry.overriddenBy;
|
|
520
|
+
if (winner && winner !== entry) entry.overriddenBy = winner.scope;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
function unmetRequirementsOf(entry, entries) {
|
|
524
|
+
return (entry.manifest?.clio.requires ?? []).filter(
|
|
525
|
+
(requirement) => !entries.some((peer) => peer.loadable && `${peer.kind ?? "plugin"}:${peer.id}` === requirement)
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
function newlyBrokenDependents(entries, mutation) {
|
|
529
|
+
const before = entries.map((entry) => ({ ...entry }));
|
|
530
|
+
resolvePluginPrecedence(before);
|
|
531
|
+
const after = before.filter((entry) => !(mutation.operation === "remove" && entry.id === mutation.id && entry.scope === mutation.scope)).map((entry) => ({
|
|
532
|
+
...entry,
|
|
533
|
+
enabled: mutation.operation === "disable" && entry.id === mutation.id && entry.scope === mutation.scope ? false : entry.enabled
|
|
534
|
+
}));
|
|
535
|
+
resolvePluginPrecedence(after);
|
|
536
|
+
const newlyBroken = [];
|
|
537
|
+
const preexisting = [];
|
|
538
|
+
for (const entry of before) {
|
|
539
|
+
if (entry.id === mutation.id && entry.scope === mutation.scope) continue;
|
|
540
|
+
const later = after.find((peer) => peer.id === entry.id && peer.scope === entry.scope);
|
|
541
|
+
if (!later?.loadable) continue;
|
|
542
|
+
const missingBefore = entry.loadable ? unmetRequirementsOf(entry, before) : [];
|
|
543
|
+
const missingAfter = unmetRequirementsOf(later, after);
|
|
544
|
+
const ref = `${entry.kind ?? "plugin"}:${entry.id}`;
|
|
545
|
+
const fresh = missingAfter.filter((requirement) => !missingBefore.includes(requirement));
|
|
546
|
+
if (fresh.length) newlyBroken.push({ ref, scope: entry.scope, missing: fresh });
|
|
547
|
+
else if (missingAfter.length) preexisting.push({ ref, scope: entry.scope, missing: missingAfter });
|
|
548
|
+
}
|
|
549
|
+
const effectiveAfter = after.find((entry) => entry.id === mutation.id && entry.effective);
|
|
550
|
+
return { newlyBroken, preexisting, ...effectiveAfter ? { effectiveAfter } : {} };
|
|
551
|
+
}
|
|
552
|
+
function refuseBrokenDependents(cwd, mutation) {
|
|
553
|
+
const { newlyBroken } = newlyBrokenDependents(listInstalledPlugins(cwd, { all: true }), mutation);
|
|
554
|
+
if (newlyBroken.length)
|
|
555
|
+
throw new PluginWriterRefusal(
|
|
556
|
+
"dependents",
|
|
557
|
+
`${mutation.operation} of ${mutation.scope}:${mutation.id} would break ${newlyBroken.map((item) => `${item.scope}:${item.ref} (missing ${item.missing.join(", ")})`).join("; ")}; disable or remove those dependents first`
|
|
558
|
+
);
|
|
559
|
+
}
|
|
560
|
+
function scopeEntries(scope, cwd) {
|
|
561
|
+
const base = pluginBaseDir(scope, cwd);
|
|
562
|
+
if (!existsSync2(base)) return [];
|
|
563
|
+
let names;
|
|
564
|
+
try {
|
|
565
|
+
assertManagedBase(scope, cwd);
|
|
566
|
+
names = readdirSync2(base).sort().filter(isPluginId);
|
|
567
|
+
} catch (error) {
|
|
568
|
+
return [
|
|
569
|
+
{
|
|
570
|
+
id: `invalid-${scope}-plugin-root`,
|
|
571
|
+
name: "Plugin installation directory",
|
|
572
|
+
version: "0.0.0",
|
|
573
|
+
description: "",
|
|
574
|
+
scope,
|
|
575
|
+
rootPath: base,
|
|
576
|
+
manifestPath: pluginStatePath(scope, cwd),
|
|
577
|
+
enabled: false,
|
|
578
|
+
valid: false,
|
|
579
|
+
compatible: true,
|
|
580
|
+
effective: false,
|
|
581
|
+
loadable: false,
|
|
582
|
+
resources: {},
|
|
583
|
+
diagnostics: [
|
|
584
|
+
{
|
|
585
|
+
type: "error",
|
|
586
|
+
message: `plugin directory cannot be read: ${error instanceof Error ? error.message : String(error)}`,
|
|
587
|
+
path: base
|
|
588
|
+
}
|
|
589
|
+
]
|
|
590
|
+
}
|
|
591
|
+
];
|
|
592
|
+
}
|
|
593
|
+
let state = { version: 1, disabled: [], installed: {} };
|
|
594
|
+
let stateError;
|
|
595
|
+
try {
|
|
596
|
+
assertManagedBase(scope, cwd);
|
|
597
|
+
state = readState(scope, cwd).state;
|
|
598
|
+
} catch (error) {
|
|
599
|
+
stateError = error instanceof Error ? error.message : String(error);
|
|
600
|
+
}
|
|
601
|
+
const entries = [];
|
|
602
|
+
for (const id of names) {
|
|
603
|
+
const rootPath = path2.join(base, id);
|
|
604
|
+
const candidate = readPluginManifest(rootPath);
|
|
605
|
+
const manifest = candidate.manifest;
|
|
606
|
+
const diagnostics = [...candidate.diagnostics];
|
|
607
|
+
const saved = state.installed[id];
|
|
608
|
+
if (manifest && manifest.name !== id)
|
|
609
|
+
diagnostics.push({
|
|
610
|
+
type: "error",
|
|
611
|
+
message: `installed directory ${id} does not match plugin identity ${manifest.name}`,
|
|
612
|
+
path: rootPath
|
|
613
|
+
});
|
|
614
|
+
if (stateError)
|
|
615
|
+
diagnostics.push({
|
|
616
|
+
type: "error",
|
|
617
|
+
message: `plugin install state cannot be read: ${stateError}`,
|
|
618
|
+
path: pluginStatePath(scope, cwd)
|
|
619
|
+
});
|
|
620
|
+
else if (!saved)
|
|
621
|
+
diagnostics.push({
|
|
622
|
+
type: "error",
|
|
623
|
+
message: "plugin is not recorded in install state; install it through plugins install",
|
|
624
|
+
path: rootPath
|
|
625
|
+
});
|
|
626
|
+
else if (candidate.contentDigest !== saved.contentDigest)
|
|
627
|
+
diagnostics.push({
|
|
628
|
+
type: "error",
|
|
629
|
+
message: `installed plugin content drift detected (expected ${saved.contentDigest}, observed ${candidate.contentDigest ?? "unreadable"})`,
|
|
630
|
+
path: rootPath
|
|
631
|
+
});
|
|
632
|
+
const range = manifest?.clio.compatibility?.clio;
|
|
633
|
+
const compatible = range === void 0 || evaluateClioCompatibility(range).satisfied;
|
|
634
|
+
if (!compatible)
|
|
635
|
+
diagnostics.push({
|
|
636
|
+
type: "error",
|
|
637
|
+
message: `plugin requires Clio ${range}`,
|
|
638
|
+
path: candidate.manifestPath ?? rootPath
|
|
639
|
+
});
|
|
640
|
+
const valid = candidate.valid && !stateError && !!saved && candidate.contentDigest === saved.contentDigest && manifest?.name === id;
|
|
641
|
+
entries.push({
|
|
642
|
+
id,
|
|
643
|
+
kind: saved?.kind ?? manifest?.clio.kind ?? "plugin",
|
|
644
|
+
trust: saved?.trust ?? (isForeignPluginOrigin(saved?.origin) ? "foreign" : "trusted"),
|
|
645
|
+
name: manifest?.name ?? id,
|
|
646
|
+
version: manifest?.version ?? "0.0.0",
|
|
647
|
+
description: manifest?.description ?? "",
|
|
648
|
+
scope,
|
|
649
|
+
rootPath,
|
|
650
|
+
manifestPath: candidate.manifestPath ?? path2.join(rootPath, "plugin.json"),
|
|
651
|
+
enabled: !state.disabled.includes(id),
|
|
652
|
+
valid,
|
|
653
|
+
compatible,
|
|
654
|
+
effective: false,
|
|
655
|
+
loadable: false,
|
|
656
|
+
resources: manifest?.clio.resources ?? {},
|
|
657
|
+
...manifest ? { manifest } : {},
|
|
658
|
+
diagnostics,
|
|
659
|
+
...candidate.contentDigest ? { observedContentDigest: candidate.contentDigest } : {},
|
|
660
|
+
...valid && candidate.manifestDigest && saved ? {
|
|
661
|
+
provenance: {
|
|
662
|
+
id,
|
|
663
|
+
scope,
|
|
664
|
+
sourcePath: saved.source,
|
|
665
|
+
canonicalRoot: realpathSync2(rootPath),
|
|
666
|
+
manifestDigest: candidate.manifestDigest,
|
|
667
|
+
contentDigest: saved.contentDigest
|
|
668
|
+
}
|
|
669
|
+
} : {}
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
return entries;
|
|
673
|
+
}
|
|
674
|
+
function listInstalledPlugins(cwd = process.cwd(), options = {}) {
|
|
675
|
+
const scopes = options.scope ? [options.scope] : ["user", "project"];
|
|
676
|
+
const entries = scopes.flatMap((scope) => scopeEntries(scope, cwd));
|
|
677
|
+
resolvePluginPrecedence(entries);
|
|
678
|
+
return entries.filter((entry) => options.all || entry.effective || !entry.valid || !entry.compatible).sort((a, b) => a.id.localeCompare(b.id) || a.scope.localeCompare(b.scope));
|
|
679
|
+
}
|
|
680
|
+
function readPluginInstallRecord(id, options = {}) {
|
|
681
|
+
if (!isPluginId(id)) return void 0;
|
|
682
|
+
const cwd = options.cwd ?? process.cwd();
|
|
683
|
+
if (options.scope) return readState(options.scope, cwd).state.installed[id];
|
|
684
|
+
return readState("project", cwd).state.installed[id] ?? readState("user", cwd).state.installed[id];
|
|
685
|
+
}
|
|
686
|
+
function selectedScope(id, options) {
|
|
687
|
+
if (options.scope) return options.scope;
|
|
688
|
+
return existsSync2(path2.join(pluginBaseDir("project", options.cwd), id)) ? "project" : "user";
|
|
689
|
+
}
|
|
690
|
+
function uniqueSibling(target, purpose) {
|
|
691
|
+
return path2.join(
|
|
692
|
+
path2.dirname(target),
|
|
693
|
+
`.${path2.basename(target)}.${purpose}-${process.pid}-${randomBytes(8).toString("hex")}`
|
|
694
|
+
);
|
|
695
|
+
}
|
|
696
|
+
function retainRecovery(backup, expectedDigest) {
|
|
697
|
+
try {
|
|
698
|
+
if (!expectedDigest || extensionContentDigest(backup) !== expectedDigest) return true;
|
|
699
|
+
rmSync(backup, { recursive: true, force: true });
|
|
700
|
+
return false;
|
|
701
|
+
} catch {
|
|
702
|
+
return true;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
function installPlugin(sourcePath, options = {}) {
|
|
706
|
+
const cwd = options.cwd ?? process.cwd();
|
|
707
|
+
const scope = options.scope ?? "user";
|
|
708
|
+
const source = path2.resolve(cwd, sourcePath);
|
|
709
|
+
const candidate = readPluginManifest(source);
|
|
710
|
+
if (!candidate.valid || !candidate.manifest || !candidate.contentDigest) return { diagnostics: candidate.diagnostics };
|
|
711
|
+
const manifest = candidate.manifest;
|
|
712
|
+
const digest = candidate.contentDigest;
|
|
713
|
+
const range = manifest.clio.compatibility?.clio;
|
|
714
|
+
if (range && !evaluateClioCompatibility(range).satisfied)
|
|
715
|
+
return { diagnostics: [{ type: "error", message: `plugin requires Clio ${range}` }] };
|
|
716
|
+
if (options.expectedKind !== void 0 && options.expectedKind !== (manifest.clio.kind ?? "plugin") || options.expectedDigest !== void 0 && options.expectedDigest !== digest || options.expectedId !== void 0 && options.expectedId !== manifest.name || options.expectedVersion !== void 0 && options.expectedVersion !== manifest.version)
|
|
717
|
+
return {
|
|
718
|
+
diagnostics: [{ type: "error", message: "plugin source does not match the pinned digest, identity, or version" }]
|
|
719
|
+
};
|
|
720
|
+
const target = path2.join(pluginBaseDir(scope, cwd), manifest.name);
|
|
721
|
+
const resolvedBase = pluginBaseDir(scope, cwd);
|
|
722
|
+
if (pluginPathContained(canonicalizeExistingPath(source), canonicalizeExistingPath(resolvedBase)) || pluginPathContained(canonicalizeExistingPath(target), canonicalizeExistingPath(source)))
|
|
723
|
+
return { diagnostics: [{ type: "error", message: "plugin source overlaps its managed installation destination" }] };
|
|
724
|
+
return withMutation(scope, cwd, () => {
|
|
725
|
+
const { state, bytes } = readState(scope, cwd);
|
|
726
|
+
assertExpectedState(options.expect, cwd);
|
|
727
|
+
const previouslyInstalled = Object.hasOwn(state.installed, manifest.name);
|
|
728
|
+
const previousDigest = state.installed[manifest.name]?.contentDigest;
|
|
729
|
+
const previousOrigin = state.installed[manifest.name]?.origin;
|
|
730
|
+
if (isForeignPluginOrigin(previousOrigin))
|
|
731
|
+
throw new Error("interop packages require a new reviewed adoption; remove the installed copy and adopt it again");
|
|
732
|
+
const previousKind = state.installed[manifest.name]?.kind ?? readPluginManifest(target).manifest?.clio.kind;
|
|
733
|
+
if (previousKind && previousKind !== (manifest.clio.kind ?? "plugin"))
|
|
734
|
+
throw new Error("package kind cannot change during replacement; remove it explicitly first");
|
|
735
|
+
if (existsSync2(target) && !options.force)
|
|
736
|
+
throw new Error(`plugin ${manifest.name} is already installed; use --force to replace it`);
|
|
737
|
+
if (existsSync2(target) && lstatSync2(target).isSymbolicLink())
|
|
738
|
+
throw new Error("installed plugin root must not be a symbolic link");
|
|
739
|
+
const staging = uniqueSibling(target, "install");
|
|
740
|
+
const backup = uniqueSibling(target, "backup");
|
|
741
|
+
let moved = false;
|
|
742
|
+
let published = false;
|
|
743
|
+
let preserveBackup = false;
|
|
744
|
+
if (existsSync2(target)) {
|
|
745
|
+
try {
|
|
746
|
+
preserveBackup = extensionContentDigest(target) !== state.installed[manifest.name]?.contentDigest;
|
|
747
|
+
} catch {
|
|
748
|
+
preserveBackup = true;
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
try {
|
|
752
|
+
cpSync(source, staging, { recursive: true, verbatimSymlinks: true, errorOnExist: true, force: false });
|
|
753
|
+
const staged = readPluginManifest(staging);
|
|
754
|
+
if (!staged.valid || staged.manifest?.name !== manifest.name || staged.contentDigest !== digest)
|
|
755
|
+
throw new Error("staged plugin differs from the verified source tree");
|
|
756
|
+
if (extensionContentDigest(source) !== digest) throw new Error("plugin source changed while staging");
|
|
757
|
+
assertUnchangedState(pluginStatePath(scope, cwd), bytes);
|
|
758
|
+
if (existsSync2(target)) {
|
|
759
|
+
renameSync(target, backup);
|
|
760
|
+
moved = true;
|
|
761
|
+
}
|
|
762
|
+
renameSync(staging, target);
|
|
763
|
+
published = true;
|
|
764
|
+
if (extensionContentDigest(target) !== digest) throw new Error("plugin changed during publication");
|
|
765
|
+
const origin = options.origin ?? { kind: "local", source };
|
|
766
|
+
const trust = isForeignPluginOrigin(origin) ? "foreign" : options.trust ?? state.installed[manifest.name]?.trust ?? "trusted";
|
|
767
|
+
state.installed[manifest.name] = {
|
|
768
|
+
kind: manifest.clio.kind ?? "plugin",
|
|
769
|
+
installedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
770
|
+
source: typeof origin === "string" ? origin : origin.source,
|
|
771
|
+
origin,
|
|
772
|
+
contentDigest: digest,
|
|
773
|
+
trust
|
|
774
|
+
};
|
|
775
|
+
if (!previouslyInstalled) state.disabled = state.disabled.filter((id) => id !== manifest.name);
|
|
776
|
+
writeState(scope, cwd, state, bytes);
|
|
777
|
+
} catch (error) {
|
|
778
|
+
rmSync(staging, { recursive: true, force: true });
|
|
779
|
+
if (published && existsSync2(target)) {
|
|
780
|
+
let unchanged = false;
|
|
781
|
+
try {
|
|
782
|
+
unchanged = extensionContentDigest(target) === digest;
|
|
783
|
+
} catch {
|
|
784
|
+
}
|
|
785
|
+
if (!unchanged)
|
|
786
|
+
return {
|
|
787
|
+
recovery: { ...moved ? { packageBackup: backup } : {} },
|
|
788
|
+
diagnostics: [
|
|
789
|
+
{
|
|
790
|
+
type: "error",
|
|
791
|
+
message: `plugin installation failed and changed content was preserved: ${String(error)}`,
|
|
792
|
+
path: target
|
|
793
|
+
}
|
|
794
|
+
]
|
|
795
|
+
};
|
|
796
|
+
rmSync(target, { recursive: true, force: true });
|
|
797
|
+
}
|
|
798
|
+
if (moved) renameSync(backup, target);
|
|
799
|
+
throw error;
|
|
800
|
+
}
|
|
801
|
+
if (moved && !preserveBackup) preserveBackup = retainRecovery(backup, previousDigest);
|
|
802
|
+
const plugin = listInstalledPlugins(cwd, { scope, all: true }).find((entry) => entry.id === manifest.name);
|
|
803
|
+
return {
|
|
804
|
+
...plugin ? { plugin } : {},
|
|
805
|
+
...moved && preserveBackup ? { recovery: { packageBackup: backup } } : {},
|
|
806
|
+
diagnostics: plugin?.diagnostics ?? []
|
|
807
|
+
};
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
function updatePlugin(id, options = {}) {
|
|
811
|
+
if (!isPluginId(id)) return { diagnostics: [{ type: "error", message: "invalid plugin id" }] };
|
|
812
|
+
try {
|
|
813
|
+
const scope = selectedScope(id, options);
|
|
814
|
+
const installed = readPluginInstallRecord(id, { ...options, scope });
|
|
815
|
+
if (!installed) throw new Error(`plugin ${id} is not installed`);
|
|
816
|
+
if (isForeignPluginOrigin(installed.origin))
|
|
817
|
+
throw new Error("interop packages require a new reviewed adoption; remove the installed copy and adopt it again");
|
|
818
|
+
const current = listInstalledPlugins(options.cwd ?? process.cwd(), { scope, all: true }).find(
|
|
819
|
+
(entry) => entry.id === id
|
|
820
|
+
);
|
|
821
|
+
if (!options.force && !current?.valid)
|
|
822
|
+
throw new Error(
|
|
823
|
+
`plugin ${id} has changed or unverifiable content; use --force to preserve a recovery copy and replace it`
|
|
824
|
+
);
|
|
825
|
+
if (/^[a-z][a-z0-9+.-]*:\/\//iu.test(installed.source))
|
|
826
|
+
throw new Error("remote plugin updates must resolve a verified library catalog source");
|
|
827
|
+
return installPlugin(installed.source, {
|
|
828
|
+
...options,
|
|
829
|
+
scope,
|
|
830
|
+
force: true,
|
|
831
|
+
expectedId: id,
|
|
832
|
+
origin: installed.origin ?? installed.source
|
|
833
|
+
});
|
|
834
|
+
} catch (error) {
|
|
835
|
+
return { diagnostics: [{ type: "error", message: error instanceof Error ? error.message : String(error) }] };
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
function setEnabled(id, enabled, options) {
|
|
839
|
+
if (!isPluginId(id)) return { diagnostics: [{ type: "error", message: "invalid plugin id" }] };
|
|
840
|
+
const cwd = options.cwd ?? process.cwd();
|
|
841
|
+
const scope = selectedScope(id, options);
|
|
842
|
+
return withMutation(scope, cwd, () => {
|
|
843
|
+
const { state, bytes } = readState(scope, cwd);
|
|
844
|
+
assertExpectedState(options.expect, cwd);
|
|
845
|
+
const plugin = listInstalledPlugins(cwd, { scope, all: true }).find((entry) => entry.id === id);
|
|
846
|
+
if (!plugin) throw new Error(`plugin ${id} is not installed`);
|
|
847
|
+
if (enabled && (!plugin.valid || !plugin.compatible))
|
|
848
|
+
throw new Error(`plugin ${id} cannot be enabled: ${plugin.diagnostics.map((entry) => entry.message).join("; ")}`);
|
|
849
|
+
if (!enabled && plugin.enabled) refuseBrokenDependents(cwd, { scope, id, operation: "disable" });
|
|
850
|
+
state.disabled = state.disabled.filter((value) => value !== id);
|
|
851
|
+
if (!enabled) state.disabled.push(id);
|
|
852
|
+
writeState(scope, cwd, state, bytes);
|
|
853
|
+
const updated = listInstalledPlugins(cwd, { scope, all: true }).find((entry) => entry.id === id);
|
|
854
|
+
return { ...updated ? { plugin: updated } : {}, diagnostics: [] };
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
function enablePlugin(id, options = {}) {
|
|
858
|
+
return setEnabled(id, true, options);
|
|
859
|
+
}
|
|
860
|
+
function disablePlugin(id, options = {}) {
|
|
861
|
+
return setEnabled(id, false, options);
|
|
862
|
+
}
|
|
863
|
+
function removePlugin(id, options = {}) {
|
|
864
|
+
if (!isPluginId(id)) return { diagnostics: [{ type: "error", message: "invalid plugin id" }] };
|
|
865
|
+
const cwd = options.cwd ?? process.cwd();
|
|
866
|
+
const scope = selectedScope(id, options);
|
|
867
|
+
return withMutation(scope, cwd, () => {
|
|
868
|
+
const { state, bytes } = readState(scope, cwd);
|
|
869
|
+
assertExpectedState(options.expect, cwd);
|
|
870
|
+
const target = path2.join(pluginBaseDir(scope, cwd), id);
|
|
871
|
+
const previousDigest = state.installed[id]?.contentDigest;
|
|
872
|
+
if (!existsSync2(target) && !state.installed[id]) throw new Error(`plugin ${id} is not installed`);
|
|
873
|
+
refuseBrokenDependents(cwd, { scope, id, operation: "remove" });
|
|
874
|
+
const backup = uniqueSibling(target, "removed");
|
|
875
|
+
const moved = existsSync2(target);
|
|
876
|
+
let preserve = false;
|
|
877
|
+
if (moved) {
|
|
878
|
+
try {
|
|
879
|
+
preserve = extensionContentDigest(target) !== state.installed[id]?.contentDigest;
|
|
880
|
+
} catch {
|
|
881
|
+
preserve = true;
|
|
882
|
+
}
|
|
883
|
+
renameSync(target, backup);
|
|
884
|
+
}
|
|
885
|
+
try {
|
|
886
|
+
delete state.installed[id];
|
|
887
|
+
state.disabled = state.disabled.filter((value) => value !== id);
|
|
888
|
+
writeState(scope, cwd, state, bytes);
|
|
889
|
+
} catch (error) {
|
|
890
|
+
if (moved) renameSync(backup, target);
|
|
891
|
+
throw error;
|
|
892
|
+
}
|
|
893
|
+
if (moved && !preserve) preserve = retainRecovery(backup, previousDigest);
|
|
894
|
+
return {
|
|
895
|
+
removed: { id, scope, path: target },
|
|
896
|
+
...preserve ? { recovery: { packageBackup: backup } } : {},
|
|
897
|
+
diagnostics: preserve ? [
|
|
898
|
+
{
|
|
899
|
+
type: "warning",
|
|
900
|
+
message: "removed plugin contained changed or unverified files; preserved recovery copy",
|
|
901
|
+
path: backup
|
|
902
|
+
}
|
|
903
|
+
] : []
|
|
904
|
+
};
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
// src/domains/plugins/resources.ts
|
|
909
|
+
init_esm_shims();
|
|
910
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
911
|
+
import { realpathSync as realpathSync3 } from "node:fs";
|
|
912
|
+
import path3 from "node:path";
|
|
913
|
+
var snapshots = /* @__PURE__ */ new Map();
|
|
914
|
+
var generation = 0;
|
|
915
|
+
function keyFor(cwd) {
|
|
916
|
+
return `${path3.resolve(clioConfigDir())}\0${realpathSync3(path3.resolve(cwd))}`;
|
|
917
|
+
}
|
|
918
|
+
function freeze(value) {
|
|
919
|
+
if (value !== null && typeof value === "object" && !Object.isFrozen(value)) {
|
|
920
|
+
for (const child of Object.values(value)) freeze(child);
|
|
921
|
+
Object.freeze(value);
|
|
922
|
+
}
|
|
923
|
+
return value;
|
|
924
|
+
}
|
|
925
|
+
function buildPluginSnapshot(cwd = process.cwd(), snapshotGeneration = 0) {
|
|
926
|
+
const canonicalCwd = realpathSync3(path3.resolve(cwd));
|
|
927
|
+
const packages = listInstalledPlugins(canonicalCwd, { all: true });
|
|
928
|
+
const resourceRoots = {
|
|
929
|
+
skills: [],
|
|
930
|
+
prompts: [],
|
|
931
|
+
agents: [],
|
|
932
|
+
fleets: [],
|
|
933
|
+
themes: []
|
|
934
|
+
};
|
|
935
|
+
for (const item of packages) {
|
|
936
|
+
if (!item.loadable || !item.provenance) continue;
|
|
937
|
+
for (const kind of PLUGIN_RESOURCE_KINDS) {
|
|
938
|
+
const relative = item.resources[kind];
|
|
939
|
+
if (!relative) continue;
|
|
940
|
+
resourceRoots[kind].push({
|
|
941
|
+
id: item.id,
|
|
942
|
+
scope: item.scope,
|
|
943
|
+
path: pluginResourcePath(item.rootPath, relative, item.kind === "skill" && relative === "."),
|
|
944
|
+
rootPath: item.rootPath,
|
|
945
|
+
source: `plugin:${item.scope}:${item.id}`,
|
|
946
|
+
provenance: item.provenance,
|
|
947
|
+
generation: snapshotGeneration,
|
|
948
|
+
trust: item.trust ?? "trusted"
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
const identity = packages.map((item) => ({
|
|
953
|
+
id: item.id,
|
|
954
|
+
scope: item.scope,
|
|
955
|
+
rootPath: item.rootPath,
|
|
956
|
+
enabled: item.enabled,
|
|
957
|
+
loadable: item.loadable,
|
|
958
|
+
contentDigest: item.observedContentDigest
|
|
959
|
+
}));
|
|
960
|
+
return freeze({
|
|
961
|
+
version: 1,
|
|
962
|
+
generation: snapshotGeneration,
|
|
963
|
+
cwd: canonicalCwd,
|
|
964
|
+
digest: createHash2("sha256").update(JSON.stringify(identity)).digest("hex"),
|
|
965
|
+
packages,
|
|
966
|
+
resourceRoots
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
function pluginSnapshotFor(cwd = process.cwd()) {
|
|
970
|
+
return snapshots.get(keyFor(cwd)) ?? buildPluginSnapshot(cwd);
|
|
971
|
+
}
|
|
972
|
+
function reloadPluginResources(cwd = process.cwd()) {
|
|
973
|
+
const key = keyFor(cwd);
|
|
974
|
+
const next = buildPluginSnapshot(cwd, ++generation);
|
|
975
|
+
snapshots.set(key, next);
|
|
976
|
+
return next;
|
|
977
|
+
}
|
|
978
|
+
function clearPluginSnapshots() {
|
|
979
|
+
snapshots.clear();
|
|
980
|
+
}
|
|
981
|
+
function enabledPluginResourceRoots(kind, cwd = process.cwd()) {
|
|
982
|
+
const snapshot = pluginSnapshotFor(cwd);
|
|
983
|
+
if (snapshot.generation === 0) return [...snapshot.resourceRoots[kind]];
|
|
984
|
+
const current = listInstalledPlugins(cwd, { all: true });
|
|
985
|
+
return snapshot.resourceRoots[kind].filter(
|
|
986
|
+
(root) => current.some(
|
|
987
|
+
(item) => item.loadable && item.id === root.id && item.scope === root.scope && item.provenance?.canonicalRoot === root.provenance.canonicalRoot && item.provenance?.manifestDigest === root.provenance.manifestDigest && item.provenance?.contentDigest === root.provenance.contentDigest
|
|
988
|
+
)
|
|
989
|
+
);
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
// src/domains/plugins/index.ts
|
|
993
|
+
init_esm_shims();
|
|
994
|
+
|
|
995
|
+
// src/domains/plugins/extension.ts
|
|
996
|
+
init_esm_shims();
|
|
997
|
+
function createPluginsBundle(_context) {
|
|
998
|
+
return {
|
|
999
|
+
extension: {
|
|
1000
|
+
start() {
|
|
1001
|
+
},
|
|
1002
|
+
stop() {
|
|
1003
|
+
clearPluginSnapshots();
|
|
1004
|
+
}
|
|
1005
|
+
},
|
|
1006
|
+
contract: {
|
|
1007
|
+
list: listInstalledPlugins,
|
|
1008
|
+
discover: discoverPluginPackages,
|
|
1009
|
+
install: installPlugin,
|
|
1010
|
+
update: updatePlugin,
|
|
1011
|
+
enable: enablePlugin,
|
|
1012
|
+
disable: disablePlugin,
|
|
1013
|
+
remove: removePlugin,
|
|
1014
|
+
resourceRoots: enabledPluginResourceRoots,
|
|
1015
|
+
snapshot: pluginSnapshotFor,
|
|
1016
|
+
reload: reloadPluginResources
|
|
1017
|
+
}
|
|
1018
|
+
};
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
// src/domains/plugins/manifest.ts
|
|
1022
|
+
init_esm_shims();
|
|
1023
|
+
var PluginsManifest = { name: "plugins", dependsOn: ["config"] };
|
|
1024
|
+
|
|
1025
|
+
// src/domains/plugins/index.ts
|
|
1026
|
+
var PluginsDomainModule = {
|
|
1027
|
+
manifest: PluginsManifest,
|
|
1028
|
+
createExtension: createPluginsBundle
|
|
1029
|
+
};
|
|
1030
|
+
|
|
1031
|
+
// src/domains/resources/package-references.ts
|
|
1032
|
+
init_esm_shims();
|
|
1033
|
+
import { realpathSync as realpathSync4 } from "node:fs";
|
|
1034
|
+
import path4 from "node:path";
|
|
1035
|
+
var REFERENCE_PATTERN = /\$\{(pluginRoot|component:([^}]+))\}(\/[A-Za-z0-9._~%+@/-]*)?/g;
|
|
1036
|
+
var COMPLETE_REFERENCE = /^\$\{(pluginRoot|component:([^}]+))\}(\/[\s\S]*)?$/u;
|
|
1037
|
+
function referenceResolver(context) {
|
|
1038
|
+
const root = realpathSync4(context.rootPath);
|
|
1039
|
+
let components2;
|
|
1040
|
+
return (reference, _token, ref, suffix) => {
|
|
1041
|
+
if (suffix && /[\\\0\r\n]/u.test(suffix)) throw new Error(`unsupported package path syntax: ${reference}`);
|
|
1042
|
+
let relative = "";
|
|
1043
|
+
if (ref !== void 0) {
|
|
1044
|
+
if (!components2) {
|
|
1045
|
+
const candidate = readPluginManifest(root);
|
|
1046
|
+
if (!candidate.valid || !candidate.manifest) throw new Error("plugin manifest unavailable for component reference");
|
|
1047
|
+
components2 = new Map(
|
|
1048
|
+
candidate.manifest.clio.components.map((component) => [`${component.kind}:${component.id}`, component.path])
|
|
1049
|
+
);
|
|
1050
|
+
}
|
|
1051
|
+
const componentPath = components2.get(ref);
|
|
1052
|
+
if (componentPath === void 0) throw new Error(`unresolved component reference: ${ref}`);
|
|
1053
|
+
relative = componentPath;
|
|
1054
|
+
}
|
|
1055
|
+
const target = path4.resolve(root, relative + (suffix ?? ""));
|
|
1056
|
+
const contained = (value) => {
|
|
1057
|
+
const rel = path4.relative(root, value);
|
|
1058
|
+
return rel !== ".." && !rel.startsWith(`..${path4.sep}`) && !path4.isAbsolute(rel);
|
|
1059
|
+
};
|
|
1060
|
+
try {
|
|
1061
|
+
const resolved = ref === void 0 ? path4.resolve(root, `.${suffix ?? ""}`) : target;
|
|
1062
|
+
if (!contained(resolved) || !contained(realpathSync4(resolved))) throw new Error("outside package");
|
|
1063
|
+
return resolved;
|
|
1064
|
+
} catch {
|
|
1065
|
+
throw new Error(`unresolved or escaping package reference: ${reference}`);
|
|
1066
|
+
}
|
|
1067
|
+
};
|
|
1068
|
+
}
|
|
1069
|
+
function resolvePackageReferences(body, context) {
|
|
1070
|
+
if (!context.rootPath || !context.plugin || !body.includes("${")) return body;
|
|
1071
|
+
return body.replace(REFERENCE_PATTERN, referenceResolver({ ...context, rootPath: context.rootPath }));
|
|
1072
|
+
}
|
|
1073
|
+
function resolvePackagePathReference(value, context) {
|
|
1074
|
+
if (!context.rootPath || !context.plugin || !/\$\{(?:pluginRoot|component:)/u.test(value)) return value;
|
|
1075
|
+
const match = COMPLETE_REFERENCE.exec(value);
|
|
1076
|
+
if (!match || match[3]?.includes("${"))
|
|
1077
|
+
throw new Error("package path references must occupy one complete argument with no embedded expressions");
|
|
1078
|
+
return referenceResolver({ ...context, rootPath: context.rootPath })(value, match[1] ?? "", match[2], match[3]);
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
// src/domains/agents/frontmatter.ts
|
|
1082
|
+
init_esm_shims();
|
|
1083
|
+
var import_yaml = __toESM(require_dist(), 1);
|
|
1084
|
+
function parseFrontmatter(raw, sourcePath) {
|
|
1085
|
+
const opening = raw.match(/^---\r?\n/);
|
|
1086
|
+
if (!opening) {
|
|
1087
|
+
throw new Error(`frontmatter: ${sourcePath}: missing YAML frontmatter opening delimiter`);
|
|
1088
|
+
}
|
|
1089
|
+
const closeRegex = /\r?\n---(?:\r?\n|$)/g;
|
|
1090
|
+
closeRegex.lastIndex = opening[0].length;
|
|
1091
|
+
const closing = closeRegex.exec(raw);
|
|
1092
|
+
if (!closing) {
|
|
1093
|
+
throw new Error(`frontmatter: ${sourcePath}: missing YAML frontmatter closing delimiter`);
|
|
1094
|
+
}
|
|
1095
|
+
const frontmatterText = raw.slice(opening[0].length, closing.index);
|
|
1096
|
+
const body = raw.slice(closing.index + closing[0].length);
|
|
1097
|
+
let parsed;
|
|
1098
|
+
try {
|
|
1099
|
+
parsed = import_yaml.default.parse(frontmatterText);
|
|
1100
|
+
} catch (err) {
|
|
1101
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
1102
|
+
throw new Error(`frontmatter: ${sourcePath}: invalid YAML frontmatter (${reason})`);
|
|
1103
|
+
}
|
|
1104
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
1105
|
+
throw new Error(`frontmatter: ${sourcePath}: frontmatter must be a YAML object`);
|
|
1106
|
+
}
|
|
1107
|
+
return {
|
|
1108
|
+
frontmatter: parsed,
|
|
1109
|
+
body
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
export {
|
|
1114
|
+
isLibraryKind,
|
|
1115
|
+
LIBRARY_RESOURCE_KINDS,
|
|
1116
|
+
isLibraryResourceKind,
|
|
1117
|
+
LIBRARY_PROVIDES_LIMITS,
|
|
1118
|
+
PLUGIN_SCHEMA,
|
|
1119
|
+
PLUGIN_EXTENSION_KEY,
|
|
1120
|
+
isPluginId,
|
|
1121
|
+
pluginResourcePath,
|
|
1122
|
+
readPluginManifest,
|
|
1123
|
+
installLibraryPackage,
|
|
1124
|
+
pluginBaseDir,
|
|
1125
|
+
PluginWriterRefusal,
|
|
1126
|
+
withPluginScopeLock,
|
|
1127
|
+
observePluginCopy,
|
|
1128
|
+
newlyBrokenDependents,
|
|
1129
|
+
listInstalledPlugins,
|
|
1130
|
+
readPluginInstallRecord,
|
|
1131
|
+
installPlugin,
|
|
1132
|
+
enablePlugin,
|
|
1133
|
+
disablePlugin,
|
|
1134
|
+
removePlugin,
|
|
1135
|
+
pluginSnapshotFor,
|
|
1136
|
+
reloadPluginResources,
|
|
1137
|
+
enabledPluginResourceRoots,
|
|
1138
|
+
PluginsDomainModule,
|
|
1139
|
+
resolvePackageReferences,
|
|
1140
|
+
resolvePackagePathReference,
|
|
1141
|
+
parseFrontmatter
|
|
1142
|
+
};
|
|
1143
|
+
//# sourceMappingURL=chunk-YKRJTYNP.js.map
|