@skaile/workspaces 3.27.0 → 4.0.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 +480 -0
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-AJOUKX55.js → asset-feeds-OPG6SUXU.js} +11 -9
- package/dist/asset-feeds-OPG6SUXU.js.map +1 -0
- package/dist/asset-manager/catalog-deployer.js +5 -3
- package/dist/asset-manager/index.js +11 -9
- package/dist/asset-manager/installer.js +8 -6
- package/dist/asset-manager/renderers.js +2 -2
- package/dist/asset-manager/src/renderers.d.ts.map +1 -1
- package/dist/bridge/drivers/claude-sdk.js +102 -55
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +178 -22
- package/dist/bridge/drivers/codex.js.map +1 -1
- package/dist/bridge/drivers/continue.js +199 -7
- package/dist/bridge/drivers/continue.js.map +1 -1
- package/dist/bridge/drivers/echo.js +10 -4
- package/dist/bridge/drivers/echo.js.map +1 -1
- package/dist/bridge/drivers/gemini.js +7 -4
- package/dist/bridge/drivers/goose.js +160 -7
- package/dist/bridge/drivers/goose.js.map +1 -1
- package/dist/bridge/drivers/omp.js +321 -96
- package/dist/bridge/drivers/omp.js.map +1 -1
- package/dist/bridge/drivers/opencode.js +148 -13
- package/dist/bridge/drivers/opencode.js.map +1 -1
- package/dist/bridge/drivers/qwen.js +41 -11
- package/dist/bridge/drivers/qwen.js.map +1 -1
- package/dist/bridge/index.js +12 -9
- package/dist/bridge/src/cloud.d.ts +62 -71
- package/dist/bridge/src/cloud.d.ts.map +1 -1
- package/dist/bridge/src/codex/config-toml.d.ts +128 -0
- package/dist/bridge/src/codex/config-toml.d.ts.map +1 -0
- package/dist/bridge/src/codex/credentials.d.ts +26 -0
- package/dist/bridge/src/codex/credentials.d.ts.map +1 -1
- package/dist/bridge/src/codex/managed-driver.d.ts.map +1 -1
- package/dist/bridge/src/drivers/_subprocess-cli.d.ts +9 -4
- package/dist/bridge/src/drivers/_subprocess-cli.d.ts.map +1 -1
- package/dist/bridge/src/drivers/claude-sdk.d.ts +19 -11
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/drivers/codex.d.ts +26 -1
- package/dist/bridge/src/drivers/codex.d.ts.map +1 -1
- package/dist/bridge/src/drivers/continue.d.ts +31 -5
- package/dist/bridge/src/drivers/continue.d.ts.map +1 -1
- package/dist/bridge/src/drivers/echo.d.ts.map +1 -1
- package/dist/bridge/src/drivers/gemini.d.ts +34 -3
- package/dist/bridge/src/drivers/gemini.d.ts.map +1 -1
- package/dist/bridge/src/drivers/goose.d.ts +26 -2
- package/dist/bridge/src/drivers/goose.d.ts.map +1 -1
- package/dist/bridge/src/drivers/omp-models-yml.d.ts +216 -0
- package/dist/bridge/src/drivers/omp-models-yml.d.ts.map +1 -0
- package/dist/bridge/src/drivers/omp.d.ts +26 -23
- package/dist/bridge/src/drivers/omp.d.ts.map +1 -1
- package/dist/bridge/src/drivers/opencode.d.ts +28 -3
- package/dist/bridge/src/drivers/opencode.d.ts.map +1 -1
- package/dist/bridge/src/drivers/qwen.d.ts +10 -4
- package/dist/bridge/src/drivers/qwen.d.ts.map +1 -1
- package/dist/bridge/src/index.d.ts +3 -1
- package/dist/bridge/src/index.d.ts.map +1 -1
- package/dist/bridge/src/models.d.ts +118 -19
- package/dist/bridge/src/models.d.ts.map +1 -1
- package/dist/bridge/src/provider-catalog.d.ts +188 -0
- package/dist/bridge/src/provider-catalog.d.ts.map +1 -0
- package/dist/bridge/src/provider-materialize/continue-config-yaml.d.ts +117 -0
- package/dist/bridge/src/provider-materialize/continue-config-yaml.d.ts.map +1 -0
- package/dist/bridge/src/provider-materialize/credential-env.d.ts +103 -0
- package/dist/bridge/src/provider-materialize/credential-env.d.ts.map +1 -0
- package/dist/bridge/src/provider-materialize/env-drivers.d.ts +209 -0
- package/dist/bridge/src/provider-materialize/env-drivers.d.ts.map +1 -0
- package/dist/bridge/src/provider-materialize/goose-custom-providers.d.ts +127 -0
- package/dist/bridge/src/provider-materialize/goose-custom-providers.d.ts.map +1 -0
- package/dist/bridge/src/provider-materialize/opencode-config.d.ts +127 -0
- package/dist/bridge/src/provider-materialize/opencode-config.d.ts.map +1 -0
- package/dist/bridge/src/provider-materialize/session-config-home.d.ts +63 -0
- package/dist/bridge/src/provider-materialize/session-config-home.d.ts.map +1 -0
- package/dist/bridge/src/provider-registry-derive.d.ts +59 -0
- package/dist/bridge/src/provider-registry-derive.d.ts.map +1 -0
- package/dist/bridge/src/registry.d.ts +19 -7
- package/dist/bridge/src/registry.d.ts.map +1 -1
- package/dist/bridge/src/runtime.d.ts.map +1 -1
- package/dist/bridge/src/types.d.ts +79 -60
- package/dist/bridge/src/types.d.ts.map +1 -1
- package/dist/bridge/src/validation.d.ts +2 -3
- package/dist/bridge/src/validation.d.ts.map +1 -1
- package/dist/{chunk-GURXUF2J.js → chunk-3ZTQY276.js} +95 -80
- package/dist/chunk-3ZTQY276.js.map +1 -0
- package/dist/{chunk-T3YLZQS4.js → chunk-45LLHKQ2.js} +24 -3
- package/dist/chunk-45LLHKQ2.js.map +1 -0
- package/dist/{chunk-UAEGKCE5.js → chunk-5IIHO2HI.js} +7 -7
- package/dist/{chunk-UAEGKCE5.js.map → chunk-5IIHO2HI.js.map} +1 -1
- package/dist/{chunk-HSRHO7SK.js → chunk-C3QLJTMB.js} +106 -150
- package/dist/chunk-C3QLJTMB.js.map +1 -0
- package/dist/chunk-CUU3AMGE.js +500 -0
- package/dist/chunk-CUU3AMGE.js.map +1 -0
- package/dist/{chunk-K6VZQNTR.js → chunk-DKCFWSVW.js} +3 -3
- package/dist/{chunk-K6VZQNTR.js.map → chunk-DKCFWSVW.js.map} +1 -1
- package/dist/{chunk-AEN2UFDN.js → chunk-DNGAA24M.js} +7 -7
- package/dist/{chunk-AEN2UFDN.js.map → chunk-DNGAA24M.js.map} +1 -1
- package/dist/{chunk-TCHEW3T2.js → chunk-EBHY23RZ.js} +6 -6
- package/dist/{chunk-TCHEW3T2.js.map → chunk-EBHY23RZ.js.map} +1 -1
- package/dist/{chunk-MQASB52N.js → chunk-FEFTOV2Y.js} +3 -3
- package/dist/{chunk-MQASB52N.js.map → chunk-FEFTOV2Y.js.map} +1 -1
- package/dist/{chunk-XMULHVKX.js → chunk-FODAC4RE.js} +17 -15
- package/dist/chunk-FODAC4RE.js.map +1 -0
- package/dist/{chunk-6H6HLMWG.js → chunk-G2F3ZCPK.js} +3 -3
- package/dist/{chunk-6H6HLMWG.js.map → chunk-G2F3ZCPK.js.map} +1 -1
- package/dist/{chunk-YLL65VXQ.js → chunk-HO2FQ76C.js} +175 -178
- package/dist/chunk-HO2FQ76C.js.map +1 -0
- package/dist/chunk-ILG4BXYE.js +936 -0
- package/dist/chunk-ILG4BXYE.js.map +1 -0
- package/dist/{chunk-E7HKNQTH.js → chunk-JXCUUZA3.js} +3 -4
- package/dist/chunk-JXCUUZA3.js.map +1 -0
- package/dist/{chunk-MBARHWMZ.js → chunk-K27T47OO.js} +79 -53
- package/dist/chunk-K27T47OO.js.map +1 -0
- package/dist/chunk-K3YR33F6.js +187 -0
- package/dist/chunk-K3YR33F6.js.map +1 -0
- package/dist/{chunk-7P6ASOFL.js → chunk-KIQGTAJ5.js} +3 -3
- package/dist/{chunk-7P6ASOFL.js.map → chunk-KIQGTAJ5.js.map} +1 -1
- package/dist/chunk-KSIRR5PL.js +142 -0
- package/dist/chunk-KSIRR5PL.js.map +1 -0
- package/dist/{chunk-SIREWRZE.js → chunk-KW7YIRYL.js} +3 -3
- package/dist/{chunk-SIREWRZE.js.map → chunk-KW7YIRYL.js.map} +1 -1
- package/dist/{chunk-3U3ZKYR7.js → chunk-LN2BQVRB.js} +139 -29
- package/dist/chunk-LN2BQVRB.js.map +1 -0
- package/dist/{chunk-DZ4UZOFB.js → chunk-M5H4DWIA.js} +3 -3
- package/dist/{chunk-DZ4UZOFB.js.map → chunk-M5H4DWIA.js.map} +1 -1
- package/dist/{chunk-JMYOJ3PA.js → chunk-MIP4IC3O.js} +3 -3
- package/dist/{chunk-JMYOJ3PA.js.map → chunk-MIP4IC3O.js.map} +1 -1
- package/dist/{chunk-O5JUZIVR.js → chunk-MJY2BO6N.js} +6 -6
- package/dist/{chunk-O5JUZIVR.js.map → chunk-MJY2BO6N.js.map} +1 -1
- package/dist/{chunk-AN6NAFRT.js → chunk-N7B3LZ7V.js} +31 -6
- package/dist/chunk-N7B3LZ7V.js.map +1 -0
- package/dist/{chunk-MX6TGDZ7.js → chunk-NBPL76HH.js} +5 -5
- package/dist/{chunk-MX6TGDZ7.js.map → chunk-NBPL76HH.js.map} +1 -1
- package/dist/{chunk-DY5GHUTC.js → chunk-NR6BPOW5.js} +2 -7
- package/dist/chunk-NR6BPOW5.js.map +1 -0
- package/dist/{chunk-F2GEM5B3.js → chunk-PCJF3XBH.js} +10 -10
- package/dist/{chunk-F2GEM5B3.js.map → chunk-PCJF3XBH.js.map} +1 -1
- package/dist/{chunk-NW65H5EV.js → chunk-PTETBRRC.js} +3 -3
- package/dist/{chunk-NW65H5EV.js.map → chunk-PTETBRRC.js.map} +1 -1
- package/dist/{chunk-UL4LD7KD.js → chunk-QQL3ET3J.js} +3 -3
- package/dist/{chunk-UL4LD7KD.js.map → chunk-QQL3ET3J.js.map} +1 -1
- package/dist/{chunk-IB4XKQMQ.js → chunk-REILIKVM.js} +3 -3
- package/dist/{chunk-IB4XKQMQ.js.map → chunk-REILIKVM.js.map} +1 -1
- package/dist/{chunk-N27DSFA7.js → chunk-RM4C5AU3.js} +27 -21
- package/dist/chunk-RM4C5AU3.js.map +1 -0
- package/dist/chunk-SG4D2UOK.js +843 -0
- package/dist/chunk-SG4D2UOK.js.map +1 -0
- package/dist/{chunk-AU4TUVHW.js → chunk-T7RHDVSY.js} +4 -4
- package/dist/{chunk-AU4TUVHW.js.map → chunk-T7RHDVSY.js.map} +1 -1
- package/dist/{chunk-773WLEXL.js → chunk-UKWEJPZZ.js} +3 -3
- package/dist/{chunk-773WLEXL.js.map → chunk-UKWEJPZZ.js.map} +1 -1
- package/dist/{chunk-3NCGSSCU.js → chunk-WLFRA5RM.js} +47 -45
- package/dist/chunk-WLFRA5RM.js.map +1 -0
- package/dist/{chunk-FFE7YLYO.js → chunk-XEVWRSLS.js} +7 -7
- package/dist/chunk-XEVWRSLS.js.map +1 -0
- package/dist/{chunk-5UWAOYDN.js → chunk-Y6E62LFB.js} +9 -12
- package/dist/chunk-Y6E62LFB.js.map +1 -0
- package/dist/{chunk-72DG6GSB.js → chunk-YS4XBN7O.js} +4 -4
- package/dist/{chunk-72DG6GSB.js.map → chunk-YS4XBN7O.js.map} +1 -1
- package/dist/chunk-YSJKLJD4.js +32 -0
- package/dist/chunk-YSJKLJD4.js.map +1 -0
- package/dist/cli/index.js +765 -334
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/config.d.ts +17 -6
- package/dist/cli/src/commands/config.d.ts.map +1 -1
- package/dist/cli/src/commands/migrate-legacy-entry.d.ts +46 -0
- package/dist/cli/src/commands/migrate-legacy-entry.d.ts.map +1 -0
- package/dist/cli/src/commands/migrate-providers.d.ts +93 -0
- package/dist/cli/src/commands/migrate-providers.d.ts.map +1 -0
- package/dist/cli/src/commands/providers.d.ts +89 -0
- package/dist/cli/src/commands/providers.d.ts.map +1 -0
- package/dist/cli/src/commands/run.d.ts +1 -1
- package/dist/cli/src/commands/run.d.ts.map +1 -1
- package/dist/cli/src/setup.d.ts +46 -6
- package/dist/cli/src/setup.d.ts.map +1 -1
- package/dist/connectors/config.js +6 -4
- package/dist/connectors/index.js +15 -12
- package/dist/core/index.js +5 -3
- package/dist/core/provider-registry-credentials.d.ts +2 -0
- package/dist/core/provider-registry-credentials.js +5 -0
- package/dist/core/provider-registry-credentials.js.map +1 -0
- package/dist/core/provider-registry.d.ts +2 -0
- package/dist/core/provider-registry.js +4 -0
- package/dist/core/provider-registry.js.map +1 -0
- package/dist/core/runtime-assets.js +2 -2
- package/dist/core/src/index.d.ts +10 -4
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/provider-registry-credentials.d.ts +50 -0
- package/dist/core/src/provider-registry-credentials.d.ts.map +1 -0
- package/dist/core/src/provider-registry-files.d.ts +97 -0
- package/dist/core/src/provider-registry-files.d.ts.map +1 -0
- package/dist/core/src/provider-registry.d.ts +450 -0
- package/dist/core/src/provider-registry.d.ts.map +1 -0
- package/dist/core/src/settings.d.ts +18 -78
- package/dist/core/src/settings.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +31 -47
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/src/workspace-yaml-editor.d.ts.map +1 -1
- package/dist/core/workspace-config.js +1 -1
- package/dist/deploy/index.js +5 -3
- package/dist/deploy/index.js.map +1 -1
- package/dist/discovery/index.js +2 -2
- package/dist/{ensure-sources-DYGQNAJM.js → ensure-sources-QZAQ4SY2.js} +14 -12
- package/dist/ensure-sources-QZAQ4SY2.js.map +1 -0
- package/dist/factory-assets/connectors/box.js +15 -12
- package/dist/factory-assets/connectors/deploy.js +15 -12
- package/dist/factory-assets/connectors/devserver.js +15 -12
- package/dist/factory-assets/connectors/flow/adapter.js +15 -12
- package/dist/factory-assets/connectors/flow/engine.js +6 -4
- package/dist/factory-assets/connectors/flow/index.d.ts +1 -1
- package/dist/factory-assets/connectors/flow/index.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.d.ts +0 -3
- package/dist/factory-assets/connectors/flow/run-flow.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.js +16 -13
- package/dist/factory-assets/connectors/flow/subprompt-runner.d.ts +31 -28
- package/dist/factory-assets/connectors/flow/subprompt-runner.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow.js +15 -12
- package/dist/factory-assets/connectors/git.js +15 -12
- package/dist/factory-assets/connectors/gmail.js +15 -12
- package/dist/factory-assets/connectors/googledrive.js +15 -12
- package/dist/factory-assets/connectors/local.js +15 -12
- package/dist/factory-assets/connectors/mattermost.js +15 -12
- package/dist/factory-assets/connectors/memory.js +15 -12
- package/dist/factory-assets/connectors/minio.js +15 -12
- package/dist/factory-assets/connectors/postgres.js +15 -12
- package/dist/factory-assets/connectors/s3.js +15 -12
- package/dist/factory-assets/connectors/sharepoint.js +15 -12
- package/dist/factory-assets/connectors/sqlite.js +15 -12
- package/dist/factory-assets/connectors/static-server.js +15 -12
- package/dist/factory-assets/connectors/tunnel.js +15 -12
- package/dist/factory-assets/connectors/webdav.js +15 -12
- package/dist/factory-assets/connectors/xstate-store.js +15 -12
- package/dist/factory-assets/connectors/xstate.js +15 -12
- package/dist/{flows-MI2VM5JZ.js → flows-4EIENFNT.js} +9 -7
- package/dist/{flows-MI2VM5JZ.js.map → flows-4EIENFNT.js.map} +1 -1
- package/dist/{helpers-G6XZPN6L.js → helpers-DISRVGRJ.js} +14 -12
- package/dist/{helpers-G6XZPN6L.js.map → helpers-DISRVGRJ.js.map} +1 -1
- package/dist/library/index.js +8 -6
- package/dist/library/install.js +5 -3
- package/dist/{library-publish-WHGKK7G5.js → library-publish-I2QYQSB4.js} +18 -16
- package/dist/library-publish-I2QYQSB4.js.map +1 -0
- package/dist/{open-library-4JSLGWL6.js → open-library-6LM4W4DR.js} +16 -14
- package/dist/{open-library-4JSLGWL6.js.map → open-library-6LM4W4DR.js.map} +1 -1
- package/dist/paths-P26QGQP5.js +18 -0
- package/dist/{paths-CZEH643M.js.map → paths-P26QGQP5.js.map} +1 -1
- package/dist/plugin-registry/src/targets.d.ts +16 -2
- package/dist/plugin-registry/src/targets.d.ts.map +1 -1
- package/dist/{plugin-store-QJNBPIQK.js → plugin-store-T2DJGKBW.js} +7 -5
- package/dist/plugin-store-T2DJGKBW.js.map +1 -0
- package/dist/{project-LISE6I5O.js → project-HP3IR7RW.js} +15 -13
- package/dist/{project-LISE6I5O.js.map → project-HP3IR7RW.js.map} +1 -1
- package/dist/resolver/index.js +5 -3
- package/dist/runner/index.js +25 -22
- package/dist/runner/src/agent.d.ts +0 -2
- package/dist/runner/src/agent.d.ts.map +1 -1
- package/dist/runner/src/codex-init.d.ts.map +1 -1
- package/dist/runner/src/codex-resource-tools.d.ts.map +1 -1
- package/dist/runner/src/managed-codex-bootstrap.d.ts.map +1 -1
- package/dist/runner/src/resources.d.ts +1 -2
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts +31 -35
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/runner/src/session.d.ts +0 -2
- package/dist/runner/src/session.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +11 -9
- package/dist/sdk/bridge.js +12 -9
- package/dist/sdk/core.js +5 -3
- package/dist/sdk/flow.js +6 -4
- package/dist/sdk/index.js +25 -22
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/resolver.js +5 -3
- package/dist/sdk/runner.js +25 -22
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/types.js +1 -1
- package/dist/session/index.js +2 -2
- package/dist/setup-HLRSU3MR.js +435 -0
- package/dist/setup-HLRSU3MR.js.map +1 -0
- package/dist/{skills-IE3IWWB7.js → skills-QPYHHZ54.js} +7 -5
- package/dist/{skills-IE3IWWB7.js.map → skills-QPYHHZ54.js.map} +1 -1
- package/dist/{source-FKVEUOBQ.js → source-G2VCWPDU.js} +17 -15
- package/dist/{source-FKVEUOBQ.js.map → source-G2VCWPDU.js.map} +1 -1
- package/dist/{source-manifest-publish-LTRXO2OQ.js → source-manifest-publish-WYKCKJFC.js} +19 -17
- package/dist/source-manifest-publish-WYKCKJFC.js.map +1 -0
- package/dist/tui/index.js +25 -23
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/src/repl.d.ts +0 -2
- 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/flow.d.ts +6 -1
- package/dist/types/src/flow.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/lifecycle.d.ts +35 -10
- package/dist/types/src/lifecycle.d.ts.map +1 -1
- package/dist/types/src/manifests/agent.d.ts +116 -22
- package/dist/types/src/manifests/agent.d.ts.map +1 -1
- package/dist/types/src/manifests/index.d.ts +2 -2
- package/dist/types/src/manifests/index.d.ts.map +1 -1
- package/dist/types/src/manifests/preset.d.ts +5 -5
- package/dist/types/src/runtime.d.ts +51 -5
- package/dist/types/src/runtime.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +18 -2
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/validator-P5ESKTW5.js +5 -0
- package/dist/{validator-RN64BKFW.js.map → validator-P5ESKTW5.js.map} +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +11 -9
- package/dist/workspace-plugin/adapters/omp.js +11 -11
- package/dist/workspace-plugin/adapters/omp.js.map +1 -1
- package/dist/workspace-plugin/index.js +1 -1
- package/dist/workspace-plugin/src/plugin.d.ts +1 -4
- package/dist/workspace-plugin/src/plugin.d.ts.map +1 -1
- package/dist/workspace-plugin/src/tools/validator.d.ts +4 -4
- package/dist/workspace-plugin/src/tools/validator.d.ts.map +1 -1
- package/package.json +13 -1
- package/dist/asset-feeds-AJOUKX55.js.map +0 -1
- package/dist/bridge/src/provider-endpoints.d.ts +0 -55
- package/dist/bridge/src/provider-endpoints.d.ts.map +0 -1
- package/dist/chunk-3NCGSSCU.js.map +0 -1
- package/dist/chunk-3U3ZKYR7.js.map +0 -1
- package/dist/chunk-5UWAOYDN.js.map +0 -1
- package/dist/chunk-AN6NAFRT.js.map +0 -1
- package/dist/chunk-AQW4BWNR.js +0 -324
- package/dist/chunk-AQW4BWNR.js.map +0 -1
- package/dist/chunk-DY5GHUTC.js.map +0 -1
- package/dist/chunk-E7HKNQTH.js.map +0 -1
- package/dist/chunk-FFE7YLYO.js.map +0 -1
- package/dist/chunk-FYIHH56K.js +0 -110
- package/dist/chunk-FYIHH56K.js.map +0 -1
- package/dist/chunk-GURXUF2J.js.map +0 -1
- package/dist/chunk-HSRHO7SK.js.map +0 -1
- package/dist/chunk-MBARHWMZ.js.map +0 -1
- package/dist/chunk-N27DSFA7.js.map +0 -1
- package/dist/chunk-T3YLZQS4.js.map +0 -1
- package/dist/chunk-XMULHVKX.js.map +0 -1
- package/dist/chunk-YLL65VXQ.js.map +0 -1
- package/dist/ensure-sources-DYGQNAJM.js.map +0 -1
- package/dist/library-publish-WHGKK7G5.js.map +0 -1
- package/dist/paths-CZEH643M.js +0 -16
- package/dist/plugin-store-QJNBPIQK.js.map +0 -1
- package/dist/runner/src/cloud-bundle.d.ts +0 -36
- package/dist/runner/src/cloud-bundle.d.ts.map +0 -1
- package/dist/setup-CIRH5BYB.js +0 -517
- package/dist/setup-CIRH5BYB.js.map +0 -1
- package/dist/source-manifest-publish-LTRXO2OQ.js.map +0 -1
- package/dist/validator-RN64BKFW.js +0 -5
package/dist/cli/index.js
CHANGED
|
@@ -1,79 +1,82 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { AI_RESOURCES } from '../chunk-PTETBRRC.js';
|
|
3
|
+
import { makeInstallCommand, makeCheckCommand, makeCleanCommand, reportInstalledSoftDeps } from '../chunk-5IIHO2HI.js';
|
|
4
|
+
import { makeProvidersCommand, loadRegistryView, addProviderEntry, ProviderRegistryWriteError } from '../chunk-CUU3AMGE.js';
|
|
5
|
+
import { getStoreConfig, storeFetch, deviceLogin, loadStoreAuthConfig, logout, hasStoredAuth, isStoreAuthenticated, getStoreToken, getStoreIdentity } from '../chunk-G2F3ZCPK.js';
|
|
6
|
+
import { makeSourceCommand, syncProjectSources } from '../chunk-PCJF3XBH.js';
|
|
7
|
+
import { openCatalogSource, openLibraryManager, createFullRegistry, openLibrary } from '../chunk-MJY2BO6N.js';
|
|
8
|
+
import { logErr, S, logOk, logInfo, logWarn, kindColorPad, kindColor, colorRef, formatSoftDepSection, bareSoftDepName, formatSoftDepHint, formatRelativeTime, formatSoftDepRemovePreview, formatSoftDepAddPreview, fitWidth } from '../chunk-KIQGTAJ5.js';
|
|
8
9
|
import { LocalSecretsProvider } from '../chunk-6BEGKO2Q.js';
|
|
9
|
-
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-
|
|
10
|
-
import '../chunk-
|
|
11
|
-
import '../chunk-
|
|
12
|
-
import '../chunk-
|
|
13
|
-
import '../chunk-773WLEXL.js';
|
|
14
|
-
import '../chunk-R6O6YWU7.js';
|
|
10
|
+
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-HO2FQ76C.js';
|
|
11
|
+
import { buildClaudePluginFiles } from '../chunk-NR6BPOW5.js';
|
|
12
|
+
import '../chunk-XEVWRSLS.js';
|
|
13
|
+
import '../chunk-UKWEJPZZ.js';
|
|
15
14
|
import '../chunk-FAI2SMFE.js';
|
|
16
15
|
import '../chunk-7IRJ4K4F.js';
|
|
17
|
-
import
|
|
16
|
+
import '../chunk-JXCUUZA3.js';
|
|
17
|
+
import '../chunk-FUCYTGAE.js';
|
|
18
|
+
import '../chunk-R6O6YWU7.js';
|
|
18
19
|
import '../chunk-X5YPJV4N.js';
|
|
19
|
-
import '../chunk-W3UDISS2.js';
|
|
20
20
|
import '../chunk-O7SG5PC2.js';
|
|
21
21
|
import '../chunk-7QBNJTTQ.js';
|
|
22
22
|
import '../chunk-GTS2FODO.js';
|
|
23
23
|
import '../chunk-73ZXUUL6.js';
|
|
24
24
|
import '../chunk-32NA4TVC.js';
|
|
25
|
-
import '../chunk-
|
|
26
|
-
import
|
|
25
|
+
import '../chunk-W3UDISS2.js';
|
|
26
|
+
import '../chunk-45LLHKQ2.js';
|
|
27
|
+
import { runFlow, resumeFlow } from '../chunk-Y6E62LFB.js';
|
|
27
28
|
import '../chunk-4R6DROGN.js';
|
|
28
29
|
import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-3XXQPHGL.js';
|
|
29
30
|
import '../chunk-7BUZQVRR.js';
|
|
30
31
|
import '../chunk-M6VQU5TS.js';
|
|
31
|
-
import '../chunk-
|
|
32
|
-
import '../chunk-
|
|
33
|
-
import '../chunk-
|
|
34
|
-
import '../chunk-
|
|
32
|
+
import '../chunk-RM4C5AU3.js';
|
|
33
|
+
import '../chunk-KW7YIRYL.js';
|
|
34
|
+
import '../chunk-FODAC4RE.js';
|
|
35
|
+
import '../chunk-WLFRA5RM.js';
|
|
35
36
|
import '../chunk-LOO5CB5M.js';
|
|
36
|
-
import '../chunk-
|
|
37
|
-
import '../chunk-
|
|
37
|
+
import '../chunk-QQL3ET3J.js';
|
|
38
|
+
import '../chunk-3ZTQY276.js';
|
|
38
39
|
import '../chunk-GAH4YRCI.js';
|
|
39
|
-
import '../chunk-
|
|
40
|
+
import { deriveRegistryFromLegacyApiKeys, getProviderPreset, AI_PROVIDER_PRESETS } from '../chunk-SG4D2UOK.js';
|
|
40
41
|
import '../chunk-6E6PKKAD.js';
|
|
41
42
|
import '../chunk-IFGTRL2I.js';
|
|
42
|
-
import { projectAiAssetsRoots, loadFlow, loadAllFlowEntries, findFlowFileInRoots } from '../chunk-
|
|
43
|
+
import { projectAiAssetsRoots, loadFlow, loadAllFlowEntries, findFlowFileInRoots } from '../chunk-MIP4IC3O.js';
|
|
43
44
|
import '../chunk-TIOT3ZOQ.js';
|
|
44
45
|
import '../chunk-53ORCYPJ.js';
|
|
45
46
|
import '../chunk-2D5BYAL6.js';
|
|
46
47
|
import { nodeLabel, nodeSkillAsset, nodeIsInert, nodeIsOptional, nodeRunKind, flowSkillVersionPins } from '../chunk-ELPR5XBG.js';
|
|
47
|
-
import '../chunk-
|
|
48
|
-
import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, parseRefTolerant, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-
|
|
49
|
-
import { getStoreManifestsDir, getDefaultValue, isSecretPlaceholder } from '../chunk-
|
|
50
|
-
import '../chunk-
|
|
48
|
+
import '../chunk-YS4XBN7O.js';
|
|
49
|
+
import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, parseRefTolerant, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-DNGAA24M.js';
|
|
50
|
+
import { getStoreManifestsDir, getDefaultValue, isSecretPlaceholder } from '../chunk-EBHY23RZ.js';
|
|
51
|
+
import '../chunk-M5H4DWIA.js';
|
|
51
52
|
import '../chunk-UKJMQZV6.js';
|
|
52
53
|
import '../chunk-R7FOF242.js';
|
|
53
54
|
import '../chunk-JXT46QFC.js';
|
|
54
|
-
import '../chunk-
|
|
55
|
+
import '../chunk-NBPL76HH.js';
|
|
55
56
|
import '../chunk-CGYEHQOX.js';
|
|
56
|
-
import { resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings,
|
|
57
|
+
import { resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, WorkspaceYamlEditor, resolveLibraryDir, checkAgentSkillConformance, aiResourceRoots, readLock, workspaceProviderRegistryPath, userProviderRegistryPath, loadProviderRegistryFile } from '../chunk-C3QLJTMB.js';
|
|
58
|
+
import { factoryAssetRoots } from '../chunk-REILIKVM.js';
|
|
57
59
|
import '../chunk-F3HNW354.js';
|
|
58
60
|
import { DRIVER_DEFAULTS } from '../chunk-K5GBV4SA.js';
|
|
59
61
|
import { detectDomains, assetSearchDirs } from '../chunk-QVZA2MDT.js';
|
|
60
|
-
import {
|
|
61
|
-
import { globalCacheRoot, sourceCacheKey, getGlobalCacheDir, resolveAgentDir, matchPin, coerceVersion, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug } from '../chunk-MBARHWMZ.js';
|
|
62
|
+
import { globalCacheRoot, sourceCacheKey, getGlobalCacheDir, resolveAgentDir, matchPin, coerceVersion, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug, isWorkspaceConfigFilename } from '../chunk-K27T47OO.js';
|
|
62
63
|
import { SUPPORTED_DRIVER_TARGETS } from '../chunk-MENCWIHW.js';
|
|
63
64
|
import { SKAILE_MANIFEST_FILENAME, decodeSkaileManifest, loadSkPublishManifest, saveSkPublishManifest } from '../chunk-P4VHQA4N.js';
|
|
64
65
|
import { parseFrontmatter, scanDirectory } from '../chunk-MKZOK4JU.js';
|
|
65
66
|
import { parseAssetRef, ASSET_KINDS, isValidAssetName, slugifyAssetName, ASSET_NAME_HINT, assetRefToStr } from '../chunk-GEEW6SY2.js';
|
|
66
67
|
import { openSqlite } from '../chunk-FTG7CRFD.js';
|
|
68
|
+
import { portableSpawn, portableSpawnSync } from '../chunk-KSIRR5PL.js';
|
|
69
|
+
import { parseModelRef, mergeRegistries, resolveEntryBaseUrl } from '../chunk-ILG4BXYE.js';
|
|
67
70
|
import '../chunk-W4IPN3DD.js';
|
|
68
71
|
import '../chunk-KTBKW2FI.js';
|
|
69
72
|
import '../chunk-UQ6LFBPZ.js';
|
|
70
|
-
import '../chunk-
|
|
71
|
-
import { validatePreset } from '../chunk-
|
|
73
|
+
import '../chunk-DKCFWSVW.js';
|
|
74
|
+
import { validatePreset } from '../chunk-N7B3LZ7V.js';
|
|
72
75
|
import '../chunk-NSBPE2FW.js';
|
|
73
76
|
import * as fs12 from 'fs';
|
|
74
77
|
import fs12__default, { readFileSync, existsSync, mkdirSync, writeFileSync, lstatSync, rmSync, readdirSync, statSync } from 'fs';
|
|
75
|
-
import * as
|
|
76
|
-
import
|
|
78
|
+
import * as path36 from 'path';
|
|
79
|
+
import path36__default, { resolve, join } from 'path';
|
|
77
80
|
import { fileURLToPath } from 'url';
|
|
78
81
|
import { Help, Command, Option } from 'commander';
|
|
79
82
|
import { rcompare } from 'semver';
|
|
@@ -81,7 +84,7 @@ import * as p5 from '@clack/prompts';
|
|
|
81
84
|
import pc5 from 'picocolors';
|
|
82
85
|
import * as os from 'os';
|
|
83
86
|
import { homedir } from 'os';
|
|
84
|
-
import { parse, stringify } from 'yaml';
|
|
87
|
+
import { parse, stringify, parseDocument } from 'yaml';
|
|
85
88
|
import * as readline from 'readline';
|
|
86
89
|
import { createInterface } from 'readline';
|
|
87
90
|
import fs5 from 'fs/promises';
|
|
@@ -111,7 +114,7 @@ async function runSearch(kind, query, opts) {
|
|
|
111
114
|
const showLocal = !opts.store;
|
|
112
115
|
const showStore = !opts.local;
|
|
113
116
|
const { resolveConfig } = await import('../library/index.js');
|
|
114
|
-
const airGapped = resolveConfig({ projectDir:
|
|
117
|
+
const airGapped = resolveConfig({ projectDir: path36__default.resolve(opts.projectDir) }).catalog.cache_ttl === 0;
|
|
115
118
|
if (showLocal) {
|
|
116
119
|
await searchLocal(query, kind, opts, showStore, airGapped);
|
|
117
120
|
}
|
|
@@ -120,7 +123,7 @@ async function runSearch(kind, query, opts) {
|
|
|
120
123
|
}
|
|
121
124
|
}
|
|
122
125
|
async function searchIndex(query, kind) {
|
|
123
|
-
const { openLibrary: openLibrary2 } = await import('../open-library-
|
|
126
|
+
const { openLibrary: openLibrary2 } = await import('../open-library-6LM4W4DR.js');
|
|
124
127
|
const library = await openLibrary2();
|
|
125
128
|
try {
|
|
126
129
|
const defs = await library.listAssetDefs(kind ? { kind } : {});
|
|
@@ -152,7 +155,7 @@ async function searchIndex(query, kind) {
|
|
|
152
155
|
}
|
|
153
156
|
}
|
|
154
157
|
async function searchFactory(projectDir, query, kind) {
|
|
155
|
-
const prefixes = factoryAssetRoots().map((r) => r.endsWith(
|
|
158
|
+
const prefixes = factoryAssetRoots().map((r) => r.endsWith(path36__default.sep) ? r : r + path36__default.sep);
|
|
156
159
|
const isFactoryPath = (p7) => prefixes.some((fp) => p7 === fp.slice(0, -1) || p7.startsWith(fp));
|
|
157
160
|
try {
|
|
158
161
|
const entries = await new AssetManager({ projectDir }).search(query, kind);
|
|
@@ -169,11 +172,11 @@ function unionEntries(indexed, factory) {
|
|
|
169
172
|
return [...indexed, ...factory.filter((e) => !seen.has(entryDedupKey(e)))];
|
|
170
173
|
}
|
|
171
174
|
async function searchLocal(query, kind, opts, showStore, airGapped) {
|
|
172
|
-
const projectDir =
|
|
175
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
173
176
|
const factory = await searchFactory(projectDir, query, kind);
|
|
174
177
|
let entries = unionEntries(await searchIndex(query, kind), factory);
|
|
175
178
|
if (entries.length === 0 && !query && !kind && !airGapped) {
|
|
176
|
-
const { autoSyncForSearch } = await import('../source-
|
|
179
|
+
const { autoSyncForSearch } = await import('../source-G2VCWPDU.js');
|
|
177
180
|
if (await autoSyncForSearch(projectDir)) {
|
|
178
181
|
entries = unionEntries(await searchIndex(query, kind), factory);
|
|
179
182
|
}
|
|
@@ -227,9 +230,9 @@ async function searchStore(query, kind, opts, airGapped) {
|
|
|
227
230
|
logInfo("air-gapped (cache_ttl: 0) \u2014 local sources only");
|
|
228
231
|
return;
|
|
229
232
|
}
|
|
230
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-
|
|
233
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-6LM4W4DR.js');
|
|
231
234
|
try {
|
|
232
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
235
|
+
const remote = await openCatalogSource2({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
233
236
|
const assets = await remote.listAssets(kind ? { kind } : {});
|
|
234
237
|
const results = filterCatalogAssets(assets, query);
|
|
235
238
|
if (results.length > 0) {
|
|
@@ -343,7 +346,7 @@ function makeAddCommand() {
|
|
|
343
346
|
}
|
|
344
347
|
const backends = parseBackendFilter(opts.backend);
|
|
345
348
|
const am2 = new AssetManager({
|
|
346
|
-
projectDir:
|
|
349
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
347
350
|
global: opts.global || backends !== void 0,
|
|
348
351
|
backends,
|
|
349
352
|
driverTarget: opts.target
|
|
@@ -386,7 +389,7 @@ function makeRemoveCommand() {
|
|
|
386
389
|
).option("--target <agent>", "Driver target", "claude-code").option("--no-soft-deps", "skip the orphaned-soft-dep prompt (don't remove, don't report)").action(async (ref, opts) => {
|
|
387
390
|
const backends = parseBackendFilter(opts.backend);
|
|
388
391
|
const am2 = new AssetManager({
|
|
389
|
-
projectDir:
|
|
392
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
390
393
|
global: opts.global || backends !== void 0,
|
|
391
394
|
backends,
|
|
392
395
|
driverTarget: opts.target
|
|
@@ -426,7 +429,7 @@ function makeListCommand() {
|
|
|
426
429
|
return;
|
|
427
430
|
}
|
|
428
431
|
const am2 = new AssetManager({
|
|
429
|
-
projectDir:
|
|
432
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
430
433
|
driverTarget: opts.target
|
|
431
434
|
});
|
|
432
435
|
let declared;
|
|
@@ -471,7 +474,7 @@ function makeListCommand() {
|
|
|
471
474
|
}
|
|
472
475
|
function runGlobalList(kind, opts, backends) {
|
|
473
476
|
const am2 = new AssetManager({
|
|
474
|
-
projectDir:
|
|
477
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
475
478
|
global: true,
|
|
476
479
|
backends
|
|
477
480
|
});
|
|
@@ -542,7 +545,7 @@ async function resolveInfoEntry(am2, ref, opts) {
|
|
|
542
545
|
return { entry: match ?? deployed };
|
|
543
546
|
}
|
|
544
547
|
const lookup = opts.storeLookup ?? (async (filter) => {
|
|
545
|
-
const { resolveCatalogSource } = await import('../open-library-
|
|
548
|
+
const { resolveCatalogSource } = await import('../open-library-6LM4W4DR.js');
|
|
546
549
|
const { source, close } = await resolveCatalogSource({ projectDir: opts.projectDir });
|
|
547
550
|
try {
|
|
548
551
|
return await source.listAssets(filter);
|
|
@@ -558,7 +561,7 @@ async function resolveInfoEntry(am2, ref, opts) {
|
|
|
558
561
|
);
|
|
559
562
|
return { entry: hit ? catalogAssetToEntry(hit) : null };
|
|
560
563
|
} catch (err) {
|
|
561
|
-
const { LocalCatalogDisabledError } = await import('../open-library-
|
|
564
|
+
const { LocalCatalogDisabledError } = await import('../open-library-6LM4W4DR.js');
|
|
562
565
|
const storeNote = err instanceof Error ? err.message : String(err);
|
|
563
566
|
const disabled = err instanceof LocalCatalogDisabledError || /catalog\.url/i.test(storeNote);
|
|
564
567
|
return { entry: null, storeNote, ...disabled ? { storeDisabled: true } : {} };
|
|
@@ -574,7 +577,7 @@ function infoNotFoundHint(ref, lookup) {
|
|
|
574
577
|
}
|
|
575
578
|
function makeInfoCommand() {
|
|
576
579
|
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) => {
|
|
577
|
-
const projectDir =
|
|
580
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
578
581
|
const am2 = new AssetManager({ projectDir });
|
|
579
582
|
const lookup = await resolveInfoEntry(am2, ref, { projectDir });
|
|
580
583
|
const entry = lookup.entry;
|
|
@@ -610,7 +613,7 @@ function makeCreateCommand() {
|
|
|
610
613
|
new Option("-k, --kind <kind>", "Asset kind").default("skill").choices([...ASSET_KINDS])
|
|
611
614
|
).option("-d, --dir <dir>", "Target directory (default: cwd)").action((name, opts) => {
|
|
612
615
|
const am2 = new AssetManager({ projectDir: process.cwd() });
|
|
613
|
-
const destDir = opts.dir ?
|
|
616
|
+
const destDir = opts.dir ? path36__default.resolve(opts.dir) : process.cwd();
|
|
614
617
|
const result = am2.create(name, opts.kind, destDir);
|
|
615
618
|
if (result.ok) logOk(`Created ${kindColor(opts.kind)}: ${pc5.dim(result.path)}`);
|
|
616
619
|
else {
|
|
@@ -621,7 +624,7 @@ function makeCreateCommand() {
|
|
|
621
624
|
}
|
|
622
625
|
function makeDoctorCommand() {
|
|
623
626
|
return new Command("doctor").description("Scan for missing dependency chains").argument("[name]", "Check a specific asset (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).action(async (name, opts) => {
|
|
624
|
-
const am2 = new AssetManager({ projectDir:
|
|
627
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
625
628
|
const issues = await am2.doctor();
|
|
626
629
|
if (issues.length === 0) {
|
|
627
630
|
logOk("No missing dependencies.");
|
|
@@ -649,20 +652,20 @@ function claudeSkillRoots() {
|
|
|
649
652
|
const roots = [];
|
|
650
653
|
const override = process.env.SKAILE_CLAUDE_SKILLS_DIR;
|
|
651
654
|
if (override) roots.push(override);
|
|
652
|
-
roots.push(
|
|
655
|
+
roots.push(path36.join(os.homedir(), ".claude", "skills"));
|
|
653
656
|
return roots;
|
|
654
657
|
}
|
|
655
658
|
function resolveImportSource(nameOrPath) {
|
|
656
|
-
const asPath =
|
|
659
|
+
const asPath = path36.resolve(nameOrPath);
|
|
657
660
|
if (fs12.existsSync(asPath)) {
|
|
658
|
-
const dir = fs12.statSync(asPath).isDirectory() ? asPath :
|
|
659
|
-
const skillFile =
|
|
661
|
+
const dir = fs12.statSync(asPath).isDirectory() ? asPath : path36.dirname(asPath);
|
|
662
|
+
const skillFile = path36.join(dir, "SKILL.md");
|
|
660
663
|
if (fs12.existsSync(skillFile)) return { dir, skillFile, via: "path" };
|
|
661
664
|
}
|
|
662
|
-
if (!nameOrPath.includes(
|
|
665
|
+
if (!nameOrPath.includes(path36.sep) && !nameOrPath.startsWith(".")) {
|
|
663
666
|
for (const root of claudeSkillRoots()) {
|
|
664
|
-
const dir =
|
|
665
|
-
const skillFile =
|
|
667
|
+
const dir = path36.join(root, nameOrPath);
|
|
668
|
+
const skillFile = path36.join(dir, "SKILL.md");
|
|
666
669
|
if (fs12.existsSync(skillFile)) return { dir, skillFile, via: "claude-skills" };
|
|
667
670
|
}
|
|
668
671
|
}
|
|
@@ -728,8 +731,8 @@ ${description}
|
|
|
728
731
|
`;
|
|
729
732
|
};
|
|
730
733
|
function ensureDomain(libraryPath, domain, opts = {}) {
|
|
731
|
-
const dir =
|
|
732
|
-
const domainFile =
|
|
734
|
+
const dir = path36.join(libraryPath, domain);
|
|
735
|
+
const domainFile = path36.join(dir, "DOMAIN.md");
|
|
733
736
|
const publisher = opts.publisher ?? slugifyAssetName(domain);
|
|
734
737
|
if (fs12.existsSync(domainFile)) {
|
|
735
738
|
return { dir, publisher, created: false };
|
|
@@ -741,7 +744,7 @@ function ensureDomain(libraryPath, domain, opts = {}) {
|
|
|
741
744
|
}
|
|
742
745
|
function listDomains(libraryPath) {
|
|
743
746
|
if (!fs12.existsSync(libraryPath)) return [];
|
|
744
|
-
return fs12.readdirSync(libraryPath, { withFileTypes: true }).filter((e) => e.isDirectory() && fs12.existsSync(
|
|
747
|
+
return fs12.readdirSync(libraryPath, { withFileTypes: true }).filter((e) => e.isDirectory() && fs12.existsSync(path36.join(libraryPath, e.name, "DOMAIN.md"))).map((e) => e.name).sort();
|
|
745
748
|
}
|
|
746
749
|
function upsertManifestAsset(libraryPath, input) {
|
|
747
750
|
const manifest = loadSkPublishManifest(libraryPath) ?? { assets: [] };
|
|
@@ -812,10 +815,10 @@ function makeAssetCommand() {
|
|
|
812
815
|
}
|
|
813
816
|
const rawSkill = fs12.readFileSync(src.skillFile, "utf8");
|
|
814
817
|
const norm = opts.normalize ? normalizeSkillContent(rawSkill, {
|
|
815
|
-
fallbackName:
|
|
818
|
+
fallbackName: path36.basename(src.dir),
|
|
816
819
|
version: opts.version,
|
|
817
820
|
stage: opts.stage
|
|
818
|
-
}) : { content: rawSkill, name:
|
|
821
|
+
}) : { content: rawSkill, name: path36.basename(src.dir), changed: false, notes: [] };
|
|
819
822
|
if (!opts.normalize && !isValidAssetName(norm.name)) {
|
|
820
823
|
logWarn(
|
|
821
824
|
`Name "${norm.name}" is not canonical (kebab-case); \`skaile validate\` will reject this manifest entry. Drop --no-normalize to slugify it.`
|
|
@@ -826,17 +829,17 @@ function makeAssetCommand() {
|
|
|
826
829
|
if (opts.domain) {
|
|
827
830
|
const dom = ensureDomain(target.path, opts.domain);
|
|
828
831
|
if (dom.created) logOk(`Scaffolded domain ${S.cmd(opts.domain)} \u2192 ${dom.dir}`);
|
|
829
|
-
destParent =
|
|
832
|
+
destParent = path36.join(dom.dir, "skills");
|
|
830
833
|
publisher = dom.publisher;
|
|
831
834
|
}
|
|
832
835
|
fs12.mkdirSync(destParent, { recursive: true });
|
|
833
|
-
const destDir =
|
|
836
|
+
const destDir = path36.join(destParent, norm.name);
|
|
834
837
|
if (fs12.existsSync(destDir)) {
|
|
835
838
|
logErr(`Destination already exists: ${destDir}`);
|
|
836
839
|
process.exit(1);
|
|
837
840
|
}
|
|
838
841
|
fs12.cpSync(src.dir, destDir, { recursive: true });
|
|
839
|
-
fs12.writeFileSync(
|
|
842
|
+
fs12.writeFileSync(path36.join(destDir, "SKILL.md"), norm.content, "utf8");
|
|
840
843
|
for (const note of norm.notes) logInfo(` \u2022 ${note}`);
|
|
841
844
|
const fm = parseFrontmatter(norm.content).data;
|
|
842
845
|
const descRaw = fm.description;
|
|
@@ -844,7 +847,7 @@ function makeAssetCommand() {
|
|
|
844
847
|
for (const f of checkAgentSkillConformance(fm, { dirName: norm.name })) {
|
|
845
848
|
logWarn(`conformance: ${f.field} \u2014 ${f.message}`);
|
|
846
849
|
}
|
|
847
|
-
const root =
|
|
850
|
+
const root = path36.relative(target.path, destDir);
|
|
848
851
|
const up = upsertManifestAsset(target.path, {
|
|
849
852
|
kind: "skill",
|
|
850
853
|
name: norm.name,
|
|
@@ -905,10 +908,10 @@ function makeAssetCommand() {
|
|
|
905
908
|
);
|
|
906
909
|
process.exit(1);
|
|
907
910
|
}
|
|
908
|
-
const basename2 =
|
|
909
|
-
const destDir = target.structure === "domain" && opts.domain ?
|
|
911
|
+
const basename2 = path36.basename(srcPath);
|
|
912
|
+
const destDir = target.structure === "domain" && opts.domain ? path36.join(target.path, opts.domain) : target.path;
|
|
910
913
|
fs12.mkdirSync(destDir, { recursive: true });
|
|
911
|
-
const destPath =
|
|
914
|
+
const destPath = path36.join(destDir, basename2);
|
|
912
915
|
if (fs12.existsSync(destPath)) {
|
|
913
916
|
logErr(`Destination already exists: ${destPath}`);
|
|
914
917
|
process.exit(1);
|
|
@@ -921,7 +924,7 @@ function makeAssetCommand() {
|
|
|
921
924
|
fs12.renameSync(srcPath, destPath);
|
|
922
925
|
break;
|
|
923
926
|
case "link":
|
|
924
|
-
fs12.symlinkSync(
|
|
927
|
+
fs12.symlinkSync(path36.resolve(srcPath), destPath);
|
|
925
928
|
break;
|
|
926
929
|
}
|
|
927
930
|
if (target.backend === "git" && opts.commit) {
|
|
@@ -978,17 +981,17 @@ function makeAssetCommand() {
|
|
|
978
981
|
}
|
|
979
982
|
const manifestPath = def.manifest.path;
|
|
980
983
|
const candidateSubpath = typeof manifestPath === "string" && manifestPath.length > 0 ? manifestPath : def.name;
|
|
981
|
-
const srcPath =
|
|
984
|
+
const srcPath = path36.join(lib.path, candidateSubpath);
|
|
982
985
|
if (!fs12.existsSync(srcPath)) {
|
|
983
986
|
logErr(`Asset path not found: ${srcPath}`);
|
|
984
987
|
process.exit(1);
|
|
985
988
|
}
|
|
986
|
-
const destPath =
|
|
987
|
-
fs12.mkdirSync(
|
|
989
|
+
const destPath = path36.join(target, candidateSubpath);
|
|
990
|
+
fs12.mkdirSync(path36.dirname(destPath), { recursive: true });
|
|
988
991
|
if (opts.mode === "copy") {
|
|
989
992
|
fs12.cpSync(srcPath, destPath, { recursive: true });
|
|
990
993
|
} else {
|
|
991
|
-
fs12.symlinkSync(
|
|
994
|
+
fs12.symlinkSync(path36.resolve(srcPath), destPath);
|
|
992
995
|
}
|
|
993
996
|
logOk(`Installed ${ref} \u2192 ${destPath} (${opts.mode})`);
|
|
994
997
|
} finally {
|
|
@@ -1053,14 +1056,14 @@ function makeAuthCommand() {
|
|
|
1053
1056
|
}
|
|
1054
1057
|
function collectCacheTargets(scope) {
|
|
1055
1058
|
const out = [];
|
|
1056
|
-
out.push(
|
|
1057
|
-
out.push(
|
|
1058
|
-
out.push(
|
|
1059
|
+
out.push(path36__default.join(scope.projectDir, ".skaile", "cache"));
|
|
1060
|
+
out.push(path36__default.join(scope.projectDir, ".skaile", "store-cache"));
|
|
1061
|
+
out.push(path36__default.join(scope.projectDir, ".skaile", "repos"));
|
|
1059
1062
|
if (scope.global) {
|
|
1060
1063
|
out.push(globalCacheRoot());
|
|
1061
|
-
const home = process.env.SKAILE_HOME ??
|
|
1062
|
-
out.push(
|
|
1063
|
-
out.push(
|
|
1064
|
+
const home = process.env.SKAILE_HOME ?? path36__default.join(homedir(), ".skaile");
|
|
1065
|
+
out.push(path36__default.join(home, "repos"));
|
|
1066
|
+
out.push(path36__default.join(home, "catalog-cache"));
|
|
1064
1067
|
}
|
|
1065
1068
|
return out;
|
|
1066
1069
|
}
|
|
@@ -1074,7 +1077,7 @@ function dirSize(target) {
|
|
|
1074
1077
|
function dirSizeOfDir(dir) {
|
|
1075
1078
|
let total = 0;
|
|
1076
1079
|
for (const ent of readdirSync(dir, { withFileTypes: true })) {
|
|
1077
|
-
const child =
|
|
1080
|
+
const child = path36__default.join(dir, ent.name);
|
|
1078
1081
|
if (ent.isSymbolicLink()) continue;
|
|
1079
1082
|
if (ent.isDirectory()) total += dirSizeOfDir(child);
|
|
1080
1083
|
else if (ent.isFile()) total += statSync(child).size;
|
|
@@ -1100,7 +1103,7 @@ function makeCacheCommand() {
|
|
|
1100
1103
|
const cmd = new Command("cache").description("Inspect and reclaim the re-derivable cache");
|
|
1101
1104
|
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) => {
|
|
1102
1105
|
const targets = collectCacheTargets({
|
|
1103
|
-
projectDir:
|
|
1106
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
1104
1107
|
global: opts.global
|
|
1105
1108
|
}).filter((t) => existsSync(t));
|
|
1106
1109
|
if (targets.length === 0) {
|
|
@@ -1130,12 +1133,12 @@ function makeCacheCommand() {
|
|
|
1130
1133
|
for (const r of removed) logOk(`Removed ${r}`);
|
|
1131
1134
|
});
|
|
1132
1135
|
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) => {
|
|
1133
|
-
console.log(
|
|
1136
|
+
console.log(path36__default.join(path36__default.resolve(opts.projectDir), ".skaile", "cache"));
|
|
1134
1137
|
if (opts.global) console.log(globalCacheRoot());
|
|
1135
1138
|
});
|
|
1136
1139
|
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) => {
|
|
1137
1140
|
const targets = collectCacheTargets({
|
|
1138
|
-
projectDir:
|
|
1141
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
1139
1142
|
global: opts.global
|
|
1140
1143
|
});
|
|
1141
1144
|
console.log();
|
|
@@ -1151,7 +1154,7 @@ function makeCatalogCommand() {
|
|
|
1151
1154
|
const catalog = new Command("catalog").description("Catalog source health and configuration");
|
|
1152
1155
|
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) => {
|
|
1153
1156
|
const { resolveConfig, isLocalCatalogUrl, trpcGetUrl } = await import('../library/index.js');
|
|
1154
|
-
const projectDir = opts.projectDir ?
|
|
1157
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : void 0;
|
|
1155
1158
|
const cfg = resolveConfig({ projectDir });
|
|
1156
1159
|
const baseUrl = opts.url ?? cfg.catalog.url;
|
|
1157
1160
|
if (isLocalCatalogUrl(baseUrl)) {
|
|
@@ -1169,7 +1172,7 @@ function makeCatalogCommand() {
|
|
|
1169
1172
|
});
|
|
1170
1173
|
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) => {
|
|
1171
1174
|
const { resolveConfig } = await import('../library/index.js');
|
|
1172
|
-
const projectDir = opts.projectDir ?
|
|
1175
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : void 0;
|
|
1173
1176
|
const cfg = resolveConfig({ projectDir });
|
|
1174
1177
|
console.log(`url: ${cfg.catalog.url}`);
|
|
1175
1178
|
console.log(`framing: ${cfg.catalog.framing}`);
|
|
@@ -1178,7 +1181,7 @@ function makeCatalogCommand() {
|
|
|
1178
1181
|
return catalog;
|
|
1179
1182
|
}
|
|
1180
1183
|
async function runLocalCatalogTest(projectDir) {
|
|
1181
|
-
const { resolveCatalogSource } = await import('../open-library-
|
|
1184
|
+
const { resolveCatalogSource } = await import('../open-library-6LM4W4DR.js');
|
|
1182
1185
|
let resolved;
|
|
1183
1186
|
try {
|
|
1184
1187
|
resolved = await resolveCatalogSource({ projectDir });
|
|
@@ -1330,9 +1333,9 @@ function findSkills(domain) {
|
|
|
1330
1333
|
}
|
|
1331
1334
|
function walkSkills(dir, domain, out) {
|
|
1332
1335
|
for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
|
|
1333
|
-
const full =
|
|
1336
|
+
const full = path36__default.join(dir, entry.name);
|
|
1334
1337
|
if (entry.isDirectory()) {
|
|
1335
|
-
const skillMd =
|
|
1338
|
+
const skillMd = path36__default.join(full, "SKILL.md");
|
|
1336
1339
|
if (fs12__default.existsSync(skillMd)) {
|
|
1337
1340
|
out.push({ name: entry.name, path: full, skillPath: skillMd, domain });
|
|
1338
1341
|
} else {
|
|
@@ -1361,7 +1364,7 @@ function resolveFlowIds() {
|
|
|
1361
1364
|
}
|
|
1362
1365
|
}
|
|
1363
1366
|
function resolveSessionIds(projectDir) {
|
|
1364
|
-
const sessionsDir =
|
|
1367
|
+
const sessionsDir = path36__default.join(projectDir, ".skaile", "sessions");
|
|
1365
1368
|
if (!fs12__default.existsSync(sessionsDir)) return [];
|
|
1366
1369
|
try {
|
|
1367
1370
|
return fs12__default.readdirSync(sessionsDir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length));
|
|
@@ -1417,20 +1420,19 @@ function resolveDynamic(words, cword) {
|
|
|
1417
1420
|
if (cmd === "config" && ["get", "set"].includes(sub) && isLast(3)) return CONFIG_KEYS;
|
|
1418
1421
|
return null;
|
|
1419
1422
|
}
|
|
1420
|
-
var PERSONAL_KEYS = /* @__PURE__ */ new Set(["driver", "model"
|
|
1423
|
+
var PERSONAL_KEYS = /* @__PURE__ */ new Set(["driver", "model"]);
|
|
1421
1424
|
var API_KEY_PREFIX = "apiKey.";
|
|
1422
1425
|
function collectWorkspaceDefaults(projectDir) {
|
|
1423
1426
|
const wsDefaults = {};
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
} catch {
|
|
1427
|
+
const ws = resolveSkWorkspaceConfig(projectDir);
|
|
1428
|
+
const p7 = ws.agent_config?.default ?? {};
|
|
1429
|
+
if (p7.driver) wsDefaults.driver = p7.driver;
|
|
1430
|
+
if (p7.model) wsDefaults.model = p7.model;
|
|
1431
|
+
if (p7.skills_dir) wsDefaults.skills_dir = p7.skills_dir;
|
|
1432
|
+
if (p7.agents_dir) wsDefaults.agents_dir = p7.agents_dir;
|
|
1433
|
+
if (p7.prompts_dir) wsDefaults.prompts_dir = p7.prompts_dir;
|
|
1434
|
+
for (const [role, target] of Object.entries(ws.roles ?? {})) {
|
|
1435
|
+
wsDefaults[`@${role}`] = target;
|
|
1434
1436
|
}
|
|
1435
1437
|
return wsDefaults;
|
|
1436
1438
|
}
|
|
@@ -1438,7 +1440,7 @@ function printEffectiveSection(config) {
|
|
|
1438
1440
|
console.log();
|
|
1439
1441
|
console.log(S.heading(" Effective Config"));
|
|
1440
1442
|
console.log(` ${S.rule(40)}`);
|
|
1441
|
-
for (const key of ["driver", "
|
|
1443
|
+
for (const key of ["driver", "model"]) {
|
|
1442
1444
|
const value = config[key];
|
|
1443
1445
|
if (value !== void 0) {
|
|
1444
1446
|
console.log(` ${S.label(`${key}:`.padEnd(16))} ${value}`);
|
|
@@ -1454,19 +1456,49 @@ function printWorkspaceDefaultsSection(wsDefaults) {
|
|
|
1454
1456
|
console.log(` ${S.label(`${key}:`.padEnd(16))} ${value}`);
|
|
1455
1457
|
}
|
|
1456
1458
|
}
|
|
1457
|
-
function
|
|
1458
|
-
|
|
1459
|
+
function printModelSelectionSection(config, projectDir) {
|
|
1460
|
+
const view = loadRegistryView({ projectDir });
|
|
1461
|
+
const legacy = deriveRegistryFromLegacyApiKeys(config.apiKeys);
|
|
1462
|
+
const registry = Object.keys(legacy.providers).length > 0 ? mergeRegistries([
|
|
1463
|
+
{ layer: "catalog", providers: legacy.providers },
|
|
1464
|
+
{ layer: "user", providers: view.merged.providers }
|
|
1465
|
+
]) : view.merged;
|
|
1459
1466
|
console.log();
|
|
1460
|
-
console.log(` ${S.heading("
|
|
1467
|
+
console.log(` ${S.heading("Model selection")}`);
|
|
1461
1468
|
console.log(` ${S.rule(40)}`);
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1469
|
+
const selector = config.model;
|
|
1470
|
+
if (!selector) {
|
|
1471
|
+
console.log(` ${S.dim("no model: selector \u2014 the driver applies its own default")}`);
|
|
1472
|
+
} else {
|
|
1473
|
+
const resolved = parseModelRef(selector, registry, config.roles);
|
|
1474
|
+
if (!resolved) {
|
|
1475
|
+
console.log(` ${S.label("selector:".padEnd(16))} ${selector}`);
|
|
1465
1476
|
console.log(
|
|
1466
|
-
` ${S.
|
|
1477
|
+
` ${S.dim("no AI provider is configured \u2014 add one with")} ${S.cmd("skaile providers add <id> --preset <preset>")}`
|
|
1467
1478
|
);
|
|
1479
|
+
} else {
|
|
1480
|
+
const entry = registry.providers[resolved.providerId];
|
|
1481
|
+
console.log(` ${S.label("selector:".padEnd(16))} ${selector}`);
|
|
1482
|
+
console.log(
|
|
1483
|
+
` ${S.label("resolves to:".padEnd(16))} ${resolved.providerId}${resolved.providerModelId ? ` / ${resolved.providerModelId}` : ""}`
|
|
1484
|
+
);
|
|
1485
|
+
const endpoint = entry ? resolveEntryBaseUrl(entry) : void 0;
|
|
1486
|
+
if (endpoint) console.log(` ${S.label("endpoint:".padEnd(16))} ${endpoint}`);
|
|
1487
|
+
if (entry?.credential) {
|
|
1488
|
+
console.log(
|
|
1489
|
+
` ${S.label("credential:".padEnd(16))} ${entry.credential.kind}${entry.credential.ref ? ` ${entry.credential.ref}` : ""}`
|
|
1490
|
+
);
|
|
1491
|
+
}
|
|
1492
|
+
for (const warning of resolved.warnings) logWarn(warning);
|
|
1468
1493
|
}
|
|
1469
1494
|
}
|
|
1495
|
+
const configured = view.merged.order;
|
|
1496
|
+
if (configured.length > 0) {
|
|
1497
|
+
console.log(
|
|
1498
|
+
` ${S.label("providers:".padEnd(16))} ${configured.join(", ")} ${S.dim("(skaile providers list)")}`
|
|
1499
|
+
);
|
|
1500
|
+
}
|
|
1501
|
+
if (legacy.deprecation) logWarn(legacy.deprecation);
|
|
1470
1502
|
}
|
|
1471
1503
|
function printResolvedPathsSection(config) {
|
|
1472
1504
|
const fw = config.driver ?? "omp";
|
|
@@ -1480,48 +1512,100 @@ function printResolvedPathsSection(config) {
|
|
|
1480
1512
|
console.log(` ${S.label("prompts:".padEnd(16))} ${config.promptsDir ?? paths.promptsDir}`);
|
|
1481
1513
|
}
|
|
1482
1514
|
async function showConfig(opts) {
|
|
1483
|
-
const projectDir = opts.projectDir ?
|
|
1484
|
-
|
|
1485
|
-
|
|
1515
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
|
|
1516
|
+
let config;
|
|
1517
|
+
let wsDefaults;
|
|
1518
|
+
try {
|
|
1519
|
+
config = await resolveSettings(projectDir);
|
|
1520
|
+
wsDefaults = collectWorkspaceDefaults(projectDir);
|
|
1521
|
+
} catch (error) {
|
|
1522
|
+
logErr(error instanceof Error ? error.message : String(error));
|
|
1523
|
+
process.exit(1);
|
|
1524
|
+
}
|
|
1486
1525
|
printEffectiveSection(config);
|
|
1487
1526
|
printWorkspaceDefaultsSection(wsDefaults);
|
|
1488
|
-
|
|
1527
|
+
printModelSelectionSection(config, projectDir);
|
|
1489
1528
|
printResolvedPathsSection(config);
|
|
1490
1529
|
console.log();
|
|
1491
1530
|
}
|
|
1531
|
+
function setApiKeySugar(provider, value, projectDir) {
|
|
1532
|
+
const envName = `${provider.toUpperCase().replace(/[^A-Z0-9]/g, "_")}_API_KEY`;
|
|
1533
|
+
try {
|
|
1534
|
+
const added = addProviderEntry({
|
|
1535
|
+
id: provider,
|
|
1536
|
+
presetId: provider,
|
|
1537
|
+
credentialRef: `env:${envName}`,
|
|
1538
|
+
projectDir,
|
|
1539
|
+
force: true
|
|
1540
|
+
});
|
|
1541
|
+
logOk(`Configured ${pc5.bold(added.id)} in the ${added.layer} registry`);
|
|
1542
|
+
console.log(S.dim(` \u2192 ${added.path}`));
|
|
1543
|
+
} catch (error) {
|
|
1544
|
+
if (!(error instanceof ProviderRegistryWriteError)) throw error;
|
|
1545
|
+
logErr(error.message);
|
|
1546
|
+
console.log(
|
|
1547
|
+
` ${S.dim("Define the endpoint explicitly:")} ${S.cmd(`skaile providers add ${provider} --preset custom --credential env:${envName}`)}`
|
|
1548
|
+
);
|
|
1549
|
+
process.exit(1);
|
|
1550
|
+
}
|
|
1551
|
+
logInfo(
|
|
1552
|
+
`The key itself is never stored by skaile \u2014 export it: ${S.cmd(`export ${envName}=${value.slice(0, 2)}\u2026`)}`
|
|
1553
|
+
);
|
|
1554
|
+
console.log(` ${S.dim("Verify with:")} ${S.cmd(`skaile providers test ${provider}`)}`);
|
|
1555
|
+
}
|
|
1492
1556
|
function makeConfigCommand() {
|
|
1493
1557
|
const cmd = new Command("config").description("Manage personal config (.skaile/settings.json)");
|
|
1494
1558
|
cmd.command("show").description("Show effective config with sources").option("--project-dir <path>", "Project directory").action((opts) => showConfig(opts));
|
|
1495
1559
|
cmd.command("get <key>").description("Get an effective config value").option("--project-dir <path>", "Project directory").action(async (key, opts) => {
|
|
1496
|
-
const projectDir = opts.projectDir ?
|
|
1560
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
|
|
1497
1561
|
const config = await resolveSettings(projectDir);
|
|
1498
1562
|
const value = config[key];
|
|
1499
1563
|
console.log(value ?? S.dim("(not set)"));
|
|
1500
1564
|
});
|
|
1501
|
-
cmd.command("set <key> <value>").description("Set a personal config value (driver, model,
|
|
1502
|
-
const projectDir = opts.projectDir ?
|
|
1565
|
+
cmd.command("set <key> <value>").description("Set a personal config value (driver, model, apiKey.<provider>)").option("--project-dir <path>", "Project directory").option("--global", "Write to ~/.skaile/settings.json instead of project-local").action(async (key, value, opts) => {
|
|
1566
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
|
|
1567
|
+
if (key === "provider" || key === "cloud" || key === "cloudConfig") {
|
|
1568
|
+
logErr(
|
|
1569
|
+
`'${key}' is no longer a setting \u2014 an endpoint is an AI provider registry entry and a session selects one with a model reference.
|
|
1570
|
+
Define it: skaile providers add <id> --preset <preset>
|
|
1571
|
+
Select it: skaile config set model <providerId>/<modelId>`
|
|
1572
|
+
);
|
|
1573
|
+
process.exit(1);
|
|
1574
|
+
}
|
|
1503
1575
|
const isApiKey = key.startsWith(API_KEY_PREFIX);
|
|
1504
1576
|
if (!PERSONAL_KEYS.has(key) && !isApiKey) {
|
|
1505
1577
|
logErr(
|
|
1506
1578
|
`'${key}' is not a personal setting.
|
|
1507
1579
|
Personal keys: ${[...PERSONAL_KEYS].join(", ")}, ${API_KEY_PREFIX}<provider>
|
|
1508
|
-
Project config (
|
|
1580
|
+
Project config (driver, model, paths, resources) belongs in skaile.yaml`
|
|
1509
1581
|
);
|
|
1510
1582
|
process.exit(1);
|
|
1511
1583
|
}
|
|
1512
|
-
const filePath = opts.global ? globalSettingsPath() : projectSettingsPath(projectDir);
|
|
1513
|
-
const existing = await loadSettings(filePath);
|
|
1514
1584
|
if (isApiKey) {
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
await saveSettings(existing, filePath);
|
|
1518
|
-
logOk(`Set ${pc5.bold(`apiKeys.${provider}`)} = ****${value.slice(-4)}`);
|
|
1519
|
-
} else {
|
|
1520
|
-
existing[key] = value;
|
|
1521
|
-
await saveSettings(existing, filePath);
|
|
1522
|
-
logOk(`Set ${pc5.bold(key)} = ${value}`);
|
|
1585
|
+
setApiKeySugar(key.slice(API_KEY_PREFIX.length), value, projectDir);
|
|
1586
|
+
return;
|
|
1523
1587
|
}
|
|
1588
|
+
const filePath = opts.global ? globalSettingsPath() : projectSettingsPath(projectDir);
|
|
1589
|
+
const existing = await loadSettings(filePath);
|
|
1590
|
+
await saveSettings({ ...existing, [key]: value }, filePath);
|
|
1591
|
+
logOk(`Set ${pc5.bold(key)} = ${value}`);
|
|
1524
1592
|
console.log(S.dim(` \u2192 ${filePath}`));
|
|
1593
|
+
if (key === "model") {
|
|
1594
|
+
const view = loadRegistryView({ projectDir });
|
|
1595
|
+
const resolved = parseModelRef(value, view.merged);
|
|
1596
|
+
if (!resolved) {
|
|
1597
|
+
logWarn(
|
|
1598
|
+
"no AI provider is configured yet \u2014 add one with `skaile providers add <id> --preset <preset>`"
|
|
1599
|
+
);
|
|
1600
|
+
} else {
|
|
1601
|
+
console.log(
|
|
1602
|
+
S.dim(
|
|
1603
|
+
` \u2192 resolves to ${resolved.providerId}${resolved.providerModelId ? `/${resolved.providerModelId}` : ""}`
|
|
1604
|
+
)
|
|
1605
|
+
);
|
|
1606
|
+
for (const warning of resolved.warnings) logWarn(warning);
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1525
1609
|
});
|
|
1526
1610
|
cmd.action(() => showConfig({}));
|
|
1527
1611
|
return cmd;
|
|
@@ -1817,8 +1901,8 @@ function makeConnectorCommand() {
|
|
|
1817
1901
|
async (driver, opts) => {
|
|
1818
1902
|
const { installNpmPackages } = await import('../connectors/index.js');
|
|
1819
1903
|
const { scanDirectory: scanDirectory2, factoryAssetRoots: factoryAssetRoots2, WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
1820
|
-
const projectDir =
|
|
1821
|
-
const yamlPath =
|
|
1904
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
1905
|
+
const yamlPath = path36__default.join(projectDir, "skaile.yaml");
|
|
1822
1906
|
if (!existsSync(yamlPath)) {
|
|
1823
1907
|
logErr("No skaile.yaml found in current directory. Run 'skaile init' first.");
|
|
1824
1908
|
process.exit(1);
|
|
@@ -1878,8 +1962,8 @@ ${installResult.output}`);
|
|
|
1878
1962
|
);
|
|
1879
1963
|
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) => {
|
|
1880
1964
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
1881
|
-
const projectDir =
|
|
1882
|
-
const yamlPath =
|
|
1965
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
1966
|
+
const yamlPath = path36__default.join(projectDir, "skaile.yaml");
|
|
1883
1967
|
if (!existsSync(yamlPath)) {
|
|
1884
1968
|
logErr("No skaile.yaml found in current directory.");
|
|
1885
1969
|
process.exit(1);
|
|
@@ -1896,7 +1980,7 @@ ${installResult.output}`);
|
|
|
1896
1980
|
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) => {
|
|
1897
1981
|
const res = await import('../connectors/index.js');
|
|
1898
1982
|
res.registerBuiltinConnectors();
|
|
1899
|
-
const projectDir =
|
|
1983
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
1900
1984
|
const declarations = res.loadConnectorDeclarations(projectDir);
|
|
1901
1985
|
if (declarations.length === 0) {
|
|
1902
1986
|
console.log("No connectors configured in skaile.yaml.");
|
|
@@ -1920,7 +2004,7 @@ ${installResult.output}`);
|
|
|
1920
2004
|
await manager.disconnectAll();
|
|
1921
2005
|
});
|
|
1922
2006
|
cmd.command("list").description("List all configured connectors").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
|
|
1923
|
-
const projectDir =
|
|
2007
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
1924
2008
|
const manager = await connectConnectors(projectDir);
|
|
1925
2009
|
try {
|
|
1926
2010
|
console.log(JSON.stringify(manager.listConnectors(), null, 2));
|
|
@@ -1929,7 +2013,7 @@ ${installResult.output}`);
|
|
|
1929
2013
|
}
|
|
1930
2014
|
});
|
|
1931
2015
|
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) => {
|
|
1932
|
-
const projectDir =
|
|
2016
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
1933
2017
|
const manager = await connectConnectors(projectDir);
|
|
1934
2018
|
try {
|
|
1935
2019
|
if (opts.all) {
|
|
@@ -1953,7 +2037,7 @@ ${installResult.output}`);
|
|
|
1953
2037
|
}
|
|
1954
2038
|
});
|
|
1955
2039
|
cmd.command("ops <id>").description("List available operations for a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, opts) => {
|
|
1956
|
-
const projectDir =
|
|
2040
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
1957
2041
|
const manager = await connectConnectors(projectDir);
|
|
1958
2042
|
try {
|
|
1959
2043
|
if (!manager.has(id)) {
|
|
@@ -1968,7 +2052,7 @@ ${installResult.output}`);
|
|
|
1968
2052
|
}
|
|
1969
2053
|
});
|
|
1970
2054
|
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) => {
|
|
1971
|
-
const projectDir =
|
|
2055
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
1972
2056
|
const manager = await connectConnectors(projectDir);
|
|
1973
2057
|
try {
|
|
1974
2058
|
const content = await manager.read(id, resourcePath);
|
|
@@ -1978,7 +2062,7 @@ ${installResult.output}`);
|
|
|
1978
2062
|
}
|
|
1979
2063
|
});
|
|
1980
2064
|
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) => {
|
|
1981
|
-
const projectDir =
|
|
2065
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
1982
2066
|
const manager = await connectConnectors(projectDir);
|
|
1983
2067
|
try {
|
|
1984
2068
|
await manager.write(id, resourcePath, { data: content });
|
|
@@ -1988,7 +2072,7 @@ ${installResult.output}`);
|
|
|
1988
2072
|
}
|
|
1989
2073
|
});
|
|
1990
2074
|
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) => {
|
|
1991
|
-
const projectDir =
|
|
2075
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
1992
2076
|
const manager = await connectConnectors(projectDir);
|
|
1993
2077
|
try {
|
|
1994
2078
|
const entries = await manager.list(id, resourcePath, {
|
|
@@ -2001,7 +2085,7 @@ ${installResult.output}`);
|
|
|
2001
2085
|
}
|
|
2002
2086
|
});
|
|
2003
2087
|
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) => {
|
|
2004
|
-
const projectDir =
|
|
2088
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2005
2089
|
const manager = await connectConnectors(projectDir);
|
|
2006
2090
|
try {
|
|
2007
2091
|
const results = await manager.search(id, query);
|
|
@@ -2011,7 +2095,7 @@ ${installResult.output}`);
|
|
|
2011
2095
|
}
|
|
2012
2096
|
});
|
|
2013
2097
|
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) => {
|
|
2014
|
-
const projectDir =
|
|
2098
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2015
2099
|
const manager = await connectConnectors(projectDir);
|
|
2016
2100
|
try {
|
|
2017
2101
|
const ok = await manager.delete(id, resourcePath);
|
|
@@ -2021,7 +2105,7 @@ ${installResult.output}`);
|
|
|
2021
2105
|
}
|
|
2022
2106
|
});
|
|
2023
2107
|
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) => {
|
|
2024
|
-
const projectDir =
|
|
2108
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2025
2109
|
const manager = await connectConnectors(projectDir);
|
|
2026
2110
|
try {
|
|
2027
2111
|
if (!manager.has(id)) {
|
|
@@ -2130,7 +2214,7 @@ function envRecord() {
|
|
|
2130
2214
|
async function buildDeployContext(projectDir) {
|
|
2131
2215
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2132
2216
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
2133
|
-
const workspaceId = config.name ??
|
|
2217
|
+
const workspaceId = config.name ?? path36__default.basename(projectDir);
|
|
2134
2218
|
let log;
|
|
2135
2219
|
try {
|
|
2136
2220
|
const { createLogger } = await import('../core/logging.js');
|
|
@@ -2162,13 +2246,13 @@ async function ensureTargetsRegistered(projectDir) {
|
|
|
2162
2246
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2163
2247
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
2164
2248
|
if (config.plugins && config.plugins.length > 0) {
|
|
2165
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
2249
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-T2DJGKBW.js');
|
|
2166
2250
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
2167
2251
|
for (const f of result.failed) logWarn(f.error);
|
|
2168
2252
|
}
|
|
2169
2253
|
}
|
|
2170
2254
|
async function runUp(opts) {
|
|
2171
|
-
const projectDir =
|
|
2255
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2172
2256
|
await ensureTargetsRegistered(projectDir);
|
|
2173
2257
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2174
2258
|
const { resolveDeployTarget, pluginRegistry } = await import('../plugin-registry/index.js');
|
|
@@ -2236,7 +2320,7 @@ async function restoreFromHandle(projectDir) {
|
|
|
2236
2320
|
return { target, handle, ctx };
|
|
2237
2321
|
}
|
|
2238
2322
|
async function runDown(opts) {
|
|
2239
|
-
const projectDir =
|
|
2323
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2240
2324
|
const restored = await restoreFromHandle(projectDir);
|
|
2241
2325
|
if (!restored) return;
|
|
2242
2326
|
await restored.handle.stop();
|
|
@@ -2245,7 +2329,7 @@ async function runDown(opts) {
|
|
|
2245
2329
|
logOk(`Stopped ${S.cmd(restored.target.id)} and cleared the handle.`);
|
|
2246
2330
|
}
|
|
2247
2331
|
async function runStatus(opts) {
|
|
2248
|
-
const projectDir =
|
|
2332
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2249
2333
|
const restored = await restoreFromHandle(projectDir);
|
|
2250
2334
|
if (!restored) return;
|
|
2251
2335
|
const health = await restored.handle.health();
|
|
@@ -2259,7 +2343,7 @@ async function runStatus(opts) {
|
|
|
2259
2343
|
console.log();
|
|
2260
2344
|
}
|
|
2261
2345
|
async function runLogs(opts) {
|
|
2262
|
-
const projectDir =
|
|
2346
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2263
2347
|
const restored = await restoreFromHandle(projectDir);
|
|
2264
2348
|
if (!restored) return;
|
|
2265
2349
|
if (!restored.handle.logs) {
|
|
@@ -2283,7 +2367,7 @@ function makeDeployCommand() {
|
|
|
2283
2367
|
}
|
|
2284
2368
|
function makeDiffCommand() {
|
|
2285
2369
|
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) => {
|
|
2286
|
-
const am2 = new AssetManager({ projectDir:
|
|
2370
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
2287
2371
|
const result = await am2.diff(ref);
|
|
2288
2372
|
if (result === null) {
|
|
2289
2373
|
logInfo("No differences (or asset not found).");
|
|
@@ -2295,7 +2379,7 @@ function makeDiffCommand() {
|
|
|
2295
2379
|
function makeFlowCommand() {
|
|
2296
2380
|
const cmd = new Command("flow").description("Manage flows");
|
|
2297
2381
|
cmd.command("list").description("List available flows").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
2298
|
-
const flows = discoverFlows(
|
|
2382
|
+
const flows = discoverFlows(path36__default.resolve(opts.projectDir));
|
|
2299
2383
|
if (flows.length === 0) {
|
|
2300
2384
|
logInfo("No flows found.");
|
|
2301
2385
|
return;
|
|
@@ -2310,7 +2394,7 @@ function makeFlowCommand() {
|
|
|
2310
2394
|
console.log();
|
|
2311
2395
|
});
|
|
2312
2396
|
cmd.command("show <id>").description("Show flow details and node graph").option("--project-dir <path>", "Project directory", process.cwd()).action(async (id, opts) => {
|
|
2313
|
-
const flows = discoverFlows(
|
|
2397
|
+
const flows = discoverFlows(path36__default.resolve(opts.projectDir));
|
|
2314
2398
|
const flow = flows.find((f) => f.id === id);
|
|
2315
2399
|
if (!flow) {
|
|
2316
2400
|
logErr(`Flow not found: ${id}`);
|
|
@@ -2342,7 +2426,7 @@ function makeFlowCommand() {
|
|
|
2342
2426
|
function makeHistoryCommand() {
|
|
2343
2427
|
const cmd = new Command("history").description("Show recent add/remove/update actions");
|
|
2344
2428
|
cmd.argument("[limit]", "Number of entries to show", "20").option("--project-dir <path>", "Project directory", process.cwd()).action((limitStr, opts) => {
|
|
2345
|
-
const am2 = new AssetManager({ projectDir:
|
|
2429
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
2346
2430
|
const limit = parseInt(limitStr, 10) || 20;
|
|
2347
2431
|
const entries = am2.history(limit);
|
|
2348
2432
|
if (entries.length === 0) {
|
|
@@ -2362,7 +2446,7 @@ function makeHistoryCommand() {
|
|
|
2362
2446
|
console.log();
|
|
2363
2447
|
});
|
|
2364
2448
|
cmd.command("clear").description("Clear action history").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
2365
|
-
const am2 = new AssetManager({ projectDir:
|
|
2449
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
2366
2450
|
am2.clearHistory();
|
|
2367
2451
|
logOk("History cleared.");
|
|
2368
2452
|
});
|
|
@@ -2375,7 +2459,7 @@ var MCP_SERVER_ENTRY = {
|
|
|
2375
2459
|
env: {}
|
|
2376
2460
|
};
|
|
2377
2461
|
function pluginDir(projectDir) {
|
|
2378
|
-
return
|
|
2462
|
+
return path36__default.join(projectDir, ".claude", "plugins", "skaile");
|
|
2379
2463
|
}
|
|
2380
2464
|
async function readJsonStrict(p7) {
|
|
2381
2465
|
let raw;
|
|
@@ -2393,7 +2477,7 @@ async function readJsonStrict(p7) {
|
|
|
2393
2477
|
}
|
|
2394
2478
|
}
|
|
2395
2479
|
async function writeJson(p7, value) {
|
|
2396
|
-
await fs5.mkdir(
|
|
2480
|
+
await fs5.mkdir(path36__default.dirname(p7), { recursive: true });
|
|
2397
2481
|
await fs5.writeFile(p7, `${JSON.stringify(value, null, 2)}
|
|
2398
2482
|
`);
|
|
2399
2483
|
}
|
|
@@ -2401,8 +2485,8 @@ async function copyDir(src, dest) {
|
|
|
2401
2485
|
await fs5.mkdir(dest, { recursive: true });
|
|
2402
2486
|
const entries = await fs5.readdir(src, { withFileTypes: true });
|
|
2403
2487
|
for (const entry of entries) {
|
|
2404
|
-
const srcPath =
|
|
2405
|
-
const destPath =
|
|
2488
|
+
const srcPath = path36__default.join(src, entry.name);
|
|
2489
|
+
const destPath = path36__default.join(dest, entry.name);
|
|
2406
2490
|
if (entry.isDirectory()) await copyDir(srcPath, destPath);
|
|
2407
2491
|
else await fs5.copyFile(srcPath, destPath);
|
|
2408
2492
|
}
|
|
@@ -2411,14 +2495,14 @@ async function install(projectDir, opts) {
|
|
|
2411
2495
|
return opts?.full ? installFullPlugin(projectDir) : installMcp(projectDir);
|
|
2412
2496
|
}
|
|
2413
2497
|
async function installMcp(projectDir) {
|
|
2414
|
-
const mcpPath =
|
|
2498
|
+
const mcpPath = path36__default.join(projectDir, ".claude", "mcp.json");
|
|
2415
2499
|
const existing = await readJsonStrict(mcpPath) ?? {};
|
|
2416
2500
|
const mcpServers = { ...existing.mcpServers ?? {} };
|
|
2417
2501
|
const previous = mcpServers[SKAILE_MCP_NAME];
|
|
2418
2502
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(MCP_SERVER_ENTRY);
|
|
2419
2503
|
let warning;
|
|
2420
2504
|
if (previous && !matches) {
|
|
2421
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${
|
|
2505
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${path36__default.relative(projectDir, mcpPath)}`;
|
|
2422
2506
|
}
|
|
2423
2507
|
mcpServers[SKAILE_MCP_NAME] = MCP_SERVER_ENTRY;
|
|
2424
2508
|
await writeJson(mcpPath, { ...existing, mcpServers });
|
|
@@ -2427,15 +2511,15 @@ async function installMcp(projectDir) {
|
|
|
2427
2511
|
async function installFullPlugin(projectDir) {
|
|
2428
2512
|
const dir = pluginDir(projectDir);
|
|
2429
2513
|
for (const [rel, content] of Object.entries(buildClaudePluginFiles())) {
|
|
2430
|
-
const dest =
|
|
2431
|
-
await fs5.mkdir(
|
|
2514
|
+
const dest = path36__default.join(dir, rel);
|
|
2515
|
+
await fs5.mkdir(path36__default.dirname(dest), { recursive: true });
|
|
2432
2516
|
await fs5.writeFile(dest, content);
|
|
2433
2517
|
}
|
|
2434
|
-
const projectSkillsDir =
|
|
2518
|
+
const projectSkillsDir = path36__default.join(projectDir, ".skaile", "skills");
|
|
2435
2519
|
if (existsSync(projectSkillsDir)) {
|
|
2436
|
-
await copyDir(projectSkillsDir,
|
|
2520
|
+
await copyDir(projectSkillsDir, path36__default.join(dir, "skills"));
|
|
2437
2521
|
}
|
|
2438
|
-
const settingsPath =
|
|
2522
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2439
2523
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2440
2524
|
const plugins = settings.plugins ?? [];
|
|
2441
2525
|
if (!plugins.includes(dir)) plugins.push(dir);
|
|
@@ -2443,8 +2527,8 @@ async function installFullPlugin(projectDir) {
|
|
|
2443
2527
|
return { changed: true, method: "plugin" };
|
|
2444
2528
|
}
|
|
2445
2529
|
async function uninstall(projectDir) {
|
|
2446
|
-
const settingsPath =
|
|
2447
|
-
const mcpPath =
|
|
2530
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2531
|
+
const mcpPath = path36__default.join(projectDir, ".claude", "mcp.json");
|
|
2448
2532
|
const dir = pluginDir(projectDir);
|
|
2449
2533
|
let changed = false;
|
|
2450
2534
|
const settings = await readJsonStrict(settingsPath);
|
|
@@ -2478,12 +2562,12 @@ async function uninstall(projectDir) {
|
|
|
2478
2562
|
async function detectInstall(projectDir) {
|
|
2479
2563
|
const dir = pluginDir(projectDir);
|
|
2480
2564
|
const settings = await readJsonStrict(
|
|
2481
|
-
|
|
2565
|
+
path36__default.join(projectDir, ".claude", "settings.json")
|
|
2482
2566
|
);
|
|
2483
|
-
if (existsSync(
|
|
2567
|
+
if (existsSync(path36__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir)) {
|
|
2484
2568
|
return { method: "plugin", pluginPath: dir };
|
|
2485
2569
|
}
|
|
2486
|
-
const mcp = await readJsonStrict(
|
|
2570
|
+
const mcp = await readJsonStrict(path36__default.join(projectDir, ".claude", "mcp.json"));
|
|
2487
2571
|
if (mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers) {
|
|
2488
2572
|
return { method: "mcp" };
|
|
2489
2573
|
}
|
|
@@ -2492,7 +2576,7 @@ async function detectInstall(projectDir) {
|
|
|
2492
2576
|
async function enable(projectDir) {
|
|
2493
2577
|
const detected = await detectInstall(projectDir);
|
|
2494
2578
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2495
|
-
const settingsPath =
|
|
2579
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2496
2580
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2497
2581
|
if (detected.method === "plugin") {
|
|
2498
2582
|
const disabled2 = settings.disabledPlugins ?? [];
|
|
@@ -2514,7 +2598,7 @@ async function enable(projectDir) {
|
|
|
2514
2598
|
async function disable(projectDir) {
|
|
2515
2599
|
const detected = await detectInstall(projectDir);
|
|
2516
2600
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2517
|
-
const settingsPath =
|
|
2601
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2518
2602
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2519
2603
|
if (detected.method === "plugin") {
|
|
2520
2604
|
const list2 = settings.disabledPlugins ?? [];
|
|
@@ -2534,12 +2618,12 @@ async function disable(projectDir) {
|
|
|
2534
2618
|
return { changed: true };
|
|
2535
2619
|
}
|
|
2536
2620
|
async function status(projectDir) {
|
|
2537
|
-
const settingsPath =
|
|
2538
|
-
const mcpPath =
|
|
2621
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2622
|
+
const mcpPath = path36__default.join(projectDir, ".claude", "mcp.json");
|
|
2539
2623
|
const dir = pluginDir(projectDir);
|
|
2540
2624
|
const settings = await readJsonStrict(settingsPath);
|
|
2541
2625
|
const mcp = await readJsonStrict(mcpPath);
|
|
2542
|
-
const pluginInstalled = !!(existsSync(
|
|
2626
|
+
const pluginInstalled = !!(existsSync(path36__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir));
|
|
2543
2627
|
const mcpInstalled = !!(mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers);
|
|
2544
2628
|
if (!pluginInstalled && !mcpInstalled) {
|
|
2545
2629
|
return {
|
|
@@ -2557,7 +2641,7 @@ async function status(projectDir) {
|
|
|
2557
2641
|
installed: "yes",
|
|
2558
2642
|
enabled: disabled2 ? "no" : "yes",
|
|
2559
2643
|
method: "plugin",
|
|
2560
|
-
location:
|
|
2644
|
+
location: path36__default.relative(projectDir, dir)
|
|
2561
2645
|
};
|
|
2562
2646
|
}
|
|
2563
2647
|
const disabled = settings?.disabledMcpjsonServers?.includes(SKAILE_MCP_NAME) ?? false;
|
|
@@ -2566,7 +2650,7 @@ async function status(projectDir) {
|
|
|
2566
2650
|
installed: "yes",
|
|
2567
2651
|
enabled: disabled ? "no" : "yes",
|
|
2568
2652
|
method: "mcp",
|
|
2569
|
-
location:
|
|
2653
|
+
location: path36__default.relative(projectDir, mcpPath)
|
|
2570
2654
|
};
|
|
2571
2655
|
}
|
|
2572
2656
|
var SKAILE_MCP_NAME2 = "skaile-workspace";
|
|
@@ -2593,7 +2677,7 @@ async function readConfig(p7) {
|
|
|
2593
2677
|
}
|
|
2594
2678
|
}
|
|
2595
2679
|
async function writeConfig(p7, value) {
|
|
2596
|
-
await fs5.mkdir(
|
|
2680
|
+
await fs5.mkdir(path36__default.dirname(p7), { recursive: true });
|
|
2597
2681
|
const cleaned = {};
|
|
2598
2682
|
for (const [k, v] of Object.entries(value)) {
|
|
2599
2683
|
if (v === void 0) continue;
|
|
@@ -2602,7 +2686,7 @@ async function writeConfig(p7, value) {
|
|
|
2602
2686
|
await fs5.writeFile(p7, stringify$1(cleaned));
|
|
2603
2687
|
}
|
|
2604
2688
|
function configPath(projectDir) {
|
|
2605
|
-
return
|
|
2689
|
+
return path36__default.join(projectDir, ".codex", "config.toml");
|
|
2606
2690
|
}
|
|
2607
2691
|
async function install2(projectDir) {
|
|
2608
2692
|
const p7 = configPath(projectDir);
|
|
@@ -2613,7 +2697,7 @@ async function install2(projectDir) {
|
|
|
2613
2697
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(next);
|
|
2614
2698
|
let warning;
|
|
2615
2699
|
if (previous && !matches) {
|
|
2616
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${
|
|
2700
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${path36__default.relative(projectDir, p7)}`;
|
|
2617
2701
|
}
|
|
2618
2702
|
if (matches) return { changed: false, method: "toml" };
|
|
2619
2703
|
servers[SKAILE_MCP_NAME2] = next;
|
|
@@ -2654,12 +2738,12 @@ async function status2(projectDir) {
|
|
|
2654
2738
|
installed: "yes",
|
|
2655
2739
|
enabled: "n/a",
|
|
2656
2740
|
method: "mcp",
|
|
2657
|
-
location:
|
|
2741
|
+
location: path36__default.relative(projectDir, p7)
|
|
2658
2742
|
};
|
|
2659
2743
|
}
|
|
2660
2744
|
async function install3(projectDir) {
|
|
2661
|
-
const extDir =
|
|
2662
|
-
const extPath =
|
|
2745
|
+
const extDir = path36__default.join(projectDir, ".omp", "extensions");
|
|
2746
|
+
const extPath = path36__default.join(extDir, "skaile.ts");
|
|
2663
2747
|
await fs5.mkdir(extDir, { recursive: true });
|
|
2664
2748
|
const { WorkspacePlugin } = await import('../workspace-plugin/index.js');
|
|
2665
2749
|
const plugin = new WorkspacePlugin({ projectDir });
|
|
@@ -2674,7 +2758,7 @@ async function install3(projectDir) {
|
|
|
2674
2758
|
return { changed: true, method: "generated" };
|
|
2675
2759
|
}
|
|
2676
2760
|
async function uninstall3(projectDir) {
|
|
2677
|
-
const extPath =
|
|
2761
|
+
const extPath = path36__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
2678
2762
|
try {
|
|
2679
2763
|
await fs5.unlink(extPath);
|
|
2680
2764
|
return { changed: true };
|
|
@@ -2683,14 +2767,14 @@ async function uninstall3(projectDir) {
|
|
|
2683
2767
|
}
|
|
2684
2768
|
}
|
|
2685
2769
|
async function status3(projectDir) {
|
|
2686
|
-
const extPath =
|
|
2770
|
+
const extPath = path36__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
2687
2771
|
if (existsSync(extPath)) {
|
|
2688
2772
|
return {
|
|
2689
2773
|
backend: "omp",
|
|
2690
2774
|
installed: "yes",
|
|
2691
2775
|
enabled: "n/a",
|
|
2692
2776
|
method: "extension",
|
|
2693
|
-
location:
|
|
2777
|
+
location: path36__default.relative(projectDir, extPath)
|
|
2694
2778
|
};
|
|
2695
2779
|
}
|
|
2696
2780
|
return {
|
|
@@ -2753,7 +2837,7 @@ async function installCodex(projectDir) {
|
|
|
2753
2837
|
console.log(` ${S.dim("\u2192")} Restart Codex CLI to pick up the change.`);
|
|
2754
2838
|
}
|
|
2755
2839
|
async function runInstall(opts) {
|
|
2756
|
-
const projectDir =
|
|
2840
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2757
2841
|
const targets = resolveDriver(opts.driver);
|
|
2758
2842
|
let exitCode = 0;
|
|
2759
2843
|
if (targets.includes("claude-code")) {
|
|
@@ -2787,7 +2871,7 @@ async function uninstallCodex(projectDir) {
|
|
|
2787
2871
|
else logInfo(`codex: not installed`);
|
|
2788
2872
|
}
|
|
2789
2873
|
async function runUninstall(opts) {
|
|
2790
|
-
const projectDir =
|
|
2874
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2791
2875
|
const targets = resolveDriver(opts.driver);
|
|
2792
2876
|
let exitCode = 0;
|
|
2793
2877
|
if (targets.includes("claude-code")) {
|
|
@@ -2830,7 +2914,7 @@ async function toggleTarget(t, projectDir, action3) {
|
|
|
2830
2914
|
});
|
|
2831
2915
|
}
|
|
2832
2916
|
async function runToggle(opts, action3) {
|
|
2833
|
-
const projectDir =
|
|
2917
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2834
2918
|
const requestedAll = opts.driver === "all";
|
|
2835
2919
|
const targets = resolveDriver(opts.driver);
|
|
2836
2920
|
const usageError = checkToggleSupported(targets, requestedAll, action3);
|
|
@@ -2842,7 +2926,7 @@ async function runToggle(opts, action3) {
|
|
|
2842
2926
|
return exitCode;
|
|
2843
2927
|
}
|
|
2844
2928
|
async function runStatus2(opts) {
|
|
2845
|
-
const projectDir =
|
|
2929
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2846
2930
|
const targets = resolveDriver(opts.driver);
|
|
2847
2931
|
const rows = [];
|
|
2848
2932
|
let exitCode = 0;
|
|
@@ -2913,7 +2997,7 @@ async function runHook(event) {
|
|
|
2913
2997
|
await plugin.shutdown();
|
|
2914
2998
|
return;
|
|
2915
2999
|
}
|
|
2916
|
-
const store = new PluginStore(
|
|
3000
|
+
const store = new PluginStore(path36__default.join(projectDir, ".skaile", "plugin-state.json"));
|
|
2917
3001
|
await store.load();
|
|
2918
3002
|
const status4 = store.get("connector:status");
|
|
2919
3003
|
if (status4 && typeof status4 === "object" && Object.keys(status4).length > 0) {
|
|
@@ -2989,7 +3073,7 @@ async function indexLibrary(lib, index) {
|
|
|
2989
3073
|
}
|
|
2990
3074
|
}
|
|
2991
3075
|
function domainPublisher(libraryPath, domain) {
|
|
2992
|
-
const domainFile =
|
|
3076
|
+
const domainFile = path36.join(libraryPath, domain, "DOMAIN.md");
|
|
2993
3077
|
if (!fs12.existsSync(domainFile)) return void 0;
|
|
2994
3078
|
try {
|
|
2995
3079
|
const { data } = parseFrontmatter(fs12.readFileSync(domainFile, "utf8"));
|
|
@@ -3072,7 +3156,7 @@ function makeLibraryCommand() {
|
|
|
3072
3156
|
cmd.command("init <name>").description("Create a new local library at ~/.skaile/libraries/<name>").option("--git <url>", "Initialize as a git library tracking <url>").option("--owner", "Mark as owner (default for local)").option("--contributor", "Mark as contributor").option("--reader", "Mark as reader").action(
|
|
3073
3157
|
async (name, opts) => {
|
|
3074
3158
|
const libDir = resolveLibraryDir();
|
|
3075
|
-
const libPath =
|
|
3159
|
+
const libPath = path36.join(libDir, name);
|
|
3076
3160
|
const ownership = opts.contributor ? "contributor" : opts.reader ? "reader" : "owner";
|
|
3077
3161
|
const { manager, close } = await openLibraryManager();
|
|
3078
3162
|
try {
|
|
@@ -3144,21 +3228,21 @@ function makeLibraryCommand() {
|
|
|
3144
3228
|
}
|
|
3145
3229
|
const effectiveKind = opts.kind ?? kind;
|
|
3146
3230
|
const am2 = new AssetManager({ projectDir: process.cwd() });
|
|
3147
|
-
const destDir = opts.dir ?
|
|
3231
|
+
const destDir = opts.dir ? path36.join(target.path, opts.dir) : target.path;
|
|
3148
3232
|
const res = am2.create(name, effectiveKind, destDir);
|
|
3149
3233
|
if (!res.ok) {
|
|
3150
3234
|
logErr(res.path);
|
|
3151
3235
|
process.exit(1);
|
|
3152
3236
|
}
|
|
3153
3237
|
logOk(`Created ${effectiveKind}: ${pc5.dim(res.path)}`);
|
|
3154
|
-
const domain2 = opts.dir ? opts.dir.split(
|
|
3238
|
+
const domain2 = opts.dir ? opts.dir.split(path36.sep)[0] : void 0;
|
|
3155
3239
|
const publisher = resolveLibraryPublisher(target, opts, domain2, getStoreIdentity());
|
|
3156
3240
|
stampAssetPublisher(res.path, publisher);
|
|
3157
3241
|
ensureManifestPublisher(target.path, publisher);
|
|
3158
3242
|
upsertManifestAsset(target.path, {
|
|
3159
3243
|
kind: effectiveKind,
|
|
3160
3244
|
name,
|
|
3161
|
-
root:
|
|
3245
|
+
root: path36.relative(target.path, res.path) || name,
|
|
3162
3246
|
version: "0.1.0"
|
|
3163
3247
|
});
|
|
3164
3248
|
const idx = await indexLibrary(target, library);
|
|
@@ -3233,7 +3317,7 @@ function makeLibraryCommand() {
|
|
|
3233
3317
|
const { manager, close } = await openLibraryManager();
|
|
3234
3318
|
try {
|
|
3235
3319
|
const target = await resolveTargetLibrary(manager, opts.library);
|
|
3236
|
-
const domainFile =
|
|
3320
|
+
const domainFile = path36.join(target.path, name, "DOMAIN.md");
|
|
3237
3321
|
if (!existsSync(domainFile)) {
|
|
3238
3322
|
logErr(`Domain "${name}" not found in "${target.name}" (no ${domainFile}).`);
|
|
3239
3323
|
process.exit(1);
|
|
@@ -3256,8 +3340,8 @@ function makeLibraryCommand() {
|
|
|
3256
3340
|
const { manager, close } = await openLibraryManager();
|
|
3257
3341
|
try {
|
|
3258
3342
|
const lib = await manager.requireLibrary(oldName);
|
|
3259
|
-
const parent =
|
|
3260
|
-
const newPath =
|
|
3343
|
+
const parent = path36.dirname(lib.path);
|
|
3344
|
+
const newPath = path36.join(parent, newName);
|
|
3261
3345
|
if (fs12.existsSync(newPath)) {
|
|
3262
3346
|
logErr(`Target directory already exists: ${newPath}`);
|
|
3263
3347
|
process.exit(1);
|
|
@@ -3417,16 +3501,16 @@ function makeLibraryCommand() {
|
|
|
3417
3501
|
});
|
|
3418
3502
|
cmd.command("publish <lib>").description("Push + register the library's manifest atomically (needs git backend)").option("--asset <ref>", "Publish only the single asset matching this ref/name").option("--create-repo", "Provision + link a public github repo if the library has no remote").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(
|
|
3419
3503
|
async (lib, opts) => {
|
|
3420
|
-
const { runLibraryPublish } = await import('../library-publish-
|
|
3504
|
+
const { runLibraryPublish } = await import('../library-publish-I2QYQSB4.js');
|
|
3421
3505
|
await withStoreErrorHandling(() => runLibraryPublish(lib, opts));
|
|
3422
3506
|
}
|
|
3423
3507
|
);
|
|
3424
3508
|
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) => {
|
|
3425
|
-
const { runLibraryRegister } = await import('../library-publish-
|
|
3509
|
+
const { runLibraryRegister } = await import('../library-publish-I2QYQSB4.js');
|
|
3426
3510
|
await withStoreErrorHandling(() => runLibraryRegister(lib, opts));
|
|
3427
3511
|
});
|
|
3428
3512
|
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) => {
|
|
3429
|
-
const { runLibraryYank } = await import('../library-publish-
|
|
3513
|
+
const { runLibraryYank } = await import('../library-publish-I2QYQSB4.js');
|
|
3430
3514
|
await withStoreErrorHandling(() => runLibraryYank(lib, opts));
|
|
3431
3515
|
});
|
|
3432
3516
|
return cmd;
|
|
@@ -3443,14 +3527,14 @@ function stampAssetPublisher(assetDir, publisher) {
|
|
|
3443
3527
|
const markers = ["SKILL.md", "AGENT.md", "CONTRACT.md"];
|
|
3444
3528
|
let markerFile;
|
|
3445
3529
|
for (const m of markers) {
|
|
3446
|
-
if (fs12.existsSync(
|
|
3447
|
-
markerFile =
|
|
3530
|
+
if (fs12.existsSync(path36.join(assetDir, m))) {
|
|
3531
|
+
markerFile = path36.join(assetDir, m);
|
|
3448
3532
|
break;
|
|
3449
3533
|
}
|
|
3450
3534
|
}
|
|
3451
3535
|
if (!markerFile) {
|
|
3452
3536
|
const promptMd = fs12.readdirSync(assetDir).find((f) => f.endsWith(".prompt.md"));
|
|
3453
|
-
if (promptMd) markerFile =
|
|
3537
|
+
if (promptMd) markerFile = path36.join(assetDir, promptMd);
|
|
3454
3538
|
}
|
|
3455
3539
|
if (!markerFile) return;
|
|
3456
3540
|
try {
|
|
@@ -3477,7 +3561,7 @@ function ensureManifestPublisher(libraryPath, publisher) {
|
|
|
3477
3561
|
async function syncManifestWithDisk(libraryPath, libraryName) {
|
|
3478
3562
|
const publisher = loadSkPublishManifest(libraryPath)?.publisher ?? slugifyAssetName(libraryName);
|
|
3479
3563
|
for (const e of await scanDirectory(libraryPath, publisher)) {
|
|
3480
|
-
const root =
|
|
3564
|
+
const root = path36.relative(libraryPath, path36.dirname(e.source)) || e.name;
|
|
3481
3565
|
upsertManifestAsset(libraryPath, { kind: e.kind, name: e.name, root, version: e.version });
|
|
3482
3566
|
}
|
|
3483
3567
|
}
|
|
@@ -3519,9 +3603,9 @@ async function printOverallStatus(projectDir, asJson) {
|
|
|
3519
3603
|
} catch {
|
|
3520
3604
|
secretsStrategy = "unavailable";
|
|
3521
3605
|
}
|
|
3522
|
-
const resolvedProjectDir =
|
|
3523
|
-
const hasWorkspaceConfig = existsSync(
|
|
3524
|
-
const hasLockFile = existsSync(
|
|
3606
|
+
const resolvedProjectDir = path36.resolve(projectDir);
|
|
3607
|
+
const hasWorkspaceConfig = existsSync(path36.join(resolvedProjectDir, "skaile.yaml"));
|
|
3608
|
+
const hasLockFile = existsSync(path36.join(resolvedProjectDir, "skaile.lock.yaml"));
|
|
3525
3609
|
let assignments = [];
|
|
3526
3610
|
if (hasWorkspaceConfig) {
|
|
3527
3611
|
try {
|
|
@@ -4148,7 +4232,7 @@ function scheduleSoftDepPreview() {
|
|
|
4148
4232
|
}
|
|
4149
4233
|
async function loadAssets() {
|
|
4150
4234
|
softDepPreviewCache.clear();
|
|
4151
|
-
const { gatherAssetFeeds } = await import('../asset-feeds-
|
|
4235
|
+
const { gatherAssetFeeds } = await import('../asset-feeds-OPG6SUXU.js');
|
|
4152
4236
|
const { entries, domains, notes } = await gatherAssetFeeds(am, am.projectDir);
|
|
4153
4237
|
if (notes.length > 0) {
|
|
4154
4238
|
state.message = notes.map((n) => `[${n.feed}] ${n.message}`).join(" \u2022 ");
|
|
@@ -4170,7 +4254,7 @@ function rebuildSourceTree() {
|
|
|
4170
4254
|
rebuildVisibleSources();
|
|
4171
4255
|
}
|
|
4172
4256
|
function sourceOrgRepo(s) {
|
|
4173
|
-
const parts = s.path.split(
|
|
4257
|
+
const parts = s.path.split(path36__default.sep).filter(Boolean);
|
|
4174
4258
|
if (parts.length < 2) return null;
|
|
4175
4259
|
return { org: parts[parts.length - 2], repo: parts[parts.length - 1] };
|
|
4176
4260
|
}
|
|
@@ -4354,14 +4438,14 @@ function reconcileCollapsedSets(rows) {
|
|
|
4354
4438
|
async function loadSourcesAndLibraries() {
|
|
4355
4439
|
try {
|
|
4356
4440
|
const [{ openLibraryManager: openLibraryManager2 }, { skaileHomeDir }, { getGlobalCacheDir: getGlobalCacheDir2 }] = await Promise.all([
|
|
4357
|
-
import('../open-library-
|
|
4441
|
+
import('../open-library-6LM4W4DR.js'),
|
|
4358
4442
|
import('../library/index.js'),
|
|
4359
4443
|
import('../core/index.js')
|
|
4360
4444
|
]);
|
|
4361
4445
|
const { manager, library, close } = await openLibraryManager2();
|
|
4362
4446
|
try {
|
|
4363
4447
|
const newRoot = getGlobalCacheDir2();
|
|
4364
|
-
const legacyRoot =
|
|
4448
|
+
const legacyRoot = path36__default.join(skaileHomeDir(), "sources");
|
|
4365
4449
|
const isSourceRow = (l) => l.path.startsWith(newRoot) || l.path.startsWith(legacyRoot);
|
|
4366
4450
|
const libs = await manager.listLibraries();
|
|
4367
4451
|
const defs = await library.listAssetDefs();
|
|
@@ -5421,13 +5505,13 @@ async function run(projectDir) {
|
|
|
5421
5505
|
}
|
|
5422
5506
|
function makeManageCommand() {
|
|
5423
5507
|
return new Command("manage").description("Interactive TUI for managing assets, sources, and libraries").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
5424
|
-
await run(
|
|
5508
|
+
await run(path36__default.resolve(opts.projectDir));
|
|
5425
5509
|
});
|
|
5426
5510
|
}
|
|
5427
5511
|
function makeMcpServerCommand() {
|
|
5428
5512
|
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) => {
|
|
5429
|
-
const
|
|
5430
|
-
const projectDir =
|
|
5513
|
+
const path39 = await import('path');
|
|
5514
|
+
const projectDir = path39.default.resolve(opts.projectDir);
|
|
5431
5515
|
const { LogStore, StdoutSink, registerLogStore } = await import('../core/logging.js');
|
|
5432
5516
|
registerLogStore(
|
|
5433
5517
|
new LogStore({
|
|
@@ -5458,14 +5542,362 @@ function makeMcpServerCommand() {
|
|
|
5458
5542
|
await plugin.runMcpServerStdio();
|
|
5459
5543
|
});
|
|
5460
5544
|
}
|
|
5545
|
+
|
|
5546
|
+
// cli/src/commands/migrate-legacy-entry.ts
|
|
5547
|
+
var ANTHROPIC_VERSION_HEADER = { "anthropic-version": "2023-06-01" };
|
|
5548
|
+
var PRESET_ALIASES = { gemini: "google" };
|
|
5549
|
+
function legacyCloudConfig(raw) {
|
|
5550
|
+
if (!raw || typeof raw !== "object") return void 0;
|
|
5551
|
+
const out = {};
|
|
5552
|
+
if (raw.region) out.region = raw.region;
|
|
5553
|
+
if (raw.project_id) out.projectId = raw.project_id;
|
|
5554
|
+
if (raw.resource) out.resource = raw.resource;
|
|
5555
|
+
if (raw.base_url) out.baseUrl = raw.base_url;
|
|
5556
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
5557
|
+
}
|
|
5558
|
+
function directEntry(provider, env) {
|
|
5559
|
+
const preset = AI_PROVIDER_PRESETS[PRESET_ALIASES[provider] ?? provider];
|
|
5560
|
+
const envBaseUrl = preset?.base_url_env ? env[preset.base_url_env]?.trim() : void 0;
|
|
5561
|
+
const baseUrl = envBaseUrl || preset?.base_url;
|
|
5562
|
+
const envName = preset?.credential.env ?? `${provider.toUpperCase().replace(/[^A-Z0-9]/g, "_")}_API_KEY`;
|
|
5563
|
+
return {
|
|
5564
|
+
kind: "llm",
|
|
5565
|
+
label: preset?.label ?? provider,
|
|
5566
|
+
// `openai-completions` is the only defensible guess for a provider the
|
|
5567
|
+
// catalog has never heard of: every unlisted vendor the old settings
|
|
5568
|
+
// cascade accepted speaks the OpenAI chat wire format.
|
|
5569
|
+
surface: preset?.surface ?? "openai-completions",
|
|
5570
|
+
...baseUrl ? { base_url: baseUrl } : {},
|
|
5571
|
+
...preset?.headers ? { headers: { ...preset.headers } } : {},
|
|
5572
|
+
...preset?.discovery ? { discovery: { ...preset.discovery } } : {},
|
|
5573
|
+
credential: { kind: preset?.credential.kind ?? "bearer", ref: `env:${envName}` }
|
|
5574
|
+
};
|
|
5575
|
+
}
|
|
5576
|
+
function cloudEntry(cloud, cfg, env) {
|
|
5577
|
+
switch (cloud) {
|
|
5578
|
+
case "bedrock": {
|
|
5579
|
+
const region = cfg?.region ?? env.AWS_REGION ?? env.AWS_DEFAULT_REGION;
|
|
5580
|
+
const common = {
|
|
5581
|
+
kind: "llm",
|
|
5582
|
+
label: "AWS Bedrock",
|
|
5583
|
+
surface: "bedrock-converse-stream",
|
|
5584
|
+
credential: { kind: "sigv4" }
|
|
5585
|
+
};
|
|
5586
|
+
return region ? { ...common, transport: "bedrock", params: { region } } : { ...common };
|
|
5587
|
+
}
|
|
5588
|
+
case "vertex": {
|
|
5589
|
+
const project = cfg?.projectId ?? env.ANTHROPIC_VERTEX_PROJECT_ID;
|
|
5590
|
+
const location = cfg?.region ?? env.CLOUD_ML_REGION;
|
|
5591
|
+
const common = {
|
|
5592
|
+
kind: "llm",
|
|
5593
|
+
label: "Google Vertex AI",
|
|
5594
|
+
surface: "google-vertex",
|
|
5595
|
+
credential: { kind: "google_adc" }
|
|
5596
|
+
};
|
|
5597
|
+
return project && location ? { ...common, transport: "vertex", params: { project, location, publisher: "anthropic" } } : { ...common };
|
|
5598
|
+
}
|
|
5599
|
+
case "azure": {
|
|
5600
|
+
const foundryCredential = env.ANTHROPIC_FOUNDRY_API_KEY ? { kind: "api_key_header", ref: "env:ANTHROPIC_FOUNDRY_API_KEY" } : { kind: "azure_entra" };
|
|
5601
|
+
const common = {
|
|
5602
|
+
kind: "llm",
|
|
5603
|
+
label: "Claude on Microsoft Foundry",
|
|
5604
|
+
surface: "anthropic-messages",
|
|
5605
|
+
headers: { ...ANTHROPIC_VERSION_HEADER },
|
|
5606
|
+
credential: foundryCredential
|
|
5607
|
+
};
|
|
5608
|
+
if (cfg?.resource)
|
|
5609
|
+
return { ...common, transport: "foundry", params: { resource: cfg.resource } };
|
|
5610
|
+
if (!cfg?.baseUrl) return { ...common };
|
|
5611
|
+
const hostLabel = cfg.baseUrl.replace(/^[a-z][a-z0-9+.-]*:\/\//i, "").split(/[./:]/)[0];
|
|
5612
|
+
return hostLabel ? { ...common, transport: "foundry", params: { resource: hostLabel }, base_url: cfg.baseUrl } : { ...common, base_url: cfg.baseUrl };
|
|
5613
|
+
}
|
|
5614
|
+
default: {
|
|
5615
|
+
const baseUrl = cfg?.baseUrl ?? env.ANTHROPIC_BASE_URL;
|
|
5616
|
+
const usesApiKeyCarrier = env.ANTHROPIC_API_KEY && env.ANTHROPIC_AUTH_TOKEN === void 0;
|
|
5617
|
+
const credential = usesApiKeyCarrier ? { kind: "api_key_header", ref: "env:ANTHROPIC_API_KEY" } : { kind: "bearer", ref: "env:ANTHROPIC_AUTH_TOKEN" };
|
|
5618
|
+
return {
|
|
5619
|
+
kind: "llm",
|
|
5620
|
+
label: "Anthropic-compatible gateway",
|
|
5621
|
+
surface: "anthropic-messages",
|
|
5622
|
+
headers: { ...ANTHROPIC_VERSION_HEADER },
|
|
5623
|
+
...baseUrl ? { base_url: baseUrl } : {},
|
|
5624
|
+
credential
|
|
5625
|
+
};
|
|
5626
|
+
}
|
|
5627
|
+
}
|
|
5628
|
+
}
|
|
5629
|
+
function legacyProfileEntry(inputs = {}) {
|
|
5630
|
+
const env = inputs.env ?? process.env;
|
|
5631
|
+
const provider = (inputs.provider ?? "anthropic").trim() || "anthropic";
|
|
5632
|
+
const cloud = inputs.cloud && inputs.cloud !== "default" ? inputs.cloud : "default";
|
|
5633
|
+
return cloud === "default" ? directEntry(provider, env) : cloudEntry(cloud, inputs.cloudConfig, env);
|
|
5634
|
+
}
|
|
5635
|
+
|
|
5636
|
+
// cli/src/commands/migrate-providers.ts
|
|
5637
|
+
var LEGACY_PROFILE_KEYS = ["provider", "cloud", "cloud_config", "cloudConfig"];
|
|
5638
|
+
var AGENT_CONFIG_KEYS = ["agent-config", "agent_config", "agentConfig"];
|
|
5639
|
+
var FLAT_PROFILE_FIELDS = [
|
|
5640
|
+
"driver",
|
|
5641
|
+
"provider",
|
|
5642
|
+
"cloud",
|
|
5643
|
+
"model",
|
|
5644
|
+
"thinking",
|
|
5645
|
+
"effort",
|
|
5646
|
+
"skills_dir",
|
|
5647
|
+
"agents_dir",
|
|
5648
|
+
"prompts_dir"
|
|
5649
|
+
];
|
|
5650
|
+
function slugId(value) {
|
|
5651
|
+
const slug = value.trim().toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^[^a-z0-9]+/, "");
|
|
5652
|
+
return slug || "provider";
|
|
5653
|
+
}
|
|
5654
|
+
function presetIdFor(provider, cloud) {
|
|
5655
|
+
const id = cloud === "default" ? provider === "gemini" ? "google" : provider : cloud === "azure" ? "foundry" : cloud === "gateway" ? void 0 : cloud;
|
|
5656
|
+
return id && getProviderPreset(id) ? id : void 0;
|
|
5657
|
+
}
|
|
5658
|
+
function withCredentialRef(entry, provider, cloud) {
|
|
5659
|
+
if (entry.credential && entry.credential.kind !== "none") return entry;
|
|
5660
|
+
if (cloud === "gateway") {
|
|
5661
|
+
const credential2 = { kind: "bearer", ref: "env:ANTHROPIC_AUTH_TOKEN" };
|
|
5662
|
+
return { ...entry, credential: credential2 };
|
|
5663
|
+
}
|
|
5664
|
+
const preset = getProviderPreset(presetIdFor(provider, cloud) ?? "");
|
|
5665
|
+
const name = preset?.credential.env ?? `${provider.toUpperCase().replace(/[^A-Z0-9]/g, "_")}_API_KEY`;
|
|
5666
|
+
const credential = {
|
|
5667
|
+
kind: preset?.credential.kind ?? "bearer",
|
|
5668
|
+
ref: `env:${name}`
|
|
5669
|
+
};
|
|
5670
|
+
return { ...entry, credential };
|
|
5671
|
+
}
|
|
5672
|
+
function workspaceConfigFiles(dir) {
|
|
5673
|
+
let names;
|
|
5674
|
+
try {
|
|
5675
|
+
names = readdirSync(dir);
|
|
5676
|
+
} catch {
|
|
5677
|
+
return [];
|
|
5678
|
+
}
|
|
5679
|
+
return names.filter((name) => isWorkspaceConfigFilename(name)).sort().map((name) => path36__default.join(dir, name));
|
|
5680
|
+
}
|
|
5681
|
+
function readAgentConfigBlock(raw) {
|
|
5682
|
+
const key = AGENT_CONFIG_KEYS.find((candidate) => raw[candidate] !== void 0);
|
|
5683
|
+
if (!key) return void 0;
|
|
5684
|
+
const block = raw[key];
|
|
5685
|
+
if (typeof block !== "object" || block === null || Array.isArray(block)) return void 0;
|
|
5686
|
+
const profiles = block;
|
|
5687
|
+
const flat = FLAT_PROFILE_FIELDS.some((field) => typeof profiles[field] === "string");
|
|
5688
|
+
return flat ? { key, profiles: { default: profiles }, flat } : { key, profiles, flat };
|
|
5689
|
+
}
|
|
5690
|
+
function planProviderMigration(options) {
|
|
5691
|
+
const projectDir = path36__default.resolve(options.projectDir);
|
|
5692
|
+
const registryPath = options.workspace ? workspaceProviderRegistryPath(projectDir) : userProviderRegistryPath();
|
|
5693
|
+
const plan = {
|
|
5694
|
+
registryPath,
|
|
5695
|
+
entries: [],
|
|
5696
|
+
providers: {},
|
|
5697
|
+
files: [],
|
|
5698
|
+
conflicts: [],
|
|
5699
|
+
warnings: []
|
|
5700
|
+
};
|
|
5701
|
+
for (const file of workspaceConfigFiles(projectDir)) {
|
|
5702
|
+
let raw;
|
|
5703
|
+
try {
|
|
5704
|
+
raw = parseDocument(readFileSync(file, "utf-8")).toJS() ?? {};
|
|
5705
|
+
} catch (error) {
|
|
5706
|
+
plan.warnings.push(
|
|
5707
|
+
`${path36__default.basename(file)}: not valid YAML (${error instanceof Error ? error.message : String(error)}) \u2014 skipped`
|
|
5708
|
+
);
|
|
5709
|
+
continue;
|
|
5710
|
+
}
|
|
5711
|
+
let touched = false;
|
|
5712
|
+
const rawProviders = raw.providers;
|
|
5713
|
+
if (typeof rawProviders === "object" && rawProviders !== null && !Array.isArray(rawProviders)) {
|
|
5714
|
+
for (const [id, entry] of Object.entries(rawProviders)) {
|
|
5715
|
+
if (typeof entry === "object" && entry !== null && !Array.isArray(entry)) {
|
|
5716
|
+
plan.providers[id] = entry;
|
|
5717
|
+
}
|
|
5718
|
+
}
|
|
5719
|
+
touched = true;
|
|
5720
|
+
}
|
|
5721
|
+
const block = readAgentConfigBlock(raw);
|
|
5722
|
+
for (const [profile, raw_] of Object.entries(block?.profiles ?? {})) {
|
|
5723
|
+
if (typeof raw_ !== "object" || raw_ === null || Array.isArray(raw_)) continue;
|
|
5724
|
+
const value = raw_;
|
|
5725
|
+
if (!LEGACY_PROFILE_KEYS.some((key) => value[key] !== void 0)) continue;
|
|
5726
|
+
const provider = typeof value.provider === "string" ? value.provider.trim() : "anthropic";
|
|
5727
|
+
const rawCloud = typeof value.cloud === "string" ? value.cloud.trim() : "default";
|
|
5728
|
+
const cloud = rawCloud === "" ? "default" : rawCloud;
|
|
5729
|
+
const model = typeof value.model === "string" ? value.model.trim() : void 0;
|
|
5730
|
+
const cloudConfig = legacyCloudConfig(
|
|
5731
|
+
value.cloud_config ?? value.cloudConfig
|
|
5732
|
+
);
|
|
5733
|
+
const derivedEntry = legacyProfileEntry({
|
|
5734
|
+
provider,
|
|
5735
|
+
cloud,
|
|
5736
|
+
...cloudConfig ? { cloudConfig } : {},
|
|
5737
|
+
env: options.env ?? process.env
|
|
5738
|
+
});
|
|
5739
|
+
const providerId = cloud === "default" ? slugId(provider) : `${slugId(provider)}-${slugId(cloud)}`;
|
|
5740
|
+
const presetId = presetIdFor(provider, cloud);
|
|
5741
|
+
const entry = withCredentialRef(
|
|
5742
|
+
presetId ? { ...derivedEntry, preset: presetId } : derivedEntry,
|
|
5743
|
+
provider,
|
|
5744
|
+
cloud
|
|
5745
|
+
);
|
|
5746
|
+
plan.entries.push({
|
|
5747
|
+
file,
|
|
5748
|
+
profile,
|
|
5749
|
+
providerId,
|
|
5750
|
+
entry,
|
|
5751
|
+
...model ? { modelRef: `${providerId}/${model}` } : {},
|
|
5752
|
+
legacy: { provider, cloud }
|
|
5753
|
+
});
|
|
5754
|
+
if (!model) {
|
|
5755
|
+
plan.warnings.push(
|
|
5756
|
+
`${path36__default.basename(file)}: profile '${profile}' had no model: \u2014 it now resolves against registry order. Pin it with 'model: ${providerId}/<modelId>'.`
|
|
5757
|
+
);
|
|
5758
|
+
}
|
|
5759
|
+
touched = true;
|
|
5760
|
+
}
|
|
5761
|
+
if (touched) plan.files.push(file);
|
|
5762
|
+
}
|
|
5763
|
+
const existing = loadProviderRegistryFile(registryPath, options.workspace ? "workspace" : "user").document.providers;
|
|
5764
|
+
const proposed = [
|
|
5765
|
+
...plan.entries.map((e) => [e.providerId, e.entry]),
|
|
5766
|
+
...Object.entries(plan.providers)
|
|
5767
|
+
];
|
|
5768
|
+
for (const [id, entry] of proposed) {
|
|
5769
|
+
const current = existing[id];
|
|
5770
|
+
if (current && JSON.stringify(current) !== JSON.stringify(entry)) plan.conflicts.push(id);
|
|
5771
|
+
}
|
|
5772
|
+
return plan;
|
|
5773
|
+
}
|
|
5774
|
+
function rewriteWorkspaceFile(file, entries) {
|
|
5775
|
+
const doc = parseDocument(readFileSync(file, "utf-8"));
|
|
5776
|
+
const raw = doc.toJS() ?? {};
|
|
5777
|
+
doc.delete("providers");
|
|
5778
|
+
const block = readAgentConfigBlock(raw);
|
|
5779
|
+
if (block) {
|
|
5780
|
+
for (const entry of entries) {
|
|
5781
|
+
const base = block.flat ? [block.key] : [block.key, entry.profile];
|
|
5782
|
+
for (const key of LEGACY_PROFILE_KEYS) doc.deleteIn([...base, key]);
|
|
5783
|
+
if (entry.modelRef) doc.setIn([...base, "model"], entry.modelRef);
|
|
5784
|
+
}
|
|
5785
|
+
}
|
|
5786
|
+
writeFileSync(file, doc.toString());
|
|
5787
|
+
}
|
|
5788
|
+
function applyProviderMigration(plan, options) {
|
|
5789
|
+
const existing = loadProviderRegistryFile(
|
|
5790
|
+
plan.registryPath,
|
|
5791
|
+
options.workspace ? "workspace" : "user"
|
|
5792
|
+
).document.providers;
|
|
5793
|
+
const toWrite = [
|
|
5794
|
+
...plan.entries.map((e) => [e.providerId, e.entry]),
|
|
5795
|
+
...Object.entries(plan.providers)
|
|
5796
|
+
];
|
|
5797
|
+
for (const [id, entry] of toWrite) {
|
|
5798
|
+
if (existing[id] && JSON.stringify(existing[id]) === JSON.stringify(entry)) continue;
|
|
5799
|
+
addProviderEntry({
|
|
5800
|
+
id,
|
|
5801
|
+
entry,
|
|
5802
|
+
projectDir: options.projectDir,
|
|
5803
|
+
...options.workspace ? { workspace: true } : {},
|
|
5804
|
+
force: true
|
|
5805
|
+
});
|
|
5806
|
+
}
|
|
5807
|
+
const written = [];
|
|
5808
|
+
for (const file of plan.files) {
|
|
5809
|
+
rewriteWorkspaceFile(
|
|
5810
|
+
file,
|
|
5811
|
+
plan.entries.filter((entry) => entry.file === file)
|
|
5812
|
+
);
|
|
5813
|
+
written.push(file);
|
|
5814
|
+
}
|
|
5815
|
+
return { registryPath: plan.registryPath, written };
|
|
5816
|
+
}
|
|
5817
|
+
function printPlan(plan) {
|
|
5818
|
+
console.log();
|
|
5819
|
+
console.log(` ${S.heading("Provider migration")}`);
|
|
5820
|
+
for (const entry of plan.entries) {
|
|
5821
|
+
const base = entry.entry.base_url ?? S.dim("(transport-derived)");
|
|
5822
|
+
console.log(
|
|
5823
|
+
` ${S.label(`${path36__default.basename(entry.file)} ${entry.profile}`)} provider: ${entry.legacy.provider}, cloud: ${entry.legacy.cloud}`
|
|
5824
|
+
);
|
|
5825
|
+
console.log(` \u2192 providers.yml ${S.bold(entry.providerId)} ${base}`);
|
|
5826
|
+
console.log(
|
|
5827
|
+
` \u2192 credential ${entry.entry.credential?.kind ?? "none"}${entry.entry.credential?.ref ? ` ${entry.entry.credential.ref}` : ""}`
|
|
5828
|
+
);
|
|
5829
|
+
console.log(
|
|
5830
|
+
` \u2192 skaile.yaml ${entry.modelRef ? `model: ${entry.modelRef}` : S.dim("(no model: to carry over)")}`
|
|
5831
|
+
);
|
|
5832
|
+
}
|
|
5833
|
+
for (const id of Object.keys(plan.providers)) {
|
|
5834
|
+
console.log(` ${S.label("providers:")} ${id} \u2192 providers.yml`);
|
|
5835
|
+
}
|
|
5836
|
+
console.log();
|
|
5837
|
+
}
|
|
5838
|
+
async function runMigrateProviders(opts) {
|
|
5839
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
|
|
5840
|
+
const plan = planProviderMigration({ projectDir, workspace: opts.workspace });
|
|
5841
|
+
for (const warning of plan.warnings) logWarn(warning);
|
|
5842
|
+
if (plan.entries.length === 0 && Object.keys(plan.providers).length === 0) {
|
|
5843
|
+
logOk("Nothing to migrate \u2014 every skaile.yaml here is already in selector form.");
|
|
5844
|
+
console.log(
|
|
5845
|
+
` ${S.dim("Providers are defined in")} ${S.cmd(plan.registryPath)} ${S.dim("\u2014 see")} ${S.cmd("skaile providers list")}`
|
|
5846
|
+
);
|
|
5847
|
+
return;
|
|
5848
|
+
}
|
|
5849
|
+
printPlan(plan);
|
|
5850
|
+
if (plan.conflicts.length > 0 && !opts.force) {
|
|
5851
|
+
logErr(
|
|
5852
|
+
`${plan.conflicts.join(", ")} already exist(s) in ${plan.registryPath} with different settings. Review the entries, then re-run with --force to overwrite them.`
|
|
5853
|
+
);
|
|
5854
|
+
process.exit(1);
|
|
5855
|
+
}
|
|
5856
|
+
if (opts.dryRun) {
|
|
5857
|
+
logInfo("--dry-run: nothing written.");
|
|
5858
|
+
return;
|
|
5859
|
+
}
|
|
5860
|
+
try {
|
|
5861
|
+
const result = applyProviderMigration(plan, {
|
|
5862
|
+
projectDir,
|
|
5863
|
+
...opts.workspace ? { workspace: true } : {},
|
|
5864
|
+
force: true
|
|
5865
|
+
});
|
|
5866
|
+
logOk(
|
|
5867
|
+
`Wrote ${plan.entries.length + Object.keys(plan.providers).length} entr(ies) to ${result.registryPath}`
|
|
5868
|
+
);
|
|
5869
|
+
for (const file of result.written) console.log(S.dim(` \u2192 rewrote ${file}`));
|
|
5870
|
+
} catch (error) {
|
|
5871
|
+
if (error instanceof ProviderRegistryWriteError) {
|
|
5872
|
+
logErr(error.message);
|
|
5873
|
+
process.exit(1);
|
|
5874
|
+
}
|
|
5875
|
+
throw error;
|
|
5876
|
+
}
|
|
5877
|
+
const refs = new Set(
|
|
5878
|
+
plan.entries.map((entry) => entry.entry.credential?.ref).filter((ref) => !!ref?.startsWith("env:")).map((ref) => ref.slice(4))
|
|
5879
|
+
);
|
|
5880
|
+
if (refs.size > 0) {
|
|
5881
|
+
console.log();
|
|
5882
|
+
logInfo(
|
|
5883
|
+
`The secrets stay out of both files \u2014 export ${[...refs].join(", ")} (or point the entry at a cmd:/platform: reference).`
|
|
5884
|
+
);
|
|
5885
|
+
}
|
|
5886
|
+
console.log(` ${S.dim("Verify with:")} ${S.cmd("skaile providers list")}`);
|
|
5887
|
+
}
|
|
5888
|
+
function makeMigrateCommand() {
|
|
5889
|
+
const cmd = new Command("migrate").description("One-time config migrations");
|
|
5890
|
+
cmd.command("providers").description("Move agent-config provider/cloud/cloud_config into the AI provider registry").option("--project-dir <path>", "Project directory").option("--workspace", "Write <workspace>/.skaile/providers.yml instead of the user file").option("--dry-run", "Print what would change and write nothing").option("--force", "Overwrite registry entries that already exist with other settings").action((opts) => runMigrateProviders(opts));
|
|
5891
|
+
return cmd;
|
|
5892
|
+
}
|
|
5461
5893
|
function makeNpxCommand() {
|
|
5462
5894
|
const npx = new Command("npx").description("Compatibility shim for npx skills syntax");
|
|
5463
5895
|
const skills = npx.command("skills").description("Skill installation from external repos");
|
|
5464
5896
|
skills.command("add <url>").description(
|
|
5465
5897
|
"Clone a repo, register it in the project's skaile.yaml sources[], and install a skill from it"
|
|
5466
5898
|
).requiredOption("--skill <name>", "Skill name to install from the repo").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", "Agent framework", "claude-code").option("--global", "Deploy globally").action(async (url, opts) => {
|
|
5467
|
-
const projectDir =
|
|
5468
|
-
const projYaml =
|
|
5899
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
5900
|
+
const projYaml = path36__default.join(projectDir, "skaile.yaml");
|
|
5469
5901
|
if (!existsSync(projYaml)) {
|
|
5470
5902
|
logErr(`No skaile.yaml in ${projectDir} \u2014 run \`skaile init\` first.`);
|
|
5471
5903
|
process.exit(1);
|
|
@@ -5478,11 +5910,11 @@ function makeNpxCommand() {
|
|
|
5478
5910
|
}
|
|
5479
5911
|
const spinner4 = p5.spinner();
|
|
5480
5912
|
const key = sourceCacheKey(url);
|
|
5481
|
-
const clonePath =
|
|
5913
|
+
const clonePath = path36__default.join(getGlobalCacheDir(), key);
|
|
5482
5914
|
spinner4.start(`Cloning ${url}`);
|
|
5483
5915
|
try {
|
|
5484
5916
|
if (!existsSync(clonePath)) {
|
|
5485
|
-
mkdirSync(
|
|
5917
|
+
mkdirSync(path36__default.dirname(clonePath), { recursive: true });
|
|
5486
5918
|
execSync(`git clone ${url} ${clonePath}`, { stdio: "ignore" });
|
|
5487
5919
|
}
|
|
5488
5920
|
spinner4.stop(`Cloned to ${key}`);
|
|
@@ -5528,7 +5960,7 @@ function makeNpxCommand() {
|
|
|
5528
5960
|
return npx;
|
|
5529
5961
|
}
|
|
5530
5962
|
function resolvePublisher(clonePath, url) {
|
|
5531
|
-
const manifestPath =
|
|
5963
|
+
const manifestPath = path36__default.join(clonePath, SKAILE_MANIFEST_FILENAME);
|
|
5532
5964
|
if (existsSync(manifestPath)) {
|
|
5533
5965
|
try {
|
|
5534
5966
|
const { manifest } = decodeSkaileManifest(readFileSync(manifestPath, "utf8"));
|
|
@@ -5541,12 +5973,12 @@ function resolvePublisher(clonePath, url) {
|
|
|
5541
5973
|
return url.match(/github\.com[/:]([^/]+)\/[^/]+/)?.[1];
|
|
5542
5974
|
}
|
|
5543
5975
|
function resolveSkillName(clonePath, requested) {
|
|
5544
|
-
const skillsDir =
|
|
5545
|
-
if (existsSync(
|
|
5976
|
+
const skillsDir = path36__default.join(clonePath, "skills");
|
|
5977
|
+
if (existsSync(path36__default.join(skillsDir, requested, "SKILL.md"))) return requested;
|
|
5546
5978
|
if (!existsSync(skillsDir)) return requested;
|
|
5547
5979
|
for (const entry of readdirSync(skillsDir, { withFileTypes: true })) {
|
|
5548
5980
|
if (!entry.isDirectory()) continue;
|
|
5549
|
-
const md =
|
|
5981
|
+
const md = path36__default.join(skillsDir, entry.name, "SKILL.md");
|
|
5550
5982
|
if (!existsSync(md)) continue;
|
|
5551
5983
|
try {
|
|
5552
5984
|
const { data } = parseFrontmatter(readFileSync(md, "utf8"));
|
|
@@ -5561,7 +5993,7 @@ function makeOutdatedCommand() {
|
|
|
5561
5993
|
new Option("--target <agent>", "Driver target").default("claude-code").choices(SUPPORTED_DRIVER_TARGETS)
|
|
5562
5994
|
).action((name, opts) => {
|
|
5563
5995
|
const am2 = new AssetManager({
|
|
5564
|
-
projectDir:
|
|
5996
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
5565
5997
|
driverTarget: opts.target
|
|
5566
5998
|
});
|
|
5567
5999
|
const entries = am2.outdated();
|
|
@@ -5590,7 +6022,7 @@ function makeOutdatedCommand() {
|
|
|
5590
6022
|
function makePatchCommand() {
|
|
5591
6023
|
const cmd = new Command("patch").description("Patch workflow for skill improvement");
|
|
5592
6024
|
cmd.command("extract <ref>").alias("start").description("Extract asset for local editing").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
5593
|
-
const am2 = new AssetManager({ projectDir:
|
|
6025
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
5594
6026
|
try {
|
|
5595
6027
|
const dest = await am2.patch(ref);
|
|
5596
6028
|
logOk(`Extracted to ${S.dim(dest)}`);
|
|
@@ -5601,7 +6033,7 @@ function makePatchCommand() {
|
|
|
5601
6033
|
}
|
|
5602
6034
|
});
|
|
5603
6035
|
cmd.command("commit <ref>").description("Generate .patch file from edits").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
5604
|
-
const am2 = new AssetManager({ projectDir:
|
|
6036
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
5605
6037
|
try {
|
|
5606
6038
|
const patchFile = await am2.patchCommit(ref);
|
|
5607
6039
|
logOk(`Patch saved to ${S.dim(patchFile)}`);
|
|
@@ -5612,7 +6044,7 @@ function makePatchCommand() {
|
|
|
5612
6044
|
}
|
|
5613
6045
|
});
|
|
5614
6046
|
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) => {
|
|
5615
|
-
const am2 = new AssetManager({ projectDir:
|
|
6047
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
5616
6048
|
try {
|
|
5617
6049
|
await am2.patchSubmit(ref);
|
|
5618
6050
|
logOk("Patch applied to repo clone and committed.");
|
|
@@ -5625,7 +6057,7 @@ function makePatchCommand() {
|
|
|
5625
6057
|
}
|
|
5626
6058
|
});
|
|
5627
6059
|
cmd.command("remove <ref>").description("Remove local patch after upstream merge").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
|
|
5628
|
-
const am2 = new AssetManager({ projectDir:
|
|
6060
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
5629
6061
|
am2.patchRemove(ref);
|
|
5630
6062
|
logOk(`Patch removed for ${ref}`);
|
|
5631
6063
|
});
|
|
@@ -5643,7 +6075,7 @@ function action2(fn) {
|
|
|
5643
6075
|
};
|
|
5644
6076
|
}
|
|
5645
6077
|
async function reconcileAndReport(projectDir, plugins) {
|
|
5646
|
-
const { reconcilePlugins } = await import('../plugin-store-
|
|
6078
|
+
const { reconcilePlugins } = await import('../plugin-store-T2DJGKBW.js');
|
|
5647
6079
|
if (plugins.length === 0) {
|
|
5648
6080
|
logInfo("No plugins declared \u2014 nothing to reconcile.");
|
|
5649
6081
|
return;
|
|
@@ -5657,10 +6089,10 @@ async function reconcileAndReport(projectDir, plugins) {
|
|
|
5657
6089
|
}
|
|
5658
6090
|
}
|
|
5659
6091
|
async function runInstall2(spec, opts) {
|
|
5660
|
-
const projectDir =
|
|
6092
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
5661
6093
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
5662
|
-
const { specName } = await import('../plugin-store-
|
|
5663
|
-
const yamlPath =
|
|
6094
|
+
const { specName } = await import('../plugin-store-T2DJGKBW.js');
|
|
6095
|
+
const yamlPath = path36__default.join(projectDir, "skaile.yaml");
|
|
5664
6096
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
5665
6097
|
const replaced = editor.addPlugin(spec, specName);
|
|
5666
6098
|
editor.save();
|
|
@@ -5669,10 +6101,10 @@ async function runInstall2(spec, opts) {
|
|
|
5669
6101
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
5670
6102
|
}
|
|
5671
6103
|
async function runRemove(name, opts) {
|
|
5672
|
-
const projectDir =
|
|
6104
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
5673
6105
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
5674
|
-
const { specName } = await import('../plugin-store-
|
|
5675
|
-
const yamlPath =
|
|
6106
|
+
const { specName } = await import('../plugin-store-T2DJGKBW.js');
|
|
6107
|
+
const yamlPath = path36__default.join(projectDir, "skaile.yaml");
|
|
5676
6108
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
5677
6109
|
const removed = editor.removePlugin(name, specName);
|
|
5678
6110
|
if (!removed) {
|
|
@@ -5684,7 +6116,7 @@ async function runRemove(name, opts) {
|
|
|
5684
6116
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
5685
6117
|
}
|
|
5686
6118
|
async function runList(opts) {
|
|
5687
|
-
const projectDir =
|
|
6119
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
5688
6120
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
5689
6121
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
5690
6122
|
const declared = config.plugins ?? [];
|
|
@@ -5699,7 +6131,7 @@ async function runList(opts) {
|
|
|
5699
6131
|
const registry = createPluginRegistry();
|
|
5700
6132
|
if (declared.length > 0) {
|
|
5701
6133
|
try {
|
|
5702
|
-
const { loadPlugins } = await import('../plugin-store-
|
|
6134
|
+
const { loadPlugins } = await import('../plugin-store-T2DJGKBW.js');
|
|
5703
6135
|
const result = await loadPlugins(projectDir, declared, registry);
|
|
5704
6136
|
for (const f of result.failed) logWarn(f.error);
|
|
5705
6137
|
} catch (err) {
|
|
@@ -5874,7 +6306,7 @@ function neededSources(config, lock) {
|
|
|
5874
6306
|
}
|
|
5875
6307
|
function sourcesWithSidecar(sources) {
|
|
5876
6308
|
const dir = getStoreManifestsDir();
|
|
5877
|
-
return sources.filter((s) => existsSync(
|
|
6309
|
+
return sources.filter((s) => existsSync(path36.join(dir, `${storeManifestSlug(s.url)}.yaml`))).map((s) => s.url);
|
|
5878
6310
|
}
|
|
5879
6311
|
function compact(obj) {
|
|
5880
6312
|
const out = {};
|
|
@@ -5966,8 +6398,8 @@ function redactSecrets(preset, findings) {
|
|
|
5966
6398
|
}
|
|
5967
6399
|
return { preset: next, keys };
|
|
5968
6400
|
}
|
|
5969
|
-
function placeholderKey(itemId,
|
|
5970
|
-
return `${itemId}_${
|
|
6401
|
+
function placeholderKey(itemId, path39) {
|
|
6402
|
+
return `${itemId}_${path39}`.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
|
|
5971
6403
|
}
|
|
5972
6404
|
function setAtPath(root, segments, value) {
|
|
5973
6405
|
let node = root;
|
|
@@ -5990,7 +6422,7 @@ function makePresetCommand() {
|
|
|
5990
6422
|
cmd.command("init [name]").description("Scaffold a new .preset.yaml file").option("--dir <path>", "Output directory", process.cwd()).action(async (name, opts) => {
|
|
5991
6423
|
const presetName = name ?? "my-preset";
|
|
5992
6424
|
const filename = `${presetName}.preset.yaml`;
|
|
5993
|
-
const outPath =
|
|
6425
|
+
const outPath = path36__default.join(path36__default.resolve(opts.dir), filename);
|
|
5994
6426
|
if (existsSync(outPath)) {
|
|
5995
6427
|
logErr(`File already exists: ${outPath}`);
|
|
5996
6428
|
logInfo("Choose a different name or remove the existing file.");
|
|
@@ -6023,7 +6455,7 @@ function makePresetCommand() {
|
|
|
6023
6455
|
return cmd;
|
|
6024
6456
|
}
|
|
6025
6457
|
async function runPresetExport(name, opts) {
|
|
6026
|
-
const projectDir =
|
|
6458
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6027
6459
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
6028
6460
|
if (!file) {
|
|
6029
6461
|
logErr(`No skaile.yaml found in ${projectDir}`);
|
|
@@ -6033,7 +6465,7 @@ async function runPresetExport(name, opts) {
|
|
|
6033
6465
|
const presetName = name ?? file.config.name ?? "my-preset";
|
|
6034
6466
|
let lock = null;
|
|
6035
6467
|
try {
|
|
6036
|
-
lock = readLock(
|
|
6468
|
+
lock = readLock(path36__default.join(projectDir, "skaile.lock.yaml"));
|
|
6037
6469
|
} catch {
|
|
6038
6470
|
lock = null;
|
|
6039
6471
|
}
|
|
@@ -6074,7 +6506,7 @@ async function runPresetExport(name, opts) {
|
|
|
6074
6506
|
const contents = header ? `${header}
|
|
6075
6507
|
${body}` : body;
|
|
6076
6508
|
if (opts.out && opts.dir !== process.cwd()) logWarn("--dir is ignored when --out is set.");
|
|
6077
|
-
const outPath = opts.out ?
|
|
6509
|
+
const outPath = opts.out ? path36__default.resolve(opts.out) : path36__default.join(path36__default.resolve(opts.dir), `${presetName}.preset.yaml`);
|
|
6078
6510
|
if (existsSync(outPath) && !opts.force) {
|
|
6079
6511
|
logErr(`File already exists: ${outPath}`);
|
|
6080
6512
|
logInfo("Pass --force to overwrite, or choose a different --out/--dir.");
|
|
@@ -6086,7 +6518,7 @@ ${body}` : body;
|
|
|
6086
6518
|
logErr(`Failed to write ${outPath}: ${e.message}`);
|
|
6087
6519
|
process.exit(1);
|
|
6088
6520
|
}
|
|
6089
|
-
logOk(`Exported ${S.brand(
|
|
6521
|
+
logOk(`Exported ${S.brand(path36__default.basename(outPath))}`);
|
|
6090
6522
|
logInfo(`Path: ${outPath}`);
|
|
6091
6523
|
if (unresolved.length > 0) {
|
|
6092
6524
|
console.error(S.err("This file is NOT safe to share."));
|
|
@@ -6127,13 +6559,13 @@ function collectInput(value, acc) {
|
|
|
6127
6559
|
return acc;
|
|
6128
6560
|
}
|
|
6129
6561
|
async function runPresetApply(filePath, opts) {
|
|
6130
|
-
const projectDir =
|
|
6562
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6131
6563
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
6132
6564
|
if (!file) {
|
|
6133
6565
|
logErr("No skaile.yaml \u2014 run `skaile init` first");
|
|
6134
6566
|
process.exit(1);
|
|
6135
6567
|
}
|
|
6136
|
-
const resolved =
|
|
6568
|
+
const resolved = path36__default.resolve(filePath);
|
|
6137
6569
|
if (!existsSync(resolved)) {
|
|
6138
6570
|
logErr(`File not found: ${resolved}`);
|
|
6139
6571
|
process.exit(1);
|
|
@@ -6349,7 +6781,7 @@ async function reportNestedPresetRefs(preset) {
|
|
|
6349
6781
|
}
|
|
6350
6782
|
async function checkPresetCycles(preset, resolved) {
|
|
6351
6783
|
const { detectCycles } = await import('../discovery/index.js');
|
|
6352
|
-
const presetRef =
|
|
6784
|
+
const presetRef = path36__default.basename(resolved, ".preset.yaml");
|
|
6353
6785
|
const edges = [];
|
|
6354
6786
|
for (const item of preset.items) {
|
|
6355
6787
|
if (item.ref) {
|
|
@@ -6401,7 +6833,7 @@ function printPresetSummary(preset, placeholderCount, hasWarnings) {
|
|
|
6401
6833
|
}
|
|
6402
6834
|
}
|
|
6403
6835
|
async function runPresetValidate(filePath) {
|
|
6404
|
-
const resolved =
|
|
6836
|
+
const resolved = path36__default.resolve(filePath);
|
|
6405
6837
|
const preset = await loadPresetForValidation(resolved);
|
|
6406
6838
|
await reportNestedPresetRefs(preset);
|
|
6407
6839
|
await checkPresetCycles(preset, resolved);
|
|
@@ -6451,14 +6883,14 @@ items:
|
|
|
6451
6883
|
}
|
|
6452
6884
|
function makeRebuildCommand() {
|
|
6453
6885
|
return new Command("rebuild").description("Re-snapshot inline-snapshot composition items and bump prompt version").argument("[agent]", "Agent name or path (defaults to current project agent)").option("--project-dir <dir>", "Project directory", process.cwd()).action(async (agentArg, opts) => {
|
|
6454
|
-
const projectDir =
|
|
6886
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6455
6887
|
let agentDir;
|
|
6456
6888
|
if (agentArg) {
|
|
6457
6889
|
if (agentArg.includes("/") || agentArg.includes("\\")) {
|
|
6458
|
-
agentDir =
|
|
6890
|
+
agentDir = path36__default.resolve(projectDir, agentArg);
|
|
6459
6891
|
} else {
|
|
6460
6892
|
const resolved = resolveAgentDir(projectDir);
|
|
6461
|
-
agentDir = resolved ??
|
|
6893
|
+
agentDir = resolved ?? path36__default.resolve(projectDir, agentArg);
|
|
6462
6894
|
}
|
|
6463
6895
|
} else {
|
|
6464
6896
|
const resolved = resolveAgentDir(projectDir);
|
|
@@ -6550,8 +6982,8 @@ function makeFlowEventHandler() {
|
|
|
6550
6982
|
};
|
|
6551
6983
|
}
|
|
6552
6984
|
function makeRunCommand() {
|
|
6553
|
-
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("--driver <name>", "Driver backend (claude-sdk, codex, omp)").option("--
|
|
6554
|
-
const projectDir =
|
|
6985
|
+
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("--driver <name>", "Driver backend (claude-sdk, codex, omp)").option("--model <name>", "Model override").option("--label <label>", "Human-readable session label").option("--dry-run", "Print plan without executing").option("--skill <name>", "Skill name (for single-shot mode)").action(async (positional, opts) => {
|
|
6986
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6555
6987
|
const cliDriver = opts.driver;
|
|
6556
6988
|
const dryRun = opts.dryRun ?? false;
|
|
6557
6989
|
let flowId = positional[0];
|
|
@@ -6577,12 +7009,10 @@ function makeRunCommand() {
|
|
|
6577
7009
|
}
|
|
6578
7010
|
const config = await resolveSettings(projectDir, {
|
|
6579
7011
|
driver: cliDriver,
|
|
6580
|
-
model: opts.model
|
|
6581
|
-
provider: opts.provider
|
|
7012
|
+
model: opts.model
|
|
6582
7013
|
});
|
|
6583
7014
|
const driver = config.driver ?? "omp";
|
|
6584
7015
|
const model = config.model;
|
|
6585
|
-
const provider = config.provider;
|
|
6586
7016
|
const flowPath = findFlowFile(flowId, projectAiAssetsRoots(projectDir), projectDir);
|
|
6587
7017
|
if (!flowPath) {
|
|
6588
7018
|
const textPrompt = positional.join(" ");
|
|
@@ -6599,7 +7029,6 @@ function makeRunCommand() {
|
|
|
6599
7029
|
projectDir,
|
|
6600
7030
|
driver: config.driver,
|
|
6601
7031
|
model: config.model,
|
|
6602
|
-
provider: config.provider,
|
|
6603
7032
|
message: textPrompt,
|
|
6604
7033
|
skill: opts.skill
|
|
6605
7034
|
});
|
|
@@ -6636,7 +7065,6 @@ function makeRunCommand() {
|
|
|
6636
7065
|
flowPath,
|
|
6637
7066
|
driver,
|
|
6638
7067
|
model,
|
|
6639
|
-
provider,
|
|
6640
7068
|
sessionLabel: opts.label,
|
|
6641
7069
|
dryRun,
|
|
6642
7070
|
onEvent: makeFlowEventHandler(),
|
|
@@ -6652,7 +7080,7 @@ function makeRunCommand() {
|
|
|
6652
7080
|
}
|
|
6653
7081
|
function makeResumeCommand() {
|
|
6654
7082
|
const cmd = new Command("resume").description("Resume current session").option("--project-dir <path>", "Project directory", process.cwd()).option("--session <run-id>", "Target session by runId").option("--dry-run", "Print plan without executing").action(async (opts) => {
|
|
6655
|
-
const projectDir =
|
|
7083
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6656
7084
|
const sessionId = opts.session;
|
|
6657
7085
|
const dryRun = opts.dryRun ?? false;
|
|
6658
7086
|
const session = sessionId ? await loadSessionById(projectDir, sessionId) : await loadSession(projectDir);
|
|
@@ -6679,7 +7107,7 @@ function makeResumeCommand() {
|
|
|
6679
7107
|
}
|
|
6680
7108
|
function makeStatusCommand() {
|
|
6681
7109
|
return new Command("status").description("Show current session state").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
6682
|
-
const projectDir =
|
|
7110
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6683
7111
|
const session = await loadSession(projectDir);
|
|
6684
7112
|
if (!session) {
|
|
6685
7113
|
logInfo("No active session.");
|
|
@@ -6704,17 +7132,17 @@ function makeStatusCommand() {
|
|
|
6704
7132
|
}
|
|
6705
7133
|
function makeClearCommand() {
|
|
6706
7134
|
return new Command("clear").description("Unset current session pointer").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
6707
|
-
const projectDir =
|
|
7135
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6708
7136
|
await clearSession(projectDir);
|
|
6709
7137
|
logOk("Session cleared.");
|
|
6710
7138
|
});
|
|
6711
7139
|
}
|
|
6712
7140
|
function makeReplCommand() {
|
|
6713
|
-
return new Command("repl").description("Start an interactive agent session").option("--project-dir <path>", "Project directory").option("--driver <name>", "Driver backend (claude-sdk, omp)").option("--
|
|
7141
|
+
return new Command("repl").description("Start an interactive agent session").option("--project-dir <path>", "Project directory").option("--driver <name>", "Driver backend (claude-sdk, omp)").option("--model <name>", "Model override").option("--resume", "Resume last session").option("--resume-session <id>", "Resume specific session").action(async (opts) => {
|
|
6714
7142
|
const { findWorkspaceRoot } = await import('../core/index.js');
|
|
6715
7143
|
const { startRepl } = await import('../tui/index.js');
|
|
6716
7144
|
const os2 = await import('os');
|
|
6717
|
-
const userCwd =
|
|
7145
|
+
const userCwd = path36__default.resolve(opts.projectDir ?? process.cwd());
|
|
6718
7146
|
const workspaceRoot = findWorkspaceRoot(userCwd);
|
|
6719
7147
|
let projectDir;
|
|
6720
7148
|
let agentCwd;
|
|
@@ -6736,12 +7164,12 @@ function makeReplCommand() {
|
|
|
6736
7164
|
p5.cancel("Cancelled.");
|
|
6737
7165
|
process.exit(0);
|
|
6738
7166
|
}
|
|
6739
|
-
const tmpDir = fs12__default.mkdtempSync(
|
|
7167
|
+
const tmpDir = fs12__default.mkdtempSync(path36__default.join(os2.tmpdir(), "skaile-repl-"));
|
|
6740
7168
|
projectDir = tmpDir;
|
|
6741
7169
|
agentCwd = userCwd;
|
|
6742
7170
|
logOk(`Temporary workspace: ${S.cmd(tmpDir)}`);
|
|
6743
7171
|
if (!driverOverride) {
|
|
6744
|
-
const claudeDir =
|
|
7172
|
+
const claudeDir = path36__default.join(os2.homedir(), ".claude");
|
|
6745
7173
|
if (fs12__default.existsSync(claudeDir)) {
|
|
6746
7174
|
driverOverride = "claude-sdk";
|
|
6747
7175
|
logInfo(`Detected ${S.cmd("~/.claude")} \u2192 using ${S.cmd("claude-sdk")} backend`);
|
|
@@ -6757,7 +7185,6 @@ function makeReplCommand() {
|
|
|
6757
7185
|
cwd: agentCwd !== projectDir ? agentCwd : void 0,
|
|
6758
7186
|
driver: driverOverride,
|
|
6759
7187
|
model: opts.model,
|
|
6760
|
-
provider: opts.provider,
|
|
6761
7188
|
resume: opts.resume,
|
|
6762
7189
|
resumeSessionId: opts.resumeSession
|
|
6763
7190
|
});
|
|
@@ -6805,12 +7232,12 @@ function makeServeCommand() {
|
|
|
6805
7232
|
);
|
|
6806
7233
|
}
|
|
6807
7234
|
async function ensurePluginsLoadedForServe(projectDir) {
|
|
6808
|
-
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-
|
|
7235
|
+
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-DISRVGRJ.js');
|
|
6809
7236
|
try {
|
|
6810
7237
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
6811
7238
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
6812
7239
|
if (!config.plugins || config.plugins.length === 0) return;
|
|
6813
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
7240
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-T2DJGKBW.js');
|
|
6814
7241
|
const { pluginRegistry } = await import('../plugin-registry/index.js');
|
|
6815
7242
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
6816
7243
|
if (result.loaded.length > 0) {
|
|
@@ -6824,14 +7251,14 @@ async function ensurePluginsLoadedForServe(projectDir) {
|
|
|
6824
7251
|
}
|
|
6825
7252
|
}
|
|
6826
7253
|
async function runCompileTest(opts) {
|
|
6827
|
-
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-
|
|
7254
|
+
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-DISRVGRJ.js');
|
|
6828
7255
|
const { tmpdir } = await import('os');
|
|
6829
7256
|
const { dirname: dirname4, join: join7, resolve: resolve5 } = await import('path');
|
|
6830
7257
|
const { fileURLToPath: fileURLToPath2 } = await import('url');
|
|
6831
7258
|
const { unlinkSync, existsSync: existsSync15 } = await import('fs');
|
|
6832
7259
|
const { spawn } = await import('child_process');
|
|
6833
7260
|
const { portableSpawnSync: portableSpawnSync2 } = await import('../core/index.js');
|
|
6834
|
-
const { MONOREPO_ROOT } = await import('../paths-
|
|
7261
|
+
const { MONOREPO_ROOT } = await import('../paths-P26QGQP5.js');
|
|
6835
7262
|
if (MONOREPO_ROOT === null) {
|
|
6836
7263
|
logErr2("--compile-test is only available inside the skaile-dev workspace.");
|
|
6837
7264
|
logInfo2("Run it from a checkout of skaile-ai/skaile-dev (the monorepo shell).");
|
|
@@ -7313,7 +7740,7 @@ function resolveMode(opts) {
|
|
|
7313
7740
|
if (opts.forceLocal && opts.forceRemote) {
|
|
7314
7741
|
throw new Error("Cannot use both --local and --remote");
|
|
7315
7742
|
}
|
|
7316
|
-
const startDir =
|
|
7743
|
+
const startDir = path36__default.resolve(opts.projectDir ?? process.cwd());
|
|
7317
7744
|
const localDb = findLogsDb(startDir);
|
|
7318
7745
|
if (opts.forceLocal) {
|
|
7319
7746
|
if (!localDb) {
|
|
@@ -7346,14 +7773,14 @@ function resolveMode(opts) {
|
|
|
7346
7773
|
function findLogsDb(startDir) {
|
|
7347
7774
|
let dir = startDir;
|
|
7348
7775
|
for (let i = 0; i < MAX_WALK_LEVELS; i++) {
|
|
7349
|
-
const candidate =
|
|
7776
|
+
const candidate = path36__default.join(dir, ".skaile", "logs.db");
|
|
7350
7777
|
if (existsSync(candidate)) {
|
|
7351
7778
|
try {
|
|
7352
7779
|
if (statSync(candidate).isFile()) return candidate;
|
|
7353
7780
|
} catch {
|
|
7354
7781
|
}
|
|
7355
7782
|
}
|
|
7356
|
-
const parent =
|
|
7783
|
+
const parent = path36__default.dirname(dir);
|
|
7357
7784
|
if (parent === dir) return void 0;
|
|
7358
7785
|
dir = parent;
|
|
7359
7786
|
}
|
|
@@ -7379,7 +7806,7 @@ function readApiToken() {
|
|
|
7379
7806
|
}
|
|
7380
7807
|
function readGlobalSettings() {
|
|
7381
7808
|
try {
|
|
7382
|
-
const settingsPath =
|
|
7809
|
+
const settingsPath = path36__default.join(homedir(), ".skaile", "settings.json");
|
|
7383
7810
|
if (!existsSync(settingsPath)) return {};
|
|
7384
7811
|
return JSON.parse(readFileSync(settingsPath, "utf8"));
|
|
7385
7812
|
} catch {
|
|
@@ -7528,7 +7955,7 @@ function parsePositiveInt(value, flag) {
|
|
|
7528
7955
|
function makeSessionCommand() {
|
|
7529
7956
|
const cmd = new Command("session").description("Manage sessions");
|
|
7530
7957
|
cmd.command("list").description("List all sessions for a project").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7531
|
-
const projectDir =
|
|
7958
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7532
7959
|
const sessions = await listSessions(projectDir);
|
|
7533
7960
|
const current = await loadSession(projectDir);
|
|
7534
7961
|
if (sessions.length === 0) {
|
|
@@ -7556,7 +7983,7 @@ function makeSessionCommand() {
|
|
|
7556
7983
|
console.log();
|
|
7557
7984
|
});
|
|
7558
7985
|
cmd.command("show <run-id>").description("Show a specific session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7559
|
-
const projectDir =
|
|
7986
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7560
7987
|
const session = await loadSessionById(projectDir, runId);
|
|
7561
7988
|
if (!session) {
|
|
7562
7989
|
logErr(`Session not found: ${runId}`);
|
|
@@ -7565,12 +7992,12 @@ function makeSessionCommand() {
|
|
|
7565
7992
|
console.log(JSON.stringify(session, null, 2));
|
|
7566
7993
|
});
|
|
7567
7994
|
cmd.command("switch <run-id>").description("Switch the current session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7568
|
-
const projectDir =
|
|
7995
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7569
7996
|
await setCurrentSession(projectDir, runId);
|
|
7570
7997
|
logOk(`Switched to session: ${S.dim(runId.slice(0, 8))}`);
|
|
7571
7998
|
});
|
|
7572
7999
|
cmd.command("delete <run-id>").description("Delete a session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7573
|
-
const projectDir =
|
|
8000
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7574
8001
|
await deleteSession(projectDir, runId);
|
|
7575
8002
|
logOk(`Deleted session: ${S.dim(runId.slice(0, 8))}`);
|
|
7576
8003
|
});
|
|
@@ -7638,7 +8065,7 @@ async function showAsset(am2, kind, name) {
|
|
|
7638
8065
|
function makeShowCommand() {
|
|
7639
8066
|
return new Command("show").description("Show deployed assets overview, or print asset content").argument("[kind]", "Asset kind (skill, agent, prompt, flow, bundle, contract)").argument("[name]", "Asset name").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", "Agent framework", "claude-code").action(async (kind, name, opts) => {
|
|
7640
8067
|
const am2 = new AssetManager({
|
|
7641
|
-
projectDir:
|
|
8068
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
7642
8069
|
driverTarget: opts.target
|
|
7643
8070
|
});
|
|
7644
8071
|
if (!kind) {
|
|
@@ -7706,9 +8133,9 @@ function makeStoreCommand() {
|
|
|
7706
8133
|
process.exit(2);
|
|
7707
8134
|
});
|
|
7708
8135
|
store.command("search <query>").description("Search the AI Asset Store catalog by name, description, or publisher").option("--kind <kind>", "Filter by asset kind (skill, agent, prompt, flow, \u2026)").option("-C, --project-dir <dir>", "Project directory (catalog config overlay)", process.cwd()).action(async (query, opts) => {
|
|
7709
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-
|
|
8136
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-6LM4W4DR.js');
|
|
7710
8137
|
try {
|
|
7711
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
8138
|
+
const remote = await openCatalogSource2({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
7712
8139
|
const assets = await remote.listAssets(opts.kind ? { kind: opts.kind } : {});
|
|
7713
8140
|
const results = filterCatalogAssets(assets, query);
|
|
7714
8141
|
if (results.length === 0) {
|
|
@@ -7739,10 +8166,10 @@ function makeStoreCommand() {
|
|
|
7739
8166
|
}
|
|
7740
8167
|
});
|
|
7741
8168
|
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) => {
|
|
7742
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-
|
|
7743
|
-
const { supportsInstallManifest } = await import('../project-
|
|
8169
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-6LM4W4DR.js');
|
|
8170
|
+
const { supportsInstallManifest } = await import('../project-HP3IR7RW.js');
|
|
7744
8171
|
try {
|
|
7745
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
8172
|
+
const remote = await openCatalogSource2({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
7746
8173
|
const asset = await remote.resolve(ref);
|
|
7747
8174
|
if (!asset) {
|
|
7748
8175
|
logErr(`Not found in store: ${ref} (try a full ref, e.g. skill:@publisher/name#version)`);
|
|
@@ -7861,7 +8288,7 @@ function printTree(node, prefix = "", isLast = true) {
|
|
|
7861
8288
|
}
|
|
7862
8289
|
function makeTreeCommand() {
|
|
7863
8290
|
return new Command("tree").description("Show full dependency tree").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7864
|
-
const am2 = new AssetManager({ projectDir:
|
|
8291
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
7865
8292
|
const root = am2.tree();
|
|
7866
8293
|
if (root.children.length === 0) {
|
|
7867
8294
|
logInfo("No dependencies in lock file. Run `skaile install` first.");
|
|
@@ -7887,7 +8314,7 @@ function makeUpdateCommand() {
|
|
|
7887
8314
|
try {
|
|
7888
8315
|
const catalogSpinner = p5.spinner();
|
|
7889
8316
|
catalogSpinner.start("Refreshing catalog cache");
|
|
7890
|
-
const remote = await openCatalogSource({ projectDir:
|
|
8317
|
+
const remote = await openCatalogSource({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
7891
8318
|
const result2 = await remote.refresh();
|
|
7892
8319
|
catalogSpinner.stop(
|
|
7893
8320
|
`Catalog refreshed: ${S.heading(String(result2.assetsCached))} assets cached`
|
|
@@ -7899,7 +8326,7 @@ function makeUpdateCommand() {
|
|
|
7899
8326
|
}
|
|
7900
8327
|
}
|
|
7901
8328
|
if (opts.catalogOnly) return;
|
|
7902
|
-
const projectDir =
|
|
8329
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7903
8330
|
if (await shouldSyncSources(opts)) {
|
|
7904
8331
|
const syncSpinner = p5.spinner();
|
|
7905
8332
|
syncSpinner.start("Syncing sources");
|
|
@@ -7960,7 +8387,7 @@ function findManifestCandidates(rootPath) {
|
|
|
7960
8387
|
return;
|
|
7961
8388
|
}
|
|
7962
8389
|
for (const entry of entries) {
|
|
7963
|
-
const fullPath =
|
|
8390
|
+
const fullPath = path36__default.join(dir, entry.name);
|
|
7964
8391
|
if (entry.isDirectory()) {
|
|
7965
8392
|
if (!SKIP_DIRS.has(entry.name)) walk(fullPath);
|
|
7966
8393
|
} else if (entry.isFile()) {
|
|
@@ -8013,13 +8440,13 @@ function parseManifestCandidate(c, absRoot) {
|
|
|
8013
8440
|
const parsed = c.filePath.endsWith(".json") ? JSON.parse(content) : parse(content);
|
|
8014
8441
|
return { kind: "value", parsed };
|
|
8015
8442
|
} catch (e) {
|
|
8016
|
-
const relPath =
|
|
8443
|
+
const relPath = path36__default.relative(absRoot, c.filePath);
|
|
8017
8444
|
logErr(`${relPath} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
|
|
8018
8445
|
return { kind: "error" };
|
|
8019
8446
|
}
|
|
8020
8447
|
}
|
|
8021
8448
|
function validateManifestCandidate(c, parsed, absRoot, registry, strictConformance) {
|
|
8022
|
-
const relPath =
|
|
8449
|
+
const relPath = path36__default.relative(absRoot, c.filePath);
|
|
8023
8450
|
let errors = 0;
|
|
8024
8451
|
let warnings = 0;
|
|
8025
8452
|
const identityError = checkManifestIdentity(c.kind, parsed);
|
|
@@ -8028,7 +8455,7 @@ function validateManifestCandidate(c, parsed, absRoot, registry, strictConforman
|
|
|
8028
8455
|
errors++;
|
|
8029
8456
|
}
|
|
8030
8457
|
if (c.kind === "skill" && parsed && typeof parsed === "object") {
|
|
8031
|
-
const dirName =
|
|
8458
|
+
const dirName = path36__default.basename(path36__default.dirname(c.filePath));
|
|
8032
8459
|
const findings = checkAgentSkillConformance(parsed, { dirName });
|
|
8033
8460
|
for (const f of findings) {
|
|
8034
8461
|
const line = `${relPath} [skill conformance] \u2014 ${f.field}: ${f.message}`;
|
|
@@ -8056,7 +8483,7 @@ function validateManifestCandidate(c, parsed, absRoot, registry, strictConforman
|
|
|
8056
8483
|
return { errors, warnings };
|
|
8057
8484
|
}
|
|
8058
8485
|
function validateManifests(rootPath, strictConformance) {
|
|
8059
|
-
const absRoot =
|
|
8486
|
+
const absRoot = path36__default.resolve(rootPath);
|
|
8060
8487
|
if (!fs12__default.existsSync(absRoot)) {
|
|
8061
8488
|
logErr(`Path does not exist: ${absRoot}`);
|
|
8062
8489
|
return { total: 0, errors: 1, warnings: 0 };
|
|
@@ -8094,7 +8521,7 @@ function findWorkspaceManifests(rootPath) {
|
|
|
8094
8521
|
return;
|
|
8095
8522
|
}
|
|
8096
8523
|
for (const entry of entries) {
|
|
8097
|
-
const full =
|
|
8524
|
+
const full = path36__default.join(dir, entry.name);
|
|
8098
8525
|
if (entry.isDirectory()) {
|
|
8099
8526
|
if (!SKIP_DIRS.has(entry.name)) walk(full);
|
|
8100
8527
|
} else if (entry.isFile() && /(^|\.)skaile\.yaml$/.test(entry.name)) {
|
|
@@ -8157,11 +8584,11 @@ function validateWorkspaceAssets(parsed, relPath) {
|
|
|
8157
8584
|
return errors;
|
|
8158
8585
|
}
|
|
8159
8586
|
function validateWorkspaceManifests(rootPath) {
|
|
8160
|
-
const absRoot =
|
|
8587
|
+
const absRoot = path36__default.resolve(rootPath);
|
|
8161
8588
|
const files = findWorkspaceManifests(absRoot);
|
|
8162
8589
|
let errors = 0;
|
|
8163
8590
|
for (const file of files) {
|
|
8164
|
-
const relPath =
|
|
8591
|
+
const relPath = path36__default.relative(absRoot, file);
|
|
8165
8592
|
let parsed;
|
|
8166
8593
|
try {
|
|
8167
8594
|
parsed = parse(fs12__default.readFileSync(file, "utf-8")) ?? {};
|
|
@@ -8181,20 +8608,20 @@ function collectAssetVersions() {
|
|
|
8181
8608
|
if (!fs12__default.existsSync(AI_RESOURCES)) return assets;
|
|
8182
8609
|
const domains = fs12__default.readdirSync(AI_RESOURCES, { withFileTypes: true }).filter((d) => d.isDirectory() && !EXCLUDED_DOMAINS.has(d.name));
|
|
8183
8610
|
for (const d of domains) {
|
|
8184
|
-
const domainDir =
|
|
8185
|
-
const skillsDir =
|
|
8611
|
+
const domainDir = path36__default.join(AI_RESOURCES, d.name);
|
|
8612
|
+
const skillsDir = path36__default.join(domainDir, "skills");
|
|
8186
8613
|
if (fs12__default.existsSync(skillsDir)) {
|
|
8187
8614
|
collectSkillVersions(skillsDir, d.name, assets);
|
|
8188
8615
|
}
|
|
8189
|
-
const agentsDir =
|
|
8616
|
+
const agentsDir = path36__default.join(domainDir, "agents");
|
|
8190
8617
|
if (fs12__default.existsSync(agentsDir)) {
|
|
8191
8618
|
collectAgentVersions(agentsDir, d.name, assets);
|
|
8192
8619
|
}
|
|
8193
|
-
const flowsDir =
|
|
8620
|
+
const flowsDir = path36__default.join(domainDir, "flows");
|
|
8194
8621
|
if (fs12__default.existsSync(flowsDir)) {
|
|
8195
8622
|
collectFlowVersions(flowsDir, d.name, assets);
|
|
8196
8623
|
}
|
|
8197
|
-
const promptsDir =
|
|
8624
|
+
const promptsDir = path36__default.join(domainDir, "prompts");
|
|
8198
8625
|
if (fs12__default.existsSync(promptsDir)) {
|
|
8199
8626
|
collectPromptVersions(promptsDir, d.name, assets);
|
|
8200
8627
|
}
|
|
@@ -8204,7 +8631,7 @@ function collectAssetVersions() {
|
|
|
8204
8631
|
function collectFlowVersions(dir, domain, out) {
|
|
8205
8632
|
for (const f of fs12__default.readdirSync(dir)) {
|
|
8206
8633
|
if (!f.endsWith(".flow.yaml")) continue;
|
|
8207
|
-
const fp =
|
|
8634
|
+
const fp = path36__default.join(dir, f);
|
|
8208
8635
|
const content = fs12__default.readFileSync(fp, "utf-8");
|
|
8209
8636
|
const parsed = parse(content);
|
|
8210
8637
|
out.push({
|
|
@@ -8219,7 +8646,7 @@ function collectFlowVersions(dir, domain, out) {
|
|
|
8219
8646
|
function collectPromptVersions(dir, domain, out) {
|
|
8220
8647
|
for (const f of fs12__default.readdirSync(dir)) {
|
|
8221
8648
|
if (!f.endsWith(".prompt.md")) continue;
|
|
8222
|
-
const fp =
|
|
8649
|
+
const fp = path36__default.join(dir, f);
|
|
8223
8650
|
const content = fs12__default.readFileSync(fp, "utf-8");
|
|
8224
8651
|
const fm = parseSkillFrontmatter(content);
|
|
8225
8652
|
out.push({
|
|
@@ -8234,8 +8661,8 @@ function collectPromptVersions(dir, domain, out) {
|
|
|
8234
8661
|
function collectSkillVersions(dir, domain, out) {
|
|
8235
8662
|
for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
|
|
8236
8663
|
if (!entry.isDirectory()) continue;
|
|
8237
|
-
const full =
|
|
8238
|
-
const skillMd =
|
|
8664
|
+
const full = path36__default.join(dir, entry.name);
|
|
8665
|
+
const skillMd = path36__default.join(full, "SKILL.md");
|
|
8239
8666
|
if (fs12__default.existsSync(skillMd)) {
|
|
8240
8667
|
const content = fs12__default.readFileSync(skillMd, "utf-8");
|
|
8241
8668
|
const fm = parseSkillFrontmatter(content);
|
|
@@ -8254,7 +8681,7 @@ function collectSkillVersions(dir, domain, out) {
|
|
|
8254
8681
|
function collectAgentVersions(dir, domain, out) {
|
|
8255
8682
|
for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
|
|
8256
8683
|
if (!entry.isDirectory()) continue;
|
|
8257
|
-
const agentYaml =
|
|
8684
|
+
const agentYaml = path36__default.join(dir, entry.name, "agent.yaml");
|
|
8258
8685
|
if (!fs12__default.existsSync(agentYaml)) continue;
|
|
8259
8686
|
const content = fs12__default.readFileSync(agentYaml, "utf-8");
|
|
8260
8687
|
const parsed = parse(content);
|
|
@@ -8287,7 +8714,7 @@ function filterToChangedAssets(assets) {
|
|
|
8287
8714
|
encoding: "utf-8"
|
|
8288
8715
|
});
|
|
8289
8716
|
const changedFiles = new Set(
|
|
8290
|
-
diffOutput.trim().split("\n").filter(Boolean).map((f) =>
|
|
8717
|
+
diffOutput.trim().split("\n").filter(Boolean).map((f) => path36__default.resolve(AI_RESOURCES, f))
|
|
8291
8718
|
);
|
|
8292
8719
|
return assets.filter((a) => changedFiles.has(a.filePath));
|
|
8293
8720
|
} catch {
|
|
@@ -8313,7 +8740,7 @@ function checkVersionBumps(assets) {
|
|
|
8313
8740
|
let warnings = 0;
|
|
8314
8741
|
for (const a of assets) {
|
|
8315
8742
|
if (!a.version) continue;
|
|
8316
|
-
const relPath =
|
|
8743
|
+
const relPath = path36__default.relative(AI_RESOURCES, a.filePath);
|
|
8317
8744
|
try {
|
|
8318
8745
|
const headContent = execSync(`git show HEAD:${relPath}`, {
|
|
8319
8746
|
cwd: AI_RESOURCES,
|
|
@@ -8345,7 +8772,7 @@ function checkFlowVersionPins(assets) {
|
|
|
8345
8772
|
pins = flowSkillVersionPins(loadFlow(f.filePath));
|
|
8346
8773
|
} catch (err) {
|
|
8347
8774
|
logWarn(
|
|
8348
|
-
`flow:${f.name} (${
|
|
8775
|
+
`flow:${f.name} (${path36__default.relative(AI_RESOURCES, f.filePath)}) \u2014 could not be read: ${err instanceof Error ? err.message : err}`
|
|
8349
8776
|
);
|
|
8350
8777
|
warnings++;
|
|
8351
8778
|
continue;
|
|
@@ -8395,7 +8822,7 @@ function makeValidateCommand() {
|
|
|
8395
8822
|
"--strict-conformance",
|
|
8396
8823
|
"Treat Agent Skills (agentskills.io) standard findings as errors"
|
|
8397
8824
|
).action((targetPath, opts) => {
|
|
8398
|
-
const absPath =
|
|
8825
|
+
const absPath = path36__default.resolve(targetPath);
|
|
8399
8826
|
logInfo(`Validating manifests in ${absPath}`);
|
|
8400
8827
|
const { total, errors, warnings } = validateManifests(
|
|
8401
8828
|
absPath,
|
|
@@ -8445,7 +8872,7 @@ function makeValidateCommand() {
|
|
|
8445
8872
|
let errors = 0;
|
|
8446
8873
|
for (const domain of modifiedDomains) {
|
|
8447
8874
|
const changelogModified = modifiedFiles.some(
|
|
8448
|
-
(f) => f === `${domain}/CHANGELOG.md` || f ===
|
|
8875
|
+
(f) => f === `${domain}/CHANGELOG.md` || f === path36__default.join(domain, "CHANGELOG.md")
|
|
8449
8876
|
);
|
|
8450
8877
|
if (changelogModified) {
|
|
8451
8878
|
logOk(`${domain}/CHANGELOG.md updated`);
|
|
@@ -8551,7 +8978,7 @@ function whyEmptyMessage(ref, declared) {
|
|
|
8551
8978
|
}
|
|
8552
8979
|
function makeWhyCommand() {
|
|
8553
8980
|
return new Command("why").description("Show why an asset is installed (dependency chain)").argument("<ref>", "Asset reference (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
8554
|
-
const am2 = new AssetManager({ projectDir:
|
|
8981
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
8555
8982
|
const chain = am2.why(ref);
|
|
8556
8983
|
if (chain.length === 0) {
|
|
8557
8984
|
let declared;
|
|
@@ -8585,7 +9012,7 @@ function makeWhyCommand() {
|
|
|
8585
9012
|
var _defaultFormatHelp = Help.prototype.formatHelp;
|
|
8586
9013
|
var pkg = JSON.parse(
|
|
8587
9014
|
readFileSync(
|
|
8588
|
-
|
|
9015
|
+
path36__default.resolve(path36__default.dirname(fileURLToPath(import.meta.url)), "../../package.json"),
|
|
8589
9016
|
"utf-8"
|
|
8590
9017
|
)
|
|
8591
9018
|
);
|
|
@@ -8706,7 +9133,7 @@ program.command("init [project-dir]").description("Initialize a project director
|
|
|
8706
9133
|
(projectDir, opts) => runInit(projectDir, opts)
|
|
8707
9134
|
);
|
|
8708
9135
|
async function runInit(projectDir, opts) {
|
|
8709
|
-
const { mkdirSync: mkdirSync5, writeFileSync:
|
|
9136
|
+
const { mkdirSync: mkdirSync5, writeFileSync: writeFileSync6 } = await import('fs');
|
|
8710
9137
|
const { stringify: stringify2 } = await import('yaml');
|
|
8711
9138
|
const { DRIVER_TARGETS, SUPPORTED_DRIVER_TARGETS: SUPPORTED_DRIVER_TARGETS2 } = await import('../core/index.js');
|
|
8712
9139
|
const backend = opts.backend;
|
|
@@ -8715,31 +9142,31 @@ async function runInit(projectDir, opts) {
|
|
|
8715
9142
|
process.exitCode = 1;
|
|
8716
9143
|
return;
|
|
8717
9144
|
}
|
|
8718
|
-
const resolved =
|
|
8719
|
-
const projectName =
|
|
9145
|
+
const resolved = path36__default.resolve(projectDir ?? ".");
|
|
9146
|
+
const projectName = path36__default.basename(resolved);
|
|
8720
9147
|
const created = [];
|
|
8721
9148
|
const { existsSync: existsSync15 } = await import('fs');
|
|
8722
9149
|
if (!existsSync15(resolved)) {
|
|
8723
9150
|
mkdirSync5(resolved, { recursive: true });
|
|
8724
9151
|
created.push(".");
|
|
8725
9152
|
}
|
|
8726
|
-
const skaileDir =
|
|
9153
|
+
const skaileDir = path36__default.join(resolved, ".skaile");
|
|
8727
9154
|
if (!existsSync15(skaileDir)) {
|
|
8728
|
-
mkdirSync5(
|
|
9155
|
+
mkdirSync5(path36__default.join(skaileDir, "sessions"), { recursive: true });
|
|
8729
9156
|
created.push(".skaile/");
|
|
8730
9157
|
}
|
|
8731
|
-
const settingsPath =
|
|
9158
|
+
const settingsPath = path36__default.join(skaileDir, "settings.json");
|
|
8732
9159
|
if (!existsSync15(settingsPath)) {
|
|
8733
|
-
|
|
9160
|
+
writeFileSync6(settingsPath, "{}\n");
|
|
8734
9161
|
created.push(".skaile/settings.json");
|
|
8735
9162
|
}
|
|
8736
|
-
const wsConfigPath =
|
|
9163
|
+
const wsConfigPath = path36__default.join(resolved, "skaile.yaml");
|
|
8737
9164
|
if (!existsSync15(wsConfigPath)) {
|
|
8738
|
-
|
|
9165
|
+
writeFileSync6(wsConfigPath, stringify2(buildInitWorkspaceConfig(projectName, backend)));
|
|
8739
9166
|
created.push("skaile.yaml");
|
|
8740
9167
|
}
|
|
8741
9168
|
for (const dir of new Set(Object.values(DRIVER_TARGETS[backend].local))) {
|
|
8742
|
-
const full =
|
|
9169
|
+
const full = path36__default.join(resolved, dir);
|
|
8743
9170
|
if (!existsSync15(full)) {
|
|
8744
9171
|
mkdirSync5(full, { recursive: true });
|
|
8745
9172
|
created.push(`${dir}/`);
|
|
@@ -8771,32 +9198,34 @@ function buildInitWorkspaceConfig(projectName, backend) {
|
|
|
8771
9198
|
}
|
|
8772
9199
|
async function initGitScaffold(resolved, created) {
|
|
8773
9200
|
const { execSync: execSync3 } = await import('child_process');
|
|
8774
|
-
const { existsSync: existsSync15, readFileSync:
|
|
8775
|
-
const gitignorePath =
|
|
9201
|
+
const { existsSync: existsSync15, readFileSync: readFileSync10, writeFileSync: writeFileSync6 } = await import('fs');
|
|
9202
|
+
const gitignorePath = path36__default.join(resolved, ".gitignore");
|
|
8776
9203
|
const entries = [
|
|
8777
9204
|
"node_modules/",
|
|
8778
9205
|
".skaile/sessions/",
|
|
8779
9206
|
".skaile/cache/",
|
|
8780
9207
|
// skaile-created artifacts that must never be committed: the per-session log
|
|
8781
9208
|
// DB (SQLite incl. -shm/-wal, ends in .db — not caught by *.log), personal
|
|
8782
|
-
// settings (holds API keys),
|
|
9209
|
+
// settings (holds API keys), the workspace AI provider registry (endpoints
|
|
9210
|
+
// and credential references are per-machine), and the install history.
|
|
8783
9211
|
".skaile/logs.db*",
|
|
8784
9212
|
".skaile/settings.json",
|
|
9213
|
+
".skaile/providers.yml",
|
|
8785
9214
|
".skaile/history.yaml",
|
|
8786
9215
|
"*.log",
|
|
8787
9216
|
".env",
|
|
8788
9217
|
".env.local"
|
|
8789
9218
|
];
|
|
8790
|
-
const existing = existsSync15(gitignorePath) ?
|
|
9219
|
+
const existing = existsSync15(gitignorePath) ? readFileSync10(gitignorePath, "utf-8") : "";
|
|
8791
9220
|
const have = new Set(existing.split("\n").map((l) => l.trim()));
|
|
8792
9221
|
const append = entries.filter((e) => !have.has(e));
|
|
8793
9222
|
if (append.length > 0) {
|
|
8794
9223
|
const prefix = existing && !existing.endsWith("\n") ? "\n" : "";
|
|
8795
|
-
|
|
9224
|
+
writeFileSync6(gitignorePath, `${existing + prefix}${append.join("\n")}
|
|
8796
9225
|
`);
|
|
8797
9226
|
if (!existing) created.push(".gitignore");
|
|
8798
9227
|
}
|
|
8799
|
-
if (!existsSync15(
|
|
9228
|
+
if (!existsSync15(path36__default.join(resolved, ".git"))) {
|
|
8800
9229
|
try {
|
|
8801
9230
|
execSync3("git init", { cwd: resolved, stdio: "pipe" });
|
|
8802
9231
|
created.push(".git/");
|
|
@@ -8826,7 +9255,7 @@ async function bootstrapUserConfig() {
|
|
|
8826
9255
|
}
|
|
8827
9256
|
async function hydrateInitSources(resolved, created) {
|
|
8828
9257
|
try {
|
|
8829
|
-
const { ensureSourcesCloned } = await import('../ensure-sources-
|
|
9258
|
+
const { ensureSourcesCloned } = await import('../ensure-sources-QZAQ4SY2.js');
|
|
8830
9259
|
const hydrate = ensureSourcesCloned(resolved, { quiet: true });
|
|
8831
9260
|
for (const n of hydrate.cloned) created.push(`~/.skaile/cache/sources/${n}/`);
|
|
8832
9261
|
if (hydrate.failed.length > 0) {
|
|
@@ -8842,7 +9271,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
8842
9271
|
logOk(`Initialized project at ${S.heading(resolved)}`);
|
|
8843
9272
|
console.log();
|
|
8844
9273
|
console.log(S.heading(" Next steps:"));
|
|
8845
|
-
const isCurrentDir = resolved ===
|
|
9274
|
+
const isCurrentDir = resolved === path36__default.resolve(".");
|
|
8846
9275
|
let step = 1;
|
|
8847
9276
|
if (!isCurrentDir) {
|
|
8848
9277
|
console.log(` ${S.dim(`${step}.`)} ${S.cmd(`cd ${projectDir}`)}`);
|
|
@@ -8866,7 +9295,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
8866
9295
|
console.log();
|
|
8867
9296
|
}
|
|
8868
9297
|
program.command("setup").description("Interactive provider setup wizard").action(async () => {
|
|
8869
|
-
const { cmdSetup } = await import('../setup-
|
|
9298
|
+
const { cmdSetup } = await import('../setup-HLRSU3MR.js');
|
|
8870
9299
|
await cmdSetup([], { projectDir: process.cwd() });
|
|
8871
9300
|
});
|
|
8872
9301
|
program.addCommand(makeInstallCommand());
|
|
@@ -8874,6 +9303,8 @@ program.addCommand(makeCheckCommand());
|
|
|
8874
9303
|
program.addCommand(makeCleanCommand());
|
|
8875
9304
|
program.addCommand(makeCacheCommand());
|
|
8876
9305
|
program.addCommand(makeConfigCommand());
|
|
9306
|
+
program.addCommand(makeProvidersCommand());
|
|
9307
|
+
program.addCommand(makeMigrateCommand());
|
|
8877
9308
|
program.addCommand(makeAddCommand());
|
|
8878
9309
|
program.addCommand(makeRemoveCommand());
|
|
8879
9310
|
program.addCommand(makeListCommand());
|