@skaile/workspaces 5.1.2 → 5.2.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 +38 -0
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-EVS3WPWS.js → asset-feeds-WDIB3E6H.js} +11 -11
- package/dist/{asset-feeds-EVS3WPWS.js.map → asset-feeds-WDIB3E6H.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +8 -8
- package/dist/asset-manager/index.js +12 -12
- package/dist/asset-manager/installer.js +8 -8
- package/dist/asset-manager/src/index.d.ts +27 -1
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/bridge/drivers/claude-sdk.js +110 -23
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +11 -10
- package/dist/bridge/drivers/codex.js.map +1 -1
- package/dist/bridge/drivers/continue.js +10 -10
- package/dist/bridge/drivers/echo.js +3 -3
- package/dist/bridge/drivers/gemini.js +5 -5
- package/dist/bridge/drivers/goose.js +10 -10
- package/dist/bridge/drivers/omp.js +6 -5
- package/dist/bridge/drivers/omp.js.map +1 -1
- package/dist/bridge/drivers/opencode.js +10 -10
- package/dist/bridge/drivers/qwen.js +5 -5
- package/dist/bridge/index.js +13 -13
- 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 +16 -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-CJB5HUY6.js → chunk-2MEMXBLC.js} +8 -7
- package/dist/chunk-2MEMXBLC.js.map +1 -0
- package/dist/{chunk-TVOODIZE.js → chunk-2QZG5VJQ.js} +3 -3
- package/dist/{chunk-TVOODIZE.js.map → chunk-2QZG5VJQ.js.map} +1 -1
- package/dist/{chunk-7SAWDPUT.js → chunk-37GBJLF5.js} +5 -55
- package/dist/chunk-37GBJLF5.js.map +1 -0
- package/dist/{chunk-RDTHJSGY.js → chunk-3E2TIPBZ.js} +56 -7
- package/dist/chunk-3E2TIPBZ.js.map +1 -0
- package/dist/{chunk-H4EGUQ7M.js → chunk-4YE7OYTB.js} +5 -5
- package/dist/chunk-4YE7OYTB.js.map +1 -0
- package/dist/{chunk-K5GBV4SA.js → chunk-5BEFNLOR.js} +6 -5
- package/dist/chunk-5BEFNLOR.js.map +1 -0
- package/dist/{chunk-UO5CWEHZ.js → chunk-6OWIEFZ2.js} +5 -5
- package/dist/{chunk-UO5CWEHZ.js.map → chunk-6OWIEFZ2.js.map} +1 -1
- package/dist/{chunk-EPHQWHOH.js → chunk-6ZCVROWW.js} +6 -6
- package/dist/{chunk-EPHQWHOH.js.map → chunk-6ZCVROWW.js.map} +1 -1
- package/dist/{chunk-TB6GDL6Q.js → chunk-77GKEZ2R.js} +21 -4
- package/dist/chunk-77GKEZ2R.js.map +1 -0
- package/dist/{chunk-TYUJB336.js → chunk-7Y43UXKA.js} +3 -3
- package/dist/{chunk-TYUJB336.js.map → chunk-7Y43UXKA.js.map} +1 -1
- package/dist/{chunk-YV4J7V53.js → chunk-ANWHAGM7.js} +3 -3
- package/dist/{chunk-YV4J7V53.js.map → chunk-ANWHAGM7.js.map} +1 -1
- package/dist/{chunk-SP47UJKE.js → chunk-B4J4RGNY.js} +231 -114
- package/dist/chunk-B4J4RGNY.js.map +1 -0
- package/dist/{chunk-IWCCZL7C.js → chunk-BIMEKYOE.js} +91 -25
- package/dist/chunk-BIMEKYOE.js.map +1 -0
- package/dist/{chunk-WCQMXBO5.js → chunk-BJQUSAGB.js} +4 -4
- package/dist/{chunk-WCQMXBO5.js.map → chunk-BJQUSAGB.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-P5UQ56RA.js → chunk-BUNBKRJZ.js} +3 -3
- package/dist/{chunk-P5UQ56RA.js.map → chunk-BUNBKRJZ.js.map} +1 -1
- package/dist/{chunk-KDH74UWB.js → chunk-BWOLP6KQ.js} +3 -3
- package/dist/{chunk-KDH74UWB.js.map → chunk-BWOLP6KQ.js.map} +1 -1
- package/dist/chunk-BZXR6SW5.js +15 -0
- package/dist/{chunk-XUQBVK4R.js.map → chunk-BZXR6SW5.js.map} +1 -1
- package/dist/{chunk-ZMMFBID4.js → chunk-DD3OZLRD.js} +3 -3
- package/dist/{chunk-ZMMFBID4.js.map → chunk-DD3OZLRD.js.map} +1 -1
- package/dist/{chunk-56IWSMSD.js → chunk-EOGNW74K.js} +9 -8
- package/dist/chunk-EOGNW74K.js.map +1 -0
- package/dist/{chunk-RNNUYFFD.js → chunk-FJTC5YFO.js} +3 -3
- package/dist/{chunk-RNNUYFFD.js.map → chunk-FJTC5YFO.js.map} +1 -1
- package/dist/{chunk-THPQ6J3U.js → chunk-IOUIC2ZD.js} +8 -8
- package/dist/{chunk-THPQ6J3U.js.map → chunk-IOUIC2ZD.js.map} +1 -1
- package/dist/{chunk-YMOZC2D3.js → chunk-JPR7EPIM.js} +4 -4
- package/dist/{chunk-YMOZC2D3.js.map → chunk-JPR7EPIM.js.map} +1 -1
- package/dist/{chunk-IDEA6CYI.js → chunk-K2K7OF4P.js} +95 -3
- package/dist/chunk-K2K7OF4P.js.map +1 -0
- package/dist/{chunk-AGWYBS2E.js → chunk-KGGT6MUM.js} +4 -4
- package/dist/{chunk-AGWYBS2E.js.map → chunk-KGGT6MUM.js.map} +1 -1
- package/dist/{chunk-YJACHPI7.js → chunk-L257BENF.js} +73 -54
- package/dist/chunk-L257BENF.js.map +1 -0
- package/dist/{chunk-UVOJSWD2.js → chunk-LZ5RH6LD.js} +24 -13
- package/dist/chunk-LZ5RH6LD.js.map +1 -0
- package/dist/{chunk-N2X7DK2S.js → chunk-MGHUSFYQ.js} +2472 -2265
- package/dist/chunk-MGHUSFYQ.js.map +1 -0
- package/dist/{chunk-43ZBF3WH.js → chunk-OABIGSUY.js} +16 -3
- package/dist/chunk-OABIGSUY.js.map +1 -0
- package/dist/{chunk-YIVB7GIP.js → chunk-OFNXRI4L.js} +4 -4
- package/dist/{chunk-YIVB7GIP.js.map → chunk-OFNXRI4L.js.map} +1 -1
- package/dist/{chunk-MXXKTQXJ.js → chunk-P2EM6FNQ.js} +5 -5
- package/dist/{chunk-MXXKTQXJ.js.map → chunk-P2EM6FNQ.js.map} +1 -1
- package/dist/{chunk-KAYH6AXN.js → chunk-PHKFFJ4I.js} +3 -3
- package/dist/{chunk-KAYH6AXN.js.map → chunk-PHKFFJ4I.js.map} +1 -1
- package/dist/{chunk-YDJZRLGN.js → chunk-PU5VY7KF.js} +4 -4
- package/dist/{chunk-YDJZRLGN.js.map → chunk-PU5VY7KF.js.map} +1 -1
- 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-52PFJLBJ.js → chunk-R3QW7CA5.js} +5 -5
- package/dist/{chunk-52PFJLBJ.js.map → chunk-R3QW7CA5.js.map} +1 -1
- package/dist/{chunk-UMSWQKCY.js → chunk-RXPC4KBW.js} +3 -3
- package/dist/{chunk-UMSWQKCY.js.map → chunk-RXPC4KBW.js.map} +1 -1
- package/dist/{chunk-X6IELFVB.js → chunk-S6KNDUAU.js} +4 -4
- package/dist/{chunk-X6IELFVB.js.map → chunk-S6KNDUAU.js.map} +1 -1
- package/dist/{chunk-6CSSFLGC.js → chunk-TVJBJLXR.js} +14 -15
- package/dist/chunk-TVJBJLXR.js.map +1 -0
- package/dist/{chunk-WKIOWDLQ.js → chunk-UDBN3LZU.js} +4 -4
- package/dist/{chunk-WKIOWDLQ.js.map → chunk-UDBN3LZU.js.map} +1 -1
- package/dist/{chunk-E67J56FJ.js → chunk-WMEPS6S4.js} +3 -3
- package/dist/{chunk-E67J56FJ.js.map → chunk-WMEPS6S4.js.map} +1 -1
- package/dist/{chunk-CXGHL75R.js → chunk-XIYXBHLN.js} +5 -4
- package/dist/chunk-XIYXBHLN.js.map +1 -0
- package/dist/{chunk-VDJKWKH2.js → chunk-XOTJVCJB.js} +3 -3
- package/dist/{chunk-VDJKWKH2.js.map → chunk-XOTJVCJB.js.map} +1 -1
- package/dist/{chunk-DXUQCMVT.js → chunk-YANDJSMN.js} +3 -3
- package/dist/{chunk-DXUQCMVT.js.map → chunk-YANDJSMN.js.map} +1 -1
- package/dist/{chunk-AG44ZJ7W.js → chunk-YRF5CYHR.js} +5 -14
- package/dist/chunk-YRF5CYHR.js.map +1 -0
- package/dist/{chunk-VFAJZE45.js → chunk-ZSFTCMZL.js} +907 -785
- package/dist/chunk-ZSFTCMZL.js.map +1 -0
- package/dist/cli/index.js +506 -434
- 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.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-publish.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 +0 -45
- 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 +5 -5
- package/dist/connectors/index.js +17 -17
- 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-KSVPVYCA.js → connectors-GUN4MRWR.js} +20 -20
- package/dist/{connectors-KSVPVYCA.js.map → connectors-GUN4MRWR.js.map} +1 -1
- package/dist/connectors-shared/index.js +2 -2
- package/dist/core/framework.js +1 -1
- package/dist/core/index.js +7 -7
- 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 +5 -5
- 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 +4 -4
- 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 +15 -0
- package/dist/core/src/models.d.ts.map +1 -1
- package/dist/core/src/publish-manifest.d.ts +4 -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/workspace-config.js +4 -4
- package/dist/deploy/index.js +7 -7
- 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/index.d.ts +1 -1
- package/dist/discovery/src/index.d.ts.map +1 -1
- package/dist/{ensure-sources-KVV72WRP.js → ensure-sources-VCPA762L.js} +15 -15
- package/dist/{ensure-sources-KVV72WRP.js.map → ensure-sources-VCPA762L.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +17 -17
- package/dist/factory-assets/connectors/deploy.js +17 -17
- package/dist/factory-assets/connectors/devserver.js +17 -17
- 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 +17 -17
- package/dist/factory-assets/connectors/flow/engine.js +8 -8
- 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 +19 -19
- package/dist/factory-assets/connectors/flow.js +17 -17
- 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 +17 -17
- package/dist/factory-assets/connectors/gmail.js +17 -17
- package/dist/factory-assets/connectors/googledrive.js +17 -17
- package/dist/factory-assets/connectors/local.js +17 -17
- package/dist/factory-assets/connectors/mattermost.js +17 -17
- package/dist/factory-assets/connectors/memory.js +17 -17
- package/dist/factory-assets/connectors/minio.js +17 -17
- package/dist/factory-assets/connectors/postgres.js +17 -17
- package/dist/factory-assets/connectors/s3.js +17 -17
- package/dist/factory-assets/connectors/sharepoint.js +17 -17
- package/dist/factory-assets/connectors/sqlite.js +17 -17
- package/dist/factory-assets/connectors/static-server.js +17 -17
- package/dist/factory-assets/connectors/tunnel.js +17 -17
- package/dist/factory-assets/connectors/webdav.js +17 -17
- package/dist/factory-assets/connectors/xstate-store.js +17 -17
- package/dist/factory-assets/connectors/xstate.js +17 -17
- package/dist/{flows-SVCCADGE.js → flows-BOB5YA5R.js} +12 -12
- package/dist/{flows-SVCCADGE.js.map → flows-BOB5YA5R.js.map} +1 -1
- package/dist/{helpers-4NT7UX6I.js → helpers-ZGK4R5MZ.js} +15 -15
- package/dist/{helpers-4NT7UX6I.js.map → helpers-ZGK4R5MZ.js.map} +1 -1
- package/dist/library/index.js +10 -10
- package/dist/library/install.js +2 -2
- 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/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 +73 -0
- package/dist/library/src/manifest-writer.d.ts.map +1 -0
- 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-GHIWWEEY.js → library-publish-RIP6NBYA.js} +20 -21
- package/dist/library-publish-RIP6NBYA.js.map +1 -0
- package/dist/{open-library-XKWTUYU2.js → open-library-4IJTBVTR.js} +18 -18
- package/dist/{open-library-XKWTUYU2.js.map → open-library-4IJTBVTR.js.map} +1 -1
- package/dist/{open-registry-CHCWKV5W.js → open-registry-G5DI4RPU.js} +14 -14
- package/dist/{open-registry-CHCWKV5W.js.map → open-registry-G5DI4RPU.js.map} +1 -1
- package/dist/paths-L5XLUC3D.js +22 -0
- package/dist/{paths-MKSI52PF.js.map → paths-L5XLUC3D.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-QENDYZ63.js} +9 -9
- package/dist/{plugin-store-SVYV7L4C.js.map → plugin-store-QENDYZ63.js.map} +1 -1
- package/dist/{project-P2QS3GNG.js → project-4INCIIZI.js} +16 -16
- package/dist/{project-P2QS3GNG.js.map → project-4INCIIZI.js.map} +1 -1
- package/dist/resolver/index.js +8 -8
- package/dist/runner/index.js +27 -27
- package/dist/runner/src/agent.d.ts +1 -1
- package/dist/runner/src/agent.d.ts.map +1 -1
- package/dist/runner/src/ai-provider-switch.d.ts +10 -0
- package/dist/runner/src/ai-provider-switch.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 +12 -12
- package/dist/sdk/bridge.js +13 -13
- package/dist/sdk/core.js +7 -7
- package/dist/sdk/flow.js +8 -8
- package/dist/sdk/index.js +27 -27
- package/dist/sdk/resolver.js +8 -8
- package/dist/sdk/runner.js +27 -27
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/types.js +1 -1
- package/dist/session/index.js +2 -2
- package/dist/session/src/dispatcher.d.ts.map +1 -1
- package/dist/{setup-RVP74D37.js → setup-RG4PJJUW.js} +23 -23
- package/dist/setup-RG4PJJUW.js.map +1 -0
- package/dist/{skills-7K2YO3KN.js → skills-CL45F7AG.js} +13 -13
- package/dist/{skills-7K2YO3KN.js.map → skills-CL45F7AG.js.map} +1 -1
- package/dist/{source-VBROLEFB.js → source-LJOI5AXU.js} +19 -19
- package/dist/{source-VBROLEFB.js.map → source-LJOI5AXU.js.map} +1 -1
- package/dist/{source-manifest-publish-7XDLJRLX.js → source-manifest-publish-QEJML4VS.js} +21 -21
- package/dist/{source-manifest-publish-7XDLJRLX.js.map → source-manifest-publish-QEJML4VS.js.map} +1 -1
- package/dist/tui/index.js +28 -28
- 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 +24 -24
- 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-43ZBF3WH.js.map +0 -1
- package/dist/chunk-56IWSMSD.js.map +0 -1
- package/dist/chunk-6CSSFLGC.js.map +0 -1
- package/dist/chunk-7SAWDPUT.js.map +0 -1
- package/dist/chunk-AG44ZJ7W.js.map +0 -1
- package/dist/chunk-CJB5HUY6.js.map +0 -1
- package/dist/chunk-CXGHL75R.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-IDEA6CYI.js.map +0 -1
- package/dist/chunk-IWCCZL7C.js.map +0 -1
- package/dist/chunk-K5GBV4SA.js.map +0 -1
- package/dist/chunk-N2X7DK2S.js.map +0 -1
- package/dist/chunk-RDTHJSGY.js.map +0 -1
- package/dist/chunk-SP47UJKE.js.map +0 -1
- package/dist/chunk-TB6GDL6Q.js.map +0 -1
- package/dist/chunk-UVOJSWD2.js.map +0 -1
- package/dist/chunk-VFAJZE45.js.map +0 -1
- package/dist/chunk-XUQBVK4R.js +0 -15
- package/dist/chunk-YJACHPI7.js.map +0 -1
- package/dist/library-publish-GHIWWEEY.js.map +0 -1
- 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-RVP74D37.js.map +0 -1
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 { createFullRegistry } from '../chunk-XUQBVK4R.js';
|
|
2
|
+
import { makeProvidersCommand, loadRegistryView, addProviderEntry, ProviderRegistryWriteError } from '../chunk-6OWIEFZ2.js';
|
|
3
|
+
import { makeSourceCommand, syncProjectSources } from '../chunk-TVJBJLXR.js';
|
|
4
|
+
import { AI_RESOURCES } from '../chunk-JPR7EPIM.js';
|
|
5
|
+
import { getStoreConfig, storeFetch, deviceLogin, loadStoreAuthConfig, logout, hasStoredAuth, isStoreAuthenticated, getStoreToken, getStoreIdentity, refFor, assetEntryRef } from '../chunk-S6KNDUAU.js';
|
|
6
|
+
import { makeInstallCommand, makeCheckCommand, makeCleanCommand, reportInstalledSoftDeps } from '../chunk-EOGNW74K.js';
|
|
7
|
+
import { openCatalogSource, openLibraryManager, openLibrary } from '../chunk-R3QW7CA5.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-77GKEZ2R.js';
|
|
9
|
+
import { createFullRegistry } from '../chunk-BZXR6SW5.js';
|
|
11
10
|
import { LocalSecretsProvider } from '../chunk-EB6OPURC.js';
|
|
12
|
-
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-
|
|
13
|
-
import { buildClaudePluginFiles } from '../chunk-
|
|
14
|
-
import '../chunk-
|
|
15
|
-
import '../chunk-
|
|
11
|
+
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-ZSFTCMZL.js';
|
|
12
|
+
import { buildClaudePluginFiles } from '../chunk-XIYXBHLN.js';
|
|
13
|
+
import '../chunk-2MEMXBLC.js';
|
|
14
|
+
import '../chunk-FJTC5YFO.js';
|
|
16
15
|
import '../chunk-R6O6YWU7.js';
|
|
17
|
-
import '../chunk-
|
|
18
|
-
import '../chunk-
|
|
16
|
+
import '../chunk-BJQUSAGB.js';
|
|
17
|
+
import '../chunk-7Y43UXKA.js';
|
|
19
18
|
import '../chunk-4ZTPYIBE.js';
|
|
20
|
-
import '../chunk-
|
|
19
|
+
import '../chunk-DD3OZLRD.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-IOUIC2ZD.js';
|
|
30
29
|
import '../chunk-4R6DROGN.js';
|
|
31
|
-
import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-
|
|
32
|
-
import '../chunk-
|
|
30
|
+
import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-ANWHAGM7.js';
|
|
31
|
+
import '../chunk-XOTJVCJB.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-MGHUSFYQ.js';
|
|
34
|
+
import '../chunk-QMWMSZQ4.js';
|
|
35
|
+
import '../chunk-UDBN3LZU.js';
|
|
36
|
+
import '../chunk-OFNXRI4L.js';
|
|
37
|
+
import '../chunk-2QZG5VJQ.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-BUNBKRJZ.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-3E2TIPBZ.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-RXPC4KBW.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-L257BENF.js';
|
|
55
|
+
import { cloneOrInitGitRepo, ensureGitRepo, stampManifestPublisher, upsertManifestAsset, syncManifestWithDisk, isGitRepo, assertManifestEditable, installLibraryAsset, missingRootAssets, getStoreManifestsDir, getDefaultValue, isSecretPlaceholder } from '../chunk-B4J4RGNY.js';
|
|
56
|
+
import '../chunk-LZ5RH6LD.js';
|
|
57
|
+
import '../chunk-4YE7OYTB.js';
|
|
59
58
|
import '../chunk-R7FOF242.js';
|
|
60
59
|
import '../chunk-ZDKJHQY2.js';
|
|
61
|
-
import '../chunk-
|
|
60
|
+
import '../chunk-KGGT6MUM.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, readLock, workspaceProviderRegistryPath, userProviderRegistryPath, loadProviderRegistryFile, aiResourceRoots } from '../chunk-BIMEKYOE.js';
|
|
64
63
|
import '../chunk-4GY63JU6.js';
|
|
65
|
-
import { factoryAssetRoots } from '../chunk-
|
|
64
|
+
import { factoryAssetRoots } from '../chunk-PU5VY7KF.js';
|
|
66
65
|
import '../chunk-U6K3I3AX.js';
|
|
67
|
-
import { DRIVER_DEFAULTS } from '../chunk-
|
|
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-
|
|
68
|
+
import { sourceCacheKey, getGlobalCacheDir, resolveAgentDir, AgentRefResolutionError, matchPin, coerceVersion, loadSkWorkspaceConfig, resolveSkWorkspaceConfig, storeManifestSlug, isWorkspaceConfigFilename } from '../chunk-P2EM6FNQ.js';
|
|
70
69
|
import { globalCacheRoot, globalSkaileDir } from '../chunk-TLKM4M47.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-YRF5CYHR.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-YANDJSMN.js';
|
|
74
|
+
import { parseAssetRef, ASSET_KINDS, isValidAssetName, slugifyAssetName, ASSET_NAME_HINT, assetRefToStr } from '../chunk-OABIGSUY.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 fs11 from 'fs';
|
|
86
|
+
import fs11__default, { readFileSync, existsSync, mkdirSync, writeFileSync, lstatSync, rmSync, readdirSync, statSync } from 'fs';
|
|
87
|
+
import * as path35 from 'path';
|
|
88
|
+
import path35__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 * as os from 'os';
|
|
95
|
+
import { parse, stringify, parseDocument } from 'yaml';
|
|
95
96
|
import * as readline from 'readline';
|
|
96
97
|
import { createInterface } from 'readline';
|
|
97
|
-
import
|
|
98
|
+
import fs5 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: path35__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-4IJTBVTR.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(path35__default.sep) ? r : r + path35__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 = path35__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-LJOI5AXU.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-4IJTBVTR.js');
|
|
271
271
|
try {
|
|
272
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
272
|
+
const remote = await openCatalogSource2({ projectDir: path35__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: path35__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: path35__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: path35__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: path35__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-4IJTBVTR.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-4IJTBVTR.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 } : {} };
|
|
@@ -619,7 +621,7 @@ function infoNotFoundHint(ref, lookup) {
|
|
|
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 = path35__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 ? path35__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: path35__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,79 @@ function makeDoctorCommand() {
|
|
|
688
690
|
console.log();
|
|
689
691
|
});
|
|
690
692
|
}
|
|
693
|
+
var DEFAULT_IMPORT_VERSION = "0.1.0";
|
|
694
|
+
var DEFAULT_IMPORT_STAGE = "alpha";
|
|
695
|
+
function claudeSkillRoots() {
|
|
696
|
+
const roots = [];
|
|
697
|
+
const override = process.env.SKAILE_CLAUDE_SKILLS_DIR;
|
|
698
|
+
if (override) roots.push(override);
|
|
699
|
+
roots.push(path35.join(os.homedir(), ".claude", "skills"));
|
|
700
|
+
return roots;
|
|
701
|
+
}
|
|
702
|
+
function resolveImportSource(nameOrPath) {
|
|
703
|
+
const asPath = path35.resolve(nameOrPath);
|
|
704
|
+
if (fs11.existsSync(asPath)) {
|
|
705
|
+
const dir = fs11.statSync(asPath).isDirectory() ? asPath : path35.dirname(asPath);
|
|
706
|
+
const skillFile = path35.join(dir, "SKILL.md");
|
|
707
|
+
if (fs11.existsSync(skillFile)) return { dir, skillFile, via: "path" };
|
|
708
|
+
}
|
|
709
|
+
if (!nameOrPath.includes(path35.sep) && !nameOrPath.startsWith(".")) {
|
|
710
|
+
for (const root of claudeSkillRoots()) {
|
|
711
|
+
const dir = path35.join(root, nameOrPath);
|
|
712
|
+
const skillFile = path35.join(dir, "SKILL.md");
|
|
713
|
+
if (fs11.existsSync(skillFile)) return { dir, skillFile, via: "claude-skills" };
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
return null;
|
|
717
|
+
}
|
|
718
|
+
function normalizeSkillContent(raw, opts = {}) {
|
|
719
|
+
const notes = [];
|
|
720
|
+
const { data, body } = parseFrontmatter(raw);
|
|
721
|
+
const rawName = typeof data.name === "string" && data.name.trim() ? data.name.trim() : void 0;
|
|
722
|
+
const sourceName = rawName ?? opts.fallbackName ?? "";
|
|
723
|
+
let name = sourceName;
|
|
724
|
+
let originalName;
|
|
725
|
+
if (!sourceName) {
|
|
726
|
+
throw new Error("skill has no `name` in frontmatter and no fallback was provided");
|
|
727
|
+
}
|
|
728
|
+
if (!isValidAssetName(sourceName)) {
|
|
729
|
+
name = slugifyAssetName(sourceName);
|
|
730
|
+
originalName = sourceName;
|
|
731
|
+
notes.push(`renamed "${sourceName}" \u2192 "${name}" (canonical kebab-case)`);
|
|
732
|
+
}
|
|
733
|
+
const existingMeta = data.metadata && typeof data.metadata === "object" && !Array.isArray(data.metadata) ? { ...data.metadata } : {};
|
|
734
|
+
if (existingMeta.version == null) {
|
|
735
|
+
existingMeta.version = opts.version ?? DEFAULT_IMPORT_VERSION;
|
|
736
|
+
notes.push(`stamped metadata.version: ${existingMeta.version}`);
|
|
737
|
+
}
|
|
738
|
+
if (existingMeta.stage == null) {
|
|
739
|
+
existingMeta.stage = opts.stage ?? DEFAULT_IMPORT_STAGE;
|
|
740
|
+
notes.push(`stamped metadata.stage: ${existingMeta.stage}`);
|
|
741
|
+
}
|
|
742
|
+
if (existingMeta.tags == null) {
|
|
743
|
+
const keywords = Array.isArray(data.keywords) ? data.keywords : [];
|
|
744
|
+
existingMeta.tags = keywords.filter((k) => typeof k === "string");
|
|
745
|
+
if (existingMeta.tags.length > 0) {
|
|
746
|
+
notes.push("promoted top-level keywords \u2192 metadata.tags");
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
const ordered = { name };
|
|
750
|
+
if (data.description != null) ordered.description = data.description;
|
|
751
|
+
ordered.metadata = existingMeta;
|
|
752
|
+
for (const [k, v] of Object.entries(data)) {
|
|
753
|
+
if (k === "name" || k === "description" || k === "metadata" || k === "keywords") continue;
|
|
754
|
+
ordered[k] = v;
|
|
755
|
+
}
|
|
756
|
+
const fm = stringify(ordered).trimEnd();
|
|
757
|
+
const content = `---
|
|
758
|
+
${fm}
|
|
759
|
+
---
|
|
760
|
+
|
|
761
|
+
${body}
|
|
762
|
+
`;
|
|
763
|
+
const changed = notes.length > 0;
|
|
764
|
+
return { content, name, originalName, changed, notes };
|
|
765
|
+
}
|
|
691
766
|
|
|
692
767
|
// cli/src/commands/asset-cmd.ts
|
|
693
768
|
async function resolveDefByRef(library, ref, opts) {
|
|
@@ -738,24 +813,30 @@ function makeAssetCommand() {
|
|
|
738
813
|
logErr(`Library "${target.name}" is read-only (ownership=reader). Choose --to.`);
|
|
739
814
|
process.exit(1);
|
|
740
815
|
}
|
|
741
|
-
|
|
816
|
+
try {
|
|
817
|
+
assertManifestEditable(target.path);
|
|
818
|
+
} catch (err) {
|
|
819
|
+
logErr(err instanceof Error ? err.message : String(err));
|
|
820
|
+
process.exit(1);
|
|
821
|
+
}
|
|
822
|
+
const rawSkill = fs11.readFileSync(src.skillFile, "utf8");
|
|
742
823
|
const norm = opts.normalize ? normalizeSkillContent(rawSkill, {
|
|
743
|
-
fallbackName:
|
|
824
|
+
fallbackName: path35.basename(src.dir),
|
|
744
825
|
version: opts.version,
|
|
745
826
|
stage: opts.stage
|
|
746
|
-
}) : { content: rawSkill, name:
|
|
827
|
+
}) : { content: rawSkill, name: path35.basename(src.dir), changed: false, notes: [] };
|
|
747
828
|
if (!opts.normalize && !isValidAssetName(norm.name)) {
|
|
748
829
|
logWarn(
|
|
749
830
|
`Name "${norm.name}" is not canonical (kebab-case); \`skaile validate\` will reject this manifest entry. Drop --no-normalize to slugify it.`
|
|
750
831
|
);
|
|
751
832
|
}
|
|
752
|
-
const destDir =
|
|
753
|
-
if (
|
|
833
|
+
const destDir = path35.join(target.path, norm.name);
|
|
834
|
+
if (fs11.existsSync(destDir)) {
|
|
754
835
|
logErr(`Destination already exists: ${destDir}`);
|
|
755
836
|
process.exit(1);
|
|
756
837
|
}
|
|
757
|
-
|
|
758
|
-
|
|
838
|
+
fs11.cpSync(src.dir, destDir, { recursive: true });
|
|
839
|
+
fs11.writeFileSync(path35.join(destDir, "SKILL.md"), norm.content, "utf8");
|
|
759
840
|
for (const note of norm.notes) logInfo(` \u2022 ${note}`);
|
|
760
841
|
const fm = parseFrontmatter(norm.content).data;
|
|
761
842
|
const descRaw = fm.description;
|
|
@@ -763,7 +844,7 @@ function makeAssetCommand() {
|
|
|
763
844
|
for (const f of checkAgentSkillConformance(fm, { dirName: norm.name })) {
|
|
764
845
|
logWarn(`conformance: ${f.field} \u2014 ${f.message}`);
|
|
765
846
|
}
|
|
766
|
-
const root =
|
|
847
|
+
const root = path35.relative(target.path, destDir);
|
|
767
848
|
const up = upsertManifestAsset(target.path, {
|
|
768
849
|
kind: "skill",
|
|
769
850
|
name: norm.name,
|
|
@@ -796,7 +877,7 @@ function makeAssetCommand() {
|
|
|
796
877
|
logErr(`Invalid --mode "${opts.mode}". Expected: copy | move | link.`);
|
|
797
878
|
process.exit(1);
|
|
798
879
|
}
|
|
799
|
-
if (!
|
|
880
|
+
if (!fs11.existsSync(srcPath)) {
|
|
800
881
|
logErr(`Source path does not exist: ${srcPath}`);
|
|
801
882
|
process.exit(1);
|
|
802
883
|
}
|
|
@@ -821,23 +902,23 @@ function makeAssetCommand() {
|
|
|
821
902
|
);
|
|
822
903
|
process.exit(1);
|
|
823
904
|
}
|
|
824
|
-
const basename2 =
|
|
905
|
+
const basename2 = path35.basename(srcPath);
|
|
825
906
|
const destDir = target.path;
|
|
826
|
-
|
|
827
|
-
const destPath =
|
|
828
|
-
if (
|
|
907
|
+
fs11.mkdirSync(destDir, { recursive: true });
|
|
908
|
+
const destPath = path35.join(destDir, basename2);
|
|
909
|
+
if (fs11.existsSync(destPath)) {
|
|
829
910
|
logErr(`Destination already exists: ${destPath}`);
|
|
830
911
|
process.exit(1);
|
|
831
912
|
}
|
|
832
913
|
switch (opts.mode) {
|
|
833
914
|
case "copy":
|
|
834
|
-
|
|
915
|
+
fs11.cpSync(srcPath, destPath, { recursive: true });
|
|
835
916
|
break;
|
|
836
917
|
case "move":
|
|
837
|
-
|
|
918
|
+
fs11.renameSync(srcPath, destPath);
|
|
838
919
|
break;
|
|
839
920
|
case "link":
|
|
840
|
-
|
|
921
|
+
fs11.symlinkSync(path35.resolve(srcPath), destPath);
|
|
841
922
|
break;
|
|
842
923
|
}
|
|
843
924
|
if (target.backend === "git" && opts.commit) {
|
|
@@ -886,27 +967,25 @@ function makeAssetCommand() {
|
|
|
886
967
|
logErr(`No asset found for ref "${ref}". Try \`skaile search\`.`);
|
|
887
968
|
process.exit(1);
|
|
888
969
|
}
|
|
889
|
-
const target = opts.target ?? process.cwd();
|
|
890
970
|
const lib = def.libraryId ? (await manager.listLibraries()).find((l) => l.id === def.libraryId) : void 0;
|
|
891
971
|
if (!lib) {
|
|
892
972
|
logErr(`Asset has no associated library; install path unknown.`);
|
|
893
973
|
process.exit(1);
|
|
894
974
|
}
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
975
|
+
let installed;
|
|
976
|
+
try {
|
|
977
|
+
installed = installLibraryAsset({
|
|
978
|
+
def,
|
|
979
|
+
library: lib,
|
|
980
|
+
targetDir: opts.target ?? process.cwd(),
|
|
981
|
+
mode: opts.mode,
|
|
982
|
+
registry: createFullRegistry()
|
|
983
|
+
});
|
|
984
|
+
} catch (err) {
|
|
985
|
+
logErr(err instanceof Error ? err.message : String(err));
|
|
900
986
|
process.exit(1);
|
|
901
987
|
}
|
|
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})`);
|
|
988
|
+
logOk(`Installed ${catalogAssetRef(def)} \u2192 ${installed.installPath} (${opts.mode})`);
|
|
910
989
|
} finally {
|
|
911
990
|
close();
|
|
912
991
|
}
|
|
@@ -969,14 +1048,14 @@ function makeAuthCommand() {
|
|
|
969
1048
|
}
|
|
970
1049
|
function collectCacheTargets(scope) {
|
|
971
1050
|
const out = [];
|
|
972
|
-
out.push(
|
|
973
|
-
out.push(
|
|
974
|
-
out.push(
|
|
1051
|
+
out.push(path35__default.join(scope.projectDir, ".skaile", "cache"));
|
|
1052
|
+
out.push(path35__default.join(scope.projectDir, ".skaile", "store-cache"));
|
|
1053
|
+
out.push(path35__default.join(scope.projectDir, ".skaile", "repos"));
|
|
975
1054
|
if (scope.global) {
|
|
976
1055
|
out.push(globalCacheRoot());
|
|
977
1056
|
const home = globalSkaileDir();
|
|
978
|
-
out.push(
|
|
979
|
-
out.push(
|
|
1057
|
+
out.push(path35__default.join(home, "repos"));
|
|
1058
|
+
out.push(path35__default.join(home, "catalog-cache"));
|
|
980
1059
|
}
|
|
981
1060
|
return out;
|
|
982
1061
|
}
|
|
@@ -990,7 +1069,7 @@ function dirSize(target) {
|
|
|
990
1069
|
function dirSizeOfDir(dir) {
|
|
991
1070
|
let total = 0;
|
|
992
1071
|
for (const ent of readdirSync(dir, { withFileTypes: true })) {
|
|
993
|
-
const child =
|
|
1072
|
+
const child = path35__default.join(dir, ent.name);
|
|
994
1073
|
if (ent.isSymbolicLink()) continue;
|
|
995
1074
|
if (ent.isDirectory()) total += dirSizeOfDir(child);
|
|
996
1075
|
else if (ent.isFile()) total += statSync(child).size;
|
|
@@ -1016,7 +1095,7 @@ function makeCacheCommand() {
|
|
|
1016
1095
|
const cmd = new Command("cache").description("Inspect and reclaim the re-derivable cache");
|
|
1017
1096
|
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
1097
|
const targets = collectCacheTargets({
|
|
1019
|
-
projectDir:
|
|
1098
|
+
projectDir: path35__default.resolve(opts.projectDir),
|
|
1020
1099
|
global: opts.global
|
|
1021
1100
|
}).filter((t) => existsSync(t));
|
|
1022
1101
|
if (targets.length === 0) {
|
|
@@ -1046,12 +1125,12 @@ function makeCacheCommand() {
|
|
|
1046
1125
|
for (const r of removed) logOk(`Removed ${r}`);
|
|
1047
1126
|
});
|
|
1048
1127
|
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(
|
|
1128
|
+
console.log(path35__default.join(path35__default.resolve(opts.projectDir), ".skaile", "cache"));
|
|
1050
1129
|
if (opts.global) console.log(globalCacheRoot());
|
|
1051
1130
|
});
|
|
1052
1131
|
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
1132
|
const targets = collectCacheTargets({
|
|
1054
|
-
projectDir:
|
|
1133
|
+
projectDir: path35__default.resolve(opts.projectDir),
|
|
1055
1134
|
global: opts.global
|
|
1056
1135
|
});
|
|
1057
1136
|
console.log();
|
|
@@ -1067,7 +1146,7 @@ function makeCatalogCommand() {
|
|
|
1067
1146
|
const catalog = new Command("catalog").description("Catalog source health and configuration");
|
|
1068
1147
|
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
1148
|
const { resolveConfig, isLocalCatalogUrl, trpcGetUrl } = await import('../library/index.js');
|
|
1070
|
-
const projectDir = opts.projectDir ?
|
|
1149
|
+
const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : void 0;
|
|
1071
1150
|
const cfg = resolveConfig({ projectDir });
|
|
1072
1151
|
const baseUrl = opts.url ?? cfg.catalog.url;
|
|
1073
1152
|
if (isLocalCatalogUrl(baseUrl)) {
|
|
@@ -1085,7 +1164,7 @@ function makeCatalogCommand() {
|
|
|
1085
1164
|
});
|
|
1086
1165
|
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
1166
|
const { resolveConfig } = await import('../library/index.js');
|
|
1088
|
-
const projectDir = opts.projectDir ?
|
|
1167
|
+
const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : void 0;
|
|
1089
1168
|
const cfg = resolveConfig({ projectDir });
|
|
1090
1169
|
console.log(`url: ${cfg.catalog.url}`);
|
|
1091
1170
|
console.log(`framing: ${cfg.catalog.framing}`);
|
|
@@ -1094,7 +1173,7 @@ function makeCatalogCommand() {
|
|
|
1094
1173
|
return catalog;
|
|
1095
1174
|
}
|
|
1096
1175
|
async function runLocalCatalogTest(projectDir) {
|
|
1097
|
-
const { resolveCatalogSource } = await import('../open-library-
|
|
1176
|
+
const { resolveCatalogSource } = await import('../open-library-4IJTBVTR.js');
|
|
1098
1177
|
let resolved;
|
|
1099
1178
|
try {
|
|
1100
1179
|
resolved = await resolveCatalogSource({ projectDir });
|
|
@@ -1226,15 +1305,20 @@ function discoverFlows(projectDir) {
|
|
|
1226
1305
|
function findFlowFile(flowId, priorityRoots = [], projectDir) {
|
|
1227
1306
|
return findFlowFileInRoots(flowId, [...priorityRoots, ...aiResourceRoots(projectDir)]);
|
|
1228
1307
|
}
|
|
1229
|
-
|
|
1308
|
+
var libraryFlowEntriesCache;
|
|
1309
|
+
function libraryFlowEntries() {
|
|
1310
|
+
libraryFlowEntriesCache ??= scanLibraryFlowEntries();
|
|
1311
|
+
return libraryFlowEntriesCache;
|
|
1312
|
+
}
|
|
1313
|
+
async function scanLibraryFlowEntries() {
|
|
1230
1314
|
const entries = [];
|
|
1231
1315
|
try {
|
|
1232
1316
|
const { LocalCatalogSource, LocalIndex, resolveIndexPath } = await import('../library/index.js');
|
|
1233
1317
|
const indexPath = resolveIndexPath();
|
|
1234
1318
|
if (!existsSync(indexPath)) return entries;
|
|
1235
1319
|
const [{ authoringLibraries }, { createFullRegistry: createFullRegistry2 }] = await Promise.all([
|
|
1236
|
-
import('../open-library-
|
|
1237
|
-
import('../open-registry-
|
|
1320
|
+
import('../open-library-4IJTBVTR.js'),
|
|
1321
|
+
import('../open-registry-G5DI4RPU.js')
|
|
1238
1322
|
]);
|
|
1239
1323
|
const index = new LocalIndex({ indexPath });
|
|
1240
1324
|
try {
|
|
@@ -1291,11 +1375,11 @@ function findSkills() {
|
|
|
1291
1375
|
return deduped;
|
|
1292
1376
|
}
|
|
1293
1377
|
function walkSkills(dir, out) {
|
|
1294
|
-
for (const entry of
|
|
1295
|
-
const full =
|
|
1378
|
+
for (const entry of fs11__default.readdirSync(dir, { withFileTypes: true })) {
|
|
1379
|
+
const full = path35__default.join(dir, entry.name);
|
|
1296
1380
|
if (entry.isDirectory()) {
|
|
1297
|
-
const skillMd =
|
|
1298
|
-
if (
|
|
1381
|
+
const skillMd = path35__default.join(full, "SKILL.md");
|
|
1382
|
+
if (fs11__default.existsSync(skillMd)) {
|
|
1299
1383
|
out.push({ name: entry.name, path: full, skillPath: skillMd });
|
|
1300
1384
|
} else {
|
|
1301
1385
|
walkSkills(full, out);
|
|
@@ -1316,10 +1400,10 @@ function resolveFlowIds() {
|
|
|
1316
1400
|
}
|
|
1317
1401
|
}
|
|
1318
1402
|
function resolveSessionIds(projectDir) {
|
|
1319
|
-
const sessionsDir =
|
|
1320
|
-
if (!
|
|
1403
|
+
const sessionsDir = path35__default.join(projectDir, ".skaile", "sessions");
|
|
1404
|
+
if (!fs11__default.existsSync(sessionsDir)) return [];
|
|
1321
1405
|
try {
|
|
1322
|
-
return
|
|
1406
|
+
return fs11__default.readdirSync(sessionsDir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length));
|
|
1323
1407
|
} catch {
|
|
1324
1408
|
return [];
|
|
1325
1409
|
}
|
|
@@ -1447,8 +1531,8 @@ function printModelSelectionSection(config, projectDir) {
|
|
|
1447
1531
|
}
|
|
1448
1532
|
}
|
|
1449
1533
|
function printResolvedPathsSection(config) {
|
|
1450
|
-
const fw = config.driver ??
|
|
1451
|
-
const paths = DRIVER_DEFAULTS[fw] ?? DRIVER_DEFAULTS
|
|
1534
|
+
const fw = config.driver ?? DEFAULT_DRIVER_ID;
|
|
1535
|
+
const paths = DRIVER_DEFAULTS[fw] ?? DRIVER_DEFAULTS[DEFAULT_DRIVER_ID];
|
|
1452
1536
|
if (!paths) return;
|
|
1453
1537
|
console.log();
|
|
1454
1538
|
console.log(` ${S.heading("Resolved Paths")} ${S.dim(`(${fw})`)}`);
|
|
@@ -1458,7 +1542,7 @@ function printResolvedPathsSection(config) {
|
|
|
1458
1542
|
console.log(` ${S.label("prompts:".padEnd(16))} ${config.promptsDir ?? paths.promptsDir}`);
|
|
1459
1543
|
}
|
|
1460
1544
|
async function showConfig(opts) {
|
|
1461
|
-
const projectDir = opts.projectDir ?
|
|
1545
|
+
const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : process.cwd();
|
|
1462
1546
|
let config;
|
|
1463
1547
|
let wsDefaults;
|
|
1464
1548
|
try {
|
|
@@ -1503,13 +1587,13 @@ function makeConfigCommand() {
|
|
|
1503
1587
|
const cmd = new Command("config").description("Manage personal config (.skaile/settings.json)");
|
|
1504
1588
|
cmd.command("show").description("Show effective config with sources").option("--project-dir <path>", "Project directory").action((opts) => showConfig(opts));
|
|
1505
1589
|
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 ?
|
|
1590
|
+
const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : process.cwd();
|
|
1507
1591
|
const config = await resolveSettings(projectDir);
|
|
1508
1592
|
const value = config[key];
|
|
1509
1593
|
console.log(value ?? S.dim("(not set)"));
|
|
1510
1594
|
});
|
|
1511
1595
|
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 ?
|
|
1596
|
+
const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : process.cwd();
|
|
1513
1597
|
if (key === "provider" || key === "cloud" || key === "cloudConfig") {
|
|
1514
1598
|
logErr(
|
|
1515
1599
|
`'${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 +1730,11 @@ function makeConnectCommand() {
|
|
|
1646
1730
|
process.exitCode = 1;
|
|
1647
1731
|
return;
|
|
1648
1732
|
}
|
|
1649
|
-
await new Promise((
|
|
1733
|
+
await new Promise((resolve5) => {
|
|
1650
1734
|
client.onMessage((event) => {
|
|
1651
1735
|
console.log(formatEvent(event));
|
|
1652
1736
|
if (event.type === "finished" || event.type === "debug_result") {
|
|
1653
|
-
|
|
1737
|
+
resolve5();
|
|
1654
1738
|
}
|
|
1655
1739
|
});
|
|
1656
1740
|
client.send(parsed);
|
|
@@ -1694,12 +1778,12 @@ function makeConnectCommand() {
|
|
|
1694
1778
|
client.send(cmd);
|
|
1695
1779
|
rl.prompt();
|
|
1696
1780
|
});
|
|
1697
|
-
await new Promise((
|
|
1698
|
-
rl.on("close",
|
|
1781
|
+
await new Promise((resolve5) => {
|
|
1782
|
+
rl.on("close", resolve5);
|
|
1699
1783
|
client.onDisconnect(() => {
|
|
1700
1784
|
logErr("Server disconnected");
|
|
1701
1785
|
rl.close();
|
|
1702
|
-
|
|
1786
|
+
resolve5();
|
|
1703
1787
|
});
|
|
1704
1788
|
});
|
|
1705
1789
|
await client.disconnect();
|
|
@@ -1781,15 +1865,15 @@ function parseOpArgs(args) {
|
|
|
1781
1865
|
async function promptText(label, defaultVal) {
|
|
1782
1866
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
1783
1867
|
const hint = defaultVal ? ` [${defaultVal}]` : "";
|
|
1784
|
-
return new Promise((
|
|
1868
|
+
return new Promise((resolve5) => {
|
|
1785
1869
|
rl.question(` ${label}${hint}: `, (answer) => {
|
|
1786
1870
|
rl.close();
|
|
1787
|
-
|
|
1871
|
+
resolve5(answer.trim() || defaultVal || "");
|
|
1788
1872
|
});
|
|
1789
1873
|
});
|
|
1790
1874
|
}
|
|
1791
1875
|
async function promptSecret(label) {
|
|
1792
|
-
return new Promise((
|
|
1876
|
+
return new Promise((resolve5) => {
|
|
1793
1877
|
process.stdout.write(` ${label} (hidden): `);
|
|
1794
1878
|
const stdin = process.stdin;
|
|
1795
1879
|
stdin.setRawMode?.(true);
|
|
@@ -1802,7 +1886,7 @@ async function promptSecret(label) {
|
|
|
1802
1886
|
stdin.pause();
|
|
1803
1887
|
stdin.removeListener("data", onData);
|
|
1804
1888
|
process.stdout.write("\n");
|
|
1805
|
-
|
|
1889
|
+
resolve5(value);
|
|
1806
1890
|
} else if (char === "") {
|
|
1807
1891
|
process.exit(1);
|
|
1808
1892
|
} else if (char === "\x7F") {
|
|
@@ -1849,8 +1933,8 @@ function makeConnectorCommand() {
|
|
|
1849
1933
|
async (driver, opts) => {
|
|
1850
1934
|
const { installNpmPackages } = await import('../connectors/index.js');
|
|
1851
1935
|
const { scanDirectory: scanDirectory2, factoryAssetRoots: factoryAssetRoots2, WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
1852
|
-
const projectDir =
|
|
1853
|
-
const yamlPath =
|
|
1936
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1937
|
+
const yamlPath = path35__default.join(projectDir, "skaile.yaml");
|
|
1854
1938
|
if (!existsSync(yamlPath)) {
|
|
1855
1939
|
logErr("No skaile.yaml found in current directory. Run 'skaile init' first.");
|
|
1856
1940
|
process.exit(1);
|
|
@@ -1910,8 +1994,8 @@ ${installResult.output}`);
|
|
|
1910
1994
|
);
|
|
1911
1995
|
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
1996
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
1913
|
-
const projectDir =
|
|
1914
|
-
const yamlPath =
|
|
1997
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1998
|
+
const yamlPath = path35__default.join(projectDir, "skaile.yaml");
|
|
1915
1999
|
if (!existsSync(yamlPath)) {
|
|
1916
2000
|
logErr("No skaile.yaml found in current directory.");
|
|
1917
2001
|
process.exit(1);
|
|
@@ -1928,7 +2012,7 @@ ${installResult.output}`);
|
|
|
1928
2012
|
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
2013
|
const res = await import('../connectors/index.js');
|
|
1930
2014
|
res.registerBuiltinConnectors();
|
|
1931
|
-
const projectDir =
|
|
2015
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1932
2016
|
const declarations = res.loadConnectorDeclarations(projectDir);
|
|
1933
2017
|
if (declarations.length === 0) {
|
|
1934
2018
|
console.log("No connectors configured in skaile.yaml.");
|
|
@@ -1952,7 +2036,7 @@ ${installResult.output}`);
|
|
|
1952
2036
|
await manager.disconnectAll();
|
|
1953
2037
|
});
|
|
1954
2038
|
cmd.command("list").description("List all configured connectors").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
|
|
1955
|
-
const projectDir =
|
|
2039
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1956
2040
|
const manager = await connectConnectors(projectDir);
|
|
1957
2041
|
try {
|
|
1958
2042
|
console.log(JSON.stringify(manager.listConnectors(), null, 2));
|
|
@@ -1961,7 +2045,7 @@ ${installResult.output}`);
|
|
|
1961
2045
|
}
|
|
1962
2046
|
});
|
|
1963
2047
|
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 =
|
|
2048
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1965
2049
|
const manager = await connectConnectors(projectDir);
|
|
1966
2050
|
try {
|
|
1967
2051
|
if (opts.all) {
|
|
@@ -1985,7 +2069,7 @@ ${installResult.output}`);
|
|
|
1985
2069
|
}
|
|
1986
2070
|
});
|
|
1987
2071
|
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 =
|
|
2072
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
1989
2073
|
const manager = await connectConnectors(projectDir);
|
|
1990
2074
|
try {
|
|
1991
2075
|
if (!manager.has(id)) {
|
|
@@ -2000,7 +2084,7 @@ ${installResult.output}`);
|
|
|
2000
2084
|
}
|
|
2001
2085
|
});
|
|
2002
2086
|
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 =
|
|
2087
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2004
2088
|
const manager = await connectConnectors(projectDir);
|
|
2005
2089
|
try {
|
|
2006
2090
|
const content = await manager.read(id, resourcePath);
|
|
@@ -2010,7 +2094,7 @@ ${installResult.output}`);
|
|
|
2010
2094
|
}
|
|
2011
2095
|
});
|
|
2012
2096
|
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 =
|
|
2097
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2014
2098
|
const manager = await connectConnectors(projectDir);
|
|
2015
2099
|
try {
|
|
2016
2100
|
await manager.write(id, resourcePath, { data: content });
|
|
@@ -2020,7 +2104,7 @@ ${installResult.output}`);
|
|
|
2020
2104
|
}
|
|
2021
2105
|
});
|
|
2022
2106
|
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 =
|
|
2107
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2024
2108
|
const manager = await connectConnectors(projectDir);
|
|
2025
2109
|
try {
|
|
2026
2110
|
const entries = await manager.list(id, resourcePath, {
|
|
@@ -2033,7 +2117,7 @@ ${installResult.output}`);
|
|
|
2033
2117
|
}
|
|
2034
2118
|
});
|
|
2035
2119
|
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 =
|
|
2120
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2037
2121
|
const manager = await connectConnectors(projectDir);
|
|
2038
2122
|
try {
|
|
2039
2123
|
const results = await manager.search(id, query);
|
|
@@ -2043,7 +2127,7 @@ ${installResult.output}`);
|
|
|
2043
2127
|
}
|
|
2044
2128
|
});
|
|
2045
2129
|
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 =
|
|
2130
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2047
2131
|
const manager = await connectConnectors(projectDir);
|
|
2048
2132
|
try {
|
|
2049
2133
|
const ok = await manager.delete(id, resourcePath);
|
|
@@ -2053,7 +2137,7 @@ ${installResult.output}`);
|
|
|
2053
2137
|
}
|
|
2054
2138
|
});
|
|
2055
2139
|
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 =
|
|
2140
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2057
2141
|
const manager = await connectConnectors(projectDir);
|
|
2058
2142
|
try {
|
|
2059
2143
|
if (!manager.has(id)) {
|
|
@@ -2088,17 +2172,17 @@ async function runDebugQuery(query, parentOpts, args) {
|
|
|
2088
2172
|
process.exitCode = 1;
|
|
2089
2173
|
return;
|
|
2090
2174
|
}
|
|
2091
|
-
await new Promise((
|
|
2175
|
+
await new Promise((resolve5) => {
|
|
2092
2176
|
const timeout = setTimeout(() => {
|
|
2093
2177
|
logErr("Timeout: no debug_result received within 5s");
|
|
2094
2178
|
process.exitCode = 1;
|
|
2095
|
-
|
|
2179
|
+
resolve5();
|
|
2096
2180
|
}, 5e3);
|
|
2097
2181
|
client.onMessage((event) => {
|
|
2098
2182
|
if (event.type !== "debug_result") return;
|
|
2099
2183
|
clearTimeout(timeout);
|
|
2100
2184
|
printDebugResult(query, event.data);
|
|
2101
|
-
|
|
2185
|
+
resolve5();
|
|
2102
2186
|
});
|
|
2103
2187
|
client.send({ type: "debug", query, args });
|
|
2104
2188
|
});
|
|
@@ -2162,7 +2246,7 @@ function envRecord() {
|
|
|
2162
2246
|
async function buildDeployContext(projectDir) {
|
|
2163
2247
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2164
2248
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
2165
|
-
const workspaceId = config.name ??
|
|
2249
|
+
const workspaceId = config.name ?? path35__default.basename(projectDir);
|
|
2166
2250
|
let log;
|
|
2167
2251
|
try {
|
|
2168
2252
|
const { createLogger } = await import('../core/logging.js');
|
|
@@ -2194,13 +2278,13 @@ async function ensureTargetsRegistered(projectDir) {
|
|
|
2194
2278
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2195
2279
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
2196
2280
|
if (config.plugins && config.plugins.length > 0) {
|
|
2197
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
2281
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-QENDYZ63.js');
|
|
2198
2282
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
2199
2283
|
for (const f of result.failed) logWarn(f.error);
|
|
2200
2284
|
}
|
|
2201
2285
|
}
|
|
2202
2286
|
async function runUp(opts) {
|
|
2203
|
-
const projectDir =
|
|
2287
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2204
2288
|
await ensureTargetsRegistered(projectDir);
|
|
2205
2289
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
2206
2290
|
const { resolveDeployTarget, pluginRegistry } = await import('../plugin-registry/index.js');
|
|
@@ -2232,12 +2316,12 @@ async function runUp(opts) {
|
|
|
2232
2316
|
await holdUntilSignal(handle, controller);
|
|
2233
2317
|
}
|
|
2234
2318
|
function holdUntilSignal(handle, controller) {
|
|
2235
|
-
return new Promise((
|
|
2319
|
+
return new Promise((resolve5) => {
|
|
2236
2320
|
const onSig = () => {
|
|
2237
2321
|
process.removeListener("SIGINT", onSig);
|
|
2238
2322
|
controller.abort();
|
|
2239
2323
|
logInfo("Stopping\u2026");
|
|
2240
|
-
handle.stop().then(() => logOk("Stopped.")).catch((e) => logErr(`stop failed: ${e instanceof Error ? e.message : String(e)}`)).finally(() =>
|
|
2324
|
+
handle.stop().then(() => logOk("Stopped.")).catch((e) => logErr(`stop failed: ${e instanceof Error ? e.message : String(e)}`)).finally(() => resolve5());
|
|
2241
2325
|
};
|
|
2242
2326
|
process.on("SIGINT", onSig);
|
|
2243
2327
|
});
|
|
@@ -2268,7 +2352,7 @@ async function restoreFromHandle(projectDir) {
|
|
|
2268
2352
|
return { target, handle, ctx };
|
|
2269
2353
|
}
|
|
2270
2354
|
async function runDown(opts) {
|
|
2271
|
-
const projectDir =
|
|
2355
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2272
2356
|
const restored = await restoreFromHandle(projectDir);
|
|
2273
2357
|
if (!restored) return;
|
|
2274
2358
|
await restored.handle.stop();
|
|
@@ -2277,7 +2361,7 @@ async function runDown(opts) {
|
|
|
2277
2361
|
logOk(`Stopped ${S.cmd(restored.target.id)} and cleared the handle.`);
|
|
2278
2362
|
}
|
|
2279
2363
|
async function runStatus(opts) {
|
|
2280
|
-
const projectDir =
|
|
2364
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2281
2365
|
const restored = await restoreFromHandle(projectDir);
|
|
2282
2366
|
if (!restored) return;
|
|
2283
2367
|
const health = await restored.handle.health();
|
|
@@ -2291,7 +2375,7 @@ async function runStatus(opts) {
|
|
|
2291
2375
|
console.log();
|
|
2292
2376
|
}
|
|
2293
2377
|
async function runLogs(opts) {
|
|
2294
|
-
const projectDir =
|
|
2378
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2295
2379
|
const restored = await restoreFromHandle(projectDir);
|
|
2296
2380
|
if (!restored) return;
|
|
2297
2381
|
if (!restored.handle.logs) {
|
|
@@ -2315,7 +2399,7 @@ function makeDeployCommand() {
|
|
|
2315
2399
|
}
|
|
2316
2400
|
function makeDiffCommand() {
|
|
2317
2401
|
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:
|
|
2402
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
2319
2403
|
const result = await am2.diff(ref);
|
|
2320
2404
|
switch (result.status) {
|
|
2321
2405
|
case "not-found":
|
|
@@ -2337,7 +2421,7 @@ function makeDiffCommand() {
|
|
|
2337
2421
|
function makeFlowCommand() {
|
|
2338
2422
|
const cmd = new Command("flow").description("Manage flows");
|
|
2339
2423
|
cmd.command("list").description("List available flows").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
2340
|
-
const flows = await discoverFlowsWithLibraries(
|
|
2424
|
+
const flows = await discoverFlowsWithLibraries(path35__default.resolve(opts.projectDir));
|
|
2341
2425
|
if (flows.length === 0) {
|
|
2342
2426
|
logInfo("No flows found.");
|
|
2343
2427
|
return;
|
|
@@ -2352,7 +2436,7 @@ function makeFlowCommand() {
|
|
|
2352
2436
|
console.log();
|
|
2353
2437
|
});
|
|
2354
2438
|
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(
|
|
2439
|
+
const flows = await discoverFlowsWithLibraries(path35__default.resolve(opts.projectDir));
|
|
2356
2440
|
const flow = flows.find((f) => f.id === id);
|
|
2357
2441
|
if (!flow) {
|
|
2358
2442
|
logErr(`Flow not found: ${id}`);
|
|
@@ -2384,7 +2468,7 @@ function makeFlowCommand() {
|
|
|
2384
2468
|
function makeHistoryCommand() {
|
|
2385
2469
|
const cmd = new Command("history").description("Show recent add/remove/update actions");
|
|
2386
2470
|
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:
|
|
2471
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
2388
2472
|
const limit = parseInt(limitStr, 10) || 20;
|
|
2389
2473
|
const entries = am2.history(limit);
|
|
2390
2474
|
if (entries.length === 0) {
|
|
@@ -2404,7 +2488,7 @@ function makeHistoryCommand() {
|
|
|
2404
2488
|
console.log();
|
|
2405
2489
|
});
|
|
2406
2490
|
cmd.command("clear").description("Clear action history").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
2407
|
-
const am2 = new AssetManager({ projectDir:
|
|
2491
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
2408
2492
|
am2.clearHistory();
|
|
2409
2493
|
logOk("History cleared.");
|
|
2410
2494
|
});
|
|
@@ -2417,12 +2501,12 @@ var MCP_SERVER_ENTRY = {
|
|
|
2417
2501
|
env: {}
|
|
2418
2502
|
};
|
|
2419
2503
|
function pluginDir(projectDir) {
|
|
2420
|
-
return
|
|
2504
|
+
return path35__default.join(projectDir, ".claude", "plugins", "skaile");
|
|
2421
2505
|
}
|
|
2422
2506
|
async function readJsonStrict(p7) {
|
|
2423
2507
|
let raw;
|
|
2424
2508
|
try {
|
|
2425
|
-
raw = await
|
|
2509
|
+
raw = await fs5.readFile(p7, "utf-8");
|
|
2426
2510
|
} catch {
|
|
2427
2511
|
return null;
|
|
2428
2512
|
}
|
|
@@ -2435,32 +2519,32 @@ async function readJsonStrict(p7) {
|
|
|
2435
2519
|
}
|
|
2436
2520
|
}
|
|
2437
2521
|
async function writeJson(p7, value) {
|
|
2438
|
-
await
|
|
2439
|
-
await
|
|
2522
|
+
await fs5.mkdir(path35__default.dirname(p7), { recursive: true });
|
|
2523
|
+
await fs5.writeFile(p7, `${JSON.stringify(value, null, 2)}
|
|
2440
2524
|
`);
|
|
2441
2525
|
}
|
|
2442
2526
|
async function copyDir(src, dest) {
|
|
2443
|
-
await
|
|
2444
|
-
const entries = await
|
|
2527
|
+
await fs5.mkdir(dest, { recursive: true });
|
|
2528
|
+
const entries = await fs5.readdir(src, { withFileTypes: true });
|
|
2445
2529
|
for (const entry of entries) {
|
|
2446
|
-
const srcPath =
|
|
2447
|
-
const destPath =
|
|
2530
|
+
const srcPath = path35__default.join(src, entry.name);
|
|
2531
|
+
const destPath = path35__default.join(dest, entry.name);
|
|
2448
2532
|
if (entry.isDirectory()) await copyDir(srcPath, destPath);
|
|
2449
|
-
else await
|
|
2533
|
+
else await fs5.copyFile(srcPath, destPath);
|
|
2450
2534
|
}
|
|
2451
2535
|
}
|
|
2452
2536
|
async function install(projectDir, opts) {
|
|
2453
2537
|
return opts?.full ? installFullPlugin(projectDir) : installMcp(projectDir);
|
|
2454
2538
|
}
|
|
2455
2539
|
async function installMcp(projectDir) {
|
|
2456
|
-
const mcpPath =
|
|
2540
|
+
const mcpPath = path35__default.join(projectDir, ".claude", "mcp.json");
|
|
2457
2541
|
const existing = await readJsonStrict(mcpPath) ?? {};
|
|
2458
2542
|
const mcpServers = { ...existing.mcpServers ?? {} };
|
|
2459
2543
|
const previous = mcpServers[SKAILE_MCP_NAME];
|
|
2460
2544
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(MCP_SERVER_ENTRY);
|
|
2461
2545
|
let warning;
|
|
2462
2546
|
if (previous && !matches) {
|
|
2463
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${
|
|
2547
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${path35__default.relative(projectDir, mcpPath)}`;
|
|
2464
2548
|
}
|
|
2465
2549
|
mcpServers[SKAILE_MCP_NAME] = MCP_SERVER_ENTRY;
|
|
2466
2550
|
await writeJson(mcpPath, { ...existing, mcpServers });
|
|
@@ -2469,15 +2553,15 @@ async function installMcp(projectDir) {
|
|
|
2469
2553
|
async function installFullPlugin(projectDir) {
|
|
2470
2554
|
const dir = pluginDir(projectDir);
|
|
2471
2555
|
for (const [rel, content] of Object.entries(buildClaudePluginFiles())) {
|
|
2472
|
-
const dest =
|
|
2473
|
-
await
|
|
2474
|
-
await
|
|
2556
|
+
const dest = path35__default.join(dir, rel);
|
|
2557
|
+
await fs5.mkdir(path35__default.dirname(dest), { recursive: true });
|
|
2558
|
+
await fs5.writeFile(dest, content);
|
|
2475
2559
|
}
|
|
2476
|
-
const projectSkillsDir =
|
|
2560
|
+
const projectSkillsDir = path35__default.join(projectDir, ".skaile", "skills");
|
|
2477
2561
|
if (existsSync(projectSkillsDir)) {
|
|
2478
|
-
await copyDir(projectSkillsDir,
|
|
2562
|
+
await copyDir(projectSkillsDir, path35__default.join(dir, "skills"));
|
|
2479
2563
|
}
|
|
2480
|
-
const settingsPath =
|
|
2564
|
+
const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
|
|
2481
2565
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2482
2566
|
const plugins = settings.plugins ?? [];
|
|
2483
2567
|
if (!plugins.includes(dir)) plugins.push(dir);
|
|
@@ -2485,8 +2569,8 @@ async function installFullPlugin(projectDir) {
|
|
|
2485
2569
|
return { changed: true, method: "plugin" };
|
|
2486
2570
|
}
|
|
2487
2571
|
async function uninstall(projectDir) {
|
|
2488
|
-
const settingsPath =
|
|
2489
|
-
const mcpPath =
|
|
2572
|
+
const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
|
|
2573
|
+
const mcpPath = path35__default.join(projectDir, ".claude", "mcp.json");
|
|
2490
2574
|
const dir = pluginDir(projectDir);
|
|
2491
2575
|
let changed = false;
|
|
2492
2576
|
const settings = await readJsonStrict(settingsPath);
|
|
@@ -2500,7 +2584,7 @@ async function uninstall(projectDir) {
|
|
|
2500
2584
|
}
|
|
2501
2585
|
}
|
|
2502
2586
|
if (existsSync(dir)) {
|
|
2503
|
-
await
|
|
2587
|
+
await fs5.rm(dir, { recursive: true, force: true });
|
|
2504
2588
|
changed = true;
|
|
2505
2589
|
}
|
|
2506
2590
|
const mcp = await readJsonStrict(mcpPath);
|
|
@@ -2510,7 +2594,7 @@ async function uninstall(projectDir) {
|
|
|
2510
2594
|
const updated = { ...mcp, mcpServers: rest };
|
|
2511
2595
|
if (Object.keys(rest).length === 0) delete updated.mcpServers;
|
|
2512
2596
|
if (Object.keys(updated).length === 0) {
|
|
2513
|
-
await
|
|
2597
|
+
await fs5.unlink(mcpPath);
|
|
2514
2598
|
} else {
|
|
2515
2599
|
await writeJson(mcpPath, updated);
|
|
2516
2600
|
}
|
|
@@ -2520,12 +2604,12 @@ async function uninstall(projectDir) {
|
|
|
2520
2604
|
async function detectInstall(projectDir) {
|
|
2521
2605
|
const dir = pluginDir(projectDir);
|
|
2522
2606
|
const settings = await readJsonStrict(
|
|
2523
|
-
|
|
2607
|
+
path35__default.join(projectDir, ".claude", "settings.json")
|
|
2524
2608
|
);
|
|
2525
|
-
if (existsSync(
|
|
2609
|
+
if (existsSync(path35__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir)) {
|
|
2526
2610
|
return { method: "plugin", pluginPath: dir };
|
|
2527
2611
|
}
|
|
2528
|
-
const mcp = await readJsonStrict(
|
|
2612
|
+
const mcp = await readJsonStrict(path35__default.join(projectDir, ".claude", "mcp.json"));
|
|
2529
2613
|
if (mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers) {
|
|
2530
2614
|
return { method: "mcp" };
|
|
2531
2615
|
}
|
|
@@ -2534,7 +2618,7 @@ async function detectInstall(projectDir) {
|
|
|
2534
2618
|
async function enable(projectDir) {
|
|
2535
2619
|
const detected = await detectInstall(projectDir);
|
|
2536
2620
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2537
|
-
const settingsPath =
|
|
2621
|
+
const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
|
|
2538
2622
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2539
2623
|
if (detected.method === "plugin") {
|
|
2540
2624
|
const disabled2 = settings.disabledPlugins ?? [];
|
|
@@ -2556,7 +2640,7 @@ async function enable(projectDir) {
|
|
|
2556
2640
|
async function disable(projectDir) {
|
|
2557
2641
|
const detected = await detectInstall(projectDir);
|
|
2558
2642
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2559
|
-
const settingsPath =
|
|
2643
|
+
const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
|
|
2560
2644
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2561
2645
|
if (detected.method === "plugin") {
|
|
2562
2646
|
const list2 = settings.disabledPlugins ?? [];
|
|
@@ -2576,12 +2660,12 @@ async function disable(projectDir) {
|
|
|
2576
2660
|
return { changed: true };
|
|
2577
2661
|
}
|
|
2578
2662
|
async function status(projectDir) {
|
|
2579
|
-
const settingsPath =
|
|
2580
|
-
const mcpPath =
|
|
2663
|
+
const settingsPath = path35__default.join(projectDir, ".claude", "settings.json");
|
|
2664
|
+
const mcpPath = path35__default.join(projectDir, ".claude", "mcp.json");
|
|
2581
2665
|
const dir = pluginDir(projectDir);
|
|
2582
2666
|
const settings = await readJsonStrict(settingsPath);
|
|
2583
2667
|
const mcp = await readJsonStrict(mcpPath);
|
|
2584
|
-
const pluginInstalled = !!(existsSync(
|
|
2668
|
+
const pluginInstalled = !!(existsSync(path35__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir));
|
|
2585
2669
|
const mcpInstalled = !!(mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers);
|
|
2586
2670
|
if (!pluginInstalled && !mcpInstalled) {
|
|
2587
2671
|
return {
|
|
@@ -2599,7 +2683,7 @@ async function status(projectDir) {
|
|
|
2599
2683
|
installed: "yes",
|
|
2600
2684
|
enabled: disabled2 ? "no" : "yes",
|
|
2601
2685
|
method: "plugin",
|
|
2602
|
-
location:
|
|
2686
|
+
location: path35__default.relative(projectDir, dir)
|
|
2603
2687
|
};
|
|
2604
2688
|
}
|
|
2605
2689
|
const disabled = settings?.disabledMcpjsonServers?.includes(SKAILE_MCP_NAME) ?? false;
|
|
@@ -2608,7 +2692,7 @@ async function status(projectDir) {
|
|
|
2608
2692
|
installed: "yes",
|
|
2609
2693
|
enabled: disabled ? "no" : "yes",
|
|
2610
2694
|
method: "mcp",
|
|
2611
|
-
location:
|
|
2695
|
+
location: path35__default.relative(projectDir, mcpPath)
|
|
2612
2696
|
};
|
|
2613
2697
|
}
|
|
2614
2698
|
var SKAILE_MCP_NAME2 = "skaile-workspace";
|
|
@@ -2622,7 +2706,7 @@ function buildEntry(projectDir) {
|
|
|
2622
2706
|
async function readConfig(p7) {
|
|
2623
2707
|
let raw;
|
|
2624
2708
|
try {
|
|
2625
|
-
raw = await
|
|
2709
|
+
raw = await fs5.readFile(p7, "utf-8");
|
|
2626
2710
|
} catch {
|
|
2627
2711
|
return null;
|
|
2628
2712
|
}
|
|
@@ -2635,16 +2719,16 @@ async function readConfig(p7) {
|
|
|
2635
2719
|
}
|
|
2636
2720
|
}
|
|
2637
2721
|
async function writeConfig(p7, value) {
|
|
2638
|
-
await
|
|
2722
|
+
await fs5.mkdir(path35__default.dirname(p7), { recursive: true });
|
|
2639
2723
|
const cleaned = {};
|
|
2640
2724
|
for (const [k, v] of Object.entries(value)) {
|
|
2641
2725
|
if (v === void 0) continue;
|
|
2642
2726
|
cleaned[k] = v;
|
|
2643
2727
|
}
|
|
2644
|
-
await
|
|
2728
|
+
await fs5.writeFile(p7, stringify$1(cleaned));
|
|
2645
2729
|
}
|
|
2646
2730
|
function configPath(projectDir) {
|
|
2647
|
-
return
|
|
2731
|
+
return path35__default.join(projectDir, ".codex", "config.toml");
|
|
2648
2732
|
}
|
|
2649
2733
|
async function install2(projectDir) {
|
|
2650
2734
|
const p7 = configPath(projectDir);
|
|
@@ -2655,7 +2739,7 @@ async function install2(projectDir) {
|
|
|
2655
2739
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(next);
|
|
2656
2740
|
let warning;
|
|
2657
2741
|
if (previous && !matches) {
|
|
2658
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${
|
|
2742
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${path35__default.relative(projectDir, p7)}`;
|
|
2659
2743
|
}
|
|
2660
2744
|
if (matches) return { changed: false, method: "toml" };
|
|
2661
2745
|
servers[SKAILE_MCP_NAME2] = next;
|
|
@@ -2672,7 +2756,7 @@ async function uninstall2(projectDir) {
|
|
|
2672
2756
|
const updated = { ...cfg, mcp_servers: rest };
|
|
2673
2757
|
if (Object.keys(rest).length === 0) delete updated.mcp_servers;
|
|
2674
2758
|
if (Object.keys(updated).length === 0) {
|
|
2675
|
-
await
|
|
2759
|
+
await fs5.unlink(p7);
|
|
2676
2760
|
} else {
|
|
2677
2761
|
await writeConfig(p7, updated);
|
|
2678
2762
|
}
|
|
@@ -2696,43 +2780,43 @@ async function status2(projectDir) {
|
|
|
2696
2780
|
installed: "yes",
|
|
2697
2781
|
enabled: "n/a",
|
|
2698
2782
|
method: "mcp",
|
|
2699
|
-
location:
|
|
2783
|
+
location: path35__default.relative(projectDir, p7)
|
|
2700
2784
|
};
|
|
2701
2785
|
}
|
|
2702
2786
|
async function install3(projectDir) {
|
|
2703
|
-
const extDir =
|
|
2704
|
-
const extPath =
|
|
2705
|
-
await
|
|
2787
|
+
const extDir = path35__default.join(projectDir, ".omp", "extensions");
|
|
2788
|
+
const extPath = path35__default.join(extDir, "skaile.ts");
|
|
2789
|
+
await fs5.mkdir(extDir, { recursive: true });
|
|
2706
2790
|
const { WorkspacePlugin } = await import('../workspace-plugin/index.js');
|
|
2707
2791
|
const plugin = new WorkspacePlugin({ projectDir });
|
|
2708
2792
|
const nextSrc = await plugin.buildOmpExtensionSource();
|
|
2709
2793
|
let prevSrc = null;
|
|
2710
2794
|
try {
|
|
2711
|
-
prevSrc = await
|
|
2795
|
+
prevSrc = await fs5.readFile(extPath, "utf-8");
|
|
2712
2796
|
} catch {
|
|
2713
2797
|
}
|
|
2714
2798
|
if (prevSrc === nextSrc) return { changed: false, method: "generated" };
|
|
2715
|
-
await
|
|
2799
|
+
await fs5.writeFile(extPath, nextSrc);
|
|
2716
2800
|
return { changed: true, method: "generated" };
|
|
2717
2801
|
}
|
|
2718
2802
|
async function uninstall3(projectDir) {
|
|
2719
|
-
const extPath =
|
|
2803
|
+
const extPath = path35__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
2720
2804
|
try {
|
|
2721
|
-
await
|
|
2805
|
+
await fs5.unlink(extPath);
|
|
2722
2806
|
return { changed: true };
|
|
2723
2807
|
} catch {
|
|
2724
2808
|
return { changed: false };
|
|
2725
2809
|
}
|
|
2726
2810
|
}
|
|
2727
2811
|
async function status3(projectDir) {
|
|
2728
|
-
const extPath =
|
|
2812
|
+
const extPath = path35__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
2729
2813
|
if (existsSync(extPath)) {
|
|
2730
2814
|
return {
|
|
2731
2815
|
harness: "omp",
|
|
2732
2816
|
installed: "yes",
|
|
2733
2817
|
enabled: "n/a",
|
|
2734
2818
|
method: "extension",
|
|
2735
|
-
location:
|
|
2819
|
+
location: path35__default.relative(projectDir, extPath)
|
|
2736
2820
|
};
|
|
2737
2821
|
}
|
|
2738
2822
|
return {
|
|
@@ -2795,7 +2879,7 @@ async function installCodex(projectDir) {
|
|
|
2795
2879
|
console.log(` ${S.dim("\u2192")} Restart Codex CLI to pick up the change.`);
|
|
2796
2880
|
}
|
|
2797
2881
|
async function runInstall(opts) {
|
|
2798
|
-
const projectDir =
|
|
2882
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2799
2883
|
const targets = resolveDriver(opts.driver);
|
|
2800
2884
|
let exitCode = 0;
|
|
2801
2885
|
if (targets.includes("claude-code")) {
|
|
@@ -2829,7 +2913,7 @@ async function uninstallCodex(projectDir) {
|
|
|
2829
2913
|
else logInfo(`codex: not installed`);
|
|
2830
2914
|
}
|
|
2831
2915
|
async function runUninstall(opts) {
|
|
2832
|
-
const projectDir =
|
|
2916
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2833
2917
|
const targets = resolveDriver(opts.driver);
|
|
2834
2918
|
let exitCode = 0;
|
|
2835
2919
|
if (targets.includes("claude-code")) {
|
|
@@ -2872,7 +2956,7 @@ async function toggleTarget(t, projectDir, action3) {
|
|
|
2872
2956
|
});
|
|
2873
2957
|
}
|
|
2874
2958
|
async function runToggle(opts, action3) {
|
|
2875
|
-
const projectDir =
|
|
2959
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2876
2960
|
const requestedAll = opts.driver === "all";
|
|
2877
2961
|
const targets = resolveDriver(opts.driver);
|
|
2878
2962
|
const usageError = checkToggleSupported(targets, requestedAll, action3);
|
|
@@ -2884,7 +2968,7 @@ async function runToggle(opts, action3) {
|
|
|
2884
2968
|
return exitCode;
|
|
2885
2969
|
}
|
|
2886
2970
|
async function runStatus2(opts) {
|
|
2887
|
-
const projectDir =
|
|
2971
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
2888
2972
|
const targets = resolveDriver(opts.driver);
|
|
2889
2973
|
const rows = [];
|
|
2890
2974
|
let exitCode = 0;
|
|
@@ -2955,7 +3039,7 @@ async function runHook(event) {
|
|
|
2955
3039
|
await plugin.shutdown();
|
|
2956
3040
|
return;
|
|
2957
3041
|
}
|
|
2958
|
-
const store = new PluginStore(
|
|
3042
|
+
const store = new PluginStore(path35__default.join(projectDir, ".skaile", "plugin-state.json"));
|
|
2959
3043
|
await store.load();
|
|
2960
3044
|
const status4 = store.get("connector:status");
|
|
2961
3045
|
if (status4 && typeof status4 === "object" && Object.keys(status4).length > 0) {
|
|
@@ -3050,9 +3134,16 @@ function exitOnSyncError(err) {
|
|
|
3050
3134
|
logErr(err instanceof Error ? err.message : String(err));
|
|
3051
3135
|
process.exit(1);
|
|
3052
3136
|
}
|
|
3137
|
+
function assertManifestEditableOrExit(libraryPath) {
|
|
3138
|
+
try {
|
|
3139
|
+
assertManifestEditable(libraryPath);
|
|
3140
|
+
} catch (err) {
|
|
3141
|
+
exitOnSyncError(err);
|
|
3142
|
+
}
|
|
3143
|
+
}
|
|
3053
3144
|
async function assertLibraryPathFree(manager, dir, exceptId) {
|
|
3054
3145
|
const clash = (await manager.listLibraries()).find(
|
|
3055
|
-
(l) => l.id !== exceptId &&
|
|
3146
|
+
(l) => l.id !== exceptId && path35.resolve(l.path) === dir
|
|
3056
3147
|
);
|
|
3057
3148
|
if (clash) throw new Error(`${dir} is already registered as library "${clash.name}".`);
|
|
3058
3149
|
}
|
|
@@ -3085,9 +3176,9 @@ by the same ref.
|
|
|
3085
3176
|
];
|
|
3086
3177
|
const written = [];
|
|
3087
3178
|
for (const [file, content] of files) {
|
|
3088
|
-
const target =
|
|
3089
|
-
if (
|
|
3090
|
-
|
|
3179
|
+
const target = path35.join(dir, file);
|
|
3180
|
+
if (fs11.existsSync(target)) continue;
|
|
3181
|
+
fs11.writeFileSync(target, content, "utf8");
|
|
3091
3182
|
written.push(file);
|
|
3092
3183
|
}
|
|
3093
3184
|
return written;
|
|
@@ -3162,8 +3253,8 @@ function makeLibraryCommand() {
|
|
|
3162
3253
|
);
|
|
3163
3254
|
process.exit(1);
|
|
3164
3255
|
}
|
|
3165
|
-
const libPath = opts.path ?
|
|
3166
|
-
if (
|
|
3256
|
+
const libPath = opts.path ? path35.resolve(opts.path) : path35.join(resolveLibraryDir(), name);
|
|
3257
|
+
if (fs11.existsSync(libPath) && !fs11.statSync(libPath).isDirectory()) {
|
|
3167
3258
|
logErr(`${libPath} exists and is not a directory.`);
|
|
3168
3259
|
process.exit(1);
|
|
3169
3260
|
}
|
|
@@ -3187,9 +3278,9 @@ function makeLibraryCommand() {
|
|
|
3187
3278
|
backend = "git";
|
|
3188
3279
|
backendConfig = { url: opts.git, branch, authHint: "ssh" };
|
|
3189
3280
|
} else {
|
|
3190
|
-
|
|
3281
|
+
fs11.mkdirSync(libPath, { recursive: true });
|
|
3191
3282
|
}
|
|
3192
|
-
const blank =
|
|
3283
|
+
const blank = fs11.readdirSync(libPath).every((entry) => entry === ".git");
|
|
3193
3284
|
const isDefault = !hasDefault && ownership !== "reader";
|
|
3194
3285
|
await manager.addLibrary({
|
|
3195
3286
|
name,
|
|
@@ -3252,9 +3343,10 @@ function makeLibraryCommand() {
|
|
|
3252
3343
|
const { manager, library, close } = await openLibraryManager();
|
|
3253
3344
|
try {
|
|
3254
3345
|
const target = await resolveTargetLibrary(manager, opts.library);
|
|
3346
|
+
assertManifestEditableOrExit(target.path);
|
|
3255
3347
|
const effectiveKind = opts.kind ?? kind;
|
|
3256
3348
|
const am2 = new AssetManager({ projectDir: process.cwd() });
|
|
3257
|
-
const destDir = opts.dir ?
|
|
3349
|
+
const destDir = opts.dir ? path35.join(target.path, opts.dir) : target.path;
|
|
3258
3350
|
const res = am2.create(name, effectiveKind, destDir, { description: opts.description });
|
|
3259
3351
|
if (!res.ok) {
|
|
3260
3352
|
logErr(res.path);
|
|
@@ -3268,11 +3360,11 @@ function makeLibraryCommand() {
|
|
|
3268
3360
|
}
|
|
3269
3361
|
const publisher = resolveLibraryPublisher(target, opts, getStoreIdentity());
|
|
3270
3362
|
stampAssetPublisher(res.path, publisher);
|
|
3271
|
-
|
|
3363
|
+
stampManifestPublisher(target.path, publisher);
|
|
3272
3364
|
upsertManifestAsset(target.path, {
|
|
3273
3365
|
kind: effectiveKind,
|
|
3274
3366
|
name,
|
|
3275
|
-
root:
|
|
3367
|
+
root: path35.relative(target.path, res.path) || name,
|
|
3276
3368
|
version: "0.1.0",
|
|
3277
3369
|
publisher
|
|
3278
3370
|
});
|
|
@@ -3310,13 +3402,13 @@ function makeLibraryCommand() {
|
|
|
3310
3402
|
const { manager, close } = await openLibraryManager();
|
|
3311
3403
|
try {
|
|
3312
3404
|
const lib = await manager.requireLibrary(oldName);
|
|
3313
|
-
const parent =
|
|
3314
|
-
const newPath =
|
|
3315
|
-
if (
|
|
3405
|
+
const parent = path35.dirname(lib.path);
|
|
3406
|
+
const newPath = path35.join(parent, newName);
|
|
3407
|
+
if (fs11.existsSync(newPath)) {
|
|
3316
3408
|
logErr(`Target directory already exists: ${newPath}`);
|
|
3317
3409
|
process.exit(1);
|
|
3318
3410
|
}
|
|
3319
|
-
|
|
3411
|
+
fs11.renameSync(lib.path, newPath);
|
|
3320
3412
|
await manager.updateLibrary(lib.id, { name: newName, path: newPath });
|
|
3321
3413
|
logOk(`Renamed ${oldName} \u2192 ${newName}`);
|
|
3322
3414
|
} finally {
|
|
@@ -3333,8 +3425,8 @@ function makeLibraryCommand() {
|
|
|
3333
3425
|
if (field === "ownership") patch.ownership = value;
|
|
3334
3426
|
else if (field === "isDefault") patch.isDefault = value === "true";
|
|
3335
3427
|
else if (field === "path") {
|
|
3336
|
-
const dir =
|
|
3337
|
-
if (!
|
|
3428
|
+
const dir = path35.resolve(value);
|
|
3429
|
+
if (!fs11.existsSync(dir) || !fs11.statSync(dir).isDirectory()) {
|
|
3338
3430
|
logErr(`Directory does not exist: ${dir}. \`library set path=\` does not move files.`);
|
|
3339
3431
|
process.exit(1);
|
|
3340
3432
|
}
|
|
@@ -3404,7 +3496,11 @@ function makeLibraryCommand() {
|
|
|
3404
3496
|
const { manager, library, close } = await openLibraryManager();
|
|
3405
3497
|
try {
|
|
3406
3498
|
const lib = await manager.requireLibrary(name);
|
|
3407
|
-
|
|
3499
|
+
assertManifestEditableOrExit(lib.path);
|
|
3500
|
+
const removed = await syncManifestWithDisk(
|
|
3501
|
+
lib.path,
|
|
3502
|
+
resolveLibraryPublisher(lib, {}, getStoreIdentity())
|
|
3503
|
+
);
|
|
3408
3504
|
const manifest = loadSkPublishManifest(lib.path);
|
|
3409
3505
|
for (const a of removed) {
|
|
3410
3506
|
const ref = manifest ? assetEntryRef(a, manifest) : `${a.kind}:${a.name}`;
|
|
@@ -3521,16 +3617,16 @@ function makeLibraryCommand() {
|
|
|
3521
3617
|
"With --create-repo: create the repo private (the store only accepts public repos)"
|
|
3522
3618
|
).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
3619
|
async (lib, opts) => {
|
|
3524
|
-
const { runLibraryPublish } = await import('../library-publish-
|
|
3620
|
+
const { runLibraryPublish } = await import('../library-publish-RIP6NBYA.js');
|
|
3525
3621
|
await withStoreErrorHandling(() => runLibraryPublish(lib, opts));
|
|
3526
3622
|
}
|
|
3527
3623
|
);
|
|
3528
3624
|
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-
|
|
3625
|
+
const { runLibraryRegister } = await import('../library-publish-RIP6NBYA.js');
|
|
3530
3626
|
await withStoreErrorHandling(() => runLibraryRegister(lib, opts));
|
|
3531
3627
|
});
|
|
3532
3628
|
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-
|
|
3629
|
+
const { runLibraryYank } = await import('../library-publish-RIP6NBYA.js');
|
|
3534
3630
|
await withStoreErrorHandling(() => runLibraryYank(lib, opts));
|
|
3535
3631
|
});
|
|
3536
3632
|
return cmd;
|
|
@@ -3547,24 +3643,24 @@ function stampAssetPublisher(assetDir, publisher) {
|
|
|
3547
3643
|
const markers = ["SKILL.md", "AGENT.md", "CONTRACT.md"];
|
|
3548
3644
|
let markerFile;
|
|
3549
3645
|
for (const m of markers) {
|
|
3550
|
-
if (
|
|
3551
|
-
markerFile =
|
|
3646
|
+
if (fs11.existsSync(path35.join(assetDir, m))) {
|
|
3647
|
+
markerFile = path35.join(assetDir, m);
|
|
3552
3648
|
break;
|
|
3553
3649
|
}
|
|
3554
3650
|
}
|
|
3555
3651
|
if (!markerFile) {
|
|
3556
|
-
const promptMd =
|
|
3557
|
-
if (promptMd) markerFile =
|
|
3652
|
+
const promptMd = fs11.readdirSync(assetDir).find((f) => f.endsWith(".prompt.md"));
|
|
3653
|
+
if (promptMd) markerFile = path35.join(assetDir, promptMd);
|
|
3558
3654
|
}
|
|
3559
3655
|
if (!markerFile) return;
|
|
3560
3656
|
try {
|
|
3561
|
-
const { data, body } = parseFrontmatter(
|
|
3657
|
+
const { data, body } = parseFrontmatter(fs11.readFileSync(markerFile, "utf8"));
|
|
3562
3658
|
const meta = data.metadata && typeof data.metadata === "object" && !Array.isArray(data.metadata) ? { ...data.metadata } : {};
|
|
3563
3659
|
if (meta.publisher != null) return;
|
|
3564
3660
|
meta.publisher = publisher;
|
|
3565
3661
|
data.metadata = meta;
|
|
3566
3662
|
const fm = stringify(data).trimEnd();
|
|
3567
|
-
|
|
3663
|
+
fs11.writeFileSync(markerFile, `---
|
|
3568
3664
|
${fm}
|
|
3569
3665
|
---
|
|
3570
3666
|
|
|
@@ -3573,30 +3669,6 @@ ${body}
|
|
|
3573
3669
|
} catch {
|
|
3574
3670
|
}
|
|
3575
3671
|
}
|
|
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
3672
|
async function printPerLibraryStatus(name, asJson) {
|
|
3601
3673
|
const { manager, close } = await openLibraryManager();
|
|
3602
3674
|
try {
|
|
@@ -3635,9 +3707,9 @@ async function printOverallStatus(projectDir, asJson) {
|
|
|
3635
3707
|
} catch {
|
|
3636
3708
|
secretsStrategy = "unavailable";
|
|
3637
3709
|
}
|
|
3638
|
-
const resolvedProjectDir =
|
|
3639
|
-
const hasWorkspaceConfig = existsSync(
|
|
3640
|
-
const hasLockFile = existsSync(
|
|
3710
|
+
const resolvedProjectDir = path35.resolve(projectDir);
|
|
3711
|
+
const hasWorkspaceConfig = existsSync(path35.join(resolvedProjectDir, "skaile.yaml"));
|
|
3712
|
+
const hasLockFile = existsSync(path35.join(resolvedProjectDir, "skaile.lock.yaml"));
|
|
3641
3713
|
let assignments = [];
|
|
3642
3714
|
if (hasWorkspaceConfig) {
|
|
3643
3715
|
try {
|
|
@@ -4244,7 +4316,7 @@ function scheduleSoftDepPreview() {
|
|
|
4244
4316
|
}
|
|
4245
4317
|
async function loadAssets() {
|
|
4246
4318
|
softDepPreviewCache.clear();
|
|
4247
|
-
const { gatherAssetFeeds } = await import('../asset-feeds-
|
|
4319
|
+
const { gatherAssetFeeds } = await import('../asset-feeds-WDIB3E6H.js');
|
|
4248
4320
|
const { entries, notes } = await gatherAssetFeeds(am, am.projectDir);
|
|
4249
4321
|
if (notes.length > 0) {
|
|
4250
4322
|
state.message = notes.map((n) => `[${n.feed}] ${n.message}`).join(" \u2022 ");
|
|
@@ -4264,7 +4336,7 @@ function rebuildSourceTree() {
|
|
|
4264
4336
|
rebuildVisibleSources();
|
|
4265
4337
|
}
|
|
4266
4338
|
function sourceOrgRepo(s) {
|
|
4267
|
-
const parts = s.path.split(
|
|
4339
|
+
const parts = s.path.split(path35__default.sep).filter(Boolean);
|
|
4268
4340
|
if (parts.length < 2) return null;
|
|
4269
4341
|
return { org: parts[parts.length - 2], repo: parts[parts.length - 1] };
|
|
4270
4342
|
}
|
|
@@ -4411,13 +4483,13 @@ function reconcileCollapsedSets(rows) {
|
|
|
4411
4483
|
async function loadSourcesAndLibraries() {
|
|
4412
4484
|
try {
|
|
4413
4485
|
const [{ openLibraryManager: openLibraryManager2 }, { getGlobalCacheDir: getGlobalCacheDir2, globalSkaileDir: globalSkaileDir2 }] = await Promise.all([
|
|
4414
|
-
import('../open-library-
|
|
4486
|
+
import('../open-library-4IJTBVTR.js'),
|
|
4415
4487
|
import('../core/index.js')
|
|
4416
4488
|
]);
|
|
4417
4489
|
const { manager, library, close } = await openLibraryManager2();
|
|
4418
4490
|
try {
|
|
4419
4491
|
const newRoot = getGlobalCacheDir2();
|
|
4420
|
-
const legacyRoot =
|
|
4492
|
+
const legacyRoot = path35__default.join(globalSkaileDir2(), "sources");
|
|
4421
4493
|
const isSourceRow = (l) => l.path.startsWith(newRoot) || l.path.startsWith(legacyRoot);
|
|
4422
4494
|
const libs = await manager.listLibraries();
|
|
4423
4495
|
const defs = await library.listAssetDefs();
|
|
@@ -4854,10 +4926,10 @@ async function showInfo() {
|
|
|
4854
4926
|
}
|
|
4855
4927
|
console.log();
|
|
4856
4928
|
console.log(pc5.dim(" Press any key to return..."));
|
|
4857
|
-
await new Promise((
|
|
4929
|
+
await new Promise((resolve5) => {
|
|
4858
4930
|
const onData = () => {
|
|
4859
4931
|
process.stdin.removeListener("data", onData);
|
|
4860
|
-
|
|
4932
|
+
resolve5();
|
|
4861
4933
|
};
|
|
4862
4934
|
process.stdin.once("data", onData);
|
|
4863
4935
|
});
|
|
@@ -5353,13 +5425,13 @@ async function run(projectDir) {
|
|
|
5353
5425
|
}
|
|
5354
5426
|
function makeManageCommand() {
|
|
5355
5427
|
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(
|
|
5428
|
+
await run(path35__default.resolve(opts.projectDir));
|
|
5357
5429
|
});
|
|
5358
5430
|
}
|
|
5359
5431
|
function makeMcpServerCommand() {
|
|
5360
5432
|
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 =
|
|
5433
|
+
const path38 = await import('path');
|
|
5434
|
+
const projectDir = path38.default.resolve(opts.projectDir);
|
|
5363
5435
|
const { LogStore, StdoutSink, registerLogStore } = await import('../core/logging.js');
|
|
5364
5436
|
registerLogStore(
|
|
5365
5437
|
new LogStore({
|
|
@@ -5529,7 +5601,7 @@ function workspaceConfigFiles(dir) {
|
|
|
5529
5601
|
} catch {
|
|
5530
5602
|
return [];
|
|
5531
5603
|
}
|
|
5532
|
-
return names.filter((name) => isWorkspaceConfigFilename(name)).sort().map((name) =>
|
|
5604
|
+
return names.filter((name) => isWorkspaceConfigFilename(name)).sort().map((name) => path35__default.join(dir, name));
|
|
5533
5605
|
}
|
|
5534
5606
|
function readAgentConfigBlock(raw) {
|
|
5535
5607
|
const key = AGENT_CONFIG_KEYS.find((candidate) => raw[candidate] !== void 0);
|
|
@@ -5541,7 +5613,7 @@ function readAgentConfigBlock(raw) {
|
|
|
5541
5613
|
return flat ? { key, profiles: { default: profiles }, flat } : { key, profiles, flat };
|
|
5542
5614
|
}
|
|
5543
5615
|
function planProviderMigration(options) {
|
|
5544
|
-
const projectDir =
|
|
5616
|
+
const projectDir = path35__default.resolve(options.projectDir);
|
|
5545
5617
|
const registryPath = options.workspace ? workspaceProviderRegistryPath(projectDir) : userProviderRegistryPath();
|
|
5546
5618
|
const plan = {
|
|
5547
5619
|
registryPath,
|
|
@@ -5557,7 +5629,7 @@ function planProviderMigration(options) {
|
|
|
5557
5629
|
raw = parseDocument(readFileSync(file, "utf-8")).toJS() ?? {};
|
|
5558
5630
|
} catch (error) {
|
|
5559
5631
|
plan.warnings.push(
|
|
5560
|
-
`${
|
|
5632
|
+
`${path35__default.basename(file)}: not valid YAML (${error instanceof Error ? error.message : String(error)}) \u2014 skipped`
|
|
5561
5633
|
);
|
|
5562
5634
|
continue;
|
|
5563
5635
|
}
|
|
@@ -5606,7 +5678,7 @@ function planProviderMigration(options) {
|
|
|
5606
5678
|
});
|
|
5607
5679
|
if (!model) {
|
|
5608
5680
|
plan.warnings.push(
|
|
5609
|
-
`${
|
|
5681
|
+
`${path35__default.basename(file)}: profile '${profile}' had no model: \u2014 it now resolves against registry order. Pin it with 'model: ${providerId}/<modelId>'.`
|
|
5610
5682
|
);
|
|
5611
5683
|
}
|
|
5612
5684
|
touched = true;
|
|
@@ -5673,7 +5745,7 @@ function printPlan(plan) {
|
|
|
5673
5745
|
for (const entry of plan.entries) {
|
|
5674
5746
|
const base = entry.entry.base_url ?? S.dim("(transport-derived)");
|
|
5675
5747
|
console.log(
|
|
5676
|
-
` ${S.label(`${
|
|
5748
|
+
` ${S.label(`${path35__default.basename(entry.file)} ${entry.profile}`)} provider: ${entry.legacy.provider}, cloud: ${entry.legacy.cloud}`
|
|
5677
5749
|
);
|
|
5678
5750
|
console.log(` \u2192 providers.yml ${S.bold(entry.providerId)} ${base}`);
|
|
5679
5751
|
console.log(
|
|
@@ -5689,7 +5761,7 @@ function printPlan(plan) {
|
|
|
5689
5761
|
console.log();
|
|
5690
5762
|
}
|
|
5691
5763
|
async function runMigrateProviders(opts) {
|
|
5692
|
-
const projectDir = opts.projectDir ?
|
|
5764
|
+
const projectDir = opts.projectDir ? path35__default.resolve(opts.projectDir) : process.cwd();
|
|
5693
5765
|
const plan = planProviderMigration({ projectDir, workspace: opts.workspace });
|
|
5694
5766
|
for (const warning of plan.warnings) logWarn(warning);
|
|
5695
5767
|
if (plan.entries.length === 0 && Object.keys(plan.providers).length === 0) {
|
|
@@ -5749,8 +5821,8 @@ function makeNpxCommand() {
|
|
|
5749
5821
|
skills.command("add <url>").description(
|
|
5750
5822
|
"Clone a repo, register it in the project's skaile.yaml sources[], and install a skill from it"
|
|
5751
5823
|
).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 =
|
|
5824
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
5825
|
+
const projYaml = path35__default.join(projectDir, "skaile.yaml");
|
|
5754
5826
|
if (!existsSync(projYaml)) {
|
|
5755
5827
|
logErr(`No skaile.yaml in ${projectDir} \u2014 run \`skaile init\` first.`);
|
|
5756
5828
|
process.exit(1);
|
|
@@ -5763,11 +5835,11 @@ function makeNpxCommand() {
|
|
|
5763
5835
|
}
|
|
5764
5836
|
const spinner4 = p5.spinner();
|
|
5765
5837
|
const key = sourceCacheKey(url);
|
|
5766
|
-
const clonePath =
|
|
5838
|
+
const clonePath = path35__default.join(getGlobalCacheDir(), key);
|
|
5767
5839
|
spinner4.start(`Cloning ${url}`);
|
|
5768
5840
|
try {
|
|
5769
5841
|
if (!existsSync(clonePath)) {
|
|
5770
|
-
mkdirSync(
|
|
5842
|
+
mkdirSync(path35__default.dirname(clonePath), { recursive: true });
|
|
5771
5843
|
execSync(`git clone ${url} ${clonePath}`, { stdio: "ignore" });
|
|
5772
5844
|
}
|
|
5773
5845
|
spinner4.stop(`Cloned to ${key}`);
|
|
@@ -5813,7 +5885,7 @@ function makeNpxCommand() {
|
|
|
5813
5885
|
return npx;
|
|
5814
5886
|
}
|
|
5815
5887
|
function resolvePublisher(clonePath, url) {
|
|
5816
|
-
const manifestPath =
|
|
5888
|
+
const manifestPath = path35__default.join(clonePath, SKAILE_MANIFEST_FILENAME);
|
|
5817
5889
|
if (existsSync(manifestPath)) {
|
|
5818
5890
|
try {
|
|
5819
5891
|
const { manifest } = decodeSkaileManifest(readFileSync(manifestPath, "utf8"));
|
|
@@ -5826,12 +5898,12 @@ function resolvePublisher(clonePath, url) {
|
|
|
5826
5898
|
return url.match(/github\.com[/:]([^/]+)\/[^/]+/)?.[1];
|
|
5827
5899
|
}
|
|
5828
5900
|
function resolveSkillName(clonePath, requested) {
|
|
5829
|
-
const skillsDir =
|
|
5830
|
-
if (existsSync(
|
|
5901
|
+
const skillsDir = path35__default.join(clonePath, "skills");
|
|
5902
|
+
if (existsSync(path35__default.join(skillsDir, requested, "SKILL.md"))) return requested;
|
|
5831
5903
|
if (!existsSync(skillsDir)) return requested;
|
|
5832
5904
|
for (const entry of readdirSync(skillsDir, { withFileTypes: true })) {
|
|
5833
5905
|
if (!entry.isDirectory()) continue;
|
|
5834
|
-
const md =
|
|
5906
|
+
const md = path35__default.join(skillsDir, entry.name, "SKILL.md");
|
|
5835
5907
|
if (!existsSync(md)) continue;
|
|
5836
5908
|
try {
|
|
5837
5909
|
const { data } = parseFrontmatter(readFileSync(md, "utf8"));
|
|
@@ -5861,7 +5933,7 @@ function makeOutdatedCommand() {
|
|
|
5861
5933
|
)
|
|
5862
5934
|
).action(async (filter, opts) => {
|
|
5863
5935
|
const am2 = new AssetManager({
|
|
5864
|
-
projectDir:
|
|
5936
|
+
projectDir: path35__default.resolve(opts.projectDir),
|
|
5865
5937
|
driverTarget: opts.target
|
|
5866
5938
|
});
|
|
5867
5939
|
const entries = await am2.outdated();
|
|
@@ -5891,7 +5963,7 @@ function makeOutdatedCommand() {
|
|
|
5891
5963
|
function makePatchCommand() {
|
|
5892
5964
|
const cmd = new Command("patch").description("Patch workflow for skill improvement");
|
|
5893
5965
|
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:
|
|
5966
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
5895
5967
|
try {
|
|
5896
5968
|
const dest = await am2.patch(ref);
|
|
5897
5969
|
logOk(`Extracted to ${S.dim(dest)}`);
|
|
@@ -5902,7 +5974,7 @@ function makePatchCommand() {
|
|
|
5902
5974
|
}
|
|
5903
5975
|
});
|
|
5904
5976
|
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:
|
|
5977
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
5906
5978
|
try {
|
|
5907
5979
|
const patchFile = await am2.patchCommit(ref);
|
|
5908
5980
|
logOk(`Patch saved to ${S.dim(patchFile)}`);
|
|
@@ -5913,7 +5985,7 @@ function makePatchCommand() {
|
|
|
5913
5985
|
}
|
|
5914
5986
|
});
|
|
5915
5987
|
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:
|
|
5988
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
5917
5989
|
try {
|
|
5918
5990
|
await am2.patchSubmit(ref);
|
|
5919
5991
|
logOk("Patch applied to repo clone and committed.");
|
|
@@ -5926,7 +5998,7 @@ function makePatchCommand() {
|
|
|
5926
5998
|
}
|
|
5927
5999
|
});
|
|
5928
6000
|
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:
|
|
6001
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
5930
6002
|
am2.patchRemove(ref);
|
|
5931
6003
|
logOk(`Patch removed for ${ref}`);
|
|
5932
6004
|
});
|
|
@@ -5944,7 +6016,7 @@ function action2(fn) {
|
|
|
5944
6016
|
};
|
|
5945
6017
|
}
|
|
5946
6018
|
async function reconcileAndReport(projectDir, plugins) {
|
|
5947
|
-
const { reconcilePlugins } = await import('../plugin-store-
|
|
6019
|
+
const { reconcilePlugins } = await import('../plugin-store-QENDYZ63.js');
|
|
5948
6020
|
if (plugins.length === 0) {
|
|
5949
6021
|
logInfo("No plugins declared \u2014 nothing to reconcile.");
|
|
5950
6022
|
return;
|
|
@@ -5958,10 +6030,10 @@ async function reconcileAndReport(projectDir, plugins) {
|
|
|
5958
6030
|
}
|
|
5959
6031
|
}
|
|
5960
6032
|
async function runInstall2(spec, opts) {
|
|
5961
|
-
const projectDir =
|
|
6033
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
5962
6034
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
5963
|
-
const { specName } = await import('../plugin-store-
|
|
5964
|
-
const yamlPath =
|
|
6035
|
+
const { specName } = await import('../plugin-store-QENDYZ63.js');
|
|
6036
|
+
const yamlPath = path35__default.join(projectDir, "skaile.yaml");
|
|
5965
6037
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
5966
6038
|
const replaced = editor.addPlugin(spec, specName);
|
|
5967
6039
|
editor.save();
|
|
@@ -5970,10 +6042,10 @@ async function runInstall2(spec, opts) {
|
|
|
5970
6042
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
5971
6043
|
}
|
|
5972
6044
|
async function runRemove(name, opts) {
|
|
5973
|
-
const projectDir =
|
|
6045
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
5974
6046
|
const { WorkspaceYamlEditor: WorkspaceYamlEditor2 } = await import('../core/index.js');
|
|
5975
|
-
const { specName } = await import('../plugin-store-
|
|
5976
|
-
const yamlPath =
|
|
6047
|
+
const { specName } = await import('../plugin-store-QENDYZ63.js');
|
|
6048
|
+
const yamlPath = path35__default.join(projectDir, "skaile.yaml");
|
|
5977
6049
|
const editor = WorkspaceYamlEditor2.load(yamlPath);
|
|
5978
6050
|
const removed = editor.removePlugin(name, specName);
|
|
5979
6051
|
if (!removed) {
|
|
@@ -5985,7 +6057,7 @@ async function runRemove(name, opts) {
|
|
|
5985
6057
|
await reconcileAndReport(projectDir, editor.getPlugins());
|
|
5986
6058
|
}
|
|
5987
6059
|
async function runList(opts) {
|
|
5988
|
-
const projectDir =
|
|
6060
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
5989
6061
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
5990
6062
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
5991
6063
|
const declared = config.plugins ?? [];
|
|
@@ -6000,7 +6072,7 @@ async function runList(opts) {
|
|
|
6000
6072
|
const registry = createPluginRegistry();
|
|
6001
6073
|
if (declared.length > 0) {
|
|
6002
6074
|
try {
|
|
6003
|
-
const { loadPlugins } = await import('../plugin-store-
|
|
6075
|
+
const { loadPlugins } = await import('../plugin-store-QENDYZ63.js');
|
|
6004
6076
|
const result = await loadPlugins(projectDir, declared, registry);
|
|
6005
6077
|
for (const f of result.failed) logWarn(f.error);
|
|
6006
6078
|
} catch (err) {
|
|
@@ -6081,11 +6153,11 @@ function presetItemsToWorkspace(preset, values) {
|
|
|
6081
6153
|
}
|
|
6082
6154
|
function resolveItemConfig(item, preset, values, envVarsToSet) {
|
|
6083
6155
|
const byKey = placeholderIndex(item, preset);
|
|
6084
|
-
const
|
|
6156
|
+
const resolve5 = (key) => {
|
|
6085
6157
|
const ph = byKey.get(key) ?? { key, type: "text", required: true };
|
|
6086
6158
|
return resolvePlaceholderValue(ph, values[key]);
|
|
6087
6159
|
};
|
|
6088
|
-
return substituteNode(item.config ?? {},
|
|
6160
|
+
return substituteNode(item.config ?? {}, resolve5, envVarsToSet);
|
|
6089
6161
|
}
|
|
6090
6162
|
function placeholderIndex(item, preset) {
|
|
6091
6163
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -6093,20 +6165,20 @@ function placeholderIndex(item, preset) {
|
|
|
6093
6165
|
for (const ph of item.placeholders ?? []) map.set(ph.key, ph);
|
|
6094
6166
|
return map;
|
|
6095
6167
|
}
|
|
6096
|
-
function substituteNode(node,
|
|
6097
|
-
if (typeof node === "string") return substituteString(node,
|
|
6098
|
-
if (Array.isArray(node)) return node.map((el) => substituteNode(el,
|
|
6168
|
+
function substituteNode(node, resolve5, envVarsToSet) {
|
|
6169
|
+
if (typeof node === "string") return substituteString(node, resolve5, envVarsToSet);
|
|
6170
|
+
if (Array.isArray(node)) return node.map((el) => substituteNode(el, resolve5, envVarsToSet));
|
|
6099
6171
|
if (node && typeof node === "object") {
|
|
6100
6172
|
const out = {};
|
|
6101
|
-
for (const [k, v] of Object.entries(node)) out[k] = substituteNode(v,
|
|
6173
|
+
for (const [k, v] of Object.entries(node)) out[k] = substituteNode(v, resolve5, envVarsToSet);
|
|
6102
6174
|
return out;
|
|
6103
6175
|
}
|
|
6104
6176
|
return node;
|
|
6105
6177
|
}
|
|
6106
|
-
function substituteString(value,
|
|
6178
|
+
function substituteString(value, resolve5, envVarsToSet) {
|
|
6107
6179
|
const tokens = [...value.matchAll(TOKEN_RE)];
|
|
6108
6180
|
if (tokens.length === 0) return value;
|
|
6109
|
-
const secret = tokens.find(([, ns]) => ns === "SECRET") ?? tokens.find(([, , key]) => "envRef" in
|
|
6181
|
+
const secret = tokens.find(([, ns]) => ns === "SECRET") ?? tokens.find(([, , key]) => "envRef" in resolve5(key));
|
|
6110
6182
|
if (secret) {
|
|
6111
6183
|
const [full, , key] = secret;
|
|
6112
6184
|
if (tokens.length > 1 || full !== value) {
|
|
@@ -6118,7 +6190,7 @@ function substituteString(value, resolve4, envVarsToSet) {
|
|
|
6118
6190
|
return `env:${key}`;
|
|
6119
6191
|
}
|
|
6120
6192
|
return value.replace(TOKEN_RE, (_m, _ns, key) => {
|
|
6121
|
-
const resolved =
|
|
6193
|
+
const resolved = resolve5(key);
|
|
6122
6194
|
return "envRef" in resolved ? resolved.envRef : resolved.value;
|
|
6123
6195
|
});
|
|
6124
6196
|
}
|
|
@@ -6175,7 +6247,7 @@ function neededSources(config, lock) {
|
|
|
6175
6247
|
}
|
|
6176
6248
|
function sourcesWithSidecar(sources) {
|
|
6177
6249
|
const dir = getStoreManifestsDir();
|
|
6178
|
-
return sources.filter((s) => existsSync(
|
|
6250
|
+
return sources.filter((s) => existsSync(path35.join(dir, `${storeManifestSlug(s.url)}.yaml`))).map((s) => s.url);
|
|
6179
6251
|
}
|
|
6180
6252
|
function compact(obj) {
|
|
6181
6253
|
const out = {};
|
|
@@ -6267,8 +6339,8 @@ function redactSecrets(preset, findings) {
|
|
|
6267
6339
|
}
|
|
6268
6340
|
return { preset: next, keys };
|
|
6269
6341
|
}
|
|
6270
|
-
function placeholderKey(itemId,
|
|
6271
|
-
return `${itemId}_${
|
|
6342
|
+
function placeholderKey(itemId, path38) {
|
|
6343
|
+
return `${itemId}_${path38}`.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
|
|
6272
6344
|
}
|
|
6273
6345
|
function setAtPath(root, segments, value) {
|
|
6274
6346
|
let node = root;
|
|
@@ -6291,7 +6363,7 @@ function makePresetCommand() {
|
|
|
6291
6363
|
cmd.command("init [name]").description("Scaffold a new .preset.yaml file").option("--dir <path>", "Output directory", process.cwd()).action(async (name, opts) => {
|
|
6292
6364
|
const presetName = name ?? "my-preset";
|
|
6293
6365
|
const filename = `${presetName}.preset.yaml`;
|
|
6294
|
-
const outPath =
|
|
6366
|
+
const outPath = path35__default.join(path35__default.resolve(opts.dir), filename);
|
|
6295
6367
|
if (existsSync(outPath)) {
|
|
6296
6368
|
logErr(`File already exists: ${outPath}`);
|
|
6297
6369
|
logInfo("Choose a different name or remove the existing file.");
|
|
@@ -6324,7 +6396,7 @@ function makePresetCommand() {
|
|
|
6324
6396
|
return cmd;
|
|
6325
6397
|
}
|
|
6326
6398
|
async function runPresetExport(name, opts) {
|
|
6327
|
-
const projectDir =
|
|
6399
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6328
6400
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
6329
6401
|
if (!file) {
|
|
6330
6402
|
logErr(`No skaile.yaml found in ${projectDir}`);
|
|
@@ -6334,7 +6406,7 @@ async function runPresetExport(name, opts) {
|
|
|
6334
6406
|
const presetName = name ?? file.config.name ?? "my-preset";
|
|
6335
6407
|
let lock = null;
|
|
6336
6408
|
try {
|
|
6337
|
-
lock = readLock(
|
|
6409
|
+
lock = readLock(path35__default.join(projectDir, "skaile.lock.yaml"));
|
|
6338
6410
|
} catch {
|
|
6339
6411
|
lock = null;
|
|
6340
6412
|
}
|
|
@@ -6375,7 +6447,7 @@ async function runPresetExport(name, opts) {
|
|
|
6375
6447
|
const contents = header ? `${header}
|
|
6376
6448
|
${body}` : body;
|
|
6377
6449
|
if (opts.out && opts.dir !== process.cwd()) logWarn("--dir is ignored when --out is set.");
|
|
6378
|
-
const outPath = opts.out ?
|
|
6450
|
+
const outPath = opts.out ? path35__default.resolve(opts.out) : path35__default.join(path35__default.resolve(opts.dir), `${presetName}.preset.yaml`);
|
|
6379
6451
|
if (existsSync(outPath) && !opts.force) {
|
|
6380
6452
|
logErr(`File already exists: ${outPath}`);
|
|
6381
6453
|
logInfo("Pass --force to overwrite, or choose a different --out/--dir.");
|
|
@@ -6387,7 +6459,7 @@ ${body}` : body;
|
|
|
6387
6459
|
logErr(`Failed to write ${outPath}: ${e.message}`);
|
|
6388
6460
|
process.exit(1);
|
|
6389
6461
|
}
|
|
6390
|
-
logOk(`Exported ${S.brand(
|
|
6462
|
+
logOk(`Exported ${S.brand(path35__default.basename(outPath))}`);
|
|
6391
6463
|
logInfo(`Path: ${outPath}`);
|
|
6392
6464
|
if (unresolved.length > 0) {
|
|
6393
6465
|
console.error(S.err("This file is NOT safe to share."));
|
|
@@ -6428,13 +6500,13 @@ function collectInput(value, acc) {
|
|
|
6428
6500
|
return acc;
|
|
6429
6501
|
}
|
|
6430
6502
|
async function runPresetApply(filePath, opts) {
|
|
6431
|
-
const projectDir =
|
|
6503
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6432
6504
|
const file = loadSkWorkspaceConfig(projectDir);
|
|
6433
6505
|
if (!file) {
|
|
6434
6506
|
logErr("No skaile.yaml \u2014 run `skaile init` first");
|
|
6435
6507
|
process.exit(1);
|
|
6436
6508
|
}
|
|
6437
|
-
const resolved =
|
|
6509
|
+
const resolved = path35__default.resolve(filePath);
|
|
6438
6510
|
if (!existsSync(resolved)) {
|
|
6439
6511
|
logErr(`File not found: ${resolved}`);
|
|
6440
6512
|
process.exit(1);
|
|
@@ -6650,7 +6722,7 @@ async function reportNestedPresetRefs(preset) {
|
|
|
6650
6722
|
}
|
|
6651
6723
|
async function checkPresetCycles(preset, resolved) {
|
|
6652
6724
|
const { detectCycles } = await import('../discovery/index.js');
|
|
6653
|
-
const presetRef =
|
|
6725
|
+
const presetRef = path35__default.basename(resolved, ".preset.yaml");
|
|
6654
6726
|
const edges = [];
|
|
6655
6727
|
for (const item of preset.items) {
|
|
6656
6728
|
if (item.ref) {
|
|
@@ -6702,7 +6774,7 @@ function printPresetSummary(preset, placeholderCount, hasWarnings) {
|
|
|
6702
6774
|
}
|
|
6703
6775
|
}
|
|
6704
6776
|
async function runPresetValidate(filePath) {
|
|
6705
|
-
const resolved =
|
|
6777
|
+
const resolved = path35__default.resolve(filePath);
|
|
6706
6778
|
const preset = await loadPresetForValidation(resolved);
|
|
6707
6779
|
await reportNestedPresetRefs(preset);
|
|
6708
6780
|
await checkPresetCycles(preset, resolved);
|
|
@@ -6752,11 +6824,11 @@ items:
|
|
|
6752
6824
|
}
|
|
6753
6825
|
function makeRebuildCommand() {
|
|
6754
6826
|
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 =
|
|
6827
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6756
6828
|
let agentDir;
|
|
6757
6829
|
if (agentArg) {
|
|
6758
6830
|
if (agentArg.includes("/") || agentArg.includes("\\")) {
|
|
6759
|
-
agentDir =
|
|
6831
|
+
agentDir = path35__default.resolve(projectDir, agentArg);
|
|
6760
6832
|
} else {
|
|
6761
6833
|
let resolved;
|
|
6762
6834
|
try {
|
|
@@ -6765,7 +6837,7 @@ function makeRebuildCommand() {
|
|
|
6765
6837
|
if (!(err instanceof AgentRefResolutionError)) throw err;
|
|
6766
6838
|
logWarn(`${err.message} \u2014 using "${agentArg}"`);
|
|
6767
6839
|
}
|
|
6768
|
-
agentDir = resolved ??
|
|
6840
|
+
agentDir = resolved ?? path35__default.resolve(projectDir, agentArg);
|
|
6769
6841
|
}
|
|
6770
6842
|
} else {
|
|
6771
6843
|
let resolved;
|
|
@@ -6866,7 +6938,7 @@ function makeFlowEventHandler() {
|
|
|
6866
6938
|
}
|
|
6867
6939
|
function makeRunCommand() {
|
|
6868
6940
|
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 =
|
|
6941
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6870
6942
|
const cliDriver = opts.driver;
|
|
6871
6943
|
const dryRun = opts.dryRun ?? false;
|
|
6872
6944
|
let flowId = positional[0];
|
|
@@ -6894,7 +6966,7 @@ function makeRunCommand() {
|
|
|
6894
6966
|
driver: cliDriver,
|
|
6895
6967
|
model: opts.model
|
|
6896
6968
|
});
|
|
6897
|
-
const driver = config.driver ??
|
|
6969
|
+
const driver = config.driver ?? DEFAULT_DRIVER_ID;
|
|
6898
6970
|
const model = config.model;
|
|
6899
6971
|
const flowPath = await findFlowFileWithLibraries(
|
|
6900
6972
|
flowId,
|
|
@@ -6967,7 +7039,7 @@ function makeRunCommand() {
|
|
|
6967
7039
|
}
|
|
6968
7040
|
function makeResumeCommand() {
|
|
6969
7041
|
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 =
|
|
7042
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6971
7043
|
const sessionId = opts.session;
|
|
6972
7044
|
const dryRun = opts.dryRun ?? false;
|
|
6973
7045
|
const session = sessionId ? await loadSessionById(projectDir, sessionId) : await loadSession(projectDir);
|
|
@@ -6994,7 +7066,7 @@ function makeResumeCommand() {
|
|
|
6994
7066
|
}
|
|
6995
7067
|
function makeStatusCommand() {
|
|
6996
7068
|
return new Command("status").description("Show current session state").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
6997
|
-
const projectDir =
|
|
7069
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
6998
7070
|
const session = await loadSession(projectDir);
|
|
6999
7071
|
if (!session) {
|
|
7000
7072
|
logInfo("No active session.");
|
|
@@ -7019,7 +7091,7 @@ function makeStatusCommand() {
|
|
|
7019
7091
|
}
|
|
7020
7092
|
function makeClearCommand() {
|
|
7021
7093
|
return new Command("clear").description("Unset current session pointer").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7022
|
-
const projectDir =
|
|
7094
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
7023
7095
|
await clearSession(projectDir);
|
|
7024
7096
|
logOk("Session cleared.");
|
|
7025
7097
|
});
|
|
@@ -7028,8 +7100,8 @@ function makeReplCommand() {
|
|
|
7028
7100
|
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
7101
|
const { findWorkspaceRoot } = await import('../core/index.js');
|
|
7030
7102
|
const { startRepl } = await import('../tui/index.js');
|
|
7031
|
-
const
|
|
7032
|
-
const userCwd =
|
|
7103
|
+
const os2 = await import('os');
|
|
7104
|
+
const userCwd = path35__default.resolve(opts.projectDir ?? process.cwd());
|
|
7033
7105
|
const workspaceRoot = findWorkspaceRoot(userCwd);
|
|
7034
7106
|
let projectDir;
|
|
7035
7107
|
let agentCwd;
|
|
@@ -7051,13 +7123,13 @@ function makeReplCommand() {
|
|
|
7051
7123
|
p5.cancel("Cancelled.");
|
|
7052
7124
|
process.exit(0);
|
|
7053
7125
|
}
|
|
7054
|
-
const tmpDir =
|
|
7126
|
+
const tmpDir = fs11__default.mkdtempSync(path35__default.join(os2.tmpdir(), "skaile-repl-"));
|
|
7055
7127
|
projectDir = tmpDir;
|
|
7056
7128
|
agentCwd = userCwd;
|
|
7057
7129
|
logOk(`Temporary workspace: ${S.cmd(tmpDir)}`);
|
|
7058
7130
|
if (!driverOverride) {
|
|
7059
|
-
const claudeDir =
|
|
7060
|
-
if (
|
|
7131
|
+
const claudeDir = path35__default.join(os2.homedir(), ".claude");
|
|
7132
|
+
if (fs11__default.existsSync(claudeDir)) {
|
|
7061
7133
|
driverOverride = "claude-sdk";
|
|
7062
7134
|
logInfo(`Detected ${S.cmd("~/.claude")} \u2192 using ${S.cmd("claude-sdk")} harness`);
|
|
7063
7135
|
} else {
|
|
@@ -7129,12 +7201,12 @@ function makeServeCommand() {
|
|
|
7129
7201
|
);
|
|
7130
7202
|
}
|
|
7131
7203
|
async function ensurePluginsLoadedForServe(projectDir) {
|
|
7132
|
-
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-
|
|
7204
|
+
const { logInfo: logInfo2, logWarn: logWarn2 } = await import('../helpers-ZGK4R5MZ.js');
|
|
7133
7205
|
try {
|
|
7134
7206
|
const { resolveSkWorkspaceConfig: resolveSkWorkspaceConfig2 } = await import('../core/index.js');
|
|
7135
7207
|
const config = resolveSkWorkspaceConfig2(projectDir);
|
|
7136
7208
|
if (!config.plugins || config.plugins.length === 0) return;
|
|
7137
|
-
const { ensurePluginsLoaded } = await import('../plugin-store-
|
|
7209
|
+
const { ensurePluginsLoaded } = await import('../plugin-store-QENDYZ63.js');
|
|
7138
7210
|
const { pluginRegistry } = await import('../plugin-registry/index.js');
|
|
7139
7211
|
const result = await ensurePluginsLoaded(projectDir, config.plugins, pluginRegistry);
|
|
7140
7212
|
if (result.loaded.length > 0) {
|
|
@@ -7148,23 +7220,23 @@ async function ensurePluginsLoadedForServe(projectDir) {
|
|
|
7148
7220
|
}
|
|
7149
7221
|
}
|
|
7150
7222
|
async function runCompileTest(opts) {
|
|
7151
|
-
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-
|
|
7223
|
+
const { logOk: logOk2, logErr: logErr2, logInfo: logInfo2, S: S2 } = await import('../helpers-ZGK4R5MZ.js');
|
|
7152
7224
|
const { tmpdir } = await import('os');
|
|
7153
|
-
const { dirname: dirname3, join:
|
|
7225
|
+
const { dirname: dirname3, join: join6, resolve: resolve5 } = await import('path');
|
|
7154
7226
|
const { fileURLToPath: fileURLToPath2 } = await import('url');
|
|
7155
|
-
const { unlinkSync, existsSync:
|
|
7227
|
+
const { unlinkSync, existsSync: existsSync15 } = await import('fs');
|
|
7156
7228
|
const { spawn } = await import('child_process');
|
|
7157
7229
|
const { portableSpawnSync: portableSpawnSync2 } = await import('../core/index.js');
|
|
7158
|
-
const { MONOREPO_ROOT } = await import('../paths-
|
|
7230
|
+
const { MONOREPO_ROOT } = await import('../paths-L5XLUC3D.js');
|
|
7159
7231
|
if (MONOREPO_ROOT === null) {
|
|
7160
7232
|
logErr2("--compile-test is only available inside the skaile-dev workspace.");
|
|
7161
7233
|
logInfo2("Run it from a checkout of skaile-ai/skaile-dev (the monorepo shell).");
|
|
7162
7234
|
process.exitCode = 2;
|
|
7163
7235
|
return;
|
|
7164
7236
|
}
|
|
7165
|
-
const outfile =
|
|
7237
|
+
const outfile = join6(tmpdir(), `skaile-compile-test-${Date.now()}`);
|
|
7166
7238
|
const __thisFile = fileURLToPath2(import.meta.url);
|
|
7167
|
-
const entryPoint =
|
|
7239
|
+
const entryPoint = resolve5(dirname3(__thisFile), "..", "index.ts");
|
|
7168
7240
|
logInfo2(`Building compiled binary...`);
|
|
7169
7241
|
logInfo2(`Entry: ${S2.dim(entryPoint)}`);
|
|
7170
7242
|
logInfo2(`Output: ${S2.dim(outfile)}`);
|
|
@@ -7217,7 +7289,7 @@ async function runCompileTest(opts) {
|
|
|
7217
7289
|
} catch {
|
|
7218
7290
|
}
|
|
7219
7291
|
try {
|
|
7220
|
-
if (
|
|
7292
|
+
if (existsSync15(outfile)) unlinkSync(outfile);
|
|
7221
7293
|
} catch {
|
|
7222
7294
|
}
|
|
7223
7295
|
}
|
|
@@ -7470,19 +7542,19 @@ function buildTailSelect(q) {
|
|
|
7470
7542
|
return { sql, params };
|
|
7471
7543
|
}
|
|
7472
7544
|
function sleepUnlessAborted(ms, signal) {
|
|
7473
|
-
return new Promise((
|
|
7545
|
+
return new Promise((resolve5) => {
|
|
7474
7546
|
if (signal?.aborted) {
|
|
7475
|
-
|
|
7547
|
+
resolve5();
|
|
7476
7548
|
return;
|
|
7477
7549
|
}
|
|
7478
7550
|
const timer = setTimeout(() => {
|
|
7479
7551
|
signal?.removeEventListener("abort", onAbort);
|
|
7480
|
-
|
|
7552
|
+
resolve5();
|
|
7481
7553
|
}, ms);
|
|
7482
7554
|
const onAbort = () => {
|
|
7483
7555
|
clearTimeout(timer);
|
|
7484
7556
|
signal?.removeEventListener("abort", onAbort);
|
|
7485
|
-
|
|
7557
|
+
resolve5();
|
|
7486
7558
|
};
|
|
7487
7559
|
signal?.addEventListener("abort", onAbort, { once: true });
|
|
7488
7560
|
});
|
|
@@ -7569,7 +7641,7 @@ async function remoteTail(opts) {
|
|
|
7569
7641
|
]
|
|
7570
7642
|
});
|
|
7571
7643
|
const filter = makeFilter(opts.query);
|
|
7572
|
-
return new Promise((
|
|
7644
|
+
return new Promise((resolve5, reject) => {
|
|
7573
7645
|
let settled = false;
|
|
7574
7646
|
const finish = (err) => {
|
|
7575
7647
|
if (settled) return;
|
|
@@ -7580,11 +7652,11 @@ async function remoteTail(opts) {
|
|
|
7580
7652
|
}
|
|
7581
7653
|
opts.signal?.removeEventListener("abort", onAbort);
|
|
7582
7654
|
if (err) reject(err);
|
|
7583
|
-
else
|
|
7655
|
+
else resolve5();
|
|
7584
7656
|
};
|
|
7585
7657
|
const onAbort = () => finish();
|
|
7586
7658
|
if (opts.signal?.aborted) {
|
|
7587
|
-
|
|
7659
|
+
resolve5();
|
|
7588
7660
|
return;
|
|
7589
7661
|
}
|
|
7590
7662
|
opts.signal?.addEventListener("abort", onAbort, { once: true });
|
|
@@ -7638,7 +7710,7 @@ function resolveMode(opts) {
|
|
|
7638
7710
|
if (opts.forceLocal && opts.forceRemote) {
|
|
7639
7711
|
throw new Error("Cannot use both --local and --remote");
|
|
7640
7712
|
}
|
|
7641
|
-
const startDir =
|
|
7713
|
+
const startDir = path35__default.resolve(opts.projectDir ?? process.cwd());
|
|
7642
7714
|
const localDb = findLogsDb(startDir);
|
|
7643
7715
|
if (opts.forceLocal) {
|
|
7644
7716
|
if (!localDb) {
|
|
@@ -7671,14 +7743,14 @@ function resolveMode(opts) {
|
|
|
7671
7743
|
function findLogsDb(startDir) {
|
|
7672
7744
|
let dir = startDir;
|
|
7673
7745
|
for (let i = 0; i < MAX_WALK_LEVELS; i++) {
|
|
7674
|
-
const candidate =
|
|
7746
|
+
const candidate = path35__default.join(dir, ".skaile", "logs.db");
|
|
7675
7747
|
if (existsSync(candidate)) {
|
|
7676
7748
|
try {
|
|
7677
7749
|
if (statSync(candidate).isFile()) return candidate;
|
|
7678
7750
|
} catch {
|
|
7679
7751
|
}
|
|
7680
7752
|
}
|
|
7681
|
-
const parent =
|
|
7753
|
+
const parent = path35__default.dirname(dir);
|
|
7682
7754
|
if (parent === dir) return void 0;
|
|
7683
7755
|
dir = parent;
|
|
7684
7756
|
}
|
|
@@ -7853,7 +7925,7 @@ function parsePositiveInt(value, flag) {
|
|
|
7853
7925
|
function makeSessionCommand() {
|
|
7854
7926
|
const cmd = new Command("session").description("Manage sessions");
|
|
7855
7927
|
cmd.command("list").description("List all sessions for a project").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
7856
|
-
const projectDir =
|
|
7928
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
7857
7929
|
const sessions = await listSessions(projectDir);
|
|
7858
7930
|
const current = await loadSession(projectDir);
|
|
7859
7931
|
if (sessions.length === 0) {
|
|
@@ -7881,7 +7953,7 @@ function makeSessionCommand() {
|
|
|
7881
7953
|
console.log();
|
|
7882
7954
|
});
|
|
7883
7955
|
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 =
|
|
7956
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
7885
7957
|
const session = await loadSessionById(projectDir, runId);
|
|
7886
7958
|
if (!session) {
|
|
7887
7959
|
logErr(`Session not found: ${runId}`);
|
|
@@ -7890,12 +7962,12 @@ function makeSessionCommand() {
|
|
|
7890
7962
|
console.log(JSON.stringify(session, null, 2));
|
|
7891
7963
|
});
|
|
7892
7964
|
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 =
|
|
7965
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
7894
7966
|
await setCurrentSession(projectDir, runId);
|
|
7895
7967
|
logOk(`Switched to session: ${S.dim(runId.slice(0, 8))}`);
|
|
7896
7968
|
});
|
|
7897
7969
|
cmd.command("delete <run-id>").description("Delete a session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
7898
|
-
const projectDir =
|
|
7970
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
7899
7971
|
await deleteSession(projectDir, runId);
|
|
7900
7972
|
logOk(`Deleted session: ${S.dim(runId.slice(0, 8))}`);
|
|
7901
7973
|
});
|
|
@@ -7949,12 +8021,12 @@ function showOverview(am2) {
|
|
|
7949
8021
|
}
|
|
7950
8022
|
async function showAsset(am2, kind, name) {
|
|
7951
8023
|
const entry = await am2.info(`${kind}:${name}`);
|
|
7952
|
-
if (entry?.source &&
|
|
8024
|
+
if (entry?.source && fs11__default.existsSync(entry.source)) {
|
|
7953
8025
|
console.log();
|
|
7954
8026
|
console.log(` ${kindColor(entry.kind)} ${S.heading(entry.name)}`);
|
|
7955
8027
|
console.log(` ${S.rule(40)}`);
|
|
7956
8028
|
console.log();
|
|
7957
|
-
console.log(
|
|
8029
|
+
console.log(fs11__default.readFileSync(entry.source, "utf-8"));
|
|
7958
8030
|
return;
|
|
7959
8031
|
}
|
|
7960
8032
|
logErr(`Asset not found: ${kind}:${name}`);
|
|
@@ -7963,7 +8035,7 @@ async function showAsset(am2, kind, name) {
|
|
|
7963
8035
|
function makeShowCommand() {
|
|
7964
8036
|
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
8037
|
const am2 = new AssetManager({
|
|
7966
|
-
projectDir:
|
|
8038
|
+
projectDir: path35__default.resolve(opts.projectDir),
|
|
7967
8039
|
driverTarget: opts.target
|
|
7968
8040
|
});
|
|
7969
8041
|
if (!kind) {
|
|
@@ -8031,9 +8103,9 @@ function makeStoreCommand() {
|
|
|
8031
8103
|
process.exit(2);
|
|
8032
8104
|
});
|
|
8033
8105
|
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-
|
|
8106
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-4IJTBVTR.js');
|
|
8035
8107
|
try {
|
|
8036
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
8108
|
+
const remote = await openCatalogSource2({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
8037
8109
|
const assets = await remote.listAssets(opts.kind ? { kind: opts.kind } : {});
|
|
8038
8110
|
const results = filterCatalogAssets(assets, query);
|
|
8039
8111
|
if (results.length === 0) {
|
|
@@ -8059,10 +8131,10 @@ function makeStoreCommand() {
|
|
|
8059
8131
|
}
|
|
8060
8132
|
});
|
|
8061
8133
|
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-
|
|
8134
|
+
const { openCatalogSource: openCatalogSource2, LocalCatalogDisabledError } = await import('../open-library-4IJTBVTR.js');
|
|
8135
|
+
const { supportsInstallManifest } = await import('../project-4INCIIZI.js');
|
|
8064
8136
|
try {
|
|
8065
|
-
const remote = await openCatalogSource2({ projectDir:
|
|
8137
|
+
const remote = await openCatalogSource2({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
8066
8138
|
const asset = await remote.resolve(ref);
|
|
8067
8139
|
if (!asset) {
|
|
8068
8140
|
logErr(`Not found in store: ${ref} (try a full ref, e.g. skill:@publisher/name#version)`);
|
|
@@ -8184,7 +8256,7 @@ function printTree(node, prefix = "", isLast = true) {
|
|
|
8184
8256
|
}
|
|
8185
8257
|
function makeTreeCommand() {
|
|
8186
8258
|
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:
|
|
8259
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
8188
8260
|
const root = am2.tree();
|
|
8189
8261
|
if (root.children.length === 0) {
|
|
8190
8262
|
logInfo("No dependencies in lock file. Run `skaile install` first.");
|
|
@@ -8210,7 +8282,7 @@ function makeUpdateCommand() {
|
|
|
8210
8282
|
const catalogSpinner = p5.spinner();
|
|
8211
8283
|
catalogSpinner.start("Refreshing catalog cache");
|
|
8212
8284
|
try {
|
|
8213
|
-
const remote = await openCatalogSource({ projectDir:
|
|
8285
|
+
const remote = await openCatalogSource({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
8214
8286
|
const result2 = await remote.refresh();
|
|
8215
8287
|
catalogSpinner.stop(
|
|
8216
8288
|
`Catalog refreshed: ${S.heading(String(result2.assetsCached))} assets cached`
|
|
@@ -8223,7 +8295,7 @@ function makeUpdateCommand() {
|
|
|
8223
8295
|
}
|
|
8224
8296
|
}
|
|
8225
8297
|
if (opts.catalogOnly) return;
|
|
8226
|
-
const projectDir =
|
|
8298
|
+
const projectDir = path35__default.resolve(opts.projectDir);
|
|
8227
8299
|
if (await shouldSyncSources(opts)) {
|
|
8228
8300
|
const syncSpinner = p5.spinner();
|
|
8229
8301
|
syncSpinner.start("Syncing sources");
|
|
@@ -8279,12 +8351,12 @@ function findManifestCandidates(rootPath) {
|
|
|
8279
8351
|
function walk(dir) {
|
|
8280
8352
|
let entries;
|
|
8281
8353
|
try {
|
|
8282
|
-
entries =
|
|
8354
|
+
entries = fs11__default.readdirSync(dir, { withFileTypes: true });
|
|
8283
8355
|
} catch {
|
|
8284
8356
|
return;
|
|
8285
8357
|
}
|
|
8286
8358
|
for (const entry of entries) {
|
|
8287
|
-
const fullPath =
|
|
8359
|
+
const fullPath = path35__default.join(dir, entry.name);
|
|
8288
8360
|
if (entry.isDirectory()) {
|
|
8289
8361
|
if (!SKIP_DIRS.has(entry.name)) walk(fullPath);
|
|
8290
8362
|
} else if (entry.isFile()) {
|
|
@@ -8325,7 +8397,7 @@ function checkManifestIdentity(kind, parsed) {
|
|
|
8325
8397
|
return null;
|
|
8326
8398
|
}
|
|
8327
8399
|
function parseManifestCandidate(c, absRoot) {
|
|
8328
|
-
const content =
|
|
8400
|
+
const content = fs11__default.readFileSync(c.filePath, "utf-8");
|
|
8329
8401
|
if (c.filePath.endsWith(".md")) {
|
|
8330
8402
|
const md = parseMdFrontmatter(content);
|
|
8331
8403
|
if (md === null) {
|
|
@@ -8337,13 +8409,13 @@ function parseManifestCandidate(c, absRoot) {
|
|
|
8337
8409
|
const parsed = c.filePath.endsWith(".json") ? JSON.parse(content) : parse(content);
|
|
8338
8410
|
return { kind: "value", parsed };
|
|
8339
8411
|
} catch (e) {
|
|
8340
|
-
const relPath =
|
|
8412
|
+
const relPath = path35__default.relative(absRoot, c.filePath);
|
|
8341
8413
|
logErr(`${relPath} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
|
|
8342
8414
|
return { kind: "error" };
|
|
8343
8415
|
}
|
|
8344
8416
|
}
|
|
8345
8417
|
function validateManifestCandidate(c, parsed, body, absRoot, registry, strictConformance) {
|
|
8346
|
-
const relPath =
|
|
8418
|
+
const relPath = path35__default.relative(absRoot, c.filePath);
|
|
8347
8419
|
let errors = 0;
|
|
8348
8420
|
let warnings = 0;
|
|
8349
8421
|
const identityError = checkManifestIdentity(c.kind, parsed);
|
|
@@ -8352,7 +8424,7 @@ function validateManifestCandidate(c, parsed, body, absRoot, registry, strictCon
|
|
|
8352
8424
|
errors++;
|
|
8353
8425
|
}
|
|
8354
8426
|
if (c.kind === "skill" && parsed && typeof parsed === "object") {
|
|
8355
|
-
const dirName =
|
|
8427
|
+
const dirName = path35__default.basename(path35__default.dirname(c.filePath));
|
|
8356
8428
|
const findings = checkAgentSkillConformance(parsed, { dirName });
|
|
8357
8429
|
for (const f of findings) {
|
|
8358
8430
|
const line = `${relPath} [skill conformance] \u2014 ${f.field}: ${f.message}`;
|
|
@@ -8384,8 +8456,8 @@ function validateManifestCandidate(c, parsed, body, absRoot, registry, strictCon
|
|
|
8384
8456
|
return { errors, warnings };
|
|
8385
8457
|
}
|
|
8386
8458
|
function validateManifests(rootPath, strictConformance) {
|
|
8387
|
-
const absRoot =
|
|
8388
|
-
if (!
|
|
8459
|
+
const absRoot = path35__default.resolve(rootPath);
|
|
8460
|
+
if (!fs11__default.existsSync(absRoot)) {
|
|
8389
8461
|
logErr(`Path does not exist: ${absRoot}`);
|
|
8390
8462
|
return { total: 0, errors: 1, warnings: 0 };
|
|
8391
8463
|
}
|
|
@@ -8418,12 +8490,12 @@ function findWorkspaceManifests(rootPath) {
|
|
|
8418
8490
|
function walk(dir) {
|
|
8419
8491
|
let entries;
|
|
8420
8492
|
try {
|
|
8421
|
-
entries =
|
|
8493
|
+
entries = fs11__default.readdirSync(dir, { withFileTypes: true });
|
|
8422
8494
|
} catch {
|
|
8423
8495
|
return;
|
|
8424
8496
|
}
|
|
8425
8497
|
for (const entry of entries) {
|
|
8426
|
-
const full =
|
|
8498
|
+
const full = path35__default.join(dir, entry.name);
|
|
8427
8499
|
if (entry.isDirectory()) {
|
|
8428
8500
|
if (!SKIP_DIRS.has(entry.name)) walk(full);
|
|
8429
8501
|
} else if (entry.isFile() && /(^|\.)skaile\.yaml$/.test(entry.name)) {
|
|
@@ -8486,14 +8558,14 @@ function validateWorkspaceAssets(parsed, relPath) {
|
|
|
8486
8558
|
return errors;
|
|
8487
8559
|
}
|
|
8488
8560
|
function validateWorkspaceManifests(rootPath) {
|
|
8489
|
-
const absRoot =
|
|
8561
|
+
const absRoot = path35__default.resolve(rootPath);
|
|
8490
8562
|
const files = findWorkspaceManifests(absRoot);
|
|
8491
8563
|
let errors = 0;
|
|
8492
8564
|
for (const file of files) {
|
|
8493
|
-
const relPath =
|
|
8565
|
+
const relPath = path35__default.relative(absRoot, file);
|
|
8494
8566
|
let parsed;
|
|
8495
8567
|
try {
|
|
8496
|
-
parsed = parse(
|
|
8568
|
+
parsed = parse(fs11__default.readFileSync(file, "utf-8")) ?? {};
|
|
8497
8569
|
} catch (e) {
|
|
8498
8570
|
logErr(`${relPath} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
|
|
8499
8571
|
errors++;
|
|
@@ -8505,7 +8577,7 @@ function validateWorkspaceManifests(rootPath) {
|
|
|
8505
8577
|
return { total: files.length, errors };
|
|
8506
8578
|
}
|
|
8507
8579
|
function validatePublishManifestRoots(rootPath) {
|
|
8508
|
-
const absRoot =
|
|
8580
|
+
const absRoot = path35__default.resolve(rootPath);
|
|
8509
8581
|
const manifest = loadSkPublishManifest(absRoot);
|
|
8510
8582
|
if (!manifest) return 0;
|
|
8511
8583
|
const missing = missingRootAssets(absRoot, manifest);
|
|
@@ -8518,7 +8590,7 @@ function validatePublishManifestRoots(rootPath) {
|
|
|
8518
8590
|
}
|
|
8519
8591
|
var EXCLUDED_PATHS = ["skaileup-shared/", "external/", "docs/"];
|
|
8520
8592
|
function toPosix(p7) {
|
|
8521
|
-
return p7.split(
|
|
8593
|
+
return p7.split(path35__default.sep).join("/");
|
|
8522
8594
|
}
|
|
8523
8595
|
function isExcludedPath(relPath) {
|
|
8524
8596
|
const rel = toPosix(relPath);
|
|
@@ -8526,9 +8598,9 @@ function isExcludedPath(relPath) {
|
|
|
8526
8598
|
}
|
|
8527
8599
|
function collectAssetVersions() {
|
|
8528
8600
|
const assets = [];
|
|
8529
|
-
if (!
|
|
8601
|
+
if (!fs11__default.existsSync(AI_RESOURCES)) return assets;
|
|
8530
8602
|
const kindDirs = (kindDirName) => findKindDirs(AI_RESOURCES, kindDirName).filter(
|
|
8531
|
-
(dir) => !isExcludedPath(
|
|
8603
|
+
(dir) => !isExcludedPath(path35__default.relative(AI_RESOURCES, dir))
|
|
8532
8604
|
);
|
|
8533
8605
|
for (const dir of kindDirs("skills")) collectSkillVersions(dir, assets);
|
|
8534
8606
|
for (const dir of kindDirs("agents")) collectAgentVersions(dir, assets);
|
|
@@ -8538,10 +8610,10 @@ function collectAssetVersions() {
|
|
|
8538
8610
|
return assets.filter((a) => !seen.has(a.filePath) && seen.add(a.filePath));
|
|
8539
8611
|
}
|
|
8540
8612
|
function collectFlowVersions(dir, out) {
|
|
8541
|
-
for (const f of
|
|
8613
|
+
for (const f of fs11__default.readdirSync(dir)) {
|
|
8542
8614
|
if (!f.endsWith(".flow.yaml")) continue;
|
|
8543
|
-
const fp =
|
|
8544
|
-
const content =
|
|
8615
|
+
const fp = path35__default.join(dir, f);
|
|
8616
|
+
const content = fs11__default.readFileSync(fp, "utf-8");
|
|
8545
8617
|
const parsed = parse(content);
|
|
8546
8618
|
out.push({
|
|
8547
8619
|
kind: "flow",
|
|
@@ -8552,10 +8624,10 @@ function collectFlowVersions(dir, out) {
|
|
|
8552
8624
|
}
|
|
8553
8625
|
}
|
|
8554
8626
|
function collectPromptVersions(dir, out) {
|
|
8555
|
-
for (const f of
|
|
8627
|
+
for (const f of fs11__default.readdirSync(dir)) {
|
|
8556
8628
|
if (!f.endsWith(".prompt.md")) continue;
|
|
8557
|
-
const fp =
|
|
8558
|
-
const content =
|
|
8629
|
+
const fp = path35__default.join(dir, f);
|
|
8630
|
+
const content = fs11__default.readFileSync(fp, "utf-8");
|
|
8559
8631
|
const fm = parseSkillFrontmatter(content);
|
|
8560
8632
|
out.push({
|
|
8561
8633
|
kind: "prompt",
|
|
@@ -8566,12 +8638,12 @@ function collectPromptVersions(dir, out) {
|
|
|
8566
8638
|
}
|
|
8567
8639
|
}
|
|
8568
8640
|
function collectSkillVersions(dir, out) {
|
|
8569
|
-
for (const entry of
|
|
8641
|
+
for (const entry of fs11__default.readdirSync(dir, { withFileTypes: true })) {
|
|
8570
8642
|
if (!entry.isDirectory()) continue;
|
|
8571
|
-
const full =
|
|
8572
|
-
const skillMd =
|
|
8573
|
-
if (
|
|
8574
|
-
const content =
|
|
8643
|
+
const full = path35__default.join(dir, entry.name);
|
|
8644
|
+
const skillMd = path35__default.join(full, "SKILL.md");
|
|
8645
|
+
if (fs11__default.existsSync(skillMd)) {
|
|
8646
|
+
const content = fs11__default.readFileSync(skillMd, "utf-8");
|
|
8575
8647
|
const fm = parseSkillFrontmatter(content);
|
|
8576
8648
|
out.push({
|
|
8577
8649
|
kind: "skill",
|
|
@@ -8585,11 +8657,11 @@ function collectSkillVersions(dir, out) {
|
|
|
8585
8657
|
}
|
|
8586
8658
|
}
|
|
8587
8659
|
function collectAgentVersions(dir, out) {
|
|
8588
|
-
for (const entry of
|
|
8660
|
+
for (const entry of fs11__default.readdirSync(dir, { withFileTypes: true })) {
|
|
8589
8661
|
if (!entry.isDirectory()) continue;
|
|
8590
|
-
const agentYaml =
|
|
8591
|
-
if (!
|
|
8592
|
-
const content =
|
|
8662
|
+
const agentYaml = path35__default.join(dir, entry.name, "agent.yaml");
|
|
8663
|
+
if (!fs11__default.existsSync(agentYaml)) continue;
|
|
8664
|
+
const content = fs11__default.readFileSync(agentYaml, "utf-8");
|
|
8593
8665
|
const parsed = parse(content);
|
|
8594
8666
|
out.push({
|
|
8595
8667
|
kind: "agent",
|
|
@@ -8600,15 +8672,15 @@ function collectAgentVersions(dir, out) {
|
|
|
8600
8672
|
}
|
|
8601
8673
|
}
|
|
8602
8674
|
function assetLocation(a) {
|
|
8603
|
-
return toPosix(
|
|
8675
|
+
return toPosix(path35__default.relative(AI_RESOURCES, a.filePath));
|
|
8604
8676
|
}
|
|
8605
8677
|
function findChangelogUnit(assetRelPath, root) {
|
|
8606
|
-
let dir =
|
|
8678
|
+
let dir = path35__default.posix.dirname(toPosix(assetRelPath));
|
|
8607
8679
|
for (; ; ) {
|
|
8608
8680
|
const candidate = dir === "." ? "CHANGELOG.md" : `${dir}/CHANGELOG.md`;
|
|
8609
|
-
if (
|
|
8681
|
+
if (fs11__default.existsSync(path35__default.join(root, candidate))) return candidate;
|
|
8610
8682
|
if (dir === ".") return null;
|
|
8611
|
-
dir =
|
|
8683
|
+
dir = path35__default.posix.dirname(dir);
|
|
8612
8684
|
}
|
|
8613
8685
|
}
|
|
8614
8686
|
function checkChangelogUnits(modifiedFiles, root) {
|
|
@@ -8646,7 +8718,7 @@ function filterToChangedAssets(assets) {
|
|
|
8646
8718
|
encoding: "utf-8"
|
|
8647
8719
|
});
|
|
8648
8720
|
const changedFiles = new Set(
|
|
8649
|
-
diffOutput.trim().split("\n").filter(Boolean).map((f) =>
|
|
8721
|
+
diffOutput.trim().split("\n").filter(Boolean).map((f) => path35__default.resolve(AI_RESOURCES, f))
|
|
8650
8722
|
);
|
|
8651
8723
|
return assets.filter((a) => changedFiles.has(a.filePath));
|
|
8652
8724
|
} catch {
|
|
@@ -8674,7 +8746,7 @@ function checkVersionBumps(assets) {
|
|
|
8674
8746
|
let warnings = 0;
|
|
8675
8747
|
for (const a of assets) {
|
|
8676
8748
|
if (!a.version) continue;
|
|
8677
|
-
const relPath =
|
|
8749
|
+
const relPath = path35__default.relative(AI_RESOURCES, a.filePath);
|
|
8678
8750
|
try {
|
|
8679
8751
|
const headContent = execSync(`git show HEAD:${relPath}`, {
|
|
8680
8752
|
cwd: AI_RESOURCES,
|
|
@@ -8706,7 +8778,7 @@ function checkFlowVersionPins(assets) {
|
|
|
8706
8778
|
pins = flowSkillVersionPins(loadFlow(f.filePath));
|
|
8707
8779
|
} catch (err) {
|
|
8708
8780
|
logWarn(
|
|
8709
|
-
`flow:${f.name} (${
|
|
8781
|
+
`flow:${f.name} (${path35__default.relative(AI_RESOURCES, f.filePath)}) \u2014 could not be read: ${err instanceof Error ? err.message : err}`
|
|
8710
8782
|
);
|
|
8711
8783
|
warnings++;
|
|
8712
8784
|
continue;
|
|
@@ -8756,7 +8828,7 @@ function makeValidateCommand() {
|
|
|
8756
8828
|
"--strict-conformance",
|
|
8757
8829
|
"Treat Agent Skills (agentskills.io) standard findings as errors"
|
|
8758
8830
|
).action((targetPath, opts) => {
|
|
8759
|
-
const absPath =
|
|
8831
|
+
const absPath = path35__default.resolve(targetPath);
|
|
8760
8832
|
logInfo(`Validating manifests in ${absPath}`);
|
|
8761
8833
|
const { total, errors, warnings } = validateManifests(
|
|
8762
8834
|
absPath,
|
|
@@ -8898,7 +8970,7 @@ function whyEmptyMessage(ref, declared) {
|
|
|
8898
8970
|
}
|
|
8899
8971
|
function makeWhyCommand() {
|
|
8900
8972
|
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:
|
|
8973
|
+
const am2 = new AssetManager({ projectDir: path35__default.resolve(opts.projectDir) });
|
|
8902
8974
|
const chain = am2.why(ref);
|
|
8903
8975
|
if (chain.length === 0) {
|
|
8904
8976
|
let declared;
|
|
@@ -8932,7 +9004,7 @@ function makeWhyCommand() {
|
|
|
8932
9004
|
var _defaultFormatHelp = Help.prototype.formatHelp;
|
|
8933
9005
|
var pkg = JSON.parse(
|
|
8934
9006
|
readFileSync(
|
|
8935
|
-
|
|
9007
|
+
path35__default.resolve(path35__default.dirname(fileURLToPath(import.meta.url)), "../../package.json"),
|
|
8936
9008
|
"utf-8"
|
|
8937
9009
|
)
|
|
8938
9010
|
);
|
|
@@ -9063,32 +9135,32 @@ async function runInit(projectDir, opts) {
|
|
|
9063
9135
|
process.exitCode = 1;
|
|
9064
9136
|
return;
|
|
9065
9137
|
}
|
|
9066
|
-
const resolved =
|
|
9067
|
-
const projectName =
|
|
9138
|
+
const resolved = path35__default.resolve(projectDir ?? ".");
|
|
9139
|
+
const projectName = path35__default.basename(resolved);
|
|
9068
9140
|
const created = [];
|
|
9069
|
-
const { existsSync:
|
|
9070
|
-
if (!
|
|
9141
|
+
const { existsSync: existsSync15 } = await import('fs');
|
|
9142
|
+
if (!existsSync15(resolved)) {
|
|
9071
9143
|
mkdirSync4(resolved, { recursive: true });
|
|
9072
9144
|
created.push(".");
|
|
9073
9145
|
}
|
|
9074
|
-
const skaileDir =
|
|
9075
|
-
if (!
|
|
9076
|
-
mkdirSync4(
|
|
9146
|
+
const skaileDir = path35__default.join(resolved, ".skaile");
|
|
9147
|
+
if (!existsSync15(skaileDir)) {
|
|
9148
|
+
mkdirSync4(path35__default.join(skaileDir, "sessions"), { recursive: true });
|
|
9077
9149
|
created.push(".skaile/");
|
|
9078
9150
|
}
|
|
9079
|
-
const settingsPath =
|
|
9080
|
-
if (!
|
|
9151
|
+
const settingsPath = path35__default.join(skaileDir, "settings.json");
|
|
9152
|
+
if (!existsSync15(settingsPath)) {
|
|
9081
9153
|
writeFileSync5(settingsPath, "{}\n");
|
|
9082
9154
|
created.push(".skaile/settings.json");
|
|
9083
9155
|
}
|
|
9084
|
-
const wsConfigPath =
|
|
9085
|
-
if (!
|
|
9156
|
+
const wsConfigPath = path35__default.join(resolved, "skaile.yaml");
|
|
9157
|
+
if (!existsSync15(wsConfigPath)) {
|
|
9086
9158
|
writeFileSync5(wsConfigPath, stringify2(buildInitWorkspaceConfig(projectName, harness)));
|
|
9087
9159
|
created.push("skaile.yaml");
|
|
9088
9160
|
}
|
|
9089
9161
|
for (const dir of new Set(Object.values(DRIVER_TARGETS[harness].local))) {
|
|
9090
|
-
const full =
|
|
9091
|
-
if (!
|
|
9162
|
+
const full = path35__default.join(resolved, dir);
|
|
9163
|
+
if (!existsSync15(full)) {
|
|
9092
9164
|
mkdirSync4(full, { recursive: true });
|
|
9093
9165
|
created.push(`${dir}/`);
|
|
9094
9166
|
}
|
|
@@ -9118,8 +9190,8 @@ function buildInitWorkspaceConfig(projectName, harness) {
|
|
|
9118
9190
|
}
|
|
9119
9191
|
async function initGitScaffold(resolved, created) {
|
|
9120
9192
|
const { execSync: execSync3 } = await import('child_process');
|
|
9121
|
-
const { existsSync:
|
|
9122
|
-
const gitignorePath =
|
|
9193
|
+
const { existsSync: existsSync15, readFileSync: readFileSync9, writeFileSync: writeFileSync5 } = await import('fs');
|
|
9194
|
+
const gitignorePath = path35__default.join(resolved, ".gitignore");
|
|
9123
9195
|
const entries = [
|
|
9124
9196
|
"node_modules/",
|
|
9125
9197
|
".skaile/sessions/",
|
|
@@ -9136,7 +9208,7 @@ async function initGitScaffold(resolved, created) {
|
|
|
9136
9208
|
".env",
|
|
9137
9209
|
".env.local"
|
|
9138
9210
|
];
|
|
9139
|
-
const existing =
|
|
9211
|
+
const existing = existsSync15(gitignorePath) ? readFileSync9(gitignorePath, "utf-8") : "";
|
|
9140
9212
|
const have = new Set(existing.split("\n").map((l) => l.trim()));
|
|
9141
9213
|
const append = entries.filter((e) => !have.has(e));
|
|
9142
9214
|
if (append.length > 0) {
|
|
@@ -9145,7 +9217,7 @@ async function initGitScaffold(resolved, created) {
|
|
|
9145
9217
|
`);
|
|
9146
9218
|
if (!existing) created.push(".gitignore");
|
|
9147
9219
|
}
|
|
9148
|
-
if (!
|
|
9220
|
+
if (!existsSync15(path35__default.join(resolved, ".git"))) {
|
|
9149
9221
|
try {
|
|
9150
9222
|
execSync3("git init", { cwd: resolved, stdio: "pipe" });
|
|
9151
9223
|
created.push(".git/");
|
|
@@ -9157,10 +9229,10 @@ async function initGitScaffold(resolved, created) {
|
|
|
9157
9229
|
}
|
|
9158
9230
|
async function bootstrapUserConfig() {
|
|
9159
9231
|
try {
|
|
9160
|
-
const
|
|
9232
|
+
const fs12 = await import('fs');
|
|
9161
9233
|
const { userConfigPath, saveConfig, getConfigDefaults } = await import('../library/index.js');
|
|
9162
9234
|
const userCfgPath = userConfigPath();
|
|
9163
|
-
if (!
|
|
9235
|
+
if (!fs12.existsSync(userCfgPath)) {
|
|
9164
9236
|
const defaults = getConfigDefaults();
|
|
9165
9237
|
saveConfig(userCfgPath, {
|
|
9166
9238
|
catalog: { url: defaults.catalog.url, cache_ttl: defaults.catalog.cache_ttl }
|
|
@@ -9175,7 +9247,7 @@ async function bootstrapUserConfig() {
|
|
|
9175
9247
|
}
|
|
9176
9248
|
async function hydrateInitSources(resolved, created) {
|
|
9177
9249
|
try {
|
|
9178
|
-
const { ensureSourcesCloned } = await import('../ensure-sources-
|
|
9250
|
+
const { ensureSourcesCloned } = await import('../ensure-sources-VCPA762L.js');
|
|
9179
9251
|
const hydrate = ensureSourcesCloned(resolved, { quiet: true });
|
|
9180
9252
|
for (const n of hydrate.cloned) created.push(`~/.skaile/cache/sources/${n}/`);
|
|
9181
9253
|
if (hydrate.failed.length > 0) {
|
|
@@ -9191,7 +9263,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
9191
9263
|
logOk(`Initialized project at ${S.heading(resolved)}`);
|
|
9192
9264
|
console.log();
|
|
9193
9265
|
console.log(S.heading(" Next steps:"));
|
|
9194
|
-
const isCurrentDir = resolved ===
|
|
9266
|
+
const isCurrentDir = resolved === path35__default.resolve(".");
|
|
9195
9267
|
let step = 1;
|
|
9196
9268
|
if (!isCurrentDir) {
|
|
9197
9269
|
console.log(` ${S.dim(`${step}.`)} ${S.cmd(`cd ${projectDir}`)}`);
|
|
@@ -9215,7 +9287,7 @@ function printInitSummary(resolved, projectDir, created) {
|
|
|
9215
9287
|
console.log();
|
|
9216
9288
|
}
|
|
9217
9289
|
program.command("setup").description("Interactive provider setup wizard").action(async () => {
|
|
9218
|
-
const { cmdSetup } = await import('../setup-
|
|
9290
|
+
const { cmdSetup } = await import('../setup-RG4PJJUW.js');
|
|
9219
9291
|
await cmdSetup([], { projectDir: process.cwd() });
|
|
9220
9292
|
});
|
|
9221
9293
|
program.addCommand(makeInstallCommand());
|