@skaile/workspaces 5.1.3 → 5.3.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 +68 -0
- package/README.md +1 -1
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-C4X4RTZV.js → asset-feeds-VIZXYDAO.js} +13 -13
- package/dist/{asset-feeds-C4X4RTZV.js.map → asset-feeds-VIZXYDAO.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +10 -10
- package/dist/asset-manager/index.js +14 -14
- package/dist/asset-manager/installer.js +10 -10
- package/dist/asset-manager/src/index.d.ts +39 -4
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/asset-manager/src/installer.d.ts +2 -1
- package/dist/asset-manager/src/installer.d.ts.map +1 -1
- package/dist/bridge/drivers/claude-sdk.js +16 -15
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +13 -12
- package/dist/bridge/drivers/codex.js.map +1 -1
- package/dist/bridge/drivers/continue.js +13 -13
- package/dist/bridge/drivers/echo.js +3 -3
- package/dist/bridge/drivers/gemini.js +5 -5
- package/dist/bridge/drivers/goose.js +13 -13
- package/dist/bridge/drivers/omp.js +6 -5
- package/dist/bridge/drivers/omp.js.map +1 -1
- package/dist/bridge/drivers/opencode.js +13 -13
- package/dist/bridge/drivers/qwen.js +5 -5
- package/dist/bridge/index.js +15 -15
- package/dist/bridge/src/driver-capabilities.d.ts +66 -0
- package/dist/bridge/src/driver-capabilities.d.ts.map +1 -0
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/drivers/codex.d.ts.map +1 -1
- package/dist/bridge/src/drivers/omp.d.ts.map +1 -1
- package/dist/bridge/src/index.d.ts +1 -0
- package/dist/bridge/src/index.d.ts.map +1 -1
- package/dist/bridge/src/registry.d.ts.map +1 -1
- package/dist/{chunk-7SAWDPUT.js → chunk-37GBJLF5.js} +5 -55
- package/dist/chunk-37GBJLF5.js.map +1 -0
- package/dist/{chunk-SP47UJKE.js → chunk-3ZVSINEV.js} +247 -118
- package/dist/chunk-3ZVSINEV.js.map +1 -0
- package/dist/{chunk-ZVKJNNME.js → chunk-4257Q2LH.js} +8 -8
- package/dist/{chunk-ZVKJNNME.js.map → chunk-4257Q2LH.js.map} +1 -1
- package/dist/{chunk-YDJZRLGN.js → chunk-4SSKKFDF.js} +4 -4
- package/dist/{chunk-YDJZRLGN.js.map → chunk-4SSKKFDF.js.map} +1 -1
- package/dist/{chunk-K5GBV4SA.js → chunk-5BEFNLOR.js} +6 -5
- package/dist/chunk-5BEFNLOR.js.map +1 -0
- package/dist/{chunk-IWCCZL7C.js → chunk-6GBQND2F.js} +99 -36
- package/dist/chunk-6GBQND2F.js.map +1 -0
- package/dist/{chunk-QU4J5YSJ.js → chunk-7L4WFH3Y.js} +4 -4
- package/dist/{chunk-QU4J5YSJ.js.map → chunk-7L4WFH3Y.js.map} +1 -1
- package/dist/{chunk-O4U7OL6D.js → chunk-A223FDDC.js} +6 -6
- package/dist/{chunk-O4U7OL6D.js.map → chunk-A223FDDC.js.map} +1 -1
- package/dist/{chunk-AZYIEK3F.js → chunk-AWGQVAC5.js} +3 -3
- package/dist/{chunk-AZYIEK3F.js.map → chunk-AWGQVAC5.js.map} +1 -1
- package/dist/{chunk-RDYI4MML.js → chunk-BNUZEYC3.js} +3 -3
- package/dist/{chunk-RDYI4MML.js.map → chunk-BNUZEYC3.js.map} +1 -1
- package/dist/{chunk-RNNUYFFD.js → chunk-BUZ3K2PT.js} +3 -3
- package/dist/{chunk-RNNUYFFD.js.map → chunk-BUZ3K2PT.js.map} +1 -1
- package/dist/{chunk-WKIOWDLQ.js → chunk-CZ35I4RK.js} +4 -4
- package/dist/{chunk-WKIOWDLQ.js.map → chunk-CZ35I4RK.js.map} +1 -1
- package/dist/{chunk-KWP4RVTJ.js → chunk-D63AJVBW.js} +761 -643
- package/dist/chunk-D63AJVBW.js.map +1 -0
- package/dist/{chunk-BJZHNSQO.js → chunk-DECPI7DN.js} +5 -5
- package/dist/{chunk-BJZHNSQO.js.map → chunk-DECPI7DN.js.map} +1 -1
- package/dist/{chunk-KVAI5DGL.js → chunk-ERCSHLTF.js} +3 -3
- package/dist/{chunk-KVAI5DGL.js.map → chunk-ERCSHLTF.js.map} +1 -1
- package/dist/{chunk-ZD7CX25M.js → chunk-FTYM4VRZ.js} +56 -7
- package/dist/chunk-FTYM4VRZ.js.map +1 -0
- package/dist/{chunk-DLLM4U6C.js → chunk-FXN4PLRO.js} +3 -3
- package/dist/{chunk-DLLM4U6C.js.map → chunk-FXN4PLRO.js.map} +1 -1
- package/dist/{chunk-KNC55536.js → chunk-FZGL7Z52.js} +5 -4
- package/dist/chunk-FZGL7Z52.js.map +1 -0
- package/dist/{chunk-WCQMXBO5.js → chunk-GCYD4EGY.js} +4 -4
- package/dist/{chunk-WCQMXBO5.js.map → chunk-GCYD4EGY.js.map} +1 -1
- package/dist/{chunk-EB6OPURC.js → chunk-HTKZ4AOW.js} +3 -3
- package/dist/{chunk-EB6OPURC.js.map → chunk-HTKZ4AOW.js.map} +1 -1
- package/dist/{chunk-YV4J7V53.js → chunk-JAJG4G5E.js} +3 -3
- package/dist/{chunk-YV4J7V53.js.map → chunk-JAJG4G5E.js.map} +1 -1
- package/dist/{chunk-TYUJB336.js → chunk-JELTQ4H7.js} +3 -3
- package/dist/{chunk-TYUJB336.js.map → chunk-JELTQ4H7.js.map} +1 -1
- package/dist/{chunk-VDJKWKH2.js → chunk-JKWU6ULI.js} +3 -3
- package/dist/{chunk-VDJKWKH2.js.map → chunk-JKWU6ULI.js.map} +1 -1
- package/dist/{chunk-AGWYBS2E.js → chunk-K2JVODQD.js} +18 -6
- package/dist/chunk-K2JVODQD.js.map +1 -0
- package/dist/{chunk-IDEA6CYI.js → chunk-K2K7OF4P.js} +95 -3
- package/dist/chunk-K2K7OF4P.js.map +1 -0
- package/dist/{chunk-MXXKTQXJ.js → chunk-KBAE7PU7.js} +18 -33
- package/dist/chunk-KBAE7PU7.js.map +1 -0
- package/dist/{chunk-ARUJBGAH.js → chunk-KXTO7HON.js} +3 -3
- package/dist/{chunk-ARUJBGAH.js.map → chunk-KXTO7HON.js.map} +1 -1
- package/dist/{chunk-TVOODIZE.js → chunk-LAI7X6I2.js} +3 -3
- package/dist/{chunk-TVOODIZE.js.map → chunk-LAI7X6I2.js.map} +1 -1
- package/dist/{chunk-DXUQCMVT.js → chunk-LFMX2UEF.js} +3 -3
- package/dist/{chunk-DXUQCMVT.js.map → chunk-LFMX2UEF.js.map} +1 -1
- package/dist/{chunk-UMSWQKCY.js → chunk-LM5XEFNS.js} +3 -3
- package/dist/{chunk-UMSWQKCY.js.map → chunk-LM5XEFNS.js.map} +1 -1
- package/dist/{chunk-TLKM4M47.js → chunk-MFHKHXDE.js} +6 -3
- package/dist/chunk-MFHKHXDE.js.map +1 -0
- package/dist/{chunk-5S4ZK75K.js → chunk-OMD4TAJX.js} +3 -3
- package/dist/{chunk-5S4ZK75K.js.map → chunk-OMD4TAJX.js.map} +1 -1
- package/dist/{chunk-M4ISBWXR.js → chunk-OOKFZW6H.js} +2472 -2265
- package/dist/chunk-OOKFZW6H.js.map +1 -0
- package/dist/{chunk-WPWJRDR3.js → chunk-QHIMMBJO.js} +8 -7
- package/dist/chunk-QHIMMBJO.js.map +1 -0
- package/dist/{chunk-KC3OF6B2.js → chunk-QMWMSZQ4.js} +3 -3
- package/dist/{chunk-KC3OF6B2.js.map → chunk-QMWMSZQ4.js.map} +1 -1
- package/dist/{chunk-AG44ZJ7W.js → chunk-SR4RFKHM.js} +35 -13
- package/dist/chunk-SR4RFKHM.js.map +1 -0
- package/dist/{chunk-RNOIDD3Y.js → chunk-TR7KFBIO.js} +7 -7
- package/dist/chunk-TR7KFBIO.js.map +1 -0
- package/dist/{chunk-YMOZC2D3.js → chunk-TVFSA5IQ.js} +4 -4
- package/dist/{chunk-YMOZC2D3.js.map → chunk-TVFSA5IQ.js.map} +1 -1
- package/dist/{chunk-H4EGUQ7M.js → chunk-VKSA2CDJ.js} +7 -8
- package/dist/chunk-VKSA2CDJ.js.map +1 -0
- package/dist/{chunk-I75CM2QF.js → chunk-VLEWVR44.js} +14 -15
- package/dist/chunk-VLEWVR44.js.map +1 -0
- package/dist/{chunk-RO4Z2CBP.js → chunk-WGN7Z36G.js} +21 -4
- package/dist/chunk-WGN7Z36G.js.map +1 -0
- package/dist/{chunk-BEOKEK3B.js → chunk-WGNFDLHT.js} +135 -64
- package/dist/chunk-WGNFDLHT.js.map +1 -0
- package/dist/{chunk-43ZBF3WH.js → chunk-WX74MVNA.js} +16 -3
- package/dist/chunk-WX74MVNA.js.map +1 -0
- package/dist/{chunk-U6K3I3AX.js → chunk-XGIS325V.js} +3 -3
- package/dist/{chunk-U6K3I3AX.js.map → chunk-XGIS325V.js.map} +1 -1
- package/dist/{chunk-UVOJSWD2.js → chunk-Y7UBRRKG.js} +107 -135
- package/dist/chunk-Y7UBRRKG.js.map +1 -0
- package/dist/{chunk-Y6V6NUEV.js → chunk-YTJZQ4HY.js} +3 -3
- package/dist/{chunk-Y6V6NUEV.js.map → chunk-YTJZQ4HY.js.map} +1 -1
- package/dist/{chunk-IAGCOAIW.js → chunk-YXNYBUQY.js} +5 -5
- package/dist/{chunk-IAGCOAIW.js.map → chunk-YXNYBUQY.js.map} +1 -1
- package/dist/chunk-ZCSFGGLG.js +15 -0
- package/dist/{chunk-XUQBVK4R.js.map → chunk-ZCSFGGLG.js.map} +1 -1
- package/dist/{chunk-2HR3RPWD.js → chunk-ZDMGMWK6.js} +13 -11
- package/dist/chunk-ZDMGMWK6.js.map +1 -0
- package/dist/cli/index.js +696 -552
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/asset-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/catalog-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/config.d.ts.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/library-index.d.ts +43 -1
- package/dist/cli/src/commands/library-index.d.ts.map +1 -1
- package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
- package/dist/cli/src/commands/outdated.d.ts +3 -1
- package/dist/cli/src/commands/outdated.d.ts.map +1 -1
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/cli/src/commands/run.d.ts.map +1 -1
- package/dist/cli/src/commands/skailify-lib.d.ts +3 -47
- package/dist/cli/src/commands/skailify-lib.d.ts.map +1 -1
- package/dist/cli/src/commands/source.d.ts.map +1 -1
- package/dist/cli/src/commands/validate.d.ts.map +1 -1
- package/dist/cli/src/flow-discovery.d.ts +9 -0
- package/dist/cli/src/flow-discovery.d.ts.map +1 -1
- package/dist/cli/src/helpers.d.ts +13 -0
- package/dist/cli/src/helpers.d.ts.map +1 -1
- package/dist/cli/src/setup.d.ts.map +1 -1
- package/dist/connectors/config.js +6 -6
- package/dist/connectors/index.js +19 -19
- package/dist/connectors/src/connector-manager.d.ts +8 -27
- package/dist/connectors/src/connector-manager.d.ts.map +1 -1
- package/dist/connectors/src/index.d.ts +1 -1
- package/dist/connectors/src/index.d.ts.map +1 -1
- package/dist/connectors/src/mount-ledger.d.ts +61 -0
- package/dist/connectors/src/mount-ledger.d.ts.map +1 -0
- package/dist/{connectors-BQXFKISC.js → connectors-Z2FUGAJU.js} +22 -22
- package/dist/{connectors-BQXFKISC.js.map → connectors-Z2FUGAJU.js.map} +1 -1
- package/dist/connectors-shared/index.js +2 -2
- package/dist/core/framework.js +1 -1
- package/dist/core/index.js +9 -9
- package/dist/core/manifest.js +2 -2
- package/dist/core/models.js +1 -1
- package/dist/core/publish-manifest.js +2 -2
- package/dist/core/ref.js +1 -1
- package/dist/core/runtime-assets.js +6 -6
- package/dist/core/src/asset-roots.d.ts +8 -0
- package/dist/core/src/asset-roots.d.ts.map +1 -1
- package/dist/core/src/cache-paths.d.ts +6 -0
- package/dist/core/src/cache-paths.d.ts.map +1 -1
- package/dist/core/src/framework.d.ts +7 -0
- package/dist/core/src/framework.d.ts.map +1 -1
- package/dist/core/src/index.d.ts +6 -6
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/lock.d.ts +12 -0
- package/dist/core/src/lock.d.ts.map +1 -1
- package/dist/core/src/manifest-yaml-editor.d.ts +14 -6
- package/dist/core/src/manifest-yaml-editor.d.ts.map +1 -1
- package/dist/core/src/models.d.ts +22 -0
- package/dist/core/src/models.d.ts.map +1 -1
- package/dist/core/src/publish-manifest.d.ts +28 -6
- package/dist/core/src/publish-manifest.d.ts.map +1 -1
- package/dist/core/src/settings.d.ts.map +1 -1
- package/dist/core/src/walker.d.ts.map +1 -1
- package/dist/core/store.js +2 -2
- package/dist/core/workspace-config.js +5 -5
- package/dist/deploy/index.js +9 -9
- package/dist/discovery/index.js +4 -4
- package/dist/discovery/src/discover-manifest.d.ts +5 -0
- package/dist/discovery/src/discover-manifest.d.ts.map +1 -1
- package/dist/discovery/src/discover.d.ts.map +1 -1
- package/dist/discovery/src/hash.d.ts +45 -23
- package/dist/discovery/src/hash.d.ts.map +1 -1
- package/dist/discovery/src/index.d.ts +3 -1
- package/dist/discovery/src/index.d.ts.map +1 -1
- package/dist/discovery/src/parse-manifest.d.ts +27 -0
- package/dist/discovery/src/parse-manifest.d.ts.map +1 -0
- package/dist/discovery/src/tree-entries.d.ts.map +1 -1
- package/dist/{ensure-sources-CMHOTYFS.js → ensure-sources-3IH5XHAP.js} +17 -17
- package/dist/{ensure-sources-CMHOTYFS.js.map → ensure-sources-3IH5XHAP.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +19 -19
- package/dist/factory-assets/connectors/deploy.js +19 -19
- package/dist/factory-assets/connectors/devserver.js +19 -19
- package/dist/factory-assets/connectors/flow/adapter.d.ts +28 -4
- package/dist/factory-assets/connectors/flow/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/adapter.js +19 -19
- package/dist/factory-assets/connectors/flow/engine.js +10 -10
- 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.js +21 -21
- package/dist/factory-assets/connectors/flow.js +19 -19
- package/dist/factory-assets/connectors/git/checkout.d.ts +161 -0
- package/dist/factory-assets/connectors/git/checkout.d.ts.map +1 -0
- package/dist/factory-assets/connectors/git/config.d.ts +78 -0
- package/dist/factory-assets/connectors/git/config.d.ts.map +1 -0
- package/dist/factory-assets/connectors/git/credentials.d.ts +93 -0
- package/dist/factory-assets/connectors/git/credentials.d.ts.map +1 -0
- package/dist/factory-assets/connectors/git/driver.d.ts +39 -598
- package/dist/factory-assets/connectors/git/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/git/exec.d.ts +177 -0
- package/dist/factory-assets/connectors/git/exec.d.ts.map +1 -0
- package/dist/factory-assets/connectors/git/inspect.d.ts +120 -0
- package/dist/factory-assets/connectors/git/inspect.d.ts.map +1 -0
- package/dist/factory-assets/connectors/git/lifecycle.d.ts +107 -0
- package/dist/factory-assets/connectors/git/lifecycle.d.ts.map +1 -0
- package/dist/factory-assets/connectors/git/repo.d.ts +496 -0
- package/dist/factory-assets/connectors/git/repo.d.ts.map +1 -0
- package/dist/factory-assets/connectors/git.js +19 -19
- package/dist/factory-assets/connectors/gmail.js +19 -19
- package/dist/factory-assets/connectors/googledrive.js +19 -19
- package/dist/factory-assets/connectors/local.js +19 -19
- package/dist/factory-assets/connectors/mattermost.js +19 -19
- package/dist/factory-assets/connectors/memory.js +19 -19
- package/dist/factory-assets/connectors/minio.js +19 -19
- package/dist/factory-assets/connectors/postgres.js +19 -19
- package/dist/factory-assets/connectors/s3.js +19 -19
- package/dist/factory-assets/connectors/sharepoint.js +19 -19
- package/dist/factory-assets/connectors/sqlite.js +19 -19
- package/dist/factory-assets/connectors/static-server.js +19 -19
- package/dist/factory-assets/connectors/tunnel.js +19 -19
- package/dist/factory-assets/connectors/webdav.js +19 -19
- package/dist/factory-assets/connectors/xstate-store.js +19 -19
- package/dist/factory-assets/connectors/xstate.js +19 -19
- package/dist/flows-64OAOYLP.js +26 -0
- package/dist/{flows-SVCCADGE.js.map → flows-64OAOYLP.js.map} +1 -1
- package/dist/{helpers-R3GLTAER.js → helpers-HV5Y57CY.js} +17 -17
- package/dist/{helpers-R3GLTAER.js.map → helpers-HV5Y57CY.js.map} +1 -1
- package/dist/library/index.js +12 -12
- package/dist/library/install.js +3 -2
- package/dist/library/src/config.d.ts +5 -4
- package/dist/library/src/config.d.ts.map +1 -1
- package/dist/library/src/index.d.ts +6 -3
- package/dist/library/src/index.d.ts.map +1 -1
- package/dist/library/src/install/install-from-manifest.d.ts +21 -0
- package/dist/library/src/install/install-from-manifest.d.ts.map +1 -1
- package/dist/library/src/local/install-library-asset.d.ts +64 -0
- package/dist/library/src/local/install-library-asset.d.ts.map +1 -0
- package/dist/library/src/local/library.d.ts.map +1 -1
- package/dist/library/src/local/local-catalog-source.d.ts +30 -0
- package/dist/library/src/local/local-catalog-source.d.ts.map +1 -1
- package/dist/library/src/local/store-paths.d.ts +6 -0
- package/dist/library/src/local/store-paths.d.ts.map +1 -1
- package/dist/library/src/manifest-writer.d.ts +79 -0
- package/dist/library/src/manifest-writer.d.ts.map +1 -0
- package/dist/library/src/sync/git-driver.d.ts +8 -0
- package/dist/library/src/sync/git-driver.d.ts.map +1 -1
- package/dist/library/src/sync/manifest-writeback.d.ts +2 -17
- package/dist/library/src/sync/manifest-writeback.d.ts.map +1 -1
- package/dist/{library-publish-EL7VYICU.js → library-publish-TVS3WQ4C.js} +27 -25
- package/dist/library-publish-TVS3WQ4C.js.map +1 -0
- package/dist/{open-library-MTD34YX3.js → open-library-AT6RYQ5M.js} +20 -20
- package/dist/{open-library-MTD34YX3.js.map → open-library-AT6RYQ5M.js.map} +1 -1
- package/dist/open-registry-F2Z4OLXJ.js +32 -0
- package/dist/{open-registry-CHCWKV5W.js.map → open-registry-F2Z4OLXJ.js.map} +1 -1
- package/dist/paths-P7ZXMDCX.js +22 -0
- package/dist/{paths-MKSI52PF.js.map → paths-P7ZXMDCX.js.map} +1 -1
- package/dist/plugin-registry/src/targets.d.ts +3 -1
- package/dist/plugin-registry/src/targets.d.ts.map +1 -1
- package/dist/{plugin-store-SVYV7L4C.js → plugin-store-27KGLW4S.js} +11 -11
- package/dist/{plugin-store-SVYV7L4C.js.map → plugin-store-27KGLW4S.js.map} +1 -1
- package/dist/{project-HCNWJP7J.js → project-J2EROMBW.js} +18 -18
- package/dist/{project-HCNWJP7J.js.map → project-J2EROMBW.js.map} +1 -1
- package/dist/resolver/index.js +10 -10
- package/dist/runner/index.js +29 -29
- package/dist/runner/src/agent.d.ts +1 -1
- 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/compaction-gate.d.ts +9 -33
- package/dist/runner/src/compaction-gate.d.ts.map +1 -1
- package/dist/runner/src/managed-codex-bootstrap.d.ts.map +1 -1
- package/dist/runner/src/pending-turns.d.ts +7 -2
- package/dist/runner/src/pending-turns.d.ts.map +1 -1
- package/dist/runner/src/resources.d.ts +2 -2
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/serve-credentials.d.ts +2 -1
- package/dist/runner/src/serve-credentials.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts +19 -35
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/runner/src/turn-scheduler.d.ts +158 -0
- package/dist/runner/src/turn-scheduler.d.ts.map +1 -0
- package/dist/sdk/asset-manager.js +14 -14
- package/dist/sdk/bridge.js +15 -15
- package/dist/sdk/core.js +9 -9
- package/dist/sdk/flow.js +10 -10
- package/dist/sdk/index.js +29 -29
- package/dist/sdk/resolver.js +10 -10
- package/dist/sdk/runner.js +29 -29
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/types.js +1 -1
- package/dist/secrets/index.js +2 -2
- package/dist/session/index.js +2 -2
- package/dist/session/src/dispatcher.d.ts.map +1 -1
- package/dist/{setup-HTXNR2CZ.js → setup-IFGA4NQA.js} +25 -25
- package/dist/setup-IFGA4NQA.js.map +1 -0
- package/dist/skills-3T55L4YT.js +26 -0
- package/dist/{skills-7K2YO3KN.js.map → skills-3T55L4YT.js.map} +1 -1
- package/dist/{source-UIFC2PFC.js → source-HEAE43IL.js} +21 -21
- package/dist/{source-UIFC2PFC.js.map → source-HEAE43IL.js.map} +1 -1
- package/dist/{source-manifest-publish-QKAKXDVH.js → source-manifest-publish-SCAHAYSQ.js} +23 -23
- package/dist/{source-manifest-publish-QKAKXDVH.js.map → source-manifest-publish-SCAHAYSQ.js.map} +1 -1
- package/dist/tui/index.js +30 -30
- package/dist/tui/index.js.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/src/delivery.d.ts +26 -0
- package/dist/types/src/delivery.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/runtime.d.ts +51 -0
- package/dist/types/src/runtime.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +26 -26
- package/dist/workspace-plugin/adapters/omp.js +18 -17
- package/dist/workspace-plugin/adapters/omp.js.map +1 -1
- package/dist/workspace-plugin/index.js +2 -1
- package/dist/workspace-plugin/src/adapters/mcp.d.ts.map +1 -1
- package/dist/workspace-plugin/src/adapters/omp.d.ts.map +1 -1
- package/dist/workspace-plugin/src/plugin.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-2HR3RPWD.js.map +0 -1
- package/dist/chunk-43ZBF3WH.js.map +0 -1
- package/dist/chunk-7SAWDPUT.js.map +0 -1
- package/dist/chunk-AG44ZJ7W.js.map +0 -1
- package/dist/chunk-AGWYBS2E.js.map +0 -1
- package/dist/chunk-BEOKEK3B.js.map +0 -1
- package/dist/chunk-F7JHP7JV.js +0 -122
- package/dist/chunk-F7JHP7JV.js.map +0 -1
- package/dist/chunk-H4EGUQ7M.js.map +0 -1
- package/dist/chunk-I75CM2QF.js.map +0 -1
- package/dist/chunk-IDEA6CYI.js.map +0 -1
- package/dist/chunk-IWCCZL7C.js.map +0 -1
- package/dist/chunk-K5GBV4SA.js.map +0 -1
- package/dist/chunk-KNC55536.js.map +0 -1
- package/dist/chunk-KWP4RVTJ.js.map +0 -1
- package/dist/chunk-M4ISBWXR.js.map +0 -1
- package/dist/chunk-MXXKTQXJ.js.map +0 -1
- package/dist/chunk-RNOIDD3Y.js.map +0 -1
- package/dist/chunk-RO4Z2CBP.js.map +0 -1
- package/dist/chunk-SP47UJKE.js.map +0 -1
- package/dist/chunk-TLKM4M47.js.map +0 -1
- package/dist/chunk-UVOJSWD2.js.map +0 -1
- package/dist/chunk-WPWJRDR3.js.map +0 -1
- package/dist/chunk-XUQBVK4R.js +0 -15
- package/dist/chunk-ZD7CX25M.js.map +0 -1
- package/dist/flows-SVCCADGE.js +0 -26
- package/dist/library-publish-EL7VYICU.js.map +0 -1
- package/dist/open-registry-CHCWKV5W.js +0 -32
- package/dist/paths-MKSI52PF.js +0 -22
- package/dist/runner/src/flow-turn-dispatch.d.ts +0 -41
- package/dist/runner/src/flow-turn-dispatch.d.ts.map +0 -1
- package/dist/runner/src/reply-routing.d.ts +0 -54
- package/dist/runner/src/reply-routing.d.ts.map +0 -1
- package/dist/setup-HTXNR2CZ.js.map +0 -1
- package/dist/skills-7K2YO3KN.js +0 -26
package/dist/cli/index.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { makeProvidersCommand, loadRegistryView, addProviderEntry, ProviderRegistryWriteError } from '../chunk-
|
|
3
|
-
import { makeSourceCommand, syncProjectSources } from '../chunk-
|
|
4
|
-
import { AI_RESOURCES } from '../chunk-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import '../chunk-
|
|
15
|
-
import '../chunk-RNNUYFFD.js';
|
|
2
|
+
import { makeProvidersCommand, loadRegistryView, addProviderEntry, ProviderRegistryWriteError } from '../chunk-DECPI7DN.js';
|
|
3
|
+
import { makeSourceCommand, syncProjectSources } from '../chunk-VLEWVR44.js';
|
|
4
|
+
import { AI_RESOURCES } from '../chunk-TVFSA5IQ.js';
|
|
5
|
+
import { getStoreConfig, storeFetch, deviceLogin, loadStoreAuthConfig, logout, hasStoredAuth, isStoreAuthenticated, getStoreToken, getStoreIdentity, assetEntryRef, refFor } from '../chunk-YXNYBUQY.js';
|
|
6
|
+
import { makeInstallCommand, makeCheckCommand, makeCleanCommand, reportInstalledSoftDeps } from '../chunk-ZDMGMWK6.js';
|
|
7
|
+
import { openCatalogSource, openLibraryManager, openLibrary } from '../chunk-TR7KFBIO.js';
|
|
8
|
+
import { logErr, S, logOk, logInfo, logWarn, TARGET_DEFAULT_HINT, warnLegacyClaudeCopies, kindColorPad, kindColor, colorRef, formatSoftDepSection, bareSoftDepName, formatSoftDepHint, formatRelativeTime, formatSoftDepRemovePreview, formatSoftDepAddPreview, fitWidth, KIND_COL_WIDTH } from '../chunk-WGN7Z36G.js';
|
|
9
|
+
import { createFullRegistry } from '../chunk-ZCSFGGLG.js';
|
|
10
|
+
import { LocalSecretsProvider } from '../chunk-HTKZ4AOW.js';
|
|
11
|
+
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-D63AJVBW.js';
|
|
12
|
+
import { buildClaudePluginFiles } from '../chunk-FZGL7Z52.js';
|
|
13
|
+
import '../chunk-QHIMMBJO.js';
|
|
14
|
+
import '../chunk-BUZ3K2PT.js';
|
|
16
15
|
import '../chunk-R6O6YWU7.js';
|
|
17
|
-
import '../chunk-
|
|
18
|
-
import '../chunk-
|
|
16
|
+
import '../chunk-GCYD4EGY.js';
|
|
17
|
+
import '../chunk-JELTQ4H7.js';
|
|
19
18
|
import '../chunk-4ZTPYIBE.js';
|
|
20
|
-
import '../chunk-
|
|
19
|
+
import '../chunk-YTJZQ4HY.js';
|
|
21
20
|
import '../chunk-X5YPJV4N.js';
|
|
22
21
|
import '../chunk-O7SG5PC2.js';
|
|
23
22
|
import '../chunk-7QBNJTTQ.js';
|
|
@@ -26,53 +25,53 @@ import '../chunk-5LKOAX7I.js';
|
|
|
26
25
|
import '../chunk-32NA4TVC.js';
|
|
27
26
|
import '../chunk-W3UDISS2.js';
|
|
28
27
|
import '../chunk-HCYS7GFP.js';
|
|
29
|
-
import { runFlow, resumeFlow } from '../chunk-
|
|
28
|
+
import { runFlow, resumeFlow } from '../chunk-4257Q2LH.js';
|
|
30
29
|
import '../chunk-4R6DROGN.js';
|
|
31
|
-
import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-
|
|
32
|
-
import '../chunk-
|
|
30
|
+
import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-JAJG4G5E.js';
|
|
31
|
+
import '../chunk-JKWU6ULI.js';
|
|
33
32
|
import '../chunk-CT6NQSA4.js';
|
|
34
|
-
import '../chunk-
|
|
35
|
-
import '../chunk-
|
|
36
|
-
import '../chunk-
|
|
37
|
-
import '../chunk-
|
|
38
|
-
import '../chunk-
|
|
33
|
+
import '../chunk-OOKFZW6H.js';
|
|
34
|
+
import '../chunk-QMWMSZQ4.js';
|
|
35
|
+
import '../chunk-CZ35I4RK.js';
|
|
36
|
+
import '../chunk-7L4WFH3Y.js';
|
|
37
|
+
import '../chunk-LAI7X6I2.js';
|
|
39
38
|
import '../chunk-EINLFFP6.js';
|
|
40
39
|
import '../chunk-LOO5CB5M.js';
|
|
41
|
-
import '../chunk-
|
|
42
|
-
import '../chunk-
|
|
40
|
+
import '../chunk-BNUZEYC3.js';
|
|
41
|
+
import '../chunk-ERCSHLTF.js';
|
|
43
42
|
import '../chunk-XBSQ4KMC.js';
|
|
44
43
|
import '../chunk-YROR332M.js';
|
|
45
|
-
import { getProviderPreset, AI_PROVIDER_PRESETS } from '../chunk-
|
|
44
|
+
import { getProviderPreset, AI_PROVIDER_PRESETS } from '../chunk-FTYM4VRZ.js';
|
|
46
45
|
import '../chunk-6E6PKKAD.js';
|
|
47
46
|
import '../chunk-IFGTRL2I.js';
|
|
48
|
-
import { projectAiAssetsRoots, loadFlow, loadAllFlowEntries, findFlowFileInRoots } from '../chunk-
|
|
47
|
+
import { projectAiAssetsRoots, loadFlow, loadAllFlowEntries, findFlowFileInRoots } from '../chunk-LM5XEFNS.js';
|
|
49
48
|
import '../chunk-37FTLYFP.js';
|
|
50
49
|
import '../chunk-QZLWJETK.js';
|
|
51
50
|
import '../chunk-XUUYAS3Z.js';
|
|
52
51
|
import { nodeLabel, nodeSkillAsset, nodeIsInert, nodeIsOptional, nodeRunKind, flowSkillVersionPins } from '../chunk-NFGRW3L7.js';
|
|
53
52
|
import '../chunk-QCI6D7E4.js';
|
|
54
|
-
import '../chunk-
|
|
55
|
-
import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, parseRefTolerant, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-
|
|
56
|
-
import { cloneOrInitGitRepo, ensureGitRepo, isGitRepo, getStoreManifestsDir, getDefaultValue, isSecretPlaceholder } from '../chunk-
|
|
57
|
-
import '../chunk-
|
|
58
|
-
import '../chunk-
|
|
53
|
+
import '../chunk-K2K7OF4P.js';
|
|
54
|
+
import { AssetManager, NON_DEPLOYABLE_KINDS, MissingManifestError, parseRefTolerant, normalizeRepoUrl, FACTORY_SOURCE_URL } from '../chunk-WGNFDLHT.js';
|
|
55
|
+
import { cloneOrInitGitRepo, ensureGitRepo, setManifestPublisher, syncManifestWithDisk, isGitRepo, assertManifestEditable, installLibraryAsset, missingRootAssets, stampManifestPublisher, upsertManifestAsset, getStoreManifestsDir, getDefaultValue, isSecretPlaceholder } from '../chunk-3ZVSINEV.js';
|
|
56
|
+
import { parseManifestFile } from '../chunk-Y7UBRRKG.js';
|
|
57
|
+
import '../chunk-VKSA2CDJ.js';
|
|
59
58
|
import '../chunk-R7FOF242.js';
|
|
60
59
|
import '../chunk-ZDKJHQY2.js';
|
|
61
|
-
import '../chunk-
|
|
60
|
+
import '../chunk-K2JVODQD.js';
|
|
62
61
|
import '../chunk-CGYEHQOX.js';
|
|
63
|
-
import { resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, WorkspaceYamlEditor, resolveLibraryDir, checkAgentSkillConformance, readLock, workspaceProviderRegistryPath, userProviderRegistryPath, loadProviderRegistryFile, aiResourceRoots } from '../chunk-
|
|
62
|
+
import { resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, WorkspaceYamlEditor, resolveLibraryDir, checkAgentSkillConformance, globalInstallDir, GLOBAL_INSTALL_DIR_NAME, readLock, workspaceProviderRegistryPath, userProviderRegistryPath, loadProviderRegistryFile, aiResourceRoots } from '../chunk-6GBQND2F.js';
|
|
64
63
|
import '../chunk-4GY63JU6.js';
|
|
65
|
-
import { factoryAssetRoots } from '../chunk-
|
|
66
|
-
import '../chunk-
|
|
67
|
-
import { DRIVER_DEFAULTS } from '../chunk-
|
|
64
|
+
import { factoryAssetRoots } from '../chunk-4SSKKFDF.js';
|
|
65
|
+
import '../chunk-XGIS325V.js';
|
|
66
|
+
import { DEFAULT_DRIVER_ID, DRIVER_DEFAULTS } from '../chunk-5BEFNLOR.js';
|
|
68
67
|
import { findKindDirs } from '../chunk-A2ULN3KX.js';
|
|
69
|
-
import { sourceCacheKey, getGlobalCacheDir, resolveAgentDir, AgentRefResolutionError, matchPin, coerceVersion, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug, isWorkspaceConfigFilename } from '../chunk-
|
|
70
|
-
import { globalCacheRoot, globalSkaileDir } from '../chunk-
|
|
68
|
+
import { sourceCacheKey, getGlobalCacheDir, resolveAgentDir, AgentRefResolutionError, matchPin, coerceVersion, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug, isWorkspaceConfigFilename } from '../chunk-KBAE7PU7.js';
|
|
69
|
+
import { globalCacheRoot, globalSkaileDir, userConfigPath } from '../chunk-MFHKHXDE.js';
|
|
71
70
|
import { SUPPORTED_DRIVER_TARGETS } from '../chunk-TOSHZX4C.js';
|
|
72
|
-
import { loadSkPublishManifest, SKAILE_MANIFEST_FILENAME, decodeSkaileManifest
|
|
71
|
+
import { loadSkPublishManifest, SKAILE_MANIFEST_FILENAME, decodeSkaileManifest } from '../chunk-SR4RFKHM.js';
|
|
73
72
|
import { pluginTitle } from '../chunk-RVRB27AN.js';
|
|
74
|
-
import { parseFrontmatter, scanDirectory } from '../chunk-
|
|
75
|
-
import { parseAssetRef, ASSET_KINDS, isValidAssetName, slugifyAssetName, ASSET_NAME_HINT, assetRefToStr } from '../chunk-
|
|
73
|
+
import { parseFrontmatter, scanDirectory } from '../chunk-LFMX2UEF.js';
|
|
74
|
+
import { parseAssetRef, ASSET_KINDS, isValidAssetName, slugifyAssetName, ASSET_NAME_HINT, assetRefToStr } from '../chunk-WX74MVNA.js';
|
|
76
75
|
import { portableSpawn, portableSpawnSync } from '../chunk-ICSCSM5D.js';
|
|
77
76
|
import { openSqlite } from '../chunk-JMKB7IB4.js';
|
|
78
77
|
import { parseModelRef, resolveEntryBaseUrl } from '../chunk-MJHSLODD.js';
|
|
@@ -83,21 +82,22 @@ import '../chunk-UQ6LFBPZ.js';
|
|
|
83
82
|
import '../chunk-TNWXGHLD.js';
|
|
84
83
|
import { validatePreset, SKILL_BODY_PLACEHOLDER } from '../chunk-5CYEWBPB.js';
|
|
85
84
|
import '../chunk-NSBPE2FW.js';
|
|
86
|
-
import * as
|
|
87
|
-
import
|
|
88
|
-
import * as
|
|
89
|
-
import
|
|
85
|
+
import * as fs12 from 'fs';
|
|
86
|
+
import fs12__default, { readFileSync, existsSync, mkdirSync, writeFileSync, lstatSync, rmSync, readdirSync, statSync } from 'fs';
|
|
87
|
+
import * as path36 from 'path';
|
|
88
|
+
import path36__default, { resolve, join } from 'path';
|
|
90
89
|
import { fileURLToPath } from 'url';
|
|
91
90
|
import { Help, Command, Option } from 'commander';
|
|
92
91
|
import { rcompare } from 'semver';
|
|
93
92
|
import * as p5 from '@clack/prompts';
|
|
94
93
|
import pc5 from 'picocolors';
|
|
94
|
+
import { parse, stringify, parseDocument } from 'yaml';
|
|
95
|
+
import * as os from 'os';
|
|
95
96
|
import * as readline from 'readline';
|
|
96
97
|
import { createInterface } from 'readline';
|
|
97
|
-
import
|
|
98
|
+
import fs6 from 'fs/promises';
|
|
98
99
|
import { parse as parse$1, stringify as stringify$1 } from 'smol-toml';
|
|
99
100
|
import { execSync, spawnSync } from 'child_process';
|
|
100
|
-
import { parse, stringify, parseDocument } from 'yaml';
|
|
101
101
|
import * as readline2 from 'readline/promises';
|
|
102
102
|
import { createTRPCUntypedClient, httpLink, httpSubscriptionLink } from '@trpc/client';
|
|
103
103
|
|
|
@@ -135,7 +135,7 @@ async function runSearch(kind, query, opts) {
|
|
|
135
135
|
const showLocal = !opts.store;
|
|
136
136
|
const showStore = !opts.local;
|
|
137
137
|
const { resolveConfig } = await import('../library/index.js');
|
|
138
|
-
const airGapped = resolveConfig({ projectDir:
|
|
138
|
+
const airGapped = resolveConfig({ projectDir: path36__default.resolve(opts.projectDir) }).catalog.cache_ttl === 0;
|
|
139
139
|
if (showLocal) {
|
|
140
140
|
await searchLocal(query, kind, opts, showStore, airGapped);
|
|
141
141
|
}
|
|
@@ -144,7 +144,7 @@ async function runSearch(kind, query, opts) {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
async function searchIndex(query, kind) {
|
|
147
|
-
const { openLibrary: openLibrary2 } = await import('../open-library-
|
|
147
|
+
const { openLibrary: openLibrary2 } = await import('../open-library-AT6RYQ5M.js');
|
|
148
148
|
const library = await openLibrary2();
|
|
149
149
|
try {
|
|
150
150
|
const defs = await library.listAssetDefs(kind ? { kind } : {});
|
|
@@ -176,7 +176,7 @@ async function searchIndex(query, kind) {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
async function searchFactory(projectDir, query, kind) {
|
|
179
|
-
const prefixes = factoryAssetRoots().map((r) => r.endsWith(
|
|
179
|
+
const prefixes = factoryAssetRoots().map((r) => r.endsWith(path36__default.sep) ? r : r + path36__default.sep);
|
|
180
180
|
const isFactoryPath = (p7) => prefixes.some((fp) => p7 === fp.slice(0, -1) || p7.startsWith(fp));
|
|
181
181
|
try {
|
|
182
182
|
const entries = await new AssetManager({ projectDir }).search(query, kind);
|
|
@@ -193,11 +193,11 @@ function unionEntries(indexed, factory) {
|
|
|
193
193
|
return [...indexed, ...factory.filter((e) => !seen.has(entryDedupKey(e)))];
|
|
194
194
|
}
|
|
195
195
|
async function searchLocal(query, kind, opts, showStore, airGapped) {
|
|
196
|
-
const projectDir =
|
|
196
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
197
197
|
const factory = await searchFactory(projectDir, query, kind);
|
|
198
198
|
let entries = unionEntries(await searchIndex(query, kind), factory);
|
|
199
199
|
if (entries.length === 0 && !query && !kind && !airGapped) {
|
|
200
|
-
const { autoSyncForSearch } = await import('../source-
|
|
200
|
+
const { autoSyncForSearch } = await import('../source-HEAE43IL.js');
|
|
201
201
|
if (await autoSyncForSearch(projectDir)) {
|
|
202
202
|
entries = unionEntries(await searchIndex(query, kind), factory);
|
|
203
203
|
}
|
|
@@ -267,9 +267,9 @@ async function searchStore(query, kind, opts, airGapped) {
|
|
|
267
267
|
logInfo("air-gapped (cache_ttl: 0) \u2014 local sources only");
|
|
268
268
|
return;
|
|
269
269
|
}
|
|
270
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-
|
|
270
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-AT6RYQ5M.js');
|
|
271
271
|
try {
|
|
272
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
272
|
+
const remote = await openCatalogSource2({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
273
273
|
const assets = await remote.listAssets(kind ? { kind } : {});
|
|
274
274
|
const results = filterCatalogAssets(assets, query);
|
|
275
275
|
if (results.length > 0) {
|
|
@@ -385,7 +385,7 @@ function makeAddCommand() {
|
|
|
385
385
|
}
|
|
386
386
|
const harnesses = parseHarnessFilter(opts.harness);
|
|
387
387
|
const am2 = new AssetManager({
|
|
388
|
-
projectDir:
|
|
388
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
389
389
|
global: opts.global || harnesses !== void 0,
|
|
390
390
|
harnesses,
|
|
391
391
|
driverTarget: opts.target
|
|
@@ -429,7 +429,7 @@ function makeRemoveCommand() {
|
|
|
429
429
|
).option("--target <agent>", `Driver target (${TARGET_DEFAULT_HINT})`).option("--no-soft-deps", "skip the orphaned-soft-dep prompt (don't remove, don't report)").action(async (ref, opts) => {
|
|
430
430
|
const harnesses = parseHarnessFilter(opts.harness);
|
|
431
431
|
const am2 = new AssetManager({
|
|
432
|
-
projectDir:
|
|
432
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
433
433
|
global: opts.global || harnesses !== void 0,
|
|
434
434
|
harnesses,
|
|
435
435
|
driverTarget: opts.target
|
|
@@ -471,7 +471,7 @@ function makeListCommand() {
|
|
|
471
471
|
return;
|
|
472
472
|
}
|
|
473
473
|
const am2 = new AssetManager({
|
|
474
|
-
projectDir:
|
|
474
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
475
475
|
driverTarget: opts.target
|
|
476
476
|
});
|
|
477
477
|
let declared;
|
|
@@ -489,6 +489,7 @@ function makeListCommand() {
|
|
|
489
489
|
}
|
|
490
490
|
if (declared.length === 0) {
|
|
491
491
|
logInfo("No dependencies declared in skaile.yaml.");
|
|
492
|
+
warnLegacyClaudeCopies(am2);
|
|
492
493
|
return;
|
|
493
494
|
}
|
|
494
495
|
const kindW = Math.max(4, ...declared.map((e) => e.kind.length));
|
|
@@ -511,12 +512,13 @@ function makeListCommand() {
|
|
|
511
512
|
const invalid = declared.filter((e) => e.state === "invalid").length;
|
|
512
513
|
if (invalid > 0)
|
|
513
514
|
logInfo(`${invalid} invalid \u2014 fix the ${S.cmd("skaile.yaml")} dependencies entry.`);
|
|
515
|
+
warnLegacyClaudeCopies(am2);
|
|
514
516
|
console.log();
|
|
515
517
|
});
|
|
516
518
|
}
|
|
517
519
|
function runGlobalList(kind, opts, harnesses) {
|
|
518
520
|
const am2 = new AssetManager({
|
|
519
|
-
projectDir:
|
|
521
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
520
522
|
global: true,
|
|
521
523
|
harnesses
|
|
522
524
|
});
|
|
@@ -587,7 +589,7 @@ async function resolveInfoEntry(am2, ref, opts) {
|
|
|
587
589
|
return { entry: match ?? deployed };
|
|
588
590
|
}
|
|
589
591
|
const lookup = opts.storeLookup ?? (async (filter) => {
|
|
590
|
-
const { resolveCatalogSource } = await import('../open-library-
|
|
592
|
+
const { resolveCatalogSource } = await import('../open-library-AT6RYQ5M.js');
|
|
591
593
|
const { source, close } = await resolveCatalogSource({ projectDir: opts.projectDir });
|
|
592
594
|
try {
|
|
593
595
|
return await source.listAssets(filter);
|
|
@@ -603,7 +605,7 @@ async function resolveInfoEntry(am2, ref, opts) {
|
|
|
603
605
|
);
|
|
604
606
|
return { entry: hit ? catalogAssetToEntry(hit) : null };
|
|
605
607
|
} catch (err) {
|
|
606
|
-
const { LocalCatalogDisabledError } = await import('../open-library-
|
|
608
|
+
const { LocalCatalogDisabledError } = await import('../open-library-AT6RYQ5M.js');
|
|
607
609
|
const storeNote = err instanceof Error ? err.message : String(err);
|
|
608
610
|
const disabled = err instanceof LocalCatalogDisabledError || /catalog\.url/i.test(storeNote);
|
|
609
611
|
return { entry: null, storeNote, ...disabled ? { storeDisabled: true } : {} };
|
|
@@ -614,12 +616,12 @@ function infoNotFoundHint(ref, lookup) {
|
|
|
614
616
|
if (!lookup.storeNote)
|
|
615
617
|
return `'${ref}' not found in local sources, deployed assets, or the store. ${sync}, or ${S.cmd("skaile search --store")} to browse the store.`;
|
|
616
618
|
if (lookup.storeDisabled)
|
|
617
|
-
return `'${ref}' not found in local sources or deployed assets, and the remote store is disabled (${lookup.storeNote}). ${sync}, or set ${S.cmd("catalog.url")} in
|
|
619
|
+
return `'${ref}' not found in local sources or deployed assets, and the remote store is disabled (${lookup.storeNote}). ${sync}, or set ${S.cmd("catalog.url")} in ${userConfigPath()} to query the store.`;
|
|
618
620
|
return `'${ref}' not found locally and the store could not be queried (${lookup.storeNote}). ${sync}, or retry when the store is reachable.`;
|
|
619
621
|
}
|
|
620
622
|
function makeInfoCommand() {
|
|
621
623
|
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) => {
|
|
622
|
-
const projectDir =
|
|
624
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
623
625
|
const am2 = new AssetManager({ projectDir });
|
|
624
626
|
const lookup = await resolveInfoEntry(am2, ref, { projectDir });
|
|
625
627
|
const entry = lookup.entry;
|
|
@@ -655,7 +657,7 @@ function makeCreateCommand() {
|
|
|
655
657
|
new Option("-k, --kind <kind>", "Asset kind").default("skill").choices([...ASSET_KINDS])
|
|
656
658
|
).option("-d, --dir <dir>", "Target directory (default: cwd)").action((name, opts) => {
|
|
657
659
|
const am2 = new AssetManager({ projectDir: process.cwd() });
|
|
658
|
-
const destDir = opts.dir ?
|
|
660
|
+
const destDir = opts.dir ? path36__default.resolve(opts.dir) : process.cwd();
|
|
659
661
|
const result = am2.create(name, opts.kind, destDir);
|
|
660
662
|
if (result.ok) logOk(`Created ${kindColor(opts.kind)}: ${pc5.dim(result.path)}`);
|
|
661
663
|
else {
|
|
@@ -666,7 +668,7 @@ function makeCreateCommand() {
|
|
|
666
668
|
}
|
|
667
669
|
function makeDoctorCommand() {
|
|
668
670
|
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) => {
|
|
669
|
-
const am2 = new AssetManager({ projectDir:
|
|
671
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
670
672
|
const issues = await am2.doctor();
|
|
671
673
|
if (issues.length === 0) {
|
|
672
674
|
logOk("No missing dependencies.");
|
|
@@ -688,6 +690,164 @@ function makeDoctorCommand() {
|
|
|
688
690
|
console.log();
|
|
689
691
|
});
|
|
690
692
|
}
|
|
693
|
+
async function indexLibrary(lib, index) {
|
|
694
|
+
const { LocalCatalogSource } = await import('../library/index.js');
|
|
695
|
+
const own = index ?? await openLibrary();
|
|
696
|
+
try {
|
|
697
|
+
const source = new LocalCatalogSource(own, lib.id, lib.path, createFullRegistry());
|
|
698
|
+
const res = await source.sync();
|
|
699
|
+
return {
|
|
700
|
+
assetsFound: res.assetsFound,
|
|
701
|
+
assetsUpdated: res.assetsUpdated,
|
|
702
|
+
errors: res.errors
|
|
703
|
+
};
|
|
704
|
+
} finally {
|
|
705
|
+
if (!index) own.close();
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
function resolveLibraryPublisherDetailed(lib, opts, storeIdentity) {
|
|
709
|
+
const bare = (p7) => p7.startsWith("@") ? p7.slice(1) : p7;
|
|
710
|
+
if (opts.publisher?.trim()) return { publisher: bare(opts.publisher.trim()), source: "flag" };
|
|
711
|
+
const declared = loadSkPublishManifest(lib.path)?.publisher?.trim();
|
|
712
|
+
if (declared) return { publisher: bare(declared), source: "manifest" };
|
|
713
|
+
const identity = (storeIdentity?.githubLogin ?? storeIdentity?.username)?.trim();
|
|
714
|
+
if (identity) return { publisher: identity, source: "identity" };
|
|
715
|
+
try {
|
|
716
|
+
return { publisher: slugifyAssetName(lib.name), source: "library-name" };
|
|
717
|
+
} catch {
|
|
718
|
+
return { publisher: "library", source: "library-name" };
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
function resolveLibraryPublisher(lib, opts, storeIdentity) {
|
|
722
|
+
return resolveLibraryPublisherDetailed(lib, opts, storeIdentity).publisher;
|
|
723
|
+
}
|
|
724
|
+
function stampAssetPublisher(assetDir, publisher) {
|
|
725
|
+
const markers = ["SKILL.md", "AGENT.md", "CONTRACT.md"];
|
|
726
|
+
let markerFile;
|
|
727
|
+
for (const m of markers) {
|
|
728
|
+
if (fs12.existsSync(path36.join(assetDir, m))) {
|
|
729
|
+
markerFile = path36.join(assetDir, m);
|
|
730
|
+
break;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
if (!markerFile) {
|
|
734
|
+
const promptMd = fs12.readdirSync(assetDir).find((f) => f.endsWith(".prompt.md"));
|
|
735
|
+
if (promptMd) markerFile = path36.join(assetDir, promptMd);
|
|
736
|
+
}
|
|
737
|
+
if (!markerFile) return;
|
|
738
|
+
try {
|
|
739
|
+
const { data, body } = parseFrontmatter(fs12.readFileSync(markerFile, "utf8"));
|
|
740
|
+
const meta = data.metadata && typeof data.metadata === "object" && !Array.isArray(data.metadata) ? { ...data.metadata } : {};
|
|
741
|
+
if (meta.publisher != null) return;
|
|
742
|
+
meta.publisher = publisher;
|
|
743
|
+
data.metadata = meta;
|
|
744
|
+
const fm = stringify(data).trimEnd();
|
|
745
|
+
fs12.writeFileSync(markerFile, `---
|
|
746
|
+
${fm}
|
|
747
|
+
---
|
|
748
|
+
|
|
749
|
+
${body}
|
|
750
|
+
`, "utf8");
|
|
751
|
+
} catch {
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
async function registerLibraryAsset(lib, index, input) {
|
|
755
|
+
const { publisher, source } = resolveLibraryPublisherDetailed(
|
|
756
|
+
lib,
|
|
757
|
+
{ publisher: input.publisher },
|
|
758
|
+
getStoreIdentity()
|
|
759
|
+
);
|
|
760
|
+
if (source === "library-name") {
|
|
761
|
+
logWarn(
|
|
762
|
+
`No publisher given and not signed in \u2014 using the library name "${publisher}" as the publisher. Pass --publisher <name> or run \`skaile store login\`; change it later with \`skaile library set ${lib.name} publisher=<name>\`.`
|
|
763
|
+
);
|
|
764
|
+
}
|
|
765
|
+
stampAssetPublisher(input.assetDir, publisher);
|
|
766
|
+
stampManifestPublisher(lib.path, publisher);
|
|
767
|
+
upsertManifestAsset(lib.path, {
|
|
768
|
+
kind: input.kind,
|
|
769
|
+
name: input.name,
|
|
770
|
+
root: path36.relative(lib.path, input.assetDir) || input.name,
|
|
771
|
+
version: input.version,
|
|
772
|
+
publisher
|
|
773
|
+
});
|
|
774
|
+
const idx = await indexLibrary(lib, index);
|
|
775
|
+
for (const e of idx.errors) logWarn(e);
|
|
776
|
+
return { publisher, ref: refFor(input.kind, publisher, input.name, input.version) };
|
|
777
|
+
}
|
|
778
|
+
var DEFAULT_IMPORT_VERSION = "0.1.0";
|
|
779
|
+
var DEFAULT_IMPORT_STAGE = "alpha";
|
|
780
|
+
function claudeSkillRoots() {
|
|
781
|
+
const roots = [];
|
|
782
|
+
const override = process.env.SKAILE_CLAUDE_SKILLS_DIR;
|
|
783
|
+
if (override) roots.push(override);
|
|
784
|
+
roots.push(path36.join(os.homedir(), ".claude", "skills"));
|
|
785
|
+
return roots;
|
|
786
|
+
}
|
|
787
|
+
function resolveImportSource(nameOrPath) {
|
|
788
|
+
const asPath = path36.resolve(nameOrPath);
|
|
789
|
+
if (fs12.existsSync(asPath)) {
|
|
790
|
+
const dir = fs12.statSync(asPath).isDirectory() ? asPath : path36.dirname(asPath);
|
|
791
|
+
const skillFile = path36.join(dir, "SKILL.md");
|
|
792
|
+
if (fs12.existsSync(skillFile)) return { dir, skillFile, via: "path" };
|
|
793
|
+
}
|
|
794
|
+
if (!nameOrPath.includes(path36.sep) && !nameOrPath.startsWith(".")) {
|
|
795
|
+
for (const root of claudeSkillRoots()) {
|
|
796
|
+
const dir = path36.join(root, nameOrPath);
|
|
797
|
+
const skillFile = path36.join(dir, "SKILL.md");
|
|
798
|
+
if (fs12.existsSync(skillFile)) return { dir, skillFile, via: "claude-skills" };
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
return null;
|
|
802
|
+
}
|
|
803
|
+
function normalizeSkillContent(raw, opts = {}) {
|
|
804
|
+
const notes = [];
|
|
805
|
+
const { data, body } = parseFrontmatter(raw);
|
|
806
|
+
const rawName = typeof data.name === "string" && data.name.trim() ? data.name.trim() : void 0;
|
|
807
|
+
const sourceName = rawName ?? opts.fallbackName ?? "";
|
|
808
|
+
let name = sourceName;
|
|
809
|
+
let originalName;
|
|
810
|
+
if (!sourceName) {
|
|
811
|
+
throw new Error("skill has no `name` in frontmatter and no fallback was provided");
|
|
812
|
+
}
|
|
813
|
+
if (!isValidAssetName(sourceName)) {
|
|
814
|
+
name = slugifyAssetName(sourceName);
|
|
815
|
+
originalName = sourceName;
|
|
816
|
+
notes.push(`renamed "${sourceName}" \u2192 "${name}" (canonical kebab-case)`);
|
|
817
|
+
}
|
|
818
|
+
const existingMeta = data.metadata && typeof data.metadata === "object" && !Array.isArray(data.metadata) ? { ...data.metadata } : {};
|
|
819
|
+
if (existingMeta.version == null) {
|
|
820
|
+
existingMeta.version = opts.version ?? DEFAULT_IMPORT_VERSION;
|
|
821
|
+
notes.push(`stamped metadata.version: ${existingMeta.version}`);
|
|
822
|
+
}
|
|
823
|
+
if (existingMeta.stage == null) {
|
|
824
|
+
existingMeta.stage = opts.stage ?? DEFAULT_IMPORT_STAGE;
|
|
825
|
+
notes.push(`stamped metadata.stage: ${existingMeta.stage}`);
|
|
826
|
+
}
|
|
827
|
+
if (existingMeta.tags == null) {
|
|
828
|
+
const keywords = Array.isArray(data.keywords) ? data.keywords.filter((k) => typeof k === "string") : [];
|
|
829
|
+
if (keywords.length > 0) {
|
|
830
|
+
existingMeta.tags = keywords;
|
|
831
|
+
notes.push("promoted top-level keywords \u2192 metadata.tags");
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
const ordered = { name };
|
|
835
|
+
if (data.description != null) ordered.description = data.description;
|
|
836
|
+
ordered.metadata = existingMeta;
|
|
837
|
+
for (const [k, v] of Object.entries(data)) {
|
|
838
|
+
if (k === "name" || k === "description" || k === "metadata" || k === "keywords") continue;
|
|
839
|
+
ordered[k] = v;
|
|
840
|
+
}
|
|
841
|
+
const fm = stringify(ordered).trimEnd();
|
|
842
|
+
const content = `---
|
|
843
|
+
${fm}
|
|
844
|
+
---
|
|
845
|
+
|
|
846
|
+
${body}
|
|
847
|
+
`;
|
|
848
|
+
const changed = notes.length > 0;
|
|
849
|
+
return { content, name, originalName, changed, notes };
|
|
850
|
+
}
|
|
691
851
|
|
|
692
852
|
// cli/src/commands/asset-cmd.ts
|
|
693
853
|
async function resolveDefByRef(library, ref, opts) {
|
|
@@ -714,7 +874,10 @@ function withCanonicalRef(def) {
|
|
|
714
874
|
}
|
|
715
875
|
function makeAssetCommand() {
|
|
716
876
|
const cmd = new Command("asset").description("Author and install AI assets");
|
|
717
|
-
cmd.command("import <name-or-path>").description("Import + skailify an existing coding-agent skill into a library").option("--to <library>", "Target library (default: auto / personal)").option("--version <semver>", "Version to stamp when the skill ships none").option("--stage <stage>", "Lifecycle stage to stamp (default: alpha)").option("--no-normalize", "Copy verbatim \u2014 skip frontmatter normalization").option(
|
|
877
|
+
cmd.command("import <name-or-path>").description("Import + skailify an existing coding-agent skill into a library").option("--to <library>", "Target library (default: auto / personal)").option("--version <semver>", "Version to stamp when the skill ships none").option("--stage <stage>", "Lifecycle stage to stamp (default: alpha)").option("--no-normalize", "Copy verbatim \u2014 skip frontmatter normalization").option(
|
|
878
|
+
"--publisher <name>",
|
|
879
|
+
"Publisher for the imported skill (default: the library's, else your store login)"
|
|
880
|
+
).option("--commit", "Auto-commit in git-backed libraries", false).action(
|
|
718
881
|
async (nameOrPath, opts) => {
|
|
719
882
|
const src = resolveImportSource(nameOrPath);
|
|
720
883
|
if (!src) {
|
|
@@ -724,7 +887,7 @@ function makeAssetCommand() {
|
|
|
724
887
|
process.exit(1);
|
|
725
888
|
}
|
|
726
889
|
logInfo(`Source: ${S.dim(src.dir)} (${src.via})`);
|
|
727
|
-
const { manager, close } = await openLibraryManager();
|
|
890
|
+
const { manager, library, close } = await openLibraryManager();
|
|
728
891
|
try {
|
|
729
892
|
let target;
|
|
730
893
|
if (opts.to) {
|
|
@@ -738,40 +901,43 @@ function makeAssetCommand() {
|
|
|
738
901
|
logErr(`Library "${target.name}" is read-only (ownership=reader). Choose --to.`);
|
|
739
902
|
process.exit(1);
|
|
740
903
|
}
|
|
741
|
-
|
|
904
|
+
try {
|
|
905
|
+
assertManifestEditable(target.path);
|
|
906
|
+
} catch (err) {
|
|
907
|
+
logErr(err instanceof Error ? err.message : String(err));
|
|
908
|
+
process.exit(1);
|
|
909
|
+
}
|
|
910
|
+
const rawSkill = fs12.readFileSync(src.skillFile, "utf8");
|
|
742
911
|
const norm = opts.normalize ? normalizeSkillContent(rawSkill, {
|
|
743
|
-
fallbackName:
|
|
912
|
+
fallbackName: path36.basename(src.dir),
|
|
744
913
|
version: opts.version,
|
|
745
914
|
stage: opts.stage
|
|
746
|
-
}) : { content: rawSkill, name:
|
|
915
|
+
}) : { content: rawSkill, name: path36.basename(src.dir), changed: false, notes: [] };
|
|
747
916
|
if (!opts.normalize && !isValidAssetName(norm.name)) {
|
|
748
917
|
logWarn(
|
|
749
918
|
`Name "${norm.name}" is not canonical (kebab-case); \`skaile validate\` will reject this manifest entry. Drop --no-normalize to slugify it.`
|
|
750
919
|
);
|
|
751
920
|
}
|
|
752
|
-
const destDir =
|
|
753
|
-
if (
|
|
921
|
+
const destDir = path36.join(target.path, norm.name);
|
|
922
|
+
if (fs12.existsSync(destDir)) {
|
|
754
923
|
logErr(`Destination already exists: ${destDir}`);
|
|
755
924
|
process.exit(1);
|
|
756
925
|
}
|
|
757
|
-
|
|
758
|
-
|
|
926
|
+
fs12.cpSync(src.dir, destDir, { recursive: true });
|
|
927
|
+
fs12.writeFileSync(path36.join(destDir, "SKILL.md"), norm.content, "utf8");
|
|
759
928
|
for (const note of norm.notes) logInfo(` \u2022 ${note}`);
|
|
760
929
|
const fm = parseFrontmatter(norm.content).data;
|
|
761
|
-
const descRaw = fm.description;
|
|
762
|
-
const description = typeof descRaw === "string" ? descRaw.trim() : void 0;
|
|
763
930
|
for (const f of checkAgentSkillConformance(fm, { dirName: norm.name })) {
|
|
764
931
|
logWarn(`conformance: ${f.field} \u2014 ${f.message}`);
|
|
765
932
|
}
|
|
766
|
-
const
|
|
767
|
-
const
|
|
933
|
+
const fmVersion = fm.metadata?.version;
|
|
934
|
+
const { ref } = await registerLibraryAsset(target, library, {
|
|
768
935
|
kind: "skill",
|
|
769
936
|
name: norm.name,
|
|
770
|
-
|
|
771
|
-
version: opts.version,
|
|
772
|
-
|
|
937
|
+
assetDir: destDir,
|
|
938
|
+
version: fmVersion != null ? String(fmVersion) : opts.version ?? DEFAULT_IMPORT_VERSION,
|
|
939
|
+
publisher: opts.publisher
|
|
773
940
|
});
|
|
774
|
-
logOk(`${up.added ? "Added" : "Updated"} manifest entry skill:${norm.name}`);
|
|
775
941
|
if (target.backend === "git" && opts.commit) {
|
|
776
942
|
const { spawnSync: spawnSync2 } = await import('child_process');
|
|
777
943
|
spawnSync2("git", ["add", "--", destDir], { cwd: target.path, stdio: "inherit" });
|
|
@@ -783,7 +949,8 @@ function makeAssetCommand() {
|
|
|
783
949
|
logWarn("Nothing committed (working tree clean or commit aborted).");
|
|
784
950
|
}
|
|
785
951
|
}
|
|
786
|
-
logOk(`Imported ${S.cmd(
|
|
952
|
+
logOk(`Imported ${S.cmd(ref)} \u2192 ${target.name}`);
|
|
953
|
+
logInfo(`Indexed \u2014 add it with ${S.cmd(`skaile add ${ref}`)}`);
|
|
787
954
|
logInfo(`Verify: ${S.cmd(`skaile validate ${target.path}`)}`);
|
|
788
955
|
} finally {
|
|
789
956
|
close();
|
|
@@ -796,7 +963,7 @@ function makeAssetCommand() {
|
|
|
796
963
|
logErr(`Invalid --mode "${opts.mode}". Expected: copy | move | link.`);
|
|
797
964
|
process.exit(1);
|
|
798
965
|
}
|
|
799
|
-
if (!
|
|
966
|
+
if (!fs12.existsSync(srcPath)) {
|
|
800
967
|
logErr(`Source path does not exist: ${srcPath}`);
|
|
801
968
|
process.exit(1);
|
|
802
969
|
}
|
|
@@ -821,23 +988,23 @@ function makeAssetCommand() {
|
|
|
821
988
|
);
|
|
822
989
|
process.exit(1);
|
|
823
990
|
}
|
|
824
|
-
const basename2 =
|
|
991
|
+
const basename2 = path36.basename(srcPath);
|
|
825
992
|
const destDir = target.path;
|
|
826
|
-
|
|
827
|
-
const destPath =
|
|
828
|
-
if (
|
|
993
|
+
fs12.mkdirSync(destDir, { recursive: true });
|
|
994
|
+
const destPath = path36.join(destDir, basename2);
|
|
995
|
+
if (fs12.existsSync(destPath)) {
|
|
829
996
|
logErr(`Destination already exists: ${destPath}`);
|
|
830
997
|
process.exit(1);
|
|
831
998
|
}
|
|
832
999
|
switch (opts.mode) {
|
|
833
1000
|
case "copy":
|
|
834
|
-
|
|
1001
|
+
fs12.cpSync(srcPath, destPath, { recursive: true });
|
|
835
1002
|
break;
|
|
836
1003
|
case "move":
|
|
837
|
-
|
|
1004
|
+
fs12.renameSync(srcPath, destPath);
|
|
838
1005
|
break;
|
|
839
1006
|
case "link":
|
|
840
|
-
|
|
1007
|
+
fs12.symlinkSync(path36.resolve(srcPath), destPath);
|
|
841
1008
|
break;
|
|
842
1009
|
}
|
|
843
1010
|
if (target.backend === "git" && opts.commit) {
|
|
@@ -886,27 +1053,25 @@ function makeAssetCommand() {
|
|
|
886
1053
|
logErr(`No asset found for ref "${ref}". Try \`skaile search\`.`);
|
|
887
1054
|
process.exit(1);
|
|
888
1055
|
}
|
|
889
|
-
const target = opts.target ?? process.cwd();
|
|
890
1056
|
const lib = def.libraryId ? (await manager.listLibraries()).find((l) => l.id === def.libraryId) : void 0;
|
|
891
1057
|
if (!lib) {
|
|
892
1058
|
logErr(`Asset has no associated library; install path unknown.`);
|
|
893
1059
|
process.exit(1);
|
|
894
1060
|
}
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
1061
|
+
let installed;
|
|
1062
|
+
try {
|
|
1063
|
+
installed = installLibraryAsset({
|
|
1064
|
+
def,
|
|
1065
|
+
library: lib,
|
|
1066
|
+
targetDir: opts.target ?? process.cwd(),
|
|
1067
|
+
mode: opts.mode,
|
|
1068
|
+
registry: createFullRegistry()
|
|
1069
|
+
});
|
|
1070
|
+
} catch (err) {
|
|
1071
|
+
logErr(err instanceof Error ? err.message : String(err));
|
|
900
1072
|
process.exit(1);
|
|
901
1073
|
}
|
|
902
|
-
|
|
903
|
-
fs10.mkdirSync(path34.dirname(destPath), { recursive: true });
|
|
904
|
-
if (opts.mode === "copy") {
|
|
905
|
-
fs10.cpSync(srcPath, destPath, { recursive: true });
|
|
906
|
-
} else {
|
|
907
|
-
fs10.symlinkSync(path34.resolve(srcPath), destPath);
|
|
908
|
-
}
|
|
909
|
-
logOk(`Installed ${catalogAssetRef(def)} \u2192 ${destPath} (${opts.mode})`);
|
|
1074
|
+
logOk(`Installed ${catalogAssetRef(def)} \u2192 ${installed.installPath} (${opts.mode})`);
|
|
910
1075
|
} finally {
|
|
911
1076
|
close();
|
|
912
1077
|
}
|
|
@@ -969,14 +1134,14 @@ function makeAuthCommand() {
|
|
|
969
1134
|
}
|
|
970
1135
|
function collectCacheTargets(scope) {
|
|
971
1136
|
const out = [];
|
|
972
|
-
out.push(
|
|
973
|
-
out.push(
|
|
974
|
-
out.push(
|
|
1137
|
+
out.push(path36__default.join(scope.projectDir, ".skaile", "cache"));
|
|
1138
|
+
out.push(path36__default.join(scope.projectDir, ".skaile", "store-cache"));
|
|
1139
|
+
out.push(path36__default.join(scope.projectDir, ".skaile", "repos"));
|
|
975
1140
|
if (scope.global) {
|
|
976
1141
|
out.push(globalCacheRoot());
|
|
977
1142
|
const home = globalSkaileDir();
|
|
978
|
-
out.push(
|
|
979
|
-
out.push(
|
|
1143
|
+
out.push(path36__default.join(home, "repos"));
|
|
1144
|
+
out.push(path36__default.join(home, "catalog-cache"));
|
|
980
1145
|
}
|
|
981
1146
|
return out;
|
|
982
1147
|
}
|
|
@@ -990,7 +1155,7 @@ function dirSize(target) {
|
|
|
990
1155
|
function dirSizeOfDir(dir) {
|
|
991
1156
|
let total = 0;
|
|
992
1157
|
for (const ent of readdirSync(dir, { withFileTypes: true })) {
|
|
993
|
-
const child =
|
|
1158
|
+
const child = path36__default.join(dir, ent.name);
|
|
994
1159
|
if (ent.isSymbolicLink()) continue;
|
|
995
1160
|
if (ent.isDirectory()) total += dirSizeOfDir(child);
|
|
996
1161
|
else if (ent.isFile()) total += statSync(child).size;
|
|
@@ -1016,7 +1181,7 @@ function makeCacheCommand() {
|
|
|
1016
1181
|
const cmd = new Command("cache").description("Inspect and reclaim the re-derivable cache");
|
|
1017
1182
|
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) => {
|
|
1018
1183
|
const targets = collectCacheTargets({
|
|
1019
|
-
projectDir:
|
|
1184
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
1020
1185
|
global: opts.global
|
|
1021
1186
|
}).filter((t) => existsSync(t));
|
|
1022
1187
|
if (targets.length === 0) {
|
|
@@ -1046,12 +1211,12 @@ function makeCacheCommand() {
|
|
|
1046
1211
|
for (const r of removed) logOk(`Removed ${r}`);
|
|
1047
1212
|
});
|
|
1048
1213
|
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) => {
|
|
1049
|
-
console.log(
|
|
1214
|
+
console.log(path36__default.join(path36__default.resolve(opts.projectDir), ".skaile", "cache"));
|
|
1050
1215
|
if (opts.global) console.log(globalCacheRoot());
|
|
1051
1216
|
});
|
|
1052
1217
|
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) => {
|
|
1053
1218
|
const targets = collectCacheTargets({
|
|
1054
|
-
projectDir:
|
|
1219
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
1055
1220
|
global: opts.global
|
|
1056
1221
|
});
|
|
1057
1222
|
console.log();
|
|
@@ -1067,7 +1232,7 @@ function makeCatalogCommand() {
|
|
|
1067
1232
|
const catalog = new Command("catalog").description("Catalog source health and configuration");
|
|
1068
1233
|
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) => {
|
|
1069
1234
|
const { resolveConfig, isLocalCatalogUrl, trpcGetUrl } = await import('../library/index.js');
|
|
1070
|
-
const projectDir = opts.projectDir ?
|
|
1235
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : void 0;
|
|
1071
1236
|
const cfg = resolveConfig({ projectDir });
|
|
1072
1237
|
const baseUrl = opts.url ?? cfg.catalog.url;
|
|
1073
1238
|
if (isLocalCatalogUrl(baseUrl)) {
|
|
@@ -1085,7 +1250,7 @@ function makeCatalogCommand() {
|
|
|
1085
1250
|
});
|
|
1086
1251
|
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) => {
|
|
1087
1252
|
const { resolveConfig } = await import('../library/index.js');
|
|
1088
|
-
const projectDir = opts.projectDir ?
|
|
1253
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : void 0;
|
|
1089
1254
|
const cfg = resolveConfig({ projectDir });
|
|
1090
1255
|
console.log(`url: ${cfg.catalog.url}`);
|
|
1091
1256
|
console.log(`framing: ${cfg.catalog.framing}`);
|
|
@@ -1094,7 +1259,7 @@ function makeCatalogCommand() {
|
|
|
1094
1259
|
return catalog;
|
|
1095
1260
|
}
|
|
1096
1261
|
async function runLocalCatalogTest(projectDir) {
|
|
1097
|
-
const { resolveCatalogSource } = await import('../open-library-
|
|
1262
|
+
const { resolveCatalogSource } = await import('../open-library-AT6RYQ5M.js');
|
|
1098
1263
|
let resolved;
|
|
1099
1264
|
try {
|
|
1100
1265
|
resolved = await resolveCatalogSource({ projectDir });
|
|
@@ -1136,11 +1301,11 @@ async function runRemoteCatalogProbe(baseUrl, probeUrl) {
|
|
|
1136
1301
|
logErr(`${probeUrl} responded ${res.status} ${res.statusText} (${ms}ms)`);
|
|
1137
1302
|
if (res.status === 404) {
|
|
1138
1303
|
logInfo(
|
|
1139
|
-
|
|
1304
|
+
`Got 404 from catalog.listKinds. Check the URL prefix in ${userConfigPath()} \u2014 Skaile mirrors must expose \`/trpc/catalog.*\` at the configured baseUrl.`
|
|
1140
1305
|
);
|
|
1141
1306
|
} else {
|
|
1142
1307
|
logInfo(
|
|
1143
|
-
|
|
1308
|
+
`Verify the URL in ${userConfigPath()} and any auth requirements on private mirrors.`
|
|
1144
1309
|
);
|
|
1145
1310
|
}
|
|
1146
1311
|
process.exitCode = 1;
|
|
@@ -1164,7 +1329,7 @@ async function runRemoteCatalogProbe(baseUrl, probeUrl) {
|
|
|
1164
1329
|
} else {
|
|
1165
1330
|
logErr(`Could not reach ${probeUrl}: ${err instanceof Error ? err.message : String(err)}`);
|
|
1166
1331
|
}
|
|
1167
|
-
logInfo(
|
|
1332
|
+
logInfo(`Verify the URL in ${userConfigPath()} and that the catalog backend is deployed.`);
|
|
1168
1333
|
process.exitCode = 1;
|
|
1169
1334
|
} finally {
|
|
1170
1335
|
clearTimeout(timeout);
|
|
@@ -1226,15 +1391,20 @@ function discoverFlows(projectDir) {
|
|
|
1226
1391
|
function findFlowFile(flowId, priorityRoots = [], projectDir) {
|
|
1227
1392
|
return findFlowFileInRoots(flowId, [...priorityRoots, ...aiResourceRoots(projectDir)]);
|
|
1228
1393
|
}
|
|
1229
|
-
|
|
1394
|
+
var libraryFlowEntriesCache;
|
|
1395
|
+
function libraryFlowEntries() {
|
|
1396
|
+
libraryFlowEntriesCache ??= scanLibraryFlowEntries();
|
|
1397
|
+
return libraryFlowEntriesCache;
|
|
1398
|
+
}
|
|
1399
|
+
async function scanLibraryFlowEntries() {
|
|
1230
1400
|
const entries = [];
|
|
1231
1401
|
try {
|
|
1232
1402
|
const { LocalCatalogSource, LocalIndex, resolveIndexPath } = await import('../library/index.js');
|
|
1233
1403
|
const indexPath = resolveIndexPath();
|
|
1234
1404
|
if (!existsSync(indexPath)) return entries;
|
|
1235
1405
|
const [{ authoringLibraries }, { createFullRegistry: createFullRegistry2 }] = await Promise.all([
|
|
1236
|
-
import('../open-library-
|
|
1237
|
-
import('../open-registry-
|
|
1406
|
+
import('../open-library-AT6RYQ5M.js'),
|
|
1407
|
+
import('../open-registry-F2Z4OLXJ.js')
|
|
1238
1408
|
]);
|
|
1239
1409
|
const index = new LocalIndex({ indexPath });
|
|
1240
1410
|
try {
|
|
@@ -1291,11 +1461,11 @@ function findSkills() {
|
|
|
1291
1461
|
return deduped;
|
|
1292
1462
|
}
|
|
1293
1463
|
function walkSkills(dir, out) {
|
|
1294
|
-
for (const entry of
|
|
1295
|
-
const full =
|
|
1464
|
+
for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
|
|
1465
|
+
const full = path36__default.join(dir, entry.name);
|
|
1296
1466
|
if (entry.isDirectory()) {
|
|
1297
|
-
const skillMd =
|
|
1298
|
-
if (
|
|
1467
|
+
const skillMd = path36__default.join(full, "SKILL.md");
|
|
1468
|
+
if (fs12__default.existsSync(skillMd)) {
|
|
1299
1469
|
out.push({ name: entry.name, path: full, skillPath: skillMd });
|
|
1300
1470
|
} else {
|
|
1301
1471
|
walkSkills(full, out);
|
|
@@ -1316,10 +1486,10 @@ function resolveFlowIds() {
|
|
|
1316
1486
|
}
|
|
1317
1487
|
}
|
|
1318
1488
|
function resolveSessionIds(projectDir) {
|
|
1319
|
-
const sessionsDir =
|
|
1320
|
-
if (!
|
|
1489
|
+
const sessionsDir = path36__default.join(projectDir, ".skaile", "sessions");
|
|
1490
|
+
if (!fs12__default.existsSync(sessionsDir)) return [];
|
|
1321
1491
|
try {
|
|
1322
|
-
return
|
|
1492
|
+
return fs12__default.readdirSync(sessionsDir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length));
|
|
1323
1493
|
} catch {
|
|
1324
1494
|
return [];
|
|
1325
1495
|
}
|
|
@@ -1447,8 +1617,8 @@ function printModelSelectionSection(config, projectDir) {
|
|
|
1447
1617
|
}
|
|
1448
1618
|
}
|
|
1449
1619
|
function printResolvedPathsSection(config) {
|
|
1450
|
-
const fw = config.driver ??
|
|
1451
|
-
const paths = DRIVER_DEFAULTS[fw] ?? DRIVER_DEFAULTS
|
|
1620
|
+
const fw = config.driver ?? DEFAULT_DRIVER_ID;
|
|
1621
|
+
const paths = DRIVER_DEFAULTS[fw] ?? DRIVER_DEFAULTS[DEFAULT_DRIVER_ID];
|
|
1452
1622
|
if (!paths) return;
|
|
1453
1623
|
console.log();
|
|
1454
1624
|
console.log(` ${S.heading("Resolved Paths")} ${S.dim(`(${fw})`)}`);
|
|
@@ -1458,7 +1628,7 @@ function printResolvedPathsSection(config) {
|
|
|
1458
1628
|
console.log(` ${S.label("prompts:".padEnd(16))} ${config.promptsDir ?? paths.promptsDir}`);
|
|
1459
1629
|
}
|
|
1460
1630
|
async function showConfig(opts) {
|
|
1461
|
-
const projectDir = opts.projectDir ?
|
|
1631
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
|
|
1462
1632
|
let config;
|
|
1463
1633
|
let wsDefaults;
|
|
1464
1634
|
try {
|
|
@@ -1503,13 +1673,13 @@ function makeConfigCommand() {
|
|
|
1503
1673
|
const cmd = new Command("config").description("Manage personal config (.skaile/settings.json)");
|
|
1504
1674
|
cmd.command("show").description("Show effective config with sources").option("--project-dir <path>", "Project directory").action((opts) => showConfig(opts));
|
|
1505
1675
|
cmd.command("get <key>").description("Get an effective config value").option("--project-dir <path>", "Project directory").action(async (key, opts) => {
|
|
1506
|
-
const projectDir = opts.projectDir ?
|
|
1676
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
|
|
1507
1677
|
const config = await resolveSettings(projectDir);
|
|
1508
1678
|
const value = config[key];
|
|
1509
1679
|
console.log(value ?? S.dim("(not set)"));
|
|
1510
1680
|
});
|
|
1511
1681
|
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) => {
|
|
1512
|
-
const projectDir = opts.projectDir ?
|
|
1682
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
|
|
1513
1683
|
if (key === "provider" || key === "cloud" || key === "cloudConfig") {
|
|
1514
1684
|
logErr(
|
|
1515
1685
|
`'${key}' is no longer a setting \u2014 an endpoint is an AI provider registry entry and a session selects one with a model reference.
|
|
@@ -1646,11 +1816,11 @@ function makeConnectCommand() {
|
|
|
1646
1816
|
process.exitCode = 1;
|
|
1647
1817
|
return;
|
|
1648
1818
|
}
|
|
1649
|
-
await new Promise((
|
|
1819
|
+
await new Promise((resolve5) => {
|
|
1650
1820
|
client.onMessage((event) => {
|
|
1651
1821
|
console.log(formatEvent(event));
|
|
1652
1822
|
if (event.type === "finished" || event.type === "debug_result") {
|
|
1653
|
-
|
|
1823
|
+
resolve5();
|
|
1654
1824
|
}
|
|
1655
1825
|
});
|
|
1656
1826
|
client.send(parsed);
|
|
@@ -1694,12 +1864,12 @@ function makeConnectCommand() {
|
|
|
1694
1864
|
client.send(cmd);
|
|
1695
1865
|
rl.prompt();
|
|
1696
1866
|
});
|
|
1697
|
-
await new Promise((
|
|
1698
|
-
rl.on("close",
|
|
1867
|
+
await new Promise((resolve5) => {
|
|
1868
|
+
rl.on("close", resolve5);
|
|
1699
1869
|
client.onDisconnect(() => {
|
|
1700
1870
|
logErr("Server disconnected");
|
|
1701
1871
|
rl.close();
|
|
1702
|
-
|
|
1872
|
+
resolve5();
|
|
1703
1873
|
});
|
|
1704
1874
|
});
|
|
1705
1875
|
await client.disconnect();
|
|
@@ -1781,15 +1951,15 @@ function parseOpArgs(args) {
|
|
|
1781
1951
|
async function promptText(label, defaultVal) {
|
|
1782
1952
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
1783
1953
|
const hint = defaultVal ? ` [${defaultVal}]` : "";
|
|
1784
|
-
return new Promise((
|
|
1954
|
+
return new Promise((resolve5) => {
|
|
1785
1955
|
rl.question(` ${label}${hint}: `, (answer) => {
|
|
1786
1956
|
rl.close();
|
|
1787
|
-
|
|
1957
|
+
resolve5(answer.trim() || defaultVal || "");
|
|
1788
1958
|
});
|
|
1789
1959
|
});
|
|
1790
1960
|
}
|
|
1791
1961
|
async function promptSecret(label) {
|
|
1792
|
-
return new Promise((
|
|
1962
|
+
return new Promise((resolve5) => {
|
|
1793
1963
|
process.stdout.write(` ${label} (hidden): `);
|
|
1794
1964
|
const stdin = process.stdin;
|
|
1795
1965
|
stdin.setRawMode?.(true);
|
|
@@ -1802,7 +1972,7 @@ async function promptSecret(label) {
|
|
|
1802
1972
|
stdin.pause();
|
|
1803
1973
|
stdin.removeListener("data", onData);
|
|
1804
1974
|
process.stdout.write("\n");
|
|
1805
|
-
|
|
1975
|
+
resolve5(value);
|
|
1806
1976
|
} else if (char === "") {
|
|
1807
1977
|
process.exit(1);
|
|
1808
1978
|
} else if (char === "\x7F") {
|
|
@@ -1849,8 +2019,8 @@ function makeConnectorCommand() {
|
|
|
1849
2019
|
async (driver, opts) => {
|
|
1850
2020
|
const { installNpmPackages } = await import('../connectors/index.js');
|
|
1851
2021
|
const { scanDirectory: scanDirectory2, factoryAssetRoots: factoryAssetRoots2, WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
1852
|
-
const projectDir =
|
|
1853
|
-
const yamlPath =
|
|
2022
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2023
|
+
const yamlPath = path36__default.join(projectDir, "skaile.yaml");
|
|
1854
2024
|
if (!existsSync(yamlPath)) {
|
|
1855
2025
|
logErr("No skaile.yaml found in current directory. Run 'skaile init' first.");
|
|
1856
2026
|
process.exit(1);
|
|
@@ -1910,8 +2080,8 @@ ${installResult.output}`);
|
|
|
1910
2080
|
);
|
|
1911
2081
|
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) => {
|
|
1912
2082
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
1913
|
-
const projectDir =
|
|
1914
|
-
const yamlPath =
|
|
2083
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2084
|
+
const yamlPath = path36__default.join(projectDir, "skaile.yaml");
|
|
1915
2085
|
if (!existsSync(yamlPath)) {
|
|
1916
2086
|
logErr("No skaile.yaml found in current directory.");
|
|
1917
2087
|
process.exit(1);
|
|
@@ -1928,7 +2098,7 @@ ${installResult.output}`);
|
|
|
1928
2098
|
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) => {
|
|
1929
2099
|
const res = await import('../connectors/index.js');
|
|
1930
2100
|
res.registerBuiltinConnectors();
|
|
1931
|
-
const projectDir =
|
|
2101
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
1932
2102
|
const declarations = res.loadConnectorDeclarations(projectDir);
|
|
1933
2103
|
if (declarations.length === 0) {
|
|
1934
2104
|
console.log("No connectors configured in skaile.yaml.");
|
|
@@ -1952,7 +2122,7 @@ ${installResult.output}`);
|
|
|
1952
2122
|
await manager.disconnectAll();
|
|
1953
2123
|
});
|
|
1954
2124
|
cmd.command("list").description("List all configured connectors").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
|
|
1955
|
-
const projectDir =
|
|
2125
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
1956
2126
|
const manager = await connectConnectors(projectDir);
|
|
1957
2127
|
try {
|
|
1958
2128
|
console.log(JSON.stringify(manager.listConnectors(), null, 2));
|
|
@@ -1961,7 +2131,7 @@ ${installResult.output}`);
|
|
|
1961
2131
|
}
|
|
1962
2132
|
});
|
|
1963
2133
|
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) => {
|
|
1964
|
-
const projectDir =
|
|
2134
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
1965
2135
|
const manager = await connectConnectors(projectDir);
|
|
1966
2136
|
try {
|
|
1967
2137
|
if (opts.all) {
|
|
@@ -1985,7 +2155,7 @@ ${installResult.output}`);
|
|
|
1985
2155
|
}
|
|
1986
2156
|
});
|
|
1987
2157
|
cmd.command("ops <id>").description("List available operations for a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, opts) => {
|
|
1988
|
-
const projectDir =
|
|
2158
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
1989
2159
|
const manager = await connectConnectors(projectDir);
|
|
1990
2160
|
try {
|
|
1991
2161
|
if (!manager.has(id)) {
|
|
@@ -2000,7 +2170,7 @@ ${installResult.output}`);
|
|
|
2000
2170
|
}
|
|
2001
2171
|
});
|
|
2002
2172
|
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) => {
|
|
2003
|
-
const projectDir =
|
|
2173
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2004
2174
|
const manager = await connectConnectors(projectDir);
|
|
2005
2175
|
try {
|
|
2006
2176
|
const content = await manager.read(id, resourcePath);
|
|
@@ -2010,7 +2180,7 @@ ${installResult.output}`);
|
|
|
2010
2180
|
}
|
|
2011
2181
|
});
|
|
2012
2182
|
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) => {
|
|
2013
|
-
const projectDir =
|
|
2183
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2014
2184
|
const manager = await connectConnectors(projectDir);
|
|
2015
2185
|
try {
|
|
2016
2186
|
await manager.write(id, resourcePath, { data: content });
|
|
@@ -2020,7 +2190,7 @@ ${installResult.output}`);
|
|
|
2020
2190
|
}
|
|
2021
2191
|
});
|
|
2022
2192
|
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) => {
|
|
2023
|
-
const projectDir =
|
|
2193
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2024
2194
|
const manager = await connectConnectors(projectDir);
|
|
2025
2195
|
try {
|
|
2026
2196
|
const entries = await manager.list(id, resourcePath, {
|
|
@@ -2033,7 +2203,7 @@ ${installResult.output}`);
|
|
|
2033
2203
|
}
|
|
2034
2204
|
});
|
|
2035
2205
|
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) => {
|
|
2036
|
-
const projectDir =
|
|
2206
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2037
2207
|
const manager = await connectConnectors(projectDir);
|
|
2038
2208
|
try {
|
|
2039
2209
|
const results = await manager.search(id, query);
|
|
@@ -2043,7 +2213,7 @@ ${installResult.output}`);
|
|
|
2043
2213
|
}
|
|
2044
2214
|
});
|
|
2045
2215
|
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) => {
|
|
2046
|
-
const projectDir =
|
|
2216
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2047
2217
|
const manager = await connectConnectors(projectDir);
|
|
2048
2218
|
try {
|
|
2049
2219
|
const ok = await manager.delete(id, resourcePath);
|
|
@@ -2053,7 +2223,7 @@ ${installResult.output}`);
|
|
|
2053
2223
|
}
|
|
2054
2224
|
});
|
|
2055
2225
|
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) => {
|
|
2056
|
-
const projectDir =
|
|
2226
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2057
2227
|
const manager = await connectConnectors(projectDir);
|
|
2058
2228
|
try {
|
|
2059
2229
|
if (!manager.has(id)) {
|
|
@@ -2088,17 +2258,17 @@ async function runDebugQuery(query, parentOpts, args) {
|
|
|
2088
2258
|
process.exitCode = 1;
|
|
2089
2259
|
return;
|
|
2090
2260
|
}
|
|
2091
|
-
await new Promise((
|
|
2261
|
+
await new Promise((resolve5) => {
|
|
2092
2262
|
const timeout = setTimeout(() => {
|
|
2093
2263
|
logErr("Timeout: no debug_result received within 5s");
|
|
2094
2264
|
process.exitCode = 1;
|
|
2095
|
-
|
|
2265
|
+
resolve5();
|
|
2096
2266
|
}, 5e3);
|
|
2097
2267
|
client.onMessage((event) => {
|
|
2098
2268
|
if (event.type !== "debug_result") return;
|
|
2099
2269
|
clearTimeout(timeout);
|
|
2100
2270
|
printDebugResult(query, event.data);
|
|
2101
|
-
|
|
2271
|
+
resolve5();
|
|
2102
2272
|
});
|
|
2103
2273
|
client.send({ type: "debug", query, args });
|
|
2104
2274
|
});
|
|
@@ -2162,7 +2332,7 @@ function envRecord() {
|
|
|
2162
2332
|
async function buildDeployContext(projectDir) {
|
|
2163
2333
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2164
2334
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
2165
|
-
const workspaceId = config.name ??
|
|
2335
|
+
const workspaceId = config.name ?? path36__default.basename(projectDir);
|
|
2166
2336
|
let log;
|
|
2167
2337
|
try {
|
|
2168
2338
|
const { createLogger } = await import('../core/logging.js');
|
|
@@ -2194,13 +2364,13 @@ async function ensureTargetsRegistered(projectDir) {
|
|
|
2194
2364
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2195
2365
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
2196
2366
|
if (config.plugins && config.plugins.length > 0) {
|
|
2197
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
2367
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-27KGLW4S.js');
|
|
2198
2368
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
2199
2369
|
for (const f of result.failed) logWarn(f.error);
|
|
2200
2370
|
}
|
|
2201
2371
|
}
|
|
2202
2372
|
async function runUp(opts) {
|
|
2203
|
-
const projectDir =
|
|
2373
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2204
2374
|
await ensureTargetsRegistered(projectDir);
|
|
2205
2375
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2206
2376
|
const { resolveDeployTarget, pluginRegistry } = await import('../plugin-registry/index.js');
|
|
@@ -2232,12 +2402,12 @@ async function runUp(opts) {
|
|
|
2232
2402
|
await holdUntilSignal(handle, controller);
|
|
2233
2403
|
}
|
|
2234
2404
|
function holdUntilSignal(handle, controller) {
|
|
2235
|
-
return new Promise((
|
|
2405
|
+
return new Promise((resolve5) => {
|
|
2236
2406
|
const onSig = () => {
|
|
2237
2407
|
process.removeListener("SIGINT", onSig);
|
|
2238
2408
|
controller.abort();
|
|
2239
2409
|
logInfo("Stopping\u2026");
|
|
2240
|
-
handle.stop().then(() => logOk("Stopped.")).catch((e) => logErr(`stop failed: ${e instanceof Error ? e.message : String(e)}`)).finally(() =>
|
|
2410
|
+
handle.stop().then(() => logOk("Stopped.")).catch((e) => logErr(`stop failed: ${e instanceof Error ? e.message : String(e)}`)).finally(() => resolve5());
|
|
2241
2411
|
};
|
|
2242
2412
|
process.on("SIGINT", onSig);
|
|
2243
2413
|
});
|
|
@@ -2268,7 +2438,7 @@ async function restoreFromHandle(projectDir) {
|
|
|
2268
2438
|
return { target, handle, ctx };
|
|
2269
2439
|
}
|
|
2270
2440
|
async function runDown(opts) {
|
|
2271
|
-
const projectDir =
|
|
2441
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2272
2442
|
const restored = await restoreFromHandle(projectDir);
|
|
2273
2443
|
if (!restored) return;
|
|
2274
2444
|
await restored.handle.stop();
|
|
@@ -2277,7 +2447,7 @@ async function runDown(opts) {
|
|
|
2277
2447
|
logOk(`Stopped ${S.cmd(restored.target.id)} and cleared the handle.`);
|
|
2278
2448
|
}
|
|
2279
2449
|
async function runStatus(opts) {
|
|
2280
|
-
const projectDir =
|
|
2450
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2281
2451
|
const restored = await restoreFromHandle(projectDir);
|
|
2282
2452
|
if (!restored) return;
|
|
2283
2453
|
const health = await restored.handle.health();
|
|
@@ -2291,7 +2461,7 @@ async function runStatus(opts) {
|
|
|
2291
2461
|
console.log();
|
|
2292
2462
|
}
|
|
2293
2463
|
async function runLogs(opts) {
|
|
2294
|
-
const projectDir =
|
|
2464
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2295
2465
|
const restored = await restoreFromHandle(projectDir);
|
|
2296
2466
|
if (!restored) return;
|
|
2297
2467
|
if (!restored.handle.logs) {
|
|
@@ -2315,7 +2485,7 @@ function makeDeployCommand() {
|
|
|
2315
2485
|
}
|
|
2316
2486
|
function makeDiffCommand() {
|
|
2317
2487
|
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) => {
|
|
2318
|
-
const am2 = new AssetManager({ projectDir:
|
|
2488
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
2319
2489
|
const result = await am2.diff(ref);
|
|
2320
2490
|
switch (result.status) {
|
|
2321
2491
|
case "not-found":
|
|
@@ -2337,7 +2507,7 @@ function makeDiffCommand() {
|
|
|
2337
2507
|
function makeFlowCommand() {
|
|
2338
2508
|
const cmd = new Command("flow").description("Manage flows");
|
|
2339
2509
|
cmd.command("list").description("List available flows").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
2340
|
-
const flows = await discoverFlowsWithLibraries(
|
|
2510
|
+
const flows = await discoverFlowsWithLibraries(path36__default.resolve(opts.projectDir));
|
|
2341
2511
|
if (flows.length === 0) {
|
|
2342
2512
|
logInfo("No flows found.");
|
|
2343
2513
|
return;
|
|
@@ -2352,7 +2522,7 @@ function makeFlowCommand() {
|
|
|
2352
2522
|
console.log();
|
|
2353
2523
|
});
|
|
2354
2524
|
cmd.command("show <id>").description("Show flow details and node graph").option("--project-dir <path>", "Project directory", process.cwd()).action(async (id, opts) => {
|
|
2355
|
-
const flows = await discoverFlowsWithLibraries(
|
|
2525
|
+
const flows = await discoverFlowsWithLibraries(path36__default.resolve(opts.projectDir));
|
|
2356
2526
|
const flow = flows.find((f) => f.id === id);
|
|
2357
2527
|
if (!flow) {
|
|
2358
2528
|
logErr(`Flow not found: ${id}`);
|
|
@@ -2384,7 +2554,7 @@ function makeFlowCommand() {
|
|
|
2384
2554
|
function makeHistoryCommand() {
|
|
2385
2555
|
const cmd = new Command("history").description("Show recent add/remove/update actions");
|
|
2386
2556
|
cmd.argument("[limit]", "Number of entries to show", "20").option("--project-dir <path>", "Project directory", process.cwd()).action((limitStr, opts) => {
|
|
2387
|
-
const am2 = new AssetManager({ projectDir:
|
|
2557
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
2388
2558
|
const limit = parseInt(limitStr, 10) || 20;
|
|
2389
2559
|
const entries = am2.history(limit);
|
|
2390
2560
|
if (entries.length === 0) {
|
|
@@ -2404,7 +2574,7 @@ function makeHistoryCommand() {
|
|
|
2404
2574
|
console.log();
|
|
2405
2575
|
});
|
|
2406
2576
|
cmd.command("clear").description("Clear action history").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
2407
|
-
const am2 = new AssetManager({ projectDir:
|
|
2577
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
2408
2578
|
am2.clearHistory();
|
|
2409
2579
|
logOk("History cleared.");
|
|
2410
2580
|
});
|
|
@@ -2417,12 +2587,12 @@ var MCP_SERVER_ENTRY = {
|
|
|
2417
2587
|
env: {}
|
|
2418
2588
|
};
|
|
2419
2589
|
function pluginDir(projectDir) {
|
|
2420
|
-
return
|
|
2590
|
+
return path36__default.join(projectDir, ".claude", "plugins", "skaile");
|
|
2421
2591
|
}
|
|
2422
2592
|
async function readJsonStrict(p7) {
|
|
2423
2593
|
let raw;
|
|
2424
2594
|
try {
|
|
2425
|
-
raw = await
|
|
2595
|
+
raw = await fs6.readFile(p7, "utf-8");
|
|
2426
2596
|
} catch {
|
|
2427
2597
|
return null;
|
|
2428
2598
|
}
|
|
@@ -2435,32 +2605,32 @@ async function readJsonStrict(p7) {
|
|
|
2435
2605
|
}
|
|
2436
2606
|
}
|
|
2437
2607
|
async function writeJson(p7, value) {
|
|
2438
|
-
await
|
|
2439
|
-
await
|
|
2608
|
+
await fs6.mkdir(path36__default.dirname(p7), { recursive: true });
|
|
2609
|
+
await fs6.writeFile(p7, `${JSON.stringify(value, null, 2)}
|
|
2440
2610
|
`);
|
|
2441
2611
|
}
|
|
2442
2612
|
async function copyDir(src, dest) {
|
|
2443
|
-
await
|
|
2444
|
-
const entries = await
|
|
2613
|
+
await fs6.mkdir(dest, { recursive: true });
|
|
2614
|
+
const entries = await fs6.readdir(src, { withFileTypes: true });
|
|
2445
2615
|
for (const entry of entries) {
|
|
2446
|
-
const srcPath =
|
|
2447
|
-
const destPath =
|
|
2616
|
+
const srcPath = path36__default.join(src, entry.name);
|
|
2617
|
+
const destPath = path36__default.join(dest, entry.name);
|
|
2448
2618
|
if (entry.isDirectory()) await copyDir(srcPath, destPath);
|
|
2449
|
-
else await
|
|
2619
|
+
else await fs6.copyFile(srcPath, destPath);
|
|
2450
2620
|
}
|
|
2451
2621
|
}
|
|
2452
2622
|
async function install(projectDir, opts) {
|
|
2453
2623
|
return opts?.full ? installFullPlugin(projectDir) : installMcp(projectDir);
|
|
2454
2624
|
}
|
|
2455
2625
|
async function installMcp(projectDir) {
|
|
2456
|
-
const mcpPath =
|
|
2626
|
+
const mcpPath = path36__default.join(projectDir, ".claude", "mcp.json");
|
|
2457
2627
|
const existing = await readJsonStrict(mcpPath) ?? {};
|
|
2458
2628
|
const mcpServers = { ...existing.mcpServers ?? {} };
|
|
2459
2629
|
const previous = mcpServers[SKAILE_MCP_NAME];
|
|
2460
2630
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(MCP_SERVER_ENTRY);
|
|
2461
2631
|
let warning;
|
|
2462
2632
|
if (previous && !matches) {
|
|
2463
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${
|
|
2633
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${path36__default.relative(projectDir, mcpPath)}`;
|
|
2464
2634
|
}
|
|
2465
2635
|
mcpServers[SKAILE_MCP_NAME] = MCP_SERVER_ENTRY;
|
|
2466
2636
|
await writeJson(mcpPath, { ...existing, mcpServers });
|
|
@@ -2469,15 +2639,15 @@ async function installMcp(projectDir) {
|
|
|
2469
2639
|
async function installFullPlugin(projectDir) {
|
|
2470
2640
|
const dir = pluginDir(projectDir);
|
|
2471
2641
|
for (const [rel, content] of Object.entries(buildClaudePluginFiles())) {
|
|
2472
|
-
const dest =
|
|
2473
|
-
await
|
|
2474
|
-
await
|
|
2642
|
+
const dest = path36__default.join(dir, rel);
|
|
2643
|
+
await fs6.mkdir(path36__default.dirname(dest), { recursive: true });
|
|
2644
|
+
await fs6.writeFile(dest, content);
|
|
2475
2645
|
}
|
|
2476
|
-
const projectSkillsDir =
|
|
2646
|
+
const projectSkillsDir = path36__default.join(projectDir, ".skaile", "skills");
|
|
2477
2647
|
if (existsSync(projectSkillsDir)) {
|
|
2478
|
-
await copyDir(projectSkillsDir,
|
|
2648
|
+
await copyDir(projectSkillsDir, path36__default.join(dir, "skills"));
|
|
2479
2649
|
}
|
|
2480
|
-
const settingsPath =
|
|
2650
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2481
2651
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2482
2652
|
const plugins = settings.plugins ?? [];
|
|
2483
2653
|
if (!plugins.includes(dir)) plugins.push(dir);
|
|
@@ -2485,8 +2655,8 @@ async function installFullPlugin(projectDir) {
|
|
|
2485
2655
|
return { changed: true, method: "plugin" };
|
|
2486
2656
|
}
|
|
2487
2657
|
async function uninstall(projectDir) {
|
|
2488
|
-
const settingsPath =
|
|
2489
|
-
const mcpPath =
|
|
2658
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2659
|
+
const mcpPath = path36__default.join(projectDir, ".claude", "mcp.json");
|
|
2490
2660
|
const dir = pluginDir(projectDir);
|
|
2491
2661
|
let changed = false;
|
|
2492
2662
|
const settings = await readJsonStrict(settingsPath);
|
|
@@ -2500,7 +2670,7 @@ async function uninstall(projectDir) {
|
|
|
2500
2670
|
}
|
|
2501
2671
|
}
|
|
2502
2672
|
if (existsSync(dir)) {
|
|
2503
|
-
await
|
|
2673
|
+
await fs6.rm(dir, { recursive: true, force: true });
|
|
2504
2674
|
changed = true;
|
|
2505
2675
|
}
|
|
2506
2676
|
const mcp = await readJsonStrict(mcpPath);
|
|
@@ -2510,7 +2680,7 @@ async function uninstall(projectDir) {
|
|
|
2510
2680
|
const updated = { ...mcp, mcpServers: rest };
|
|
2511
2681
|
if (Object.keys(rest).length === 0) delete updated.mcpServers;
|
|
2512
2682
|
if (Object.keys(updated).length === 0) {
|
|
2513
|
-
await
|
|
2683
|
+
await fs6.unlink(mcpPath);
|
|
2514
2684
|
} else {
|
|
2515
2685
|
await writeJson(mcpPath, updated);
|
|
2516
2686
|
}
|
|
@@ -2520,12 +2690,12 @@ async function uninstall(projectDir) {
|
|
|
2520
2690
|
async function detectInstall(projectDir) {
|
|
2521
2691
|
const dir = pluginDir(projectDir);
|
|
2522
2692
|
const settings = await readJsonStrict(
|
|
2523
|
-
|
|
2693
|
+
path36__default.join(projectDir, ".claude", "settings.json")
|
|
2524
2694
|
);
|
|
2525
|
-
if (existsSync(
|
|
2695
|
+
if (existsSync(path36__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir)) {
|
|
2526
2696
|
return { method: "plugin", pluginPath: dir };
|
|
2527
2697
|
}
|
|
2528
|
-
const mcp = await readJsonStrict(
|
|
2698
|
+
const mcp = await readJsonStrict(path36__default.join(projectDir, ".claude", "mcp.json"));
|
|
2529
2699
|
if (mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers) {
|
|
2530
2700
|
return { method: "mcp" };
|
|
2531
2701
|
}
|
|
@@ -2534,7 +2704,7 @@ async function detectInstall(projectDir) {
|
|
|
2534
2704
|
async function enable(projectDir) {
|
|
2535
2705
|
const detected = await detectInstall(projectDir);
|
|
2536
2706
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2537
|
-
const settingsPath =
|
|
2707
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2538
2708
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2539
2709
|
if (detected.method === "plugin") {
|
|
2540
2710
|
const disabled2 = settings.disabledPlugins ?? [];
|
|
@@ -2556,7 +2726,7 @@ async function enable(projectDir) {
|
|
|
2556
2726
|
async function disable(projectDir) {
|
|
2557
2727
|
const detected = await detectInstall(projectDir);
|
|
2558
2728
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2559
|
-
const settingsPath =
|
|
2729
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2560
2730
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2561
2731
|
if (detected.method === "plugin") {
|
|
2562
2732
|
const list2 = settings.disabledPlugins ?? [];
|
|
@@ -2576,12 +2746,12 @@ async function disable(projectDir) {
|
|
|
2576
2746
|
return { changed: true };
|
|
2577
2747
|
}
|
|
2578
2748
|
async function status(projectDir) {
|
|
2579
|
-
const settingsPath =
|
|
2580
|
-
const mcpPath =
|
|
2749
|
+
const settingsPath = path36__default.join(projectDir, ".claude", "settings.json");
|
|
2750
|
+
const mcpPath = path36__default.join(projectDir, ".claude", "mcp.json");
|
|
2581
2751
|
const dir = pluginDir(projectDir);
|
|
2582
2752
|
const settings = await readJsonStrict(settingsPath);
|
|
2583
2753
|
const mcp = await readJsonStrict(mcpPath);
|
|
2584
|
-
const pluginInstalled = !!(existsSync(
|
|
2754
|
+
const pluginInstalled = !!(existsSync(path36__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir));
|
|
2585
2755
|
const mcpInstalled = !!(mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers);
|
|
2586
2756
|
if (!pluginInstalled && !mcpInstalled) {
|
|
2587
2757
|
return {
|
|
@@ -2599,7 +2769,7 @@ async function status(projectDir) {
|
|
|
2599
2769
|
installed: "yes",
|
|
2600
2770
|
enabled: disabled2 ? "no" : "yes",
|
|
2601
2771
|
method: "plugin",
|
|
2602
|
-
location:
|
|
2772
|
+
location: path36__default.relative(projectDir, dir)
|
|
2603
2773
|
};
|
|
2604
2774
|
}
|
|
2605
2775
|
const disabled = settings?.disabledMcpjsonServers?.includes(SKAILE_MCP_NAME) ?? false;
|
|
@@ -2608,7 +2778,7 @@ async function status(projectDir) {
|
|
|
2608
2778
|
installed: "yes",
|
|
2609
2779
|
enabled: disabled ? "no" : "yes",
|
|
2610
2780
|
method: "mcp",
|
|
2611
|
-
location:
|
|
2781
|
+
location: path36__default.relative(projectDir, mcpPath)
|
|
2612
2782
|
};
|
|
2613
2783
|
}
|
|
2614
2784
|
var SKAILE_MCP_NAME2 = "skaile-workspace";
|
|
@@ -2622,7 +2792,7 @@ function buildEntry(projectDir) {
|
|
|
2622
2792
|
async function readConfig(p7) {
|
|
2623
2793
|
let raw;
|
|
2624
2794
|
try {
|
|
2625
|
-
raw = await
|
|
2795
|
+
raw = await fs6.readFile(p7, "utf-8");
|
|
2626
2796
|
} catch {
|
|
2627
2797
|
return null;
|
|
2628
2798
|
}
|
|
@@ -2635,16 +2805,16 @@ async function readConfig(p7) {
|
|
|
2635
2805
|
}
|
|
2636
2806
|
}
|
|
2637
2807
|
async function writeConfig(p7, value) {
|
|
2638
|
-
await
|
|
2808
|
+
await fs6.mkdir(path36__default.dirname(p7), { recursive: true });
|
|
2639
2809
|
const cleaned = {};
|
|
2640
2810
|
for (const [k, v] of Object.entries(value)) {
|
|
2641
2811
|
if (v === void 0) continue;
|
|
2642
2812
|
cleaned[k] = v;
|
|
2643
2813
|
}
|
|
2644
|
-
await
|
|
2814
|
+
await fs6.writeFile(p7, stringify$1(cleaned));
|
|
2645
2815
|
}
|
|
2646
2816
|
function configPath(projectDir) {
|
|
2647
|
-
return
|
|
2817
|
+
return path36__default.join(projectDir, ".codex", "config.toml");
|
|
2648
2818
|
}
|
|
2649
2819
|
async function install2(projectDir) {
|
|
2650
2820
|
const p7 = configPath(projectDir);
|
|
@@ -2655,7 +2825,7 @@ async function install2(projectDir) {
|
|
|
2655
2825
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(next);
|
|
2656
2826
|
let warning;
|
|
2657
2827
|
if (previous && !matches) {
|
|
2658
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${
|
|
2828
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${path36__default.relative(projectDir, p7)}`;
|
|
2659
2829
|
}
|
|
2660
2830
|
if (matches) return { changed: false, method: "toml" };
|
|
2661
2831
|
servers[SKAILE_MCP_NAME2] = next;
|
|
@@ -2672,7 +2842,7 @@ async function uninstall2(projectDir) {
|
|
|
2672
2842
|
const updated = { ...cfg, mcp_servers: rest };
|
|
2673
2843
|
if (Object.keys(rest).length === 0) delete updated.mcp_servers;
|
|
2674
2844
|
if (Object.keys(updated).length === 0) {
|
|
2675
|
-
await
|
|
2845
|
+
await fs6.unlink(p7);
|
|
2676
2846
|
} else {
|
|
2677
2847
|
await writeConfig(p7, updated);
|
|
2678
2848
|
}
|
|
@@ -2696,43 +2866,43 @@ async function status2(projectDir) {
|
|
|
2696
2866
|
installed: "yes",
|
|
2697
2867
|
enabled: "n/a",
|
|
2698
2868
|
method: "mcp",
|
|
2699
|
-
location:
|
|
2869
|
+
location: path36__default.relative(projectDir, p7)
|
|
2700
2870
|
};
|
|
2701
2871
|
}
|
|
2702
2872
|
async function install3(projectDir) {
|
|
2703
|
-
const extDir =
|
|
2704
|
-
const extPath =
|
|
2705
|
-
await
|
|
2873
|
+
const extDir = path36__default.join(projectDir, ".omp", "extensions");
|
|
2874
|
+
const extPath = path36__default.join(extDir, "skaile.ts");
|
|
2875
|
+
await fs6.mkdir(extDir, { recursive: true });
|
|
2706
2876
|
const { WorkspacePlugin } = await import('../workspace-plugin/index.js');
|
|
2707
2877
|
const plugin = new WorkspacePlugin({ projectDir });
|
|
2708
2878
|
const nextSrc = await plugin.buildOmpExtensionSource();
|
|
2709
2879
|
let prevSrc = null;
|
|
2710
2880
|
try {
|
|
2711
|
-
prevSrc = await
|
|
2881
|
+
prevSrc = await fs6.readFile(extPath, "utf-8");
|
|
2712
2882
|
} catch {
|
|
2713
2883
|
}
|
|
2714
2884
|
if (prevSrc === nextSrc) return { changed: false, method: "generated" };
|
|
2715
|
-
await
|
|
2885
|
+
await fs6.writeFile(extPath, nextSrc);
|
|
2716
2886
|
return { changed: true, method: "generated" };
|
|
2717
2887
|
}
|
|
2718
2888
|
async function uninstall3(projectDir) {
|
|
2719
|
-
const extPath =
|
|
2889
|
+
const extPath = path36__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
2720
2890
|
try {
|
|
2721
|
-
await
|
|
2891
|
+
await fs6.unlink(extPath);
|
|
2722
2892
|
return { changed: true };
|
|
2723
2893
|
} catch {
|
|
2724
2894
|
return { changed: false };
|
|
2725
2895
|
}
|
|
2726
2896
|
}
|
|
2727
2897
|
async function status3(projectDir) {
|
|
2728
|
-
const extPath =
|
|
2898
|
+
const extPath = path36__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
2729
2899
|
if (existsSync(extPath)) {
|
|
2730
2900
|
return {
|
|
2731
2901
|
harness: "omp",
|
|
2732
2902
|
installed: "yes",
|
|
2733
2903
|
enabled: "n/a",
|
|
2734
2904
|
method: "extension",
|
|
2735
|
-
location:
|
|
2905
|
+
location: path36__default.relative(projectDir, extPath)
|
|
2736
2906
|
};
|
|
2737
2907
|
}
|
|
2738
2908
|
return {
|
|
@@ -2795,7 +2965,7 @@ async function installCodex(projectDir) {
|
|
|
2795
2965
|
console.log(` ${S.dim("\u2192")} Restart Codex CLI to pick up the change.`);
|
|
2796
2966
|
}
|
|
2797
2967
|
async function runInstall(opts) {
|
|
2798
|
-
const projectDir =
|
|
2968
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2799
2969
|
const targets = resolveDriver(opts.driver);
|
|
2800
2970
|
let exitCode = 0;
|
|
2801
2971
|
if (targets.includes("claude-code")) {
|
|
@@ -2829,7 +2999,7 @@ async function uninstallCodex(projectDir) {
|
|
|
2829
2999
|
else logInfo(`codex: not installed`);
|
|
2830
3000
|
}
|
|
2831
3001
|
async function runUninstall(opts) {
|
|
2832
|
-
const projectDir =
|
|
3002
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2833
3003
|
const targets = resolveDriver(opts.driver);
|
|
2834
3004
|
let exitCode = 0;
|
|
2835
3005
|
if (targets.includes("claude-code")) {
|
|
@@ -2872,7 +3042,7 @@ async function toggleTarget(t, projectDir, action3) {
|
|
|
2872
3042
|
});
|
|
2873
3043
|
}
|
|
2874
3044
|
async function runToggle(opts, action3) {
|
|
2875
|
-
const projectDir =
|
|
3045
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2876
3046
|
const requestedAll = opts.driver === "all";
|
|
2877
3047
|
const targets = resolveDriver(opts.driver);
|
|
2878
3048
|
const usageError = checkToggleSupported(targets, requestedAll, action3);
|
|
@@ -2884,7 +3054,7 @@ async function runToggle(opts, action3) {
|
|
|
2884
3054
|
return exitCode;
|
|
2885
3055
|
}
|
|
2886
3056
|
async function runStatus2(opts) {
|
|
2887
|
-
const projectDir =
|
|
3057
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
2888
3058
|
const targets = resolveDriver(opts.driver);
|
|
2889
3059
|
const rows = [];
|
|
2890
3060
|
let exitCode = 0;
|
|
@@ -2955,7 +3125,7 @@ async function runHook(event) {
|
|
|
2955
3125
|
await plugin.shutdown();
|
|
2956
3126
|
return;
|
|
2957
3127
|
}
|
|
2958
|
-
const store = new PluginStore(
|
|
3128
|
+
const store = new PluginStore(path36__default.join(projectDir, ".skaile", "plugin-state.json"));
|
|
2959
3129
|
await store.load();
|
|
2960
3130
|
const status4 = store.get("connector:status");
|
|
2961
3131
|
if (status4 && typeof status4 === "object" && Object.keys(status4).length > 0) {
|
|
@@ -3015,47 +3185,38 @@ function makeIntegrationCommand() {
|
|
|
3015
3185
|
cmd.action(() => cmd.help());
|
|
3016
3186
|
return cmd;
|
|
3017
3187
|
}
|
|
3018
|
-
|
|
3019
|
-
// cli/src/commands/library-index.ts
|
|
3020
|
-
async function indexLibrary(lib, index) {
|
|
3021
|
-
const { LocalCatalogSource } = await import('../library/index.js');
|
|
3022
|
-
const own = index ?? await openLibrary();
|
|
3023
|
-
try {
|
|
3024
|
-
const source = new LocalCatalogSource(own, lib.id, lib.path, createFullRegistry());
|
|
3025
|
-
const res = await source.sync();
|
|
3026
|
-
return {
|
|
3027
|
-
assetsFound: res.assetsFound,
|
|
3028
|
-
assetsUpdated: res.assetsUpdated,
|
|
3029
|
-
errors: res.errors
|
|
3030
|
-
};
|
|
3031
|
-
} finally {
|
|
3032
|
-
if (!index) own.close();
|
|
3033
|
-
}
|
|
3034
|
-
}
|
|
3035
|
-
function resolveLibraryPublisher(lib, opts, storeIdentity) {
|
|
3036
|
-
if (opts.publisher?.trim()) return opts.publisher.trim();
|
|
3037
|
-
const declared = loadSkPublishManifest(lib.path)?.publisher?.trim();
|
|
3038
|
-
if (declared) return declared.startsWith("@") ? declared.slice(1) : declared;
|
|
3039
|
-
const identity = (storeIdentity?.githubLogin ?? storeIdentity?.username)?.trim();
|
|
3040
|
-
if (identity) return identity;
|
|
3041
|
-
try {
|
|
3042
|
-
return slugifyAssetName(lib.name);
|
|
3043
|
-
} catch {
|
|
3044
|
-
return "library";
|
|
3045
|
-
}
|
|
3046
|
-
}
|
|
3047
|
-
|
|
3048
|
-
// cli/src/commands/library-cmd.ts
|
|
3049
3188
|
function exitOnSyncError(err) {
|
|
3050
3189
|
logErr(err instanceof Error ? err.message : String(err));
|
|
3051
3190
|
process.exit(1);
|
|
3052
3191
|
}
|
|
3192
|
+
function assertManifestEditableOrExit(libraryPath) {
|
|
3193
|
+
try {
|
|
3194
|
+
assertManifestEditable(libraryPath);
|
|
3195
|
+
} catch (err) {
|
|
3196
|
+
exitOnSyncError(err);
|
|
3197
|
+
}
|
|
3198
|
+
}
|
|
3053
3199
|
async function assertLibraryPathFree(manager, dir, exceptId) {
|
|
3054
3200
|
const clash = (await manager.listLibraries()).find(
|
|
3055
|
-
(l) => l.id !== exceptId &&
|
|
3201
|
+
(l) => l.id !== exceptId && path36.resolve(l.path) === dir
|
|
3056
3202
|
);
|
|
3057
3203
|
if (clash) throw new Error(`${dir} is already registered as library "${clash.name}".`);
|
|
3058
3204
|
}
|
|
3205
|
+
function canonicalDir(dir) {
|
|
3206
|
+
const abs = path36.resolve(dir);
|
|
3207
|
+
return fs12.existsSync(abs) ? fs12.realpathSync(abs) : abs;
|
|
3208
|
+
}
|
|
3209
|
+
function refuseGlobalInstallFolder(name, dir) {
|
|
3210
|
+
const reserved = globalInstallDir();
|
|
3211
|
+
const rel = path36.relative(canonicalDir(reserved), canonicalDir(dir));
|
|
3212
|
+
const inside = rel === "" || !rel.startsWith("..") && !path36.isAbsolute(rel);
|
|
3213
|
+
if (name === GLOBAL_INSTALL_DIR_NAME || inside) {
|
|
3214
|
+
logErr(
|
|
3215
|
+
`"${GLOBAL_INSTALL_DIR_NAME}" is reserved: ${reserved} holds assets from \`skaile install\`, not a library you author.`
|
|
3216
|
+
);
|
|
3217
|
+
process.exit(1);
|
|
3218
|
+
}
|
|
3219
|
+
}
|
|
3059
3220
|
function scaffoldLibraryFiles(dir, name) {
|
|
3060
3221
|
const readme = `# ${name}
|
|
3061
3222
|
|
|
@@ -3085,9 +3246,9 @@ by the same ref.
|
|
|
3085
3246
|
];
|
|
3086
3247
|
const written = [];
|
|
3087
3248
|
for (const [file, content] of files) {
|
|
3088
|
-
const target =
|
|
3089
|
-
if (
|
|
3090
|
-
|
|
3249
|
+
const target = path36.join(dir, file);
|
|
3250
|
+
if (fs12.existsSync(target)) continue;
|
|
3251
|
+
fs12.writeFileSync(target, content, "utf8");
|
|
3091
3252
|
written.push(file);
|
|
3092
3253
|
}
|
|
3093
3254
|
return written;
|
|
@@ -3162,8 +3323,9 @@ function makeLibraryCommand() {
|
|
|
3162
3323
|
);
|
|
3163
3324
|
process.exit(1);
|
|
3164
3325
|
}
|
|
3165
|
-
const libPath = opts.path ?
|
|
3166
|
-
|
|
3326
|
+
const libPath = opts.path ? path36.resolve(opts.path) : path36.join(resolveLibraryDir(), name);
|
|
3327
|
+
refuseGlobalInstallFolder(name, libPath);
|
|
3328
|
+
if (fs12.existsSync(libPath) && !fs12.statSync(libPath).isDirectory()) {
|
|
3167
3329
|
logErr(`${libPath} exists and is not a directory.`);
|
|
3168
3330
|
process.exit(1);
|
|
3169
3331
|
}
|
|
@@ -3187,9 +3349,9 @@ function makeLibraryCommand() {
|
|
|
3187
3349
|
backend = "git";
|
|
3188
3350
|
backendConfig = { url: opts.git, branch, authHint: "ssh" };
|
|
3189
3351
|
} else {
|
|
3190
|
-
|
|
3352
|
+
fs12.mkdirSync(libPath, { recursive: true });
|
|
3191
3353
|
}
|
|
3192
|
-
const blank =
|
|
3354
|
+
const blank = fs12.readdirSync(libPath).every((entry) => entry === ".git");
|
|
3193
3355
|
const isDefault = !hasDefault && ownership !== "reader";
|
|
3194
3356
|
await manager.addLibrary({
|
|
3195
3357
|
name,
|
|
@@ -3235,7 +3397,7 @@ function makeLibraryCommand() {
|
|
|
3235
3397
|
});
|
|
3236
3398
|
cmd.command("create <kind> <name>").description("Scaffold a new asset inside the default (or named) library").addOption(new Option("--kind <kind>", "Asset kind override").choices([...ASSET_KINDS])).option("--library <name>", "Target library (default: the default-marked one)").option("--dir <dir>", "Target directory inside the library (default: library root)").option("--publisher <name>", "Publisher for the new asset (default: the library's default)").option(
|
|
3237
3399
|
"--description <text>",
|
|
3238
|
-
"Description for the
|
|
3400
|
+
"Description for the asset's frontmatter \u2014 say what it does and when to use it (default: a TODO placeholder `skaile validate` rejects)"
|
|
3239
3401
|
).action(
|
|
3240
3402
|
async (kind, name, opts) => {
|
|
3241
3403
|
if (!ASSET_KINDS.includes(kind)) {
|
|
@@ -3252,9 +3414,10 @@ function makeLibraryCommand() {
|
|
|
3252
3414
|
const { manager, library, close } = await openLibraryManager();
|
|
3253
3415
|
try {
|
|
3254
3416
|
const target = await resolveTargetLibrary(manager, opts.library);
|
|
3417
|
+
assertManifestEditableOrExit(target.path);
|
|
3255
3418
|
const effectiveKind = opts.kind ?? kind;
|
|
3256
3419
|
const am2 = new AssetManager({ projectDir: process.cwd() });
|
|
3257
|
-
const destDir = opts.dir ?
|
|
3420
|
+
const destDir = opts.dir ? path36.join(target.path, opts.dir) : target.path;
|
|
3258
3421
|
const res = am2.create(name, effectiveKind, destDir, { description: opts.description });
|
|
3259
3422
|
if (!res.ok) {
|
|
3260
3423
|
logErr(res.path);
|
|
@@ -3266,21 +3429,14 @@ function makeLibraryCommand() {
|
|
|
3266
3429
|
"Description is a TODO placeholder \u2014 edit it (what the skill does and when to use it) or `skaile validate` will fail."
|
|
3267
3430
|
);
|
|
3268
3431
|
}
|
|
3269
|
-
const
|
|
3270
|
-
stampAssetPublisher(res.path, publisher);
|
|
3271
|
-
ensureManifestPublisher(target.path, publisher);
|
|
3272
|
-
upsertManifestAsset(target.path, {
|
|
3432
|
+
const { ref } = await registerLibraryAsset(target, library, {
|
|
3273
3433
|
kind: effectiveKind,
|
|
3274
3434
|
name,
|
|
3275
|
-
|
|
3435
|
+
assetDir: res.path,
|
|
3276
3436
|
version: "0.1.0",
|
|
3277
|
-
publisher
|
|
3437
|
+
publisher: opts.publisher
|
|
3278
3438
|
});
|
|
3279
|
-
|
|
3280
|
-
for (const e of idx.errors) logWarn(e);
|
|
3281
|
-
logOk(
|
|
3282
|
-
`Indexed \u2014 add it with \`skaile add ${refFor(effectiveKind, publisher, name, "0.1.0")}\``
|
|
3283
|
-
);
|
|
3439
|
+
logOk(`Indexed \u2014 add it with \`skaile add ${ref}\``);
|
|
3284
3440
|
} finally {
|
|
3285
3441
|
close();
|
|
3286
3442
|
}
|
|
@@ -3310,34 +3466,59 @@ function makeLibraryCommand() {
|
|
|
3310
3466
|
const { manager, close } = await openLibraryManager();
|
|
3311
3467
|
try {
|
|
3312
3468
|
const lib = await manager.requireLibrary(oldName);
|
|
3313
|
-
const parent =
|
|
3314
|
-
const newPath =
|
|
3315
|
-
|
|
3469
|
+
const parent = path36.dirname(lib.path);
|
|
3470
|
+
const newPath = path36.join(parent, newName);
|
|
3471
|
+
refuseGlobalInstallFolder(newName, newPath);
|
|
3472
|
+
if (fs12.existsSync(newPath)) {
|
|
3316
3473
|
logErr(`Target directory already exists: ${newPath}`);
|
|
3317
3474
|
process.exit(1);
|
|
3318
3475
|
}
|
|
3319
|
-
|
|
3476
|
+
fs12.renameSync(lib.path, newPath);
|
|
3320
3477
|
await manager.updateLibrary(lib.id, { name: newName, path: newPath });
|
|
3321
3478
|
logOk(`Renamed ${oldName} \u2192 ${newName}`);
|
|
3322
3479
|
} finally {
|
|
3323
3480
|
close();
|
|
3324
3481
|
}
|
|
3325
3482
|
});
|
|
3326
|
-
cmd.command("set <name> <field=value>").description(
|
|
3483
|
+
cmd.command("set <name> <field=value>").description(
|
|
3484
|
+
"Update a single library field (ownership, isDefault, path, publisher, backendConfig.<key>)"
|
|
3485
|
+
).action(async (name, expr) => {
|
|
3327
3486
|
const [field, ...rest] = expr.split("=");
|
|
3328
3487
|
const value = rest.join("=");
|
|
3329
|
-
const { manager, close } = await openLibraryManager();
|
|
3488
|
+
const { manager, library, close } = await openLibraryManager();
|
|
3330
3489
|
try {
|
|
3331
3490
|
const lib = await manager.requireLibrary(name);
|
|
3491
|
+
if (field === "publisher") {
|
|
3492
|
+
const publisher = value.trim().replace(/^@/, "");
|
|
3493
|
+
if (!/^[^\s/#@]+$/.test(publisher)) {
|
|
3494
|
+
logErr(
|
|
3495
|
+
`Invalid publisher "${value}": expected a bare name like "acme" (no @, /, # or spaces).`
|
|
3496
|
+
);
|
|
3497
|
+
process.exit(1);
|
|
3498
|
+
}
|
|
3499
|
+
if (lib.ownership === "reader") {
|
|
3500
|
+
logErr(
|
|
3501
|
+
`Library "${lib.name}" is read-only (ownership=reader); its publisher is not yours to set.`
|
|
3502
|
+
);
|
|
3503
|
+
process.exit(1);
|
|
3504
|
+
}
|
|
3505
|
+
assertManifestEditableOrExit(lib.path);
|
|
3506
|
+
setManifestPublisher(lib.path, publisher);
|
|
3507
|
+
const res = await indexLibrary(lib, library);
|
|
3508
|
+
for (const e of res.errors) logWarn(e);
|
|
3509
|
+
logOk(`Updated ${name}.publisher \u2192 ${publisher}`);
|
|
3510
|
+
return;
|
|
3511
|
+
}
|
|
3332
3512
|
const patch = {};
|
|
3333
3513
|
if (field === "ownership") patch.ownership = value;
|
|
3334
3514
|
else if (field === "isDefault") patch.isDefault = value === "true";
|
|
3335
3515
|
else if (field === "path") {
|
|
3336
|
-
const dir =
|
|
3337
|
-
if (!
|
|
3516
|
+
const dir = path36.resolve(value);
|
|
3517
|
+
if (!fs12.existsSync(dir) || !fs12.statSync(dir).isDirectory()) {
|
|
3338
3518
|
logErr(`Directory does not exist: ${dir}. \`library set path=\` does not move files.`);
|
|
3339
3519
|
process.exit(1);
|
|
3340
3520
|
}
|
|
3521
|
+
refuseGlobalInstallFolder(null, dir);
|
|
3341
3522
|
await assertLibraryPathFree(manager, dir, lib.id);
|
|
3342
3523
|
patch.path = dir;
|
|
3343
3524
|
} else if (field.startsWith("backendConfig.")) {
|
|
@@ -3404,15 +3585,24 @@ function makeLibraryCommand() {
|
|
|
3404
3585
|
const { manager, library, close } = await openLibraryManager();
|
|
3405
3586
|
try {
|
|
3406
3587
|
const lib = await manager.requireLibrary(name);
|
|
3407
|
-
|
|
3588
|
+
assertManifestEditableOrExit(lib.path);
|
|
3589
|
+
const removed = await syncManifestWithDisk(
|
|
3590
|
+
lib.path,
|
|
3591
|
+
resolveLibraryPublisher(lib, {}, getStoreIdentity())
|
|
3592
|
+
);
|
|
3408
3593
|
const manifest = loadSkPublishManifest(lib.path);
|
|
3409
3594
|
for (const a of removed) {
|
|
3410
3595
|
const ref = manifest ? assetEntryRef(a, manifest) : `${a.kind}:${a.name}`;
|
|
3411
3596
|
logInfo(`Removed manifest entry ${ref} (root ${a.root} is gone)`);
|
|
3412
3597
|
}
|
|
3413
3598
|
const res = await indexLibrary(lib, library);
|
|
3414
|
-
|
|
3599
|
+
const unparsable = res.errors.filter((e) => e.includes("ManifestSchemaError:"));
|
|
3600
|
+
for (const e of res.errors) (unparsable.includes(e) ? logErr : logWarn)(e);
|
|
3415
3601
|
logOk(`Indexed ${res.assetsUpdated} asset(s) from ${name}.`);
|
|
3602
|
+
if (unparsable.length > 0) {
|
|
3603
|
+
logErr(`${unparsable.length} asset(s) skipped: manifest could not be parsed.`);
|
|
3604
|
+
process.exitCode = 1;
|
|
3605
|
+
}
|
|
3416
3606
|
} finally {
|
|
3417
3607
|
close();
|
|
3418
3608
|
}
|
|
@@ -3521,16 +3711,16 @@ function makeLibraryCommand() {
|
|
|
3521
3711
|
"With --create-repo: create the repo private (the store only accepts public repos)"
|
|
3522
3712
|
).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(
|
|
3523
3713
|
async (lib, opts) => {
|
|
3524
|
-
const { runLibraryPublish } = await import('../library-publish-
|
|
3714
|
+
const { runLibraryPublish } = await import('../library-publish-TVS3WQ4C.js');
|
|
3525
3715
|
await withStoreErrorHandling(() => runLibraryPublish(lib, opts));
|
|
3526
3716
|
}
|
|
3527
3717
|
);
|
|
3528
3718
|
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) => {
|
|
3529
|
-
const { runLibraryRegister } = await import('../library-publish-
|
|
3719
|
+
const { runLibraryRegister } = await import('../library-publish-TVS3WQ4C.js');
|
|
3530
3720
|
await withStoreErrorHandling(() => runLibraryRegister(lib, opts));
|
|
3531
3721
|
});
|
|
3532
3722
|
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) => {
|
|
3533
|
-
const { runLibraryYank } = await import('../library-publish-
|
|
3723
|
+
const { runLibraryYank } = await import('../library-publish-TVS3WQ4C.js');
|
|
3534
3724
|
await withStoreErrorHandling(() => runLibraryYank(lib, opts));
|
|
3535
3725
|
});
|
|
3536
3726
|
return cmd;
|
|
@@ -3543,60 +3733,6 @@ async function withStoreErrorHandling(fn) {
|
|
|
3543
3733
|
process.exit(1);
|
|
3544
3734
|
}
|
|
3545
3735
|
}
|
|
3546
|
-
function stampAssetPublisher(assetDir, publisher) {
|
|
3547
|
-
const markers = ["SKILL.md", "AGENT.md", "CONTRACT.md"];
|
|
3548
|
-
let markerFile;
|
|
3549
|
-
for (const m of markers) {
|
|
3550
|
-
if (fs10.existsSync(path34.join(assetDir, m))) {
|
|
3551
|
-
markerFile = path34.join(assetDir, m);
|
|
3552
|
-
break;
|
|
3553
|
-
}
|
|
3554
|
-
}
|
|
3555
|
-
if (!markerFile) {
|
|
3556
|
-
const promptMd = fs10.readdirSync(assetDir).find((f) => f.endsWith(".prompt.md"));
|
|
3557
|
-
if (promptMd) markerFile = path34.join(assetDir, promptMd);
|
|
3558
|
-
}
|
|
3559
|
-
if (!markerFile) return;
|
|
3560
|
-
try {
|
|
3561
|
-
const { data, body } = parseFrontmatter(fs10.readFileSync(markerFile, "utf8"));
|
|
3562
|
-
const meta = data.metadata && typeof data.metadata === "object" && !Array.isArray(data.metadata) ? { ...data.metadata } : {};
|
|
3563
|
-
if (meta.publisher != null) return;
|
|
3564
|
-
meta.publisher = publisher;
|
|
3565
|
-
data.metadata = meta;
|
|
3566
|
-
const fm = stringify(data).trimEnd();
|
|
3567
|
-
fs10.writeFileSync(markerFile, `---
|
|
3568
|
-
${fm}
|
|
3569
|
-
---
|
|
3570
|
-
|
|
3571
|
-
${body}
|
|
3572
|
-
`, "utf8");
|
|
3573
|
-
} catch {
|
|
3574
|
-
}
|
|
3575
|
-
}
|
|
3576
|
-
function ensureManifestPublisher(libraryPath, publisher) {
|
|
3577
|
-
const manifest = loadSkPublishManifest(libraryPath) ?? { assets: [] };
|
|
3578
|
-
if (manifest.publisher) return;
|
|
3579
|
-
saveSkPublishManifest(libraryPath, { ...manifest, publisher });
|
|
3580
|
-
}
|
|
3581
|
-
async function syncManifestWithDisk(lib) {
|
|
3582
|
-
const libraryPath = lib.path;
|
|
3583
|
-
if (!loadSkPublishManifest(libraryPath)?.publisher) {
|
|
3584
|
-
ensureManifestPublisher(libraryPath, resolveLibraryPublisher(lib, {}, getStoreIdentity()));
|
|
3585
|
-
}
|
|
3586
|
-
const removed = pruneMissingRootAssets(libraryPath);
|
|
3587
|
-
const manifest = loadSkPublishManifest(libraryPath);
|
|
3588
|
-
const repoName = manifest?.publisher ?? slugifyAssetName(lib.name);
|
|
3589
|
-
for (const e of await scanDirectory(libraryPath, repoName)) {
|
|
3590
|
-
const root = path34.relative(libraryPath, path34.dirname(e.source)) || e.name;
|
|
3591
|
-
upsertManifestAsset(libraryPath, {
|
|
3592
|
-
kind: e.kind,
|
|
3593
|
-
name: e.name,
|
|
3594
|
-
root,
|
|
3595
|
-
version: e.version
|
|
3596
|
-
});
|
|
3597
|
-
}
|
|
3598
|
-
return removed;
|
|
3599
|
-
}
|
|
3600
3736
|
async function printPerLibraryStatus(name, asJson) {
|
|
3601
3737
|
const { manager, close } = await openLibraryManager();
|
|
3602
3738
|
try {
|
|
@@ -3635,9 +3771,9 @@ async function printOverallStatus(projectDir, asJson) {
|
|
|
3635
3771
|
} catch {
|
|
3636
3772
|
secretsStrategy = "unavailable";
|
|
3637
3773
|
}
|
|
3638
|
-
const resolvedProjectDir =
|
|
3639
|
-
const hasWorkspaceConfig = existsSync(
|
|
3640
|
-
const hasLockFile = existsSync(
|
|
3774
|
+
const resolvedProjectDir = path36.resolve(projectDir);
|
|
3775
|
+
const hasWorkspaceConfig = existsSync(path36.join(resolvedProjectDir, "skaile.yaml"));
|
|
3776
|
+
const hasLockFile = existsSync(path36.join(resolvedProjectDir, "skaile.lock.yaml"));
|
|
3641
3777
|
let assignments = [];
|
|
3642
3778
|
if (hasWorkspaceConfig) {
|
|
3643
3779
|
try {
|
|
@@ -4244,7 +4380,7 @@ function scheduleSoftDepPreview() {
|
|
|
4244
4380
|
}
|
|
4245
4381
|
async function loadAssets() {
|
|
4246
4382
|
softDepPreviewCache.clear();
|
|
4247
|
-
const { gatherAssetFeeds } = await import('../asset-feeds-
|
|
4383
|
+
const { gatherAssetFeeds } = await import('../asset-feeds-VIZXYDAO.js');
|
|
4248
4384
|
const { entries, notes } = await gatherAssetFeeds(am, am.projectDir);
|
|
4249
4385
|
if (notes.length > 0) {
|
|
4250
4386
|
state.message = notes.map((n) => `[${n.feed}] ${n.message}`).join(" \u2022 ");
|
|
@@ -4264,7 +4400,7 @@ function rebuildSourceTree() {
|
|
|
4264
4400
|
rebuildVisibleSources();
|
|
4265
4401
|
}
|
|
4266
4402
|
function sourceOrgRepo(s) {
|
|
4267
|
-
const parts = s.path.split(
|
|
4403
|
+
const parts = s.path.split(path36__default.sep).filter(Boolean);
|
|
4268
4404
|
if (parts.length < 2) return null;
|
|
4269
4405
|
return { org: parts[parts.length - 2], repo: parts[parts.length - 1] };
|
|
4270
4406
|
}
|
|
@@ -4411,13 +4547,13 @@ function reconcileCollapsedSets(rows) {
|
|
|
4411
4547
|
async function loadSourcesAndLibraries() {
|
|
4412
4548
|
try {
|
|
4413
4549
|
const [{ openLibraryManager: openLibraryManager2 }, { getGlobalCacheDir: getGlobalCacheDir2, globalSkaileDir: globalSkaileDir2 }] = await Promise.all([
|
|
4414
|
-
import('../open-library-
|
|
4550
|
+
import('../open-library-AT6RYQ5M.js'),
|
|
4415
4551
|
import('../core/index.js')
|
|
4416
4552
|
]);
|
|
4417
4553
|
const { manager, library, close } = await openLibraryManager2();
|
|
4418
4554
|
try {
|
|
4419
4555
|
const newRoot = getGlobalCacheDir2();
|
|
4420
|
-
const legacyRoot =
|
|
4556
|
+
const legacyRoot = path36__default.join(globalSkaileDir2(), "sources");
|
|
4421
4557
|
const isSourceRow = (l) => l.path.startsWith(newRoot) || l.path.startsWith(legacyRoot);
|
|
4422
4558
|
const libs = await manager.listLibraries();
|
|
4423
4559
|
const defs = await library.listAssetDefs();
|
|
@@ -4854,10 +4990,10 @@ async function showInfo() {
|
|
|
4854
4990
|
}
|
|
4855
4991
|
console.log();
|
|
4856
4992
|
console.log(pc5.dim(" Press any key to return..."));
|
|
4857
|
-
await new Promise((
|
|
4993
|
+
await new Promise((resolve5) => {
|
|
4858
4994
|
const onData = () => {
|
|
4859
4995
|
process.stdin.removeListener("data", onData);
|
|
4860
|
-
|
|
4996
|
+
resolve5();
|
|
4861
4997
|
};
|
|
4862
4998
|
process.stdin.once("data", onData);
|
|
4863
4999
|
});
|
|
@@ -5353,13 +5489,13 @@ async function run(projectDir) {
|
|
|
5353
5489
|
}
|
|
5354
5490
|
function makeManageCommand() {
|
|
5355
5491
|
return new Command("manage").description("Interactive TUI for managing assets, sources, and libraries").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
5356
|
-
await run(
|
|
5492
|
+
await run(path36__default.resolve(opts.projectDir));
|
|
5357
5493
|
});
|
|
5358
5494
|
}
|
|
5359
5495
|
function makeMcpServerCommand() {
|
|
5360
5496
|
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) => {
|
|
5361
|
-
const
|
|
5362
|
-
const projectDir =
|
|
5497
|
+
const path39 = await import('path');
|
|
5498
|
+
const projectDir = path39.default.resolve(opts.projectDir);
|
|
5363
5499
|
const { LogStore, StdoutSink, registerLogStore } = await import('../core/logging.js');
|
|
5364
5500
|
registerLogStore(
|
|
5365
5501
|
new LogStore({
|
|
@@ -5529,7 +5665,7 @@ function workspaceConfigFiles(dir) {
|
|
|
5529
5665
|
} catch {
|
|
5530
5666
|
return [];
|
|
5531
5667
|
}
|
|
5532
|
-
return names.filter((name) => isWorkspaceConfigFilename(name)).sort().map((name) =>
|
|
5668
|
+
return names.filter((name) => isWorkspaceConfigFilename(name)).sort().map((name) => path36__default.join(dir, name));
|
|
5533
5669
|
}
|
|
5534
5670
|
function readAgentConfigBlock(raw) {
|
|
5535
5671
|
const key = AGENT_CONFIG_KEYS.find((candidate) => raw[candidate] !== void 0);
|
|
@@ -5541,7 +5677,7 @@ function readAgentConfigBlock(raw) {
|
|
|
5541
5677
|
return flat ? { key, profiles: { default: profiles }, flat } : { key, profiles, flat };
|
|
5542
5678
|
}
|
|
5543
5679
|
function planProviderMigration(options) {
|
|
5544
|
-
const projectDir =
|
|
5680
|
+
const projectDir = path36__default.resolve(options.projectDir);
|
|
5545
5681
|
const registryPath = options.workspace ? workspaceProviderRegistryPath(projectDir) : userProviderRegistryPath();
|
|
5546
5682
|
const plan = {
|
|
5547
5683
|
registryPath,
|
|
@@ -5557,7 +5693,7 @@ function planProviderMigration(options) {
|
|
|
5557
5693
|
raw = parseDocument(readFileSync(file, "utf-8")).toJS() ?? {};
|
|
5558
5694
|
} catch (error) {
|
|
5559
5695
|
plan.warnings.push(
|
|
5560
|
-
`${
|
|
5696
|
+
`${path36__default.basename(file)}: not valid YAML (${error instanceof Error ? error.message : String(error)}) \u2014 skipped`
|
|
5561
5697
|
);
|
|
5562
5698
|
continue;
|
|
5563
5699
|
}
|
|
@@ -5606,7 +5742,7 @@ function planProviderMigration(options) {
|
|
|
5606
5742
|
});
|
|
5607
5743
|
if (!model) {
|
|
5608
5744
|
plan.warnings.push(
|
|
5609
|
-
`${
|
|
5745
|
+
`${path36__default.basename(file)}: profile '${profile}' had no model: \u2014 it now resolves against registry order. Pin it with 'model: ${providerId}/<modelId>'.`
|
|
5610
5746
|
);
|
|
5611
5747
|
}
|
|
5612
5748
|
touched = true;
|
|
@@ -5673,7 +5809,7 @@ function printPlan(plan) {
|
|
|
5673
5809
|
for (const entry of plan.entries) {
|
|
5674
5810
|
const base = entry.entry.base_url ?? S.dim("(transport-derived)");
|
|
5675
5811
|
console.log(
|
|
5676
|
-
` ${S.label(`${
|
|
5812
|
+
` ${S.label(`${path36__default.basename(entry.file)} ${entry.profile}`)} provider: ${entry.legacy.provider}, cloud: ${entry.legacy.cloud}`
|
|
5677
5813
|
);
|
|
5678
5814
|
console.log(` \u2192 providers.yml ${S.bold(entry.providerId)} ${base}`);
|
|
5679
5815
|
console.log(
|
|
@@ -5689,7 +5825,7 @@ function printPlan(plan) {
|
|
|
5689
5825
|
console.log();
|
|
5690
5826
|
}
|
|
5691
5827
|
async function runMigrateProviders(opts) {
|
|
5692
|
-
const projectDir = opts.projectDir ?
|
|
5828
|
+
const projectDir = opts.projectDir ? path36__default.resolve(opts.projectDir) : process.cwd();
|
|
5693
5829
|
const plan = planProviderMigration({ projectDir, workspace: opts.workspace });
|
|
5694
5830
|
for (const warning of plan.warnings) logWarn(warning);
|
|
5695
5831
|
if (plan.entries.length === 0 && Object.keys(plan.providers).length === 0) {
|
|
@@ -5749,8 +5885,8 @@ function makeNpxCommand() {
|
|
|
5749
5885
|
skills.command("add <url>").description(
|
|
5750
5886
|
"Clone a repo, register it in the project's skaile.yaml sources[], and install a skill from it"
|
|
5751
5887
|
).requiredOption("--skill <name>", "Skill name to install from the repo").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", `Agent framework (${TARGET_DEFAULT_HINT})`).option("--global", "Deploy globally").action(async (url, opts) => {
|
|
5752
|
-
const projectDir =
|
|
5753
|
-
const projYaml =
|
|
5888
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
5889
|
+
const projYaml = path36__default.join(projectDir, "skaile.yaml");
|
|
5754
5890
|
if (!existsSync(projYaml)) {
|
|
5755
5891
|
logErr(`No skaile.yaml in ${projectDir} \u2014 run \`skaile init\` first.`);
|
|
5756
5892
|
process.exit(1);
|
|
@@ -5763,11 +5899,11 @@ function makeNpxCommand() {
|
|
|
5763
5899
|
}
|
|
5764
5900
|
const spinner4 = p5.spinner();
|
|
5765
5901
|
const key = sourceCacheKey(url);
|
|
5766
|
-
const clonePath =
|
|
5902
|
+
const clonePath = path36__default.join(getGlobalCacheDir(), key);
|
|
5767
5903
|
spinner4.start(`Cloning ${url}`);
|
|
5768
5904
|
try {
|
|
5769
5905
|
if (!existsSync(clonePath)) {
|
|
5770
|
-
mkdirSync(
|
|
5906
|
+
mkdirSync(path36__default.dirname(clonePath), { recursive: true });
|
|
5771
5907
|
execSync(`git clone ${url} ${clonePath}`, { stdio: "ignore" });
|
|
5772
5908
|
}
|
|
5773
5909
|
spinner4.stop(`Cloned to ${key}`);
|
|
@@ -5813,7 +5949,7 @@ function makeNpxCommand() {
|
|
|
5813
5949
|
return npx;
|
|
5814
5950
|
}
|
|
5815
5951
|
function resolvePublisher(clonePath, url) {
|
|
5816
|
-
const manifestPath =
|
|
5952
|
+
const manifestPath = path36__default.join(clonePath, SKAILE_MANIFEST_FILENAME);
|
|
5817
5953
|
if (existsSync(manifestPath)) {
|
|
5818
5954
|
try {
|
|
5819
5955
|
const { manifest } = decodeSkaileManifest(readFileSync(manifestPath, "utf8"));
|
|
@@ -5826,12 +5962,12 @@ function resolvePublisher(clonePath, url) {
|
|
|
5826
5962
|
return url.match(/github\.com[/:]([^/]+)\/[^/]+/)?.[1];
|
|
5827
5963
|
}
|
|
5828
5964
|
function resolveSkillName(clonePath, requested) {
|
|
5829
|
-
const skillsDir =
|
|
5830
|
-
if (existsSync(
|
|
5965
|
+
const skillsDir = path36__default.join(clonePath, "skills");
|
|
5966
|
+
if (existsSync(path36__default.join(skillsDir, requested, "SKILL.md"))) return requested;
|
|
5831
5967
|
if (!existsSync(skillsDir)) return requested;
|
|
5832
5968
|
for (const entry of readdirSync(skillsDir, { withFileTypes: true })) {
|
|
5833
5969
|
if (!entry.isDirectory()) continue;
|
|
5834
|
-
const md =
|
|
5970
|
+
const md = path36__default.join(skillsDir, entry.name, "SKILL.md");
|
|
5835
5971
|
if (!existsSync(md)) continue;
|
|
5836
5972
|
try {
|
|
5837
5973
|
const { data } = parseFrontmatter(readFileSync(md, "utf8"));
|
|
@@ -5861,7 +5997,7 @@ function makeOutdatedCommand() {
|
|
|
5861
5997
|
)
|
|
5862
5998
|
).action(async (filter, opts) => {
|
|
5863
5999
|
const am2 = new AssetManager({
|
|
5864
|
-
projectDir:
|
|
6000
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
5865
6001
|
driverTarget: opts.target
|
|
5866
6002
|
});
|
|
5867
6003
|
const entries = await am2.outdated();
|
|
@@ -5879,19 +6015,24 @@ function makeOutdatedCommand() {
|
|
|
5879
6015
|
console.log(S.heading(" Outdated Assets"));
|
|
5880
6016
|
console.log(` ${S.rule(refW + 34)}`);
|
|
5881
6017
|
for (const e of filtered) {
|
|
5882
|
-
const status4 = e.library !== void 0 ? `${e.currentVersion} \u2192 ${e.latestVersion} ${S.dim(`(library ${e.library})`)}` : `${e.behind} commit(s) behind`;
|
|
6018
|
+
const status4 = e.problem !== void 0 ? e.problem : e.library !== void 0 ? `${e.currentVersion} \u2192 ${e.latestVersion} ${S.dim(`(library ${e.library})`)}` : `${e.behind} commit(s) behind`;
|
|
5883
6019
|
console.log(
|
|
5884
|
-
` ${colorRef(outdatedRef(e))}${" ".repeat(refW - outdatedRef(e).length)} ${pc5.yellow(status4)}`
|
|
6020
|
+
` ${colorRef(outdatedRef(e))}${" ".repeat(refW - outdatedRef(e).length)} ${e.problem !== void 0 ? pc5.red(status4) : pc5.yellow(status4)}`
|
|
5885
6021
|
);
|
|
5886
6022
|
}
|
|
5887
6023
|
console.log();
|
|
5888
|
-
|
|
6024
|
+
if (filtered.some((e) => e.problem === void 0)) {
|
|
6025
|
+
logWarn(`Run ${S.cmd("skaile update")} to re-deploy.`);
|
|
6026
|
+
}
|
|
6027
|
+
if (filtered.some((e) => e.problem !== void 0)) {
|
|
6028
|
+
logWarn(`Run ${S.cmd("skaile install")} to restore or re-lock the broken assets.`);
|
|
6029
|
+
}
|
|
5889
6030
|
});
|
|
5890
6031
|
}
|
|
5891
6032
|
function makePatchCommand() {
|
|
5892
6033
|
const cmd = new Command("patch").description("Patch workflow for skill improvement");
|
|
5893
6034
|
cmd.command("extract <ref>").alias("start").description("Extract asset for local editing").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
5894
|
-
const am2 = new AssetManager({ projectDir:
|
|
6035
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
5895
6036
|
try {
|
|
5896
6037
|
const dest = await am2.patch(ref);
|
|
5897
6038
|
logOk(`Extracted to ${S.dim(dest)}`);
|
|
@@ -5902,7 +6043,7 @@ function makePatchCommand() {
|
|
|
5902
6043
|
}
|
|
5903
6044
|
});
|
|
5904
6045
|
cmd.command("commit <ref>").description("Generate .patch file from edits").option("--project-dir <path>", "Project directory", process.cwd()).action(async (ref, opts) => {
|
|
5905
|
-
const am2 = new AssetManager({ projectDir:
|
|
6046
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
5906
6047
|
try {
|
|
5907
6048
|
const patchFile = await am2.patchCommit(ref);
|
|
5908
6049
|
logOk(`Patch saved to ${S.dim(patchFile)}`);
|
|
@@ -5913,7 +6054,7 @@ function makePatchCommand() {
|
|
|
5913
6054
|
}
|
|
5914
6055
|
});
|
|
5915
6056
|
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) => {
|
|
5916
|
-
const am2 = new AssetManager({ projectDir:
|
|
6057
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
5917
6058
|
try {
|
|
5918
6059
|
await am2.patchSubmit(ref);
|
|
5919
6060
|
logOk("Patch applied to repo clone and committed.");
|
|
@@ -5926,7 +6067,7 @@ function makePatchCommand() {
|
|
|
5926
6067
|
}
|
|
5927
6068
|
});
|
|
5928
6069
|
cmd.command("remove <ref>").description("Remove local patch after upstream merge").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
|
|
5929
|
-
const am2 = new AssetManager({ projectDir:
|
|
6070
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
5930
6071
|
am2.patchRemove(ref);
|
|
5931
6072
|
logOk(`Patch removed for ${ref}`);
|
|
5932
6073
|
});
|
|
@@ -5944,7 +6085,7 @@ function action2(fn) {
|
|
|
5944
6085
|
};
|
|
5945
6086
|
}
|
|
5946
6087
|
async function reconcileAndReport(projectDir, plugins) {
|
|
5947
|
-
const { reconcilePlugins } = await import('../plugin-store-
|
|
6088
|
+
const { reconcilePlugins } = await import('../plugin-store-27KGLW4S.js');
|
|
5948
6089
|
if (plugins.length === 0) {
|
|
5949
6090
|
logInfo("No plugins declared \u2014 nothing to reconcile.");
|
|
5950
6091
|
return;
|
|
@@ -5958,10 +6099,10 @@ async function reconcileAndReport(projectDir, plugins) {
|
|
|
5958
6099
|
}
|
|
5959
6100
|
}
|
|
5960
6101
|
async function runInstall2(spec, opts) {
|
|
5961
|
-
const projectDir =
|
|
6102
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
5962
6103
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
5963
|
-
const { specName } = await import('../plugin-store-
|
|
5964
|
-
const yamlPath =
|
|
6104
|
+
const { specName } = await import('../plugin-store-27KGLW4S.js');
|
|
6105
|
+
const yamlPath = path36__default.join(projectDir, "skaile.yaml");
|
|
5965
6106
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
5966
6107
|
const replaced = editor.addPlugin(spec, specName);
|
|
5967
6108
|
editor.save();
|
|
@@ -5970,10 +6111,10 @@ async function runInstall2(spec, opts) {
|
|
|
5970
6111
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
5971
6112
|
}
|
|
5972
6113
|
async function runRemove(name, opts) {
|
|
5973
|
-
const projectDir =
|
|
6114
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
5974
6115
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
5975
|
-
const { specName } = await import('../plugin-store-
|
|
5976
|
-
const yamlPath =
|
|
6116
|
+
const { specName } = await import('../plugin-store-27KGLW4S.js');
|
|
6117
|
+
const yamlPath = path36__default.join(projectDir, "skaile.yaml");
|
|
5977
6118
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
5978
6119
|
const removed = editor.removePlugin(name, specName);
|
|
5979
6120
|
if (!removed) {
|
|
@@ -5985,7 +6126,7 @@ async function runRemove(name, opts) {
|
|
|
5985
6126
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
5986
6127
|
}
|
|
5987
6128
|
async function runList(opts) {
|
|
5988
|
-
const projectDir =
|
|
6129
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
5989
6130
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
5990
6131
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
5991
6132
|
const declared = config.plugins ?? [];
|
|
@@ -6000,7 +6141,7 @@ async function runList(opts) {
|
|
|
6000
6141
|
const registry = createPluginRegistry();
|
|
6001
6142
|
if (declared.length > 0) {
|
|
6002
6143
|
try {
|
|
6003
|
-
const { loadPlugins } = await import('../plugin-store-
|
|
6144
|
+
const { loadPlugins } = await import('../plugin-store-27KGLW4S.js');
|
|
6004
6145
|
const result = await loadPlugins(projectDir, declared, registry);
|
|
6005
6146
|
for (const f of result.failed) logWarn(f.error);
|
|
6006
6147
|
} catch (err) {
|
|
@@ -6081,11 +6222,11 @@ function presetItemsToWorkspace(preset, values) {
|
|
|
6081
6222
|
}
|
|
6082
6223
|
function resolveItemConfig(item, preset, values, envVarsToSet) {
|
|
6083
6224
|
const byKey = placeholderIndex(item, preset);
|
|
6084
|
-
const
|
|
6225
|
+
const resolve5 = (key) => {
|
|
6085
6226
|
const ph = byKey.get(key) ?? { key, type: "text", required: true };
|
|
6086
6227
|
return resolvePlaceholderValue(ph, values[key]);
|
|
6087
6228
|
};
|
|
6088
|
-
return substituteNode(item.config ?? {},
|
|
6229
|
+
return substituteNode(item.config ?? {}, resolve5, envVarsToSet);
|
|
6089
6230
|
}
|
|
6090
6231
|
function placeholderIndex(item, preset) {
|
|
6091
6232
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -6093,20 +6234,20 @@ function placeholderIndex(item, preset) {
|
|
|
6093
6234
|
for (const ph of item.placeholders ?? []) map.set(ph.key, ph);
|
|
6094
6235
|
return map;
|
|
6095
6236
|
}
|
|
6096
|
-
function substituteNode(node,
|
|
6097
|
-
if (typeof node === "string") return substituteString(node,
|
|
6098
|
-
if (Array.isArray(node)) return node.map((el) => substituteNode(el,
|
|
6237
|
+
function substituteNode(node, resolve5, envVarsToSet) {
|
|
6238
|
+
if (typeof node === "string") return substituteString(node, resolve5, envVarsToSet);
|
|
6239
|
+
if (Array.isArray(node)) return node.map((el) => substituteNode(el, resolve5, envVarsToSet));
|
|
6099
6240
|
if (node && typeof node === "object") {
|
|
6100
6241
|
const out = {};
|
|
6101
|
-
for (const [k, v] of Object.entries(node)) out[k] = substituteNode(v,
|
|
6242
|
+
for (const [k, v] of Object.entries(node)) out[k] = substituteNode(v, resolve5, envVarsToSet);
|
|
6102
6243
|
return out;
|
|
6103
6244
|
}
|
|
6104
6245
|
return node;
|
|
6105
6246
|
}
|
|
6106
|
-
function substituteString(value,
|
|
6247
|
+
function substituteString(value, resolve5, envVarsToSet) {
|
|
6107
6248
|
const tokens = [...value.matchAll(TOKEN_RE)];
|
|
6108
6249
|
if (tokens.length === 0) return value;
|
|
6109
|
-
const secret = tokens.find(([, ns]) => ns === "SECRET") ?? tokens.find(([, , key]) => "envRef" in
|
|
6250
|
+
const secret = tokens.find(([, ns]) => ns === "SECRET") ?? tokens.find(([, , key]) => "envRef" in resolve5(key));
|
|
6110
6251
|
if (secret) {
|
|
6111
6252
|
const [full, , key] = secret;
|
|
6112
6253
|
if (tokens.length > 1 || full !== value) {
|
|
@@ -6118,7 +6259,7 @@ function substituteString(value, resolve4, envVarsToSet) {
|
|
|
6118
6259
|
return `env:${key}`;
|
|
6119
6260
|
}
|
|
6120
6261
|
return value.replace(TOKEN_RE, (_m, _ns, key) => {
|
|
6121
|
-
const resolved =
|
|
6262
|
+
const resolved = resolve5(key);
|
|
6122
6263
|
return "envRef" in resolved ? resolved.envRef : resolved.value;
|
|
6123
6264
|
});
|
|
6124
6265
|
}
|
|
@@ -6175,7 +6316,7 @@ function neededSources(config, lock) {
|
|
|
6175
6316
|
}
|
|
6176
6317
|
function sourcesWithSidecar(sources) {
|
|
6177
6318
|
const dir = getStoreManifestsDir();
|
|
6178
|
-
return sources.filter((s) => existsSync(
|
|
6319
|
+
return sources.filter((s) => existsSync(path36.join(dir, `${storeManifestSlug(s.url)}.yaml`))).map((s) => s.url);
|
|
6179
6320
|
}
|
|
6180
6321
|
function compact(obj) {
|
|
6181
6322
|
const out = {};
|
|
@@ -6267,8 +6408,8 @@ function redactSecrets(preset, findings) {
|
|
|
6267
6408
|
}
|
|
6268
6409
|
return { preset: next, keys };
|
|
6269
6410
|
}
|
|
6270
|
-
function placeholderKey(itemId,
|
|
6271
|
-
return `${itemId}_${
|
|
6411
|
+
function placeholderKey(itemId, path39) {
|
|
6412
|
+
return `${itemId}_${path39}`.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
|
|
6272
6413
|
}
|
|
6273
6414
|
function setAtPath(root, segments, value) {
|
|
6274
6415
|
let node = root;
|
|
@@ -6291,7 +6432,7 @@ function makePresetCommand() {
|
|
|
6291
6432
|
cmd.command("init [name]").description("Scaffold a new .preset.yaml file").option("--dir <path>", "Output directory", process.cwd()).action(async (name, opts) => {
|
|
6292
6433
|
const presetName = name ?? "my-preset";
|
|
6293
6434
|
const filename = `${presetName}.preset.yaml`;
|
|
6294
|
-
const outPath =
|
|
6435
|
+
const outPath = path36__default.join(path36__default.resolve(opts.dir), filename);
|
|
6295
6436
|
if (existsSync(outPath)) {
|
|
6296
6437
|
logErr(`File already exists: ${outPath}`);
|
|
6297
6438
|
logInfo("Choose a different name or remove the existing file.");
|
|
@@ -6324,7 +6465,7 @@ function makePresetCommand() {
|
|
|
6324
6465
|
return cmd;
|
|
6325
6466
|
}
|
|
6326
6467
|
async function runPresetExport(name, opts) {
|
|
6327
|
-
const projectDir =
|
|
6468
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6328
6469
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
6329
6470
|
if (!file) {
|
|
6330
6471
|
logErr(`No skaile.yaml found in ${projectDir}`);
|
|
@@ -6334,7 +6475,7 @@ async function runPresetExport(name, opts) {
|
|
|
6334
6475
|
const presetName = name ?? file.config.name ?? "my-preset";
|
|
6335
6476
|
let lock = null;
|
|
6336
6477
|
try {
|
|
6337
|
-
lock = readLock(
|
|
6478
|
+
lock = readLock(path36__default.join(projectDir, "skaile.lock.yaml"));
|
|
6338
6479
|
} catch {
|
|
6339
6480
|
lock = null;
|
|
6340
6481
|
}
|
|
@@ -6375,7 +6516,7 @@ async function runPresetExport(name, opts) {
|
|
|
6375
6516
|
const contents = header ? `${header}
|
|
6376
6517
|
${body}` : body;
|
|
6377
6518
|
if (opts.out && opts.dir !== process.cwd()) logWarn("--dir is ignored when --out is set.");
|
|
6378
|
-
const outPath = opts.out ?
|
|
6519
|
+
const outPath = opts.out ? path36__default.resolve(opts.out) : path36__default.join(path36__default.resolve(opts.dir), `${presetName}.preset.yaml`);
|
|
6379
6520
|
if (existsSync(outPath) && !opts.force) {
|
|
6380
6521
|
logErr(`File already exists: ${outPath}`);
|
|
6381
6522
|
logInfo("Pass --force to overwrite, or choose a different --out/--dir.");
|
|
@@ -6387,7 +6528,7 @@ ${body}` : body;
|
|
|
6387
6528
|
logErr(`Failed to write ${outPath}: ${e.message}`);
|
|
6388
6529
|
process.exit(1);
|
|
6389
6530
|
}
|
|
6390
|
-
logOk(`Exported ${S.brand(
|
|
6531
|
+
logOk(`Exported ${S.brand(path36__default.basename(outPath))}`);
|
|
6391
6532
|
logInfo(`Path: ${outPath}`);
|
|
6392
6533
|
if (unresolved.length > 0) {
|
|
6393
6534
|
console.error(S.err("This file is NOT safe to share."));
|
|
@@ -6428,13 +6569,13 @@ function collectInput(value, acc) {
|
|
|
6428
6569
|
return acc;
|
|
6429
6570
|
}
|
|
6430
6571
|
async function runPresetApply(filePath, opts) {
|
|
6431
|
-
const projectDir =
|
|
6572
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6432
6573
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
6433
6574
|
if (!file) {
|
|
6434
6575
|
logErr("No skaile.yaml \u2014 run `skaile init` first");
|
|
6435
6576
|
process.exit(1);
|
|
6436
6577
|
}
|
|
6437
|
-
const resolved =
|
|
6578
|
+
const resolved = path36__default.resolve(filePath);
|
|
6438
6579
|
if (!existsSync(resolved)) {
|
|
6439
6580
|
logErr(`File not found: ${resolved}`);
|
|
6440
6581
|
process.exit(1);
|
|
@@ -6650,7 +6791,7 @@ async function reportNestedPresetRefs(preset) {
|
|
|
6650
6791
|
}
|
|
6651
6792
|
async function checkPresetCycles(preset, resolved) {
|
|
6652
6793
|
const { detectCycles } = await import('../discovery/index.js');
|
|
6653
|
-
const presetRef =
|
|
6794
|
+
const presetRef = path36__default.basename(resolved, ".preset.yaml");
|
|
6654
6795
|
const edges = [];
|
|
6655
6796
|
for (const item of preset.items) {
|
|
6656
6797
|
if (item.ref) {
|
|
@@ -6702,7 +6843,7 @@ function printPresetSummary(preset, placeholderCount, hasWarnings) {
|
|
|
6702
6843
|
}
|
|
6703
6844
|
}
|
|
6704
6845
|
async function runPresetValidate(filePath) {
|
|
6705
|
-
const resolved =
|
|
6846
|
+
const resolved = path36__default.resolve(filePath);
|
|
6706
6847
|
const preset = await loadPresetForValidation(resolved);
|
|
6707
6848
|
await reportNestedPresetRefs(preset);
|
|
6708
6849
|
await checkPresetCycles(preset, resolved);
|
|
@@ -6752,11 +6893,11 @@ items:
|
|
|
6752
6893
|
}
|
|
6753
6894
|
function makeRebuildCommand() {
|
|
6754
6895
|
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) => {
|
|
6755
|
-
const projectDir =
|
|
6896
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6756
6897
|
let agentDir;
|
|
6757
6898
|
if (agentArg) {
|
|
6758
6899
|
if (agentArg.includes("/") || agentArg.includes("\\")) {
|
|
6759
|
-
agentDir =
|
|
6900
|
+
agentDir = path36__default.resolve(projectDir, agentArg);
|
|
6760
6901
|
} else {
|
|
6761
6902
|
let resolved;
|
|
6762
6903
|
try {
|
|
@@ -6765,7 +6906,7 @@ function makeRebuildCommand() {
|
|
|
6765
6906
|
if (!(err instanceof AgentRefResolutionError)) throw err;
|
|
6766
6907
|
logWarn(`${err.message} \u2014 using "${agentArg}"`);
|
|
6767
6908
|
}
|
|
6768
|
-
agentDir = resolved ??
|
|
6909
|
+
agentDir = resolved ?? path36__default.resolve(projectDir, agentArg);
|
|
6769
6910
|
}
|
|
6770
6911
|
} else {
|
|
6771
6912
|
let resolved;
|
|
@@ -6866,7 +7007,7 @@ function makeFlowEventHandler() {
|
|
|
6866
7007
|
}
|
|
6867
7008
|
function makeRunCommand() {
|
|
6868
7009
|
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>", "Harness to run (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) => {
|
|
6869
|
-
const projectDir =
|
|
7010
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6870
7011
|
const cliDriver = opts.driver;
|
|
6871
7012
|
const dryRun = opts.dryRun ?? false;
|
|
6872
7013
|
let flowId = positional[0];
|
|
@@ -6894,7 +7035,7 @@ function makeRunCommand() {
|
|
|
6894
7035
|
driver: cliDriver,
|
|
6895
7036
|
model: opts.model
|
|
6896
7037
|
});
|
|
6897
|
-
const driver = config.driver ??
|
|
7038
|
+
const driver = config.driver ?? DEFAULT_DRIVER_ID;
|
|
6898
7039
|
const model = config.model;
|
|
6899
7040
|
const flowPath = await findFlowFileWithLibraries(
|
|
6900
7041
|
flowId,
|
|
@@ -6967,7 +7108,7 @@ function makeRunCommand() {
|
|
|
6967
7108
|
}
|
|
6968
7109
|
function makeResumeCommand() {
|
|
6969
7110
|
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) => {
|
|
6970
|
-
const projectDir =
|
|
7111
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6971
7112
|
const sessionId = opts.session;
|
|
6972
7113
|
const dryRun = opts.dryRun ?? false;
|
|
6973
7114
|
const session = sessionId ? await loadSessionById(projectDir, sessionId) : await loadSession(projectDir);
|
|
@@ -6994,7 +7135,7 @@ function makeResumeCommand() {
|
|
|
6994
7135
|
}
|
|
6995
7136
|
function makeStatusCommand() {
|
|
6996
7137
|
return new Command("status").description("Show current session state").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
6997
|
-
const projectDir =
|
|
7138
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
6998
7139
|
const session = await loadSession(projectDir);
|
|
6999
7140
|
if (!session) {
|
|
7000
7141
|
logInfo("No active session.");
|
|
@@ -7019,7 +7160,7 @@ function makeStatusCommand() {
|
|
|
7019
7160
|
}
|
|
7020
7161
|
function makeClearCommand() {
|
|
7021
7162
|
return new Command("clear").description("Unset current session pointer").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7022
|
-
const projectDir =
|
|
7163
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7023
7164
|
await clearSession(projectDir);
|
|
7024
7165
|
logOk("Session cleared.");
|
|
7025
7166
|
});
|
|
@@ -7028,8 +7169,8 @@ function makeReplCommand() {
|
|
|
7028
7169
|
return new Command("repl").description("Start an interactive agent session").option("--project-dir <path>", "Project directory").option("--driver <name>", "Harness to run (claude-sdk, omp)").option("--model <name>", "Model override").option("--resume", "Resume last session").option("--resume-session <id>", "Resume specific session").action(async (opts) => {
|
|
7029
7170
|
const { findWorkspaceRoot } = await import('../core/index.js');
|
|
7030
7171
|
const { startRepl } = await import('../tui/index.js');
|
|
7031
|
-
const
|
|
7032
|
-
const userCwd =
|
|
7172
|
+
const os2 = await import('os');
|
|
7173
|
+
const userCwd = path36__default.resolve(opts.projectDir ?? process.cwd());
|
|
7033
7174
|
const workspaceRoot = findWorkspaceRoot(userCwd);
|
|
7034
7175
|
let projectDir;
|
|
7035
7176
|
let agentCwd;
|
|
@@ -7051,13 +7192,13 @@ function makeReplCommand() {
|
|
|
7051
7192
|
p5.cancel("Cancelled.");
|
|
7052
7193
|
process.exit(0);
|
|
7053
7194
|
}
|
|
7054
|
-
const tmpDir =
|
|
7195
|
+
const tmpDir = fs12__default.mkdtempSync(path36__default.join(os2.tmpdir(), "skaile-repl-"));
|
|
7055
7196
|
projectDir = tmpDir;
|
|
7056
7197
|
agentCwd = userCwd;
|
|
7057
7198
|
logOk(`Temporary workspace: ${S.cmd(tmpDir)}`);
|
|
7058
7199
|
if (!driverOverride) {
|
|
7059
|
-
const claudeDir =
|
|
7060
|
-
if (
|
|
7200
|
+
const claudeDir = path36__default.join(os2.homedir(), ".claude");
|
|
7201
|
+
if (fs12__default.existsSync(claudeDir)) {
|
|
7061
7202
|
driverOverride = "claude-sdk";
|
|
7062
7203
|
logInfo(`Detected ${S.cmd("~/.claude")} \u2192 using ${S.cmd("claude-sdk")} harness`);
|
|
7063
7204
|
} else {
|
|
@@ -7129,12 +7270,12 @@ function makeServeCommand() {
|
|
|
7129
7270
|
);
|
|
7130
7271
|
}
|
|
7131
7272
|
async function ensurePluginsLoadedForServe(projectDir) {
|
|
7132
|
-
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-
|
|
7273
|
+
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-HV5Y57CY.js');
|
|
7133
7274
|
try {
|
|
7134
7275
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
7135
7276
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
7136
7277
|
if (!config.plugins || config.plugins.length === 0) return;
|
|
7137
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
7278
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-27KGLW4S.js');
|
|
7138
7279
|
const { pluginRegistry } = await import('../plugin-registry/index.js');
|
|
7139
7280
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
7140
7281
|
if (result.loaded.length > 0) {
|
|
@@ -7148,23 +7289,23 @@ async function ensurePluginsLoadedForServe(projectDir) {
|
|
|
7148
7289
|
}
|
|
7149
7290
|
}
|
|
7150
7291
|
async function runCompileTest(opts) {
|
|
7151
|
-
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-
|
|
7292
|
+
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-HV5Y57CY.js');
|
|
7152
7293
|
const { tmpdir } = await import('os');
|
|
7153
|
-
const { dirname: dirname3, join:
|
|
7294
|
+
const { dirname: dirname3, join: join7, resolve: resolve5 } = await import('path');
|
|
7154
7295
|
const { fileURLToPath: fileURLToPath2 } = await import('url');
|
|
7155
|
-
const { unlinkSync, existsSync:
|
|
7296
|
+
const { unlinkSync, existsSync: existsSync16 } = await import('fs');
|
|
7156
7297
|
const { spawn } = await import('child_process');
|
|
7157
7298
|
const { portableSpawnSync: portableSpawnSync2 } = await import('../core/index.js');
|
|
7158
|
-
const { MONOREPO_ROOT } = await import('../paths-
|
|
7299
|
+
const { MONOREPO_ROOT } = await import('../paths-P7ZXMDCX.js');
|
|
7159
7300
|
if (MONOREPO_ROOT === null) {
|
|
7160
7301
|
logErr2("--compile-test is only available inside the skaile-dev workspace.");
|
|
7161
7302
|
logInfo2("Run it from a checkout of skaile-ai/skaile-dev (the monorepo shell).");
|
|
7162
7303
|
process.exitCode = 2;
|
|
7163
7304
|
return;
|
|
7164
7305
|
}
|
|
7165
|
-
const outfile =
|
|
7306
|
+
const outfile = join7(tmpdir(), `skaile-compile-test-${Date.now()}`);
|
|
7166
7307
|
const __thisFile = fileURLToPath2(import.meta.url);
|
|
7167
|
-
const entryPoint =
|
|
7308
|
+
const entryPoint = resolve5(dirname3(__thisFile), "..", "index.ts");
|
|
7168
7309
|
logInfo2(`Building compiled binary...`);
|
|
7169
7310
|
logInfo2(`Entry: ${S2.dim(entryPoint)}`);
|
|
7170
7311
|
logInfo2(`Output: ${S2.dim(outfile)}`);
|
|
@@ -7217,7 +7358,7 @@ async function runCompileTest(opts) {
|
|
|
7217
7358
|
} catch {
|
|
7218
7359
|
}
|
|
7219
7360
|
try {
|
|
7220
|
-
if (
|
|
7361
|
+
if (existsSync16(outfile)) unlinkSync(outfile);
|
|
7221
7362
|
} catch {
|
|
7222
7363
|
}
|
|
7223
7364
|
}
|
|
@@ -7470,19 +7611,19 @@ function buildTailSelect(q) {
|
|
|
7470
7611
|
return { sql, params };
|
|
7471
7612
|
}
|
|
7472
7613
|
function sleepUnlessAborted(ms, signal) {
|
|
7473
|
-
return new Promise((
|
|
7614
|
+
return new Promise((resolve5) => {
|
|
7474
7615
|
if (signal?.aborted) {
|
|
7475
|
-
|
|
7616
|
+
resolve5();
|
|
7476
7617
|
return;
|
|
7477
7618
|
}
|
|
7478
7619
|
const timer = setTimeout(() => {
|
|
7479
7620
|
signal?.removeEventListener("abort", onAbort);
|
|
7480
|
-
|
|
7621
|
+
resolve5();
|
|
7481
7622
|
}, ms);
|
|
7482
7623
|
const onAbort = () => {
|
|
7483
7624
|
clearTimeout(timer);
|
|
7484
7625
|
signal?.removeEventListener("abort", onAbort);
|
|
7485
|
-
|
|
7626
|
+
resolve5();
|
|
7486
7627
|
};
|
|
7487
7628
|
signal?.addEventListener("abort", onAbort, { once: true });
|
|
7488
7629
|
});
|
|
@@ -7569,7 +7710,7 @@ async function remoteTail(opts) {
|
|
|
7569
7710
|
]
|
|
7570
7711
|
});
|
|
7571
7712
|
const filter = makeFilter(opts.query);
|
|
7572
|
-
return new Promise((
|
|
7713
|
+
return new Promise((resolve5, reject) => {
|
|
7573
7714
|
let settled = false;
|
|
7574
7715
|
const finish = (err) => {
|
|
7575
7716
|
if (settled) return;
|
|
@@ -7580,11 +7721,11 @@ async function remoteTail(opts) {
|
|
|
7580
7721
|
}
|
|
7581
7722
|
opts.signal?.removeEventListener("abort", onAbort);
|
|
7582
7723
|
if (err) reject(err);
|
|
7583
|
-
else
|
|
7724
|
+
else resolve5();
|
|
7584
7725
|
};
|
|
7585
7726
|
const onAbort = () => finish();
|
|
7586
7727
|
if (opts.signal?.aborted) {
|
|
7587
|
-
|
|
7728
|
+
resolve5();
|
|
7588
7729
|
return;
|
|
7589
7730
|
}
|
|
7590
7731
|
opts.signal?.addEventListener("abort", onAbort, { once: true });
|
|
@@ -7638,7 +7779,7 @@ function resolveMode(opts) {
|
|
|
7638
7779
|
if (opts.forceLocal && opts.forceRemote) {
|
|
7639
7780
|
throw new Error("Cannot use both --local and --remote");
|
|
7640
7781
|
}
|
|
7641
|
-
const startDir =
|
|
7782
|
+
const startDir = path36__default.resolve(opts.projectDir ?? process.cwd());
|
|
7642
7783
|
const localDb = findLogsDb(startDir);
|
|
7643
7784
|
if (opts.forceLocal) {
|
|
7644
7785
|
if (!localDb) {
|
|
@@ -7671,14 +7812,14 @@ function resolveMode(opts) {
|
|
|
7671
7812
|
function findLogsDb(startDir) {
|
|
7672
7813
|
let dir = startDir;
|
|
7673
7814
|
for (let i = 0; i < MAX_WALK_LEVELS; i++) {
|
|
7674
|
-
const candidate =
|
|
7815
|
+
const candidate = path36__default.join(dir, ".skaile", "logs.db");
|
|
7675
7816
|
if (existsSync(candidate)) {
|
|
7676
7817
|
try {
|
|
7677
7818
|
if (statSync(candidate).isFile()) return candidate;
|
|
7678
7819
|
} catch {
|
|
7679
7820
|
}
|
|
7680
7821
|
}
|
|
7681
|
-
const parent =
|
|
7822
|
+
const parent = path36__default.dirname(dir);
|
|
7682
7823
|
if (parent === dir) return void 0;
|
|
7683
7824
|
dir = parent;
|
|
7684
7825
|
}
|
|
@@ -7853,7 +7994,7 @@ function parsePositiveInt(value, flag) {
|
|
|
7853
7994
|
function makeSessionCommand() {
|
|
7854
7995
|
const cmd = new Command("session").description("Manage sessions");
|
|
7855
7996
|
cmd.command("list").description("List all sessions for a project").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7856
|
-
const projectDir =
|
|
7997
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7857
7998
|
const sessions = await listSessions(projectDir);
|
|
7858
7999
|
const current = await loadSession(projectDir);
|
|
7859
8000
|
if (sessions.length === 0) {
|
|
@@ -7881,7 +8022,7 @@ function makeSessionCommand() {
|
|
|
7881
8022
|
console.log();
|
|
7882
8023
|
});
|
|
7883
8024
|
cmd.command("show <run-id>").description("Show a specific session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7884
|
-
const projectDir =
|
|
8025
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7885
8026
|
const session = await loadSessionById(projectDir, runId);
|
|
7886
8027
|
if (!session) {
|
|
7887
8028
|
logErr(`Session not found: ${runId}`);
|
|
@@ -7890,12 +8031,12 @@ function makeSessionCommand() {
|
|
|
7890
8031
|
console.log(JSON.stringify(session, null, 2));
|
|
7891
8032
|
});
|
|
7892
8033
|
cmd.command("switch <run-id>").description("Switch the current session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7893
|
-
const projectDir =
|
|
8034
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7894
8035
|
await setCurrentSession(projectDir, runId);
|
|
7895
8036
|
logOk(`Switched to session: ${S.dim(runId.slice(0, 8))}`);
|
|
7896
8037
|
});
|
|
7897
8038
|
cmd.command("delete <run-id>").description("Delete a session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7898
|
-
const projectDir =
|
|
8039
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
7899
8040
|
await deleteSession(projectDir, runId);
|
|
7900
8041
|
logOk(`Deleted session: ${S.dim(runId.slice(0, 8))}`);
|
|
7901
8042
|
});
|
|
@@ -7949,12 +8090,12 @@ function showOverview(am2) {
|
|
|
7949
8090
|
}
|
|
7950
8091
|
async function showAsset(am2, kind, name) {
|
|
7951
8092
|
const entry = await am2.info(`${kind}:${name}`);
|
|
7952
|
-
if (entry?.source &&
|
|
8093
|
+
if (entry?.source && fs12__default.existsSync(entry.source)) {
|
|
7953
8094
|
console.log();
|
|
7954
8095
|
console.log(` ${kindColor(entry.kind)} ${S.heading(entry.name)}`);
|
|
7955
8096
|
console.log(` ${S.rule(40)}`);
|
|
7956
8097
|
console.log();
|
|
7957
|
-
console.log(
|
|
8098
|
+
console.log(fs12__default.readFileSync(entry.source, "utf-8"));
|
|
7958
8099
|
return;
|
|
7959
8100
|
}
|
|
7960
8101
|
logErr(`Asset not found: ${kind}:${name}`);
|
|
@@ -7963,7 +8104,7 @@ async function showAsset(am2, kind, name) {
|
|
|
7963
8104
|
function makeShowCommand() {
|
|
7964
8105
|
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 (${TARGET_DEFAULT_HINT})`).action(async (kind, name, opts) => {
|
|
7965
8106
|
const am2 = new AssetManager({
|
|
7966
|
-
projectDir:
|
|
8107
|
+
projectDir: path36__default.resolve(opts.projectDir),
|
|
7967
8108
|
driverTarget: opts.target
|
|
7968
8109
|
});
|
|
7969
8110
|
if (!kind) {
|
|
@@ -8026,14 +8167,14 @@ function makeStoreCommand() {
|
|
|
8026
8167
|
});
|
|
8027
8168
|
store.command("mode <auto|local|remote>").description("Set the catalog resolution mode (not yet wired)").action((_mode) => {
|
|
8028
8169
|
logErr(
|
|
8029
|
-
|
|
8170
|
+
`\`skaile store mode\` is scaffolded but not yet wired. Store config lives at ${path36__default.join(globalSkaileDir(), "store", "config.yaml")}.`
|
|
8030
8171
|
);
|
|
8031
8172
|
process.exit(2);
|
|
8032
8173
|
});
|
|
8033
8174
|
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) => {
|
|
8034
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-
|
|
8175
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-AT6RYQ5M.js');
|
|
8035
8176
|
try {
|
|
8036
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
8177
|
+
const remote = await openCatalogSource2({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
8037
8178
|
const assets = await remote.listAssets(opts.kind ? { kind: opts.kind } : {});
|
|
8038
8179
|
const results = filterCatalogAssets(assets, query);
|
|
8039
8180
|
if (results.length === 0) {
|
|
@@ -8050,7 +8191,7 @@ function makeStoreCommand() {
|
|
|
8050
8191
|
} catch (e) {
|
|
8051
8192
|
if (e instanceof LocalCatalogDisabledError) {
|
|
8052
8193
|
logErr(
|
|
8053
|
-
|
|
8194
|
+
`Remote catalog disabled (catalog.url: local). Set \`catalog.url: https://skaile.store\` in ${userConfigPath()}.`
|
|
8054
8195
|
);
|
|
8055
8196
|
} else {
|
|
8056
8197
|
logErr(`Store search failed: ${e.message}`);
|
|
@@ -8059,10 +8200,10 @@ function makeStoreCommand() {
|
|
|
8059
8200
|
}
|
|
8060
8201
|
});
|
|
8061
8202
|
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) => {
|
|
8062
|
-
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-
|
|
8063
|
-
const { supportsInstallManifest } = await import('../project-
|
|
8203
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-AT6RYQ5M.js');
|
|
8204
|
+
const { supportsInstallManifest } = await import('../project-J2EROMBW.js');
|
|
8064
8205
|
try {
|
|
8065
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
8206
|
+
const remote = await openCatalogSource2({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
8066
8207
|
const asset = await remote.resolve(ref);
|
|
8067
8208
|
if (!asset) {
|
|
8068
8209
|
logErr(`Not found in store: ${ref} (try a full ref, e.g. skill:@publisher/name#version)`);
|
|
@@ -8112,7 +8253,7 @@ function makeStoreCommand() {
|
|
|
8112
8253
|
} catch (e) {
|
|
8113
8254
|
if (e instanceof LocalCatalogDisabledError) {
|
|
8114
8255
|
logErr(
|
|
8115
|
-
|
|
8256
|
+
`Remote catalog disabled (catalog.url: local). Set \`catalog.url: https://skaile.store\` in ${userConfigPath()}.`
|
|
8116
8257
|
);
|
|
8117
8258
|
} else {
|
|
8118
8259
|
logErr(`Store show failed: ${e.message}`);
|
|
@@ -8184,7 +8325,7 @@ function printTree(node, prefix = "", isLast = true) {
|
|
|
8184
8325
|
}
|
|
8185
8326
|
function makeTreeCommand() {
|
|
8186
8327
|
return new Command("tree").description("Show full dependency tree").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
8187
|
-
const am2 = new AssetManager({ projectDir:
|
|
8328
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
8188
8329
|
const root = am2.tree();
|
|
8189
8330
|
if (root.children.length === 0) {
|
|
8190
8331
|
logInfo("No dependencies in lock file. Run `skaile install` first.");
|
|
@@ -8210,7 +8351,7 @@ function makeUpdateCommand() {
|
|
|
8210
8351
|
const catalogSpinner = p5.spinner();
|
|
8211
8352
|
catalogSpinner.start("Refreshing catalog cache");
|
|
8212
8353
|
try {
|
|
8213
|
-
const remote = await openCatalogSource({ projectDir:
|
|
8354
|
+
const remote = await openCatalogSource({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
8214
8355
|
const result2 = await remote.refresh();
|
|
8215
8356
|
catalogSpinner.stop(
|
|
8216
8357
|
`Catalog refreshed: ${S.heading(String(result2.assetsCached))} assets cached`
|
|
@@ -8223,7 +8364,7 @@ function makeUpdateCommand() {
|
|
|
8223
8364
|
}
|
|
8224
8365
|
}
|
|
8225
8366
|
if (opts.catalogOnly) return;
|
|
8226
|
-
const projectDir =
|
|
8367
|
+
const projectDir = path36__default.resolve(opts.projectDir);
|
|
8227
8368
|
if (await shouldSyncSources(opts)) {
|
|
8228
8369
|
const syncSpinner = p5.spinner();
|
|
8229
8370
|
syncSpinner.start("Syncing sources");
|
|
@@ -8279,12 +8420,12 @@ function findManifestCandidates(rootPath) {
|
|
|
8279
8420
|
function walk(dir) {
|
|
8280
8421
|
let entries;
|
|
8281
8422
|
try {
|
|
8282
|
-
entries =
|
|
8423
|
+
entries = fs12__default.readdirSync(dir, { withFileTypes: true });
|
|
8283
8424
|
} catch {
|
|
8284
8425
|
return;
|
|
8285
8426
|
}
|
|
8286
8427
|
for (const entry of entries) {
|
|
8287
|
-
const fullPath =
|
|
8428
|
+
const fullPath = path36__default.join(dir, entry.name);
|
|
8288
8429
|
if (entry.isDirectory()) {
|
|
8289
8430
|
if (!SKIP_DIRS.has(entry.name)) walk(fullPath);
|
|
8290
8431
|
} else if (entry.isFile()) {
|
|
@@ -8300,11 +8441,6 @@ function findManifestCandidates(rootPath) {
|
|
|
8300
8441
|
walk(rootPath);
|
|
8301
8442
|
return candidates;
|
|
8302
8443
|
}
|
|
8303
|
-
function parseMdFrontmatter(content) {
|
|
8304
|
-
const fmMatch = content.match(/^---\n([\s\S]*?)\n---\n?/);
|
|
8305
|
-
if (!fmMatch) return null;
|
|
8306
|
-
return { frontmatter: parse(fmMatch[1]), body: content.slice(fmMatch[0].length).trim() };
|
|
8307
|
-
}
|
|
8308
8444
|
function checkManifestIdentity(kind, parsed) {
|
|
8309
8445
|
if (parsed === null || typeof parsed !== "object") return null;
|
|
8310
8446
|
const obj = parsed;
|
|
@@ -8325,25 +8461,20 @@ function checkManifestIdentity(kind, parsed) {
|
|
|
8325
8461
|
return null;
|
|
8326
8462
|
}
|
|
8327
8463
|
function parseManifestCandidate(c, absRoot) {
|
|
8328
|
-
const content =
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
return { kind: "skip" };
|
|
8333
|
-
}
|
|
8334
|
-
return { kind: "value", parsed: md.frontmatter, body: md.body };
|
|
8335
|
-
}
|
|
8336
|
-
try {
|
|
8337
|
-
const parsed = c.filePath.endsWith(".json") ? JSON.parse(content) : parse(content);
|
|
8338
|
-
return { kind: "value", parsed };
|
|
8339
|
-
} catch (e) {
|
|
8340
|
-
const relPath = path34__default.relative(absRoot, c.filePath);
|
|
8341
|
-
logErr(`${relPath} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
|
|
8464
|
+
const content = fs12__default.readFileSync(c.filePath, "utf-8");
|
|
8465
|
+
const res = parseManifestFile(c.filePath, content);
|
|
8466
|
+
if (!res.ok) {
|
|
8467
|
+
logErr(`${path36__default.relative(absRoot, c.filePath)} [${c.kind}] \u2014 parse error: ${res.reason}`);
|
|
8342
8468
|
return { kind: "error" };
|
|
8343
8469
|
}
|
|
8470
|
+
return {
|
|
8471
|
+
kind: "value",
|
|
8472
|
+
parsed: res.data,
|
|
8473
|
+
body: c.filePath.endsWith(".md") ? parseFrontmatter(content).body : void 0
|
|
8474
|
+
};
|
|
8344
8475
|
}
|
|
8345
8476
|
function validateManifestCandidate(c, parsed, body, absRoot, registry, strictConformance) {
|
|
8346
|
-
const relPath =
|
|
8477
|
+
const relPath = path36__default.relative(absRoot, c.filePath);
|
|
8347
8478
|
let errors = 0;
|
|
8348
8479
|
let warnings = 0;
|
|
8349
8480
|
const identityError = checkManifestIdentity(c.kind, parsed);
|
|
@@ -8352,7 +8483,7 @@ function validateManifestCandidate(c, parsed, body, absRoot, registry, strictCon
|
|
|
8352
8483
|
errors++;
|
|
8353
8484
|
}
|
|
8354
8485
|
if (c.kind === "skill" && parsed && typeof parsed === "object") {
|
|
8355
|
-
const dirName =
|
|
8486
|
+
const dirName = path36__default.basename(path36__default.dirname(c.filePath));
|
|
8356
8487
|
const findings = checkAgentSkillConformance(parsed, { dirName });
|
|
8357
8488
|
for (const f of findings) {
|
|
8358
8489
|
const line = `${relPath} [skill conformance] \u2014 ${f.field}: ${f.message}`;
|
|
@@ -8384,8 +8515,8 @@ function validateManifestCandidate(c, parsed, body, absRoot, registry, strictCon
|
|
|
8384
8515
|
return { errors, warnings };
|
|
8385
8516
|
}
|
|
8386
8517
|
function validateManifests(rootPath, strictConformance) {
|
|
8387
|
-
const absRoot =
|
|
8388
|
-
if (!
|
|
8518
|
+
const absRoot = path36__default.resolve(rootPath);
|
|
8519
|
+
if (!fs12__default.existsSync(absRoot)) {
|
|
8389
8520
|
logErr(`Path does not exist: ${absRoot}`);
|
|
8390
8521
|
return { total: 0, errors: 1, warnings: 0 };
|
|
8391
8522
|
}
|
|
@@ -8395,7 +8526,6 @@ function validateManifests(rootPath, strictConformance) {
|
|
|
8395
8526
|
let warnings = 0;
|
|
8396
8527
|
for (const c of candidates) {
|
|
8397
8528
|
const parseResult = parseManifestCandidate(c, absRoot);
|
|
8398
|
-
if (parseResult.kind === "skip") continue;
|
|
8399
8529
|
if (parseResult.kind === "error") {
|
|
8400
8530
|
errors++;
|
|
8401
8531
|
continue;
|
|
@@ -8418,12 +8548,12 @@ function findWorkspaceManifests(rootPath) {
|
|
|
8418
8548
|
function walk(dir) {
|
|
8419
8549
|
let entries;
|
|
8420
8550
|
try {
|
|
8421
|
-
entries =
|
|
8551
|
+
entries = fs12__default.readdirSync(dir, { withFileTypes: true });
|
|
8422
8552
|
} catch {
|
|
8423
8553
|
return;
|
|
8424
8554
|
}
|
|
8425
8555
|
for (const entry of entries) {
|
|
8426
|
-
const full =
|
|
8556
|
+
const full = path36__default.join(dir, entry.name);
|
|
8427
8557
|
if (entry.isDirectory()) {
|
|
8428
8558
|
if (!SKIP_DIRS.has(entry.name)) walk(full);
|
|
8429
8559
|
} else if (entry.isFile() && /(^|\.)skaile\.yaml$/.test(entry.name)) {
|
|
@@ -8486,14 +8616,14 @@ function validateWorkspaceAssets(parsed, relPath) {
|
|
|
8486
8616
|
return errors;
|
|
8487
8617
|
}
|
|
8488
8618
|
function validateWorkspaceManifests(rootPath) {
|
|
8489
|
-
const absRoot =
|
|
8619
|
+
const absRoot = path36__default.resolve(rootPath);
|
|
8490
8620
|
const files = findWorkspaceManifests(absRoot);
|
|
8491
8621
|
let errors = 0;
|
|
8492
8622
|
for (const file of files) {
|
|
8493
|
-
const relPath =
|
|
8623
|
+
const relPath = path36__default.relative(absRoot, file);
|
|
8494
8624
|
let parsed;
|
|
8495
8625
|
try {
|
|
8496
|
-
parsed = parse(
|
|
8626
|
+
parsed = parse(fs12__default.readFileSync(file, "utf-8")) ?? {};
|
|
8497
8627
|
} catch (e) {
|
|
8498
8628
|
logErr(`${relPath} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
|
|
8499
8629
|
errors++;
|
|
@@ -8505,7 +8635,7 @@ function validateWorkspaceManifests(rootPath) {
|
|
|
8505
8635
|
return { total: files.length, errors };
|
|
8506
8636
|
}
|
|
8507
8637
|
function validatePublishManifestRoots(rootPath) {
|
|
8508
|
-
const absRoot =
|
|
8638
|
+
const absRoot = path36__default.resolve(rootPath);
|
|
8509
8639
|
const manifest = loadSkPublishManifest(absRoot);
|
|
8510
8640
|
if (!manifest) return 0;
|
|
8511
8641
|
const missing = missingRootAssets(absRoot, manifest);
|
|
@@ -8518,7 +8648,7 @@ function validatePublishManifestRoots(rootPath) {
|
|
|
8518
8648
|
}
|
|
8519
8649
|
var EXCLUDED_PATHS = ["skaileup-shared/", "external/", "docs/"];
|
|
8520
8650
|
function toPosix(p7) {
|
|
8521
|
-
return p7.split(
|
|
8651
|
+
return p7.split(path36__default.sep).join("/");
|
|
8522
8652
|
}
|
|
8523
8653
|
function isExcludedPath(relPath) {
|
|
8524
8654
|
const rel = toPosix(relPath);
|
|
@@ -8526,9 +8656,9 @@ function isExcludedPath(relPath) {
|
|
|
8526
8656
|
}
|
|
8527
8657
|
function collectAssetVersions() {
|
|
8528
8658
|
const assets = [];
|
|
8529
|
-
if (!
|
|
8659
|
+
if (!fs12__default.existsSync(AI_RESOURCES)) return assets;
|
|
8530
8660
|
const kindDirs = (kindDirName) => findKindDirs(AI_RESOURCES, kindDirName).filter(
|
|
8531
|
-
(dir) => !isExcludedPath(
|
|
8661
|
+
(dir) => !isExcludedPath(path36__default.relative(AI_RESOURCES, dir))
|
|
8532
8662
|
);
|
|
8533
8663
|
for (const dir of kindDirs("skills")) collectSkillVersions(dir, assets);
|
|
8534
8664
|
for (const dir of kindDirs("agents")) collectAgentVersions(dir, assets);
|
|
@@ -8538,10 +8668,10 @@ function collectAssetVersions() {
|
|
|
8538
8668
|
return assets.filter((a) => !seen.has(a.filePath) && seen.add(a.filePath));
|
|
8539
8669
|
}
|
|
8540
8670
|
function collectFlowVersions(dir, out) {
|
|
8541
|
-
for (const f of
|
|
8671
|
+
for (const f of fs12__default.readdirSync(dir)) {
|
|
8542
8672
|
if (!f.endsWith(".flow.yaml")) continue;
|
|
8543
|
-
const fp =
|
|
8544
|
-
const content =
|
|
8673
|
+
const fp = path36__default.join(dir, f);
|
|
8674
|
+
const content = fs12__default.readFileSync(fp, "utf-8");
|
|
8545
8675
|
const parsed = parse(content);
|
|
8546
8676
|
out.push({
|
|
8547
8677
|
kind: "flow",
|
|
@@ -8552,10 +8682,10 @@ function collectFlowVersions(dir, out) {
|
|
|
8552
8682
|
}
|
|
8553
8683
|
}
|
|
8554
8684
|
function collectPromptVersions(dir, out) {
|
|
8555
|
-
for (const f of
|
|
8685
|
+
for (const f of fs12__default.readdirSync(dir)) {
|
|
8556
8686
|
if (!f.endsWith(".prompt.md")) continue;
|
|
8557
|
-
const fp =
|
|
8558
|
-
const content =
|
|
8687
|
+
const fp = path36__default.join(dir, f);
|
|
8688
|
+
const content = fs12__default.readFileSync(fp, "utf-8");
|
|
8559
8689
|
const fm = parseSkillFrontmatter(content);
|
|
8560
8690
|
out.push({
|
|
8561
8691
|
kind: "prompt",
|
|
@@ -8566,12 +8696,12 @@ function collectPromptVersions(dir, out) {
|
|
|
8566
8696
|
}
|
|
8567
8697
|
}
|
|
8568
8698
|
function collectSkillVersions(dir, out) {
|
|
8569
|
-
for (const entry of
|
|
8699
|
+
for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
|
|
8570
8700
|
if (!entry.isDirectory()) continue;
|
|
8571
|
-
const full =
|
|
8572
|
-
const skillMd =
|
|
8573
|
-
if (
|
|
8574
|
-
const content =
|
|
8701
|
+
const full = path36__default.join(dir, entry.name);
|
|
8702
|
+
const skillMd = path36__default.join(full, "SKILL.md");
|
|
8703
|
+
if (fs12__default.existsSync(skillMd)) {
|
|
8704
|
+
const content = fs12__default.readFileSync(skillMd, "utf-8");
|
|
8575
8705
|
const fm = parseSkillFrontmatter(content);
|
|
8576
8706
|
out.push({
|
|
8577
8707
|
kind: "skill",
|
|
@@ -8585,11 +8715,11 @@ function collectSkillVersions(dir, out) {
|
|
|
8585
8715
|
}
|
|
8586
8716
|
}
|
|
8587
8717
|
function collectAgentVersions(dir, out) {
|
|
8588
|
-
for (const entry of
|
|
8718
|
+
for (const entry of fs12__default.readdirSync(dir, { withFileTypes: true })) {
|
|
8589
8719
|
if (!entry.isDirectory()) continue;
|
|
8590
|
-
const agentYaml =
|
|
8591
|
-
if (!
|
|
8592
|
-
const content =
|
|
8720
|
+
const agentYaml = path36__default.join(dir, entry.name, "agent.yaml");
|
|
8721
|
+
if (!fs12__default.existsSync(agentYaml)) continue;
|
|
8722
|
+
const content = fs12__default.readFileSync(agentYaml, "utf-8");
|
|
8593
8723
|
const parsed = parse(content);
|
|
8594
8724
|
out.push({
|
|
8595
8725
|
kind: "agent",
|
|
@@ -8600,15 +8730,15 @@ function collectAgentVersions(dir, out) {
|
|
|
8600
8730
|
}
|
|
8601
8731
|
}
|
|
8602
8732
|
function assetLocation(a) {
|
|
8603
|
-
return toPosix(
|
|
8733
|
+
return toPosix(path36__default.relative(AI_RESOURCES, a.filePath));
|
|
8604
8734
|
}
|
|
8605
8735
|
function findChangelogUnit(assetRelPath, root) {
|
|
8606
|
-
let dir =
|
|
8736
|
+
let dir = path36__default.posix.dirname(toPosix(assetRelPath));
|
|
8607
8737
|
for (; ; ) {
|
|
8608
8738
|
const candidate = dir === "." ? "CHANGELOG.md" : `${dir}/CHANGELOG.md`;
|
|
8609
|
-
if (
|
|
8739
|
+
if (fs12__default.existsSync(path36__default.join(root, candidate))) return candidate;
|
|
8610
8740
|
if (dir === ".") return null;
|
|
8611
|
-
dir =
|
|
8741
|
+
dir = path36__default.posix.dirname(dir);
|
|
8612
8742
|
}
|
|
8613
8743
|
}
|
|
8614
8744
|
function checkChangelogUnits(modifiedFiles, root) {
|
|
@@ -8646,7 +8776,7 @@ function filterToChangedAssets(assets) {
|
|
|
8646
8776
|
encoding: "utf-8"
|
|
8647
8777
|
});
|
|
8648
8778
|
const changedFiles = new Set(
|
|
8649
|
-
diffOutput.trim().split("\n").filter(Boolean).map((f) =>
|
|
8779
|
+
diffOutput.trim().split("\n").filter(Boolean).map((f) => path36__default.resolve(AI_RESOURCES, f))
|
|
8650
8780
|
);
|
|
8651
8781
|
return assets.filter((a) => changedFiles.has(a.filePath));
|
|
8652
8782
|
} catch {
|
|
@@ -8674,7 +8804,7 @@ function checkVersionBumps(assets) {
|
|
|
8674
8804
|
let warnings = 0;
|
|
8675
8805
|
for (const a of assets) {
|
|
8676
8806
|
if (!a.version) continue;
|
|
8677
|
-
const relPath =
|
|
8807
|
+
const relPath = path36__default.relative(AI_RESOURCES, a.filePath);
|
|
8678
8808
|
try {
|
|
8679
8809
|
const headContent = execSync(`git show HEAD:${relPath}`, {
|
|
8680
8810
|
cwd: AI_RESOURCES,
|
|
@@ -8706,7 +8836,7 @@ function checkFlowVersionPins(assets) {
|
|
|
8706
8836
|
pins = flowSkillVersionPins(loadFlow(f.filePath));
|
|
8707
8837
|
} catch (err) {
|
|
8708
8838
|
logWarn(
|
|
8709
|
-
`flow:${f.name} (${
|
|
8839
|
+
`flow:${f.name} (${path36__default.relative(AI_RESOURCES, f.filePath)}) \u2014 could not be read: ${err instanceof Error ? err.message : err}`
|
|
8710
8840
|
);
|
|
8711
8841
|
warnings++;
|
|
8712
8842
|
continue;
|
|
@@ -8756,7 +8886,7 @@ function makeValidateCommand() {
|
|
|
8756
8886
|
"--strict-conformance",
|
|
8757
8887
|
"Treat Agent Skills (agentskills.io) standard findings as errors"
|
|
8758
8888
|
).action((targetPath, opts) => {
|
|
8759
|
-
const absPath =
|
|
8889
|
+
const absPath = path36__default.resolve(targetPath);
|
|
8760
8890
|
logInfo(`Validating manifests in ${absPath}`);
|
|
8761
8891
|
const { total, errors, warnings } = validateManifests(
|
|
8762
8892
|
absPath,
|
|
@@ -8898,7 +9028,7 @@ function whyEmptyMessage(ref, declared) {
|
|
|
8898
9028
|
}
|
|
8899
9029
|
function makeWhyCommand() {
|
|
8900
9030
|
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) => {
|
|
8901
|
-
const am2 = new AssetManager({ projectDir:
|
|
9031
|
+
const am2 = new AssetManager({ projectDir: path36__default.resolve(opts.projectDir) });
|
|
8902
9032
|
const chain = am2.why(ref);
|
|
8903
9033
|
if (chain.length === 0) {
|
|
8904
9034
|
let declared;
|
|
@@ -8932,7 +9062,7 @@ function makeWhyCommand() {
|
|
|
8932
9062
|
var _defaultFormatHelp = Help.prototype.formatHelp;
|
|
8933
9063
|
var pkg = JSON.parse(
|
|
8934
9064
|
readFileSync(
|
|
8935
|
-
|
|
9065
|
+
path36__default.resolve(path36__default.dirname(fileURLToPath(import.meta.url)), "../../package.json"),
|
|
8936
9066
|
"utf-8"
|
|
8937
9067
|
)
|
|
8938
9068
|
);
|
|
@@ -9054,7 +9184,7 @@ program.command("init [project-dir]").description("Initialize a project director
|
|
|
9054
9184
|
(projectDir, opts) => runInit(projectDir, opts)
|
|
9055
9185
|
);
|
|
9056
9186
|
async function runInit(projectDir, opts) {
|
|
9057
|
-
const { mkdirSync: mkdirSync4, writeFileSync:
|
|
9187
|
+
const { mkdirSync: mkdirSync4, writeFileSync: writeFileSync6 } = await import('fs');
|
|
9058
9188
|
const { stringify: stringify2 } = await import('yaml');
|
|
9059
9189
|
const { DRIVER_TARGETS, SUPPORTED_DRIVER_TARGETS: SUPPORTED_DRIVER_TARGETS2 } = await import('../core/index.js');
|
|
9060
9190
|
const harness = opts.harness;
|
|
@@ -9063,32 +9193,32 @@ async function runInit(projectDir, opts) {
|
|
|
9063
9193
|
process.exitCode = 1;
|
|
9064
9194
|
return;
|
|
9065
9195
|
}
|
|
9066
|
-
const resolved =
|
|
9067
|
-
const projectName =
|
|
9196
|
+
const resolved = path36__default.resolve(projectDir ?? ".");
|
|
9197
|
+
const projectName = path36__default.basename(resolved);
|
|
9068
9198
|
const created = [];
|
|
9069
|
-
const { existsSync:
|
|
9070
|
-
if (!
|
|
9199
|
+
const { existsSync: existsSync16 } = await import('fs');
|
|
9200
|
+
if (!existsSync16(resolved)) {
|
|
9071
9201
|
mkdirSync4(resolved, { recursive: true });
|
|
9072
9202
|
created.push(".");
|
|
9073
9203
|
}
|
|
9074
|
-
const skaileDir =
|
|
9075
|
-
if (!
|
|
9076
|
-
mkdirSync4(
|
|
9204
|
+
const skaileDir = path36__default.join(resolved, ".skaile");
|
|
9205
|
+
if (!existsSync16(skaileDir)) {
|
|
9206
|
+
mkdirSync4(path36__default.join(skaileDir, "sessions"), { recursive: true });
|
|
9077
9207
|
created.push(".skaile/");
|
|
9078
9208
|
}
|
|
9079
|
-
const settingsPath =
|
|
9080
|
-
if (!
|
|
9081
|
-
|
|
9209
|
+
const settingsPath = path36__default.join(skaileDir, "settings.json");
|
|
9210
|
+
if (!existsSync16(settingsPath)) {
|
|
9211
|
+
writeFileSync6(settingsPath, "{}\n");
|
|
9082
9212
|
created.push(".skaile/settings.json");
|
|
9083
9213
|
}
|
|
9084
|
-
const wsConfigPath =
|
|
9085
|
-
if (!
|
|
9086
|
-
|
|
9214
|
+
const wsConfigPath = path36__default.join(resolved, "skaile.yaml");
|
|
9215
|
+
if (!existsSync16(wsConfigPath)) {
|
|
9216
|
+
writeFileSync6(wsConfigPath, stringify2(buildInitWorkspaceConfig(projectName, harness)));
|
|
9087
9217
|
created.push("skaile.yaml");
|
|
9088
9218
|
}
|
|
9089
9219
|
for (const dir of new Set(Object.values(DRIVER_TARGETS[harness].local))) {
|
|
9090
|
-
const full =
|
|
9091
|
-
if (!
|
|
9220
|
+
const full = path36__default.join(resolved, dir);
|
|
9221
|
+
if (!existsSync16(full)) {
|
|
9092
9222
|
mkdirSync4(full, { recursive: true });
|
|
9093
9223
|
created.push(`${dir}/`);
|
|
9094
9224
|
}
|
|
@@ -9118,8 +9248,8 @@ function buildInitWorkspaceConfig(projectName, harness) {
|
|
|
9118
9248
|
}
|
|
9119
9249
|
async function initGitScaffold(resolved, created) {
|
|
9120
9250
|
const { execSync: execSync3 } = await import('child_process');
|
|
9121
|
-
const { existsSync:
|
|
9122
|
-
const gitignorePath =
|
|
9251
|
+
const { existsSync: existsSync16, readFileSync: readFileSync9, writeFileSync: writeFileSync6 } = await import('fs');
|
|
9252
|
+
const gitignorePath = path36__default.join(resolved, ".gitignore");
|
|
9123
9253
|
const entries = [
|
|
9124
9254
|
"node_modules/",
|
|
9125
9255
|
".skaile/sessions/",
|
|
@@ -9136,16 +9266,16 @@ async function initGitScaffold(resolved, created) {
|
|
|
9136
9266
|
".env",
|
|
9137
9267
|
".env.local"
|
|
9138
9268
|
];
|
|
9139
|
-
const existing =
|
|
9269
|
+
const existing = existsSync16(gitignorePath) ? readFileSync9(gitignorePath, "utf-8") : "";
|
|
9140
9270
|
const have = new Set(existing.split("\n").map((l) => l.trim()));
|
|
9141
9271
|
const append = entries.filter((e) => !have.has(e));
|
|
9142
9272
|
if (append.length > 0) {
|
|
9143
9273
|
const prefix = existing && !existing.endsWith("\n") ? "\n" : "";
|
|
9144
|
-
|
|
9274
|
+
writeFileSync6(gitignorePath, `${existing + prefix}${append.join("\n")}
|
|
9145
9275
|
`);
|
|
9146
9276
|
if (!existing) created.push(".gitignore");
|
|
9147
9277
|
}
|
|
9148
|
-
if (!
|
|
9278
|
+
if (!existsSync16(path36__default.join(resolved, ".git"))) {
|
|
9149
9279
|
try {
|
|
9150
9280
|
execSync3("git init", { cwd: resolved, stdio: "pipe" });
|
|
9151
9281
|
created.push(".git/");
|
|
@@ -9157,10 +9287,10 @@ async function initGitScaffold(resolved, created) {
|
|
|
9157
9287
|
}
|
|
9158
9288
|
async function bootstrapUserConfig() {
|
|
9159
9289
|
try {
|
|
9160
|
-
const
|
|
9161
|
-
const { userConfigPath, saveConfig, getConfigDefaults } = await import('../library/index.js');
|
|
9162
|
-
const userCfgPath =
|
|
9163
|
-
if (!
|
|
9290
|
+
const fs13 = await import('fs');
|
|
9291
|
+
const { userConfigPath: userConfigPath2, saveConfig, getConfigDefaults } = await import('../library/index.js');
|
|
9292
|
+
const userCfgPath = userConfigPath2();
|
|
9293
|
+
if (!fs13.existsSync(userCfgPath)) {
|
|
9164
9294
|
const defaults = getConfigDefaults();
|
|
9165
9295
|
saveConfig(userCfgPath, {
|
|
9166
9296
|
catalog: { url: defaults.catalog.url, cache_ttl: defaults.catalog.cache_ttl }
|
|
@@ -9175,7 +9305,7 @@ async function bootstrapUserConfig() {
|
|
|
9175
9305
|
}
|
|
9176
9306
|
async function hydrateInitSources(resolved, created) {
|
|
9177
9307
|
try {
|
|
9178
|
-
const { ensureSourcesCloned } = await import('../ensure-sources-
|
|
9308
|
+
const { ensureSourcesCloned } = await import('../ensure-sources-3IH5XHAP.js');
|
|
9179
9309
|
const hydrate = ensureSourcesCloned(resolved, { quiet: true });
|
|
9180
9310
|
for (const n of hydrate.cloned) created.push(`~/.skaile/cache/sources/${n}/`);
|
|
9181
9311
|
if (hydrate.failed.length > 0) {
|
|
@@ -9191,7 +9321,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
9191
9321
|
logOk(`Initialized project at ${S.heading(resolved)}`);
|
|
9192
9322
|
console.log();
|
|
9193
9323
|
console.log(S.heading(" Next steps:"));
|
|
9194
|
-
const isCurrentDir = resolved ===
|
|
9324
|
+
const isCurrentDir = resolved === path36__default.resolve(".");
|
|
9195
9325
|
let step = 1;
|
|
9196
9326
|
if (!isCurrentDir) {
|
|
9197
9327
|
console.log(` ${S.dim(`${step}.`)} ${S.cmd(`cd ${projectDir}`)}`);
|
|
@@ -9215,7 +9345,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
9215
9345
|
console.log();
|
|
9216
9346
|
}
|
|
9217
9347
|
program.command("setup").description("Interactive provider setup wizard").action(async () => {
|
|
9218
|
-
const { cmdSetup } = await import('../setup-
|
|
9348
|
+
const { cmdSetup } = await import('../setup-IFGA4NQA.js');
|
|
9219
9349
|
await cmdSetup([], { projectDir: process.cwd() });
|
|
9220
9350
|
});
|
|
9221
9351
|
program.addCommand(makeInstallCommand());
|
|
@@ -9268,10 +9398,24 @@ program.addCommand(makeSourceCommand());
|
|
|
9268
9398
|
program.addCommand(makeLibraryCommand());
|
|
9269
9399
|
program.addCommand(makeAssetCommand());
|
|
9270
9400
|
program.addCommand(makePresetCommand());
|
|
9271
|
-
program.command("path").description("Show resolved paths").action(() => {
|
|
9401
|
+
program.command("path").description("Show resolved paths (honours SKAILE_HOME and the per-path overrides)").action(async () => {
|
|
9402
|
+
const { globalCacheRoot: globalCacheRoot2, globalSkaileDir: globalSkaileDir2, resolveLibraryDir: resolveLibraryDir2, userConfigPath: userConfigPath2 } = await import('../core/index.js');
|
|
9403
|
+
const { getStoreRoot, resolveIndexPath } = await import('../library/index.js');
|
|
9404
|
+
const rows = [
|
|
9405
|
+
["skaile-home", globalSkaileDir2()],
|
|
9406
|
+
["config", userConfigPath2()],
|
|
9407
|
+
["index", resolveIndexPath()],
|
|
9408
|
+
["libraries", resolveLibraryDir2()],
|
|
9409
|
+
["store", getStoreRoot()],
|
|
9410
|
+
["cache", globalCacheRoot2()],
|
|
9411
|
+
["ai-assets", AI_RESOURCES],
|
|
9412
|
+
["patches-dir", ".skaile/patches/"]
|
|
9413
|
+
];
|
|
9414
|
+
const width = Math.max(...rows.map(([label]) => label.length));
|
|
9272
9415
|
console.log();
|
|
9273
|
-
|
|
9274
|
-
|
|
9416
|
+
for (const [label, value] of rows) {
|
|
9417
|
+
console.log(` ${S.dim(label.padEnd(width))} ${S.heading(value)}`);
|
|
9418
|
+
}
|
|
9275
9419
|
console.log();
|
|
9276
9420
|
});
|
|
9277
9421
|
program.addCommand(makeCompleteCommand(program));
|