@skaile/workspaces 5.19.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/README.md +8 -8
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-QGLI3AXI.js → asset-feeds-HJFV7UPW.js} +32 -24
- package/dist/asset-feeds-HJFV7UPW.js.map +1 -0
- package/dist/asset-manager/catalog-deployer.js +12 -12
- package/dist/asset-manager/index.js +19 -19
- package/dist/asset-manager/installer.js +14 -14
- package/dist/asset-manager/renderers.js +13 -13
- package/dist/asset-manager/src/index.d.ts +214 -27
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/asset-manager/src/install-agent.d.ts +2 -2
- package/dist/asset-manager/src/install-agent.d.ts.map +1 -1
- package/dist/asset-manager/src/install-instances.d.ts +8 -8
- package/dist/asset-manager/src/install-instances.d.ts.map +1 -1
- package/dist/asset-manager/src/installer.d.ts +34 -3
- package/dist/asset-manager/src/installer.d.ts.map +1 -1
- package/dist/asset-manager/src/mcp-config.d.ts +35 -14
- package/dist/asset-manager/src/mcp-config.d.ts.map +1 -1
- package/dist/asset-manager/src/renderers.d.ts +12 -12
- package/dist/asset-manager/src/renderers.d.ts.map +1 -1
- package/dist/bridge/codex-app-server.js +2 -2
- package/dist/bridge/harnesses/claude-sdk.d.ts +2 -0
- package/dist/bridge/{drivers → harnesses}/claude-sdk.js +69 -73
- package/dist/bridge/harnesses/claude-sdk.js.map +1 -0
- package/dist/bridge/{drivers/gemini.d.ts → harnesses/codex.d.ts} +1 -1
- package/dist/bridge/{drivers → harnesses}/codex.js +53 -53
- package/dist/bridge/harnesses/codex.js.map +1 -0
- package/dist/bridge/{drivers/claude-sdk.d.ts → harnesses/continue.d.ts} +1 -1
- package/dist/bridge/{drivers → harnesses}/continue.js +30 -30
- package/dist/bridge/harnesses/continue.js.map +1 -0
- package/dist/bridge/{drivers → harnesses}/echo.d.ts +1 -1
- package/dist/bridge/{drivers → harnesses}/echo.js +27 -27
- package/dist/bridge/harnesses/echo.js.map +1 -0
- package/dist/bridge/{drivers/continue.d.ts → harnesses/gemini.d.ts} +1 -1
- package/dist/bridge/harnesses/gemini.js +18 -0
- package/dist/bridge/{drivers → harnesses}/goose.d.ts +1 -1
- package/dist/bridge/{drivers → harnesses}/goose.js +30 -30
- package/dist/bridge/harnesses/goose.js.map +1 -0
- package/dist/bridge/{drivers → harnesses}/omp.d.ts +1 -1
- package/dist/bridge/{drivers → harnesses}/omp.js +31 -31
- package/dist/bridge/harnesses/omp.js.map +1 -0
- package/dist/bridge/{drivers → harnesses}/opencode.d.ts +1 -1
- package/dist/bridge/{drivers → harnesses}/opencode.js +31 -31
- package/dist/bridge/harnesses/opencode.js.map +1 -0
- package/dist/bridge/{drivers → harnesses}/qwen.d.ts +1 -1
- package/dist/bridge/{drivers → harnesses}/qwen.js +20 -20
- package/dist/bridge/harnesses/qwen.js.map +1 -0
- package/dist/bridge/index.js +25 -25
- package/dist/bridge/src/agent-exec.d.ts +2 -2
- package/dist/bridge/src/agent-transcript.d.ts +1 -1
- package/dist/bridge/src/agent-transcript.d.ts.map +1 -1
- package/dist/bridge/src/approval-card.d.ts +3 -3
- package/dist/bridge/src/capability-dispatch.d.ts +5 -5
- package/dist/bridge/src/claude-sdk-surface.d.ts +17 -0
- package/dist/bridge/src/claude-sdk-surface.d.ts.map +1 -0
- package/dist/bridge/src/cloud.d.ts +4 -4
- package/dist/bridge/src/codex/config-toml.d.ts +3 -3
- package/dist/bridge/src/codex/friendly-error.d.ts +1 -1
- package/dist/bridge/src/codex/friendly-error.d.ts.map +1 -1
- package/dist/bridge/src/codex/{managed-driver.d.ts → managed-harness.d.ts} +5 -5
- package/dist/bridge/src/codex/managed-harness.d.ts.map +1 -0
- package/dist/bridge/src/codex/native-approvals.d.ts +1 -1
- package/dist/bridge/src/codex/native-approvals.d.ts.map +1 -1
- package/dist/bridge/src/error-classifier.d.ts +7 -7
- package/dist/bridge/src/{driver-capabilities.d.ts → harness-capabilities.d.ts} +18 -18
- package/dist/bridge/src/harness-capabilities.d.ts.map +1 -0
- package/dist/bridge/src/harness-model-check.d.ts +40 -0
- package/dist/bridge/src/harness-model-check.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/_subprocess-cli.d.ts +8 -8
- package/dist/bridge/src/harnesses/_subprocess-cli.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/claude-context-usage.d.ts +5 -5
- package/dist/bridge/src/harnesses/claude-context-usage.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/claude-sdk.d.ts +27 -27
- package/dist/bridge/src/harnesses/claude-sdk.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/claude-self-turns.d.ts +5 -5
- package/dist/bridge/src/harnesses/claude-self-turns.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/claude-tool-allowlist.d.ts +4 -4
- package/dist/bridge/src/harnesses/claude-tool-allowlist.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/codex.d.ts +14 -14
- package/dist/bridge/src/harnesses/codex.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/continue.d.ts +12 -12
- package/dist/bridge/src/harnesses/continue.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/echo.d.ts +16 -16
- package/dist/bridge/src/harnesses/echo.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/flow-script.d.ts +9 -9
- package/dist/bridge/src/harnesses/flow-script.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/gemini.d.ts +15 -15
- package/dist/bridge/src/harnesses/gemini.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/goose.d.ts +10 -10
- package/dist/bridge/src/harnesses/goose.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/omp-models-yml.d.ts +12 -12
- package/dist/bridge/src/harnesses/omp-models-yml.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/omp.d.ts +23 -23
- package/dist/bridge/src/harnesses/omp.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/opencode.d.ts +11 -11
- package/dist/bridge/src/harnesses/opencode.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/qwen.d.ts +12 -12
- package/dist/bridge/src/harnesses/qwen.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/recovery-policy.d.ts +4 -4
- package/dist/bridge/src/harnesses/recovery-policy.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/resume-probe.d.ts +3 -3
- package/dist/bridge/src/harnesses/resume-probe.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/sanitize-assistant-text.d.ts +1 -1
- package/dist/bridge/src/harnesses/sanitize-assistant-text.d.ts.map +1 -0
- package/dist/bridge/src/{drivers → harnesses}/scrub-transcript.d.ts +1 -1
- package/dist/bridge/src/harnesses/scrub-transcript.d.ts.map +1 -0
- package/dist/bridge/src/index.d.ts +5 -4
- package/dist/bridge/src/index.d.ts.map +1 -1
- package/dist/bridge/src/logger.d.ts +4 -4
- package/dist/bridge/src/models.d.ts +1 -1
- package/dist/bridge/src/normalizer.d.ts +5 -3
- package/dist/bridge/src/normalizer.d.ts.map +1 -1
- package/dist/bridge/src/provider-materialize/continue-config-yaml.d.ts +5 -5
- package/dist/bridge/src/provider-materialize/continue-config-yaml.d.ts.map +1 -1
- package/dist/bridge/src/provider-materialize/credential-env.d.ts +3 -3
- package/dist/bridge/src/provider-materialize/{env-drivers.d.ts → env-harnesses.d.ts} +19 -19
- package/dist/bridge/src/provider-materialize/env-harnesses.d.ts.map +1 -0
- package/dist/bridge/src/provider-materialize/goose-custom-providers.d.ts +5 -5
- package/dist/bridge/src/provider-materialize/goose-custom-providers.d.ts.map +1 -1
- package/dist/bridge/src/provider-materialize/opencode-config.d.ts +7 -7
- package/dist/bridge/src/provider-materialize/opencode-config.d.ts.map +1 -1
- package/dist/bridge/src/provider-materialize/session-config-home.d.ts +5 -5
- package/dist/bridge/src/provider-materialize/session-config-home.d.ts.map +1 -1
- package/dist/bridge/src/provider-registry-derive.d.ts +4 -4
- package/dist/bridge/src/provider-registry-derive.d.ts.map +1 -1
- package/dist/bridge/src/reconfigure-ledger.d.ts +8 -8
- package/dist/bridge/src/reconfigure-ledger.d.ts.map +1 -1
- package/dist/bridge/src/registry.d.ts +34 -41
- package/dist/bridge/src/registry.d.ts.map +1 -1
- package/dist/bridge/src/runner-private-env.d.ts +2 -2
- package/dist/bridge/src/runtime.d.ts +11 -11
- package/dist/bridge/src/runtime.d.ts.map +1 -1
- package/dist/bridge/src/types.d.ts +158 -158
- package/dist/bridge/src/types.d.ts.map +1 -1
- package/dist/{chunk-7NT4F6SR.js → chunk-2LAPHLDH.js} +587 -521
- package/dist/chunk-2LAPHLDH.js.map +1 -0
- package/dist/{chunk-25ZVWL2R.js → chunk-3GMOPFWH.js} +4 -4
- package/dist/{chunk-25ZVWL2R.js.map → chunk-3GMOPFWH.js.map} +1 -1
- package/dist/{chunk-X5YPJV4N.js → chunk-3MWQKQUB.js} +2 -2
- package/dist/{chunk-X5YPJV4N.js.map → chunk-3MWQKQUB.js.map} +1 -1
- package/dist/{chunk-EPBKISS5.js → chunk-3TG2NV2F.js} +2 -2
- package/dist/chunk-3TG2NV2F.js.map +1 -0
- package/dist/{chunk-L2AMXONH.js → chunk-3X7VTCPG.js} +2 -2
- package/dist/chunk-3X7VTCPG.js.map +1 -0
- package/dist/{chunk-VIM3PWZM.js → chunk-4FVIT5DI.js} +3 -3
- package/dist/{chunk-VIM3PWZM.js.map → chunk-4FVIT5DI.js.map} +1 -1
- package/dist/{chunk-IF6IA3PZ.js → chunk-4MUDQCBP.js} +4 -4
- package/dist/{chunk-IF6IA3PZ.js.map → chunk-4MUDQCBP.js.map} +1 -1
- package/dist/{chunk-MKRWN7XP.js → chunk-5J4NPGFM.js} +5 -5
- package/dist/chunk-5J4NPGFM.js.map +1 -0
- package/dist/{chunk-5TBFN46Z.js → chunk-5KRMNUL4.js} +4 -4
- package/dist/chunk-5KRMNUL4.js.map +1 -0
- package/dist/{chunk-7SCS64BG.js → chunk-5Y2KGB4H.js} +109 -74
- package/dist/chunk-5Y2KGB4H.js.map +1 -0
- package/dist/{chunk-YIF2IJUA.js → chunk-6GWSDPBP.js} +3 -3
- package/dist/{chunk-YIF2IJUA.js.map → chunk-6GWSDPBP.js.map} +1 -1
- package/dist/{chunk-WST6UITC.js → chunk-6YR4ALVX.js} +17 -17
- package/dist/chunk-6YR4ALVX.js.map +1 -0
- package/dist/{chunk-YROR332M.js → chunk-7DN6JKP2.js} +2 -2
- package/dist/chunk-7DN6JKP2.js.map +1 -0
- package/dist/{chunk-IZCR27MU.js → chunk-7EKQDY2T.js} +3 -3
- package/dist/chunk-7EKQDY2T.js.map +1 -0
- package/dist/chunk-7HX6FNKL.js +317 -0
- package/dist/chunk-7HX6FNKL.js.map +1 -0
- package/dist/{chunk-COJIL7G4.js → chunk-7LP7RCZI.js} +7 -7
- package/dist/chunk-7LP7RCZI.js.map +1 -0
- package/dist/{chunk-2PBSAH3Z.js → chunk-AATHJRKL.js} +4 -4
- package/dist/{chunk-2PBSAH3Z.js.map → chunk-AATHJRKL.js.map} +1 -1
- package/dist/{chunk-C7WBGSBV.js → chunk-ABFPSVIS.js} +10 -10
- package/dist/chunk-ABFPSVIS.js.map +1 -0
- package/dist/{chunk-ICSCSM5D.js → chunk-ADPM6AYF.js} +3 -3
- package/dist/{chunk-ICSCSM5D.js.map → chunk-ADPM6AYF.js.map} +1 -1
- package/dist/{chunk-WOIRYY5L.js → chunk-AITJ7ELM.js} +141 -27
- package/dist/chunk-AITJ7ELM.js.map +1 -0
- package/dist/{chunk-HU5HVKY7.js → chunk-ASWTQQ7E.js} +4 -4
- package/dist/{chunk-HU5HVKY7.js.map → chunk-ASWTQQ7E.js.map} +1 -1
- package/dist/{chunk-RO6VOM6Z.js → chunk-AZ2H6R5I.js} +51 -25
- package/dist/chunk-AZ2H6R5I.js.map +1 -0
- package/dist/{chunk-I7TWVK6N.js → chunk-BBBCJSSU.js} +4 -4
- package/dist/{chunk-I7TWVK6N.js.map → chunk-BBBCJSSU.js.map} +1 -1
- package/dist/{chunk-AJ7EGIFR.js → chunk-BIRW3HOG.js} +3 -3
- package/dist/chunk-BIRW3HOG.js.map +1 -0
- package/dist/{chunk-FPHNJE4M.js → chunk-CEKW3KXP.js} +91 -30
- package/dist/chunk-CEKW3KXP.js.map +1 -0
- package/dist/{chunk-F6AA42GW.js → chunk-COYF6IG2.js} +5 -5
- package/dist/{chunk-F6AA42GW.js.map → chunk-COYF6IG2.js.map} +1 -1
- package/dist/{chunk-HT35SQZD.js → chunk-DGTI65OC.js} +30 -30
- package/dist/chunk-DGTI65OC.js.map +1 -0
- package/dist/{chunk-W4Q6CKJ5.js → chunk-DIGFA7Z5.js} +11 -11
- package/dist/chunk-DIGFA7Z5.js.map +1 -0
- package/dist/{chunk-335ENCCS.js → chunk-E572OHGY.js} +2 -2
- package/dist/{chunk-335ENCCS.js.map → chunk-E572OHGY.js.map} +1 -1
- package/dist/{chunk-Y5MBW5EU.js → chunk-EJPMNDTP.js} +3 -3
- package/dist/{chunk-Y5MBW5EU.js.map → chunk-EJPMNDTP.js.map} +1 -1
- package/dist/chunk-EX3GLAL6.js +31 -0
- package/dist/chunk-EX3GLAL6.js.map +1 -0
- package/dist/{chunk-XWOPZW26.js → chunk-FKQNBCDW.js} +38 -38
- package/dist/chunk-FKQNBCDW.js.map +1 -0
- package/dist/{chunk-6E6PKKAD.js → chunk-G5SUWZEU.js} +18 -8
- package/dist/chunk-G5SUWZEU.js.map +1 -0
- package/dist/{chunk-2GXSSZAM.js → chunk-GNZBFSRB.js} +12 -12
- package/dist/chunk-GNZBFSRB.js.map +1 -0
- package/dist/{chunk-PYJS5K7V.js → chunk-HMISULVD.js} +5 -5
- package/dist/{chunk-PYJS5K7V.js.map → chunk-HMISULVD.js.map} +1 -1
- package/dist/{chunk-IP2IPMEH.js → chunk-HPMQRAIF.js} +18 -18
- package/dist/chunk-HPMQRAIF.js.map +1 -0
- package/dist/{chunk-MRHVPQNO.js → chunk-HWNK3F3X.js} +1015 -189
- package/dist/chunk-HWNK3F3X.js.map +1 -0
- package/dist/{chunk-ZQSOJH6I.js → chunk-IHFGPHCT.js} +141 -341
- package/dist/chunk-IHFGPHCT.js.map +1 -0
- package/dist/{chunk-CQJH4G2K.js → chunk-ILLTBKDJ.js} +101 -102
- package/dist/chunk-ILLTBKDJ.js.map +1 -0
- package/dist/{chunk-FKU57Q5Q.js → chunk-IRYKRKVQ.js} +3 -3
- package/dist/{chunk-FKU57Q5Q.js.map → chunk-IRYKRKVQ.js.map} +1 -1
- package/dist/{chunk-J24CY3PF.js → chunk-J72MO2WA.js} +39 -39
- package/dist/chunk-J72MO2WA.js.map +1 -0
- package/dist/{chunk-Y56YIT6J.js → chunk-JCPD4QRM.js} +4 -4
- package/dist/chunk-JCPD4QRM.js.map +1 -0
- package/dist/{chunk-X3RMRJNR.js → chunk-JRN5QF4C.js} +8 -3
- package/dist/chunk-JRN5QF4C.js.map +1 -0
- package/dist/{chunk-K4O6L3WH.js → chunk-KNY356I3.js} +3 -3
- package/dist/{chunk-K4O6L3WH.js.map → chunk-KNY356I3.js.map} +1 -1
- package/dist/{chunk-XJVBUDDJ.js → chunk-KUQAJVYT.js} +8 -8
- package/dist/chunk-KUQAJVYT.js.map +1 -0
- package/dist/{chunk-4ZTPYIBE.js → chunk-KW37WNXY.js} +12 -12
- package/dist/chunk-KW37WNXY.js.map +1 -0
- package/dist/{chunk-MJHSLODD.js → chunk-LSI2IVFT.js} +2 -2
- package/dist/chunk-LSI2IVFT.js.map +1 -0
- package/dist/{chunk-WDXZA7QW.js → chunk-LSSYC5IC.js} +2 -2
- package/dist/{chunk-WDXZA7QW.js.map → chunk-LSSYC5IC.js.map} +1 -1
- package/dist/{chunk-WG6V4ISA.js → chunk-NB7SYQYP.js} +7 -7
- package/dist/{chunk-WG6V4ISA.js.map → chunk-NB7SYQYP.js.map} +1 -1
- package/dist/{chunk-EAZECHPM.js → chunk-NBAGV6L2.js} +5 -5
- package/dist/chunk-NBAGV6L2.js.map +1 -0
- package/dist/{chunk-JTOWA6RS.js → chunk-NUA33BYO.js} +181 -64
- package/dist/chunk-NUA33BYO.js.map +1 -0
- package/dist/{chunk-A6SMCEEE.js → chunk-QAKUD6QN.js} +11 -11
- package/dist/{chunk-A6SMCEEE.js.map → chunk-QAKUD6QN.js.map} +1 -1
- package/dist/{chunk-QG6GHTRM.js → chunk-QEULL4Q3.js} +8 -8
- package/dist/chunk-QEULL4Q3.js.map +1 -0
- package/dist/{chunk-ZX4KRWRB.js → chunk-QSYQOTWN.js} +4 -4
- package/dist/{chunk-ZX4KRWRB.js.map → chunk-QSYQOTWN.js.map} +1 -1
- package/dist/{chunk-X4ZZTHU3.js → chunk-RDTLPOPD.js} +4 -4
- package/dist/{chunk-X4ZZTHU3.js.map → chunk-RDTLPOPD.js.map} +1 -1
- package/dist/{chunk-GOCWM7FN.js → chunk-RHN5MRQO.js} +21 -4
- package/dist/chunk-RHN5MRQO.js.map +1 -0
- package/dist/{chunk-XM6T2AZ2.js → chunk-S2XHGWQC.js} +162 -124
- package/dist/chunk-S2XHGWQC.js.map +1 -0
- package/dist/{chunk-VJ7NU7GD.js → chunk-SVTMNSPI.js} +23 -6
- package/dist/chunk-SVTMNSPI.js.map +1 -0
- package/dist/{chunk-I37INEWE.js → chunk-UI745XC3.js} +10 -23
- package/dist/chunk-UI745XC3.js.map +1 -0
- package/dist/{chunk-N46LQR46.js → chunk-VMVDAZLA.js} +53 -30
- package/dist/chunk-VMVDAZLA.js.map +1 -0
- package/dist/{chunk-IG5LZ3WU.js → chunk-VTETQCR6.js} +10 -10
- package/dist/chunk-VTETQCR6.js.map +1 -0
- package/dist/{chunk-EFLKSMCO.js → chunk-VUJXZDCY.js} +5 -5
- package/dist/{chunk-EFLKSMCO.js.map → chunk-VUJXZDCY.js.map} +1 -1
- package/dist/{chunk-H6UVIKQ2.js → chunk-VYVTEMAW.js} +3 -3
- package/dist/{chunk-H6UVIKQ2.js.map → chunk-VYVTEMAW.js.map} +1 -1
- package/dist/{chunk-M3WPBTGJ.js → chunk-WD3L5QSU.js} +2 -2
- package/dist/{chunk-M3WPBTGJ.js.map → chunk-WD3L5QSU.js.map} +1 -1
- package/dist/{chunk-R6O6YWU7.js → chunk-WYZXSJBK.js} +3 -3
- package/dist/{chunk-R6O6YWU7.js.map → chunk-WYZXSJBK.js.map} +1 -1
- package/dist/{chunk-R4I3VBSS.js → chunk-X3YGUKCG.js} +5 -5
- package/dist/{chunk-R4I3VBSS.js.map → chunk-X3YGUKCG.js.map} +1 -1
- package/dist/{chunk-RPZVHXQ3.js → chunk-XFIEVEU7.js} +4 -4
- package/dist/chunk-XFIEVEU7.js.map +1 -0
- package/dist/{chunk-VSZWNUZC.js → chunk-XGULGQA3.js} +4 -4
- package/dist/chunk-XGULGQA3.js.map +1 -0
- package/dist/{chunk-Q6E6FM7P.js → chunk-XKNXPLKR.js} +6 -6
- package/dist/{chunk-Q6E6FM7P.js.map → chunk-XKNXPLKR.js.map} +1 -1
- package/dist/{chunk-7XSAW5OC.js → chunk-YLLVSR2U.js} +4 -4
- package/dist/{chunk-7XSAW5OC.js.map → chunk-YLLVSR2U.js.map} +1 -1
- package/dist/{chunk-6Z5KTFJT.js → chunk-Z3VKUWAX.js} +3 -3
- package/dist/{chunk-6Z5KTFJT.js.map → chunk-Z3VKUWAX.js.map} +1 -1
- package/dist/{chunk-5BEFNLOR.js → chunk-Z7ZEZZB6.js} +8 -8
- package/dist/chunk-Z7ZEZZB6.js.map +1 -0
- package/dist/{chunk-2LSDMJI2.js → chunk-ZAELRYKS.js} +4 -4
- package/dist/{chunk-2LSDMJI2.js.map → chunk-ZAELRYKS.js.map} +1 -1
- package/dist/{chunk-UQ33Y4DM.js → chunk-ZBHZLWV3.js} +4 -4
- package/dist/{chunk-UQ33Y4DM.js.map → chunk-ZBHZLWV3.js.map} +1 -1
- package/dist/{chunk-TIIXG3PN.js → chunk-ZDLUQLI6.js} +4 -4
- package/dist/{chunk-TIIXG3PN.js.map → chunk-ZDLUQLI6.js.map} +1 -1
- package/dist/{chunk-PHRNUTSG.js → chunk-ZFUZ5AKM.js} +4 -4
- package/dist/{chunk-PHRNUTSG.js.map → chunk-ZFUZ5AKM.js.map} +1 -1
- package/dist/{chunk-V257LUBM.js → chunk-ZHGKAZJ7.js} +251 -26
- package/dist/chunk-ZHGKAZJ7.js.map +1 -0
- package/dist/claude-code-RE46FJXI.js +10 -0
- package/dist/{claude-code-2PU7TITZ.js.map → claude-code-RE46FJXI.js.map} +1 -1
- package/dist/cli/index.js +1066 -647
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/agent-pins.d.ts +11 -0
- package/dist/cli/src/agent-pins.d.ts.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts +4 -4
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/complete-resolvers.d.ts.map +1 -1
- package/dist/cli/src/commands/config.d.ts +2 -2
- package/dist/cli/src/commands/config.d.ts.map +1 -1
- package/dist/cli/src/commands/diff.d.ts.map +1 -1
- package/dist/cli/src/commands/harness.d.ts +24 -0
- package/dist/cli/src/commands/harness.d.ts.map +1 -0
- package/dist/cli/src/commands/integration.d.ts +1 -1
- package/dist/cli/src/commands/integration.d.ts.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/library-index.d.ts +20 -2
- package/dist/cli/src/commands/library-index.d.ts.map +1 -1
- package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
- package/dist/cli/src/commands/migrate-assets.d.ts.map +1 -1
- package/dist/cli/src/commands/migrate-files.d.ts +14 -0
- package/dist/cli/src/commands/migrate-files.d.ts.map +1 -1
- package/dist/cli/src/commands/migrate-harness.d.ts +49 -0
- package/dist/cli/src/commands/migrate-harness.d.ts.map +1 -0
- package/dist/cli/src/commands/migrate.d.ts +4 -2
- package/dist/cli/src/commands/migrate.d.ts.map +1 -1
- package/dist/cli/src/commands/plugin/types.d.ts +1 -6
- package/dist/cli/src/commands/plugin/types.d.ts.map +1 -1
- package/dist/cli/src/commands/plugin-registry-cmd.d.ts +1 -1
- package/dist/cli/src/commands/preset-export.d.ts +1 -1
- package/dist/cli/src/commands/project.d.ts +20 -2
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/cli/src/commands/run.d.ts +2 -2
- package/dist/cli/src/commands/run.d.ts.map +1 -1
- package/dist/cli/src/commands/serve-preflight.d.ts +11 -11
- package/dist/cli/src/commands/serve-preflight.d.ts.map +1 -1
- package/dist/cli/src/commands/serve.d.ts +1 -1
- package/dist/cli/src/commands/serve.d.ts.map +1 -1
- package/dist/cli/src/commands/session-logs/local-query.d.ts +2 -0
- package/dist/cli/src/commands/session-logs/local-query.d.ts.map +1 -1
- package/dist/cli/src/commands/source.d.ts +9 -2
- package/dist/cli/src/commands/source.d.ts.map +1 -1
- package/dist/cli/src/commands/store.d.ts.map +1 -1
- package/dist/cli/src/commands/update.d.ts.map +1 -1
- package/dist/cli/src/commands/validate.d.ts.map +1 -1
- package/dist/cli/src/config-checks.d.ts +37 -0
- package/dist/cli/src/config-checks.d.ts.map +1 -0
- package/dist/cli/src/harness-error.d.ts +47 -0
- package/dist/cli/src/harness-error.d.ts.map +1 -0
- package/dist/cli/src/helpers.d.ts +5 -5
- package/dist/cli/src/helpers.d.ts.map +1 -1
- package/dist/cli/src/plugin-store/index.d.ts +2 -2
- package/dist/cli/src/setup.d.ts +3 -3
- package/dist/cli/src/setup.d.ts.map +1 -1
- package/dist/cli/src/skill-checks.d.ts +27 -0
- package/dist/cli/src/skill-checks.d.ts.map +1 -1
- package/dist/cli/src/store-addable.d.ts +11 -0
- package/dist/cli/src/store-addable.d.ts.map +1 -1
- package/dist/connectors/config.js +6 -6
- package/dist/connectors/index.js +31 -31
- package/dist/connectors/src/connector-prompt.d.ts +5 -5
- package/dist/connectors/src/connector-registry.d.ts +1 -1
- package/dist/connectors-7THEF7YA.js +48 -0
- package/dist/{connectors-RBGZ3M7G.js.map → connectors-7THEF7YA.js.map} +1 -1
- package/dist/connectors-shared/index.js +2 -2
- package/dist/core/framework.js +1 -1
- package/dist/{bridge/drivers/codex.d.ts → core/harness-targets.d.ts} +1 -1
- package/dist/core/harness-targets.js +4 -0
- package/dist/core/harness-targets.js.map +1 -0
- package/dist/core/index.js +11 -11
- package/dist/core/manifest.js +2 -2
- package/dist/core/models.js +1 -1
- package/dist/core/provider-registry-credentials.js +2 -2
- package/dist/core/provider-registry.js +1 -1
- package/dist/core/publish-manifest.js +3 -3
- package/dist/core/ref.js +1 -1
- package/dist/core/runtime-assets.js +6 -6
- package/dist/core/src/agent-instances.d.ts.map +1 -1
- package/dist/core/src/asset-roots.d.ts +2 -2
- package/dist/core/src/config-key-diagnostics.d.ts +9 -0
- package/dist/core/src/config-key-diagnostics.d.ts.map +1 -0
- package/dist/core/src/framework.d.ts +21 -21
- package/dist/core/src/framework.d.ts.map +1 -1
- package/dist/core/src/{driver-sdk.d.ts → harness-sdk.d.ts} +9 -9
- package/dist/core/src/harness-sdk.d.ts.map +1 -0
- package/dist/core/src/harness-targets.d.ts +71 -0
- package/dist/core/src/harness-targets.d.ts.map +1 -0
- package/dist/core/src/index.d.ts +8 -8
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/manifest.d.ts +10 -0
- package/dist/core/src/manifest.d.ts.map +1 -1
- package/dist/core/src/models.d.ts +8 -0
- package/dist/core/src/models.d.ts.map +1 -1
- package/dist/core/src/provider-registry.d.ts +2 -2
- package/dist/core/src/settings.d.ts +17 -16
- package/dist/core/src/settings.d.ts.map +1 -1
- package/dist/core/src/store.d.ts +12 -12
- package/dist/core/src/store.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +39 -21
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/src/workspace-yaml-editor.d.ts +10 -3
- package/dist/core/src/workspace-yaml-editor.d.ts.map +1 -1
- package/dist/core/store.js +2 -2
- package/dist/core/workspace-config.js +5 -5
- package/dist/deploy/index.js +12 -12
- package/dist/discovery/index.js +5 -5
- package/dist/discovery/src/builtin-providers.d.ts.map +1 -1
- package/dist/discovery/src/parse-manifest.d.ts.map +1 -1
- package/dist/{ensure-sources-GKVLE6L5.js → ensure-sources-IH7CHSJF.js} +22 -22
- package/dist/{ensure-sources-GKVLE6L5.js.map → ensure-sources-IH7CHSJF.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +31 -31
- package/dist/factory-assets/connectors/deploy.js +31 -31
- package/dist/factory-assets/connectors/devserver.js +31 -31
- package/dist/factory-assets/connectors/flow/CONNECTOR.md +5 -5
- package/dist/factory-assets/connectors/flow/adapter.d.ts +3 -3
- package/dist/factory-assets/connectors/flow/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/adapter.js +31 -31
- package/dist/factory-assets/connectors/flow/contract/normalize.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/contract.js +1 -1
- package/dist/factory-assets/connectors/flow/engine/types.d.ts +1 -1
- package/dist/factory-assets/connectors/flow/engine.js +13 -13
- package/dist/factory-assets/connectors/flow/inline-sub-flow-host.d.ts +2 -2
- package/dist/factory-assets/connectors/flow/inline-sub-flow-host.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/orchestrator-turn.d.ts +4 -4
- package/dist/factory-assets/connectors/flow/orchestrator-turn.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/prompt-fragments.d.ts +1 -1
- package/dist/factory-assets/connectors/flow/prompt-fragments.js +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.d.ts +12 -12
- package/dist/factory-assets/connectors/flow/run-flow.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.js +33 -33
- package/dist/factory-assets/connectors/flow/sub-flow-runner.d.ts +1 -1
- package/dist/factory-assets/connectors/flow/sub-flow-runner.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/subprompt-runner.d.ts +22 -22
- package/dist/factory-assets/connectors/flow/subprompt-runner.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow.js +31 -31
- package/dist/factory-assets/connectors/git.js +31 -31
- package/dist/factory-assets/connectors/gmail.js +31 -31
- package/dist/factory-assets/connectors/googledrive.js +31 -31
- package/dist/factory-assets/connectors/local.js +31 -31
- package/dist/factory-assets/connectors/mattermost.js +31 -31
- package/dist/factory-assets/connectors/memory.js +31 -31
- package/dist/factory-assets/connectors/minio.js +31 -31
- package/dist/factory-assets/connectors/postgres.js +31 -31
- package/dist/factory-assets/connectors/s3.js +31 -31
- package/dist/factory-assets/connectors/sharepoint.js +31 -31
- package/dist/factory-assets/connectors/sqlite.js +31 -31
- package/dist/factory-assets/connectors/static-server.js +31 -31
- package/dist/factory-assets/connectors/tunnel.js +31 -31
- package/dist/factory-assets/connectors/webdav.js +31 -31
- package/dist/factory-assets/connectors/xstate-store.js +31 -31
- package/dist/factory-assets/connectors/xstate.js +31 -31
- package/dist/factory-assets/skills/authoring-skaile-assets/SKILL.md +1 -1
- package/dist/factory-assets/skills/authoring-skaile-manifests/SKILL.md +2 -2
- package/dist/factory-assets/skills/authoring-skaile-manifests/references/dependency-standard.md +3 -3
- package/dist/factory-assets/skills/skaile-manage-workspace/SKILL.md +1 -1
- package/dist/flows-4JZQ3XFK.js +26 -0
- package/dist/{flows-W2FB7WIM.js.map → flows-4JZQ3XFK.js.map} +1 -1
- package/dist/{helpers-34QNVIGB.js → helpers-JNMK3FC2.js} +22 -22
- package/dist/{helpers-34QNVIGB.js.map → helpers-JNMK3FC2.js.map} +1 -1
- package/dist/library/index.js +15 -15
- package/dist/library/install.js +4 -4
- package/dist/library/src/index.d.ts +1 -1
- package/dist/library/src/index.d.ts.map +1 -1
- package/dist/library/src/local/library-dir.d.ts +22 -5
- package/dist/library/src/local/library-dir.d.ts.map +1 -1
- package/dist/library/src/local/local-catalog-source.d.ts.map +1 -1
- package/dist/library/src/remote/remote-catalog-source.d.ts +6 -0
- package/dist/library/src/remote/remote-catalog-source.d.ts.map +1 -1
- package/dist/{library-publish-RUQTKTJU.js → library-publish-I3UWXAHI.js} +69 -67
- package/dist/library-publish-I3UWXAHI.js.map +1 -0
- package/dist/model-endpoint/index.js +15 -15
- package/dist/model-endpoint/src/resolve.d.ts +1 -1
- package/dist/open-library-NKKUJLWA.js +42 -0
- package/dist/{open-library-PVTIUQUF.js.map → open-library-NKKUJLWA.js.map} +1 -1
- package/dist/open-registry-BYAXSHUI.js +32 -0
- package/dist/{open-registry-SOIS3TA2.js.map → open-registry-BYAXSHUI.js.map} +1 -1
- package/dist/paths-UKWE35XS.js +22 -0
- package/dist/{paths-JLNX7Y4X.js.map → paths-UKWE35XS.js.map} +1 -1
- package/dist/plugin-registry/index.js +1 -1
- package/dist/plugin-registry/src/context.d.ts +3 -3
- package/dist/plugin-registry/src/context.d.ts.map +1 -1
- package/dist/plugin-registry/src/deploy-handle.d.ts +1 -1
- package/dist/plugin-registry/src/index.d.ts +2 -2
- package/dist/plugin-registry/src/index.d.ts.map +1 -1
- package/dist/plugin-registry/src/internal.d.ts.map +1 -1
- package/dist/plugin-registry/src/registry.d.ts +3 -3
- package/dist/plugin-registry/src/registry.d.ts.map +1 -1
- package/dist/plugin-registry/src/targets.d.ts +9 -9
- package/dist/plugin-registry/src/targets.d.ts.map +1 -1
- package/dist/plugin-store-ABE35NRX.js +23 -0
- package/dist/{plugin-store-G2GWAHSD.js.map → plugin-store-ABE35NRX.js.map} +1 -1
- package/dist/plugins/src/asset-kind-provider.d.ts +1 -1
- package/dist/project-BIPK47JK.js +86 -0
- package/dist/{project-EX47PUBN.js.map → project-BIPK47JK.js.map} +1 -1
- package/dist/resolver/index.js +12 -12
- package/dist/runner/index.js +50 -50
- package/dist/runner/src/agent.d.ts +3 -3
- package/dist/runner/src/agent.d.ts.map +1 -1
- package/dist/runner/src/agents/in-process-host.d.ts +1 -1
- package/dist/runner/src/agents/instances.d.ts +1 -1
- package/dist/runner/src/agents/instances.d.ts.map +1 -1
- package/dist/runner/src/agents/run-controller.d.ts +7 -7
- package/dist/runner/src/agents/run-controller.d.ts.map +1 -1
- package/dist/runner/src/agents/standalone-surface.d.ts +2 -2
- package/dist/runner/src/agents/standalone-surface.d.ts.map +1 -1
- package/dist/runner/src/ai-provider-switch.d.ts +7 -7
- package/dist/runner/src/assistant-home.d.ts +1 -1
- package/dist/runner/src/capability-registry.d.ts +2 -2
- package/dist/runner/src/coalesced-restart.d.ts +2 -2
- package/dist/runner/src/compaction/context-window.d.ts +8 -8
- package/dist/runner/src/compaction/context-window.d.ts.map +1 -1
- package/dist/runner/src/compaction/orchestrator.d.ts +24 -24
- package/dist/runner/src/compaction/orchestrator.d.ts.map +1 -1
- package/dist/runner/src/compaction-gate.d.ts +30 -30
- package/dist/runner/src/compaction-gate.d.ts.map +1 -1
- package/dist/runner/src/composition/content-source.d.ts.map +1 -1
- package/dist/runner/src/composition/dry-run.d.ts +2 -2
- package/dist/runner/src/composition/dry-run.d.ts.map +1 -1
- package/dist/runner/src/composition/errors.d.ts +16 -1
- package/dist/runner/src/composition/errors.d.ts.map +1 -1
- package/dist/runner/src/composition/resolve-instance.d.ts +2 -2
- package/dist/runner/src/composition/resolve.d.ts +1 -1
- package/dist/runner/src/config.d.ts +3 -3
- package/dist/runner/src/config.d.ts.map +1 -1
- package/dist/runner/src/context-usage/collector.d.ts +15 -15
- package/dist/runner/src/context-usage/collector.d.ts.map +1 -1
- package/dist/runner/src/context-usage/compose.d.ts +6 -6
- package/dist/runner/src/context-usage/compose.d.ts.map +1 -1
- package/dist/runner/src/context-usage/estimator.d.ts +1 -1
- package/dist/runner/src/context-usage/index.d.ts +1 -1
- package/dist/runner/src/context-usage/index.d.ts.map +1 -1
- package/dist/runner/src/context-usage/transcript-tracker.d.ts +2 -2
- package/dist/runner/src/context-usage/transcript-tracker.d.ts.map +1 -1
- package/dist/runner/src/credential-notice.d.ts +4 -4
- package/dist/runner/src/credential-notice.d.ts.map +1 -1
- package/dist/runner/src/credential-rotated.d.ts +1 -1
- package/dist/runner/src/final-text.d.ts +1 -1
- package/dist/runner/src/{driver-swap-gate.d.ts → harness-swap-gate.d.ts} +21 -21
- package/dist/runner/src/harness-swap-gate.d.ts.map +1 -0
- package/dist/runner/src/late-mcp-rebuild.d.ts +6 -6
- package/dist/runner/src/late-mcp-rebuild.d.ts.map +1 -1
- package/dist/runner/src/lifecycle-handler.d.ts +1 -1
- package/dist/runner/src/lifecycle-handler.d.ts.map +1 -1
- package/dist/runner/src/manifest.d.ts +1 -1
- package/dist/runner/src/mcp-runtime-handlers.d.ts +6 -6
- package/dist/runner/src/mcp-runtime-handlers.d.ts.map +1 -1
- package/dist/runner/src/model-endpoint-discovery.d.ts +1 -1
- package/dist/runner/src/pending-turns.d.ts +3 -3
- package/dist/runner/src/platform-blocks.d.ts +5 -5
- package/dist/runner/src/platform-blocks.d.ts.map +1 -1
- package/dist/runner/src/prompt-turn-queue.d.ts +1 -1
- package/dist/runner/src/provider-quota-forwarder.d.ts +1 -1
- package/dist/runner/src/provider-quota-forwarder.d.ts.map +1 -1
- package/dist/runner/src/reconfigure-handler.d.ts +14 -14
- package/dist/runner/src/reconfigure-handler.d.ts.map +1 -1
- package/dist/runner/src/resource-handler.d.ts +1 -1
- package/dist/runner/src/resources.d.ts +5 -5
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/runner-capabilities.d.ts +7 -7
- package/dist/runner/src/runtime-session-emit.d.ts +5 -5
- package/dist/runner/src/runtime-session-emit.d.ts.map +1 -1
- package/dist/runner/src/s3-presign-client.d.ts +1 -1
- package/dist/runner/src/serve-credentials.d.ts +7 -7
- package/dist/runner/src/serve-credentials.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts +46 -34
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts +41 -41
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/runner/src/session-capability-wiring.d.ts +9 -9
- package/dist/runner/src/session-capability-wiring.d.ts.map +1 -1
- package/dist/runner/src/session-stimulus.d.ts +1 -1
- package/dist/runner/src/session.d.ts +5 -5
- package/dist/runner/src/session.d.ts.map +1 -1
- package/dist/runner/src/skill-staging.d.ts +16 -16
- package/dist/runner/src/skill-staging.d.ts.map +1 -1
- package/dist/runner/src/turn-end-contract.d.ts +5 -5
- package/dist/runner/src/turn-end-contract.d.ts.map +1 -1
- package/dist/runner/src/turn-scheduler.d.ts +22 -22
- package/dist/runner/src/turn-scheduler.d.ts.map +1 -1
- package/dist/runner/src/turn-status-replay.d.ts +1 -1
- package/dist/runner/src/usage-limit-turn-hold.d.ts +1 -1
- package/dist/sdk/asset-manager.js +19 -19
- package/dist/sdk/bridge.js +25 -25
- package/dist/sdk/core.js +11 -11
- package/dist/sdk/flow.js +13 -13
- package/dist/sdk/index.js +54 -54
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/resolver.js +12 -12
- package/dist/sdk/runner.js +50 -50
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/src/agent-session.d.ts +1 -1
- package/dist/sdk/src/local-runtime.d.ts +1 -1
- package/dist/sdk/src/local-runtime.d.ts.map +1 -1
- package/dist/sdk/src/types.d.ts +1 -1
- package/dist/sdk/src/types.d.ts.map +1 -1
- package/dist/sdk/store.js +2 -2
- package/dist/sdk/transport/ws/server.js +12 -12
- package/dist/sdk/transport/ws.js +12 -12
- package/dist/sdk/transport.js +12 -12
- package/dist/sdk/types.js +1 -1
- package/dist/serve-preflight-FLTIBTEX.js +107 -0
- package/dist/serve-preflight-FLTIBTEX.js.map +1 -0
- package/dist/session/index.js +2 -2
- package/dist/session/src/dispatcher.d.ts +2 -2
- package/dist/sessions-2Q7SSYPT.js +5 -0
- package/dist/{sessions-DICDEONJ.js.map → sessions-2Q7SSYPT.js.map} +1 -1
- package/dist/{setup-AFZQNGKA.js → setup-AG6NFHSN.js} +52 -52
- package/dist/setup-AG6NFHSN.js.map +1 -0
- package/dist/skills-UQYUHVKO.js +26 -0
- package/dist/{skills-YYYC6D5X.js.map → skills-UQYUHVKO.js.map} +1 -1
- package/dist/source-ASEHI2XS.js +85 -0
- package/dist/{source-DGPCT5IC.js.map → source-ASEHI2XS.js.map} +1 -1
- package/dist/{source-manifest-publish-AGJ63JF2.js → source-manifest-publish-IEVV3W6J.js} +62 -62
- package/dist/{source-manifest-publish-AGJ63JF2.js.map → source-manifest-publish-IEVV3W6J.js.map} +1 -1
- package/dist/store/index.js +2 -2
- package/dist/store/src/store.d.ts +3 -3
- package/dist/store/src/store.d.ts.map +1 -1
- package/dist/transport/index.js +12 -12
- package/dist/transport/ws/server.js +12 -12
- package/dist/transport/ws.js +12 -12
- package/dist/tui/index.js +70 -70
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/src/repl-session.d.ts +5 -5
- package/dist/tui/src/repl.d.ts +5 -5
- package/dist/tui/src/repl.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/manifests.js +1 -1
- package/dist/types/src/agent-lifecycle.d.ts +1 -1
- package/dist/types/src/agent-lifecycle.d.ts.map +1 -1
- package/dist/types/src/ask-slots.d.ts +1 -1
- package/dist/types/src/capabilities.d.ts +1 -1
- package/dist/types/src/context-usage.d.ts +22 -22
- package/dist/types/src/context-usage.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +49 -49
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/install-manifest.d.ts +1 -1
- package/dist/types/src/install-manifest.d.ts.map +1 -1
- package/dist/types/src/lifecycle.d.ts +6 -6
- package/dist/types/src/lifecycle.d.ts.map +1 -1
- package/dist/types/src/logging.d.ts +1 -1
- package/dist/types/src/manifests/agent.d.ts +3 -3
- package/dist/types/src/protocol.d.ts +4 -4
- package/dist/types/src/runtime.d.ts +38 -38
- package/dist/types/src/runtime.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +22 -11
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/validator-DRHMJ457.js +5 -0
- package/dist/{validator-FA2PFW6N.js.map → validator-DRHMJ457.js.map} +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +41 -41
- package/dist/workspace-plugin/adapters/omp.js +26 -26
- package/dist/workspace-plugin/adapters/omp.js.map +1 -1
- package/dist/workspace-plugin/index.js +3 -3
- package/dist/workspace-plugin/src/plugin.d.ts +5 -5
- package/dist/workspace-plugin/src/plugin.d.ts.map +1 -1
- package/dist/workspace-plugin/src/tools/flows.d.ts +1 -1
- package/dist/workspace-plugin/src/tools/validator.d.ts +6 -6
- package/dist/workspace-plugin/src/tools/validator.d.ts.map +1 -1
- package/dist/workspace-plugin/src/types.d.ts +2 -2
- package/dist/workspace-plugin/src/types.d.ts.map +1 -1
- package/package.json +59 -59
- package/dist/asset-feeds-QGLI3AXI.js.map +0 -1
- package/dist/bridge/drivers/claude-sdk.js.map +0 -1
- package/dist/bridge/drivers/codex.js.map +0 -1
- package/dist/bridge/drivers/continue.js.map +0 -1
- package/dist/bridge/drivers/echo.js.map +0 -1
- package/dist/bridge/drivers/gemini.js +0 -18
- package/dist/bridge/drivers/goose.js.map +0 -1
- package/dist/bridge/drivers/omp.js.map +0 -1
- package/dist/bridge/drivers/opencode.js.map +0 -1
- package/dist/bridge/drivers/qwen.js.map +0 -1
- package/dist/bridge/src/codex/managed-driver.d.ts.map +0 -1
- package/dist/bridge/src/driver-capabilities.d.ts.map +0 -1
- package/dist/bridge/src/driver-model-check.d.ts +0 -25
- package/dist/bridge/src/driver-model-check.d.ts.map +0 -1
- package/dist/bridge/src/drivers/_subprocess-cli.d.ts.map +0 -1
- package/dist/bridge/src/drivers/claude-context-usage.d.ts.map +0 -1
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +0 -1
- package/dist/bridge/src/drivers/claude-self-turns.d.ts.map +0 -1
- package/dist/bridge/src/drivers/claude-tool-allowlist.d.ts.map +0 -1
- package/dist/bridge/src/drivers/codex.d.ts.map +0 -1
- package/dist/bridge/src/drivers/continue.d.ts.map +0 -1
- package/dist/bridge/src/drivers/echo.d.ts.map +0 -1
- package/dist/bridge/src/drivers/flow-script.d.ts.map +0 -1
- package/dist/bridge/src/drivers/gemini.d.ts.map +0 -1
- package/dist/bridge/src/drivers/goose.d.ts.map +0 -1
- package/dist/bridge/src/drivers/omp-models-yml.d.ts.map +0 -1
- package/dist/bridge/src/drivers/omp.d.ts.map +0 -1
- package/dist/bridge/src/drivers/opencode.d.ts.map +0 -1
- package/dist/bridge/src/drivers/qwen.d.ts.map +0 -1
- package/dist/bridge/src/drivers/recovery-policy.d.ts.map +0 -1
- package/dist/bridge/src/drivers/resume-probe.d.ts.map +0 -1
- package/dist/bridge/src/drivers/sanitize-assistant-text.d.ts.map +0 -1
- package/dist/bridge/src/drivers/scrub-transcript.d.ts.map +0 -1
- package/dist/bridge/src/provider-materialize/env-drivers.d.ts.map +0 -1
- package/dist/chunk-2GXSSZAM.js.map +0 -1
- package/dist/chunk-4ZTPYIBE.js.map +0 -1
- package/dist/chunk-5BEFNLOR.js.map +0 -1
- package/dist/chunk-5TBFN46Z.js.map +0 -1
- package/dist/chunk-6E6PKKAD.js.map +0 -1
- package/dist/chunk-7NT4F6SR.js.map +0 -1
- package/dist/chunk-7SCS64BG.js.map +0 -1
- package/dist/chunk-AJ7EGIFR.js.map +0 -1
- package/dist/chunk-C7WBGSBV.js.map +0 -1
- package/dist/chunk-COJIL7G4.js.map +0 -1
- package/dist/chunk-CQJH4G2K.js.map +0 -1
- package/dist/chunk-EAZECHPM.js.map +0 -1
- package/dist/chunk-EPBKISS5.js.map +0 -1
- package/dist/chunk-FPHNJE4M.js.map +0 -1
- package/dist/chunk-GOCWM7FN.js.map +0 -1
- package/dist/chunk-HT35SQZD.js.map +0 -1
- package/dist/chunk-I37INEWE.js.map +0 -1
- package/dist/chunk-IG5LZ3WU.js.map +0 -1
- package/dist/chunk-IP2IPMEH.js.map +0 -1
- package/dist/chunk-IZCR27MU.js.map +0 -1
- package/dist/chunk-J24CY3PF.js.map +0 -1
- package/dist/chunk-JTOWA6RS.js.map +0 -1
- package/dist/chunk-L2AMXONH.js.map +0 -1
- package/dist/chunk-MJHSLODD.js.map +0 -1
- package/dist/chunk-MKRWN7XP.js.map +0 -1
- package/dist/chunk-MRHVPQNO.js.map +0 -1
- package/dist/chunk-N46LQR46.js.map +0 -1
- package/dist/chunk-PUK7TQT4.js +0 -13
- package/dist/chunk-PUK7TQT4.js.map +0 -1
- package/dist/chunk-QG6GHTRM.js.map +0 -1
- package/dist/chunk-RO6VOM6Z.js.map +0 -1
- package/dist/chunk-RPZVHXQ3.js.map +0 -1
- package/dist/chunk-V257LUBM.js.map +0 -1
- package/dist/chunk-VJ7NU7GD.js.map +0 -1
- package/dist/chunk-VSZWNUZC.js.map +0 -1
- package/dist/chunk-W4Q6CKJ5.js.map +0 -1
- package/dist/chunk-WOIRYY5L.js.map +0 -1
- package/dist/chunk-WST6UITC.js.map +0 -1
- package/dist/chunk-X3RMRJNR.js.map +0 -1
- package/dist/chunk-XJVBUDDJ.js.map +0 -1
- package/dist/chunk-XM6T2AZ2.js.map +0 -1
- package/dist/chunk-XWOPZW26.js.map +0 -1
- package/dist/chunk-Y56YIT6J.js.map +0 -1
- package/dist/chunk-YROR332M.js.map +0 -1
- package/dist/chunk-ZQSOJH6I.js.map +0 -1
- package/dist/claude-code-2PU7TITZ.js +0 -10
- package/dist/cli/src/driver-error.d.ts +0 -28
- package/dist/cli/src/driver-error.d.ts.map +0 -1
- package/dist/connectors-RBGZ3M7G.js +0 -48
- package/dist/core/driver-targets.d.ts +0 -2
- package/dist/core/driver-targets.js +0 -4
- package/dist/core/driver-targets.js.map +0 -1
- package/dist/core/src/driver-sdk.d.ts.map +0 -1
- package/dist/core/src/driver-targets.d.ts +0 -71
- package/dist/core/src/driver-targets.d.ts.map +0 -1
- package/dist/flows-W2FB7WIM.js +0 -26
- package/dist/library-publish-RUQTKTJU.js.map +0 -1
- package/dist/open-library-PVTIUQUF.js +0 -42
- package/dist/open-registry-SOIS3TA2.js +0 -32
- package/dist/paths-JLNX7Y4X.js +0 -22
- package/dist/plugin-store-G2GWAHSD.js +0 -23
- package/dist/project-EX47PUBN.js +0 -84
- package/dist/runner/src/driver-swap-gate.d.ts.map +0 -1
- package/dist/serve-preflight-QXRKGOI5.js +0 -108
- package/dist/serve-preflight-QXRKGOI5.js.map +0 -1
- package/dist/sessions-DICDEONJ.js +0 -5
- package/dist/setup-AFZQNGKA.js.map +0 -1
- package/dist/skills-YYYC6D5X.js +0 -26
- package/dist/source-DGPCT5IC.js +0 -85
- package/dist/validator-FA2PFW6N.js +0 -5
- /package/dist/bridge/{drivers → harnesses}/gemini.js.map +0 -0
package/dist/cli/index.js
CHANGED
|
@@ -1,101 +1,102 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { makeValidateCommand, scanIdentities
|
|
3
|
-
import { storeNotInstallableReason } from '../chunk-
|
|
4
|
-
import { makeProvidersCommand, loadRegistryView, addProviderEntry, ProviderRegistryWriteError, removeProviderEntry } from '../chunk-
|
|
5
|
-
import { makeInstallCommand, makeCheckCommand, makeCleanCommand, pinComposedAgents, reportRewritten, reportReplaced, reportRelocked, reportMoved, reportStoreNotChecked, globalProblems, editedConventionFiles, supportsInstallManifest, REF_HINT, reportInstalledSoftDeps } from '../chunk-
|
|
2
|
+
import { makeValidateCommand, scanIdentities } from '../chunk-IHFGPHCT.js';
|
|
3
|
+
import { storeNotInstallableReason, mcpNotRunnableHere } from '../chunk-EX3GLAL6.js';
|
|
4
|
+
import { makeProvidersCommand, loadRegistryView, addProviderEntry, ProviderRegistryWriteError, removeProviderEntry } from '../chunk-NB7SYQYP.js';
|
|
5
|
+
import { makeInstallCommand, makeCheckCommand, makeCleanCommand, pinComposedAgents, reportRewritten, reportReplaced, reportRelocked, reportMoved, reportStoreNotChecked, globalProblems, editedConventionFiles, supportsInstallManifest, runYamlInstall, REF_HINT, reportInstalledSoftDeps } from '../chunk-CEKW3KXP.js';
|
|
6
|
+
import { unknownHarnessMessage, reportProjectConfig, driverAliasOption, foldDriverFlag, friendlyHarnessError, harnessErrorNotes, isRecord } from '../chunk-7HX6FNKL.js';
|
|
6
7
|
import { createSpinner } from '../chunk-NESV47MF.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { status, enable, disable, install, uninstall } from '../chunk-
|
|
14
|
-
import { logErr, S, logOk, logInfo, logWarn, TARGET_DEFAULT_HINT, parseHarnessFilter, requireProjectConfig, deferredWarnings, warnPlaceholderBodies, warnFilesOnlyDelegates, reportLegacyOmpCopies, logNoProject, warnLegacyClaudeCopies, kindColorPad, kindColor, colorRef, formatSoftDepSection, bareSoftDepName, formatSoftDepHint, formatRelativeTime, formatSoftDepRemovePreview, formatSoftDepAddPreview, fitWidth, KIND_COL_WIDTH } from '../chunk-
|
|
15
|
-
import { getKindRegistry, getKnownKinds } from '../chunk-
|
|
8
|
+
import { loadDeclaredPlugins } from '../chunk-QSYQOTWN.js';
|
|
9
|
+
import { getStoreConfig, storeFetch, isStoreAuthenticated, getStoreToken } from '../chunk-3GMOPFWH.js';
|
|
10
|
+
import { makeSourceCommand, syncProjectSources, divergedSourceClones } from '../chunk-AZ2H6R5I.js';
|
|
11
|
+
import { libraryAssetRefusals, deviceLogin, loadStoreAuthConfig, logout, hasStoredAuth, exitOnLibrarySymlinks, resolveLibraryPublisherDetailed, getStoreIdentity, warnLibraryNameFallback, indexLibrary, warnIgnoredDomainFiles, removedDomainOption, rejectRemovedDomainOption, requireValidPublisherOrExit, exitOnManifestPublisherProblems, findAssetManifestFile, checkAssetFile, registerLibraryAsset, DOMAIN_REMOVED_HINT, reportLibrarySymlinks, checkAsset, manifestPublisherProblems, exitOnManifestPathProblems, manifestRequiresProblems, composeRefContext, registeredAssetKeys, assetEntryRef, duplicateAssetMessage, manifestParseFailureLine, manifestParseErrorText, unresolvedManifestDependencies, findEntryManifestFile, unheldRequiresOfFile, warnLegacyBundleFiles, checkComposeKinds } from '../chunk-AITJ7ELM.js';
|
|
12
|
+
import { openCatalogSource, LocalCatalogDisabledError, openLibraryManager, openLibrary } from '../chunk-RDTLPOPD.js';
|
|
13
|
+
import { AI_RESOURCES } from '../chunk-AATHJRKL.js';
|
|
14
|
+
import { status, enable, disable, install, uninstall } from '../chunk-ASWTQQ7E.js';
|
|
15
|
+
import { logErr, S, logOk, logInfo, logWarn, TARGET_DEFAULT_HINT, parseHarnessFilter, requireProjectConfig, deferredWarnings, warnPlaceholderBodies, warnFilesOnlyDelegates, reportLegacyOmpCopies, logNoProject, warnLegacyClaudeCopies, kindColorPad, kindColor, colorRef, formatSoftDepSection, bareSoftDepName, formatSoftDepHint, formatRelativeTime, formatSoftDepRemovePreview, formatSoftDepAddPreview, fitWidth, KIND_COL_WIDTH } from '../chunk-QEULL4Q3.js';
|
|
16
|
+
import { getKindRegistry, getKnownKinds } from '../chunk-COYF6IG2.js';
|
|
16
17
|
import { LocalSecretsProvider } from '../chunk-ILFGVSTJ.js';
|
|
17
|
-
import { resolveInstanceAgentDir, instanceSessionOverrides, runAgentChat, isCompositionError, resolveSessionId, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, hashAgentFiles, createCompositionContentSource, compileComposition,
|
|
18
|
-
import '../chunk-
|
|
19
|
-
import '../chunk-
|
|
20
|
-
import '../chunk-
|
|
21
|
-
import '../chunk-
|
|
22
|
-
import '../chunk-
|
|
23
|
-
import '../chunk-
|
|
24
|
-
import '../chunk-
|
|
25
|
-
import '../chunk-
|
|
26
|
-
import '../chunk-
|
|
27
|
-
import '../chunk-
|
|
18
|
+
import { resolveInstanceAgentDir, instanceSessionOverrides, runAgentChat, isCompositionError, resolveSessionId, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, hashAgentFiles, createCompositionContentSource, compileComposition, manifestModelForHarness, instanceForSession, resolveAgentInstance, describeComposition, MarkdownStreamer, createFinalTextFallback } from '../chunk-2LAPHLDH.js';
|
|
19
|
+
import '../chunk-QAKUD6QN.js';
|
|
20
|
+
import '../chunk-6YR4ALVX.js';
|
|
21
|
+
import '../chunk-ZAELRYKS.js';
|
|
22
|
+
import '../chunk-X3YGUKCG.js';
|
|
23
|
+
import '../chunk-WYZXSJBK.js';
|
|
24
|
+
import '../chunk-HMISULVD.js';
|
|
25
|
+
import '../chunk-Z3VKUWAX.js';
|
|
26
|
+
import '../chunk-KW37WNXY.js';
|
|
27
|
+
import '../chunk-3MWQKQUB.js';
|
|
28
|
+
import '../chunk-KUQAJVYT.js';
|
|
28
29
|
import '../chunk-O7SG5PC2.js';
|
|
29
30
|
import '../chunk-7QBNJTTQ.js';
|
|
30
31
|
import '../chunk-O2SYFJWP.js';
|
|
31
|
-
import '../chunk-
|
|
32
|
+
import '../chunk-EJPMNDTP.js';
|
|
32
33
|
import '../chunk-32NA4TVC.js';
|
|
33
34
|
import '../chunk-W3UDISS2.js';
|
|
34
|
-
import '../chunk-
|
|
35
|
-
import { runFlow, resumeFlow } from '../chunk-
|
|
35
|
+
import '../chunk-ZFUZ5AKM.js';
|
|
36
|
+
import { runFlow, resumeFlow } from '../chunk-J72MO2WA.js';
|
|
36
37
|
import '../chunk-4R6DROGN.js';
|
|
37
|
-
import { parseSkillRequirements, validateRequirements } from '../chunk-
|
|
38
|
-
import '../chunk-
|
|
39
|
-
import '../chunk-
|
|
40
|
-
import '../chunk-
|
|
41
|
-
import '../chunk-
|
|
42
|
-
import {
|
|
43
|
-
import '../chunk-
|
|
44
|
-
import '../chunk-
|
|
45
|
-
import '../chunk-
|
|
38
|
+
import { parseSkillRequirements, validateRequirements } from '../chunk-IRYKRKVQ.js';
|
|
39
|
+
import '../chunk-VYVTEMAW.js';
|
|
40
|
+
import '../chunk-DGTI65OC.js';
|
|
41
|
+
import '../chunk-6GWSDPBP.js';
|
|
42
|
+
import '../chunk-BBBCJSSU.js';
|
|
43
|
+
import { checkHarnessModel, checkModelProvider } from '../chunk-5Y2KGB4H.js';
|
|
44
|
+
import '../chunk-7LP7RCZI.js';
|
|
45
|
+
import '../chunk-SVTMNSPI.js';
|
|
46
|
+
import '../chunk-XGULGQA3.js';
|
|
46
47
|
import '../chunk-LOO5CB5M.js';
|
|
47
|
-
import '../chunk-
|
|
48
|
-
import '../chunk-
|
|
49
|
-
import '../chunk-
|
|
50
|
-
import '../chunk-
|
|
51
|
-
import '../chunk-
|
|
52
|
-
import '../chunk-
|
|
53
|
-
import {
|
|
54
|
-
import '../chunk-
|
|
48
|
+
import '../chunk-BIRW3HOG.js';
|
|
49
|
+
import '../chunk-5J4NPGFM.js';
|
|
50
|
+
import '../chunk-GNZBFSRB.js';
|
|
51
|
+
import '../chunk-XFIEVEU7.js';
|
|
52
|
+
import '../chunk-7DN6JKP2.js';
|
|
53
|
+
import '../chunk-FKQNBCDW.js';
|
|
54
|
+
import { listHarnesses, getProviderPreset, AI_PROVIDER_PRESETS } from '../chunk-ILLTBKDJ.js';
|
|
55
|
+
import '../chunk-G5SUWZEU.js';
|
|
55
56
|
import '../chunk-IFGTRL2I.js';
|
|
56
|
-
import { loadFlow, flowLookupRoots, findFlowFileInRoots, loadAllFlowEntries } from '../chunk-
|
|
57
|
-
import '../chunk-
|
|
57
|
+
import { loadFlow, flowLookupRoots, findFlowFileInRoots, loadAllFlowEntries } from '../chunk-4MUDQCBP.js';
|
|
58
|
+
import '../chunk-WD3L5QSU.js';
|
|
58
59
|
import { nodeLabel, nodeSkillAsset, nodeIsInert, nodeIsOptional, nodeRunKind } from '../chunk-7RGTAEG6.js';
|
|
59
|
-
import '../chunk-
|
|
60
|
-
import { LibraryEntryError, AssetManager, parseRefTolerant, MissingManifestError, parseCanonicalLockKey, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-
|
|
61
|
-
import { CatalogHttpError, libraryDirMissing, missingLibraryDirMessage, cloneOrInitGitRepo, trackOriginBranch, stampManifestPublisher, isGitRepo, ensureGitRepo, conflictingAssetRoot, scanUnlistedAssets, setManifestPublisher, LIBRARY_OWNERSHIPS, assertManifestEditable, installLibraryAsset, getStoreManifestsDir, assertValidLibraryName, unparsableAssetFiles, syncManifestWithDisk, renamedLibraryName, storeManifestFile, getDefaultValue, isSecretPlaceholder } from '../chunk-
|
|
62
|
-
import { flowFileNameError, SEMVER_RE } from '../chunk-
|
|
63
|
-
import '../chunk-
|
|
60
|
+
import '../chunk-JCPD4QRM.js';
|
|
61
|
+
import { setLibraryAssetCheck, LibraryEntryError, AssetManager, parseRefTolerant, MissingManifestError, parseCanonicalLockKey, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-HWNK3F3X.js';
|
|
62
|
+
import { CatalogHttpError, libraryDirMissing, missingLibraryDirMessage, cloneOrInitGitRepo, trackOriginBranch, stampManifestPublisher, isGitRepo, ensureGitRepo, conflictingAssetRoot, scanUnlistedAssets, setManifestPublisher, LIBRARY_OWNERSHIPS, assertManifestEditable, installLibraryAsset, getStoreManifestsDir, assertValidLibraryName, unparsableAssetFiles, syncManifestWithDisk, renamedLibraryName, storeManifestFile, getDefaultValue, isSecretPlaceholder } from '../chunk-S2XHGWQC.js';
|
|
63
|
+
import { flowFileNameError, SEMVER_RE } from '../chunk-UI745XC3.js';
|
|
64
|
+
import '../chunk-YLLVSR2U.js';
|
|
64
65
|
import '../chunk-BFMYYNDT.js';
|
|
65
66
|
import '../chunk-3TXEJN4W.js';
|
|
66
67
|
import '../chunk-ISHJITXJ.js';
|
|
67
68
|
import '../chunk-LNFKL23K.js';
|
|
68
|
-
import '../chunk-
|
|
69
|
+
import '../chunk-JRN5QF4C.js';
|
|
69
70
|
import '../chunk-NUELZWCF.js';
|
|
70
|
-
import { installTargetOf, SCAFFOLD_KINDS } from '../chunk-
|
|
71
|
+
import { installTargetOf, SCAFFOLD_KINDS } from '../chunk-NUA33BYO.js';
|
|
71
72
|
import '../chunk-NOA6EJXE.js';
|
|
72
73
|
import '../chunk-KTBKW2FI.js';
|
|
73
74
|
import '../chunk-UQ6LFBPZ.js';
|
|
74
|
-
import '../chunk-
|
|
75
|
-
import { effectiveComposes, validatePreset, validateAgent, composeSlotDiagnostics, agentDeprecationDiagnostics, SLOT_ID_PATTERN } from '../chunk-
|
|
76
|
-
import { loadSettings, globalSettingsPath, resolveSettings, projectSettingsPath, saveSettings, WorkspaceYamlEditor, resolveLibraryDir, checkAgentSkillConformance, resolveSettingsWithSources, readLock, globalInstallDir, GLOBAL_INSTALL_DIR_NAME, workspaceProviderRegistryPath, userProviderRegistryPath, loadProviderRegistryFile, aiResourceRoots } from '../chunk-
|
|
75
|
+
import '../chunk-ABFPSVIS.js';
|
|
76
|
+
import { effectiveComposes, validatePreset, validateAgent, composeSlotDiagnostics, agentDeprecationDiagnostics, SLOT_ID_PATTERN } from '../chunk-E572OHGY.js';
|
|
77
|
+
import { loadSettings, globalSettingsPath, resolveSettings, projectSettingsPath, saveSettings, WorkspaceYamlEditor, resolveLibraryDir, checkAgentSkillConformance, resolveSettingsWithSources, resolveConfiguredHarnessName, readLock, globalInstallDir, GLOBAL_INSTALL_DIR_NAME, workspaceProviderRegistryPath, userProviderRegistryPath, loadProviderRegistryFile, aiResourceRoots } from '../chunk-VMVDAZLA.js';
|
|
77
78
|
import '../chunk-4GY63JU6.js';
|
|
78
|
-
import { factoryAssetRoots } from '../chunk-
|
|
79
|
-
import { deployedDir } from '../chunk-
|
|
80
|
-
import {
|
|
79
|
+
import { factoryAssetRoots } from '../chunk-ZDLUQLI6.js';
|
|
80
|
+
import { deployedDir } from '../chunk-5KRMNUL4.js';
|
|
81
|
+
import { DEFAULT_HARNESS_ID, HARNESS_DEFAULTS } from '../chunk-Z7ZEZZB6.js';
|
|
81
82
|
import { findKindDirs } from '../chunk-MWXYN6NY.js';
|
|
82
|
-
import { SourceEntryError, LegacyKeyError, resolveSkWorkspaceConfig, sourceCacheKey, getGlobalCacheDir, resolveAgentDir, AgentRefResolutionError, resolveAgentDefinitionDir, effectiveAgentInstances, matchPin, coerceVersion, loadSkWorkspaceConfig, isWorkspaceConfigFilename } from '../chunk-
|
|
83
|
+
import { SourceEntryError, LegacyKeyError, resolveSkWorkspaceConfig, sourceCacheKey, getGlobalCacheDir, resolveAgentDir, AgentRefResolutionError, resolveAgentDefinitionDir, effectiveAgentInstances, matchPin, coerceVersion, loadSkWorkspaceConfig, findWorkspaceRoot, isWorkspaceConfigFilename, SKAILE_YAML_DEFAULT, AGENT_PROFILE_FIELDS } from '../chunk-ZHGKAZJ7.js';
|
|
83
84
|
import { globalCacheRoot, globalSkaileDir, userConfigPath } from '../chunk-L5VSIPQD.js';
|
|
84
|
-
import {
|
|
85
|
-
import { SKAILE_MANIFEST_FILENAME, loadSkPublishManifest, decodeSkaileManifest, LIBRARY_GITIGNORE, librarySymlinkMessage, isNonAssetPath, isNonAssetDir, encodeSkaileManifest } from '../chunk-
|
|
85
|
+
import { HARNESS_TARGETS, SUPPORTED_HARNESSES, harnessNameForHarnessId } from '../chunk-VTETQCR6.js';
|
|
86
|
+
import { SKAILE_MANIFEST_FILENAME, loadSkPublishManifest, decodeSkaileManifest, LIBRARY_GITIGNORE, librarySymlinkMessage, isNonAssetPath, isNonAssetDir, encodeSkaileManifest } from '../chunk-ZBHZLWV3.js';
|
|
86
87
|
import { pluginTitle } from '../chunk-RVRB27AN.js';
|
|
87
|
-
import { dedupeRequirements, parseFrontmatter, scanDirectory, parseRequires } from '../chunk-
|
|
88
|
-
import { parseAssetRef, isValidPublisher, PUBLISHER_HINT, isValidAssetName, ASSET_NAME_HINT, depToStr, assetRefToStr, slugifyAssetName, parseAssetRefLoose } from '../chunk-
|
|
89
|
-
import { portableSpawn, portableSpawnSync } from '../chunk-
|
|
88
|
+
import { dedupeRequirements, parseFrontmatter, scanDirectory, parseRequires } from '../chunk-RHN5MRQO.js';
|
|
89
|
+
import { parseAssetRef, isValidPublisher, PUBLISHER_HINT, isValidAssetName, ASSET_NAME_HINT, depToStr, assetRefToStr, slugifyAssetName, parseAssetRefLoose } from '../chunk-LSSYC5IC.js';
|
|
90
|
+
import { portableSpawn, portableSpawnSync } from '../chunk-ADPM6AYF.js';
|
|
90
91
|
import { openSqlite } from '../chunk-DKXNKFKP.js';
|
|
91
|
-
import { parseModelRef, resolveEntryBaseUrl } from '../chunk-
|
|
92
|
+
import { parseModelRef, resolveEntryBaseUrl } from '../chunk-LSI2IVFT.js';
|
|
92
93
|
import '../chunk-C3CAXQMA.js';
|
|
93
94
|
import { registerLogStore, LogStore, StdoutSink } from '../chunk-BOFL7GIF.js';
|
|
94
95
|
import '../chunk-NSBPE2FW.js';
|
|
95
96
|
import * as fs8 from 'fs';
|
|
96
97
|
import fs8__default, { readFileSync, existsSync, mkdirSync, writeFileSync, lstatSync, rmSync, readdirSync, statSync } from 'fs';
|
|
97
|
-
import * as
|
|
98
|
-
import
|
|
98
|
+
import * as path19 from 'path';
|
|
99
|
+
import path19__default, { resolve, join } from 'path';
|
|
99
100
|
import { fileURLToPath } from 'url';
|
|
100
101
|
import { Help, Command, Option } from 'commander';
|
|
101
102
|
import { rcompare } from 'semver';
|
|
@@ -224,7 +225,7 @@ async function runSearch(kind, query, opts) {
|
|
|
224
225
|
const showLocal = !opts.store;
|
|
225
226
|
const showStore = !opts.local;
|
|
226
227
|
const { resolveConfig } = await import('../library/index.js');
|
|
227
|
-
const airGapped = resolveConfig({ projectDir:
|
|
228
|
+
const airGapped = resolveConfig({ projectDir: path19__default.resolve(opts.projectDir) }).catalog.cache_ttl === 0;
|
|
228
229
|
if (showLocal) {
|
|
229
230
|
await searchLocal(query, kind, opts, showStore, airGapped);
|
|
230
231
|
}
|
|
@@ -232,13 +233,19 @@ async function runSearch(kind, query, opts) {
|
|
|
232
233
|
await searchStore(query, kind, opts, airGapped);
|
|
233
234
|
}
|
|
234
235
|
}
|
|
235
|
-
async function searchIndex(query, kind) {
|
|
236
|
-
const { openLibrary: openLibrary2 } = await import('../open-library-
|
|
236
|
+
async function searchIndex(query, kind, projectDir) {
|
|
237
|
+
const { openLibrary: openLibrary2 } = await import('../open-library-NKKUJLWA.js');
|
|
237
238
|
const library = await openLibrary2();
|
|
238
239
|
try {
|
|
239
240
|
const { libraryDirMissing: libraryDirMissing2 } = await import('../library/index.js');
|
|
240
241
|
const sources = await library.listSources();
|
|
241
242
|
const gone = new Set(sources.filter(libraryDirMissing2).map((l) => l.id));
|
|
243
|
+
for (const id of new AssetManager({
|
|
244
|
+
registry: getKindRegistry(),
|
|
245
|
+
projectDir
|
|
246
|
+
}).undeclaredSourceClones(sources)) {
|
|
247
|
+
gone.add(id);
|
|
248
|
+
}
|
|
242
249
|
const defs = (await library.listAssetDefs(kind ? { kind } : {})).filter((d) => !d.libraryId || !gone.has(d.libraryId));
|
|
243
250
|
const libraryNames = new Map(sources.map((l) => [l.id, l.name]));
|
|
244
251
|
let entries = defs.map(
|
|
@@ -270,7 +277,7 @@ async function searchIndex(query, kind) {
|
|
|
270
277
|
}
|
|
271
278
|
}
|
|
272
279
|
async function searchFactory(projectDir, query, kind) {
|
|
273
|
-
const prefixes = factoryAssetRoots().map((r) => r.endsWith(
|
|
280
|
+
const prefixes = factoryAssetRoots().map((r) => r.endsWith(path19__default.sep) ? r : r + path19__default.sep);
|
|
274
281
|
const isFactoryPath = (p6) => prefixes.some((fp) => p6 === fp.slice(0, -1) || p6.startsWith(fp));
|
|
275
282
|
try {
|
|
276
283
|
const entries = await new AssetManager({ registry: getKindRegistry(), projectDir }).search(
|
|
@@ -383,18 +390,35 @@ async function expandCompetingOrigins(entries, projectDir) {
|
|
|
383
390
|
}
|
|
384
391
|
return out;
|
|
385
392
|
}
|
|
393
|
+
async function withAddVersions(entries, projectDir) {
|
|
394
|
+
if (!entries.some((e) => e.library && e.publisher)) return entries;
|
|
395
|
+
let versions;
|
|
396
|
+
try {
|
|
397
|
+
versions = await new AssetManager({
|
|
398
|
+
registry: getKindRegistry(),
|
|
399
|
+
projectDir
|
|
400
|
+
}).sourceAssetVersions();
|
|
401
|
+
} catch {
|
|
402
|
+
return entries;
|
|
403
|
+
}
|
|
404
|
+
if (versions.size === 0) return entries;
|
|
405
|
+
return entries.map((e) => {
|
|
406
|
+
const v = e.library ? versions.get(`${e.library}\0${entryDedupKey(e)}`) : void 0;
|
|
407
|
+
return v && v !== e.version ? { ...e, version: v } : e;
|
|
408
|
+
});
|
|
409
|
+
}
|
|
386
410
|
async function searchLocal(query, kind, opts, showStore, airGapped) {
|
|
387
|
-
const projectDir =
|
|
388
|
-
const { restoreSourceReaders } = await import('../source-
|
|
411
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
412
|
+
const { restoreSourceReaders } = await import('../source-ASEHI2XS.js');
|
|
389
413
|
for (const name of await restoreSourceReaders(projectDir)) {
|
|
390
414
|
logInfo(`Re-registered source "${name}" (its library entry was removed elsewhere).`);
|
|
391
415
|
}
|
|
392
416
|
const factory = await searchFactory(projectDir, query, kind);
|
|
393
|
-
let entries = unionEntries(await searchIndex(query, kind), factory);
|
|
417
|
+
let entries = unionEntries(await searchIndex(query, kind, projectDir), factory);
|
|
394
418
|
if (entries.length === 0 && !query && !kind && !airGapped) {
|
|
395
|
-
const { autoSyncForSearch } = await import('../source-
|
|
419
|
+
const { autoSyncForSearch } = await import('../source-ASEHI2XS.js');
|
|
396
420
|
if (await autoSyncForSearch(projectDir)) {
|
|
397
|
-
entries = unionEntries(await searchIndex(query, kind), factory);
|
|
421
|
+
entries = unionEntries(await searchIndex(query, kind, projectDir), factory);
|
|
398
422
|
}
|
|
399
423
|
}
|
|
400
424
|
if (entries.length === 0) {
|
|
@@ -410,7 +434,10 @@ async function searchLocal(query, kind, opts, showStore, airGapped) {
|
|
|
410
434
|
${S.heading("Local:")}`);
|
|
411
435
|
}
|
|
412
436
|
printLocalEntries(
|
|
413
|
-
await
|
|
437
|
+
await withAddVersions(
|
|
438
|
+
await expandCompetingOrigins(await expandLibraryCopies(entries, projectDir), projectDir),
|
|
439
|
+
projectDir
|
|
440
|
+
)
|
|
414
441
|
);
|
|
415
442
|
}
|
|
416
443
|
var MIN_LOCAL_DESCRIPTION_WIDTH = 10;
|
|
@@ -506,9 +533,9 @@ async function searchStore(query, kind, opts, airGapped) {
|
|
|
506
533
|
logInfo("air-gapped (cache_ttl: 0) \u2014 local sources only");
|
|
507
534
|
return;
|
|
508
535
|
}
|
|
509
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError: LocalCatalogDisabledError2 } = await import('../open-library-
|
|
536
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError: LocalCatalogDisabledError2 } = await import('../open-library-NKKUJLWA.js');
|
|
510
537
|
try {
|
|
511
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
538
|
+
const remote = await openCatalogSource2({ projectDir: path19__default.resolve(opts.projectDir) });
|
|
512
539
|
const assets = await remote.listAssets(kind ? { kind } : {});
|
|
513
540
|
const sel = selectStoreRows(filterCatalogAssets(assets, query), query, Boolean(opts.all));
|
|
514
541
|
if (sel.shown.length > 0) {
|
|
@@ -523,7 +550,7 @@ async function searchStore(query, kind, opts, airGapped) {
|
|
|
523
550
|
const local = e instanceof LocalCatalogDisabledError2;
|
|
524
551
|
if (opts.store) {
|
|
525
552
|
logErr(
|
|
526
|
-
local ? "remote catalog disabled (catalog.url: local) \u2014 set catalog.url: https://skaile.store to search the store" : `Store search failed: ${await describeStoreFailure(e,
|
|
553
|
+
local ? "remote catalog disabled (catalog.url: local) \u2014 set catalog.url: https://skaile.store to search the store" : `Store search failed: ${await describeStoreFailure(e, path19__default.resolve(opts.projectDir))}`
|
|
527
554
|
);
|
|
528
555
|
process.exit(1);
|
|
529
556
|
} else {
|
|
@@ -615,7 +642,7 @@ function makeAddCommand() {
|
|
|
615
642
|
return new Command("add").description("Add to skaile.yaml + deploy").argument("<ref>", "Asset reference (kind:@<publisher>/name#<version>)").option("--project-dir <path>", "Project directory", process.cwd()).option("--global", "Record in ~/.skaile/skaile.yaml + deploy to every global harness").option(
|
|
616
643
|
"--harness <ids>",
|
|
617
644
|
"Comma-separated global harnesses to deploy into (default: all resolved); implies --global"
|
|
618
|
-
).option("--target <agent>", `
|
|
645
|
+
).option("--target <agent>", `Harness target (${TARGET_DEFAULT_HINT})`).option(
|
|
619
646
|
"--link",
|
|
620
647
|
"symlink local-path assets instead of copying (dev loop; machine-local, not for committing)"
|
|
621
648
|
).option(
|
|
@@ -624,7 +651,10 @@ function makeAddCommand() {
|
|
|
624
651
|
).option("--no-soft-deps", "skip the soft-dep prompt entirely (don't add, don't report)").option(
|
|
625
652
|
"--force",
|
|
626
653
|
"overwrite a deployed folder that no lock entry owns (a hand-made skill of the same name)"
|
|
627
|
-
).option("--verbose", "print the full `exists in N libraries` warning for every asset").
|
|
654
|
+
).option("--verbose", "print the full `exists in N libraries` warning for every asset").option(
|
|
655
|
+
"--dry-run",
|
|
656
|
+
"show the library, version, dependencies and folders the add would use; change nothing"
|
|
657
|
+
).action(async (ref, opts) => {
|
|
628
658
|
if (opts.withSoftDeps && opts.softDeps === false) {
|
|
629
659
|
logErr("--with-soft-deps and --no-soft-deps are mutually exclusive.");
|
|
630
660
|
process.exit(1);
|
|
@@ -635,10 +665,10 @@ function makeAddCommand() {
|
|
|
635
665
|
const collisionKeys = [];
|
|
636
666
|
const am2 = new AssetManager({
|
|
637
667
|
registry: getKindRegistry(),
|
|
638
|
-
projectDir:
|
|
668
|
+
projectDir: path19__default.resolve(opts.projectDir),
|
|
639
669
|
global: opts.global || harnesses !== void 0,
|
|
640
670
|
harnesses,
|
|
641
|
-
|
|
671
|
+
harness: opts.target,
|
|
642
672
|
verboseCollisions: opts.verbose === true,
|
|
643
673
|
onLibraryCollision: (msg, keys) => {
|
|
644
674
|
collisionKeys.push(...keys ?? [msg.split(" exists in ")[0]]);
|
|
@@ -653,6 +683,7 @@ function makeAddCommand() {
|
|
|
653
683
|
const placeholderDescriptions = [];
|
|
654
684
|
let presets = [];
|
|
655
685
|
const skippedSecrets = /* @__PURE__ */ new Set();
|
|
686
|
+
let plan = [];
|
|
656
687
|
const added = await am2.add(ref, {
|
|
657
688
|
link: opts.link,
|
|
658
689
|
force: opts.force,
|
|
@@ -671,9 +702,18 @@ function makeAddCommand() {
|
|
|
671
702
|
warnings.push(
|
|
672
703
|
`${secretPath} looks like a secret: it is not deployed or hashed with the asset. Keep secrets out of an asset root`
|
|
673
704
|
);
|
|
705
|
+
},
|
|
706
|
+
dryRun: opts.dryRun === true,
|
|
707
|
+
onPlan: (items) => {
|
|
708
|
+
plan = items;
|
|
674
709
|
}
|
|
675
710
|
});
|
|
676
|
-
spinner.stop("Done");
|
|
711
|
+
spinner.stop(opts.dryRun ? "Planned" : "Done");
|
|
712
|
+
if (opts.dryRun) {
|
|
713
|
+
warnings.flush();
|
|
714
|
+
printAddPlan(plan);
|
|
715
|
+
return;
|
|
716
|
+
}
|
|
677
717
|
warnings.flush();
|
|
678
718
|
if (!am2.global) await pinComposedAgents(am2.projectDir);
|
|
679
719
|
await promptSoftDepAdds(am2, ref, {
|
|
@@ -706,7 +746,7 @@ function makeAddCommand() {
|
|
|
706
746
|
);
|
|
707
747
|
} else if (!installTargetOf(getKindRegistry(), kind))
|
|
708
748
|
logInfo(
|
|
709
|
-
`Recorded in skaile.yaml (store bytes are fetched + verified into .skaile/cache/store). ${kind} assets are not deployed into the
|
|
749
|
+
`Recorded in skaile.yaml (store bytes are fetched + verified into .skaile/cache/store). ${kind} assets are not deployed into the harness target \u2014 they are composed when skaile runs the agent.`
|
|
710
750
|
);
|
|
711
751
|
else logInfo("Nothing to deploy (already up to date).");
|
|
712
752
|
} else {
|
|
@@ -715,7 +755,7 @@ function makeAddCommand() {
|
|
|
715
755
|
logOk(library ? `${a} (library ${library})` : a);
|
|
716
756
|
}
|
|
717
757
|
warnPlaceholderBodies(placeholderBodies, placeholderDescriptions);
|
|
718
|
-
if (!am2.global) warnFilesOnlyDelegates(am2.projectDir, am2.
|
|
758
|
+
if (!am2.global) warnFilesOnlyDelegates(am2.projectDir, am2.harness);
|
|
719
759
|
if (am2.global) {
|
|
720
760
|
for (const a of added) {
|
|
721
761
|
const { kind, name } = parseAssetRef(a);
|
|
@@ -754,6 +794,18 @@ function makeAddCommand() {
|
|
|
754
794
|
}
|
|
755
795
|
});
|
|
756
796
|
}
|
|
797
|
+
function printAddPlan(plan) {
|
|
798
|
+
const line = (item, label) => {
|
|
799
|
+
logInfo(
|
|
800
|
+
`${label} ${colorRef(item.ref)}${item.version ? `#${item.version}` : ""} (${item.origin})`
|
|
801
|
+
);
|
|
802
|
+
for (const folder of item.folders) console.log(` folder: ${S.dim(folder)}`);
|
|
803
|
+
if (item.files.length > 0) console.log(` files: ${S.dim(item.files.join(", "))}`);
|
|
804
|
+
};
|
|
805
|
+
for (const item of plan.filter((i) => i.requested)) line(item, "Would add");
|
|
806
|
+
for (const item of plan.filter((i) => !i.requested)) line(item, "Would also add");
|
|
807
|
+
logInfo("Dry run: nothing was changed.");
|
|
808
|
+
}
|
|
757
809
|
function readableError(err) {
|
|
758
810
|
if (err instanceof Error && err.code === "unknown_asset_kind") {
|
|
759
811
|
return `Error: ${err.message.replace(/^unknown_asset_kind: /, "")}`;
|
|
@@ -764,7 +816,7 @@ function makeRemoveCommand() {
|
|
|
764
816
|
return new Command("remove").description("Remove from skaile.yaml + undeploy").argument("<ref>", "Asset reference (kind:@publisher/name, or kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).option("--global", "Remove from ~/.skaile/skaile.yaml + undeploy from every global harness").option(
|
|
765
817
|
"--harness <ids>",
|
|
766
818
|
"Comma-separated global harnesses to undeploy from (default: all resolved); implies --global"
|
|
767
|
-
).option("--target <agent>", `
|
|
819
|
+
).option("--target <agent>", `Harness target (${TARGET_DEFAULT_HINT})`).option(
|
|
768
820
|
"--force",
|
|
769
821
|
"Remove even when another installed asset requires it, or when the folder is not one the lock holds"
|
|
770
822
|
).option("--no-soft-deps", "skip the orphaned-soft-dep prompt (don't remove, don't report)").action(async (ref, opts) => {
|
|
@@ -773,10 +825,10 @@ function makeRemoveCommand() {
|
|
|
773
825
|
requireProjectConfig(opts.projectDir, { allowMissing: true });
|
|
774
826
|
const am2 = new AssetManager({
|
|
775
827
|
registry: getKindRegistry(),
|
|
776
|
-
projectDir:
|
|
828
|
+
projectDir: path19__default.resolve(opts.projectDir),
|
|
777
829
|
global: opts.global || harnesses !== void 0,
|
|
778
830
|
harnesses,
|
|
779
|
-
|
|
831
|
+
harness: opts.target
|
|
780
832
|
});
|
|
781
833
|
let result;
|
|
782
834
|
try {
|
|
@@ -813,6 +865,9 @@ function makeRemoveCommand() {
|
|
|
813
865
|
for (const dep of result.pruned) {
|
|
814
866
|
logOk(`Removed ${dep} (no longer required by anything declared in skaile.yaml)`);
|
|
815
867
|
}
|
|
868
|
+
for (const setting of result.droppedSettings ?? []) {
|
|
869
|
+
logOk(`Removed ${setting} from skaile.yaml (it only set values for ${ref})`);
|
|
870
|
+
}
|
|
816
871
|
await promptSoftDepRemovals(am2, ref, {
|
|
817
872
|
isTTY: !!process.stdin.isTTY,
|
|
818
873
|
noSoftDeps: opts.softDeps === false,
|
|
@@ -834,8 +889,8 @@ function makeListCommand() {
|
|
|
834
889
|
"-g, --global",
|
|
835
890
|
"Read the global SSOT (~/.skaile/skaile.yaml); report state per harness"
|
|
836
891
|
).option("--harness <ids>", "Comma-separated global harnesses to report (implies --global)").option("--json", "Output as JSON").addOption(
|
|
837
|
-
new Option("--target <agent>", `
|
|
838
|
-
|
|
892
|
+
new Option("--target <agent>", `Harness target (${TARGET_DEFAULT_HINT})`).choices(
|
|
893
|
+
SUPPORTED_HARNESSES
|
|
839
894
|
)
|
|
840
895
|
).action(async (kind, opts) => {
|
|
841
896
|
const harnesses = parseHarnessFilter(opts.harness);
|
|
@@ -845,8 +900,8 @@ function makeListCommand() {
|
|
|
845
900
|
}
|
|
846
901
|
const am2 = new AssetManager({
|
|
847
902
|
registry: getKindRegistry(),
|
|
848
|
-
projectDir:
|
|
849
|
-
|
|
903
|
+
projectDir: path19__default.resolve(opts.projectDir),
|
|
904
|
+
harness: opts.target
|
|
850
905
|
});
|
|
851
906
|
let declared;
|
|
852
907
|
try {
|
|
@@ -895,7 +950,7 @@ function makeListCommand() {
|
|
|
895
950
|
function runGlobalList(kind, opts, harnesses) {
|
|
896
951
|
const am2 = new AssetManager({
|
|
897
952
|
registry: getKindRegistry(),
|
|
898
|
-
projectDir:
|
|
953
|
+
projectDir: path19__default.resolve(opts.projectDir),
|
|
899
954
|
global: true,
|
|
900
955
|
harnesses
|
|
901
956
|
});
|
|
@@ -974,7 +1029,7 @@ function infoVersionLine(locked, latest) {
|
|
|
974
1029
|
}
|
|
975
1030
|
function lockedVersionOf(projectDir, kind, name, publisher) {
|
|
976
1031
|
try {
|
|
977
|
-
const lock = readLock(
|
|
1032
|
+
const lock = readLock(path19__default.join(projectDir, "skaile.lock.yaml"));
|
|
978
1033
|
for (const key of Object.keys(lock?.assets ?? {})) {
|
|
979
1034
|
const id = parseCanonicalLockKey(key);
|
|
980
1035
|
if (id.kind !== kind || id.name !== name || !id.version) continue;
|
|
@@ -1014,7 +1069,7 @@ async function resolveInfoEntry(am2, ref, opts) {
|
|
|
1014
1069
|
return { entry: match ?? deployed };
|
|
1015
1070
|
}
|
|
1016
1071
|
const lookup = opts.storeLookup ?? (async (filter) => {
|
|
1017
|
-
const { resolveCatalogSource } = await import('../open-library-
|
|
1072
|
+
const { resolveCatalogSource } = await import('../open-library-NKKUJLWA.js');
|
|
1018
1073
|
const { source, close } = await resolveCatalogSource({ projectDir: opts.projectDir });
|
|
1019
1074
|
try {
|
|
1020
1075
|
return await source.listAssets(filter);
|
|
@@ -1030,7 +1085,7 @@ async function resolveInfoEntry(am2, ref, opts) {
|
|
|
1030
1085
|
);
|
|
1031
1086
|
return { entry: hit ? catalogAssetToEntry(hit) : null };
|
|
1032
1087
|
} catch (err) {
|
|
1033
|
-
const { LocalCatalogDisabledError: LocalCatalogDisabledError2 } = await import('../open-library-
|
|
1088
|
+
const { LocalCatalogDisabledError: LocalCatalogDisabledError2 } = await import('../open-library-NKKUJLWA.js');
|
|
1034
1089
|
const storeNote = err instanceof Error ? err.message : String(err);
|
|
1035
1090
|
const disabled = err instanceof LocalCatalogDisabledError2 || /catalog\.url/i.test(storeNote);
|
|
1036
1091
|
return { entry: null, storeNote, ...disabled ? { storeDisabled: true } : {} };
|
|
@@ -1046,7 +1101,7 @@ function infoNotFoundHint(ref, lookup) {
|
|
|
1046
1101
|
}
|
|
1047
1102
|
function makeInfoCommand() {
|
|
1048
1103
|
return new Command("info").description("Show asset metadata, deps, deploy status").argument("<ref>", "Asset reference (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
1049
|
-
const projectDir =
|
|
1104
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
1050
1105
|
requireProjectConfig(projectDir, { allowMissing: true });
|
|
1051
1106
|
const am2 = new AssetManager({ registry: getKindRegistry(), projectDir });
|
|
1052
1107
|
let lookup;
|
|
@@ -1079,6 +1134,12 @@ function makeInfoCommand() {
|
|
|
1079
1134
|
if (entry.publisher) console.log(` repository: ${S.dim(entry.publisher)}`);
|
|
1080
1135
|
const infoSource = showLocked && entry.source.endsWith(`#${entry.version}`) ? `${entry.source.slice(0, -`#${entry.version}`.length)}#${infoLocked}` : entry.source;
|
|
1081
1136
|
console.log(` source: ${S.dim(infoSource)}`);
|
|
1137
|
+
const infoLibrary = await am2.lockedLibraryOf(
|
|
1138
|
+
entry.kind,
|
|
1139
|
+
entry.name,
|
|
1140
|
+
parseRefTolerant(ref)?.publisher ?? entry.publisher
|
|
1141
|
+
);
|
|
1142
|
+
if (infoLibrary) console.log(` library: ${S.dim(infoLibrary)}`);
|
|
1082
1143
|
if (entry.kind === "mcp-server") {
|
|
1083
1144
|
const skipped = (await am2.mcpNotices()).find(
|
|
1084
1145
|
(n) => n.kind === "skipped" && (n.id === entry.name || n.id.endsWith(`/${entry.name}`))
|
|
@@ -1117,7 +1178,7 @@ function makeCreateCommand() {
|
|
|
1117
1178
|
new Option("-k, --kind <kind>", "Asset kind").default("skill").choices([...SCAFFOLD_KINDS])
|
|
1118
1179
|
).option("-d, --dir <dir>", "Target directory (default: cwd)").action((name, opts) => {
|
|
1119
1180
|
const am2 = new AssetManager({ registry: getKindRegistry(), projectDir: process.cwd() });
|
|
1120
|
-
const destDir = opts.dir ?
|
|
1181
|
+
const destDir = opts.dir ? path19__default.resolve(opts.dir) : process.cwd();
|
|
1121
1182
|
const result = am2.create(name, opts.kind, destDir);
|
|
1122
1183
|
if (result.ok) logOk(`Created ${kindColor(opts.kind)}: ${pc5.dim(result.path)}`);
|
|
1123
1184
|
else {
|
|
@@ -1132,7 +1193,7 @@ function makeDoctorCommand() {
|
|
|
1132
1193
|
const problems = globalProblems(
|
|
1133
1194
|
new AssetManager({
|
|
1134
1195
|
registry: getKindRegistry(),
|
|
1135
|
-
projectDir:
|
|
1196
|
+
projectDir: path19__default.resolve(opts.projectDir),
|
|
1136
1197
|
global: true,
|
|
1137
1198
|
harnesses: parseHarnessFilter(opts.harness)
|
|
1138
1199
|
})
|
|
@@ -1146,19 +1207,24 @@ function makeDoctorCommand() {
|
|
|
1146
1207
|
return;
|
|
1147
1208
|
}
|
|
1148
1209
|
requireProjectConfig(opts.projectDir);
|
|
1210
|
+
const configErrors = await reportProjectConfig(path19__default.resolve(opts.projectDir), {
|
|
1211
|
+
harness: true,
|
|
1212
|
+
instances: true
|
|
1213
|
+
});
|
|
1214
|
+
if (configErrors > 0) process.exitCode = 1;
|
|
1149
1215
|
const am2 = new AssetManager({
|
|
1150
1216
|
registry: getKindRegistry(),
|
|
1151
|
-
projectDir:
|
|
1217
|
+
projectDir: path19__default.resolve(opts.projectDir)
|
|
1152
1218
|
});
|
|
1153
1219
|
const { gaps } = await am2.projectState();
|
|
1154
|
-
const edited = await editedConventionFiles(
|
|
1220
|
+
const edited = await editedConventionFiles(path19__default.resolve(opts.projectDir));
|
|
1155
1221
|
const notices = [
|
|
1156
1222
|
...(await am2.mcpNotices()).map((n) => n.text),
|
|
1157
1223
|
// A library that went back past the lock is no drift either (p1257).
|
|
1158
1224
|
...await am2.libraryOlderNotices()
|
|
1159
1225
|
];
|
|
1160
1226
|
if (gaps.length === 0 && edited.length === 0) {
|
|
1161
|
-
logOk("No missing dependencies.");
|
|
1227
|
+
if (configErrors === 0) logOk("No missing dependencies.");
|
|
1162
1228
|
for (const n of notices) logWarn(n);
|
|
1163
1229
|
return;
|
|
1164
1230
|
}
|
|
@@ -1189,20 +1255,20 @@ function claudeSkillRoots() {
|
|
|
1189
1255
|
const roots = [];
|
|
1190
1256
|
const override = process.env.SKAILE_CLAUDE_SKILLS_DIR;
|
|
1191
1257
|
if (override) roots.push(override);
|
|
1192
|
-
roots.push(
|
|
1258
|
+
roots.push(path19.join(os.homedir(), ".claude", "skills"));
|
|
1193
1259
|
return roots;
|
|
1194
1260
|
}
|
|
1195
1261
|
function resolveImportSource(nameOrPath) {
|
|
1196
|
-
const asPath =
|
|
1262
|
+
const asPath = path19.resolve(nameOrPath);
|
|
1197
1263
|
if (fs8.existsSync(asPath)) {
|
|
1198
|
-
const dir = fs8.statSync(asPath).isDirectory() ? asPath :
|
|
1199
|
-
const skillFile =
|
|
1264
|
+
const dir = fs8.statSync(asPath).isDirectory() ? asPath : path19.dirname(asPath);
|
|
1265
|
+
const skillFile = path19.join(dir, "SKILL.md");
|
|
1200
1266
|
if (fs8.existsSync(skillFile)) return { dir, skillFile, via: "path" };
|
|
1201
1267
|
}
|
|
1202
|
-
if (!nameOrPath.includes(
|
|
1268
|
+
if (!nameOrPath.includes(path19.sep) && !nameOrPath.startsWith(".")) {
|
|
1203
1269
|
for (const root of claudeSkillRoots()) {
|
|
1204
|
-
const dir =
|
|
1205
|
-
const skillFile =
|
|
1270
|
+
const dir = path19.join(root, nameOrPath);
|
|
1271
|
+
const skillFile = path19.join(dir, "SKILL.md");
|
|
1206
1272
|
if (fs8.existsSync(skillFile)) return { dir, skillFile, via: "claude-skills" };
|
|
1207
1273
|
}
|
|
1208
1274
|
}
|
|
@@ -1260,8 +1326,8 @@ ${body}
|
|
|
1260
1326
|
// cli/src/commands/asset-cmd.ts
|
|
1261
1327
|
function copyFilter(root) {
|
|
1262
1328
|
return (src) => {
|
|
1263
|
-
const rel =
|
|
1264
|
-
return rel === "" || !(isNonAssetPath(rel) || isNonAssetDir(
|
|
1329
|
+
const rel = path19.relative(root, src).split(path19.sep).join("/");
|
|
1330
|
+
return rel === "" || !(isNonAssetPath(rel) || isNonAssetDir(path19.basename(src)));
|
|
1265
1331
|
};
|
|
1266
1332
|
}
|
|
1267
1333
|
async function resolveDefByRef(library, ref, opts) {
|
|
@@ -1344,16 +1410,16 @@ function makeAssetCommand() {
|
|
|
1344
1410
|
}
|
|
1345
1411
|
const rawSkill = fs8.readFileSync(src.skillFile, "utf8");
|
|
1346
1412
|
const norm = opts.normalize ? normalizeSkillContent(rawSkill, {
|
|
1347
|
-
fallbackName:
|
|
1413
|
+
fallbackName: path19.basename(src.dir),
|
|
1348
1414
|
version: opts.version,
|
|
1349
1415
|
stage: opts.stage
|
|
1350
|
-
}) : { content: rawSkill, name:
|
|
1416
|
+
}) : { content: rawSkill, name: path19.basename(src.dir), changed: false, notes: [] };
|
|
1351
1417
|
if (!opts.normalize && !isValidAssetName(norm.name)) {
|
|
1352
1418
|
logWarn(
|
|
1353
1419
|
`Name "${norm.name}" is not canonical (kebab-case); \`skaile validate\` will reject this manifest entry. Drop --no-normalize to slugify it.`
|
|
1354
1420
|
);
|
|
1355
1421
|
}
|
|
1356
|
-
const destDir =
|
|
1422
|
+
const destDir = path19.join(target.path, norm.name);
|
|
1357
1423
|
if (fs8.existsSync(destDir)) {
|
|
1358
1424
|
logErr(`Destination already exists: ${destDir}`);
|
|
1359
1425
|
process.exit(1);
|
|
@@ -1385,7 +1451,7 @@ function makeAssetCommand() {
|
|
|
1385
1451
|
logWarn(`${norm.name}/SKILL.md [${f.tag}] \u2014 ${f.text}`);
|
|
1386
1452
|
}
|
|
1387
1453
|
fs8.cpSync(src.dir, destDir, { recursive: true, filter: copyFilter(src.dir) });
|
|
1388
|
-
fs8.writeFileSync(
|
|
1454
|
+
fs8.writeFileSync(path19.join(destDir, "SKILL.md"), norm.content, "utf8");
|
|
1389
1455
|
for (const note of norm.notes) logInfo(` \u2022 ${note}`);
|
|
1390
1456
|
const fm = parseFrontmatter(norm.content).data;
|
|
1391
1457
|
for (const f of checkAgentSkillConformance(fm, { dirName: norm.name })) {
|
|
@@ -1451,10 +1517,10 @@ function makeAssetCommand() {
|
|
|
1451
1517
|
);
|
|
1452
1518
|
process.exit(1);
|
|
1453
1519
|
}
|
|
1454
|
-
const basename3 =
|
|
1520
|
+
const basename3 = path19.basename(srcPath);
|
|
1455
1521
|
const destDir = target.path;
|
|
1456
1522
|
fs8.mkdirSync(destDir, { recursive: true });
|
|
1457
|
-
const destPath =
|
|
1523
|
+
const destPath = path19.join(destDir, basename3);
|
|
1458
1524
|
if (fs8.existsSync(destPath)) {
|
|
1459
1525
|
logErr(`Destination already exists: ${destPath}`);
|
|
1460
1526
|
process.exit(1);
|
|
@@ -1486,7 +1552,7 @@ function makeAssetCommand() {
|
|
|
1486
1552
|
}
|
|
1487
1553
|
logOk(`Migrated ${basename3} \u2192 ${target.name} (${opts.mode})`);
|
|
1488
1554
|
const publisher = loadSkPublishManifest(target.path)?.publisher ?? "<publisher>";
|
|
1489
|
-
const migratedKind = fs8.existsSync(
|
|
1555
|
+
const migratedKind = fs8.existsSync(path19.join(destPath, "SKILL.md")) ? "skill" : "<kind>";
|
|
1490
1556
|
logInfo(
|
|
1491
1557
|
`Not addable yet: run ${S.cmd(`skaile library index ${target.name}`)}, then ${S.cmd(`skaile add ${migratedKind}:@${publisher.replace(/^@/, "")}/${basename3}`)}`
|
|
1492
1558
|
);
|
|
@@ -1612,14 +1678,14 @@ function makeAuthCommand() {
|
|
|
1612
1678
|
}
|
|
1613
1679
|
function collectCacheTargets(scope) {
|
|
1614
1680
|
const out = [];
|
|
1615
|
-
out.push(
|
|
1616
|
-
out.push(
|
|
1617
|
-
out.push(
|
|
1681
|
+
out.push(path19__default.join(scope.projectDir, ".skaile", "cache"));
|
|
1682
|
+
out.push(path19__default.join(scope.projectDir, ".skaile", "store-cache"));
|
|
1683
|
+
out.push(path19__default.join(scope.projectDir, ".skaile", "repos"));
|
|
1618
1684
|
if (scope.global) {
|
|
1619
1685
|
out.push(globalCacheRoot());
|
|
1620
1686
|
const home = globalSkaileDir();
|
|
1621
|
-
out.push(
|
|
1622
|
-
out.push(
|
|
1687
|
+
out.push(path19__default.join(home, "repos"));
|
|
1688
|
+
out.push(path19__default.join(home, "catalog-cache"));
|
|
1623
1689
|
}
|
|
1624
1690
|
return out;
|
|
1625
1691
|
}
|
|
@@ -1633,7 +1699,7 @@ function dirSize(target) {
|
|
|
1633
1699
|
function dirSizeOfDir(dir) {
|
|
1634
1700
|
let total = 0;
|
|
1635
1701
|
for (const ent of readdirSync(dir, { withFileTypes: true })) {
|
|
1636
|
-
const child =
|
|
1702
|
+
const child = path19__default.join(dir, ent.name);
|
|
1637
1703
|
if (ent.isSymbolicLink()) continue;
|
|
1638
1704
|
if (ent.isDirectory()) total += dirSizeOfDir(child);
|
|
1639
1705
|
else if (ent.isFile()) total += statSync(child).size;
|
|
@@ -1659,7 +1725,7 @@ function makeCacheCommand() {
|
|
|
1659
1725
|
const cmd = new Command("cache").description("Inspect and reclaim the re-derivable cache");
|
|
1660
1726
|
cmd.command("clean").description("Remove the project cache (.skaile/cache); --global also clears ~/.skaile/cache").option("--global", "Also clear the global cache (sources + catalog) and legacy dirs").option("--dry-run", "Show what would be removed without doing it").option("-y, --yes", "Skip confirmation prompt").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
1661
1727
|
const targets = collectCacheTargets({
|
|
1662
|
-
projectDir:
|
|
1728
|
+
projectDir: path19__default.resolve(opts.projectDir),
|
|
1663
1729
|
global: opts.global
|
|
1664
1730
|
}).filter((t) => existsSync(t));
|
|
1665
1731
|
if (targets.length === 0) {
|
|
@@ -1689,12 +1755,12 @@ function makeCacheCommand() {
|
|
|
1689
1755
|
for (const r of removed) logOk(`Removed ${r}`);
|
|
1690
1756
|
});
|
|
1691
1757
|
cmd.command("dir").description("Print the resolved cache roots").option("--global", "Include the global cache root").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
1692
|
-
console.log(
|
|
1758
|
+
console.log(path19__default.join(path19__default.resolve(opts.projectDir), ".skaile", "cache"));
|
|
1693
1759
|
if (opts.global) console.log(globalCacheRoot());
|
|
1694
1760
|
});
|
|
1695
1761
|
cmd.command("size").description("Show cache disk usage per directory").option("--global", "Include the global cache").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
1696
1762
|
const targets = collectCacheTargets({
|
|
1697
|
-
projectDir:
|
|
1763
|
+
projectDir: path19__default.resolve(opts.projectDir),
|
|
1698
1764
|
global: opts.global
|
|
1699
1765
|
});
|
|
1700
1766
|
console.log();
|
|
@@ -1710,7 +1776,7 @@ function makeCatalogCommand() {
|
|
|
1710
1776
|
const catalog = new Command("catalog").description("Catalog source health and configuration");
|
|
1711
1777
|
catalog.command("test").description("Probe the configured catalog source and report status").option("--project-dir <path>", "Project directory (for project-level config overlay)").option("--url <url>", "Override the catalog URL for this probe").option("--force", "Probe the network even in air-gapped mode (cache_ttl: 0)").action(async (opts) => {
|
|
1712
1778
|
const { resolveConfig, isLocalCatalogUrl, trpcGetUrl } = await import('../library/index.js');
|
|
1713
|
-
const projectDir = opts.projectDir ?
|
|
1779
|
+
const projectDir = opts.projectDir ? path19__default.resolve(opts.projectDir) : void 0;
|
|
1714
1780
|
const cfg = resolveConfig({ projectDir });
|
|
1715
1781
|
const baseUrl = opts.url ?? cfg.catalog.url;
|
|
1716
1782
|
if (isLocalCatalogUrl(baseUrl)) {
|
|
@@ -1732,7 +1798,7 @@ function makeCatalogCommand() {
|
|
|
1732
1798
|
});
|
|
1733
1799
|
catalog.command("info").description("Print the resolved catalog configuration (url, framing, cacheTtlMs)").option("--project-dir <path>", "Project directory (for project-level config overlay)").action(async (opts) => {
|
|
1734
1800
|
const { resolveConfig } = await import('../library/index.js');
|
|
1735
|
-
const projectDir = opts.projectDir ?
|
|
1801
|
+
const projectDir = opts.projectDir ? path19__default.resolve(opts.projectDir) : void 0;
|
|
1736
1802
|
const cfg = resolveConfig({ projectDir });
|
|
1737
1803
|
console.log(`url: ${cfg.catalog.url}`);
|
|
1738
1804
|
console.log(`framing: ${cfg.catalog.framing}`);
|
|
@@ -1741,7 +1807,7 @@ function makeCatalogCommand() {
|
|
|
1741
1807
|
return catalog;
|
|
1742
1808
|
}
|
|
1743
1809
|
async function runLocalCatalogTest(projectDir) {
|
|
1744
|
-
const { resolveCatalogSource } = await import('../open-library-
|
|
1810
|
+
const { resolveCatalogSource } = await import('../open-library-NKKUJLWA.js');
|
|
1745
1811
|
let resolved;
|
|
1746
1812
|
try {
|
|
1747
1813
|
resolved = await resolveCatalogSource({ projectDir });
|
|
@@ -1917,13 +1983,13 @@ async function scanLibraryFlowEntries() {
|
|
|
1917
1983
|
const { LocalIndex, resolveIndexPath, scanAuthoringLibraries } = await import('../library/index.js');
|
|
1918
1984
|
const indexPath = resolveIndexPath();
|
|
1919
1985
|
if (!existsSync(indexPath)) return entries;
|
|
1920
|
-
const { getKindRegistry: getKindRegistry2 } = await import('../open-registry-
|
|
1986
|
+
const { getKindRegistry: getKindRegistry2 } = await import('../open-registry-BYAXSHUI.js');
|
|
1921
1987
|
const index = new LocalIndex({ indexPath });
|
|
1922
1988
|
try {
|
|
1923
1989
|
for (const { library, assets } of await scanAuthoringLibraries(index, getKindRegistry2())) {
|
|
1924
1990
|
for (const asset of assets) {
|
|
1925
1991
|
if (asset.kind !== "flow") continue;
|
|
1926
|
-
if (flowFileNameError(asset.manifest,
|
|
1992
|
+
if (flowFileNameError(asset.manifest, path19__default.basename(asset.manifestPath))) continue;
|
|
1927
1993
|
try {
|
|
1928
1994
|
const flow = loadFlow(asset.manifestPath);
|
|
1929
1995
|
if (flow.id) {
|
|
@@ -1991,9 +2057,9 @@ function findSkills() {
|
|
|
1991
2057
|
}
|
|
1992
2058
|
function walkSkills(dir, out) {
|
|
1993
2059
|
for (const entry of fs8__default.readdirSync(dir, { withFileTypes: true })) {
|
|
1994
|
-
const full =
|
|
2060
|
+
const full = path19__default.join(dir, entry.name);
|
|
1995
2061
|
if (entry.isDirectory()) {
|
|
1996
|
-
const skillMd =
|
|
2062
|
+
const skillMd = path19__default.join(full, "SKILL.md");
|
|
1997
2063
|
if (fs8__default.existsSync(skillMd)) {
|
|
1998
2064
|
out.push({ name: entry.name, path: full, skillPath: skillMd });
|
|
1999
2065
|
} else {
|
|
@@ -2015,7 +2081,7 @@ function resolveFlowIds() {
|
|
|
2015
2081
|
}
|
|
2016
2082
|
}
|
|
2017
2083
|
function resolveSessionIds(projectDir) {
|
|
2018
|
-
const sessionsDir =
|
|
2084
|
+
const sessionsDir = path19__default.join(projectDir, ".skaile", "sessions");
|
|
2019
2085
|
if (!fs8__default.existsSync(sessionsDir)) return [];
|
|
2020
2086
|
try {
|
|
2021
2087
|
return fs8__default.readdirSync(sessionsDir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length));
|
|
@@ -2023,7 +2089,7 @@ function resolveSessionIds(projectDir) {
|
|
|
2023
2089
|
return [];
|
|
2024
2090
|
}
|
|
2025
2091
|
}
|
|
2026
|
-
var CONFIG_KEYS = ["provider", "model", "
|
|
2092
|
+
var CONFIG_KEYS = ["provider", "model", "harness", "framework", "projectDir", "apiKey"];
|
|
2027
2093
|
|
|
2028
2094
|
// cli/src/commands/complete.ts
|
|
2029
2095
|
function makeCompleteCommand(program2) {
|
|
@@ -2070,39 +2136,12 @@ function resolveDynamic(words, cword) {
|
|
|
2070
2136
|
if (cmd === "config" && ["get", "set"].includes(sub) && isLast(3)) return CONFIG_KEYS;
|
|
2071
2137
|
return null;
|
|
2072
2138
|
}
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
return `Unknown agent driver: "${driver}". Available: ${known.join(", ")}`;
|
|
2079
|
-
}
|
|
2080
|
-
function friendlyDriverError(err) {
|
|
2081
|
-
const e = err;
|
|
2082
|
-
if (!e) return null;
|
|
2083
|
-
const isSpawnEnoent = e.code === "ENOENT" && (e.syscall?.startsWith("spawn") === true || /^spawn .*ENOENT/.test(e.message ?? ""));
|
|
2084
|
-
const isConfig = e.category === "config" || e.detail?.category === "config";
|
|
2085
|
-
if (!isSpawnEnoent && !isConfig) return null;
|
|
2086
|
-
const hint = e.hint ?? e.detail?.hint;
|
|
2087
|
-
const base = hint ?? "The configured agent binary is not installed or not on your PATH.";
|
|
2088
|
-
return `${base}
|
|
2089
|
-
Try a different harness with \`--driver claude-sdk\`.`;
|
|
2090
|
-
}
|
|
2091
|
-
function driverErrorNotes(err) {
|
|
2092
|
-
const e = err;
|
|
2093
|
-
const notes = [];
|
|
2094
|
-
const category = e?.category ?? e?.detail?.category;
|
|
2095
|
-
const hint = e?.hint ?? e?.detail?.hint;
|
|
2096
|
-
if (hint && category !== "config") notes.push(hint);
|
|
2097
|
-
else if (category === "auth") notes.push("Check your API key or login.");
|
|
2098
|
-
if (e?.logSessionId) {
|
|
2099
|
-
notes.push(`Full records: .skaile/logs.db (skaile session logs ${e.logSessionId}).`);
|
|
2100
|
-
}
|
|
2101
|
-
return notes;
|
|
2139
|
+
var PERSONAL_KEYS = /* @__PURE__ */ new Set(["harness", "model"]);
|
|
2140
|
+
function resolveDriverKeyAlias(key) {
|
|
2141
|
+
if (key !== "driver") return key;
|
|
2142
|
+
console.error("`driver` is deprecated; use `harness`");
|
|
2143
|
+
return "harness";
|
|
2102
2144
|
}
|
|
2103
|
-
|
|
2104
|
-
// cli/src/commands/config.ts
|
|
2105
|
-
var PERSONAL_KEYS = /* @__PURE__ */ new Set(["driver", "model"]);
|
|
2106
2145
|
var CATALOG_KEYS = /* @__PURE__ */ new Set(["catalog.url", "catalog.cache_ttl", "catalog.framing"]);
|
|
2107
2146
|
async function setCatalogKey(key, raw) {
|
|
2108
2147
|
const { CatalogConfigSchema, saveConfig } = await import('../library/index.js');
|
|
@@ -2160,7 +2199,7 @@ function collectWorkspaceDefaults(projectDir) {
|
|
|
2160
2199
|
const wsDefaults = {};
|
|
2161
2200
|
const ws = resolveSkWorkspaceConfig(projectDir);
|
|
2162
2201
|
const p6 = ws.agent_config?.default ?? {};
|
|
2163
|
-
if (p6.
|
|
2202
|
+
if (p6.harness) wsDefaults.harness = p6.harness;
|
|
2164
2203
|
if (p6.model) wsDefaults.model = p6.model;
|
|
2165
2204
|
if (p6.skills_dir) wsDefaults.skills_dir = p6.skills_dir;
|
|
2166
2205
|
if (p6.agents_dir) wsDefaults.agents_dir = p6.agents_dir;
|
|
@@ -2174,7 +2213,7 @@ function printEffectiveSection(config, sources) {
|
|
|
2174
2213
|
console.log();
|
|
2175
2214
|
console.log(S.heading(" Effective Config"));
|
|
2176
2215
|
console.log(` ${S.rule(40)}`);
|
|
2177
|
-
for (const key of ["
|
|
2216
|
+
for (const key of ["harness", "model"]) {
|
|
2178
2217
|
const value = config[key];
|
|
2179
2218
|
if (value !== void 0) {
|
|
2180
2219
|
const origin = sources[key];
|
|
@@ -2201,7 +2240,7 @@ function printModelSelectionSection(config, projectDir) {
|
|
|
2201
2240
|
console.log(` ${S.rule(40)}`);
|
|
2202
2241
|
const selector = config.model;
|
|
2203
2242
|
if (!selector) {
|
|
2204
|
-
console.log(` ${S.dim("no model: selector \u2014 the
|
|
2243
|
+
console.log(` ${S.dim("no model: selector \u2014 the harness applies its own default")}`);
|
|
2205
2244
|
} else {
|
|
2206
2245
|
const resolved = parseModelRef(selector, registry, config.roles);
|
|
2207
2246
|
if (!resolved) {
|
|
@@ -2233,8 +2272,8 @@ function printModelSelectionSection(config, projectDir) {
|
|
|
2233
2272
|
}
|
|
2234
2273
|
}
|
|
2235
2274
|
function printResolvedPathsSection(config) {
|
|
2236
|
-
const fw = config.
|
|
2237
|
-
const paths =
|
|
2275
|
+
const fw = config.harness ?? DEFAULT_HARNESS_ID;
|
|
2276
|
+
const paths = HARNESS_DEFAULTS[fw] ?? HARNESS_DEFAULTS[DEFAULT_HARNESS_ID];
|
|
2238
2277
|
if (!paths) return;
|
|
2239
2278
|
console.log();
|
|
2240
2279
|
console.log(` ${S.heading("Resolved Paths")} ${S.dim(`(${fw})`)}`);
|
|
@@ -2244,7 +2283,7 @@ function printResolvedPathsSection(config) {
|
|
|
2244
2283
|
console.log(` ${S.label("prompts:".padEnd(16))} ${config.promptsDir ?? paths.promptsDir}`);
|
|
2245
2284
|
}
|
|
2246
2285
|
async function showConfig(opts) {
|
|
2247
|
-
const projectDir = opts.projectDir ?
|
|
2286
|
+
const projectDir = opts.projectDir ? path19__default.resolve(opts.projectDir) : process.cwd();
|
|
2248
2287
|
let config;
|
|
2249
2288
|
let sources;
|
|
2250
2289
|
let wsDefaults;
|
|
@@ -2309,8 +2348,9 @@ function unsetApiKeySugar(provider, projectDir) {
|
|
|
2309
2348
|
function makeConfigCommand() {
|
|
2310
2349
|
const cmd = new Command("config").description("Manage personal config (.skaile/settings.json)");
|
|
2311
2350
|
cmd.command("show").description("Show effective config with sources").option("--project-dir <path>", "Project directory").action((opts) => showConfig(opts));
|
|
2312
|
-
cmd.command("get <key>").description("Get an effective config value").option("--project-dir <path>", "Project directory").option("--global", "Read ~/.skaile/settings.json only, not the project's value").action(async (
|
|
2313
|
-
const
|
|
2351
|
+
cmd.command("get <key>").description("Get an effective config value").option("--project-dir <path>", "Project directory").option("--global", "Read ~/.skaile/settings.json only, not the project's value").action(async (rawKey, opts) => {
|
|
2352
|
+
const key = resolveDriverKeyAlias(rawKey);
|
|
2353
|
+
const projectDir = opts.projectDir ? path19__default.resolve(opts.projectDir) : process.cwd();
|
|
2314
2354
|
if (CATALOG_KEYS.has(key)) {
|
|
2315
2355
|
const { resolveConfig } = await import('../library/index.js');
|
|
2316
2356
|
const field = key.slice("catalog.".length);
|
|
@@ -2322,75 +2362,92 @@ function makeConfigCommand() {
|
|
|
2322
2362
|
console.log(value ?? S.dim("(not set)"));
|
|
2323
2363
|
});
|
|
2324
2364
|
cmd.command("set <key> <value>").description(
|
|
2325
|
-
"Set a personal config value (
|
|
2326
|
-
).option("--project-dir <path>", "Project directory").option("--global", "Write to ~/.skaile/settings.json instead of project-local").action(
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2365
|
+
"Set a personal config value (harness, model, apiKey.<provider>) or a catalog setting (catalog.url, catalog.cache_ttl, catalog.framing). `config unset <key>` removes every one of them again"
|
|
2366
|
+
).option("--project-dir <path>", "Project directory").option("--global", "Write to ~/.skaile/settings.json instead of project-local").action(
|
|
2367
|
+
async (rawKey, value, opts) => {
|
|
2368
|
+
const key = resolveDriverKeyAlias(rawKey);
|
|
2369
|
+
const projectDir = opts.projectDir ? path19__default.resolve(opts.projectDir) : process.cwd();
|
|
2370
|
+
if (CATALOG_KEYS.has(key)) {
|
|
2371
|
+
await setCatalogKey(key, value);
|
|
2372
|
+
return;
|
|
2373
|
+
}
|
|
2374
|
+
if (key === "provider" || key === "cloud" || key === "cloudConfig") {
|
|
2375
|
+
logErr(
|
|
2376
|
+
`'${key}' is no longer a setting \u2014 an endpoint is an AI provider registry entry and a session selects one with a model reference.
|
|
2335
2377
|
Define it: skaile providers add <id> --preset <preset>
|
|
2336
2378
|
Select it: skaile config set model <providerId>/<modelId>`
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2379
|
+
);
|
|
2380
|
+
process.exit(1);
|
|
2381
|
+
}
|
|
2382
|
+
const isApiKey = key.startsWith(API_KEY_PREFIX);
|
|
2383
|
+
if (!PERSONAL_KEYS.has(key) && !isApiKey) {
|
|
2384
|
+
logErr(
|
|
2385
|
+
`'${key}' is not a personal setting.
|
|
2344
2386
|
Personal keys: ${[...PERSONAL_KEYS].join(", ")}, ${API_KEY_PREFIX}<provider>
|
|
2345
|
-
Project config (
|
|
2346
|
-
|
|
2347
|
-
process.exit(1);
|
|
2348
|
-
}
|
|
2349
|
-
if (isApiKey) {
|
|
2350
|
-
setApiKeySugar(key.slice(API_KEY_PREFIX.length), value, projectDir);
|
|
2351
|
-
return;
|
|
2352
|
-
}
|
|
2353
|
-
if (key === "driver") {
|
|
2354
|
-
await loadDeclaredPlugins(projectDir);
|
|
2355
|
-
const unknown = unknownDriverMessage(value);
|
|
2356
|
-
if (unknown) {
|
|
2357
|
-
logErr(unknown);
|
|
2387
|
+
Project config (harness, model, paths, resources) belongs in skaile.yaml`
|
|
2388
|
+
);
|
|
2358
2389
|
process.exit(1);
|
|
2359
2390
|
}
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2391
|
+
if (isApiKey) {
|
|
2392
|
+
setApiKeySugar(key.slice(API_KEY_PREFIX.length), value, projectDir);
|
|
2393
|
+
return;
|
|
2394
|
+
}
|
|
2395
|
+
if (key === "harness") {
|
|
2396
|
+
await loadDeclaredPlugins(projectDir);
|
|
2397
|
+
const unknown = unknownHarnessMessage(value);
|
|
2398
|
+
if (unknown) {
|
|
2399
|
+
logErr(unknown);
|
|
2400
|
+
process.exit(1);
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
if (key === "model") {
|
|
2404
|
+
await loadDeclaredPlugins(projectDir);
|
|
2405
|
+
const harness = (await resolveSettings(projectDir)).harness ?? DEFAULT_HARNESS_ID;
|
|
2406
|
+
const refusal = checkHarnessModel(harness, {
|
|
2407
|
+
registry: loadRegistryView({ projectDir }).merged,
|
|
2408
|
+
model: value,
|
|
2409
|
+
roles: resolveSkWorkspaceConfig(projectDir).roles
|
|
2410
|
+
});
|
|
2411
|
+
if (refusal) {
|
|
2412
|
+
logErr(`${refusal} (the project's harness is ${harness})`);
|
|
2413
|
+
process.exit(1);
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
const projectHarness = key === "harness" ? resolveSkWorkspaceConfig(projectDir).agent_config?.default?.harness : void 0;
|
|
2417
|
+
const filePath = opts.global ? globalSettingsPath() : projectSettingsPath(projectDir);
|
|
2418
|
+
const existing = await loadSettings(filePath);
|
|
2419
|
+
await saveSettings({ ...existing, [key]: value }, filePath);
|
|
2420
|
+
logOk(`Set ${pc5.bold(key)} = ${value}`);
|
|
2421
|
+
console.log(S.dim(` \u2192 ${filePath}`));
|
|
2422
|
+
if (projectHarness && projectHarness !== value) {
|
|
2377
2423
|
logWarn(
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
} else {
|
|
2381
|
-
console.log(
|
|
2382
|
-
S.dim(
|
|
2383
|
-
` \u2192 resolves to ${resolved.providerId}${resolved.providerModelId ? `/${resolved.providerModelId}` : ""}`
|
|
2384
|
-
)
|
|
2424
|
+
`skaile.yaml sets harness ${projectHarness}; a personal harness does not override the project harness.
|
|
2425
|
+
Remove this one again: skaile config unset harness${opts.global ? " --global" : ""}`
|
|
2385
2426
|
);
|
|
2386
|
-
|
|
2427
|
+
}
|
|
2428
|
+
if (key === "model") {
|
|
2429
|
+
const view = loadRegistryView({ projectDir });
|
|
2430
|
+
const resolved = parseModelRef(value, view.merged);
|
|
2431
|
+
if (!resolved) {
|
|
2432
|
+
logWarn(
|
|
2433
|
+
"no AI provider is configured yet \u2014 add one with `skaile providers add <id> --preset <preset>`"
|
|
2434
|
+
);
|
|
2435
|
+
} else {
|
|
2436
|
+
console.log(
|
|
2437
|
+
S.dim(
|
|
2438
|
+
` \u2192 resolves to ${resolved.providerId}${resolved.providerModelId ? `/${resolved.providerModelId}` : ""}`
|
|
2439
|
+
)
|
|
2440
|
+
);
|
|
2441
|
+
for (const warning of resolved.warnings) logWarn(warning);
|
|
2442
|
+
}
|
|
2387
2443
|
}
|
|
2388
2444
|
}
|
|
2389
|
-
|
|
2445
|
+
);
|
|
2390
2446
|
cmd.command("unset <key>").description(
|
|
2391
|
-
"Remove a value that `config set` wrote:
|
|
2392
|
-
).option("--project-dir <path>", "Project directory").option("--global", "Remove from ~/.skaile/settings.json instead of project-local").action(async (
|
|
2393
|
-
const
|
|
2447
|
+
"Remove a value that `config set` wrote: harness, model, apiKey.<provider> (removes the provider entry) or catalog.url, catalog.cache_ttl, catalog.framing (the default applies again)"
|
|
2448
|
+
).option("--project-dir <path>", "Project directory").option("--global", "Remove from ~/.skaile/settings.json instead of project-local").action(async (rawKey, opts) => {
|
|
2449
|
+
const key = resolveDriverKeyAlias(rawKey);
|
|
2450
|
+
const projectDir = opts.projectDir ? path19__default.resolve(opts.projectDir) : process.cwd();
|
|
2394
2451
|
if (CATALOG_KEYS.has(key)) {
|
|
2395
2452
|
await unsetCatalogKey(key);
|
|
2396
2453
|
return;
|
|
@@ -2713,8 +2770,8 @@ function makeConnectorCommand() {
|
|
|
2713
2770
|
async (driver, opts) => {
|
|
2714
2771
|
const { installNpmPackages } = await import('../connectors/index.js');
|
|
2715
2772
|
const { scanDirectory: scanDirectory2, factoryAssetRoots: factoryAssetRoots2, WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
2716
|
-
const projectDir =
|
|
2717
|
-
const yamlPath =
|
|
2773
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
2774
|
+
const yamlPath = path19__default.join(projectDir, "skaile.yaml");
|
|
2718
2775
|
if (!existsSync(yamlPath)) {
|
|
2719
2776
|
logErr("No skaile.yaml found in current directory. Run 'skaile init' first.");
|
|
2720
2777
|
process.exit(1);
|
|
@@ -2774,8 +2831,8 @@ ${installResult.output}`);
|
|
|
2774
2831
|
);
|
|
2775
2832
|
cmd.command("remove <id>").option("--project-dir <path>", "Workspace directory", process.cwd()).description("Remove a connector from skaile.yaml by its instance ID").action(async (id, opts) => {
|
|
2776
2833
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
2777
|
-
const projectDir =
|
|
2778
|
-
const yamlPath =
|
|
2834
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
2835
|
+
const yamlPath = path19__default.join(projectDir, "skaile.yaml");
|
|
2779
2836
|
if (!existsSync(yamlPath)) {
|
|
2780
2837
|
logErr("No skaile.yaml found in current directory.");
|
|
2781
2838
|
process.exit(1);
|
|
@@ -2792,7 +2849,7 @@ ${installResult.output}`);
|
|
|
2792
2849
|
cmd.command("status [id]").option("--project-dir <path>", "Workspace directory", process.cwd()).description("Connect and report health status for one or all connectors").action(async (id, opts) => {
|
|
2793
2850
|
const res = await import('../connectors/index.js');
|
|
2794
2851
|
res.registerBuiltinConnectors();
|
|
2795
|
-
const projectDir =
|
|
2852
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
2796
2853
|
const declarations = res.loadConnectorDeclarations(projectDir);
|
|
2797
2854
|
if (declarations.length === 0) {
|
|
2798
2855
|
console.log("No connectors configured in skaile.yaml.");
|
|
@@ -2816,7 +2873,7 @@ ${installResult.output}`);
|
|
|
2816
2873
|
await manager.disconnectAll();
|
|
2817
2874
|
});
|
|
2818
2875
|
cmd.command("list").description("List all configured connectors").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
|
|
2819
|
-
const projectDir =
|
|
2876
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
2820
2877
|
const manager = await connectConnectors(projectDir);
|
|
2821
2878
|
try {
|
|
2822
2879
|
console.log(JSON.stringify(manager.listConnectors(), null, 2));
|
|
@@ -2825,7 +2882,7 @@ ${installResult.output}`);
|
|
|
2825
2882
|
}
|
|
2826
2883
|
});
|
|
2827
2884
|
cmd.command("sync [id]").description("Re-sync a filesystem-face connector or all of them (git pull, S3 refresh, etc.)").option("--all", "Sync all connectors").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, opts) => {
|
|
2828
|
-
const projectDir =
|
|
2885
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
2829
2886
|
const manager = await connectConnectors(projectDir);
|
|
2830
2887
|
try {
|
|
2831
2888
|
if (opts.all) {
|
|
@@ -2849,7 +2906,7 @@ ${installResult.output}`);
|
|
|
2849
2906
|
}
|
|
2850
2907
|
});
|
|
2851
2908
|
cmd.command("ops <id>").description("List available operations for a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, opts) => {
|
|
2852
|
-
const projectDir =
|
|
2909
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
2853
2910
|
const manager = await connectConnectors(projectDir);
|
|
2854
2911
|
try {
|
|
2855
2912
|
if (!manager.has(id)) {
|
|
@@ -2864,7 +2921,7 @@ ${installResult.output}`);
|
|
|
2864
2921
|
}
|
|
2865
2922
|
});
|
|
2866
2923
|
cmd.command("read <id> <resource-path>").description("Read content from a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, resourcePath, opts) => {
|
|
2867
|
-
const projectDir =
|
|
2924
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
2868
2925
|
const manager = await connectConnectors(projectDir);
|
|
2869
2926
|
try {
|
|
2870
2927
|
const content = await manager.read(id, resourcePath);
|
|
@@ -2874,7 +2931,7 @@ ${installResult.output}`);
|
|
|
2874
2931
|
}
|
|
2875
2932
|
});
|
|
2876
2933
|
cmd.command("write <id> <resource-path> <content>").description("Write content to a connector at a path").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, resourcePath, content, opts) => {
|
|
2877
|
-
const projectDir =
|
|
2934
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
2878
2935
|
const manager = await connectConnectors(projectDir);
|
|
2879
2936
|
try {
|
|
2880
2937
|
await manager.write(id, resourcePath, { data: content });
|
|
@@ -2884,7 +2941,7 @@ ${installResult.output}`);
|
|
|
2884
2941
|
}
|
|
2885
2942
|
});
|
|
2886
2943
|
cmd.command("entries <id> [resource-path]").description("List entries in a connector (files, keys, rows, etc)").option("--project-dir <path>", "Workspace directory", process.cwd()).option("--recursive", "Include nested entries").option("--limit <n>", "Maximum entries to return", parsePositiveIntOption).action(async (id, resourcePath, opts) => {
|
|
2887
|
-
const projectDir =
|
|
2944
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
2888
2945
|
const manager = await connectConnectors(projectDir);
|
|
2889
2946
|
try {
|
|
2890
2947
|
const entries = await manager.list(id, resourcePath, {
|
|
@@ -2897,7 +2954,7 @@ ${installResult.output}`);
|
|
|
2897
2954
|
}
|
|
2898
2955
|
});
|
|
2899
2956
|
cmd.command("search <id> <query>").description("Search within a connector for matching content").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, query, opts) => {
|
|
2900
|
-
const projectDir =
|
|
2957
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
2901
2958
|
const manager = await connectConnectors(projectDir);
|
|
2902
2959
|
try {
|
|
2903
2960
|
const results = await manager.search(id, query);
|
|
@@ -2907,7 +2964,7 @@ ${installResult.output}`);
|
|
|
2907
2964
|
}
|
|
2908
2965
|
});
|
|
2909
2966
|
cmd.command("delete <id> <resource-path>").description("Delete an entry from a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, resourcePath, opts) => {
|
|
2910
|
-
const projectDir =
|
|
2967
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
2911
2968
|
const manager = await connectConnectors(projectDir);
|
|
2912
2969
|
try {
|
|
2913
2970
|
const ok = await manager.delete(id, resourcePath);
|
|
@@ -2917,7 +2974,7 @@ ${installResult.output}`);
|
|
|
2917
2974
|
}
|
|
2918
2975
|
});
|
|
2919
2976
|
cmd.command("run <id> <op> [args...]").description("Run a custom adapter operation (e.g. git log, sqlite query)").option("--project-dir <path>", "Workspace directory", process.cwd()).allowUnknownOption().action(async (id, op, args, opts) => {
|
|
2920
|
-
const projectDir =
|
|
2977
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
2921
2978
|
const manager = await connectConnectors(projectDir);
|
|
2922
2979
|
try {
|
|
2923
2980
|
if (!manager.has(id)) {
|
|
@@ -2998,7 +3055,7 @@ function makeDebugCommand() {
|
|
|
2998
3055
|
cmd.command("mcp").description("List MCP servers and their registered tools").action(async (_, parent) => {
|
|
2999
3056
|
await runDebugQuery("mcp", parent.parent.opts());
|
|
3000
3057
|
});
|
|
3001
|
-
cmd.command("config").description("Dump
|
|
3058
|
+
cmd.command("config").description("Dump harness config (API keys redacted)").action(async (_, parent) => {
|
|
3002
3059
|
await runDebugQuery("config", parent.parent.opts());
|
|
3003
3060
|
});
|
|
3004
3061
|
cmd.command("state [store]").description("Read a shared state store snapshot (or list all stores)").action(async (store, _, parent) => {
|
|
@@ -3026,7 +3083,7 @@ function envRecord() {
|
|
|
3026
3083
|
async function buildDeployContext(projectDir) {
|
|
3027
3084
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
3028
3085
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
3029
|
-
const workspaceId = config.name ??
|
|
3086
|
+
const workspaceId = config.name ?? path19__default.basename(projectDir);
|
|
3030
3087
|
let log;
|
|
3031
3088
|
try {
|
|
3032
3089
|
const { createLogger } = await import('../core/logging.js');
|
|
@@ -3058,13 +3115,13 @@ async function ensureTargetsRegistered(projectDir) {
|
|
|
3058
3115
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
3059
3116
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
3060
3117
|
if (config.plugins && config.plugins.length > 0) {
|
|
3061
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
3118
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-ABE35NRX.js');
|
|
3062
3119
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
3063
3120
|
for (const f of result.failed) logWarn(f.error);
|
|
3064
3121
|
}
|
|
3065
3122
|
}
|
|
3066
3123
|
async function runUp(opts) {
|
|
3067
|
-
const projectDir =
|
|
3124
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
3068
3125
|
await ensureTargetsRegistered(projectDir);
|
|
3069
3126
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
3070
3127
|
const { resolveDeployTarget, pluginRegistry } = await import('../plugin-registry/index.js');
|
|
@@ -3132,7 +3189,7 @@ async function restoreFromHandle(projectDir) {
|
|
|
3132
3189
|
return { target, handle, ctx };
|
|
3133
3190
|
}
|
|
3134
3191
|
async function runDown(opts) {
|
|
3135
|
-
const projectDir =
|
|
3192
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
3136
3193
|
const restored = await restoreFromHandle(projectDir);
|
|
3137
3194
|
if (!restored) return;
|
|
3138
3195
|
await restored.handle.stop();
|
|
@@ -3141,7 +3198,7 @@ async function runDown(opts) {
|
|
|
3141
3198
|
logOk(`Stopped ${S.cmd(restored.target.id)} and cleared the handle.`);
|
|
3142
3199
|
}
|
|
3143
3200
|
async function runStatus(opts) {
|
|
3144
|
-
const projectDir =
|
|
3201
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
3145
3202
|
const restored = await restoreFromHandle(projectDir);
|
|
3146
3203
|
if (!restored) return;
|
|
3147
3204
|
const health = await restored.handle.health();
|
|
@@ -3155,7 +3212,7 @@ async function runStatus(opts) {
|
|
|
3155
3212
|
console.log();
|
|
3156
3213
|
}
|
|
3157
3214
|
async function runLogs(opts) {
|
|
3158
|
-
const projectDir =
|
|
3215
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
3159
3216
|
const restored = await restoreFromHandle(projectDir);
|
|
3160
3217
|
if (!restored) return;
|
|
3161
3218
|
if (!restored.handle.logs) {
|
|
@@ -3178,12 +3235,15 @@ function makeDeployCommand() {
|
|
|
3178
3235
|
return cmd;
|
|
3179
3236
|
}
|
|
3180
3237
|
var DIFF_SHOWS = { content: true, modified: true, incomplete: true };
|
|
3238
|
+
function uniqueMessages(gaps) {
|
|
3239
|
+
return [...new Set(gaps.map((g) => g.message))];
|
|
3240
|
+
}
|
|
3181
3241
|
function makeDiffCommand() {
|
|
3182
3242
|
return new Command("diff").description("Show changes between deployed and source versions").argument("<ref>", "Asset reference (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
3183
3243
|
requireProjectConfig(opts.projectDir);
|
|
3184
3244
|
const am2 = new AssetManager({
|
|
3185
3245
|
registry: getKindRegistry(),
|
|
3186
|
-
projectDir:
|
|
3246
|
+
projectDir: path19__default.resolve(opts.projectDir)
|
|
3187
3247
|
});
|
|
3188
3248
|
try {
|
|
3189
3249
|
parseAssetRef(ref);
|
|
@@ -3204,7 +3264,7 @@ function makeDiffCommand() {
|
|
|
3204
3264
|
const requirementGaps = await am2.requirementGapsOf(ref);
|
|
3205
3265
|
const blocking = gaps.filter((g) => !DIFF_SHOWS[g.type]);
|
|
3206
3266
|
if (blocking.length > 0) {
|
|
3207
|
-
for (const
|
|
3267
|
+
for (const line of uniqueMessages([...blocking, ...requirementGaps])) logErr(line);
|
|
3208
3268
|
process.exitCode = 1;
|
|
3209
3269
|
return;
|
|
3210
3270
|
}
|
|
@@ -3235,7 +3295,7 @@ function makeDiffCommand() {
|
|
|
3235
3295
|
console.log(result.diff);
|
|
3236
3296
|
break;
|
|
3237
3297
|
}
|
|
3238
|
-
for (const
|
|
3298
|
+
for (const line of uniqueMessages([...problems, ...requirementGaps])) logErr(line);
|
|
3239
3299
|
if (result.status === "not-found" || problems.length > 0 || requirementGaps.length > 0)
|
|
3240
3300
|
process.exitCode = 1;
|
|
3241
3301
|
});
|
|
@@ -3243,7 +3303,7 @@ function makeDiffCommand() {
|
|
|
3243
3303
|
function makeFlowCommand() {
|
|
3244
3304
|
const cmd = new Command("flow").description("Manage flows");
|
|
3245
3305
|
cmd.command("list").description("List the flows of this project").option("--project-dir <path>", "Project directory", process.cwd()).option("--all", "Also list the flows of registered libraries and cached sources").action(async (opts) => {
|
|
3246
|
-
const projectDir =
|
|
3306
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
3247
3307
|
const flows = discoverProjectFlows(projectDir);
|
|
3248
3308
|
const others = opts.all ? await discoverOtherFlows(projectDir) : [];
|
|
3249
3309
|
if (flows.length === 0 && others.length === 0) {
|
|
@@ -3279,7 +3339,7 @@ function makeFlowCommand() {
|
|
|
3279
3339
|
}
|
|
3280
3340
|
});
|
|
3281
3341
|
cmd.command("show <id>").description("Show flow details and node graph").option("--project-dir <path>", "Project directory", process.cwd()).option("--all", "Also look in registered libraries and cached sources").action(async (id, opts) => {
|
|
3282
|
-
const projectDir =
|
|
3342
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
3283
3343
|
const flow = discoverProjectFlows(projectDir).find((f) => f.id === id) ?? (opts.all ? (await discoverOtherFlows(projectDir)).find((o) => o.flow.id === id)?.flow : void 0);
|
|
3284
3344
|
if (!flow) {
|
|
3285
3345
|
logErr(`Flow not found: ${id}`);
|
|
@@ -3313,12 +3373,68 @@ function makeFlowCommand() {
|
|
|
3313
3373
|
cmd.action(() => cmd.help());
|
|
3314
3374
|
return cmd;
|
|
3315
3375
|
}
|
|
3376
|
+
var HARNESS_ID_OF_TARGET = {
|
|
3377
|
+
"claude-code": "claude-sdk",
|
|
3378
|
+
omp: "omp",
|
|
3379
|
+
codex: "codex"
|
|
3380
|
+
};
|
|
3381
|
+
function parseHarnessTarget(name) {
|
|
3382
|
+
if (name === "claude-sdk") return "claude-code";
|
|
3383
|
+
return SUPPORTED_HARNESSES.includes(name) ? name : void 0;
|
|
3384
|
+
}
|
|
3385
|
+
function makeHarnessCommand() {
|
|
3386
|
+
const cmd = new Command("harness").description("Choose the coding-agent harness of a project");
|
|
3387
|
+
cmd.command("set <name>").description(
|
|
3388
|
+
`Switch the project to a harness (${SUPPORTED_HARNESSES.join(" | ")}): rewrite skaile.yaml and install for it`
|
|
3389
|
+
).option("--project-dir <path>", "Project directory", process.cwd()).action(async (name, opts) => {
|
|
3390
|
+
await runHarnessSet(name, path19__default.resolve(opts.projectDir));
|
|
3391
|
+
});
|
|
3392
|
+
cmd.action(() => cmd.help());
|
|
3393
|
+
return cmd;
|
|
3394
|
+
}
|
|
3395
|
+
async function runHarnessSet(name, projectDir) {
|
|
3396
|
+
const target = parseHarnessTarget(name);
|
|
3397
|
+
if (!target) {
|
|
3398
|
+
logErr(`Unknown harness "${name}". Supported: ${SUPPORTED_HARNESSES.join(", ")}`);
|
|
3399
|
+
process.exit(1);
|
|
3400
|
+
}
|
|
3401
|
+
requireProjectConfig(projectDir);
|
|
3402
|
+
const file = path19__default.join(projectDir, "skaile.yaml");
|
|
3403
|
+
const before = resolveConfiguredHarnessName(projectDir);
|
|
3404
|
+
let editor;
|
|
3405
|
+
try {
|
|
3406
|
+
editor = WorkspaceYamlEditor.load(file);
|
|
3407
|
+
} catch (err) {
|
|
3408
|
+
logErr(err instanceof Error ? err.message : String(err));
|
|
3409
|
+
process.exit(1);
|
|
3410
|
+
}
|
|
3411
|
+
const profile = editor.getAgentConfig("default");
|
|
3412
|
+
editor.setAgentConfig("default", {
|
|
3413
|
+
agent: target,
|
|
3414
|
+
harness: HARNESS_ID_OF_TARGET[target]
|
|
3415
|
+
});
|
|
3416
|
+
editor.save();
|
|
3417
|
+
if (before === target) {
|
|
3418
|
+
logInfo(`Project is already on ${S.cmd(target)}; installing for it.`);
|
|
3419
|
+
} else {
|
|
3420
|
+
logOk(
|
|
3421
|
+
`Set ${S.cmd("agent-config.default")} to ${S.cmd(`agent: ${target}`)}, ${S.cmd(`harness: ${HARNESS_ID_OF_TARGET[target]}`)} in skaile.yaml`
|
|
3422
|
+
);
|
|
3423
|
+
}
|
|
3424
|
+
if (profile?.model) {
|
|
3425
|
+
logInfo(
|
|
3426
|
+
`model ${profile.model} is kept. Check it fits ${target}: skaile run "hi there" --dry-run`
|
|
3427
|
+
);
|
|
3428
|
+
}
|
|
3429
|
+
logInfo(`Installing for ${target} (${HARNESS_TARGETS[target].local.skill})`);
|
|
3430
|
+
await runYamlInstall({ projectDir });
|
|
3431
|
+
}
|
|
3316
3432
|
function makeHistoryCommand() {
|
|
3317
3433
|
const cmd = new Command("history").description("Show recent add/remove/update actions");
|
|
3318
3434
|
cmd.argument("[limit]", "Number of entries to show", "20").option("--project-dir <path>", "Project directory", process.cwd()).action((limitStr, opts) => {
|
|
3319
3435
|
const am2 = new AssetManager({
|
|
3320
3436
|
registry: getKindRegistry(),
|
|
3321
|
-
projectDir:
|
|
3437
|
+
projectDir: path19__default.resolve(opts.projectDir)
|
|
3322
3438
|
});
|
|
3323
3439
|
const limit = parseInt(limitStr, 10) || 20;
|
|
3324
3440
|
const entries = am2.history(limit);
|
|
@@ -3341,7 +3457,7 @@ function makeHistoryCommand() {
|
|
|
3341
3457
|
cmd.command("clear").description("Clear action history").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
3342
3458
|
const am2 = new AssetManager({
|
|
3343
3459
|
registry: getKindRegistry(),
|
|
3344
|
-
projectDir:
|
|
3460
|
+
projectDir: path19__default.resolve(opts.projectDir)
|
|
3345
3461
|
});
|
|
3346
3462
|
am2.clearHistory();
|
|
3347
3463
|
logOk("History cleared.");
|
|
@@ -3372,7 +3488,7 @@ async function readConfig(p6) {
|
|
|
3372
3488
|
}
|
|
3373
3489
|
}
|
|
3374
3490
|
async function writeConfig(p6, value) {
|
|
3375
|
-
await fs5.mkdir(
|
|
3491
|
+
await fs5.mkdir(path19__default.dirname(p6), { recursive: true });
|
|
3376
3492
|
const cleaned = {};
|
|
3377
3493
|
for (const [k, v] of Object.entries(value)) {
|
|
3378
3494
|
if (v === void 0) continue;
|
|
@@ -3381,7 +3497,7 @@ async function writeConfig(p6, value) {
|
|
|
3381
3497
|
await fs5.writeFile(p6, stringify$1(cleaned));
|
|
3382
3498
|
}
|
|
3383
3499
|
function configPath(projectDir) {
|
|
3384
|
-
return
|
|
3500
|
+
return path19__default.join(projectDir, ".codex", "config.toml");
|
|
3385
3501
|
}
|
|
3386
3502
|
async function install2(projectDir) {
|
|
3387
3503
|
const p6 = configPath(projectDir);
|
|
@@ -3392,7 +3508,7 @@ async function install2(projectDir) {
|
|
|
3392
3508
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(next);
|
|
3393
3509
|
let warning;
|
|
3394
3510
|
if (previous && !matches) {
|
|
3395
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${
|
|
3511
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${path19__default.relative(projectDir, p6)}`;
|
|
3396
3512
|
}
|
|
3397
3513
|
if (matches) return { changed: false, method: "toml" };
|
|
3398
3514
|
servers[SKAILE_MCP_NAME] = next;
|
|
@@ -3400,7 +3516,7 @@ async function install2(projectDir) {
|
|
|
3400
3516
|
return { changed: true, method: "toml", warning };
|
|
3401
3517
|
}
|
|
3402
3518
|
function userConfigPath2() {
|
|
3403
|
-
return
|
|
3519
|
+
return path19__default.join(process.env.CODEX_HOME || path19__default.join(homedir(), ".codex"), "config.toml");
|
|
3404
3520
|
}
|
|
3405
3521
|
async function readUserConfig() {
|
|
3406
3522
|
const p6 = userConfigPath2();
|
|
@@ -3442,7 +3558,7 @@ async function trustProject(projectDir) {
|
|
|
3442
3558
|
} catch {
|
|
3443
3559
|
return "refused";
|
|
3444
3560
|
}
|
|
3445
|
-
await fs5.mkdir(
|
|
3561
|
+
await fs5.mkdir(path19__default.dirname(p6), { recursive: true });
|
|
3446
3562
|
await fs5.writeFile(p6, next);
|
|
3447
3563
|
await writeTrustMark(projectDir, [
|
|
3448
3564
|
.../* @__PURE__ */ new Set([
|
|
@@ -3454,7 +3570,7 @@ async function trustProject(projectDir) {
|
|
|
3454
3570
|
}
|
|
3455
3571
|
var TRUST_MARK = "codexTrustAdded";
|
|
3456
3572
|
function stateFilePath(projectDir) {
|
|
3457
|
-
return
|
|
3573
|
+
return path19__default.join(projectDir, ".skaile", "plugin-state.json");
|
|
3458
3574
|
}
|
|
3459
3575
|
async function readState(projectDir) {
|
|
3460
3576
|
try {
|
|
@@ -3478,7 +3594,7 @@ async function writeTrustMark(projectDir, roots) {
|
|
|
3478
3594
|
const state2 = await readState(projectDir);
|
|
3479
3595
|
if (roots.length > 0) state2[TRUST_MARK] = roots;
|
|
3480
3596
|
else delete state2[TRUST_MARK];
|
|
3481
|
-
await fs5.mkdir(
|
|
3597
|
+
await fs5.mkdir(path19__default.dirname(stateFilePath(projectDir)), { recursive: true });
|
|
3482
3598
|
await fs5.writeFile(stateFilePath(projectDir), JSON.stringify(state2, null, 2));
|
|
3483
3599
|
}
|
|
3484
3600
|
async function untrustProject(projectDir) {
|
|
@@ -3576,12 +3692,12 @@ async function status2(projectDir) {
|
|
|
3576
3692
|
installed: "yes",
|
|
3577
3693
|
enabled: trusted ? "n/a" : "untrusted",
|
|
3578
3694
|
method: "mcp",
|
|
3579
|
-
location:
|
|
3695
|
+
location: path19__default.relative(projectDir, p6)
|
|
3580
3696
|
};
|
|
3581
3697
|
}
|
|
3582
3698
|
async function install3(projectDir) {
|
|
3583
|
-
const extDir =
|
|
3584
|
-
const extPath =
|
|
3699
|
+
const extDir = path19__default.join(projectDir, ".omp", "extensions");
|
|
3700
|
+
const extPath = path19__default.join(extDir, "skaile.ts");
|
|
3585
3701
|
await fs5.mkdir(extDir, { recursive: true });
|
|
3586
3702
|
const { WorkspacePlugin } = await import('../workspace-plugin/index.js');
|
|
3587
3703
|
const plugin = new WorkspacePlugin({ projectDir });
|
|
@@ -3596,7 +3712,7 @@ async function install3(projectDir) {
|
|
|
3596
3712
|
return { changed: true, method: "generated" };
|
|
3597
3713
|
}
|
|
3598
3714
|
async function uninstall3(projectDir) {
|
|
3599
|
-
const extPath =
|
|
3715
|
+
const extPath = path19__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
3600
3716
|
try {
|
|
3601
3717
|
await fs5.unlink(extPath);
|
|
3602
3718
|
return { changed: true };
|
|
@@ -3605,14 +3721,14 @@ async function uninstall3(projectDir) {
|
|
|
3605
3721
|
}
|
|
3606
3722
|
}
|
|
3607
3723
|
async function status3(projectDir) {
|
|
3608
|
-
const extPath =
|
|
3724
|
+
const extPath = path19__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
3609
3725
|
if (existsSync(extPath)) {
|
|
3610
3726
|
return {
|
|
3611
3727
|
harness: "omp",
|
|
3612
3728
|
installed: "yes",
|
|
3613
3729
|
enabled: "n/a",
|
|
3614
3730
|
method: "extension",
|
|
3615
|
-
location:
|
|
3731
|
+
location: path19__default.relative(projectDir, extPath)
|
|
3616
3732
|
};
|
|
3617
3733
|
}
|
|
3618
3734
|
return {
|
|
@@ -3627,12 +3743,15 @@ async function status3(projectDir) {
|
|
|
3627
3743
|
// cli/src/commands/integration.ts
|
|
3628
3744
|
var ALL_HARNESSES = ["claude-code", "omp", "codex"];
|
|
3629
3745
|
var TOGGLE_SUPPORTED = ["claude-code"];
|
|
3630
|
-
function
|
|
3631
|
-
if (
|
|
3632
|
-
if (
|
|
3633
|
-
logErr(`Unknown
|
|
3746
|
+
function resolveHarness(harness) {
|
|
3747
|
+
if (harness === "all") return [...ALL_HARNESSES];
|
|
3748
|
+
if (harness === "claude-code" || harness === "omp" || harness === "codex") return [harness];
|
|
3749
|
+
logErr(`Unknown harness "${harness}". Supported: ${ALL_HARNESSES.join(", ")}, all`);
|
|
3634
3750
|
return null;
|
|
3635
3751
|
}
|
|
3752
|
+
function withHarness(raw, fallback) {
|
|
3753
|
+
return foldDriverFlag(raw, fallback);
|
|
3754
|
+
}
|
|
3636
3755
|
async function runHarnessStep(label, body) {
|
|
3637
3756
|
try {
|
|
3638
3757
|
await body();
|
|
@@ -3664,15 +3783,27 @@ async function installOmp(projectDir) {
|
|
|
3664
3783
|
logInfo(`omp: already installed (${r.method})`);
|
|
3665
3784
|
}
|
|
3666
3785
|
await unignoreOmpExtension(projectDir);
|
|
3667
|
-
|
|
3786
|
+
const rule = ompExtensionIgnoreRule(projectDir, OMP_EXTENSION);
|
|
3787
|
+
if (rule) {
|
|
3668
3788
|
logWarn(
|
|
3669
|
-
`git ignores ${OMP_EXTENSION} (
|
|
3789
|
+
`git ignores ${OMP_EXTENSION} (${rule}); omp does not load an ignored extension. Remove that rule.`
|
|
3670
3790
|
);
|
|
3671
3791
|
}
|
|
3672
3792
|
console.log(` ${S.dim("\u2192")} OMP auto-discovers extensions on next startup.`);
|
|
3673
3793
|
}
|
|
3674
|
-
function
|
|
3675
|
-
|
|
3794
|
+
function ompExtensionIgnoreRule(projectDir, file) {
|
|
3795
|
+
const verbose = (p6) => {
|
|
3796
|
+
const r = spawnSync("git", ["check-ignore", "-v", p6], { cwd: projectDir, encoding: "utf-8" });
|
|
3797
|
+
return r.status === 0 ? r.stdout.trim() || void 0 : void 0;
|
|
3798
|
+
};
|
|
3799
|
+
const hit = verbose(file);
|
|
3800
|
+
if (!hit) return void 0;
|
|
3801
|
+
const dirs = [];
|
|
3802
|
+
for (let d = path19__default.posix.dirname(file); d !== "."; d = path19__default.posix.dirname(d)) dirs.push(d);
|
|
3803
|
+
if (dirs.some((d) => verbose(d) !== void 0)) return void 0;
|
|
3804
|
+
const [rule] = hit.split(" ");
|
|
3805
|
+
const m = /^(.*?):(\d+):(.*)$/.exec(rule ?? "");
|
|
3806
|
+
return m ? `${m[1]}:${m[2]}: ${m[3]}` : rule;
|
|
3676
3807
|
}
|
|
3677
3808
|
async function installCodex(projectDir) {
|
|
3678
3809
|
const r = await install2(projectDir);
|
|
@@ -3697,8 +3828,8 @@ ${await trustEntry(projectDir)}`
|
|
|
3697
3828
|
console.log(` ${S.dim("\u2192")} Restart Codex CLI to pick up the change.`);
|
|
3698
3829
|
}
|
|
3699
3830
|
async function runInstall(opts) {
|
|
3700
|
-
const projectDir =
|
|
3701
|
-
const targets =
|
|
3831
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
3832
|
+
const targets = resolveHarness(opts.harness);
|
|
3702
3833
|
if (!targets) return 1;
|
|
3703
3834
|
let exitCode = 0;
|
|
3704
3835
|
if (targets.includes("claude-code")) {
|
|
@@ -3760,8 +3891,8 @@ async function uninstallCodex(projectDir) {
|
|
|
3760
3891
|
}
|
|
3761
3892
|
}
|
|
3762
3893
|
async function runUninstall(opts) {
|
|
3763
|
-
const projectDir =
|
|
3764
|
-
const targets =
|
|
3894
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
3895
|
+
const targets = resolveHarness(opts.harness);
|
|
3765
3896
|
if (!targets) return 1;
|
|
3766
3897
|
let exitCode = 0;
|
|
3767
3898
|
if (targets.includes("claude-code")) {
|
|
@@ -3783,12 +3914,12 @@ async function runUninstall(opts) {
|
|
|
3783
3914
|
return exitCode;
|
|
3784
3915
|
}
|
|
3785
3916
|
async function removeEmptyPluginState(projectDir) {
|
|
3786
|
-
const stateFile =
|
|
3917
|
+
const stateFile = path19__default.join(projectDir, ".skaile", "plugin-state.json");
|
|
3787
3918
|
try {
|
|
3788
3919
|
const parsed = JSON.parse(await fs5.readFile(stateFile, "utf-8"));
|
|
3789
3920
|
if (typeof parsed !== "object" || parsed === null || Object.keys(parsed).length > 0) return;
|
|
3790
3921
|
await fs5.unlink(stateFile);
|
|
3791
|
-
await fs5.rmdir(
|
|
3922
|
+
await fs5.rmdir(path19__default.dirname(stateFile)).catch(() => void 0);
|
|
3792
3923
|
} catch {
|
|
3793
3924
|
}
|
|
3794
3925
|
}
|
|
@@ -3799,7 +3930,7 @@ var PER_MACHINE_FILES = {
|
|
|
3799
3930
|
};
|
|
3800
3931
|
var OMP_EXTENSION = ".omp/extensions/skaile.ts";
|
|
3801
3932
|
async function unignoreOmpExtension(projectDir) {
|
|
3802
|
-
const gitignore =
|
|
3933
|
+
const gitignore = path19__default.join(projectDir, ".gitignore");
|
|
3803
3934
|
let text;
|
|
3804
3935
|
try {
|
|
3805
3936
|
text = await fs5.readFile(gitignore, "utf-8");
|
|
@@ -3816,12 +3947,12 @@ async function unignoreOmpExtension(projectDir) {
|
|
|
3816
3947
|
}
|
|
3817
3948
|
var CLAUDE_FULL_FILES = [".claude/settings.json", ".claude/plugins/skaile/"];
|
|
3818
3949
|
async function ignorePerMachineFiles(projectDir, targets, full) {
|
|
3819
|
-
const gitignore =
|
|
3950
|
+
const gitignore = path19__default.join(projectDir, ".gitignore");
|
|
3820
3951
|
let existing = null;
|
|
3821
3952
|
try {
|
|
3822
3953
|
existing = await fs5.readFile(gitignore, "utf-8");
|
|
3823
3954
|
} catch {
|
|
3824
|
-
if (!existsSync(
|
|
3955
|
+
if (!existsSync(path19__default.join(projectDir, ".git"))) return;
|
|
3825
3956
|
}
|
|
3826
3957
|
const have = new Set((existing ?? "").split("\n").map((l) => l.trim()));
|
|
3827
3958
|
const wanted = [
|
|
@@ -3865,9 +3996,9 @@ async function toggleTarget(t, projectDir, action3) {
|
|
|
3865
3996
|
});
|
|
3866
3997
|
}
|
|
3867
3998
|
async function runToggle(opts, action3) {
|
|
3868
|
-
const projectDir =
|
|
3869
|
-
const requestedAll = opts.
|
|
3870
|
-
const targets =
|
|
3999
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
4000
|
+
const requestedAll = opts.harness === "all";
|
|
4001
|
+
const targets = resolveHarness(opts.harness);
|
|
3871
4002
|
if (!targets) return 1;
|
|
3872
4003
|
const usageError = checkToggleSupported(targets, requestedAll, action3);
|
|
3873
4004
|
if (usageError !== null) return usageError;
|
|
@@ -3878,8 +4009,8 @@ async function runToggle(opts, action3) {
|
|
|
3878
4009
|
return exitCode;
|
|
3879
4010
|
}
|
|
3880
4011
|
async function runStatus2(opts) {
|
|
3881
|
-
const projectDir =
|
|
3882
|
-
const targets =
|
|
4012
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
4013
|
+
const targets = resolveHarness(opts.harness);
|
|
3883
4014
|
if (!targets) return 1;
|
|
3884
4015
|
const rows = [];
|
|
3885
4016
|
let exitCode = 0;
|
|
@@ -3950,7 +4081,7 @@ async function runHook(event) {
|
|
|
3950
4081
|
await plugin.shutdown();
|
|
3951
4082
|
return;
|
|
3952
4083
|
}
|
|
3953
|
-
const store = new PluginStore(
|
|
4084
|
+
const store = new PluginStore(path19__default.join(projectDir, ".skaile", "plugin-state.json"));
|
|
3954
4085
|
await store.load();
|
|
3955
4086
|
const status4 = store.get("connector:status");
|
|
3956
4087
|
if (status4 && typeof status4 === "object" && Object.keys(status4).length > 0) {
|
|
@@ -4008,28 +4139,28 @@ function makeIntegrationCommand() {
|
|
|
4008
4139
|
const cmd = new Command("integration").description(
|
|
4009
4140
|
"Manage skaile agent integration / workspace-plugin adapter (Claude Code / OMP / Codex)"
|
|
4010
4141
|
);
|
|
4011
|
-
cmd.command("install").description("Install skaile workspace plugin").option("--
|
|
4142
|
+
cmd.command("install").description("Install skaile workspace plugin").option("--harness <name>", "Target: claude-code | omp | codex | all (default: all)").addOption(driverAliasOption()).option("--project-dir <path>", "Project directory", process.cwd()).option(
|
|
4012
4143
|
"--full",
|
|
4013
4144
|
"Claude Code: generate the full .claude/plugins/skaile/ directory (MCP + hooks) instead of the default MCP-only install"
|
|
4014
|
-
).action(async (
|
|
4015
|
-
process.exitCode = await runInstall(
|
|
4145
|
+
).action(async (raw) => {
|
|
4146
|
+
process.exitCode = await runInstall(withHarness(raw, "all"));
|
|
4016
4147
|
});
|
|
4017
|
-
cmd.command("uninstall").description("Uninstall skaile workspace plugin").option("--
|
|
4018
|
-
process.exitCode = await runUninstall(
|
|
4148
|
+
cmd.command("uninstall").description("Uninstall skaile workspace plugin").option("--harness <name>", "Target: claude-code | omp | codex | all (default: all)").addOption(driverAliasOption()).option("--project-dir <path>", "Project directory", process.cwd()).action(async (raw) => {
|
|
4149
|
+
process.exitCode = await runUninstall(withHarness(raw, "all"));
|
|
4019
4150
|
});
|
|
4020
|
-
cmd.command("enable").description("Enable an installed plugin (claude-code only)").option("--
|
|
4021
|
-
process.exitCode = await runToggle(
|
|
4151
|
+
cmd.command("enable").description("Enable an installed plugin (claude-code only)").option("--harness <name>", "Target: claude-code | all (default: claude-code)").addOption(driverAliasOption()).option("--project-dir <path>", "Project directory", process.cwd()).action(async (raw) => {
|
|
4152
|
+
process.exitCode = await runToggle(withHarness(raw, "claude-code"), "enable");
|
|
4022
4153
|
});
|
|
4023
|
-
cmd.command("disable").description("Disable an installed plugin (claude-code only)").option("--
|
|
4024
|
-
process.exitCode = await runToggle(
|
|
4154
|
+
cmd.command("disable").description("Disable an installed plugin (claude-code only)").option("--harness <name>", "Target: claude-code | all (default: claude-code)").addOption(driverAliasOption()).option("--project-dir <path>", "Project directory", process.cwd()).action(async (raw) => {
|
|
4155
|
+
process.exitCode = await runToggle(withHarness(raw, "claude-code"), "disable");
|
|
4025
4156
|
});
|
|
4026
|
-
cmd.command("status").description("Show install / enable status across harnesses").option("--
|
|
4027
|
-
process.exitCode = await runStatus2(
|
|
4157
|
+
cmd.command("status").description("Show install / enable status across harnesses").option("--harness <name>", "Target: claude-code | omp | codex | all (default: all)").addOption(driverAliasOption()).option("--project-dir <path>", "Project directory", process.cwd()).action(async (raw) => {
|
|
4158
|
+
process.exitCode = await runStatus2(withHarness(raw, "all"));
|
|
4028
4159
|
});
|
|
4029
4160
|
cmd.command("omp-exec <kind> <name>").description(
|
|
4030
4161
|
"Run one tool or slash command of the omp extension (used by .omp/extensions/skaile.ts)"
|
|
4031
4162
|
).option("--project-dir <path>", "Project directory", process.cwd()).action(async (kind, name, opts) => {
|
|
4032
|
-
process.exitCode = await runOmpExec(kind, name,
|
|
4163
|
+
process.exitCode = await runOmpExec(kind, name, path19__default.resolve(opts.projectDir));
|
|
4033
4164
|
});
|
|
4034
4165
|
cmd.command("hook <event>").description(
|
|
4035
4166
|
"Run a Claude Code lifecycle hook (session-start | session-end | user-prompt-submit)"
|
|
@@ -4072,7 +4203,7 @@ function unfinishedGitState(dir) {
|
|
|
4072
4203
|
for (const [entry, state2] of Object.entries(UNFINISHED_GIT_ENTRIES)) {
|
|
4073
4204
|
const p6 = spawnSync("git", ["rev-parse", "--git-path", entry], { cwd: dir, encoding: "utf-8" });
|
|
4074
4205
|
if (p6.status !== 0) return "the git directory could not be read";
|
|
4075
|
-
if (fs8.existsSync(
|
|
4206
|
+
if (fs8.existsSync(path19.resolve(dir, p6.stdout.trim()))) return state2;
|
|
4076
4207
|
}
|
|
4077
4208
|
return null;
|
|
4078
4209
|
}
|
|
@@ -4080,7 +4211,7 @@ async function reindexLibrary(lib, library, name) {
|
|
|
4080
4211
|
assertManifestEditableOrExit(lib.path);
|
|
4081
4212
|
exitOnManifestPublisherProblems(lib.path, name);
|
|
4082
4213
|
exitOnLibrarySymlinks(lib.path, `skaile library index ${name}`);
|
|
4083
|
-
|
|
4214
|
+
exitOnManifestPathProblems(lib.path, `skaile library index ${name}`);
|
|
4084
4215
|
const badRequires = manifestRequiresProblems(lib.path);
|
|
4085
4216
|
const resolved = resolveLibraryPublisherDetailed(lib, {}, getStoreIdentity());
|
|
4086
4217
|
warnLibraryNameFallback(name, resolved);
|
|
@@ -4097,7 +4228,7 @@ async function reindexLibrary(lib, library, name) {
|
|
|
4097
4228
|
{
|
|
4098
4229
|
check: (e) => checkAssetFile(e.source, e.kind, registry, lib.path, composeRefs),
|
|
4099
4230
|
// A flow the engine would never load under its id (p871): keep it out of the manifest and the index.
|
|
4100
|
-
refuse: (e) => e.kind === "flow" && flowFileNameError({ id: e.name },
|
|
4231
|
+
refuse: (e) => e.kind === "flow" && flowFileNameError({ id: e.name }, path19.basename(e.source)) !== void 0
|
|
4101
4232
|
}
|
|
4102
4233
|
);
|
|
4103
4234
|
const manifest = loadSkPublishManifest(lib.path);
|
|
@@ -4118,7 +4249,7 @@ async function reindexLibrary(lib, library, name) {
|
|
|
4118
4249
|
}
|
|
4119
4250
|
const invalidVersion = skipped.filter((x) => x.reason === "invalid-version");
|
|
4120
4251
|
for (const s of invalidVersion) {
|
|
4121
|
-
const found = checkAssetFile(
|
|
4252
|
+
const found = checkAssetFile(path19.join(lib.path, s.file), s.kind, registry).find(
|
|
4122
4253
|
(f) => f.text.startsWith("version ")
|
|
4123
4254
|
);
|
|
4124
4255
|
const detail = found?.text ?? s.detail;
|
|
@@ -4129,28 +4260,36 @@ async function reindexLibrary(lib, library, name) {
|
|
|
4129
4260
|
}
|
|
4130
4261
|
const duplicates = skipped.filter((x) => x.reason === "duplicate");
|
|
4131
4262
|
for (const s of duplicates) {
|
|
4132
|
-
logErr(duplicateAssetMessage(s.kind, s.name,
|
|
4263
|
+
logErr(duplicateAssetMessage(s.kind, s.name, path19.dirname(s.file), s.detail, name));
|
|
4133
4264
|
}
|
|
4134
4265
|
for (const s of failed) {
|
|
4135
4266
|
for (const f of s.findings) logErr(`${s.file} [${f.tag}] \u2014 ${f.text}`);
|
|
4136
4267
|
}
|
|
4137
|
-
const duplicateFiles = new Set(duplicates.map((s) =>
|
|
4268
|
+
const duplicateFiles = new Set(duplicates.map((s) => path19.resolve(lib.path, s.file)));
|
|
4138
4269
|
const skippedKeys = new Set(
|
|
4139
4270
|
[
|
|
4140
4271
|
...skipped.filter((s) => s.reason !== "duplicate"),
|
|
4141
4272
|
...failed.filter((s) => !s.inManifest)
|
|
4142
4273
|
].map((s) => `${s.kind}:${s.name}`)
|
|
4143
4274
|
);
|
|
4275
|
+
const refusedFiles = new Set(
|
|
4276
|
+
[
|
|
4277
|
+
...skipped.filter((s) => s.reason !== "duplicate"),
|
|
4278
|
+
...failed.filter((s) => !s.inManifest)
|
|
4279
|
+
].map((s) => path19.resolve(lib.path, s.file))
|
|
4280
|
+
);
|
|
4144
4281
|
const res = await indexLibrary(lib, library, {
|
|
4145
|
-
exclude: (a) => skippedKeys.has(`${a.kind}:${a.name}`) || duplicateFiles.has(
|
|
4282
|
+
exclude: (a) => skippedKeys.has(`${a.kind}:${a.name}`) || duplicateFiles.has(path19.resolve(a.manifestPath)) || refusedFiles.has(path19.resolve(a.manifestPath))
|
|
4146
4283
|
});
|
|
4147
4284
|
const unparsable = res.unparsable;
|
|
4148
4285
|
for (const e of res.errors) (unparsable.includes(e) ? logErr : logWarn)(e);
|
|
4149
4286
|
const syncUnparsable = skipped.filter(
|
|
4150
|
-
(s) => s.reason === "unparsable" && !unparsable.some((e) => e.
|
|
4287
|
+
(s) => s.reason === "unparsable" && !unparsable.some((e) => e.startsWith(`${s.file} `))
|
|
4151
4288
|
);
|
|
4152
4289
|
for (const s of syncUnparsable) {
|
|
4153
|
-
logErr(
|
|
4290
|
+
logErr(
|
|
4291
|
+
manifestParseFailureLine(lib.path, s.file) ?? `${s.file} [${s.kind}] \u2014 ${manifestParseErrorText("the manifest file could not be read")}`
|
|
4292
|
+
);
|
|
4154
4293
|
}
|
|
4155
4294
|
for (const p6 of badRequires) logErr(`${p6.asset}: ${p6.message}`);
|
|
4156
4295
|
for (const w of await unresolvedManifestDependencies(lib.path)) logWarn(w);
|
|
@@ -4160,7 +4299,7 @@ async function reindexLibrary(lib, library, name) {
|
|
|
4160
4299
|
const file = findEntryManifestFile(lib.path, a);
|
|
4161
4300
|
if (!file) continue;
|
|
4162
4301
|
for (const f of unheldRequiresOfFile(file, a.kind, composeRefs)) {
|
|
4163
|
-
logWarn(`${
|
|
4302
|
+
logWarn(`${path19.relative(lib.path, file)} [${f.tag}] \u2014 ${f.text}`);
|
|
4164
4303
|
}
|
|
4165
4304
|
}
|
|
4166
4305
|
const skippedUnparsable = unparsable.length + syncUnparsable.length;
|
|
@@ -4220,23 +4359,60 @@ function assertManifestEditableOrExit(libraryPath) {
|
|
|
4220
4359
|
}
|
|
4221
4360
|
var DEPLOYED_COPY_DIRS = [
|
|
4222
4361
|
...new Set(
|
|
4223
|
-
Object.values(
|
|
4362
|
+
Object.values(HARNESS_TARGETS).flatMap(
|
|
4224
4363
|
(t) => Object.values(t.local).filter((d) => typeof d === "string")
|
|
4225
4364
|
)
|
|
4226
4365
|
)
|
|
4227
4366
|
];
|
|
4367
|
+
var DEPLOY_ROOT_FOLDERS = new Set(
|
|
4368
|
+
DEPLOYED_COPY_DIRS.map((d) => d.split("/")[0])
|
|
4369
|
+
);
|
|
4370
|
+
function deployFolderBelowProject(dir) {
|
|
4371
|
+
const real = canonicalDir(dir);
|
|
4372
|
+
const home = (() => {
|
|
4373
|
+
try {
|
|
4374
|
+
return fs8.realpathSync(os.homedir());
|
|
4375
|
+
} catch {
|
|
4376
|
+
return void 0;
|
|
4377
|
+
}
|
|
4378
|
+
})();
|
|
4379
|
+
for (let cur = real; path19.dirname(cur) !== cur; cur = path19.dirname(cur)) {
|
|
4380
|
+
const project = path19.dirname(cur);
|
|
4381
|
+
const folder = path19.basename(cur);
|
|
4382
|
+
if (!DEPLOY_ROOT_FOLDERS.has(folder) || project === home) continue;
|
|
4383
|
+
const isProject = fs8.existsSync(path19.join(project, "skaile.yaml")) || DEPLOYED_COPY_DIRS.some((d) => {
|
|
4384
|
+
const full = path19.join(project, d);
|
|
4385
|
+
try {
|
|
4386
|
+
return fs8.statSync(full).isDirectory() && fs8.readdirSync(full).length > 0;
|
|
4387
|
+
} catch {
|
|
4388
|
+
return false;
|
|
4389
|
+
}
|
|
4390
|
+
});
|
|
4391
|
+
if (isProject) return { folder, project };
|
|
4392
|
+
}
|
|
4393
|
+
return void 0;
|
|
4394
|
+
}
|
|
4395
|
+
function refuseDeployFolder(dir, force = false) {
|
|
4396
|
+
const deployFolder = force ? void 0 : deployFolderBelowProject(dir);
|
|
4397
|
+
if (!deployFolder) return;
|
|
4398
|
+
logErr(
|
|
4399
|
+
`${dir} is inside the deploy folder ${deployFolder.folder}/ of the project ${deployFolder.project}: a library holds asset sources, not the copies \`skaile add\` deployed. Pick another --path for the library, or pass --force when the sources live in that folder.`
|
|
4400
|
+
);
|
|
4401
|
+
process.exit(1);
|
|
4402
|
+
}
|
|
4228
4403
|
async function refuseUnusableLibraryDir(dir, force = false) {
|
|
4229
4404
|
const deployed = DEPLOYED_COPY_DIRS.filter((d) => {
|
|
4230
|
-
const full =
|
|
4405
|
+
const full = path19.join(dir, d);
|
|
4231
4406
|
return fs8.existsSync(full) && fs8.statSync(full).isDirectory() && fs8.readdirSync(full).length > 0;
|
|
4232
4407
|
});
|
|
4233
4408
|
if (deployed.length > 0 && !force) {
|
|
4234
|
-
const where = fs8.existsSync(
|
|
4409
|
+
const where = fs8.existsSync(path19.join(dir, "skaile.yaml")) ? "skaile.yaml with deployed copies" : "deployed copies";
|
|
4235
4410
|
logErr(
|
|
4236
4411
|
`${dir} is a project folder (${where} in ${deployed.map((d) => `${d}/`).join(", ")}): a library holds asset sources, not the copies \`skaile add\` deployed. Pick another --path for the library, or pass --force when the sources live in those folders.`
|
|
4237
4412
|
);
|
|
4238
4413
|
process.exit(1);
|
|
4239
4414
|
}
|
|
4415
|
+
refuseDeployFolder(dir, force);
|
|
4240
4416
|
assertManifestEditableOrExit(dir);
|
|
4241
4417
|
const unparsable = await unparsableAssetFiles(dir, getKindRegistry());
|
|
4242
4418
|
if (unparsable.length > 0) {
|
|
@@ -4248,26 +4424,26 @@ async function refuseUnusableLibraryDir(dir, force = false) {
|
|
|
4248
4424
|
}
|
|
4249
4425
|
async function assertLibraryPathFree(manager, dir, exceptId) {
|
|
4250
4426
|
const clash = (await manager.listLibraries()).find(
|
|
4251
|
-
(l) => l.id !== exceptId &&
|
|
4427
|
+
(l) => l.id !== exceptId && path19.resolve(l.path) === dir
|
|
4252
4428
|
);
|
|
4253
4429
|
if (clash) throw new Error(`${dir} is already registered as library "${clash.name}".`);
|
|
4254
4430
|
}
|
|
4255
4431
|
function canonicalDir(dir) {
|
|
4256
|
-
const abs =
|
|
4432
|
+
const abs = path19.resolve(dir);
|
|
4257
4433
|
const missing = [];
|
|
4258
4434
|
let existing = abs;
|
|
4259
4435
|
while (!fs8.existsSync(existing)) {
|
|
4260
|
-
const parent =
|
|
4436
|
+
const parent = path19.dirname(existing);
|
|
4261
4437
|
if (parent === existing) return abs;
|
|
4262
|
-
missing.unshift(
|
|
4438
|
+
missing.unshift(path19.basename(existing));
|
|
4263
4439
|
existing = parent;
|
|
4264
4440
|
}
|
|
4265
|
-
return
|
|
4441
|
+
return path19.join(fs8.realpathSync(existing), ...missing);
|
|
4266
4442
|
}
|
|
4267
4443
|
function refuseGlobalInstallFolder(name, dir) {
|
|
4268
4444
|
const reserved = globalInstallDir();
|
|
4269
|
-
const rel =
|
|
4270
|
-
const inside = rel === "" || !rel.startsWith("..") && !
|
|
4445
|
+
const rel = path19.relative(canonicalDir(reserved).toLowerCase(), canonicalDir(dir).toLowerCase());
|
|
4446
|
+
const inside = rel === "" || !rel.startsWith("..") && !path19.isAbsolute(rel);
|
|
4271
4447
|
if (name?.toLowerCase() === GLOBAL_INSTALL_DIR_NAME || inside) {
|
|
4272
4448
|
logErr(
|
|
4273
4449
|
`"${GLOBAL_INSTALL_DIR_NAME}" is reserved: ${reserved} holds assets from \`skaile install\`, not a library you author.`
|
|
@@ -4277,8 +4453,8 @@ function refuseGlobalInstallFolder(name, dir) {
|
|
|
4277
4453
|
}
|
|
4278
4454
|
async function refuseNestedLibraryPath(manager, dir, exceptId) {
|
|
4279
4455
|
const within = (parent, child) => {
|
|
4280
|
-
const rel =
|
|
4281
|
-
return rel === "" || !rel.startsWith("..") && !
|
|
4456
|
+
const rel = path19.relative(parent, child);
|
|
4457
|
+
return rel === "" || !rel.startsWith("..") && !path19.isAbsolute(rel);
|
|
4282
4458
|
};
|
|
4283
4459
|
const target = canonicalDir(dir).toLowerCase();
|
|
4284
4460
|
const librariesDir = resolveLibraryDir();
|
|
@@ -4315,7 +4491,7 @@ function assertCreateDirInsideLibrary(libRoot, destDir, given) {
|
|
|
4315
4491
|
}
|
|
4316
4492
|
};
|
|
4317
4493
|
let probe = destDir;
|
|
4318
|
-
while (!exists(probe)) probe =
|
|
4494
|
+
while (!exists(probe)) probe = path19.dirname(probe);
|
|
4319
4495
|
let realProbe;
|
|
4320
4496
|
try {
|
|
4321
4497
|
realProbe = fs8.realpathSync(probe);
|
|
@@ -4328,19 +4504,19 @@ function assertCreateDirInsideLibrary(libRoot, destDir, given) {
|
|
|
4328
4504
|
process.exit(1);
|
|
4329
4505
|
}
|
|
4330
4506
|
const realRoot = canonicalDir(libRoot);
|
|
4331
|
-
const realDest =
|
|
4332
|
-
const rel =
|
|
4333
|
-
if (rel === ".." || rel.startsWith(`..${
|
|
4507
|
+
const realDest = path19.join(realProbe, path19.relative(probe, destDir));
|
|
4508
|
+
const rel = path19.relative(realRoot, realDest);
|
|
4509
|
+
if (rel === ".." || rel.startsWith(`..${path19.sep}`) || path19.isAbsolute(rel)) {
|
|
4334
4510
|
logErr(
|
|
4335
4511
|
`--dir "${given}" must stay inside the library (${realRoot}): it resolves to ${realDest}.`
|
|
4336
4512
|
);
|
|
4337
4513
|
process.exit(1);
|
|
4338
4514
|
}
|
|
4339
|
-
const relParts =
|
|
4340
|
-
let walked =
|
|
4515
|
+
const relParts = path19.relative(path19.resolve(libRoot), path19.resolve(destDir)).split(path19.sep);
|
|
4516
|
+
let walked = path19.resolve(libRoot);
|
|
4341
4517
|
for (const [i, part] of relParts.entries()) {
|
|
4342
4518
|
if (part === "" || part === ".") continue;
|
|
4343
|
-
walked =
|
|
4519
|
+
walked = path19.join(walked, part);
|
|
4344
4520
|
if (!exists(walked)) break;
|
|
4345
4521
|
if (fs8.lstatSync(walked).isSymbolicLink()) {
|
|
4346
4522
|
logErr(
|
|
@@ -4354,7 +4530,7 @@ function assertCreateDirInsideLibrary(libRoot, destDir, given) {
|
|
|
4354
4530
|
}
|
|
4355
4531
|
}
|
|
4356
4532
|
function adoptWritesManifest(libPath) {
|
|
4357
|
-
if (!fs8.existsSync(
|
|
4533
|
+
if (!fs8.existsSync(path19.join(libPath, SKAILE_MANIFEST_FILENAME))) return true;
|
|
4358
4534
|
const manifest = loadSkPublishManifest(libPath);
|
|
4359
4535
|
if (!manifest || manifest.source || (manifest.assets ?? []).length > 0) return false;
|
|
4360
4536
|
return manifestPublisherProblems(libPath).length === 0;
|
|
@@ -4408,13 +4584,13 @@ function requireValidLibraryName(name) {
|
|
|
4408
4584
|
var LOCAL_OWNERSHIP_REASON = "ownership only governs sync with a git remote, and a local library is always owned by you.";
|
|
4409
4585
|
function pruneEmptyLibraryParents(libPath) {
|
|
4410
4586
|
const root = canonicalDir(resolveLibraryDir());
|
|
4411
|
-
let dir =
|
|
4587
|
+
let dir = path19.dirname(path19.resolve(libPath));
|
|
4412
4588
|
for (; ; ) {
|
|
4413
|
-
const rel =
|
|
4414
|
-
if (rel === "" || rel.startsWith("..") ||
|
|
4589
|
+
const rel = path19.relative(root, canonicalDir(dir));
|
|
4590
|
+
if (rel === "" || rel.startsWith("..") || path19.isAbsolute(rel)) return;
|
|
4415
4591
|
if (!fs8.existsSync(dir) || fs8.readdirSync(dir).length > 0) return;
|
|
4416
4592
|
fs8.rmdirSync(dir);
|
|
4417
|
-
dir =
|
|
4593
|
+
dir = path19.dirname(dir);
|
|
4418
4594
|
}
|
|
4419
4595
|
}
|
|
4420
4596
|
function remoteBranches(url) {
|
|
@@ -4427,7 +4603,7 @@ function remoteBranches(url) {
|
|
|
4427
4603
|
return r.stdout.split("\n").map((line) => line.split(" ")[1]?.replace(/^refs\/heads\//, "")).filter((b) => !!b);
|
|
4428
4604
|
}
|
|
4429
4605
|
async function warnIfNotGithubRemote(name, url) {
|
|
4430
|
-
const { isGithubRemote, notGithubRemoteMessage } = await import('../library-publish-
|
|
4606
|
+
const { isGithubRemote, notGithubRemoteMessage } = await import('../library-publish-I3UWXAHI.js');
|
|
4431
4607
|
if (!isGithubRemote(url)) logWarn(notGithubRemoteMessage(name, url));
|
|
4432
4608
|
}
|
|
4433
4609
|
function scaffoldLibraryFiles(dir, name) {
|
|
@@ -4459,7 +4635,7 @@ by the same ref.
|
|
|
4459
4635
|
];
|
|
4460
4636
|
const written = [];
|
|
4461
4637
|
for (const [file, content] of files) {
|
|
4462
|
-
const target =
|
|
4638
|
+
const target = path19.join(dir, file);
|
|
4463
4639
|
if (fs8.existsSync(target)) continue;
|
|
4464
4640
|
fs8.writeFileSync(target, content, "utf8");
|
|
4465
4641
|
written.push(file);
|
|
@@ -4494,7 +4670,7 @@ function makeLibraryCommand() {
|
|
|
4494
4670
|
for (const l of ls) {
|
|
4495
4671
|
const def = l.isDefault ? pc5.green("\u25B8 ") : " ";
|
|
4496
4672
|
console.log(
|
|
4497
|
-
`${def}${S.cmd(l.name.padEnd(nameW))} ${pc5.dim(l.backend.padEnd(backendW))} ${pc5.dim(l.ownership.padEnd(ownerW))} ${pc5.dim(l.path)}`
|
|
4673
|
+
`${def}${S.cmd(l.name.padEnd(nameW))} ${pc5.dim(l.backend.padEnd(backendW))} ${pc5.dim(l.ownership.padEnd(ownerW))} ${pc5.dim(l.path)}${libraryDirMissing(l) ? ` ${pc5.red("(directory missing)")}` : ""}`
|
|
4498
4674
|
);
|
|
4499
4675
|
}
|
|
4500
4676
|
console.log(`
|
|
@@ -4516,6 +4692,11 @@ function makeLibraryCommand() {
|
|
|
4516
4692
|
const { manager, close } = await openLibraryManager();
|
|
4517
4693
|
try {
|
|
4518
4694
|
const l = await manager.requireLibrary(name);
|
|
4695
|
+
if (libraryDirMissing(l)) {
|
|
4696
|
+
logErr(missingLibraryDirMessage(l));
|
|
4697
|
+
process.exitCode = 1;
|
|
4698
|
+
return;
|
|
4699
|
+
}
|
|
4519
4700
|
console.log();
|
|
4520
4701
|
console.log(S.heading(` ${l.name}`));
|
|
4521
4702
|
console.log(` ${S.rule(50)}`);
|
|
@@ -4527,10 +4708,6 @@ function makeLibraryCommand() {
|
|
|
4527
4708
|
console.log(` ${S.label("manifestGen")} ${l.manifestGenerated}`);
|
|
4528
4709
|
console.log(` ${S.label("backendConfig")} ${JSON.stringify(l.backendConfig)}`);
|
|
4529
4710
|
console.log();
|
|
4530
|
-
if (libraryDirMissing(l)) {
|
|
4531
|
-
logErr(missingLibraryDirMessage(l));
|
|
4532
|
-
process.exitCode = 1;
|
|
4533
|
-
}
|
|
4534
4711
|
} finally {
|
|
4535
4712
|
close();
|
|
4536
4713
|
}
|
|
@@ -4552,7 +4729,7 @@ function makeLibraryCommand() {
|
|
|
4552
4729
|
opts.path ??= gone.path;
|
|
4553
4730
|
}
|
|
4554
4731
|
const ownership = flagged[0] ?? gone?.ownership ?? "owner";
|
|
4555
|
-
const libPath = opts.path ?
|
|
4732
|
+
const libPath = opts.path ? path19.resolve(opts.path) : path19.join(resolveLibraryDir(), name);
|
|
4556
4733
|
refuseGlobalInstallFolder(name, libPath);
|
|
4557
4734
|
if (fs8.existsSync(libPath) && !fs8.statSync(libPath).isDirectory()) {
|
|
4558
4735
|
logErr(`${libPath} exists and is not a directory.`);
|
|
@@ -4578,6 +4755,8 @@ function makeLibraryCommand() {
|
|
|
4578
4755
|
if (fs8.existsSync(libPath)) {
|
|
4579
4756
|
exitOnLibrarySymlinks(libPath, `skaile library init ${name} --path ${libPath}`);
|
|
4580
4757
|
await refuseUnusableLibraryDir(libPath, opts.force);
|
|
4758
|
+
} else {
|
|
4759
|
+
refuseDeployFolder(libPath, opts.force);
|
|
4581
4760
|
}
|
|
4582
4761
|
const hasDefault = (await manager.listLibraries()).some((l) => l.isDefault);
|
|
4583
4762
|
let backend = "local";
|
|
@@ -4744,10 +4923,10 @@ function makeLibraryCommand() {
|
|
|
4744
4923
|
exitOnManifestPublisherProblems(target.path, target.name);
|
|
4745
4924
|
const effectiveKind = opts.kind ?? kind;
|
|
4746
4925
|
const am2 = new AssetManager({ registry: getKindRegistry(), projectDir: process.cwd() });
|
|
4747
|
-
const libRoot =
|
|
4748
|
-
const destDir = opts.dir ?
|
|
4749
|
-
const relDest =
|
|
4750
|
-
if (relDest === ".." || relDest.startsWith(`..${
|
|
4926
|
+
const libRoot = path19.resolve(target.path);
|
|
4927
|
+
const destDir = opts.dir ? path19.resolve(libRoot, opts.dir) : libRoot;
|
|
4928
|
+
const relDest = path19.relative(libRoot, destDir);
|
|
4929
|
+
if (relDest === ".." || relDest.startsWith(`..${path19.sep}`) || path19.isAbsolute(relDest)) {
|
|
4751
4930
|
logErr(`--dir "${opts.dir}" must stay inside the library (${libRoot}).`);
|
|
4752
4931
|
process.exit(1);
|
|
4753
4932
|
}
|
|
@@ -4756,21 +4935,21 @@ function makeLibraryCommand() {
|
|
|
4756
4935
|
libRoot,
|
|
4757
4936
|
effectiveKind,
|
|
4758
4937
|
name,
|
|
4759
|
-
|
|
4938
|
+
path19.relative(libRoot, path19.join(destDir, name))
|
|
4760
4939
|
);
|
|
4761
4940
|
if (taken) {
|
|
4762
4941
|
logErr(
|
|
4763
|
-
`${effectiveKind}:${name} already exists at "${taken}" \u2014 creating it again under "${
|
|
4942
|
+
`${effectiveKind}:${name} already exists at "${taken}" \u2014 creating it again under "${path19.relative(libRoot, destDir) || "."}" would re-point the manifest entry. Pick another name.`
|
|
4764
4943
|
);
|
|
4765
4944
|
process.exit(1);
|
|
4766
4945
|
}
|
|
4767
|
-
const wanted =
|
|
4946
|
+
const wanted = path19.relative(libRoot, path19.join(destDir, name));
|
|
4768
4947
|
const onDisk = (await scanUnlistedAssets(libRoot, target.name, getKindRegistry())).find(
|
|
4769
4948
|
(u) => u.entry.kind === effectiveKind && u.entry.name === name && u.root !== wanted
|
|
4770
4949
|
);
|
|
4771
4950
|
if (onDisk) {
|
|
4772
4951
|
logErr(
|
|
4773
|
-
`${effectiveKind}:${name} already exists at "${onDisk.root}" (not in the manifest yet) \u2014 creating it again under "${
|
|
4952
|
+
`${effectiveKind}:${name} already exists at "${onDisk.root}" (not in the manifest yet) \u2014 creating it again under "${path19.relative(libRoot, destDir) || "."}" would be a duplicate. Run \`skaile library index ${target.name}\` first or pick another name.`
|
|
4774
4953
|
);
|
|
4775
4954
|
process.exit(1);
|
|
4776
4955
|
}
|
|
@@ -4820,6 +4999,12 @@ function makeLibraryCommand() {
|
|
|
4820
4999
|
cmd.command("default <name>").description("Set <name> as the default library").action(async (name) => {
|
|
4821
5000
|
const { manager, close } = await openLibraryManager();
|
|
4822
5001
|
try {
|
|
5002
|
+
const lib = await manager.requireLibrary(name);
|
|
5003
|
+
if (libraryDirMissing(lib)) {
|
|
5004
|
+
logErr(missingLibraryDirMessage(lib));
|
|
5005
|
+
process.exitCode = 1;
|
|
5006
|
+
return;
|
|
5007
|
+
}
|
|
4823
5008
|
const updated = await manager.setDefault(name);
|
|
4824
5009
|
logOk(`Default \u2192 ${updated.name}`);
|
|
4825
5010
|
} finally {
|
|
@@ -4836,7 +5021,7 @@ function makeLibraryCommand() {
|
|
|
4836
5021
|
logErr(`A library named "${newName}" is already registered.`);
|
|
4837
5022
|
process.exit(1);
|
|
4838
5023
|
}
|
|
4839
|
-
const newPath =
|
|
5024
|
+
const newPath = path19.join(path19.dirname(lib.path), newName);
|
|
4840
5025
|
refuseGlobalInstallFolder(newName, newPath);
|
|
4841
5026
|
if (fs8.existsSync(newPath)) {
|
|
4842
5027
|
logErr(`Target directory already exists: ${newPath}`);
|
|
@@ -4929,7 +5114,7 @@ function makeLibraryCommand() {
|
|
|
4929
5114
|
}
|
|
4930
5115
|
patch.isDefault = false;
|
|
4931
5116
|
} else if (field === "path") {
|
|
4932
|
-
const dir =
|
|
5117
|
+
const dir = path19.resolve(value);
|
|
4933
5118
|
if (!fs8.existsSync(dir) || !fs8.statSync(dir).isDirectory()) {
|
|
4934
5119
|
logErr(`Directory does not exist: ${dir}. \`library set path=\` does not move files.`);
|
|
4935
5120
|
process.exit(1);
|
|
@@ -5149,16 +5334,16 @@ function makeLibraryCommand() {
|
|
|
5149
5334
|
"With --create-repo: create the repo private (the store only accepts public repos)"
|
|
5150
5335
|
).option("--ref <gitref>", "Git ref to ingest (default: the library branch or main)").option("--dry-run", "Print the plan; push nothing and call no store endpoint").action(
|
|
5151
5336
|
async (lib, opts) => {
|
|
5152
|
-
const { runLibraryPublish } = await import('../library-publish-
|
|
5337
|
+
const { runLibraryPublish } = await import('../library-publish-I3UWXAHI.js');
|
|
5153
5338
|
await withStoreErrorHandling(() => runLibraryPublish(lib, opts));
|
|
5154
5339
|
}
|
|
5155
5340
|
);
|
|
5156
5341
|
cmd.command("register <lib>").description("Register the library's manifest without pushing (bytes already on github)").option("--asset <ref>", "Publish only the single asset matching this ref/name").option("--ref <gitref>", "Git ref to ingest (default: the library branch or main)").option("--dry-run", "Print the plan; call no store endpoint").action(async (lib, opts) => {
|
|
5157
|
-
const { runLibraryRegister } = await import('../library-publish-
|
|
5342
|
+
const { runLibraryRegister } = await import('../library-publish-I3UWXAHI.js');
|
|
5158
5343
|
await withStoreErrorHandling(() => runLibraryRegister(lib, opts));
|
|
5159
5344
|
});
|
|
5160
5345
|
cmd.command("yank <lib>").description("Retract the library's published assets from the store").option("--asset <ref>", "Yank only the single asset matching this ref/name").action(async (lib, opts) => {
|
|
5161
|
-
const { runLibraryYank } = await import('../library-publish-
|
|
5346
|
+
const { runLibraryYank } = await import('../library-publish-I3UWXAHI.js');
|
|
5162
5347
|
await withStoreErrorHandling(() => runLibraryYank(lib, opts));
|
|
5163
5348
|
});
|
|
5164
5349
|
return cmd;
|
|
@@ -5209,9 +5394,9 @@ async function printOverallStatus(projectDir, asJson) {
|
|
|
5209
5394
|
} catch {
|
|
5210
5395
|
secretsStrategy = "unavailable";
|
|
5211
5396
|
}
|
|
5212
|
-
const resolvedProjectDir =
|
|
5213
|
-
const hasWorkspaceConfig = existsSync(
|
|
5214
|
-
const hasLockFile = existsSync(
|
|
5397
|
+
const resolvedProjectDir = path19.resolve(projectDir);
|
|
5398
|
+
const hasWorkspaceConfig = existsSync(path19.join(resolvedProjectDir, "skaile.yaml"));
|
|
5399
|
+
const hasLockFile = existsSync(path19.join(resolvedProjectDir, "skaile.lock.yaml"));
|
|
5215
5400
|
let assignments = [];
|
|
5216
5401
|
if (hasWorkspaceConfig) {
|
|
5217
5402
|
try {
|
|
@@ -5308,7 +5493,7 @@ function colorLine(line) {
|
|
|
5308
5493
|
if (/error|Error|ERROR|failed|Failed/.test(line)) return pc5.red(line);
|
|
5309
5494
|
if (/connector|MCP|tool/.test(line)) return pc5.yellow(line);
|
|
5310
5495
|
if (/rebuilt|registered|ready/.test(line)) return pc5.green(line);
|
|
5311
|
-
if (/\[
|
|
5496
|
+
if (/\[harness\]/.test(line)) return pc5.cyan(line);
|
|
5312
5497
|
if (/\[serve\]/.test(line)) return pc5.dim(line);
|
|
5313
5498
|
return line;
|
|
5314
5499
|
}
|
|
@@ -5818,7 +6003,7 @@ function scheduleSoftDepPreview() {
|
|
|
5818
6003
|
}
|
|
5819
6004
|
async function loadAssets() {
|
|
5820
6005
|
softDepPreviewCache.clear();
|
|
5821
|
-
const { gatherAssetFeeds } = await import('../asset-feeds-
|
|
6006
|
+
const { gatherAssetFeeds } = await import('../asset-feeds-HJFV7UPW.js');
|
|
5822
6007
|
const { entries, notes } = await gatherAssetFeeds(am, am.projectDir);
|
|
5823
6008
|
if (notes.length > 0) {
|
|
5824
6009
|
state.message = notes.map((n) => `[${n.feed}] ${n.message}`).join(" \u2022 ");
|
|
@@ -5826,7 +6011,7 @@ async function loadAssets() {
|
|
|
5826
6011
|
const installed = new Set(am.listDeployed().map((e) => `${e.kind}:${e.name}`));
|
|
5827
6012
|
let lock = null;
|
|
5828
6013
|
try {
|
|
5829
|
-
lock = readLock(
|
|
6014
|
+
lock = readLock(path19__default.join(am.projectDir, "skaile.lock.yaml"));
|
|
5830
6015
|
} catch {
|
|
5831
6016
|
}
|
|
5832
6017
|
const rows = buildAssetRows(
|
|
@@ -5848,7 +6033,7 @@ function rebuildSourceTree() {
|
|
|
5848
6033
|
rebuildVisibleSources();
|
|
5849
6034
|
}
|
|
5850
6035
|
function sourceOrgRepo(s) {
|
|
5851
|
-
const parts = s.path.split(
|
|
6036
|
+
const parts = s.path.split(path19__default.sep).filter(Boolean);
|
|
5852
6037
|
if (parts.length < 2) return null;
|
|
5853
6038
|
return { org: parts[parts.length - 2], repo: parts[parts.length - 1] };
|
|
5854
6039
|
}
|
|
@@ -6022,13 +6207,13 @@ function reconcileCollapsedSets(rows) {
|
|
|
6022
6207
|
async function loadSourcesAndLibraries() {
|
|
6023
6208
|
try {
|
|
6024
6209
|
const [{ openLibraryManager: openLibraryManager2 }, { getGlobalCacheDir: getGlobalCacheDir2, globalSkaileDir: globalSkaileDir2 }] = await Promise.all([
|
|
6025
|
-
import('../open-library-
|
|
6210
|
+
import('../open-library-NKKUJLWA.js'),
|
|
6026
6211
|
import('../core/index.js')
|
|
6027
6212
|
]);
|
|
6028
6213
|
const { manager, library, close } = await openLibraryManager2();
|
|
6029
6214
|
try {
|
|
6030
6215
|
const newRoot = getGlobalCacheDir2();
|
|
6031
|
-
const legacyRoot =
|
|
6216
|
+
const legacyRoot = path19__default.join(globalSkaileDir2(), "sources");
|
|
6032
6217
|
const isSourceRow = (l) => l.path.startsWith(newRoot) || l.path.startsWith(legacyRoot);
|
|
6033
6218
|
const libs = await manager.listLibraries();
|
|
6034
6219
|
const defs = await library.listAssetDefs();
|
|
@@ -6988,13 +7173,13 @@ async function run(projectDir) {
|
|
|
6988
7173
|
}
|
|
6989
7174
|
function makeManageCommand() {
|
|
6990
7175
|
return new Command("manage").description("Interactive TUI for managing assets, sources, and libraries").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
6991
|
-
await run(
|
|
7176
|
+
await run(path19__default.resolve(opts.projectDir));
|
|
6992
7177
|
});
|
|
6993
7178
|
}
|
|
6994
7179
|
function makeMcpServerCommand() {
|
|
6995
7180
|
return new Command("mcp-server").description("Start skaile workspace MCP server (stdio transport)").option("--project-dir <path>", "Project directory (default: cwd)", process.cwd()).action(async (opts) => {
|
|
6996
|
-
const
|
|
6997
|
-
const projectDir =
|
|
7181
|
+
const path43 = await import('path');
|
|
7182
|
+
const projectDir = path43.default.resolve(opts.projectDir);
|
|
6998
7183
|
const { LogStore: LogStore2, StdoutSink: StdoutSink2, registerLogStore: registerLogStore2 } = await import('../core/logging.js');
|
|
6999
7184
|
registerLogStore2(
|
|
7000
7185
|
new LogStore2({
|
|
@@ -7036,10 +7221,10 @@ function walkFiles(root, match) {
|
|
|
7036
7221
|
return;
|
|
7037
7222
|
}
|
|
7038
7223
|
for (const entry of entries) {
|
|
7039
|
-
const full =
|
|
7224
|
+
const full = path19__default.join(dir, entry.name);
|
|
7040
7225
|
if (entry.isDirectory()) {
|
|
7041
7226
|
if (SKIPPED_DIRS.has(entry.name)) continue;
|
|
7042
|
-
if (entry.name === "cache" &&
|
|
7227
|
+
if (entry.name === "cache" && path19__default.basename(dir) === ".skaile") continue;
|
|
7043
7228
|
visit(full);
|
|
7044
7229
|
} else if (entry.isFile() && match(entry.name)) {
|
|
7045
7230
|
out.push(full);
|
|
@@ -7057,14 +7242,14 @@ function applyChanges2(changes) {
|
|
|
7057
7242
|
switch (change.type) {
|
|
7058
7243
|
case "write":
|
|
7059
7244
|
case "create":
|
|
7060
|
-
mkdirSync(
|
|
7245
|
+
mkdirSync(path19__default.dirname(change.path), { recursive: true });
|
|
7061
7246
|
writeFileSync(change.path, change.after, "utf-8");
|
|
7062
7247
|
break;
|
|
7063
7248
|
case "delete":
|
|
7064
7249
|
rmSync(change.path, { force: true });
|
|
7065
7250
|
break;
|
|
7066
7251
|
case "move":
|
|
7067
|
-
mkdirSync(
|
|
7252
|
+
mkdirSync(path19__default.dirname(change.to), { recursive: true });
|
|
7068
7253
|
writeFileSync(change.to, change.after, "utf-8");
|
|
7069
7254
|
rmSync(change.from, { force: true });
|
|
7070
7255
|
break;
|
|
@@ -7157,7 +7342,7 @@ function unifiedDiff(before, after, oldLabel, newLabel, context = 3) {
|
|
|
7157
7342
|
return `${out.join("\n")}
|
|
7158
7343
|
`;
|
|
7159
7344
|
}
|
|
7160
|
-
var posix = (p6) => p6.split(
|
|
7345
|
+
var posix = (p6) => p6.split(path19__default.sep).join("/");
|
|
7161
7346
|
function colorizeDiff(diff) {
|
|
7162
7347
|
return diff.split("\n").map((line) => {
|
|
7163
7348
|
if (line.startsWith("+++") || line.startsWith("---")) return S.bold(line);
|
|
@@ -7168,7 +7353,7 @@ function colorizeDiff(diff) {
|
|
|
7168
7353
|
}).join("\n");
|
|
7169
7354
|
}
|
|
7170
7355
|
function renderChange(change, base) {
|
|
7171
|
-
const rel = (p6) => posix(
|
|
7356
|
+
const rel = (p6) => posix(path19__default.relative(base, p6) || path19__default.basename(p6));
|
|
7172
7357
|
switch (change.type) {
|
|
7173
7358
|
case "write":
|
|
7174
7359
|
return unifiedDiff(
|
|
@@ -7195,7 +7380,7 @@ ${diff}`;
|
|
|
7195
7380
|
}
|
|
7196
7381
|
}
|
|
7197
7382
|
function changeLabel(change, base) {
|
|
7198
|
-
const rel = (p6) => posix(
|
|
7383
|
+
const rel = (p6) => posix(path19__default.relative(base, p6) || path19__default.basename(p6));
|
|
7199
7384
|
switch (change.type) {
|
|
7200
7385
|
case "write":
|
|
7201
7386
|
return `modify ${rel(change.path)}`;
|
|
@@ -7207,6 +7392,35 @@ function changeLabel(change, base) {
|
|
|
7207
7392
|
return `move ${rel(change.from)} \u2192 ${rel(change.to)}`;
|
|
7208
7393
|
}
|
|
7209
7394
|
}
|
|
7395
|
+
function resolveMode(opts, writeFlag = "--write") {
|
|
7396
|
+
if (opts.write && opts.dryRun) {
|
|
7397
|
+
logErr(`${writeFlag} and --dry-run are mutually exclusive.`);
|
|
7398
|
+
process.exit(1);
|
|
7399
|
+
}
|
|
7400
|
+
return opts.write === true;
|
|
7401
|
+
}
|
|
7402
|
+
function printChanges(changes, base) {
|
|
7403
|
+
for (const change of changes) {
|
|
7404
|
+
console.log();
|
|
7405
|
+
console.log(colorizeDiff(renderChange(change, base)).trimEnd());
|
|
7406
|
+
}
|
|
7407
|
+
}
|
|
7408
|
+
function finish(changes, write, base, writeFlag = "--write") {
|
|
7409
|
+
console.log();
|
|
7410
|
+
if (changes.length === 0) {
|
|
7411
|
+
logOk("Nothing to migrate.");
|
|
7412
|
+
return;
|
|
7413
|
+
}
|
|
7414
|
+
if (!write) {
|
|
7415
|
+
logInfo(
|
|
7416
|
+
`Dry run: ${changes.length} file change(s) planned, nothing written. Re-run with ${writeFlag} to apply.`
|
|
7417
|
+
);
|
|
7418
|
+
return;
|
|
7419
|
+
}
|
|
7420
|
+
applyChanges2(changes);
|
|
7421
|
+
logOk(`Applied ${changes.length} file change(s):`);
|
|
7422
|
+
for (const change of changes) console.log(` ${S.dim(changeLabel(change, base))}`);
|
|
7423
|
+
}
|
|
7210
7424
|
|
|
7211
7425
|
// cli/src/commands/migrate-agents.ts
|
|
7212
7426
|
var TARGET_SPEC_VERSION = "0.2";
|
|
@@ -7237,7 +7451,7 @@ function itemFromRef(raw, defaultKind, ctx) {
|
|
|
7237
7451
|
return { kind: prefixed[1], ref: value };
|
|
7238
7452
|
}
|
|
7239
7453
|
if (PATH_LIKE.test(value)) return { kind: defaultKind, ref: value };
|
|
7240
|
-
if (defaultKind === "skill" && !value.includes("/") && existsSync(
|
|
7454
|
+
if (defaultKind === "skill" && !value.includes("/") && existsSync(path19__default.join(ctx.agentDir, "skills", value, "SKILL.md"))) {
|
|
7241
7455
|
return { kind: "skill", ref: `./skills/${value}` };
|
|
7242
7456
|
}
|
|
7243
7457
|
return { kind: defaultKind, ref: `${defaultKind}:${value}` };
|
|
@@ -7373,7 +7587,7 @@ function migrateAgentYaml(source, options) {
|
|
|
7373
7587
|
manual.push("metadata.soul: not a string; left unchanged");
|
|
7374
7588
|
continue;
|
|
7375
7589
|
}
|
|
7376
|
-
if (
|
|
7590
|
+
if (path19__default.posix.basename(soul.replace(/\\/g, "/")).toLowerCase() === "soul.md") {
|
|
7377
7591
|
notes.push("metadata.soul \u2192 dropped (SOUL.md is a convention file)");
|
|
7378
7592
|
} else {
|
|
7379
7593
|
derived.push({ kind: "persona", ref: soul });
|
|
@@ -7607,7 +7821,7 @@ function migrateSubagents(skaileYamlPath, source) {
|
|
|
7607
7821
|
if (!isMap(agentNode)) return void 0;
|
|
7608
7822
|
const subNode = agentNode.get("subagents", true);
|
|
7609
7823
|
if (!isMap(subNode)) return void 0;
|
|
7610
|
-
const dir =
|
|
7824
|
+
const dir = path19__default.dirname(skaileYamlPath);
|
|
7611
7825
|
const notes = [];
|
|
7612
7826
|
const manual = [];
|
|
7613
7827
|
const changes = [];
|
|
@@ -7625,10 +7839,10 @@ function migrateSubagents(skaileYamlPath, source) {
|
|
|
7625
7839
|
continue;
|
|
7626
7840
|
}
|
|
7627
7841
|
const id = instanceId(name);
|
|
7628
|
-
const assetDir =
|
|
7842
|
+
const assetDir = path19__default.join(dir, ".skaile", "agents", id);
|
|
7629
7843
|
if (takenIds.has(id) || existsSync(assetDir)) {
|
|
7630
7844
|
manual.push(
|
|
7631
|
-
`agent.subagents.${name}: ${takenIds.has(id) ? `agents.${id} already exists` : `${
|
|
7845
|
+
`agent.subagents.${name}: ${takenIds.has(id) ? `agents.${id} already exists` : `${path19__default.relative(dir, assetDir)} already exists`}; left in place`
|
|
7632
7846
|
);
|
|
7633
7847
|
continue;
|
|
7634
7848
|
}
|
|
@@ -7652,13 +7866,13 @@ function migrateSubagents(skaileYamlPath, source) {
|
|
|
7652
7866
|
manifest.tools = { ...allowed ? { allowed } : {}, ...denied ? { denied } : {} };
|
|
7653
7867
|
}
|
|
7654
7868
|
const text = stringify(manifest, { lineWidth: 0 });
|
|
7655
|
-
const manifestPath =
|
|
7869
|
+
const manifestPath = path19__default.join(assetDir, "agent.yaml");
|
|
7656
7870
|
changes.push({ type: "create", path: manifestPath, after: text });
|
|
7657
7871
|
assetManifests.push({ file: manifestPath, text });
|
|
7658
7872
|
if (typeof spec.prompt === "string" && spec.prompt.trim() !== "") {
|
|
7659
7873
|
changes.push({
|
|
7660
7874
|
type: "create",
|
|
7661
|
-
path:
|
|
7875
|
+
path: path19__default.join(assetDir, "SOUL.md"),
|
|
7662
7876
|
after: `${spec.prompt.replace(/\s+$/, "")}
|
|
7663
7877
|
`
|
|
7664
7878
|
});
|
|
@@ -7717,7 +7931,7 @@ function validateMigratedAgent(text, registry) {
|
|
|
7717
7931
|
function collectAgentFiles(paths) {
|
|
7718
7932
|
const files = /* @__PURE__ */ new Set();
|
|
7719
7933
|
for (const input of paths) {
|
|
7720
|
-
const abs =
|
|
7934
|
+
const abs = path19__default.resolve(input);
|
|
7721
7935
|
if (!existsSync(abs)) continue;
|
|
7722
7936
|
if (statSync(abs).isDirectory()) {
|
|
7723
7937
|
for (const f of walkFiles(abs, (b) => b === "agent.yaml" || b === "skaile.yaml"))
|
|
@@ -7734,7 +7948,7 @@ function planAgentMigration(options) {
|
|
|
7734
7948
|
const reports = [];
|
|
7735
7949
|
for (const file of collectAgentFiles(options.paths)) {
|
|
7736
7950
|
const source = readText(file);
|
|
7737
|
-
const base =
|
|
7951
|
+
const base = path19__default.basename(file);
|
|
7738
7952
|
if (base === "skaile.yaml") {
|
|
7739
7953
|
const result = migrateSubagents(file, source);
|
|
7740
7954
|
if (!result) continue;
|
|
@@ -7742,7 +7956,7 @@ function planAgentMigration(options) {
|
|
|
7742
7956
|
for (const asset of result.assetManifests) {
|
|
7743
7957
|
const v = validateMigratedAgent(asset.text, options.registry);
|
|
7744
7958
|
validation2.errors.push(
|
|
7745
|
-
...v.errors.map((e) => `${
|
|
7959
|
+
...v.errors.map((e) => `${path19__default.basename(path19__default.dirname(asset.file))}: ${e}`)
|
|
7746
7960
|
);
|
|
7747
7961
|
validation2.warnings.push(...v.warnings);
|
|
7748
7962
|
}
|
|
@@ -7770,7 +7984,7 @@ function planAgentMigration(options) {
|
|
|
7770
7984
|
});
|
|
7771
7985
|
continue;
|
|
7772
7986
|
}
|
|
7773
|
-
migration = migrateAgentYaml(source, { agentDir:
|
|
7987
|
+
migration = migrateAgentYaml(source, { agentDir: path19__default.dirname(file), knownKinds });
|
|
7774
7988
|
} catch (error) {
|
|
7775
7989
|
reports.push({
|
|
7776
7990
|
file,
|
|
@@ -7800,7 +8014,7 @@ function planAgentMigration(options) {
|
|
|
7800
8014
|
var DEFAULT_PUBLISHER = "skaile-ai";
|
|
7801
8015
|
var PRESET_DEFAULT_VERSION = "1.0.0";
|
|
7802
8016
|
var FRONTMATTER = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;
|
|
7803
|
-
var posix2 = (p6) => p6.split(
|
|
8017
|
+
var posix2 = (p6) => p6.split(path19__default.sep).join("/");
|
|
7804
8018
|
var MOVED_KINDS = { persona: "PERSONA.md", ruleset: "RULESET.md" };
|
|
7805
8019
|
var KIND_MANIFEST_FILES = /* @__PURE__ */ new Set(["PERSONA.md", "RULESET.md", "SKILL.md"]);
|
|
7806
8020
|
function readFrontmatterType(text) {
|
|
@@ -7822,7 +8036,14 @@ ${kept.join("\n")}
|
|
|
7822
8036
|
${rest}`;
|
|
7823
8037
|
return { type: parsed.type, withoutType };
|
|
7824
8038
|
}
|
|
7825
|
-
function
|
|
8039
|
+
function finalIdentity(kind, name) {
|
|
8040
|
+
try {
|
|
8041
|
+
return `${kind}:${slugifyAssetName(name)}`;
|
|
8042
|
+
} catch {
|
|
8043
|
+
return `${kind}:${name}`;
|
|
8044
|
+
}
|
|
8045
|
+
}
|
|
8046
|
+
function planMarkdownMoves(root, knownKinds, manual, unknownTypes, identities, conflicts) {
|
|
7826
8047
|
const moves = [];
|
|
7827
8048
|
const changes = [];
|
|
7828
8049
|
const targets = /* @__PURE__ */ new Set();
|
|
@@ -7831,17 +8052,26 @@ function planMarkdownMoves(root, knownKinds, manual, unknownTypes) {
|
|
|
7831
8052
|
if (!text.startsWith("---")) continue;
|
|
7832
8053
|
const found = readFrontmatterType(text);
|
|
7833
8054
|
if (!found) continue;
|
|
7834
|
-
const base =
|
|
7835
|
-
const inAgentParts = file.split(
|
|
8055
|
+
const base = path19__default.basename(file);
|
|
8056
|
+
const inAgentParts = file.split(path19__default.sep).includes("_agent-parts");
|
|
7836
8057
|
const targetName = MOVED_KINDS[found.type];
|
|
7837
8058
|
if (targetName !== void 0 && !KIND_MANIFEST_FILES.has(base)) {
|
|
7838
|
-
const to =
|
|
8059
|
+
const to = path19__default.join(path19__default.dirname(file), base.replace(/\.md$/i, ""), targetName);
|
|
7839
8060
|
if (existsSync(to) || targets.has(to)) {
|
|
7840
8061
|
manual.push(
|
|
7841
|
-
`${posix2(
|
|
8062
|
+
`${posix2(path19__default.relative(root, file))}: ${posix2(path19__default.relative(root, to))} already exists; not moved`
|
|
8063
|
+
);
|
|
8064
|
+
continue;
|
|
8065
|
+
}
|
|
8066
|
+
const identity = finalIdentity(found.type, base.replace(/\.md$/i, ""));
|
|
8067
|
+
const earlier = identities.get(identity);
|
|
8068
|
+
if (earlier !== void 0) {
|
|
8069
|
+
conflicts.push(
|
|
8070
|
+
`${earlier} and ${posix2(path19__default.relative(root, file))} both become ${identity}: rename one bundle first. Nothing was changed.`
|
|
7842
8071
|
);
|
|
7843
8072
|
continue;
|
|
7844
8073
|
}
|
|
8074
|
+
identities.set(identity, posix2(path19__default.relative(root, file)));
|
|
7845
8075
|
targets.add(to);
|
|
7846
8076
|
moves.push({ from: file, to, kind: found.type });
|
|
7847
8077
|
changes.push({ type: "move", from: file, to, before: text, after: found.withoutType });
|
|
@@ -7859,13 +8089,13 @@ function planAgentRefRewrites(root, moves, knownKinds, notes) {
|
|
|
7859
8089
|
const changes = [];
|
|
7860
8090
|
for (const file of walkFiles(root, (b) => b === "agent.yaml")) {
|
|
7861
8091
|
const source = readText(file);
|
|
7862
|
-
const agentDir =
|
|
8092
|
+
const agentDir = path19__default.dirname(file);
|
|
7863
8093
|
let hits = 0;
|
|
7864
8094
|
const refRewrite = (_kind, ref) => {
|
|
7865
|
-
const moved = byOldPath.get(
|
|
8095
|
+
const moved = byOldPath.get(path19__default.resolve(agentDir, ref));
|
|
7866
8096
|
if (moved === void 0) return ref;
|
|
7867
8097
|
hits++;
|
|
7868
|
-
const rel = posix2(
|
|
8098
|
+
const rel = posix2(path19__default.relative(agentDir, moved));
|
|
7869
8099
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
7870
8100
|
};
|
|
7871
8101
|
let output;
|
|
@@ -7882,7 +8112,7 @@ function planAgentRefRewrites(root, moves, knownKinds, notes) {
|
|
|
7882
8112
|
if (hits === 0 || output === source) continue;
|
|
7883
8113
|
changes.push({ type: "write", path: file, before: source, after: output });
|
|
7884
8114
|
notes.push(
|
|
7885
|
-
`${posix2(
|
|
8115
|
+
`${posix2(path19__default.relative(root, file))}: persona/ruleset refs \u2192 composes items at the new paths`
|
|
7886
8116
|
);
|
|
7887
8117
|
}
|
|
7888
8118
|
return changes;
|
|
@@ -7906,14 +8136,14 @@ function presetText(name, description, refs, version) {
|
|
|
7906
8136
|
}
|
|
7907
8137
|
function skillDirs(dir) {
|
|
7908
8138
|
try {
|
|
7909
|
-
return readdirSync(
|
|
8139
|
+
return readdirSync(path19__default.join(dir, "skills"), { withFileTypes: true }).filter((e) => e.isDirectory() && existsSync(path19__default.join(dir, "skills", e.name, "SKILL.md"))).map((e) => e.name).sort();
|
|
7910
8140
|
} catch {
|
|
7911
8141
|
return [];
|
|
7912
8142
|
}
|
|
7913
8143
|
}
|
|
7914
8144
|
function repoPublisher(root) {
|
|
7915
8145
|
for (const name of ["skaile.manifest.yaml", "skaile.yaml"]) {
|
|
7916
|
-
const file =
|
|
8146
|
+
const file = path19__default.join(root, name);
|
|
7917
8147
|
if (!existsSync(file)) continue;
|
|
7918
8148
|
try {
|
|
7919
8149
|
const parsed = parse(readText(file));
|
|
@@ -7925,15 +8155,15 @@ function repoPublisher(root) {
|
|
|
7925
8155
|
}
|
|
7926
8156
|
return DEFAULT_PUBLISHER;
|
|
7927
8157
|
}
|
|
7928
|
-
function planBundles(root, skaileYamls, publisher, notes, manual, conflicts) {
|
|
8158
|
+
function planBundles(root, skaileYamls, publisher, notes, manual, conflicts, identities) {
|
|
7929
8159
|
const changes = [];
|
|
7930
8160
|
const presets = [];
|
|
7931
8161
|
const handled = /* @__PURE__ */ new Set();
|
|
7932
8162
|
const claimed = /* @__PURE__ */ new Map();
|
|
7933
|
-
const rel = (p6) => posix2(
|
|
8163
|
+
const rel = (p6) => posix2(path19__default.relative(root, p6));
|
|
7934
8164
|
const convert = (name, bundleFile, dir) => {
|
|
7935
|
-
const target =
|
|
7936
|
-
const origin = bundleFile ? rel(bundleFile) : `${rel(
|
|
8165
|
+
const target = path19__default.join(dir === root ? path19__default.join(dir, name) : dir, `${name}.preset.yaml`);
|
|
8166
|
+
const origin = bundleFile ? rel(bundleFile) : `${rel(path19__default.join(dir, "skills")) || "skills"}/`;
|
|
7937
8167
|
const earlier = claimed.get(target);
|
|
7938
8168
|
if (earlier !== void 0) {
|
|
7939
8169
|
conflicts.push(
|
|
@@ -7941,6 +8171,14 @@ function planBundles(root, skaileYamls, publisher, notes, manual, conflicts) {
|
|
|
7941
8171
|
);
|
|
7942
8172
|
return;
|
|
7943
8173
|
}
|
|
8174
|
+
const identity = finalIdentity("preset", name);
|
|
8175
|
+
const sameName = identities.get(identity);
|
|
8176
|
+
if (sameName !== void 0) {
|
|
8177
|
+
conflicts.push(
|
|
8178
|
+
`${sameName} and ${origin} both become ${identity}: rename one bundle first. Nothing was changed.`
|
|
8179
|
+
);
|
|
8180
|
+
return;
|
|
8181
|
+
}
|
|
7944
8182
|
if (existsSync(target)) {
|
|
7945
8183
|
manual.push(`${rel(target)} already exists; bundle ${name} not converted`);
|
|
7946
8184
|
return;
|
|
@@ -7972,11 +8210,12 @@ function planBundles(root, skaileYamls, publisher, notes, manual, conflicts) {
|
|
|
7972
8210
|
}
|
|
7973
8211
|
if (refs.length === 0) {
|
|
7974
8212
|
manual.push(
|
|
7975
|
-
`bundle ${name}: no dependencies found${bundleFile ? ` in ${rel(bundleFile)}` : ` and no skills under ${rel(
|
|
8213
|
+
`bundle ${name}: no dependencies found${bundleFile ? ` in ${rel(bundleFile)}` : ` and no skills under ${rel(path19__default.join(dir, "skills"))}`}; no preset generated`
|
|
7976
8214
|
);
|
|
7977
8215
|
return;
|
|
7978
8216
|
}
|
|
7979
8217
|
claimed.set(target, origin);
|
|
8218
|
+
identities.set(identity, origin);
|
|
7980
8219
|
const after = presetText(name, description, refs, version);
|
|
7981
8220
|
if (before !== void 0 && bundleFile) {
|
|
7982
8221
|
changes.push({ type: "move", from: bundleFile, to: target, before, after });
|
|
@@ -7997,18 +8236,18 @@ function planBundles(root, skaileYamls, publisher, notes, manual, conflicts) {
|
|
|
7997
8236
|
const assets = Array.isArray(raw.assets) ? raw.assets : [];
|
|
7998
8237
|
for (const entry of assets) {
|
|
7999
8238
|
if (!isRecord(entry) || entry.kind !== "bundle" || typeof entry.name !== "string") continue;
|
|
8000
|
-
const baseDir =
|
|
8001
|
-
const entryRoot = typeof entry.root === "string" ?
|
|
8239
|
+
const baseDir = path19__default.dirname(file);
|
|
8240
|
+
const entryRoot = typeof entry.root === "string" ? path19__default.join(baseDir, entry.root) : baseDir;
|
|
8002
8241
|
const files = Array.isArray(entry.files) ? entry.files : [];
|
|
8003
8242
|
const bundleName = files.find(
|
|
8004
8243
|
(f) => typeof f === "string" && f.endsWith(".bundle.yaml")
|
|
8005
8244
|
);
|
|
8006
|
-
convert(entry.name, bundleName ?
|
|
8245
|
+
convert(entry.name, bundleName ? path19__default.join(entryRoot, bundleName) : void 0, entryRoot);
|
|
8007
8246
|
}
|
|
8008
8247
|
}
|
|
8009
8248
|
for (const bundleFile of walkFiles(root, (b) => b.endsWith(".bundle.yaml"))) {
|
|
8010
8249
|
if (handled.has(bundleFile)) continue;
|
|
8011
|
-
const base =
|
|
8250
|
+
const base = path19__default.basename(bundleFile);
|
|
8012
8251
|
let name = base.replace(/\.bundle\.yaml$/, "");
|
|
8013
8252
|
try {
|
|
8014
8253
|
const parsed = parse(readText(bundleFile));
|
|
@@ -8017,7 +8256,7 @@ function planBundles(root, skaileYamls, publisher, notes, manual, conflicts) {
|
|
|
8017
8256
|
} catch {
|
|
8018
8257
|
}
|
|
8019
8258
|
if (presets.some((p6) => p6.bundleFile === bundleFile)) continue;
|
|
8020
|
-
convert(name, bundleFile,
|
|
8259
|
+
convert(name, bundleFile, path19__default.dirname(bundleFile));
|
|
8021
8260
|
}
|
|
8022
8261
|
return changes;
|
|
8023
8262
|
}
|
|
@@ -8027,8 +8266,8 @@ function planSkaileYaml(root, file, source, notes, manual) {
|
|
|
8027
8266
|
if (doc.errors.length > 0 || !isMap(doc.contents)) return [];
|
|
8028
8267
|
const map = doc.contents;
|
|
8029
8268
|
const raw = doc.toJS();
|
|
8030
|
-
const dir =
|
|
8031
|
-
const rel = (p6) => posix2(
|
|
8269
|
+
const dir = path19__default.dirname(file);
|
|
8270
|
+
const rel = (p6) => posix2(path19__default.relative(root, p6));
|
|
8032
8271
|
const changes = [];
|
|
8033
8272
|
let changed = false;
|
|
8034
8273
|
const deps = map.get("dependencies", true);
|
|
@@ -8045,7 +8284,7 @@ function planSkaileYaml(root, file, source, notes, manual) {
|
|
|
8045
8284
|
const hasPublication = PUBLICATION_KEYS.some((k) => raw[k] !== void 0);
|
|
8046
8285
|
let remove = false;
|
|
8047
8286
|
if (hasPublication) {
|
|
8048
|
-
const manifestPath =
|
|
8287
|
+
const manifestPath = path19__default.join(dir, "skaile.manifest.yaml");
|
|
8049
8288
|
if (existsSync(manifestPath)) {
|
|
8050
8289
|
manual.push(
|
|
8051
8290
|
`${rel(file)}: publisher/version/assets left in place \u2014 ${rel(manifestPath)} already exists; merge by hand`
|
|
@@ -8102,16 +8341,24 @@ function planSkaileYaml(root, file, source, notes, manual) {
|
|
|
8102
8341
|
return changes;
|
|
8103
8342
|
}
|
|
8104
8343
|
function planAssetMigration(options) {
|
|
8105
|
-
const root =
|
|
8344
|
+
const root = path19__default.resolve(options.root);
|
|
8106
8345
|
const knownKinds = new Set(options.registry.getAllKinds());
|
|
8107
8346
|
const notes = [];
|
|
8108
8347
|
const manual = [];
|
|
8109
8348
|
const conflicts = [];
|
|
8110
8349
|
const unknownTypes = [];
|
|
8111
|
-
const
|
|
8350
|
+
const identities = /* @__PURE__ */ new Map();
|
|
8351
|
+
const { moves, changes: moveChanges } = planMarkdownMoves(
|
|
8352
|
+
root,
|
|
8353
|
+
knownKinds,
|
|
8354
|
+
manual,
|
|
8355
|
+
unknownTypes,
|
|
8356
|
+
identities,
|
|
8357
|
+
conflicts
|
|
8358
|
+
);
|
|
8112
8359
|
for (const move of moves) {
|
|
8113
8360
|
notes.push(
|
|
8114
|
-
`${posix2(
|
|
8361
|
+
`${posix2(path19__default.relative(root, move.from))} \u2192 ${posix2(path19__default.relative(root, move.to))} (${move.kind})`
|
|
8115
8362
|
);
|
|
8116
8363
|
}
|
|
8117
8364
|
const agentChanges = planAgentRefRewrites(root, moves, knownKinds, notes);
|
|
@@ -8123,11 +8370,19 @@ function planAssetMigration(options) {
|
|
|
8123
8370
|
const raw = parse(source);
|
|
8124
8371
|
if (isRecord(raw)) skaileYamls.push({ file, source, raw });
|
|
8125
8372
|
} catch {
|
|
8126
|
-
manual.push(`${posix2(
|
|
8373
|
+
manual.push(`${posix2(path19__default.relative(root, file))}: invalid YAML; skipped`);
|
|
8127
8374
|
}
|
|
8128
8375
|
}
|
|
8129
8376
|
const publisher = repoPublisher(root);
|
|
8130
|
-
const bundleChanges = planBundles(
|
|
8377
|
+
const bundleChanges = planBundles(
|
|
8378
|
+
root,
|
|
8379
|
+
skaileYamls,
|
|
8380
|
+
publisher,
|
|
8381
|
+
notes,
|
|
8382
|
+
manual,
|
|
8383
|
+
conflicts,
|
|
8384
|
+
identities
|
|
8385
|
+
);
|
|
8131
8386
|
const skaileChanges = skaileYamls.flatMap(
|
|
8132
8387
|
({ file, source }) => planSkaileYaml(root, file, source, notes, manual)
|
|
8133
8388
|
);
|
|
@@ -8139,6 +8394,142 @@ function planAssetMigration(options) {
|
|
|
8139
8394
|
unknownTypes
|
|
8140
8395
|
};
|
|
8141
8396
|
}
|
|
8397
|
+
var SKAILE_YAML_SUFFIX = ".skaile.yaml";
|
|
8398
|
+
var OLD_KEY = "driver";
|
|
8399
|
+
var NEW_KEY = "harness";
|
|
8400
|
+
var AGENT_CONFIG_KEYS = ["agent-config", "agent_config", "agentConfig"];
|
|
8401
|
+
function renameInMap(map, where, notes) {
|
|
8402
|
+
const oldIdx = map.items.findIndex((p6) => isScalar(p6.key) && p6.key.value === OLD_KEY);
|
|
8403
|
+
if (oldIdx < 0) return false;
|
|
8404
|
+
const hasNew = map.items.some((p6) => isScalar(p6.key) && p6.key.value === NEW_KEY);
|
|
8405
|
+
if (hasNew) {
|
|
8406
|
+
map.items.splice(oldIdx, 1);
|
|
8407
|
+
notes.push(
|
|
8408
|
+
`${where}: both \`harness\` and \`driver\` set; kept \`harness\`, dropped \`driver\``
|
|
8409
|
+
);
|
|
8410
|
+
} else {
|
|
8411
|
+
(map.items[oldIdx]?.key).value = NEW_KEY;
|
|
8412
|
+
notes.push(`${where}: \`driver\` \u2192 \`harness\``);
|
|
8413
|
+
}
|
|
8414
|
+
return true;
|
|
8415
|
+
}
|
|
8416
|
+
function migrateHarnessYaml(text, label = SKAILE_YAML_DEFAULT) {
|
|
8417
|
+
const doc = parseDocument(text);
|
|
8418
|
+
if (doc.errors.length > 0) {
|
|
8419
|
+
throw new Error(`invalid YAML: ${doc.errors[0]?.message ?? "parse error"}`);
|
|
8420
|
+
}
|
|
8421
|
+
const root = doc.contents;
|
|
8422
|
+
if (!isMap(root)) return { output: text, notes: [] };
|
|
8423
|
+
const notes = [];
|
|
8424
|
+
let changed = false;
|
|
8425
|
+
for (const key of AGENT_CONFIG_KEYS) {
|
|
8426
|
+
const block = root.get(key, true);
|
|
8427
|
+
if (!isMap(block)) continue;
|
|
8428
|
+
const flat = AGENT_PROFILE_FIELDS.some((f) => {
|
|
8429
|
+
const v = block.get(f, true);
|
|
8430
|
+
return isScalar(v) && typeof v.value === "string";
|
|
8431
|
+
});
|
|
8432
|
+
if (flat) {
|
|
8433
|
+
changed = renameInMap(block, `${label}: ${key}`, notes) || changed;
|
|
8434
|
+
continue;
|
|
8435
|
+
}
|
|
8436
|
+
for (const pair of block.items) {
|
|
8437
|
+
if (!isMap(pair.value) || !isScalar(pair.key)) continue;
|
|
8438
|
+
changed = renameInMap(pair.value, `${label}: ${key}.${String(pair.key.value)}`, notes) || changed;
|
|
8439
|
+
}
|
|
8440
|
+
}
|
|
8441
|
+
return { output: changed ? String(doc) : text, notes };
|
|
8442
|
+
}
|
|
8443
|
+
function migrateHarnessSettings(text, label = "settings.json") {
|
|
8444
|
+
let parsed;
|
|
8445
|
+
try {
|
|
8446
|
+
parsed = JSON.parse(text);
|
|
8447
|
+
} catch {
|
|
8448
|
+
return { output: text, notes: [] };
|
|
8449
|
+
}
|
|
8450
|
+
if (!isRecord(parsed) || !(OLD_KEY in parsed)) return { output: text, notes: [] };
|
|
8451
|
+
const notes = [];
|
|
8452
|
+
const out = {};
|
|
8453
|
+
for (const [k, v] of Object.entries(parsed)) {
|
|
8454
|
+
if (k !== OLD_KEY) {
|
|
8455
|
+
out[k] = v;
|
|
8456
|
+
} else if (NEW_KEY in parsed) {
|
|
8457
|
+
notes.push(
|
|
8458
|
+
`${label}: both \`harness\` and \`driver\` set; kept \`harness\`, dropped \`driver\``
|
|
8459
|
+
);
|
|
8460
|
+
} else {
|
|
8461
|
+
out[NEW_KEY] = v;
|
|
8462
|
+
notes.push(`${label}: \`driver\` \u2192 \`harness\``);
|
|
8463
|
+
}
|
|
8464
|
+
}
|
|
8465
|
+
const trailing = text.endsWith("\n") ? "\n" : "";
|
|
8466
|
+
return { output: `${JSON.stringify(out, null, 2)}${trailing}`, notes };
|
|
8467
|
+
}
|
|
8468
|
+
function workspaceYamlFiles(projectDir) {
|
|
8469
|
+
const files = [];
|
|
8470
|
+
if (existsSync(path19__default.join(projectDir, SKAILE_YAML_DEFAULT))) {
|
|
8471
|
+
files.push(path19__default.join(projectDir, SKAILE_YAML_DEFAULT));
|
|
8472
|
+
}
|
|
8473
|
+
try {
|
|
8474
|
+
for (const entry of readdirSync(projectDir).sort()) {
|
|
8475
|
+
if (entry.endsWith(SKAILE_YAML_SUFFIX)) files.push(path19__default.join(projectDir, entry));
|
|
8476
|
+
}
|
|
8477
|
+
} catch {
|
|
8478
|
+
}
|
|
8479
|
+
return files;
|
|
8480
|
+
}
|
|
8481
|
+
function planHarnessMigration(opts) {
|
|
8482
|
+
const changes = [];
|
|
8483
|
+
const notes = [];
|
|
8484
|
+
const seen = /* @__PURE__ */ new Set();
|
|
8485
|
+
const plan = (file, rewrite) => {
|
|
8486
|
+
if (seen.has(file) || !existsSync(file)) return;
|
|
8487
|
+
seen.add(file);
|
|
8488
|
+
const before = readText(file);
|
|
8489
|
+
const label = path19__default.basename(file);
|
|
8490
|
+
let result;
|
|
8491
|
+
try {
|
|
8492
|
+
result = rewrite(before, label);
|
|
8493
|
+
} catch (error) {
|
|
8494
|
+
notes.push(`${file}: skipped \u2014 ${error.message}`);
|
|
8495
|
+
return;
|
|
8496
|
+
}
|
|
8497
|
+
if (result.output === before) return;
|
|
8498
|
+
notes.push(...result.notes);
|
|
8499
|
+
changes.push({ type: "write", path: file, before, after: result.output });
|
|
8500
|
+
};
|
|
8501
|
+
for (const file of workspaceYamlFiles(opts.projectDir)) plan(file, migrateHarnessYaml);
|
|
8502
|
+
plan(projectSettingsPath(opts.projectDir), migrateHarnessSettings);
|
|
8503
|
+
plan(globalSettingsPath(), migrateHarnessSettings);
|
|
8504
|
+
return { changes, notes };
|
|
8505
|
+
}
|
|
8506
|
+
function runMigrateHarness(opts) {
|
|
8507
|
+
const apply = resolveMode(
|
|
8508
|
+
{ write: opts.apply === true || opts.write === true, dryRun: opts.dryRun },
|
|
8509
|
+
"--apply"
|
|
8510
|
+
);
|
|
8511
|
+
const cwd = process.cwd();
|
|
8512
|
+
const projectDir = path19__default.resolve(opts.projectDir ?? findWorkspaceRoot(cwd) ?? cwd);
|
|
8513
|
+
const plan = planHarnessMigration({ projectDir });
|
|
8514
|
+
for (const note of plan.notes) console.log(` ${note}`);
|
|
8515
|
+
printChanges(plan.changes, projectDir);
|
|
8516
|
+
finish(plan.changes, apply, projectDir, "--apply");
|
|
8517
|
+
}
|
|
8518
|
+
function addMigrateHarnessCommand(migrate) {
|
|
8519
|
+
migrate.command("harness").description(
|
|
8520
|
+
"Rename the `driver` key to `harness` in skaile.yaml agent-config and settings.json"
|
|
8521
|
+
).option("--project-dir <path>", "Project directory (default: the workspace root of the cwd)").option("--apply", "Write the changes (default: print a diff and write nothing)").option("--write", "Same as --apply").option("--dry-run", "Print the diff and write nothing (the default)").addHelpText(
|
|
8522
|
+
"after",
|
|
8523
|
+
`
|
|
8524
|
+
Rewrites (the connector/mount \`driver\` of connectors: and mounts: is never touched):
|
|
8525
|
+
skaile.yaml agent-config.<profile>.driver -> harness (also the flat agent-config: { driver: \u2026 } shape)
|
|
8526
|
+
.skaile/settings.json, ~/.skaile/settings.json driver -> harness
|
|
8527
|
+
A profile or file that sets both keeps \`harness\` and drops \`driver\`.
|
|
8528
|
+
|
|
8529
|
+
Dry run by default: prints a unified diff per file. Pass --apply to write.
|
|
8530
|
+
`
|
|
8531
|
+
).action((opts) => runMigrateHarness(opts));
|
|
8532
|
+
}
|
|
8142
8533
|
|
|
8143
8534
|
// cli/src/commands/migrate-legacy-entry.ts
|
|
8144
8535
|
var ANTHROPIC_VERSION_HEADER = { "anthropic-version": "2023-06-01" };
|
|
@@ -8237,9 +8628,9 @@ function legacyProfileEntry(inputs = {}) {
|
|
|
8237
8628
|
|
|
8238
8629
|
// cli/src/commands/migrate-providers.ts
|
|
8239
8630
|
var LEGACY_PROFILE_KEYS = ["provider", "cloud", "cloud_config", "cloudConfig"];
|
|
8240
|
-
var
|
|
8631
|
+
var AGENT_CONFIG_KEYS2 = ["agent-config", "agent_config", "agentConfig"];
|
|
8241
8632
|
var FLAT_PROFILE_FIELDS = [
|
|
8242
|
-
"
|
|
8633
|
+
"harness",
|
|
8243
8634
|
"provider",
|
|
8244
8635
|
"cloud",
|
|
8245
8636
|
"model",
|
|
@@ -8278,10 +8669,10 @@ function workspaceConfigFiles(dir) {
|
|
|
8278
8669
|
} catch {
|
|
8279
8670
|
return [];
|
|
8280
8671
|
}
|
|
8281
|
-
return names.filter((name) => isWorkspaceConfigFilename(name)).sort().map((name) =>
|
|
8672
|
+
return names.filter((name) => isWorkspaceConfigFilename(name)).sort().map((name) => path19__default.join(dir, name));
|
|
8282
8673
|
}
|
|
8283
8674
|
function readAgentConfigBlock(raw) {
|
|
8284
|
-
const key =
|
|
8675
|
+
const key = AGENT_CONFIG_KEYS2.find((candidate) => raw[candidate] !== void 0);
|
|
8285
8676
|
if (!key) return void 0;
|
|
8286
8677
|
const block = raw[key];
|
|
8287
8678
|
if (typeof block !== "object" || block === null || Array.isArray(block)) return void 0;
|
|
@@ -8290,7 +8681,7 @@ function readAgentConfigBlock(raw) {
|
|
|
8290
8681
|
return flat ? { key, profiles: { default: profiles }, flat } : { key, profiles, flat };
|
|
8291
8682
|
}
|
|
8292
8683
|
function planProviderMigration(options) {
|
|
8293
|
-
const projectDir =
|
|
8684
|
+
const projectDir = path19__default.resolve(options.projectDir);
|
|
8294
8685
|
const registryPath = options.workspace ? workspaceProviderRegistryPath(projectDir) : userProviderRegistryPath();
|
|
8295
8686
|
const plan = {
|
|
8296
8687
|
registryPath,
|
|
@@ -8306,7 +8697,7 @@ function planProviderMigration(options) {
|
|
|
8306
8697
|
raw = parseDocument(readFileSync(file, "utf-8")).toJS() ?? {};
|
|
8307
8698
|
} catch (error) {
|
|
8308
8699
|
plan.warnings.push(
|
|
8309
|
-
`${
|
|
8700
|
+
`${path19__default.basename(file)}: not valid YAML (${error instanceof Error ? error.message : String(error)}) \u2014 skipped`
|
|
8310
8701
|
);
|
|
8311
8702
|
continue;
|
|
8312
8703
|
}
|
|
@@ -8355,7 +8746,7 @@ function planProviderMigration(options) {
|
|
|
8355
8746
|
});
|
|
8356
8747
|
if (!model) {
|
|
8357
8748
|
plan.warnings.push(
|
|
8358
|
-
`${
|
|
8749
|
+
`${path19__default.basename(file)}: profile '${profile}' had no model: \u2014 it now resolves against registry order. Pin it with 'model: ${providerId}/<modelId>'.`
|
|
8359
8750
|
);
|
|
8360
8751
|
}
|
|
8361
8752
|
touched = true;
|
|
@@ -8422,7 +8813,7 @@ function printPlan(plan) {
|
|
|
8422
8813
|
for (const entry of plan.entries) {
|
|
8423
8814
|
const base = entry.entry.base_url ?? S.dim("(transport-derived)");
|
|
8424
8815
|
console.log(
|
|
8425
|
-
` ${S.label(`${
|
|
8816
|
+
` ${S.label(`${path19__default.basename(entry.file)} ${entry.profile}`)} provider: ${entry.legacy.provider}, cloud: ${entry.legacy.cloud}`
|
|
8426
8817
|
);
|
|
8427
8818
|
console.log(` \u2192 providers.yml ${S.bold(entry.providerId)} ${base}`);
|
|
8428
8819
|
console.log(
|
|
@@ -8438,7 +8829,7 @@ function printPlan(plan) {
|
|
|
8438
8829
|
console.log();
|
|
8439
8830
|
}
|
|
8440
8831
|
async function runMigrateProviders(opts) {
|
|
8441
|
-
const projectDir = opts.projectDir ?
|
|
8832
|
+
const projectDir = opts.projectDir ? path19__default.resolve(opts.projectDir) : process.cwd();
|
|
8442
8833
|
const plan = planProviderMigration({ projectDir, workspace: opts.workspace });
|
|
8443
8834
|
for (const warning of plan.warnings) logWarn(warning);
|
|
8444
8835
|
if (plan.entries.length === 0 && Object.keys(plan.providers).length === 0) {
|
|
@@ -8532,35 +8923,6 @@ Rewrites (run on a repo root):
|
|
|
8532
8923
|
|
|
8533
8924
|
Dry run by default: prints a unified diff per file. Pass --write to apply.
|
|
8534
8925
|
`;
|
|
8535
|
-
function resolveMode(opts) {
|
|
8536
|
-
if (opts.write && opts.dryRun) {
|
|
8537
|
-
logErr("--write and --dry-run are mutually exclusive.");
|
|
8538
|
-
process.exit(1);
|
|
8539
|
-
}
|
|
8540
|
-
return opts.write === true;
|
|
8541
|
-
}
|
|
8542
|
-
function printChanges(changes, base) {
|
|
8543
|
-
for (const change of changes) {
|
|
8544
|
-
console.log();
|
|
8545
|
-
console.log(colorizeDiff(renderChange(change, base)).trimEnd());
|
|
8546
|
-
}
|
|
8547
|
-
}
|
|
8548
|
-
function finish(changes, write, base) {
|
|
8549
|
-
console.log();
|
|
8550
|
-
if (changes.length === 0) {
|
|
8551
|
-
logOk("Nothing to migrate.");
|
|
8552
|
-
return;
|
|
8553
|
-
}
|
|
8554
|
-
if (!write) {
|
|
8555
|
-
logInfo(
|
|
8556
|
-
`Dry run: ${changes.length} file change(s) planned, nothing written. Re-run with --write to apply.`
|
|
8557
|
-
);
|
|
8558
|
-
return;
|
|
8559
|
-
}
|
|
8560
|
-
applyChanges2(changes);
|
|
8561
|
-
logOk(`Applied ${changes.length} file change(s):`);
|
|
8562
|
-
for (const change of changes) console.log(` ${S.dim(changeLabel(change, base))}`);
|
|
8563
|
-
}
|
|
8564
8926
|
async function runMigrateAgents(paths, opts) {
|
|
8565
8927
|
const write = resolveMode(opts);
|
|
8566
8928
|
const base = process.cwd();
|
|
@@ -8571,7 +8933,7 @@ async function runMigrateAgents(paths, opts) {
|
|
|
8571
8933
|
let failures = 0;
|
|
8572
8934
|
let manualCount = 0;
|
|
8573
8935
|
for (const report of plan.reports) {
|
|
8574
|
-
const rel =
|
|
8936
|
+
const rel = path19__default.relative(base, report.file) || report.file;
|
|
8575
8937
|
for (const note of report.notes) console.log(` ${S.label(rel)} ${note}`);
|
|
8576
8938
|
for (const note of report.manual) {
|
|
8577
8939
|
manualCount++;
|
|
@@ -8598,7 +8960,7 @@ async function runMigrateAssets(root, opts) {
|
|
|
8598
8960
|
const write = resolveMode(opts);
|
|
8599
8961
|
const base = process.cwd();
|
|
8600
8962
|
const plan = planAssetMigration({
|
|
8601
|
-
root:
|
|
8963
|
+
root: path19__default.resolve(root ?? base),
|
|
8602
8964
|
registry: getKindRegistry()
|
|
8603
8965
|
});
|
|
8604
8966
|
if (plan.conflicts.length > 0) {
|
|
@@ -8610,7 +8972,7 @@ async function runMigrateAssets(root, opts) {
|
|
|
8610
8972
|
for (const note of plan.manual) logWarn(note);
|
|
8611
8973
|
for (const { file, type } of plan.unknownTypes) {
|
|
8612
8974
|
logWarn(
|
|
8613
|
-
`${
|
|
8975
|
+
`${path19__default.relative(base, file) || file}: frontmatter type "${type}" is not a registered asset kind (reported, not rewritten)`
|
|
8614
8976
|
);
|
|
8615
8977
|
}
|
|
8616
8978
|
printChanges(plan.changes, base);
|
|
@@ -8625,6 +8987,7 @@ function makeMigrateCommand() {
|
|
|
8625
8987
|
cmd.command("assets").description(
|
|
8626
8988
|
"Move persona/ruleset files, bundles and the publication half of skaile.yaml onto the kind model"
|
|
8627
8989
|
).argument("[root]", "Repo root to migrate (default: current directory)").option("--write", "Apply the changes (default: print a diff and write nothing)").option("--dry-run", "Print the diff and write nothing (the default)").addHelpText("after", ASSETS_HELP).action((root, opts) => runMigrateAssets(root, opts));
|
|
8990
|
+
addMigrateHarnessCommand(cmd);
|
|
8628
8991
|
return cmd;
|
|
8629
8992
|
}
|
|
8630
8993
|
function makeNpxCommand() {
|
|
@@ -8633,8 +8996,8 @@ function makeNpxCommand() {
|
|
|
8633
8996
|
skills.command("add <url>").description(
|
|
8634
8997
|
"Clone a repo, register it in the project's skaile.yaml sources[], and install a skill from it"
|
|
8635
8998
|
).requiredOption("--skill <name>", "Skill name to install from the repo").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", `Agent framework (${TARGET_DEFAULT_HINT})`).option("--global", "Deploy globally").action(async (url, opts) => {
|
|
8636
|
-
const projectDir =
|
|
8637
|
-
const projYaml =
|
|
8999
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
9000
|
+
const projYaml = path19__default.join(projectDir, "skaile.yaml");
|
|
8638
9001
|
if (!existsSync(projYaml)) {
|
|
8639
9002
|
logErr(`No skaile.yaml in ${projectDir} \u2014 run \`skaile init\` first.`);
|
|
8640
9003
|
process.exit(1);
|
|
@@ -8647,11 +9010,11 @@ function makeNpxCommand() {
|
|
|
8647
9010
|
}
|
|
8648
9011
|
const spinner = createSpinner();
|
|
8649
9012
|
const key = sourceCacheKey(url);
|
|
8650
|
-
const clonePath =
|
|
9013
|
+
const clonePath = path19__default.join(getGlobalCacheDir(), key);
|
|
8651
9014
|
spinner.start(`Cloning ${url}`);
|
|
8652
9015
|
try {
|
|
8653
9016
|
if (!existsSync(clonePath)) {
|
|
8654
|
-
mkdirSync(
|
|
9017
|
+
mkdirSync(path19__default.dirname(clonePath), { recursive: true });
|
|
8655
9018
|
execSync(`git clone ${url} ${clonePath}`, { stdio: "ignore" });
|
|
8656
9019
|
}
|
|
8657
9020
|
spinner.stop(`Cloned to ${key}`);
|
|
@@ -8680,7 +9043,7 @@ function makeNpxCommand() {
|
|
|
8680
9043
|
registry: getKindRegistry(),
|
|
8681
9044
|
projectDir,
|
|
8682
9045
|
global: opts.global,
|
|
8683
|
-
|
|
9046
|
+
harness: opts.target,
|
|
8684
9047
|
onLibraryCollision: warnings.push
|
|
8685
9048
|
});
|
|
8686
9049
|
spinner.start(`Installing ${skillRef}`);
|
|
@@ -8706,7 +9069,7 @@ function makeNpxCommand() {
|
|
|
8706
9069
|
return npx;
|
|
8707
9070
|
}
|
|
8708
9071
|
function resolvePublisher(clonePath, url) {
|
|
8709
|
-
const manifestPath =
|
|
9072
|
+
const manifestPath = path19__default.join(clonePath, SKAILE_MANIFEST_FILENAME);
|
|
8710
9073
|
if (existsSync(manifestPath)) {
|
|
8711
9074
|
try {
|
|
8712
9075
|
const { manifest } = decodeSkaileManifest(readFileSync(manifestPath, "utf8"));
|
|
@@ -8719,12 +9082,12 @@ function resolvePublisher(clonePath, url) {
|
|
|
8719
9082
|
return url.match(/github\.com[/:]([^/]+)\/[^/]+/)?.[1];
|
|
8720
9083
|
}
|
|
8721
9084
|
function resolveSkillName(clonePath, requested) {
|
|
8722
|
-
const skillsDir =
|
|
8723
|
-
if (existsSync(
|
|
9085
|
+
const skillsDir = path19__default.join(clonePath, "skills");
|
|
9086
|
+
if (existsSync(path19__default.join(skillsDir, requested, "SKILL.md"))) return requested;
|
|
8724
9087
|
if (!existsSync(skillsDir)) return requested;
|
|
8725
9088
|
for (const entry of readdirSync(skillsDir, { withFileTypes: true })) {
|
|
8726
9089
|
if (!entry.isDirectory()) continue;
|
|
8727
|
-
const md =
|
|
9090
|
+
const md = path19__default.join(skillsDir, entry.name, "SKILL.md");
|
|
8728
9091
|
if (!existsSync(md)) continue;
|
|
8729
9092
|
try {
|
|
8730
9093
|
const { data } = parseFrontmatter(readFileSync(md, "utf8"));
|
|
@@ -8771,15 +9134,15 @@ function outdatedStatus(e) {
|
|
|
8771
9134
|
}
|
|
8772
9135
|
function makeOutdatedCommand() {
|
|
8773
9136
|
return new Command("outdated").description("Check for assets behind their repo or library").argument("[ref]", "Check a specific asset (kind:@publisher/name)").option("--project-dir <path>", "Project directory", process.cwd()).addOption(
|
|
8774
|
-
new Option("--target <agent>", `
|
|
8775
|
-
|
|
9137
|
+
new Option("--target <agent>", `Harness target (${TARGET_DEFAULT_HINT})`).choices(
|
|
9138
|
+
SUPPORTED_HARNESSES
|
|
8776
9139
|
)
|
|
8777
9140
|
).action(async (filter, opts) => {
|
|
8778
9141
|
requireProjectConfig(opts.projectDir);
|
|
8779
9142
|
const am2 = new AssetManager({
|
|
8780
9143
|
registry: getKindRegistry(),
|
|
8781
|
-
projectDir:
|
|
8782
|
-
|
|
9144
|
+
projectDir: path19__default.resolve(opts.projectDir),
|
|
9145
|
+
harness: opts.target
|
|
8783
9146
|
});
|
|
8784
9147
|
const entries = await am2.outdated();
|
|
8785
9148
|
if (entries.length === 0) {
|
|
@@ -8821,7 +9184,7 @@ function makePatchCommand() {
|
|
|
8821
9184
|
cmd.command("extract <ref>").alias("start").description("Extract asset for local editing").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
8822
9185
|
const am2 = new AssetManager({
|
|
8823
9186
|
registry: getKindRegistry(),
|
|
8824
|
-
projectDir:
|
|
9187
|
+
projectDir: path19__default.resolve(opts.projectDir)
|
|
8825
9188
|
});
|
|
8826
9189
|
try {
|
|
8827
9190
|
const dest = await am2.patch(ref);
|
|
@@ -8835,7 +9198,7 @@ function makePatchCommand() {
|
|
|
8835
9198
|
cmd.command("commit <ref>").description("Generate .patch file from edits").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
8836
9199
|
const am2 = new AssetManager({
|
|
8837
9200
|
registry: getKindRegistry(),
|
|
8838
|
-
projectDir:
|
|
9201
|
+
projectDir: path19__default.resolve(opts.projectDir)
|
|
8839
9202
|
});
|
|
8840
9203
|
try {
|
|
8841
9204
|
const patchFile = await am2.patchCommit(ref);
|
|
@@ -8849,7 +9212,7 @@ function makePatchCommand() {
|
|
|
8849
9212
|
cmd.command("submit <ref>").description("Apply patch to repo clone and prepare for PR").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
8850
9213
|
const am2 = new AssetManager({
|
|
8851
9214
|
registry: getKindRegistry(),
|
|
8852
|
-
projectDir:
|
|
9215
|
+
projectDir: path19__default.resolve(opts.projectDir)
|
|
8853
9216
|
});
|
|
8854
9217
|
try {
|
|
8855
9218
|
await am2.patchSubmit(ref);
|
|
@@ -8865,7 +9228,7 @@ function makePatchCommand() {
|
|
|
8865
9228
|
cmd.command("remove <ref>").description("Remove local patch after upstream merge").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
|
|
8866
9229
|
const am2 = new AssetManager({
|
|
8867
9230
|
registry: getKindRegistry(),
|
|
8868
|
-
projectDir:
|
|
9231
|
+
projectDir: path19__default.resolve(opts.projectDir)
|
|
8869
9232
|
});
|
|
8870
9233
|
am2.patchRemove(ref);
|
|
8871
9234
|
logOk(`Patch removed for ${ref}`);
|
|
@@ -8884,7 +9247,7 @@ function action2(fn) {
|
|
|
8884
9247
|
};
|
|
8885
9248
|
}
|
|
8886
9249
|
async function reconcileAndReport(projectDir, plugins, opts = {}) {
|
|
8887
|
-
const { reconcilePlugins } = await import('../plugin-store-
|
|
9250
|
+
const { reconcilePlugins } = await import('../plugin-store-ABE35NRX.js');
|
|
8888
9251
|
if (plugins.length === 0) {
|
|
8889
9252
|
logInfo("No plugins declared \u2014 nothing to reconcile.");
|
|
8890
9253
|
return;
|
|
@@ -8899,22 +9262,22 @@ async function reconcileAndReport(projectDir, plugins, opts = {}) {
|
|
|
8899
9262
|
}
|
|
8900
9263
|
}
|
|
8901
9264
|
async function verifyPluginLoads(projectDir, spec) {
|
|
8902
|
-
const { loadPlugins } = await import('../plugin-store-
|
|
9265
|
+
const { loadPlugins } = await import('../plugin-store-ABE35NRX.js');
|
|
8903
9266
|
const { createPluginRegistry } = await import('../plugin-registry/index.js');
|
|
8904
9267
|
const registry = createPluginRegistry();
|
|
8905
9268
|
const result = await loadPlugins(projectDir, [spec], registry);
|
|
8906
9269
|
const failure = result.failed[0];
|
|
8907
9270
|
if (failure) throw new Error(failure.error);
|
|
8908
|
-
const contributed = ["
|
|
9271
|
+
const contributed = ["harness", "connector", "deployTarget"].flatMap(
|
|
8909
9272
|
(kind) => registry.list(kind).map((m) => `${kind} ${m.id}`)
|
|
8910
9273
|
);
|
|
8911
9274
|
logOk(`Loaded ${S.cmd(spec)}${contributed.length > 0 ? ` (${contributed.join(", ")})` : ""}`);
|
|
8912
9275
|
}
|
|
8913
9276
|
async function runInstall2(spec, opts) {
|
|
8914
|
-
const projectDir =
|
|
9277
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
8915
9278
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
8916
|
-
const { specName, rollbackPluginStore } = await import('../plugin-store-
|
|
8917
|
-
const yamlPath =
|
|
9279
|
+
const { specName, rollbackPluginStore } = await import('../plugin-store-ABE35NRX.js');
|
|
9280
|
+
const yamlPath = path19__default.join(projectDir, "skaile.yaml");
|
|
8918
9281
|
if (!existsSync(yamlPath)) {
|
|
8919
9282
|
throw new Error(`no skaile.yaml in ${projectDir}; run \`skaile init\` first`);
|
|
8920
9283
|
}
|
|
@@ -8940,10 +9303,10 @@ async function runInstall2(spec, opts) {
|
|
|
8940
9303
|
}
|
|
8941
9304
|
}
|
|
8942
9305
|
async function runRemove(name, opts) {
|
|
8943
|
-
const projectDir =
|
|
9306
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
8944
9307
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
8945
|
-
const { specName } = await import('../plugin-store-
|
|
8946
|
-
const yamlPath =
|
|
9308
|
+
const { specName } = await import('../plugin-store-ABE35NRX.js');
|
|
9309
|
+
const yamlPath = path19__default.join(projectDir, "skaile.yaml");
|
|
8947
9310
|
if (!existsSync(yamlPath)) {
|
|
8948
9311
|
logInfo(`No plugin matching ${S.cmd(name)}: there is no skaile.yaml in ${projectDir}.`);
|
|
8949
9312
|
return;
|
|
@@ -8959,7 +9322,7 @@ async function runRemove(name, opts) {
|
|
|
8959
9322
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
8960
9323
|
}
|
|
8961
9324
|
async function runList(opts) {
|
|
8962
|
-
const projectDir =
|
|
9325
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
8963
9326
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
8964
9327
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
8965
9328
|
const declared = config.plugins ?? [];
|
|
@@ -8974,7 +9337,7 @@ async function runList(opts) {
|
|
|
8974
9337
|
const registry = createPluginRegistry();
|
|
8975
9338
|
if (declared.length > 0) {
|
|
8976
9339
|
try {
|
|
8977
|
-
const { loadPlugins } = await import('../plugin-store-
|
|
9340
|
+
const { loadPlugins } = await import('../plugin-store-ABE35NRX.js');
|
|
8978
9341
|
const result = await loadPlugins(projectDir, declared, registry);
|
|
8979
9342
|
for (const f of result.failed) logWarn(f.error);
|
|
8980
9343
|
} catch (err) {
|
|
@@ -8982,7 +9345,7 @@ async function runList(opts) {
|
|
|
8982
9345
|
}
|
|
8983
9346
|
}
|
|
8984
9347
|
const kinds = [
|
|
8985
|
-
{ kind: "
|
|
9348
|
+
{ kind: "harness", label: "harnesses" },
|
|
8986
9349
|
{ kind: "connector", label: "connectors" },
|
|
8987
9350
|
{ kind: "deployTarget", label: "deploy targets" }
|
|
8988
9351
|
];
|
|
@@ -9000,7 +9363,7 @@ async function runList(opts) {
|
|
|
9000
9363
|
}
|
|
9001
9364
|
function makePluginCommand() {
|
|
9002
9365
|
const cmd = new Command("plugin").description(
|
|
9003
|
-
"Manage registry plugins (
|
|
9366
|
+
"Manage registry plugins (harnesses / connectors / deploy targets) declared in skaile.yaml"
|
|
9004
9367
|
);
|
|
9005
9368
|
cmd.command("install <spec>").description("Add a plugin spec to skaile.yaml plugins and reconcile the store").option("--project-dir <path>", "Project directory", process.cwd()).action(action2(runInstall2));
|
|
9006
9369
|
cmd.command("remove <name>").description("Remove a plugin (by package name) from skaile.yaml plugins and reconcile").option("--project-dir <path>", "Project directory", process.cwd()).action(action2(runRemove));
|
|
@@ -9242,8 +9605,8 @@ function redactSecrets(preset, findings) {
|
|
|
9242
9605
|
}
|
|
9243
9606
|
return { preset: next, keys };
|
|
9244
9607
|
}
|
|
9245
|
-
function placeholderKey(itemId,
|
|
9246
|
-
return `${itemId}_${
|
|
9608
|
+
function placeholderKey(itemId, path43) {
|
|
9609
|
+
return `${itemId}_${path43}`.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
|
|
9247
9610
|
}
|
|
9248
9611
|
function setAtPath(root, segments, value) {
|
|
9249
9612
|
let node = root;
|
|
@@ -9266,7 +9629,7 @@ function makePresetCommand() {
|
|
|
9266
9629
|
cmd.command("init [name]").description("Scaffold a new .preset.yaml file").option("--dir <path>", "Output directory", process.cwd()).action(async (name, opts) => {
|
|
9267
9630
|
const presetName = name ?? "my-preset";
|
|
9268
9631
|
const filename = `${presetName}.preset.yaml`;
|
|
9269
|
-
const outPath =
|
|
9632
|
+
const outPath = path19__default.join(path19__default.resolve(opts.dir), filename);
|
|
9270
9633
|
if (existsSync(outPath)) {
|
|
9271
9634
|
logErr(`File already exists: ${outPath}`);
|
|
9272
9635
|
logInfo("Choose a different name or remove the existing file.");
|
|
@@ -9299,7 +9662,7 @@ function makePresetCommand() {
|
|
|
9299
9662
|
return cmd;
|
|
9300
9663
|
}
|
|
9301
9664
|
async function runPresetExport(name, opts) {
|
|
9302
|
-
const projectDir =
|
|
9665
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
9303
9666
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
9304
9667
|
if (!file) {
|
|
9305
9668
|
logErr(`No skaile.yaml found in ${projectDir}`);
|
|
@@ -9309,7 +9672,7 @@ async function runPresetExport(name, opts) {
|
|
|
9309
9672
|
const presetName = name ?? file.config.name ?? "my-preset";
|
|
9310
9673
|
let lock = null;
|
|
9311
9674
|
try {
|
|
9312
|
-
lock = readLock(
|
|
9675
|
+
lock = readLock(path19__default.join(projectDir, "skaile.lock.yaml"));
|
|
9313
9676
|
} catch {
|
|
9314
9677
|
lock = null;
|
|
9315
9678
|
}
|
|
@@ -9350,7 +9713,7 @@ async function runPresetExport(name, opts) {
|
|
|
9350
9713
|
const contents = header ? `${header}
|
|
9351
9714
|
${body}` : body;
|
|
9352
9715
|
if (opts.out && opts.dir !== process.cwd()) logWarn("--dir is ignored when --out is set.");
|
|
9353
|
-
const outPath = opts.out ?
|
|
9716
|
+
const outPath = opts.out ? path19__default.resolve(opts.out) : path19__default.join(path19__default.resolve(opts.dir), `${presetName}.preset.yaml`);
|
|
9354
9717
|
if (existsSync(outPath) && !opts.force) {
|
|
9355
9718
|
logErr(`File already exists: ${outPath}`);
|
|
9356
9719
|
logInfo("Pass --force to overwrite, or choose a different --out/--dir.");
|
|
@@ -9362,7 +9725,7 @@ ${body}` : body;
|
|
|
9362
9725
|
logErr(`Failed to write ${outPath}: ${e.message}`);
|
|
9363
9726
|
process.exit(1);
|
|
9364
9727
|
}
|
|
9365
|
-
logOk(`Exported ${S.brand(
|
|
9728
|
+
logOk(`Exported ${S.brand(path19__default.basename(outPath))}`);
|
|
9366
9729
|
logInfo(`Path: ${outPath}`);
|
|
9367
9730
|
if (unresolved.length > 0) {
|
|
9368
9731
|
console.error(S.err("This file is NOT safe to share."));
|
|
@@ -9403,13 +9766,13 @@ function collectInput(value, acc) {
|
|
|
9403
9766
|
return acc;
|
|
9404
9767
|
}
|
|
9405
9768
|
async function runPresetApply(filePath, opts) {
|
|
9406
|
-
const projectDir =
|
|
9769
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
9407
9770
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
9408
9771
|
if (!file) {
|
|
9409
9772
|
logErr("No skaile.yaml \u2014 run `skaile init` first");
|
|
9410
9773
|
process.exit(1);
|
|
9411
9774
|
}
|
|
9412
|
-
const resolved =
|
|
9775
|
+
const resolved = path19__default.resolve(filePath);
|
|
9413
9776
|
if (!existsSync(resolved)) {
|
|
9414
9777
|
logErr(`File not found: ${resolved}`);
|
|
9415
9778
|
process.exit(1);
|
|
@@ -9627,7 +9990,7 @@ async function reportNestedPresetRefs(preset) {
|
|
|
9627
9990
|
}
|
|
9628
9991
|
async function checkPresetCycles(preset, resolved) {
|
|
9629
9992
|
const { detectCycles } = await import('../discovery/index.js');
|
|
9630
|
-
const presetRef =
|
|
9993
|
+
const presetRef = path19__default.basename(resolved, ".preset.yaml");
|
|
9631
9994
|
const edges = [];
|
|
9632
9995
|
for (const item of preset.items) {
|
|
9633
9996
|
if (item.ref) {
|
|
@@ -9679,7 +10042,7 @@ function printPresetSummary(preset, placeholderCount, hasWarnings) {
|
|
|
9679
10042
|
}
|
|
9680
10043
|
}
|
|
9681
10044
|
async function runPresetValidate(filePath) {
|
|
9682
|
-
const resolved =
|
|
10045
|
+
const resolved = path19__default.resolve(filePath);
|
|
9683
10046
|
const preset = await loadPresetForValidation(resolved);
|
|
9684
10047
|
await reportNestedPresetRefs(preset);
|
|
9685
10048
|
await checkPresetCycles(preset, resolved);
|
|
@@ -9732,7 +10095,7 @@ function resolveNamedAgent(projectDir, arg) {
|
|
|
9732
10095
|
logErr(message);
|
|
9733
10096
|
process.exit(1);
|
|
9734
10097
|
};
|
|
9735
|
-
const asPath =
|
|
10098
|
+
const asPath = path19__default.resolve(projectDir, arg);
|
|
9736
10099
|
const isPath = arg.includes("/") || arg.includes("\\");
|
|
9737
10100
|
const viaRef = (ref) => {
|
|
9738
10101
|
try {
|
|
@@ -9757,7 +10120,7 @@ function resolveNamedAgent(projectDir, arg) {
|
|
|
9757
10120
|
if (!(err instanceof AgentRefResolutionError)) throw err;
|
|
9758
10121
|
if (err.code === "ambiguous") return fail(err.message);
|
|
9759
10122
|
}
|
|
9760
|
-
if (existsSync(
|
|
10123
|
+
if (existsSync(path19__default.join(asPath, "agent.yaml"))) return asPath;
|
|
9761
10124
|
const known = Object.keys(instances);
|
|
9762
10125
|
return fail(
|
|
9763
10126
|
`No agent "${arg}" found. Give an agent name, an agent: ref or a path` + (known.length > 0 ? ` (agent instances of this project: ${known.join(", ")})` : "") + "."
|
|
@@ -9768,7 +10131,7 @@ function makeRebuildCommand() {
|
|
|
9768
10131
|
"[agent]",
|
|
9769
10132
|
"Agent name, agent: ref, instance id or path (defaults to the project agent)"
|
|
9770
10133
|
).option("--project-dir <dir>", "Project directory", process.cwd()).action(async (agentArg, opts) => {
|
|
9771
|
-
const projectDir =
|
|
10134
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
9772
10135
|
requireProjectConfig(projectDir, { allowMissing: true });
|
|
9773
10136
|
let agentDir;
|
|
9774
10137
|
if (agentArg) {
|
|
@@ -9826,26 +10189,26 @@ function makeRebuildCommand() {
|
|
|
9826
10189
|
}
|
|
9827
10190
|
function resolveSingleShotAgentDir(projectDir, agentDefinition) {
|
|
9828
10191
|
if (!agentDefinition) return resolveAgentDir(projectDir);
|
|
9829
|
-
const asPath = agentDefinition.endsWith("agent.yaml") ?
|
|
10192
|
+
const asPath = agentDefinition.endsWith("agent.yaml") ? path19__default.dirname(path19__default.resolve(projectDir, agentDefinition)) : agentDefinition;
|
|
9830
10193
|
const dir = resolveAgentDefinitionDir(projectDir, asPath);
|
|
9831
|
-
if (!dir || !fs8__default.existsSync(
|
|
10194
|
+
if (!dir || !fs8__default.existsSync(path19__default.join(dir, "agent.yaml"))) {
|
|
9832
10195
|
throw new Error(
|
|
9833
10196
|
`--agent-definition "${agentDefinition}" does not resolve to an agent directory with agent.yaml${dir ? ` (looked in ${dir})` : ""}`
|
|
9834
10197
|
);
|
|
9835
10198
|
}
|
|
9836
10199
|
return dir;
|
|
9837
10200
|
}
|
|
9838
|
-
async function printCompositionDryRun(projectDir, agentDir,
|
|
10201
|
+
async function printCompositionDryRun(projectDir, agentDir, harness, model, instanceIdOverride) {
|
|
9839
10202
|
const manifest = agentDir ? await loadAgentManifest(agentDir) : void 0;
|
|
9840
|
-
const refusal =
|
|
10203
|
+
const refusal = checkHarnessModel(harness, {
|
|
9841
10204
|
registry: loadRegistryView({ projectDir }).merged,
|
|
9842
|
-
model: model ??
|
|
10205
|
+
model: model ?? manifestModelForHarness(manifest, harness)
|
|
9843
10206
|
});
|
|
9844
10207
|
if (refusal) throw new Error(refusal);
|
|
9845
10208
|
console.log();
|
|
9846
10209
|
console.log(` ${S.label("Project dir:")} ${projectDir}`);
|
|
9847
10210
|
console.log(` ${S.label("Agent dir:")} ${agentDir ?? S.dim("(none)")}`);
|
|
9848
|
-
console.log(` ${S.label("
|
|
10211
|
+
console.log(` ${S.label("Harness:")} ${harness}${model ? S.dim(` / ${model}`) : ""}`);
|
|
9849
10212
|
console.log(` ${S.warn("(dry run \u2014 no model will be started)")}`);
|
|
9850
10213
|
console.log();
|
|
9851
10214
|
if (!agentDir || !manifest) {
|
|
@@ -9863,7 +10226,7 @@ async function printCompositionDryRun(projectDir, agentDir, driver, model, insta
|
|
|
9863
10226
|
asset: { manifest, dir: agentDir },
|
|
9864
10227
|
projectDir,
|
|
9865
10228
|
registry: getKindRegistry(),
|
|
9866
|
-
host: { nativeSubagents:
|
|
10229
|
+
host: { nativeSubagents: harnessNameForHarnessId(harness) !== void 0 },
|
|
9867
10230
|
dryRun: true
|
|
9868
10231
|
});
|
|
9869
10232
|
console.log(` ${S.label("Instance:")} ${instanceId2}`);
|
|
@@ -9886,8 +10249,8 @@ async function printCompositionDryRun(projectDir, agentDir, driver, model, insta
|
|
|
9886
10249
|
}
|
|
9887
10250
|
async function findSkillFile(projectDir, skill) {
|
|
9888
10251
|
const name = skill.trim().replace(/^skill:/, "").replace(/^@[^/]+\//, "").replace(/#.*$/, "");
|
|
9889
|
-
for (const target of
|
|
9890
|
-
const file =
|
|
10252
|
+
for (const target of SUPPORTED_HARNESSES) {
|
|
10253
|
+
const file = path19__default.join(deployedDir("skill", name, target, false, projectDir), "SKILL.md");
|
|
9891
10254
|
if (fs8__default.existsSync(file)) return file;
|
|
9892
10255
|
}
|
|
9893
10256
|
const am2 = new AssetManager({ registry: getKindRegistry(), projectDir });
|
|
@@ -9903,6 +10266,14 @@ async function printSkillDryRun(projectDir, skill) {
|
|
|
9903
10266
|
return false;
|
|
9904
10267
|
}
|
|
9905
10268
|
const content = fs8__default.readFileSync(file, "utf-8");
|
|
10269
|
+
const prerequisiteErrors = checkAssetFile(file, "skill", getKindRegistry()).filter(
|
|
10270
|
+
(f) => f.text.startsWith("metadata.prerequisites")
|
|
10271
|
+
);
|
|
10272
|
+
if (prerequisiteErrors.length > 0) {
|
|
10273
|
+
for (const f of prerequisiteErrors) logErr(`${file} [${f.tag}] - ${f.text}`);
|
|
10274
|
+
logErr(`Fix the skill's metadata.prerequisites (see \`skaile validate\`), then run it again.`);
|
|
10275
|
+
return false;
|
|
10276
|
+
}
|
|
9906
10277
|
const { data } = parseFrontmatter(content);
|
|
9907
10278
|
const meta = data.metadata ?? {};
|
|
9908
10279
|
console.log(` ${S.label("Skill:")} ${S.heading(String(data.name ?? skill))}`);
|
|
@@ -9999,20 +10370,21 @@ function isNearFlowId(typed, id) {
|
|
|
9999
10370
|
const b = id.toLowerCase();
|
|
10000
10371
|
return a.length >= 3 && (b.includes(a) || a.includes(b) || editDistance2(a, b) <= 2);
|
|
10001
10372
|
}
|
|
10002
|
-
function
|
|
10003
|
-
return `Harness to run (${
|
|
10373
|
+
function harnessOptionDescription() {
|
|
10374
|
+
return `Harness to run (${listHarnesses().map((d) => d.id).join(", ")})`;
|
|
10004
10375
|
}
|
|
10005
10376
|
function makeRunCommand() {
|
|
10006
|
-
const cmd = new Command("run").description("Start a flow or run a single-shot text prompt").argument("[flow-id-or-text...]", "Flow ID or text prompt").option("--project-dir <path>", "Project directory", process.cwd()).option("--
|
|
10377
|
+
const cmd = new Command("run").description("Start a flow or run a single-shot text prompt").argument("[flow-id-or-text...]", "Flow ID or text prompt").option("--project-dir <path>", "Project directory", process.cwd()).option("--harness <name>", harnessOptionDescription()).addOption(driverAliasOption()).option("--model <name>", "Model override").option("--label <label>", "Human-readable session label").option("--dry-run", "Print plan without executing (single-shot: resolved composition items)").option(
|
|
10007
10378
|
"--agent-definition <ref|path>",
|
|
10008
10379
|
"Agent asset for this one invocation (agent:@pub/name, ai-assets://\u2026, or a directory with agent.yaml); single-shot prompts only"
|
|
10009
10380
|
).option(
|
|
10010
10381
|
"--instance <id>",
|
|
10011
10382
|
"Run the skaile.yaml `agents:` instance <id> (`default` is the primary `agent:`) with its overrides; single-shot prompts only"
|
|
10012
10383
|
).option("--skill <name>", "Skill name (for single-shot mode)").action(async (positional, opts) => {
|
|
10013
|
-
const projectDir =
|
|
10384
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
10014
10385
|
await loadDeclaredPlugins(projectDir);
|
|
10015
|
-
|
|
10386
|
+
await reportProjectConfig(projectDir, { harness: false });
|
|
10387
|
+
const cliHarness = foldDriverFlag(opts).harness;
|
|
10016
10388
|
const dryRun = opts.dryRun ?? false;
|
|
10017
10389
|
const agentDefinition = opts.agentDefinition?.trim() || void 0;
|
|
10018
10390
|
const instanceId2 = opts.instance?.trim() || void 0;
|
|
@@ -10046,17 +10418,17 @@ function makeRunCommand() {
|
|
|
10046
10418
|
flowId = selected;
|
|
10047
10419
|
}
|
|
10048
10420
|
const config = await resolveSettings(projectDir, {
|
|
10049
|
-
|
|
10421
|
+
harness: cliHarness,
|
|
10050
10422
|
model: opts.model
|
|
10051
10423
|
});
|
|
10052
|
-
const
|
|
10424
|
+
const harness = config.harness ?? DEFAULT_HARNESS_ID;
|
|
10053
10425
|
const model = config.model;
|
|
10054
|
-
const
|
|
10055
|
-
if (
|
|
10056
|
-
logErr(
|
|
10426
|
+
const unknownHarness = unknownHarnessMessage(harness);
|
|
10427
|
+
if (unknownHarness) {
|
|
10428
|
+
logErr(unknownHarness);
|
|
10057
10429
|
process.exit(1);
|
|
10058
10430
|
}
|
|
10059
|
-
const providerRefusal = checkModelProvider(
|
|
10431
|
+
const providerRefusal = checkModelProvider(harness, {
|
|
10060
10432
|
registry: loadRegistryView({ projectDir }).merged,
|
|
10061
10433
|
model
|
|
10062
10434
|
});
|
|
@@ -10104,7 +10476,7 @@ function makeRunCommand() {
|
|
|
10104
10476
|
try {
|
|
10105
10477
|
const agentDir = instanceId2 ? resolveInstanceAgentDir(projectDir, resolveSkWorkspaceConfig(projectDir), instanceId2) : resolveSingleShotAgentDir(projectDir, agentDefinition);
|
|
10106
10478
|
if (dryRun) {
|
|
10107
|
-
await printCompositionDryRun(projectDir, agentDir,
|
|
10479
|
+
await printCompositionDryRun(projectDir, agentDir, harness, model, instanceId2);
|
|
10108
10480
|
if (opts.skill && !await printSkillDryRun(projectDir, opts.skill)) {
|
|
10109
10481
|
process.exit(1);
|
|
10110
10482
|
}
|
|
@@ -10116,7 +10488,7 @@ function makeRunCommand() {
|
|
|
10116
10488
|
projectDir,
|
|
10117
10489
|
...agentDir ? { agentDir } : {},
|
|
10118
10490
|
...instanceId2 ? { instanceId: instanceId2 } : {},
|
|
10119
|
-
|
|
10491
|
+
harness: config.harness,
|
|
10120
10492
|
model: instanceModel ?? config.model,
|
|
10121
10493
|
...instanceModel ? { modelRef: instanceModel } : {},
|
|
10122
10494
|
...overrides.maxTurns !== void 0 ? { maxTurns: overrides.maxTurns } : {},
|
|
@@ -10129,12 +10501,12 @@ function makeRunCommand() {
|
|
|
10129
10501
|
logErr(`${err.code}: ${err.message}`);
|
|
10130
10502
|
process.exit(1);
|
|
10131
10503
|
}
|
|
10132
|
-
const friendly =
|
|
10504
|
+
const friendly = friendlyHarnessError(err);
|
|
10133
10505
|
if (friendly) {
|
|
10134
10506
|
logErr(friendly);
|
|
10135
10507
|
} else {
|
|
10136
10508
|
logErr(err instanceof Error ? err.message : String(err));
|
|
10137
|
-
for (const note of
|
|
10509
|
+
for (const note of harnessErrorNotes(err)) console.error(` ${S.dim(note)}`);
|
|
10138
10510
|
}
|
|
10139
10511
|
process.exit(1);
|
|
10140
10512
|
}
|
|
@@ -10152,7 +10524,7 @@ function makeRunCommand() {
|
|
|
10152
10524
|
console.log();
|
|
10153
10525
|
console.log(` ${S.label("Flow:")} ${S.heading(flow.name)}`);
|
|
10154
10526
|
console.log(` ${S.label("Project dir:")} ${projectDir}`);
|
|
10155
|
-
console.log(` ${S.label("
|
|
10527
|
+
console.log(` ${S.label("Harness:")} ${harness}${model ? S.dim(` / ${model}`) : ""}`);
|
|
10156
10528
|
if (opts.label) console.log(` ${S.label("Label:")} ${opts.label}`);
|
|
10157
10529
|
if (dryRun) console.log(` ${S.warn("(dry run \u2014 no agent will be started)")}`);
|
|
10158
10530
|
console.log();
|
|
@@ -10160,7 +10532,7 @@ function makeRunCommand() {
|
|
|
10160
10532
|
await runFlow({
|
|
10161
10533
|
projectDir,
|
|
10162
10534
|
flowPath,
|
|
10163
|
-
|
|
10535
|
+
harness,
|
|
10164
10536
|
model,
|
|
10165
10537
|
sessionLabel: opts.label,
|
|
10166
10538
|
dryRun,
|
|
@@ -10168,7 +10540,7 @@ function makeRunCommand() {
|
|
|
10168
10540
|
onLog: (line) => console.log(line)
|
|
10169
10541
|
});
|
|
10170
10542
|
} catch (err) {
|
|
10171
|
-
const friendly =
|
|
10543
|
+
const friendly = friendlyHarnessError(err);
|
|
10172
10544
|
logErr(friendly ?? (err instanceof Error ? err.message : String(err)));
|
|
10173
10545
|
process.exit(1);
|
|
10174
10546
|
}
|
|
@@ -10180,7 +10552,7 @@ function makeResumeCommand() {
|
|
|
10180
10552
|
"--session <run-id>",
|
|
10181
10553
|
"Target session by runId (full ID or the prefix `session list` prints)"
|
|
10182
10554
|
).option("--dry-run", "Print plan without executing").action(async (opts) => {
|
|
10183
|
-
const projectDir =
|
|
10555
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
10184
10556
|
let sessionId = opts.session;
|
|
10185
10557
|
const dryRun = opts.dryRun ?? false;
|
|
10186
10558
|
if (sessionId) {
|
|
@@ -10212,7 +10584,7 @@ function makeResumeCommand() {
|
|
|
10212
10584
|
onLog: (line) => console.log(line)
|
|
10213
10585
|
});
|
|
10214
10586
|
} catch (err) {
|
|
10215
|
-
const friendly =
|
|
10587
|
+
const friendly = friendlyHarnessError(err);
|
|
10216
10588
|
logErr(friendly ?? (err instanceof Error ? err.message : String(err)));
|
|
10217
10589
|
process.exit(1);
|
|
10218
10590
|
}
|
|
@@ -10221,7 +10593,7 @@ function makeResumeCommand() {
|
|
|
10221
10593
|
}
|
|
10222
10594
|
function makeStatusCommand() {
|
|
10223
10595
|
return new Command("status").description("Show current session state").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
10224
|
-
const projectDir =
|
|
10596
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
10225
10597
|
const session = await loadSession(projectDir);
|
|
10226
10598
|
if (!session) {
|
|
10227
10599
|
logInfo("No active session.");
|
|
@@ -10236,7 +10608,7 @@ function makeStatusCommand() {
|
|
|
10236
10608
|
console.log(` ${S.label("Status:")} ${statusColor(session.status ?? "unknown")}`);
|
|
10237
10609
|
if (session.error) console.log(` ${S.label("Error:")} ${session.error}`);
|
|
10238
10610
|
console.log(
|
|
10239
|
-
` ${S.label("
|
|
10611
|
+
` ${S.label("Harness:")} ${session.harness}${session.model ? S.dim(` / ${session.model}`) : ""}`
|
|
10240
10612
|
);
|
|
10241
10613
|
console.log(` ${S.label("Updated:")} ${session.updatedAt} ${S.dim(`(${age}s ago)`)}`);
|
|
10242
10614
|
console.log(
|
|
@@ -10247,25 +10619,25 @@ function makeStatusCommand() {
|
|
|
10247
10619
|
}
|
|
10248
10620
|
function makeClearCommand() {
|
|
10249
10621
|
return new Command("clear").description("Unset current session pointer").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
10250
|
-
const projectDir =
|
|
10622
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
10251
10623
|
await clearSession(projectDir);
|
|
10252
10624
|
logOk("Session cleared.");
|
|
10253
10625
|
});
|
|
10254
10626
|
}
|
|
10255
10627
|
function makeReplCommand() {
|
|
10256
|
-
return new Command("repl").description("Start an interactive agent session").option("--project-dir <path>", "Project directory").option("--
|
|
10628
|
+
return new Command("repl").description("Start an interactive agent session").option("--project-dir <path>", "Project directory").option("--harness <name>", harnessOptionDescription()).addOption(driverAliasOption()).option("--model <name>", "Model override").option("--resume", "Resume last session").option("--resume-session <id>", "Resume specific session").option(
|
|
10257
10629
|
"--instance <id>",
|
|
10258
10630
|
"Run the skaile.yaml `agents:` instance <id> (`default` is the primary `agent:`) with its overrides"
|
|
10259
10631
|
).action(async (opts) => {
|
|
10260
|
-
const { findWorkspaceRoot } = await import('../core/index.js');
|
|
10632
|
+
const { findWorkspaceRoot: findWorkspaceRoot2 } = await import('../core/index.js');
|
|
10261
10633
|
const { startRepl } = await import('../tui/index.js');
|
|
10262
|
-
const
|
|
10263
|
-
const userCwd =
|
|
10264
|
-
const workspaceRoot =
|
|
10634
|
+
const os3 = await import('os');
|
|
10635
|
+
const userCwd = path19__default.resolve(opts.projectDir ?? process.cwd());
|
|
10636
|
+
const workspaceRoot = findWorkspaceRoot2(userCwd);
|
|
10265
10637
|
const instanceId2 = opts.instance?.trim() || void 0;
|
|
10266
10638
|
let projectDir;
|
|
10267
10639
|
let agentCwd;
|
|
10268
|
-
let
|
|
10640
|
+
let harnessOverride = foldDriverFlag(opts).harness;
|
|
10269
10641
|
if (workspaceRoot) {
|
|
10270
10642
|
projectDir = workspaceRoot;
|
|
10271
10643
|
agentCwd = userCwd;
|
|
@@ -10289,25 +10661,26 @@ function makeReplCommand() {
|
|
|
10289
10661
|
p4.cancel("Cancelled.");
|
|
10290
10662
|
process.exit(0);
|
|
10291
10663
|
}
|
|
10292
|
-
const tmpDir = fs8__default.mkdtempSync(
|
|
10664
|
+
const tmpDir = fs8__default.mkdtempSync(path19__default.join(os3.tmpdir(), "skaile-repl-"));
|
|
10293
10665
|
projectDir = tmpDir;
|
|
10294
10666
|
agentCwd = userCwd;
|
|
10295
10667
|
logOk(`Temporary workspace: ${S.cmd(tmpDir)}`);
|
|
10296
|
-
if (!
|
|
10297
|
-
const claudeDir =
|
|
10668
|
+
if (!harnessOverride) {
|
|
10669
|
+
const claudeDir = path19__default.join(os3.homedir(), ".claude");
|
|
10298
10670
|
if (fs8__default.existsSync(claudeDir)) {
|
|
10299
|
-
|
|
10671
|
+
harnessOverride = "claude-sdk";
|
|
10300
10672
|
logInfo(`Detected ${S.cmd("~/.claude")} \u2192 using ${S.cmd("claude-sdk")} harness`);
|
|
10301
10673
|
} else {
|
|
10302
|
-
|
|
10674
|
+
harnessOverride = "omp";
|
|
10303
10675
|
logInfo(`Using ${S.cmd("omp")} harness`);
|
|
10304
10676
|
}
|
|
10305
10677
|
}
|
|
10306
10678
|
console.log();
|
|
10307
10679
|
}
|
|
10308
10680
|
await loadDeclaredPlugins(projectDir);
|
|
10681
|
+
await reportProjectConfig(projectDir, { harness: false });
|
|
10309
10682
|
const effective = await resolveSettings(projectDir, {
|
|
10310
|
-
|
|
10683
|
+
harness: harnessOverride,
|
|
10311
10684
|
model: opts.model
|
|
10312
10685
|
});
|
|
10313
10686
|
let effectiveModel = effective.model;
|
|
@@ -10317,7 +10690,7 @@ function makeReplCommand() {
|
|
|
10317
10690
|
} catch {
|
|
10318
10691
|
}
|
|
10319
10692
|
}
|
|
10320
|
-
const providerRefusal = checkModelProvider(effective.
|
|
10693
|
+
const providerRefusal = checkModelProvider(effective.harness ?? DEFAULT_HARNESS_ID, {
|
|
10321
10694
|
registry: loadRegistryView({ projectDir }).merged,
|
|
10322
10695
|
model: effectiveModel
|
|
10323
10696
|
});
|
|
@@ -10329,14 +10702,14 @@ function makeReplCommand() {
|
|
|
10329
10702
|
await startRepl({
|
|
10330
10703
|
projectDir,
|
|
10331
10704
|
cwd: agentCwd !== projectDir ? agentCwd : void 0,
|
|
10332
|
-
|
|
10705
|
+
harness: harnessOverride,
|
|
10333
10706
|
model: opts.model,
|
|
10334
10707
|
resume: opts.resume,
|
|
10335
10708
|
resumeSessionId: opts.resumeSession,
|
|
10336
10709
|
...instanceId2 ? { instanceId: instanceId2 } : {}
|
|
10337
10710
|
});
|
|
10338
10711
|
} catch (err) {
|
|
10339
|
-
logErr(
|
|
10712
|
+
logErr(friendlyHarnessError(err) ?? (err instanceof Error ? err.message : String(err)));
|
|
10340
10713
|
process.exit(1);
|
|
10341
10714
|
}
|
|
10342
10715
|
});
|
|
@@ -10393,12 +10766,12 @@ function makeServeCommand() {
|
|
|
10393
10766
|
).option("--project-dir <path>", "Project directory", process.cwd()).option(
|
|
10394
10767
|
"--managed-codex-config <path>",
|
|
10395
10768
|
"Explicit private host configuration for managed Codex"
|
|
10396
|
-
).option("--
|
|
10769
|
+
).option("--harness <name>", "Override harness").addOption(driverAliasOption()).option("--model <name>", "Override model").option("--provider <name>", "Override provider").option(
|
|
10397
10770
|
"--session-id <id>",
|
|
10398
10771
|
"Label for the session; does not restore the conversation (use --resume-session-id)"
|
|
10399
10772
|
).option(
|
|
10400
10773
|
"--resume-session-id <id>",
|
|
10401
|
-
"
|
|
10774
|
+
"harnessSessionId of an earlier session (from its session_info event); restores that conversation"
|
|
10402
10775
|
).option(
|
|
10403
10776
|
"--providers <ids>",
|
|
10404
10777
|
"Restrict the AI provider registry to these entry ids (comma-separated)"
|
|
@@ -10409,7 +10782,8 @@ function makeServeCommand() {
|
|
|
10409
10782
|
"--with-codex",
|
|
10410
10783
|
"Include the Codex harness in the compiled binary (used with --compile-test)"
|
|
10411
10784
|
).action(
|
|
10412
|
-
async (
|
|
10785
|
+
async (rawOpts) => {
|
|
10786
|
+
const opts = foldDriverFlag(rawOpts);
|
|
10413
10787
|
if (opts.compileTest && opts.managedCodexConfig)
|
|
10414
10788
|
throw new Error("Managed Codex configuration is unsupported with --compile-test");
|
|
10415
10789
|
if (opts.compileTest) {
|
|
@@ -10455,10 +10829,10 @@ function makeServeCommand() {
|
|
|
10455
10829
|
}
|
|
10456
10830
|
const providers = parseProviderIds(opts.providers);
|
|
10457
10831
|
const modelEndpoint = parseModelEndpointFlag(opts.modelEndpoint);
|
|
10458
|
-
const {
|
|
10459
|
-
const
|
|
10460
|
-
if (
|
|
10461
|
-
logErr(
|
|
10832
|
+
const { checkHarnessSdk, checkModelEndpointPeer, checkServeModel } = await import('../serve-preflight-FLTIBTEX.js');
|
|
10833
|
+
const harnessProblem = managedCodex ? null : await checkHarnessSdk(opts.projectDir, opts.harness);
|
|
10834
|
+
if (harnessProblem) {
|
|
10835
|
+
logErr(harnessProblem);
|
|
10462
10836
|
process.exitCode = 1;
|
|
10463
10837
|
return;
|
|
10464
10838
|
}
|
|
@@ -10469,7 +10843,7 @@ function makeServeCommand() {
|
|
|
10469
10843
|
return;
|
|
10470
10844
|
}
|
|
10471
10845
|
const modelProblem = managedCodex ? null : await checkServeModel(opts.projectDir, {
|
|
10472
|
-
|
|
10846
|
+
harness: opts.harness,
|
|
10473
10847
|
model: opts.model,
|
|
10474
10848
|
providers
|
|
10475
10849
|
});
|
|
@@ -10498,7 +10872,7 @@ function makeServeCommand() {
|
|
|
10498
10872
|
// `nix` deploy targets set it for children meant to outlive them.
|
|
10499
10873
|
exitOnBrokenPipe: process.env.SKAILE_SERVE_EXIT_ON_BROKEN_STDOUT !== "0",
|
|
10500
10874
|
projectDir: opts.projectDir,
|
|
10501
|
-
|
|
10875
|
+
harness: opts.harness,
|
|
10502
10876
|
model: opts.model,
|
|
10503
10877
|
provider: opts.provider,
|
|
10504
10878
|
sessionId: opts.sessionId,
|
|
@@ -10516,12 +10890,12 @@ function makeServeCommand() {
|
|
|
10516
10890
|
);
|
|
10517
10891
|
}
|
|
10518
10892
|
async function ensurePluginsLoadedForServe(projectDir) {
|
|
10519
|
-
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-
|
|
10893
|
+
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-JNMK3FC2.js');
|
|
10520
10894
|
try {
|
|
10521
10895
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
10522
10896
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
10523
10897
|
if (!config.plugins || config.plugins.length === 0) return;
|
|
10524
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
10898
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-ABE35NRX.js');
|
|
10525
10899
|
const { pluginRegistry } = await import('../plugin-registry/index.js');
|
|
10526
10900
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
10527
10901
|
if (result.loaded.length > 0) {
|
|
@@ -10535,14 +10909,14 @@ async function ensurePluginsLoadedForServe(projectDir) {
|
|
|
10535
10909
|
}
|
|
10536
10910
|
}
|
|
10537
10911
|
async function runCompileTest(opts) {
|
|
10538
|
-
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-
|
|
10912
|
+
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-JNMK3FC2.js');
|
|
10539
10913
|
const { tmpdir } = await import('os');
|
|
10540
10914
|
const { dirname: dirname3, join: join6, resolve: resolve4 } = await import('path');
|
|
10541
10915
|
const { fileURLToPath: fileURLToPath2 } = await import('url');
|
|
10542
|
-
const { unlinkSync, existsSync:
|
|
10916
|
+
const { unlinkSync, existsSync: existsSync22 } = await import('fs');
|
|
10543
10917
|
const { spawn } = await import('child_process');
|
|
10544
10918
|
const { portableSpawnSync: portableSpawnSync2 } = await import('../core/index.js');
|
|
10545
|
-
const { MONOREPO_ROOT } = await import('../paths-
|
|
10919
|
+
const { MONOREPO_ROOT } = await import('../paths-UKWE35XS.js');
|
|
10546
10920
|
if (MONOREPO_ROOT === null) {
|
|
10547
10921
|
logErr2("--compile-test is only available inside the skaile-dev workspace.");
|
|
10548
10922
|
logInfo2("Run it from a checkout of skaile-ai/skaile-dev (the monorepo shell).");
|
|
@@ -10586,7 +10960,7 @@ async function runCompileTest(opts) {
|
|
|
10586
10960
|
}
|
|
10587
10961
|
logOk2(`Binary built (${S2.dim(outfile)})`);
|
|
10588
10962
|
const serveArgs = [outfile, "serve", "--port", opts.port, "--project-dir", opts.projectDir];
|
|
10589
|
-
if (opts.
|
|
10963
|
+
if (opts.harness) serveArgs.push("--harness", opts.harness);
|
|
10590
10964
|
if (opts.model) serveArgs.push("--model", opts.model);
|
|
10591
10965
|
if (opts.provider) serveArgs.push("--provider", opts.provider);
|
|
10592
10966
|
if (opts.sessionId) serveArgs.push("--session-id", opts.sessionId);
|
|
@@ -10604,7 +10978,7 @@ async function runCompileTest(opts) {
|
|
|
10604
10978
|
} catch {
|
|
10605
10979
|
}
|
|
10606
10980
|
try {
|
|
10607
|
-
if (
|
|
10981
|
+
if (existsSync22(outfile)) unlinkSync(outfile);
|
|
10608
10982
|
} catch {
|
|
10609
10983
|
}
|
|
10610
10984
|
}
|
|
@@ -10735,6 +11109,15 @@ function localQuery(dbPath, q) {
|
|
|
10735
11109
|
db.close();
|
|
10736
11110
|
}
|
|
10737
11111
|
}
|
|
11112
|
+
function localSessionExists(dbPath, sessionId) {
|
|
11113
|
+
const db = openSqlite(dbPath, { readonly: true });
|
|
11114
|
+
try {
|
|
11115
|
+
db.exec("PRAGMA query_only=1;");
|
|
11116
|
+
return db.prepare("SELECT 1 AS found FROM log_entries WHERE session_id = $sid LIMIT 1").get({ $sid: sessionId }) != null;
|
|
11117
|
+
} finally {
|
|
11118
|
+
db.close();
|
|
11119
|
+
}
|
|
11120
|
+
}
|
|
10738
11121
|
function buildSelect(q) {
|
|
10739
11122
|
const where = ["session_id = $sid"];
|
|
10740
11123
|
const params = { $sid: q.sessionId };
|
|
@@ -11025,7 +11408,7 @@ function resolveMode2(opts) {
|
|
|
11025
11408
|
if (opts.forceLocal && opts.forceRemote) {
|
|
11026
11409
|
throw new Error("Cannot use both --local and --remote");
|
|
11027
11410
|
}
|
|
11028
|
-
const startDir =
|
|
11411
|
+
const startDir = path19__default.resolve(opts.projectDir ?? process.cwd());
|
|
11029
11412
|
const localDb = findLogsDb(startDir);
|
|
11030
11413
|
if (opts.forceLocal) {
|
|
11031
11414
|
if (!localDb) {
|
|
@@ -11058,14 +11441,14 @@ function resolveMode2(opts) {
|
|
|
11058
11441
|
function findLogsDb(startDir) {
|
|
11059
11442
|
let dir = startDir;
|
|
11060
11443
|
for (let i = 0; i < MAX_WALK_LEVELS; i++) {
|
|
11061
|
-
const candidate =
|
|
11444
|
+
const candidate = path19__default.join(dir, ".skaile", "logs.db");
|
|
11062
11445
|
if (existsSync(candidate)) {
|
|
11063
11446
|
try {
|
|
11064
11447
|
if (statSync(candidate).isFile()) return candidate;
|
|
11065
11448
|
} catch {
|
|
11066
11449
|
}
|
|
11067
11450
|
}
|
|
11068
|
-
const parent =
|
|
11451
|
+
const parent = path19__default.dirname(dir);
|
|
11069
11452
|
if (parent === dir) return void 0;
|
|
11070
11453
|
dir = parent;
|
|
11071
11454
|
}
|
|
@@ -11164,6 +11547,9 @@ function buildLogQuery(opts) {
|
|
|
11164
11547
|
async function fetchEntries(sessionId, opts, resolved, query) {
|
|
11165
11548
|
if (resolved.mode === "local") {
|
|
11166
11549
|
const result2 = localQuery(resolved.dbPath, { ...query, sessionId });
|
|
11550
|
+
if (result2.entries.length === 0 && !localSessionExists(resolved.dbPath, sessionId)) {
|
|
11551
|
+
throw new Error(`No session ${sessionId} in this project's log database.`);
|
|
11552
|
+
}
|
|
11167
11553
|
return { entries: result2.entries, nextCursor: result2.nextCursor };
|
|
11168
11554
|
}
|
|
11169
11555
|
if (!opts.projectId) {
|
|
@@ -11255,7 +11641,7 @@ async function requireSession(projectDir, idOrPrefix) {
|
|
|
11255
11641
|
function makeSessionCommand() {
|
|
11256
11642
|
const cmd = new Command("session").description("Manage sessions");
|
|
11257
11643
|
cmd.command("list").description("List all sessions for a project").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
11258
|
-
const projectDir =
|
|
11644
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
11259
11645
|
const sessions = await listSessions(projectDir);
|
|
11260
11646
|
const current = await loadSession(projectDir);
|
|
11261
11647
|
if (sessions.length === 0) {
|
|
@@ -11283,18 +11669,18 @@ function makeSessionCommand() {
|
|
|
11283
11669
|
console.log();
|
|
11284
11670
|
});
|
|
11285
11671
|
cmd.command("show <run-id>").description("Show a specific session (full run ID or the prefix `session list` prints)").option("--project-dir <path>", "Project directory", process.cwd()).action(async (idOrPrefix, opts) => {
|
|
11286
|
-
const projectDir =
|
|
11672
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
11287
11673
|
const { session } = await requireSession(projectDir, idOrPrefix);
|
|
11288
11674
|
console.log(JSON.stringify(session, null, 2));
|
|
11289
11675
|
});
|
|
11290
11676
|
cmd.command("switch <run-id>").description("Switch the current session (full run ID or the prefix `session list` prints)").option("--project-dir <path>", "Project directory", process.cwd()).action(async (idOrPrefix, opts) => {
|
|
11291
|
-
const projectDir =
|
|
11677
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
11292
11678
|
const { runId } = await requireSession(projectDir, idOrPrefix);
|
|
11293
11679
|
await setCurrentSession(projectDir, runId);
|
|
11294
11680
|
logOk(`Switched to session: ${S.dim(runId.slice(0, 8))}`);
|
|
11295
11681
|
});
|
|
11296
11682
|
cmd.command("delete <run-id>").description("Delete a session (full run ID or the prefix `session list` prints)").option("--project-dir <path>", "Project directory", process.cwd()).action(async (idOrPrefix, opts) => {
|
|
11297
|
-
const projectDir =
|
|
11683
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
11298
11684
|
const { runId } = await requireSession(projectDir, idOrPrefix);
|
|
11299
11685
|
await deleteSession(projectDir, runId);
|
|
11300
11686
|
logOk(`Deleted session: ${S.dim(runId.slice(0, 8))}`);
|
|
@@ -11371,8 +11757,8 @@ function makeShowCommand() {
|
|
|
11371
11757
|
requireProjectConfig(opts.projectDir, { allowMissing: true });
|
|
11372
11758
|
const am2 = new AssetManager({
|
|
11373
11759
|
registry: getKindRegistry(),
|
|
11374
|
-
projectDir:
|
|
11375
|
-
|
|
11760
|
+
projectDir: path19__default.resolve(opts.projectDir),
|
|
11761
|
+
harness: opts.target
|
|
11376
11762
|
});
|
|
11377
11763
|
if (!kind) {
|
|
11378
11764
|
showOverview(am2);
|
|
@@ -11399,7 +11785,7 @@ function searchCuratedManifests(query) {
|
|
|
11399
11785
|
const slug = file.slice(0, -".yaml".length);
|
|
11400
11786
|
let manifest;
|
|
11401
11787
|
try {
|
|
11402
|
-
manifest = decodeSkaileManifest(readFileSync(
|
|
11788
|
+
manifest = decodeSkaileManifest(readFileSync(path19.join(dir, file), "utf-8")).manifest;
|
|
11403
11789
|
} catch {
|
|
11404
11790
|
continue;
|
|
11405
11791
|
}
|
|
@@ -11419,6 +11805,13 @@ async function fetchIdentity() {
|
|
|
11419
11805
|
const jwt = await getStoreToken();
|
|
11420
11806
|
return storeFetch({ ...getStoreConfig(), jwt }, "/api/v1/me");
|
|
11421
11807
|
}
|
|
11808
|
+
function storeRefProblem(ref, err) {
|
|
11809
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
11810
|
+
const plain = message.replace(/ Run the `migrate-skaile-manifest`.*$/, "");
|
|
11811
|
+
if (!plain.startsWith("publisher required")) return message;
|
|
11812
|
+
const name = /^(?:[^:@/#\s]+:)?([^@/#\s]+)/.exec(ref.trim())?.[1];
|
|
11813
|
+
return name ? `${plain} Find the publisher with \`skaile store search ${name}\`.` : plain;
|
|
11814
|
+
}
|
|
11422
11815
|
async function storeNotFoundMessage(remote, ref) {
|
|
11423
11816
|
const parsed = parseAssetRef(ref);
|
|
11424
11817
|
let versions = [];
|
|
@@ -11473,7 +11866,7 @@ function makeStoreCommand() {
|
|
|
11473
11866
|
});
|
|
11474
11867
|
store.command("mode <auto|local|remote>").description("Set the catalog resolution mode (not yet wired)").action((_mode) => {
|
|
11475
11868
|
logErr(
|
|
11476
|
-
`\`skaile store mode\` is scaffolded but not yet wired. Store config lives at ${
|
|
11869
|
+
`\`skaile store mode\` is scaffolded but not yet wired. Store config lives at ${path19__default.join(globalSkaileDir(), "store", "config.yaml")}.`
|
|
11477
11870
|
);
|
|
11478
11871
|
process.exit(2);
|
|
11479
11872
|
});
|
|
@@ -11481,9 +11874,9 @@ function makeStoreCommand() {
|
|
|
11481
11874
|
"--all",
|
|
11482
11875
|
`List every match (default: ${STORE_ROW_LIMIT} rows, only what \`skaile add\` can install)`
|
|
11483
11876
|
).option("-C, --project-dir <dir>", "Project directory (catalog config overlay)", process.cwd()).action(async (query, opts) => {
|
|
11484
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError: LocalCatalogDisabledError2 } = await import('../open-library-
|
|
11485
|
-
const { getKnownKinds: getKnownKinds2 } = await import('../open-registry-
|
|
11486
|
-
const projectDir =
|
|
11877
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError: LocalCatalogDisabledError2 } = await import('../open-library-NKKUJLWA.js');
|
|
11878
|
+
const { getKnownKinds: getKnownKinds2 } = await import('../open-registry-BYAXSHUI.js');
|
|
11879
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
11487
11880
|
if (opts.kind && !getKnownKinds2().has(opts.kind)) {
|
|
11488
11881
|
logErr(
|
|
11489
11882
|
`Unknown kind "${opts.kind}". Valid kinds: ${[...getKnownKinds2()].sort().join(", ")}`
|
|
@@ -11540,16 +11933,16 @@ function makeStoreCommand() {
|
|
|
11540
11933
|
}
|
|
11541
11934
|
});
|
|
11542
11935
|
store.command("show <ref>").description("Show a store asset's details + provenance (source, files, integrity)").option("-C, --project-dir <dir>", "Project directory (catalog config overlay)", process.cwd()).action(async (ref, opts) => {
|
|
11543
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError: LocalCatalogDisabledError2 } = await import('../open-library-
|
|
11544
|
-
const { supportsInstallManifest: supportsInstallManifest2 } = await import('../project-
|
|
11936
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError: LocalCatalogDisabledError2 } = await import('../open-library-NKKUJLWA.js');
|
|
11937
|
+
const { supportsInstallManifest: supportsInstallManifest2 } = await import('../project-BIPK47JK.js');
|
|
11545
11938
|
try {
|
|
11546
11939
|
parseAssetRef(ref);
|
|
11547
11940
|
} catch (e) {
|
|
11548
|
-
logErr(`Invalid asset ref "${ref}": ${
|
|
11941
|
+
logErr(`Invalid asset ref "${ref}": ${storeRefProblem(ref, e)}`);
|
|
11549
11942
|
process.exit(1);
|
|
11550
11943
|
}
|
|
11551
11944
|
try {
|
|
11552
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
11945
|
+
const remote = await openCatalogSource2({ projectDir: path19__default.resolve(opts.projectDir) });
|
|
11553
11946
|
const asset = await remote.resolve(ref);
|
|
11554
11947
|
if (!asset) {
|
|
11555
11948
|
logErr(await storeNotFoundMessage(remote, ref));
|
|
@@ -11560,7 +11953,7 @@ function makeStoreCommand() {
|
|
|
11560
11953
|
const manifestFailure = {};
|
|
11561
11954
|
if (supportsInstallManifest2(remote)) {
|
|
11562
11955
|
manifest = await remote.getInstallManifest(canonical).catch(async (err) => {
|
|
11563
|
-
manifestFailure.text = await describeStoreFailure(err,
|
|
11956
|
+
manifestFailure.text = await describeStoreFailure(err, path19__default.resolve(opts.projectDir));
|
|
11564
11957
|
return null;
|
|
11565
11958
|
});
|
|
11566
11959
|
}
|
|
@@ -11608,9 +12001,14 @@ function makeStoreCommand() {
|
|
|
11608
12001
|
}
|
|
11609
12002
|
console.log();
|
|
11610
12003
|
const notInstallable = storeNotInstallableReason(asset);
|
|
11611
|
-
|
|
11612
|
-
|
|
11613
|
-
)
|
|
12004
|
+
const notRunnable = !notInstallable && asset.kind === "mcp-server" && manifest ? await mcpNotRunnableHere(manifest, asset.name) : void 0;
|
|
12005
|
+
if (notInstallable) console.log(` ${S.dim(`Not installable: ${notInstallable}`)}`);
|
|
12006
|
+
else if (notRunnable) {
|
|
12007
|
+
console.log(` ${S.dim(`Not runnable here: ${notRunnable}`)}`);
|
|
12008
|
+
console.log(
|
|
12009
|
+
` ${S.dim(`skaile add ${canonical} still records it in the lock, but writes no .mcp.json entry.`)}`
|
|
12010
|
+
);
|
|
12011
|
+
} else console.log(` ${S.dim(`Install: skaile add ${canonical}`)}`);
|
|
11614
12012
|
console.log();
|
|
11615
12013
|
} catch (e) {
|
|
11616
12014
|
if (e instanceof LocalCatalogDisabledError2) {
|
|
@@ -11619,7 +12017,7 @@ function makeStoreCommand() {
|
|
|
11619
12017
|
);
|
|
11620
12018
|
} else {
|
|
11621
12019
|
logErr(
|
|
11622
|
-
`Store show failed: ${await describeStoreFailure(e,
|
|
12020
|
+
`Store show failed: ${await describeStoreFailure(e, path19__default.resolve(opts.projectDir))}`
|
|
11623
12021
|
);
|
|
11624
12022
|
}
|
|
11625
12023
|
process.exit(1);
|
|
@@ -11693,7 +12091,7 @@ function makeTreeCommand() {
|
|
|
11693
12091
|
requireProjectConfig(opts.projectDir);
|
|
11694
12092
|
const am2 = new AssetManager({
|
|
11695
12093
|
registry: getKindRegistry(),
|
|
11696
|
-
projectDir:
|
|
12094
|
+
projectDir: path19__default.resolve(opts.projectDir)
|
|
11697
12095
|
});
|
|
11698
12096
|
const root = await am2.tree();
|
|
11699
12097
|
if (root.children.length === 0) {
|
|
@@ -11719,9 +12117,12 @@ function makeUpdateCommand() {
|
|
|
11719
12117
|
return new Command("update").description("Refresh the Catalog cache and re-deploy outdated assets in the current project").argument(
|
|
11720
12118
|
"[name]",
|
|
11721
12119
|
"Update only this declared asset (kind:@publisher/name, kind:name or name); exits 1 when none matches"
|
|
11722
|
-
).option("--project-dir <path>", "Project directory", process.cwd()).option("--no-catalog", "Skip refreshing the catalog cache").option("--catalog-only", "Refresh the catalog cache only; do not re-deploy assets").option("--no-sync", "Skip syncing sources from upstream before re-deploying").option("-y, --yes", "Sync sources without the confirmation prompt").
|
|
12120
|
+
).option("--project-dir <path>", "Project directory", process.cwd()).option("--no-catalog", "Skip refreshing the catalog cache").option("--catalog-only", "Refresh the catalog cache only; do not re-deploy assets").option("--no-sync", "Skip syncing sources from upstream before re-deploying").option("-y, --yes", "Sync sources without the confirmation prompt").option(
|
|
12121
|
+
"--force",
|
|
12122
|
+
"Delete files the new content does not ship, and overwrite hand-edited agent files"
|
|
12123
|
+
).action(
|
|
11723
12124
|
async (name, opts) => {
|
|
11724
|
-
const projectDir =
|
|
12125
|
+
const projectDir = path19__default.resolve(opts.projectDir);
|
|
11725
12126
|
if (!opts.catalogOnly) requireProjectConfig(projectDir);
|
|
11726
12127
|
const am2 = new AssetManager({
|
|
11727
12128
|
registry: getKindRegistry(),
|
|
@@ -11741,7 +12142,7 @@ function makeUpdateCommand() {
|
|
|
11741
12142
|
const catalogSpinner = createSpinner();
|
|
11742
12143
|
catalogSpinner.start("Refreshing catalog cache");
|
|
11743
12144
|
try {
|
|
11744
|
-
const remote = await openCatalogSource({ projectDir:
|
|
12145
|
+
const remote = await openCatalogSource({ projectDir: path19__default.resolve(opts.projectDir) });
|
|
11745
12146
|
const result2 = await remote.refresh({ timeoutMs: CATALOG_REFRESH_TIMEOUT_MS });
|
|
11746
12147
|
catalogSpinner.stop(
|
|
11747
12148
|
`Catalog refreshed: ${S.heading(String(result2.assetsCached))} assets cached`
|
|
@@ -11782,7 +12183,7 @@ function makeUpdateCommand() {
|
|
|
11782
12183
|
spinner.start("Re-deploying assets");
|
|
11783
12184
|
let result;
|
|
11784
12185
|
try {
|
|
11785
|
-
result = await am2.install({ moveLibraries: true });
|
|
12186
|
+
result = await am2.install({ moveLibraries: true, force: opts.force });
|
|
11786
12187
|
} catch (err) {
|
|
11787
12188
|
spinner.stop("Failed");
|
|
11788
12189
|
logErr(String(err));
|
|
@@ -11876,13 +12277,13 @@ async function resolveUpdateTarget(am2, name) {
|
|
|
11876
12277
|
async function needsCatalog(am2, projectDir) {
|
|
11877
12278
|
let lock = null;
|
|
11878
12279
|
try {
|
|
11879
|
-
lock = readLock(
|
|
12280
|
+
lock = readLock(path19__default.join(projectDir, "skaile.lock.yaml"));
|
|
11880
12281
|
} catch {
|
|
11881
12282
|
lock = null;
|
|
11882
12283
|
}
|
|
11883
12284
|
let declaredUrls = /* @__PURE__ */ new Set();
|
|
11884
12285
|
try {
|
|
11885
|
-
const yamlPath =
|
|
12286
|
+
const yamlPath = path19__default.join(projectDir, "skaile.yaml");
|
|
11886
12287
|
declaredUrls = new Set(
|
|
11887
12288
|
WorkspaceYamlEditor.load(yamlPath).getSources().map((s) => normalizeRepoUrl(s.url))
|
|
11888
12289
|
);
|
|
@@ -11918,7 +12319,7 @@ function readText2(file) {
|
|
|
11918
12319
|
}
|
|
11919
12320
|
}
|
|
11920
12321
|
async function updateOne(am2, projectDir, target) {
|
|
11921
|
-
const lockPath =
|
|
12322
|
+
const lockPath = path19__default.join(projectDir, "skaile.lock.yaml");
|
|
11922
12323
|
const before = readText2(lockPath);
|
|
11923
12324
|
const spinner = createSpinner();
|
|
11924
12325
|
spinner.start(`Updating ${target.ref}`);
|
|
@@ -12114,7 +12515,7 @@ function makeWhyCommand() {
|
|
|
12114
12515
|
requireProjectConfig(opts.projectDir);
|
|
12115
12516
|
const am2 = new AssetManager({
|
|
12116
12517
|
registry: getKindRegistry(),
|
|
12117
|
-
projectDir:
|
|
12518
|
+
projectDir: path19__default.resolve(opts.projectDir)
|
|
12118
12519
|
});
|
|
12119
12520
|
const chain = await am2.why(ref);
|
|
12120
12521
|
if (chain.length === 0) {
|
|
@@ -12186,7 +12587,7 @@ function isIndexBusyError(err) {
|
|
|
12186
12587
|
var _defaultFormatHelp = Help.prototype.formatHelp;
|
|
12187
12588
|
var pkg = JSON.parse(
|
|
12188
12589
|
readFileSync(
|
|
12189
|
-
|
|
12590
|
+
path19__default.resolve(path19__default.dirname(fileURLToPath(import.meta.url)), "../../package.json"),
|
|
12190
12591
|
"utf-8"
|
|
12191
12592
|
)
|
|
12192
12593
|
);
|
|
@@ -12197,7 +12598,7 @@ for (const key of [
|
|
|
12197
12598
|
"SKAILE_CACHE_DIR"
|
|
12198
12599
|
]) {
|
|
12199
12600
|
const value = process.env[key];
|
|
12200
|
-
if (value) process.env[key] =
|
|
12601
|
+
if (value) process.env[key] = path19__default.resolve(value);
|
|
12201
12602
|
}
|
|
12202
12603
|
var program = new Command("skaile").description("AI asset manager").version(pkg.version, "-v, --version", "Show the skaile CLI version").enablePositionalOptions().configureHelp({
|
|
12203
12604
|
formatHelp(cmd, helper) {
|
|
@@ -12212,6 +12613,7 @@ Project:
|
|
|
12212
12613
|
clean [--all] [--dry-run] Remove skaile-managed assets
|
|
12213
12614
|
setup Interactive provider setup wizard
|
|
12214
12615
|
config show|get|set Personal settings
|
|
12616
|
+
harness set <name> Switch the project to claude-code | omp | codex and install
|
|
12215
12617
|
|
|
12216
12618
|
Assets (skill, agent, prompt, flow, preset, contract):
|
|
12217
12619
|
add <ref> [--global] Add to skaile.yaml + deploy
|
|
@@ -12243,8 +12645,8 @@ Execution:
|
|
|
12243
12645
|
resume Resume last session
|
|
12244
12646
|
serve [--compile-test] Start WebSocket agent server
|
|
12245
12647
|
mcp-server Start workspace MCP server (for .mcp.json)
|
|
12246
|
-
integration install [--
|
|
12247
|
-
integration uninstall [--
|
|
12648
|
+
integration install [--harness all] Install agent integration (claude-code | omp | codex)
|
|
12649
|
+
integration uninstall [--harness all] Uninstall agent integration
|
|
12248
12650
|
integration enable Enable integration (claude-code only)
|
|
12249
12651
|
integration disable Disable integration (claude-code only)
|
|
12250
12652
|
integration status Show install / enable state across harnesses
|
|
@@ -12308,50 +12710,63 @@ Advanced:
|
|
|
12308
12710
|
`;
|
|
12309
12711
|
}
|
|
12310
12712
|
});
|
|
12311
|
-
var
|
|
12312
|
-
"claude-code": {
|
|
12313
|
-
omp: {
|
|
12314
|
-
codex: {
|
|
12713
|
+
var INIT_HARNESS_DEFAULTS = {
|
|
12714
|
+
"claude-code": { harness: HARNESS_ID_OF_TARGET["claude-code"] },
|
|
12715
|
+
omp: { harness: HARNESS_ID_OF_TARGET.omp },
|
|
12716
|
+
codex: { harness: HARNESS_ID_OF_TARGET.codex }
|
|
12315
12717
|
};
|
|
12316
|
-
program.command("init [project-dir]").description("Initialize a project directory (defaults to current directory)").option(
|
|
12718
|
+
program.command("init [project-dir]").description("Initialize a project directory (defaults to current directory)").option(
|
|
12719
|
+
"--harness <name>",
|
|
12720
|
+
"Coding-agent harness of a new project (claude-code | omp | codex; default claude-code)"
|
|
12721
|
+
).option("--no-git", "Skip git init and .gitignore").action(
|
|
12317
12722
|
(projectDir, opts) => runInit(projectDir, opts)
|
|
12318
12723
|
);
|
|
12319
12724
|
async function runInit(projectDir, opts) {
|
|
12320
12725
|
const { mkdirSync: mkdirSync5, writeFileSync: writeFileSync7 } = await import('fs');
|
|
12321
12726
|
const { stringify: stringify2 } = await import('yaml');
|
|
12322
|
-
const {
|
|
12323
|
-
const harness = opts.harness;
|
|
12324
|
-
if (!
|
|
12325
|
-
logErr(`Unknown harness "${opts.harness}". Supported: ${
|
|
12727
|
+
const { HARNESS_TARGETS: HARNESS_TARGETS2, SUPPORTED_HARNESSES: SUPPORTED_HARNESSES2, resolveConfiguredHarnessName: resolveConfiguredHarnessName2 } = await import('../core/index.js');
|
|
12728
|
+
const harness = opts.harness ?? "claude-code";
|
|
12729
|
+
if (!SUPPORTED_HARNESSES2.includes(harness)) {
|
|
12730
|
+
logErr(`Unknown harness "${opts.harness}". Supported: ${SUPPORTED_HARNESSES2.join(", ")}`);
|
|
12326
12731
|
process.exitCode = 1;
|
|
12327
12732
|
return;
|
|
12328
12733
|
}
|
|
12329
|
-
const resolved =
|
|
12330
|
-
|
|
12734
|
+
const resolved = path19__default.resolve(projectDir ?? ".");
|
|
12735
|
+
if (opts.harness && (await import('fs')).existsSync(path19__default.join(resolved, "skaile.yaml"))) {
|
|
12736
|
+
const current = resolveConfiguredHarnessName2(resolved);
|
|
12737
|
+
if (current !== harness) {
|
|
12738
|
+
logErr(
|
|
12739
|
+
`${resolved} is already a skaile project${current ? ` on ${current}` : ""}. To switch it to ${harness}, run: skaile harness set ${harness}`
|
|
12740
|
+
);
|
|
12741
|
+
process.exitCode = 1;
|
|
12742
|
+
return;
|
|
12743
|
+
}
|
|
12744
|
+
}
|
|
12745
|
+
const projectName = path19__default.basename(resolved);
|
|
12331
12746
|
const created = [];
|
|
12332
|
-
const { existsSync:
|
|
12333
|
-
if (!
|
|
12747
|
+
const { existsSync: existsSync22 } = await import('fs');
|
|
12748
|
+
if (!existsSync22(resolved)) {
|
|
12334
12749
|
mkdirSync5(resolved, { recursive: true });
|
|
12335
12750
|
created.push(".");
|
|
12336
12751
|
}
|
|
12337
|
-
const skaileDir =
|
|
12338
|
-
if (!
|
|
12339
|
-
mkdirSync5(
|
|
12752
|
+
const skaileDir = path19__default.join(resolved, ".skaile");
|
|
12753
|
+
if (!existsSync22(skaileDir)) {
|
|
12754
|
+
mkdirSync5(path19__default.join(skaileDir, "sessions"), { recursive: true });
|
|
12340
12755
|
created.push(".skaile/");
|
|
12341
12756
|
}
|
|
12342
|
-
const settingsPath =
|
|
12343
|
-
if (!
|
|
12757
|
+
const settingsPath = path19__default.join(skaileDir, "settings.json");
|
|
12758
|
+
if (!existsSync22(settingsPath)) {
|
|
12344
12759
|
writeFileSync7(settingsPath, "{}\n");
|
|
12345
12760
|
created.push(".skaile/settings.json");
|
|
12346
12761
|
}
|
|
12347
|
-
const wsConfigPath =
|
|
12348
|
-
if (!
|
|
12762
|
+
const wsConfigPath = path19__default.join(resolved, "skaile.yaml");
|
|
12763
|
+
if (!existsSync22(wsConfigPath)) {
|
|
12349
12764
|
writeFileSync7(wsConfigPath, stringify2(buildInitWorkspaceConfig(projectName, harness)));
|
|
12350
12765
|
created.push("skaile.yaml");
|
|
12351
12766
|
}
|
|
12352
|
-
for (const dir of new Set(Object.values(
|
|
12353
|
-
const full =
|
|
12354
|
-
if (!
|
|
12767
|
+
for (const dir of new Set(Object.values(HARNESS_TARGETS2[harness].local))) {
|
|
12768
|
+
const full = path19__default.join(resolved, dir);
|
|
12769
|
+
if (!existsSync22(full)) {
|
|
12355
12770
|
mkdirSync5(full, { recursive: true });
|
|
12356
12771
|
created.push(`${dir}/`);
|
|
12357
12772
|
}
|
|
@@ -12364,7 +12779,7 @@ async function runInit(projectDir, opts) {
|
|
|
12364
12779
|
printInitSummary(resolved, projectDir, created);
|
|
12365
12780
|
}
|
|
12366
12781
|
function buildInitWorkspaceConfig(projectName, harness) {
|
|
12367
|
-
const harnessDefaults =
|
|
12782
|
+
const harnessDefaults = INIT_HARNESS_DEFAULTS[harness];
|
|
12368
12783
|
return {
|
|
12369
12784
|
name: projectName,
|
|
12370
12785
|
description: `${projectName} AI skill dependencies`,
|
|
@@ -12373,7 +12788,7 @@ function buildInitWorkspaceConfig(projectName, harness) {
|
|
|
12373
12788
|
agent: harness,
|
|
12374
12789
|
// model is omitted unless a harness fixes it (none do today).
|
|
12375
12790
|
...harnessDefaults.model ? { model: harnessDefaults.model } : {},
|
|
12376
|
-
|
|
12791
|
+
harness: harnessDefaults.harness,
|
|
12377
12792
|
max_turns: 200
|
|
12378
12793
|
}
|
|
12379
12794
|
}
|
|
@@ -12381,8 +12796,8 @@ function buildInitWorkspaceConfig(projectName, harness) {
|
|
|
12381
12796
|
}
|
|
12382
12797
|
async function initGitScaffold(resolved, created) {
|
|
12383
12798
|
const { execSync: execSync2 } = await import('child_process');
|
|
12384
|
-
const { existsSync:
|
|
12385
|
-
const gitignorePath =
|
|
12799
|
+
const { existsSync: existsSync22, readFileSync: readFileSync13, writeFileSync: writeFileSync7 } = await import('fs');
|
|
12800
|
+
const gitignorePath = path19__default.join(resolved, ".gitignore");
|
|
12386
12801
|
const entries = [
|
|
12387
12802
|
"node_modules/",
|
|
12388
12803
|
// Python bytecode a deployed skill script leaves inside `.claude/skills` and friends.
|
|
@@ -12417,7 +12832,7 @@ async function initGitScaffold(resolved, created) {
|
|
|
12417
12832
|
".env",
|
|
12418
12833
|
".env.local"
|
|
12419
12834
|
];
|
|
12420
|
-
const existing =
|
|
12835
|
+
const existing = existsSync22(gitignorePath) ? readFileSync13(gitignorePath, "utf-8") : "";
|
|
12421
12836
|
const have = new Set(existing.split("\n").map((l) => l.trim()));
|
|
12422
12837
|
const append = entries.filter((e) => !have.has(e));
|
|
12423
12838
|
if (append.length > 0) {
|
|
@@ -12426,7 +12841,7 @@ async function initGitScaffold(resolved, created) {
|
|
|
12426
12841
|
`);
|
|
12427
12842
|
if (!existing) created.push(".gitignore");
|
|
12428
12843
|
}
|
|
12429
|
-
if (!
|
|
12844
|
+
if (!existsSync22(path19__default.join(resolved, ".git"))) {
|
|
12430
12845
|
try {
|
|
12431
12846
|
execSync2("git init", { cwd: resolved, stdio: "pipe" });
|
|
12432
12847
|
created.push(".git/");
|
|
@@ -12456,7 +12871,7 @@ async function bootstrapUserConfig() {
|
|
|
12456
12871
|
}
|
|
12457
12872
|
async function hydrateInitSources(resolved, created) {
|
|
12458
12873
|
try {
|
|
12459
|
-
const { ensureSourcesCloned } = await import('../ensure-sources-
|
|
12874
|
+
const { ensureSourcesCloned } = await import('../ensure-sources-IH7CHSJF.js');
|
|
12460
12875
|
const hydrate = ensureSourcesCloned(resolved, { quiet: true });
|
|
12461
12876
|
for (const n of hydrate.cloned) created.push(`~/.skaile/cache/sources/${n}/`);
|
|
12462
12877
|
if (hydrate.failed.length > 0) {
|
|
@@ -12472,7 +12887,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
12472
12887
|
logOk(`Initialized project at ${S.heading(resolved)}`);
|
|
12473
12888
|
console.log();
|
|
12474
12889
|
console.log(S.heading(" Next steps:"));
|
|
12475
|
-
const isCurrentDir = resolved ===
|
|
12890
|
+
const isCurrentDir = resolved === path19__default.resolve(".");
|
|
12476
12891
|
let step = 1;
|
|
12477
12892
|
if (!isCurrentDir) {
|
|
12478
12893
|
console.log(` ${S.dim(`${step}.`)} ${S.cmd(`cd ${projectDir}`)}`);
|
|
@@ -12496,7 +12911,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
12496
12911
|
console.log();
|
|
12497
12912
|
}
|
|
12498
12913
|
program.command("setup").description("Interactive provider setup wizard").action(async () => {
|
|
12499
|
-
const { cmdSetup } = await import('../setup-
|
|
12914
|
+
const { cmdSetup } = await import('../setup-AG6NFHSN.js');
|
|
12500
12915
|
await cmdSetup([], { projectDir: process.cwd() });
|
|
12501
12916
|
});
|
|
12502
12917
|
program.addCommand(makeInstallCommand());
|
|
@@ -12504,6 +12919,7 @@ program.addCommand(makeCheckCommand());
|
|
|
12504
12919
|
program.addCommand(makeCleanCommand());
|
|
12505
12920
|
program.addCommand(makeCacheCommand());
|
|
12506
12921
|
program.addCommand(makeConfigCommand());
|
|
12922
|
+
program.addCommand(makeHarnessCommand());
|
|
12507
12923
|
program.addCommand(makeProvidersCommand());
|
|
12508
12924
|
program.addCommand(makeMigrateCommand());
|
|
12509
12925
|
program.addCommand(makeAddCommand());
|
|
@@ -12575,8 +12991,8 @@ program.hook("postAction", async (_thisCommand, actionCommand) => {
|
|
|
12575
12991
|
if (!["add", "remove", "install", "update"].includes(actionCommand.name())) return;
|
|
12576
12992
|
const opts = actionCommand.opts();
|
|
12577
12993
|
if (opts.global || opts.dryRun) return;
|
|
12578
|
-
const projectDir =
|
|
12579
|
-
const { refreshPluginSkills } = await import('../claude-code-
|
|
12994
|
+
const projectDir = path19__default.resolve(opts.projectDir ?? process.cwd());
|
|
12995
|
+
const { refreshPluginSkills } = await import('../claude-code-RE46FJXI.js');
|
|
12580
12996
|
try {
|
|
12581
12997
|
if (await refreshPluginSkills(projectDir)) {
|
|
12582
12998
|
logInfo(`Updated ${S.cmd(".claude/plugins/skaile/skills")} (the --full plugin copy)`);
|
|
@@ -12594,6 +13010,9 @@ process.once("beforeExit", () => {
|
|
|
12594
13010
|
logErr("The command ended before it finished (nothing left to wait for).");
|
|
12595
13011
|
process.exit(1);
|
|
12596
13012
|
});
|
|
13013
|
+
setLibraryAssetCheck(
|
|
13014
|
+
(asset, libraryPath) => libraryAssetRefusals(asset, libraryPath, getKindRegistry())
|
|
13015
|
+
);
|
|
12597
13016
|
try {
|
|
12598
13017
|
await program.parseAsync();
|
|
12599
13018
|
commandSettled = true;
|