@skaile/workspaces 0.8.5 → 0.9.1
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 +75 -1
- package/README.md +2 -2
- package/dist/asset-manager/index.js +12 -12
- package/dist/asset-manager/installer.js +10 -10
- package/dist/asset-manager/renderers.js +2 -2
- package/dist/asset-manager/scaffold.js +10 -10
- package/dist/base-assets/connectors/deploy/adapter.d.ts +21 -19
- package/dist/base-assets/connectors/deploy/adapter.d.ts.map +1 -1
- package/dist/base-assets/connectors/deploy.js +10 -10
- package/dist/base-assets/connectors/devserver/adapter.d.ts +14 -12
- package/dist/base-assets/connectors/devserver/adapter.d.ts.map +1 -1
- package/dist/base-assets/connectors/devserver.js +10 -10
- package/dist/base-assets/connectors/flow/adapter.d.ts +13 -10
- package/dist/base-assets/connectors/flow/adapter.d.ts.map +1 -1
- package/dist/base-assets/connectors/flow/adapter.js +10 -10
- package/dist/base-assets/connectors/flow/engine/flow-manifest.d.ts +5 -167
- package/dist/base-assets/connectors/flow/engine/flow-manifest.d.ts.map +1 -1
- package/dist/base-assets/connectors/flow/engine.js +1 -1
- package/dist/base-assets/connectors/flow/index.d.ts +1 -1
- package/dist/base-assets/connectors/flow/index.d.ts.map +1 -1
- package/dist/base-assets/connectors/flow/run-flow.d.ts.map +1 -1
- package/dist/base-assets/connectors/flow/run-flow.js +12 -12
- package/dist/base-assets/connectors/flow.js +10 -10
- package/dist/base-assets/{mounts → connectors}/git/driver.d.ts +34 -32
- package/dist/base-assets/connectors/git/driver.d.ts.map +1 -0
- package/dist/base-assets/connectors/git.js +20 -0
- package/dist/base-assets/connectors/gmail/adapter.d.ts +16 -15
- package/dist/base-assets/connectors/gmail/adapter.d.ts.map +1 -1
- package/dist/base-assets/connectors/gmail.js +10 -10
- package/dist/base-assets/connectors/local/driver.d.ts +28 -0
- package/dist/base-assets/connectors/local/driver.d.ts.map +1 -0
- package/dist/base-assets/connectors/local.js +20 -0
- package/dist/base-assets/connectors/mattermost/adapter.d.ts +23 -22
- package/dist/base-assets/connectors/mattermost/adapter.d.ts.map +1 -1
- package/dist/base-assets/connectors/mattermost.js +10 -10
- package/dist/base-assets/connectors/memory/adapter.d.ts +18 -17
- package/dist/base-assets/connectors/memory/adapter.d.ts.map +1 -1
- package/dist/base-assets/connectors/memory.js +10 -10
- package/dist/base-assets/connectors/minio/adapter.d.ts +17 -16
- package/dist/base-assets/connectors/minio/adapter.d.ts.map +1 -1
- package/dist/base-assets/connectors/minio.js +10 -10
- package/dist/base-assets/connectors/postgres/adapter.d.ts +17 -21
- package/dist/base-assets/connectors/postgres/adapter.d.ts.map +1 -1
- package/dist/base-assets/connectors/postgres.js +10 -10
- package/dist/base-assets/connectors/redis/adapter.d.ts +19 -19
- package/dist/base-assets/connectors/redis/adapter.d.ts.map +1 -1
- package/dist/base-assets/connectors/redis.js +10 -10
- package/dist/base-assets/connectors/s3/driver.d.ts +46 -0
- package/dist/base-assets/connectors/s3/driver.d.ts.map +1 -0
- package/dist/base-assets/connectors/s3.js +20 -0
- package/dist/base-assets/connectors/sharepoint/driver.d.ts +34 -0
- package/dist/base-assets/connectors/sharepoint/driver.d.ts.map +1 -0
- package/dist/base-assets/connectors/sharepoint.js +20 -0
- package/dist/base-assets/connectors/sqlite/adapter.d.ts +16 -16
- package/dist/base-assets/connectors/sqlite/adapter.d.ts.map +1 -1
- package/dist/base-assets/connectors/sqlite.js +10 -10
- package/dist/base-assets/connectors/static-server/adapter.d.ts +16 -12
- package/dist/base-assets/connectors/static-server/adapter.d.ts.map +1 -1
- package/dist/base-assets/connectors/static-server.js +10 -10
- package/dist/base-assets/connectors/tunnel/adapter.d.ts +14 -12
- package/dist/base-assets/connectors/tunnel/adapter.d.ts.map +1 -1
- package/dist/base-assets/connectors/tunnel.js +10 -10
- package/dist/base-assets/connectors/webdav/driver.d.ts +35 -0
- package/dist/base-assets/connectors/webdav/driver.d.ts.map +1 -0
- package/dist/base-assets/connectors/webdav.js +20 -0
- package/dist/base-assets/connectors/xstate/adapter.d.ts +18 -16
- package/dist/base-assets/connectors/xstate/adapter.d.ts.map +1 -1
- package/dist/base-assets/connectors/xstate-store/adapter.d.ts +20 -19
- package/dist/base-assets/connectors/xstate-store/adapter.d.ts.map +1 -1
- package/dist/base-assets/connectors/xstate-store.js +10 -10
- package/dist/base-assets/connectors/xstate.js +10 -10
- package/dist/base-assets/connectors/yjs/adapter.d.ts +22 -21
- package/dist/base-assets/connectors/yjs/adapter.d.ts.map +1 -1
- package/dist/base-assets/connectors/yjs.js +10 -10
- package/dist/base-assets/index.js.map +1 -1
- package/dist/bridge/drivers/claude-sdk.js +215 -4
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +2 -2
- package/dist/bridge/drivers/echo.js +2 -2
- package/dist/bridge/drivers/omp.js +2 -2
- package/dist/bridge/index.js +3 -3
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/drivers/scrub-transcript.d.ts +113 -0
- package/dist/bridge/src/drivers/scrub-transcript.d.ts.map +1 -0
- package/dist/bridge/src/types.d.ts +2 -2
- package/dist/bridge/src/types.d.ts.map +1 -1
- package/dist/{chunk-V37HONL7.js → chunk-24UIWON4.js} +61 -6
- package/dist/chunk-24UIWON4.js.map +1 -0
- package/dist/{chunk-JLPC4YWT.js → chunk-37JKX6D7.js} +3 -4
- package/dist/chunk-37JKX6D7.js.map +1 -0
- package/dist/{chunk-DOMCYP7D.js → chunk-42OQF7UU.js} +227 -21
- package/dist/chunk-42OQF7UU.js.map +1 -0
- package/dist/{chunk-65CYXYUW.js → chunk-4RUVG5GX.js} +50 -5
- package/dist/chunk-4RUVG5GX.js.map +1 -0
- package/dist/{chunk-MJHLQRJJ.js → chunk-5IC6CJL4.js} +11 -29
- package/dist/chunk-5IC6CJL4.js.map +1 -0
- package/dist/{chunk-GVOLEJG5.js → chunk-6DEGWPAR.js} +3 -3
- package/dist/{chunk-GVOLEJG5.js.map → chunk-6DEGWPAR.js.map} +1 -1
- package/dist/{chunk-7HLNUSNE.js → chunk-6FNCZYJY.js} +3 -3
- package/dist/{chunk-7HLNUSNE.js.map → chunk-6FNCZYJY.js.map} +1 -1
- package/dist/{chunk-D5IH3QMH.js → chunk-7R6W5EQR.js} +20 -19
- package/dist/chunk-7R6W5EQR.js.map +1 -0
- package/dist/{chunk-MBBTBKAS.js → chunk-AE6GCXGL.js} +3 -3
- package/dist/{chunk-MBBTBKAS.js.map → chunk-AE6GCXGL.js.map} +1 -1
- package/dist/{chunk-TS6VCR4W.js → chunk-DIKFRNCS.js} +3 -3
- package/dist/{chunk-TS6VCR4W.js.map → chunk-DIKFRNCS.js.map} +1 -1
- package/dist/{chunk-7HCGI2GW.js → chunk-DTL7S57T.js} +37 -29
- package/dist/chunk-DTL7S57T.js.map +1 -0
- package/dist/{chunk-7H7EOIRH.js → chunk-EBMFCF4P.js} +2 -2
- package/dist/{chunk-7H7EOIRH.js.map → chunk-EBMFCF4P.js.map} +1 -1
- package/dist/{chunk-3W7Z74ZP.js → chunk-EPGHAOEU.js} +5856 -5822
- package/dist/chunk-EPGHAOEU.js.map +1 -0
- package/dist/{chunk-CSUBFKAN.js → chunk-GAZINYCS.js} +4 -4
- package/dist/{chunk-CSUBFKAN.js.map → chunk-GAZINYCS.js.map} +1 -1
- package/dist/{chunk-Y46TBPLI.js → chunk-GCJXPUHG.js} +3 -3
- package/dist/{chunk-Y46TBPLI.js.map → chunk-GCJXPUHG.js.map} +1 -1
- package/dist/{chunk-46T37EBP.js → chunk-GKIA2PU5.js} +7 -35
- package/dist/chunk-GKIA2PU5.js.map +1 -0
- package/dist/{chunk-EE3XTJ62.js → chunk-I3S4BAAR.js} +7 -7
- package/dist/{chunk-EE3XTJ62.js.map → chunk-I3S4BAAR.js.map} +1 -1
- package/dist/{chunk-ZUQIXLRJ.js → chunk-ICS76R4T.js} +14 -14
- package/dist/chunk-ICS76R4T.js.map +1 -0
- package/dist/{chunk-CCKGX5AS.js → chunk-K3TMZI6D.js} +3 -3
- package/dist/{chunk-CCKGX5AS.js.map → chunk-K3TMZI6D.js.map} +1 -1
- package/dist/{chunk-AIGWF3TJ.js → chunk-LDUNTZB6.js} +46 -4
- package/dist/chunk-LDUNTZB6.js.map +1 -0
- package/dist/{chunk-UMMBL7SW.js → chunk-M2NLRGIX.js} +5 -5
- package/dist/{chunk-UMMBL7SW.js.map → chunk-M2NLRGIX.js.map} +1 -1
- package/dist/{chunk-Z3RER6YZ.js → chunk-NELZIQ2E.js} +42 -42
- package/dist/chunk-NELZIQ2E.js.map +1 -0
- package/dist/chunk-PBWMV5GM.js +171 -0
- package/dist/chunk-PBWMV5GM.js.map +1 -0
- package/dist/{chunk-NYJKXVG6.js → chunk-QZ6PY73K.js} +160 -188
- package/dist/chunk-QZ6PY73K.js.map +1 -0
- package/dist/chunk-R7FOF242.js +59 -0
- package/dist/chunk-R7FOF242.js.map +1 -0
- package/dist/{chunk-XEGHWFAX.js → chunk-SVNFQSU3.js} +5 -10
- package/dist/chunk-SVNFQSU3.js.map +1 -0
- package/dist/{chunk-44ZICIN4.js → chunk-TODD4VNR.js} +9 -3
- package/dist/chunk-TODD4VNR.js.map +1 -0
- package/dist/{chunk-77CUYYO3.js → chunk-VAJB2UJ5.js} +5 -5
- package/dist/{chunk-77CUYYO3.js.map → chunk-VAJB2UJ5.js.map} +1 -1
- package/dist/{chunk-Q5URN24L.js → chunk-W75ASXH4.js} +23 -27
- package/dist/chunk-W75ASXH4.js.map +1 -0
- package/dist/{chunk-5CSE3QL2.js → chunk-XIVOEUAF.js} +5 -5
- package/dist/{chunk-5CSE3QL2.js.map → chunk-XIVOEUAF.js.map} +1 -1
- package/dist/{chunk-BVHFSUFM.js → chunk-ZHLRRT5D.js} +4 -25
- package/dist/chunk-ZHLRRT5D.js.map +1 -0
- package/dist/{chunk-6UQ66R46.js → chunk-ZWIG55ZX.js} +2 -2
- package/dist/{chunk-6UQ66R46.js.map → chunk-ZWIG55ZX.js.map} +1 -1
- package/dist/cli/index.js +321 -300
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/connector.d.ts +2 -1
- package/dist/cli/src/commands/connector.d.ts.map +1 -1
- package/dist/cli/src/commands/logs.d.ts.map +1 -1
- package/dist/cli/src/commands/project.d.ts +73 -3
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/cli/src/commands/session-logs/local-query.d.ts +3 -4
- package/dist/cli/src/commands/session-logs/local-query.d.ts.map +1 -1
- package/dist/cli/src/commands/session-logs/local-tail.d.ts +0 -3
- package/dist/cli/src/commands/session-logs/local-tail.d.ts.map +1 -1
- package/dist/cli/src/commands/session-logs/sqlite-row.d.ts +0 -26
- package/dist/cli/src/commands/session-logs/sqlite-row.d.ts.map +1 -1
- package/dist/cli/src/index.d.ts +1 -1
- package/dist/connectors/config.js +7 -7
- package/dist/connectors/index.js +10 -10
- package/dist/connectors/rclone.js +1 -1
- package/dist/connectors/src/config.d.ts +9 -10
- package/dist/connectors/src/config.d.ts.map +1 -1
- package/dist/connectors/src/connector-base.d.ts +23 -0
- package/dist/connectors/src/connector-base.d.ts.map +1 -0
- package/dist/connectors/src/connector-manager.d.ts +158 -58
- package/dist/connectors/src/connector-manager.d.ts.map +1 -1
- package/dist/connectors/src/connector-prompt.d.ts +72 -0
- package/dist/connectors/src/connector-prompt.d.ts.map +1 -0
- package/dist/connectors/src/connector-registry.d.ts +34 -35
- package/dist/connectors/src/connector-registry.d.ts.map +1 -1
- package/dist/connectors/src/connector-types.d.ts +147 -60
- package/dist/connectors/src/connector-types.d.ts.map +1 -1
- package/dist/connectors/src/index.d.ts +17 -23
- package/dist/connectors/src/index.d.ts.map +1 -1
- package/dist/connectors/src/npm-installer.d.ts +2 -2
- package/dist/connectors/src/npm-installer.d.ts.map +1 -1
- package/dist/connectors/src/rclone-process-manager.d.ts +1 -1
- package/dist/connectors/src/secrets.d.ts +3 -3
- package/dist/connectors/src/watcher.d.ts +3 -3
- package/dist/connectors/src/watcher.d.ts.map +1 -1
- package/dist/connectors-PTCSHCHZ.js +5 -0
- package/dist/{connectors-7WS2KOSZ.js.map → connectors-PTCSHCHZ.js.map} +1 -1
- package/dist/core/index.js +6 -6
- package/dist/core/logging.js +1 -1
- package/dist/core/manifest.js +2 -2
- package/dist/core/models.js +1 -1
- package/dist/core/runtime-assets.js +4 -4
- package/dist/core/src/index.d.ts +4 -2
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/logging/index.d.ts +2 -0
- package/dist/core/src/logging/index.d.ts.map +1 -1
- package/dist/core/src/logging/sinks/sqlite-runtime.d.ts +24 -0
- package/dist/core/src/logging/sinks/sqlite-runtime.d.ts.map +1 -0
- package/dist/core/src/logging/sinks/sqlite-sink.d.ts.map +1 -1
- package/dist/core/src/manifest.d.ts +2 -23
- package/dist/core/src/manifest.d.ts.map +1 -1
- package/dist/core/src/models.d.ts +1 -1
- package/dist/core/src/models.d.ts.map +1 -1
- package/dist/core/src/runtime-assets.d.ts +12 -13
- package/dist/core/src/runtime-assets.d.ts.map +1 -1
- package/dist/core/src/subprocess.d.ts +35 -0
- package/dist/core/src/subprocess.d.ts.map +1 -0
- package/dist/core/src/workspace-config.d.ts +32 -10
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/workspace-config.js +3 -3
- package/dist/discovery/index.js +4 -4
- package/dist/discovery/src/builtin-providers.d.ts +5 -4
- package/dist/discovery/src/builtin-providers.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/discovery/src/source-config.d.ts +24 -233
- package/dist/discovery/src/source-config.d.ts.map +1 -1
- package/dist/{flows-ZULSVHX5.js → flows-6BNO4GKK.js} +3 -3
- package/dist/{flows-ZULSVHX5.js.map → flows-6BNO4GKK.js.map} +1 -1
- package/dist/library/index.js +6 -5
- package/dist/library/src/config.d.ts +25 -77
- package/dist/library/src/config.d.ts.map +1 -1
- package/dist/library/src/index.d.ts +2 -0
- package/dist/library/src/index.d.ts.map +1 -1
- package/dist/library/src/install/install-from-manifest.d.ts +80 -0
- package/dist/library/src/install/install-from-manifest.d.ts.map +1 -0
- package/dist/library/src/install/source-fetch-github.d.ts +43 -0
- package/dist/library/src/install/source-fetch-github.d.ts.map +1 -0
- package/dist/library/src/knowledge/knowledge-manifest.d.ts +3 -17
- package/dist/library/src/knowledge/knowledge-manifest.d.ts.map +1 -1
- package/dist/library/src/library.d.ts +6 -0
- package/dist/library/src/library.d.ts.map +1 -1
- package/dist/library/src/local/db.d.ts.map +1 -1
- package/dist/library/src/local/library.d.ts +41 -0
- package/dist/library/src/local/library.d.ts.map +1 -1
- package/dist/library/src/local/schema.d.ts +19 -0
- package/dist/library/src/local/schema.d.ts.map +1 -1
- package/dist/library/src/remote/remote-catalog-source.d.ts +22 -0
- package/dist/library/src/remote/remote-catalog-source.d.ts.map +1 -1
- package/dist/library/src/user-library.d.ts +1 -2
- package/dist/library/src/user-library.d.ts.map +1 -1
- package/dist/library/src/workspace-config.d.ts +45 -243
- package/dist/library/src/workspace-config.d.ts.map +1 -1
- package/dist/open-library-S6FK4N4S.js +13 -0
- package/dist/{open-library-N5T5HRTS.js.map → open-library-S6FK4N4S.js.map} +1 -1
- package/dist/{provider-QXKEDXWJ.js → provider-GAWKFQ3T.js} +20 -4
- package/dist/provider-GAWKFQ3T.js.map +1 -0
- package/dist/runner/index.js +15 -15
- package/dist/runner/src/builtin-capabilities.d.ts.map +1 -1
- package/dist/runner/src/define-capability.d.ts +1 -1
- package/dist/runner/src/define-capability.d.ts.map +1 -1
- package/dist/runner/src/refresh-flag-dispatcher.d.ts +20 -20
- package/dist/runner/src/refresh-flag-dispatcher.d.ts.map +1 -1
- package/dist/runner/src/resource-handler.d.ts +8 -6
- package/dist/runner/src/resource-handler.d.ts.map +1 -1
- package/dist/runner/src/resources.d.ts +14 -22
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/runner-capabilities.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts +5 -7
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/runner/src/workspace-migration.d.ts +2 -2
- package/dist/runner/src/workspace-migration.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +12 -12
- package/dist/sdk/bridge.js +3 -3
- package/dist/sdk/core.js +6 -6
- package/dist/sdk/flow.js +1 -1
- package/dist/sdk/index.js +15 -15
- package/dist/sdk/runner.js +15 -15
- package/dist/sdk/session.js +1 -1
- package/dist/sdk/telemetry.js +1 -1
- package/dist/sdk/transport/ws/server.js +1 -1
- package/dist/sdk/transport/ws.js +1 -1
- package/dist/sdk/transport.js +1 -1
- package/dist/session/index.js +1 -1
- package/dist/session/src/dispatcher.d.ts +4 -1
- package/dist/session/src/dispatcher.d.ts.map +1 -1
- package/dist/{setup-BMTC562F.js → setup-PHFPBDBI.js} +10 -10
- package/dist/{setup-BMTC562F.js.map → setup-PHFPBDBI.js.map} +1 -1
- package/dist/source-fetch-github-QN4LLTL5.js +4 -0
- package/dist/source-fetch-github-QN4LLTL5.js.map +1 -0
- package/dist/store-client-BM3IBDPT.js +14 -0
- package/dist/{store-client-X7Y7D5QX.js.map → store-client-BM3IBDPT.js.map} +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/transport/index.js +1 -1
- package/dist/transport/src/ws/server.d.ts +11 -8
- package/dist/transport/src/ws/server.d.ts.map +1 -1
- package/dist/transport/ws/server.js +1 -1
- package/dist/transport/ws.js +1 -1
- package/dist/tui/index.js +16 -25
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/src/repl.d.ts.map +1 -1
- package/dist/types/manifests.js +1 -1
- package/dist/types/src/events.d.ts +6 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/install-manifest.d.ts +33 -0
- package/dist/types/src/install-manifest.d.ts.map +1 -0
- package/dist/types/src/manifests/_shared.d.ts +39 -100
- package/dist/types/src/manifests/_shared.d.ts.map +1 -1
- package/dist/types/src/manifests/agent.d.ts +43 -248
- package/dist/types/src/manifests/agent.d.ts.map +1 -1
- package/dist/types/src/manifests/connector.d.ts +7 -107
- package/dist/types/src/manifests/connector.d.ts.map +1 -1
- package/dist/types/src/manifests/contract.d.ts +10 -75
- package/dist/types/src/manifests/contract.d.ts.map +1 -1
- package/dist/types/src/manifests/mcp-server.d.ts +9 -29
- package/dist/types/src/manifests/mcp-server.d.ts.map +1 -1
- package/dist/types/src/manifests/mount.d.ts +4 -76
- package/dist/types/src/manifests/mount.d.ts.map +1 -1
- package/dist/types/src/manifests/persona.d.ts +10 -75
- package/dist/types/src/manifests/persona.d.ts.map +1 -1
- package/dist/types/src/manifests/preset.d.ts +82 -642
- package/dist/types/src/manifests/preset.d.ts.map +1 -1
- package/dist/types/src/manifests/prompt.d.ts +10 -75
- package/dist/types/src/manifests/prompt.d.ts.map +1 -1
- package/dist/types/src/manifests/ruleset.d.ts +10 -75
- package/dist/types/src/manifests/ruleset.d.ts.map +1 -1
- package/dist/types/src/manifests/skill.d.ts +46 -2328
- package/dist/types/src/manifests/skill.d.ts.map +1 -1
- package/dist/validator-47SQUW3J.js +5 -0
- package/dist/{validator-764EQNM3.js.map → validator-47SQUW3J.js.map} +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +8 -9
- package/dist/workspace-plugin/adapters/mcp.js.map +1 -1
- package/dist/workspace-plugin/adapters/omp.js +19 -18
- package/dist/workspace-plugin/adapters/omp.js.map +1 -1
- package/dist/workspace-plugin/index.js +2 -2
- 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 +5 -3
- package/dist/workspace-plugin/src/plugin.d.ts.map +1 -1
- package/dist/workspace-plugin/src/tools/connectors.d.ts +38 -0
- package/dist/workspace-plugin/src/tools/connectors.d.ts.map +1 -1
- package/dist/workspace-plugin/src/tools/validator.d.ts +6 -4
- package/dist/workspace-plugin/src/tools/validator.d.ts.map +1 -1
- package/package.json +217 -117
- package/dist/base-assets/mounts/git/driver.d.ts.map +0 -1
- package/dist/base-assets/mounts/git.js +0 -20
- package/dist/base-assets/mounts/local/driver.d.ts +0 -27
- package/dist/base-assets/mounts/local/driver.d.ts.map +0 -1
- package/dist/base-assets/mounts/local.js +0 -20
- package/dist/base-assets/mounts/s3/driver.d.ts +0 -27
- package/dist/base-assets/mounts/s3/driver.d.ts.map +0 -1
- package/dist/base-assets/mounts/s3.js +0 -20
- package/dist/base-assets/mounts/sharepoint/driver.d.ts +0 -31
- package/dist/base-assets/mounts/sharepoint/driver.d.ts.map +0 -1
- package/dist/base-assets/mounts/sharepoint.js +0 -20
- package/dist/base-assets/mounts/webdav/driver.d.ts +0 -32
- package/dist/base-assets/mounts/webdav/driver.d.ts.map +0 -1
- package/dist/base-assets/mounts/webdav.js +0 -20
- package/dist/chunk-3W7Z74ZP.js.map +0 -1
- package/dist/chunk-44ZICIN4.js.map +0 -1
- package/dist/chunk-46T37EBP.js.map +0 -1
- package/dist/chunk-65CYXYUW.js.map +0 -1
- package/dist/chunk-7HCGI2GW.js.map +0 -1
- package/dist/chunk-AIGWF3TJ.js.map +0 -1
- package/dist/chunk-BVHFSUFM.js.map +0 -1
- package/dist/chunk-D5IH3QMH.js.map +0 -1
- package/dist/chunk-DOMCYP7D.js.map +0 -1
- package/dist/chunk-JLPC4YWT.js.map +0 -1
- package/dist/chunk-MJHLQRJJ.js.map +0 -1
- package/dist/chunk-NYJKXVG6.js.map +0 -1
- package/dist/chunk-Q5URN24L.js.map +0 -1
- package/dist/chunk-QT2KQHDT.js +0 -49
- package/dist/chunk-QT2KQHDT.js.map +0 -1
- package/dist/chunk-V37HONL7.js.map +0 -1
- package/dist/chunk-XEGHWFAX.js.map +0 -1
- package/dist/chunk-XOSBNBB6.js +0 -155
- package/dist/chunk-XOSBNBB6.js.map +0 -1
- package/dist/chunk-Z3RER6YZ.js.map +0 -1
- package/dist/chunk-ZUQIXLRJ.js.map +0 -1
- package/dist/cli/src/commands/mount.d.ts +0 -22
- package/dist/cli/src/commands/mount.d.ts.map +0 -1
- package/dist/connectors/src/adapters/base.d.ts +0 -66
- package/dist/connectors/src/adapters/base.d.ts.map +0 -1
- package/dist/connectors/src/connector-tools.d.ts +0 -61
- package/dist/connectors/src/connector-tools.d.ts.map +0 -1
- package/dist/connectors/src/drivers/base.d.ts +0 -44
- package/dist/connectors/src/drivers/base.d.ts.map +0 -1
- package/dist/connectors/src/mount-manager.d.ts +0 -147
- package/dist/connectors/src/mount-manager.d.ts.map +0 -1
- package/dist/connectors/src/mount-prompt.d.ts +0 -13
- package/dist/connectors/src/mount-prompt.d.ts.map +0 -1
- package/dist/connectors/src/mount-registry.d.ts +0 -61
- package/dist/connectors/src/mount-registry.d.ts.map +0 -1
- package/dist/connectors/src/mount-types.d.ts +0 -222
- package/dist/connectors/src/mount-types.d.ts.map +0 -1
- package/dist/connectors-7WS2KOSZ.js +0 -5
- package/dist/mounts-PQLFYD2C.js +0 -5
- package/dist/mounts-PQLFYD2C.js.map +0 -1
- package/dist/open-library-N5T5HRTS.js +0 -12
- package/dist/provider-QXKEDXWJ.js.map +0 -1
- package/dist/store-client-X7Y7D5QX.js +0 -14
- package/dist/validator-764EQNM3.js +0 -5
- package/dist/workspace-plugin/src/tools/mounts.d.ts +0 -51
- package/dist/workspace-plugin/src/tools/mounts.d.ts.map +0 -1
- /package/dist/base-assets/{mounts → connectors}/git.js.map +0 -0
- /package/dist/base-assets/{mounts → connectors}/local.js.map +0 -0
- /package/dist/base-assets/{mounts → connectors}/s3.js.map +0 -0
- /package/dist/base-assets/{mounts → connectors}/sharepoint.js.map +0 -0
- /package/dist/base-assets/{mounts → connectors}/webdav.js.map +0 -0
package/dist/cli/index.js
CHANGED
|
@@ -1,58 +1,59 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
import { openCatalogSource, openLibrary, createFullRegistry, openUserLibraryManager } from '../chunk-
|
|
3
|
-
import { S, logErr, logOk,
|
|
4
|
-
import { getStoreConfig, storeFetch, saveStoreTokens, clearStoreTokens, isStoreAuthenticated } from '../chunk-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { openCatalogSource, openLibrary, createFullRegistry, openUserLibraryManager } from '../chunk-VAJB2UJ5.js';
|
|
3
|
+
import { S, logErr, logOk, colorRef, logInfo, logWarn, kindColorPad, kindColor, formatRelativeTime } from '../chunk-4NDWKA64.js';
|
|
4
|
+
import { getStoreConfig, storeFetch, saveStoreTokens, clearStoreTokens, isStoreAuthenticated } from '../chunk-6DEGWPAR.js';
|
|
5
5
|
import { AI_RESOURCES } from '../chunk-2M3XTMOL.js';
|
|
6
6
|
import { LocalSecretsProvider } from '../chunk-JDX54X4Y.js';
|
|
7
|
-
import { resolveLibraryDir } from '../chunk-
|
|
8
|
-
import '../chunk-
|
|
7
|
+
import { resolveLibraryDir } from '../chunk-42OQF7UU.js';
|
|
8
|
+
import '../chunk-R7FOF242.js';
|
|
9
|
+
import '../chunk-GKIA2PU5.js';
|
|
9
10
|
import '../chunk-OKRUTSG7.js';
|
|
10
|
-
import { runFlow, resumeFlow } from '../chunk-
|
|
11
|
-
import '../chunk-
|
|
11
|
+
import { runFlow, resumeFlow } from '../chunk-DTL7S57T.js';
|
|
12
|
+
import '../chunk-GCJXPUHG.js';
|
|
12
13
|
import { validateFlowVersions, parseSkillFrontmatter } from '../chunk-IPUYL6TD.js';
|
|
13
|
-
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-
|
|
14
|
-
import { buildClaudePluginFiles } from '../chunk-
|
|
14
|
+
import { runAgentChat, loadSessionById, loadSession, listSessions, setCurrentSession, deleteSession, clearSession, loadAgentManifest, compileComposition, MarkdownStreamer, resolveMixin } from '../chunk-QZ6PY73K.js';
|
|
15
|
+
import { buildClaudePluginFiles } from '../chunk-5IC6CJL4.js';
|
|
15
16
|
import '../chunk-X5YPJV4N.js';
|
|
16
17
|
import '../chunk-O5AE4QDX.js';
|
|
17
18
|
import '../chunk-O7SG5PC2.js';
|
|
18
19
|
import '../chunk-W2O5LWYU.js';
|
|
19
20
|
import '../chunk-7PTP3SQJ.js';
|
|
20
|
-
import '../chunk-
|
|
21
|
-
import '../chunk-
|
|
21
|
+
import '../chunk-PBWMV5GM.js';
|
|
22
|
+
import '../chunk-K3TMZI6D.js';
|
|
22
23
|
import '../chunk-EWP5HZBV.js';
|
|
23
24
|
import '../chunk-KOVLSBXK.js';
|
|
24
25
|
import '../chunk-RRVQAE5D.js';
|
|
25
|
-
import '../chunk-
|
|
26
|
+
import '../chunk-AE6GCXGL.js';
|
|
26
27
|
import '../chunk-LV2HPH3C.js';
|
|
27
|
-
import '../chunk-
|
|
28
|
-
import '../chunk-
|
|
29
|
-
import '../chunk-
|
|
28
|
+
import '../chunk-EPGHAOEU.js';
|
|
29
|
+
import '../chunk-W75ASXH4.js';
|
|
30
|
+
import '../chunk-EBMFCF4P.js';
|
|
30
31
|
import '../chunk-GCRKAFH7.js';
|
|
31
|
-
import { loadAllFlows } from '../chunk-
|
|
32
|
+
import { loadAllFlows } from '../chunk-ICS76R4T.js';
|
|
32
33
|
import '../chunk-GZWJGNNN.js';
|
|
33
34
|
import '../chunk-FVTV7M76.js';
|
|
34
|
-
import { AssetManager } from '../chunk-
|
|
35
|
-
import '../chunk-
|
|
35
|
+
import { AssetManager } from '../chunk-I3S4BAAR.js';
|
|
36
|
+
import '../chunk-M2NLRGIX.js';
|
|
36
37
|
import '../chunk-KTBKW2FI.js';
|
|
37
38
|
import '../chunk-UQ6LFBPZ.js';
|
|
38
|
-
import '../chunk-
|
|
39
|
-
import '../chunk-
|
|
40
|
-
import { readLock, resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings } from '../chunk-
|
|
39
|
+
import '../chunk-XIVOEUAF.js';
|
|
40
|
+
import '../chunk-DIKFRNCS.js';
|
|
41
|
+
import { readLock, resolveSettings, globalSettingsPath, projectSettingsPath, loadSettings, saveSettings, portableSpawn, portableSpawnSync } from '../chunk-4RUVG5GX.js';
|
|
41
42
|
import '../chunk-JKNWJ64A.js';
|
|
42
43
|
import { SUPPORTED_DRIVER_TARGETS } from '../chunk-O4JH3KUE.js';
|
|
43
44
|
import { DRIVER_DEFAULTS } from '../chunk-K5GBV4SA.js';
|
|
44
45
|
import '../chunk-KLNL7QHN.js';
|
|
45
|
-
import '../chunk-
|
|
46
|
-
import { resolveSkWorkspaceConfig, resolveAgentDir } from '../chunk-
|
|
47
|
-
import '../chunk-
|
|
48
|
-
import { ASSET_KINDS } from '../chunk-
|
|
49
|
-
import '../chunk-
|
|
50
|
-
import '../chunk-
|
|
51
|
-
import '../chunk-
|
|
46
|
+
import '../chunk-SVNFQSU3.js';
|
|
47
|
+
import { resolveSkWorkspaceConfig, resolveAgentDir } from '../chunk-GAZINYCS.js';
|
|
48
|
+
import '../chunk-ZHLRRT5D.js';
|
|
49
|
+
import { ASSET_KINDS } from '../chunk-37JKX6D7.js';
|
|
50
|
+
import { openSqlite } from '../chunk-24UIWON4.js';
|
|
51
|
+
import '../chunk-6FNCZYJY.js';
|
|
52
|
+
import '../chunk-NELZIQ2E.js';
|
|
52
53
|
import '../chunk-CGYEHQOX.js';
|
|
53
|
-
import
|
|
54
|
-
import * as
|
|
55
|
-
import
|
|
54
|
+
import '../chunk-NSBPE2FW.js';
|
|
55
|
+
import * as path16 from 'path';
|
|
56
|
+
import path16__default, { resolve, join } from 'path';
|
|
56
57
|
import { Help, Command, Option } from 'commander';
|
|
57
58
|
import * as fs10 from 'fs';
|
|
58
59
|
import fs10__default, { existsSync, readFileSync, writeFileSync, statSync } from 'fs';
|
|
@@ -102,10 +103,10 @@ function makeAssetCommand() {
|
|
|
102
103
|
);
|
|
103
104
|
process.exit(1);
|
|
104
105
|
}
|
|
105
|
-
const basename2 =
|
|
106
|
-
const destDir = target.structure === "domain" && opts.domain ?
|
|
106
|
+
const basename2 = path16.basename(srcPath);
|
|
107
|
+
const destDir = target.structure === "domain" && opts.domain ? path16.join(target.path, opts.domain) : target.path;
|
|
107
108
|
fs10.mkdirSync(destDir, { recursive: true });
|
|
108
|
-
const destPath =
|
|
109
|
+
const destPath = path16.join(destDir, basename2);
|
|
109
110
|
if (fs10.existsSync(destPath)) {
|
|
110
111
|
logErr(`Destination already exists: ${destPath}`);
|
|
111
112
|
process.exit(1);
|
|
@@ -118,7 +119,7 @@ function makeAssetCommand() {
|
|
|
118
119
|
fs10.renameSync(srcPath, destPath);
|
|
119
120
|
break;
|
|
120
121
|
case "link":
|
|
121
|
-
fs10.symlinkSync(
|
|
122
|
+
fs10.symlinkSync(path16.resolve(srcPath), destPath);
|
|
122
123
|
break;
|
|
123
124
|
}
|
|
124
125
|
if (target.backend === "git" && opts.commit) {
|
|
@@ -166,17 +167,17 @@ function makeAssetCommand() {
|
|
|
166
167
|
}
|
|
167
168
|
const manifestPath = def.manifest.path;
|
|
168
169
|
const candidateSubpath = typeof manifestPath === "string" && manifestPath.length > 0 ? manifestPath : def.name;
|
|
169
|
-
const srcPath =
|
|
170
|
+
const srcPath = path16.join(lib.path, candidateSubpath);
|
|
170
171
|
if (!fs10.existsSync(srcPath)) {
|
|
171
172
|
logErr(`Asset path not found: ${srcPath}`);
|
|
172
173
|
process.exit(1);
|
|
173
174
|
}
|
|
174
|
-
const destPath =
|
|
175
|
-
fs10.mkdirSync(
|
|
175
|
+
const destPath = path16.join(target, candidateSubpath);
|
|
176
|
+
fs10.mkdirSync(path16.dirname(destPath), { recursive: true });
|
|
176
177
|
if (opts.mode === "copy") {
|
|
177
178
|
fs10.cpSync(srcPath, destPath, { recursive: true });
|
|
178
179
|
} else {
|
|
179
|
-
fs10.symlinkSync(
|
|
180
|
+
fs10.symlinkSync(path16.resolve(srcPath), destPath);
|
|
180
181
|
}
|
|
181
182
|
logOk(`Installed ${ref} \u2192 ${destPath} (${opts.mode})`);
|
|
182
183
|
} finally {
|
|
@@ -274,7 +275,7 @@ function makeSearchCommand() {
|
|
|
274
275
|
const showLocal = !opts.store;
|
|
275
276
|
const showStore = !opts.local;
|
|
276
277
|
if (showLocal) {
|
|
277
|
-
const am2 = new AssetManager({ projectDir:
|
|
278
|
+
const am2 = new AssetManager({ projectDir: path16__default.resolve(opts.projectDir) });
|
|
278
279
|
const entries = am2.search(query, kind);
|
|
279
280
|
if (entries.length === 0) {
|
|
280
281
|
if (!showStore) {
|
|
@@ -311,7 +312,7 @@ function makeSearchCommand() {
|
|
|
311
312
|
}
|
|
312
313
|
if (showStore) {
|
|
313
314
|
try {
|
|
314
|
-
const { getStoreConfig: getStoreConfig2, storeFetch: storeFetch2 } = await import('../store-client-
|
|
315
|
+
const { getStoreConfig: getStoreConfig2, storeFetch: storeFetch2 } = await import('../store-client-BM3IBDPT.js');
|
|
315
316
|
const config = getStoreConfig2();
|
|
316
317
|
const params = {};
|
|
317
318
|
if (query) params.q = query;
|
|
@@ -340,7 +341,7 @@ function makeSearchCommand() {
|
|
|
340
341
|
function makeAddCommand() {
|
|
341
342
|
return new Command("add").description("Add to skaile.yaml + deploy").argument("<ref>", "Asset reference (kind:name[@repo])").option("--project-dir <path>", "Project directory", process.cwd()).option("--global", "Deploy to global dir (~/.claude)").option("--target <agent>", "Driver target", "claude-code").action((ref, opts) => {
|
|
342
343
|
const am2 = new AssetManager({
|
|
343
|
-
projectDir:
|
|
344
|
+
projectDir: path16__default.resolve(opts.projectDir),
|
|
344
345
|
global: opts.global,
|
|
345
346
|
driverTarget: opts.target
|
|
346
347
|
});
|
|
@@ -361,7 +362,7 @@ function makeAddCommand() {
|
|
|
361
362
|
function makeRemoveCommand() {
|
|
362
363
|
return new Command("remove").description("Remove from skaile.yaml + undeploy").argument("<ref>", "Asset reference (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).option("--global", "Remove from global dir").option("--target <agent>", "Driver target", "claude-code").action((ref, opts) => {
|
|
363
364
|
const am2 = new AssetManager({
|
|
364
|
-
projectDir:
|
|
365
|
+
projectDir: path16__default.resolve(opts.projectDir),
|
|
365
366
|
global: opts.global,
|
|
366
367
|
driverTarget: opts.target
|
|
367
368
|
});
|
|
@@ -375,7 +376,7 @@ function makeListCommand() {
|
|
|
375
376
|
new Option("--target <agent>", "Driver target").default("claude-code").choices(SUPPORTED_DRIVER_TARGETS)
|
|
376
377
|
).action((kind, opts) => {
|
|
377
378
|
const am2 = new AssetManager({
|
|
378
|
-
projectDir:
|
|
379
|
+
projectDir: path16__default.resolve(opts.projectDir),
|
|
379
380
|
global: opts.global,
|
|
380
381
|
driverTarget: opts.target
|
|
381
382
|
});
|
|
@@ -399,7 +400,7 @@ function makeListCommand() {
|
|
|
399
400
|
}
|
|
400
401
|
function makeInfoCommand() {
|
|
401
402
|
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((ref, opts) => {
|
|
402
|
-
const am2 = new AssetManager({ projectDir:
|
|
403
|
+
const am2 = new AssetManager({ projectDir: path16__default.resolve(opts.projectDir) });
|
|
403
404
|
const entry = am2.info(ref);
|
|
404
405
|
if (!entry) {
|
|
405
406
|
logErr(
|
|
@@ -432,7 +433,7 @@ function makeCreateCommand() {
|
|
|
432
433
|
new Option("-k, --kind <kind>", "Asset kind").default("skill").choices([...ASSET_KINDS])
|
|
433
434
|
).option("-d, --dir <dir>", "Target directory (default: cwd)").action((name, opts) => {
|
|
434
435
|
const am2 = new AssetManager({ projectDir: process.cwd() });
|
|
435
|
-
const destDir = opts.dir ?
|
|
436
|
+
const destDir = opts.dir ? path16__default.resolve(opts.dir) : process.cwd();
|
|
436
437
|
const result = am2.create(name, opts.kind, destDir);
|
|
437
438
|
if (result.ok) logOk(`Created ${kindColor(opts.kind)}: ${pc6.dim(result.path)}`);
|
|
438
439
|
else {
|
|
@@ -443,7 +444,7 @@ function makeCreateCommand() {
|
|
|
443
444
|
}
|
|
444
445
|
function makeDoctorCommand() {
|
|
445
446
|
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((name, opts) => {
|
|
446
|
-
const am2 = new AssetManager({ projectDir:
|
|
447
|
+
const am2 = new AssetManager({ projectDir: path16__default.resolve(opts.projectDir) });
|
|
447
448
|
const issues = am2.doctor();
|
|
448
449
|
if (issues.length === 0) {
|
|
449
450
|
logOk("No missing dependencies.");
|
|
@@ -469,11 +470,11 @@ function makeCatalogCommand() {
|
|
|
469
470
|
const catalog = new Command("catalog").description("Catalog source health and configuration");
|
|
470
471
|
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) => {
|
|
471
472
|
const { resolveConfig, isLocalCatalogUrl, trpcGetUrl } = await import('../library/index.js');
|
|
472
|
-
const projectDir = opts.projectDir ?
|
|
473
|
+
const projectDir = opts.projectDir ? path16__default.resolve(opts.projectDir) : void 0;
|
|
473
474
|
const cfg = resolveConfig({ projectDir });
|
|
474
475
|
const baseUrl = opts.url ?? cfg.catalog.url;
|
|
475
476
|
if (isLocalCatalogUrl(baseUrl)) {
|
|
476
|
-
const { resolveCatalogSource } = await import('../open-library-
|
|
477
|
+
const { resolveCatalogSource } = await import('../open-library-S6FK4N4S.js');
|
|
477
478
|
let resolved;
|
|
478
479
|
try {
|
|
479
480
|
resolved = await resolveCatalogSource({ projectDir: opts.projectDir });
|
|
@@ -562,7 +563,7 @@ function makeCatalogCommand() {
|
|
|
562
563
|
});
|
|
563
564
|
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) => {
|
|
564
565
|
const { resolveConfig } = await import('../library/index.js');
|
|
565
|
-
const projectDir = opts.projectDir ?
|
|
566
|
+
const projectDir = opts.projectDir ? path16__default.resolve(opts.projectDir) : void 0;
|
|
566
567
|
const cfg = resolveConfig({ projectDir });
|
|
567
568
|
console.log(`url: ${cfg.catalog.url}`);
|
|
568
569
|
console.log(`framing: ${cfg.catalog.framing}`);
|
|
@@ -619,7 +620,7 @@ function findSkills(domain) {
|
|
|
619
620
|
if (!fs10__default.existsSync(AI_RESOURCES)) return skills;
|
|
620
621
|
const domains = fs10__default.readdirSync(AI_RESOURCES, { withFileTypes: true }).filter((d) => d.isDirectory()).filter((d) => true);
|
|
621
622
|
for (const d of domains) {
|
|
622
|
-
const skillsDir =
|
|
623
|
+
const skillsDir = path16__default.join(AI_RESOURCES, d.name, "skills");
|
|
623
624
|
if (!fs10__default.existsSync(skillsDir)) continue;
|
|
624
625
|
walkSkills(skillsDir, d.name, skills);
|
|
625
626
|
}
|
|
@@ -627,9 +628,9 @@ function findSkills(domain) {
|
|
|
627
628
|
}
|
|
628
629
|
function walkSkills(dir, domain, out) {
|
|
629
630
|
for (const entry of fs10__default.readdirSync(dir, { withFileTypes: true })) {
|
|
630
|
-
const full =
|
|
631
|
+
const full = path16__default.join(dir, entry.name);
|
|
631
632
|
if (entry.isDirectory()) {
|
|
632
|
-
const skillMd =
|
|
633
|
+
const skillMd = path16__default.join(full, "SKILL.md");
|
|
633
634
|
if (fs10__default.existsSync(skillMd)) {
|
|
634
635
|
out.push({ name: entry.name, path: full, skillPath: skillMd, domain });
|
|
635
636
|
} else {
|
|
@@ -655,7 +656,7 @@ function resolveFlowIds() {
|
|
|
655
656
|
}
|
|
656
657
|
}
|
|
657
658
|
function resolveSessionIds(projectDir) {
|
|
658
|
-
const sessionsDir =
|
|
659
|
+
const sessionsDir = path16__default.join(projectDir, ".skaile", "sessions");
|
|
659
660
|
if (!fs10__default.existsSync(sessionsDir)) return [];
|
|
660
661
|
try {
|
|
661
662
|
return fs10__default.readdirSync(sessionsDir).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -".json".length));
|
|
@@ -716,7 +717,7 @@ var API_KEY_PREFIX = "apiKey.";
|
|
|
716
717
|
function makeConfigCommand() {
|
|
717
718
|
const cmd = new Command("config").description("Manage personal config (.skaile/settings.json)");
|
|
718
719
|
cmd.command("show").description("Show effective config with sources").option("--project-dir <path>", "Project directory").action(async (opts) => {
|
|
719
|
-
const projectDir = opts.projectDir ?
|
|
720
|
+
const projectDir = opts.projectDir ? path16__default.resolve(opts.projectDir) : process.cwd();
|
|
720
721
|
const config = await resolveSettings(projectDir);
|
|
721
722
|
const wsDefaults = {};
|
|
722
723
|
try {
|
|
@@ -773,13 +774,13 @@ function makeConfigCommand() {
|
|
|
773
774
|
console.log();
|
|
774
775
|
});
|
|
775
776
|
cmd.command("get <key>").description("Get an effective config value").option("--project-dir <path>", "Project directory").action(async (key, opts) => {
|
|
776
|
-
const projectDir = opts.projectDir ?
|
|
777
|
+
const projectDir = opts.projectDir ? path16__default.resolve(opts.projectDir) : process.cwd();
|
|
777
778
|
const config = await resolveSettings(projectDir);
|
|
778
779
|
const value = config[key];
|
|
779
780
|
console.log(value ?? S.dim("(not set)"));
|
|
780
781
|
});
|
|
781
782
|
cmd.command("set <key> <value>").description("Set a personal config value (driver, model, provider, apiKey.<provider>)").option("--project-dir <path>", "Project directory").option("--global", "Write to ~/.skaile/settings.json instead of project-local").action(async (key, value, opts) => {
|
|
782
|
-
const projectDir = opts.projectDir ?
|
|
783
|
+
const projectDir = opts.projectDir ? path16__default.resolve(opts.projectDir) : process.cwd();
|
|
783
784
|
const isApiKey = key.startsWith(API_KEY_PREFIX);
|
|
784
785
|
if (!PERSONAL_KEYS.has(key) && !isApiKey) {
|
|
785
786
|
logErr(
|
|
@@ -957,13 +958,15 @@ function makeConnectCommand() {
|
|
|
957
958
|
}
|
|
958
959
|
async function connectConnectors(projectDir) {
|
|
959
960
|
const res = await import('../connectors/index.js');
|
|
960
|
-
res.
|
|
961
|
+
res.registerBuiltinConnectors();
|
|
961
962
|
const declarations = res.loadConnectorDeclarations(projectDir);
|
|
962
963
|
if (declarations.length === 0) {
|
|
963
964
|
logErr("No connectors configured. Add connectors to skaile.yaml");
|
|
964
965
|
process.exit(1);
|
|
965
966
|
}
|
|
966
|
-
const manager = new res.ConnectorManager(
|
|
967
|
+
const manager = new res.ConnectorManager(projectDir, {
|
|
968
|
+
secrets: res.createCliSecretProviderChain()
|
|
969
|
+
});
|
|
967
970
|
const report = await manager.connectAll(declarations);
|
|
968
971
|
for (const r of report.results) {
|
|
969
972
|
if (!r.connected) {
|
|
@@ -1084,8 +1087,8 @@ function makeConnectorCommand() {
|
|
|
1084
1087
|
async (driver, opts) => {
|
|
1085
1088
|
const { installNpmPackages } = await import('../connectors/index.js');
|
|
1086
1089
|
const { scanDirectory, resolveBaseAssetsRoot, WorkspaceYamlEditor } = await import('../core/index.js');
|
|
1087
|
-
const projectDir =
|
|
1088
|
-
const yamlPath =
|
|
1090
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
1091
|
+
const yamlPath = path16__default.join(projectDir, "skaile.yaml");
|
|
1089
1092
|
if (!existsSync(yamlPath)) {
|
|
1090
1093
|
logErr("No skaile.yaml found in current directory. Run 'skaile init' first.");
|
|
1091
1094
|
process.exit(1);
|
|
@@ -1148,8 +1151,8 @@ ${installResult.output}`);
|
|
|
1148
1151
|
);
|
|
1149
1152
|
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) => {
|
|
1150
1153
|
const { WorkspaceYamlEditor } = await import('../core/index.js');
|
|
1151
|
-
const projectDir =
|
|
1152
|
-
const yamlPath =
|
|
1154
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
1155
|
+
const yamlPath = path16__default.join(projectDir, "skaile.yaml");
|
|
1153
1156
|
if (!existsSync(yamlPath)) {
|
|
1154
1157
|
logErr("No skaile.yaml found in current directory.");
|
|
1155
1158
|
process.exit(1);
|
|
@@ -1165,8 +1168,8 @@ ${installResult.output}`);
|
|
|
1165
1168
|
});
|
|
1166
1169
|
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) => {
|
|
1167
1170
|
const res = await import('../connectors/index.js');
|
|
1168
|
-
res.
|
|
1169
|
-
const projectDir =
|
|
1171
|
+
res.registerBuiltinConnectors();
|
|
1172
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
1170
1173
|
const declarations = res.loadConnectorDeclarations(projectDir);
|
|
1171
1174
|
if (declarations.length === 0) {
|
|
1172
1175
|
console.log("No connectors configured in skaile.yaml.");
|
|
@@ -1177,8 +1180,9 @@ ${installResult.output}`);
|
|
|
1177
1180
|
logErr(`No connector with id '${id}' found.`);
|
|
1178
1181
|
process.exit(1);
|
|
1179
1182
|
}
|
|
1180
|
-
const
|
|
1181
|
-
|
|
1183
|
+
const manager = new res.ConnectorManager(projectDir, {
|
|
1184
|
+
secrets: res.createCliSecretProviderChain()
|
|
1185
|
+
});
|
|
1182
1186
|
const report = await manager.connectAll(targets);
|
|
1183
1187
|
for (const r of report.results) {
|
|
1184
1188
|
const symbol = r.connected ? "\u2713" : "\u2717";
|
|
@@ -1189,7 +1193,7 @@ ${installResult.output}`);
|
|
|
1189
1193
|
await manager.disconnectAll();
|
|
1190
1194
|
});
|
|
1191
1195
|
cmd.command("list").description("List all configured connectors").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
|
|
1192
|
-
const projectDir =
|
|
1196
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
1193
1197
|
const manager = await connectConnectors(projectDir);
|
|
1194
1198
|
try {
|
|
1195
1199
|
console.log(JSON.stringify(manager.listConnectors(), null, 2));
|
|
@@ -1197,8 +1201,32 @@ ${installResult.output}`);
|
|
|
1197
1201
|
await manager.disconnectAll();
|
|
1198
1202
|
}
|
|
1199
1203
|
});
|
|
1204
|
+
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) => {
|
|
1205
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
1206
|
+
const manager = await connectConnectors(projectDir);
|
|
1207
|
+
try {
|
|
1208
|
+
if (opts.all) {
|
|
1209
|
+
const results = await manager.syncAll();
|
|
1210
|
+
console.log(JSON.stringify(results, null, 2));
|
|
1211
|
+
} else if (id) {
|
|
1212
|
+
if (!manager.has(id)) {
|
|
1213
|
+
logErr(
|
|
1214
|
+
`Unknown connector: "${id}". Available: ${manager.listConnectors().map((r) => r.id).join(", ")}`
|
|
1215
|
+
);
|
|
1216
|
+
process.exit(1);
|
|
1217
|
+
}
|
|
1218
|
+
const result = await manager.sync(id);
|
|
1219
|
+
console.log(JSON.stringify(result, null, 2));
|
|
1220
|
+
} else {
|
|
1221
|
+
logErr("Provide a connector ID or use --all");
|
|
1222
|
+
process.exit(1);
|
|
1223
|
+
}
|
|
1224
|
+
} finally {
|
|
1225
|
+
await manager.disconnectAll();
|
|
1226
|
+
}
|
|
1227
|
+
});
|
|
1200
1228
|
cmd.command("ops <id>").description("List available operations for a connector").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, opts) => {
|
|
1201
|
-
const projectDir =
|
|
1229
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
1202
1230
|
const manager = await connectConnectors(projectDir);
|
|
1203
1231
|
try {
|
|
1204
1232
|
if (!manager.has(id)) {
|
|
@@ -1213,7 +1241,7 @@ ${installResult.output}`);
|
|
|
1213
1241
|
}
|
|
1214
1242
|
});
|
|
1215
1243
|
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) => {
|
|
1216
|
-
const projectDir =
|
|
1244
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
1217
1245
|
const manager = await connectConnectors(projectDir);
|
|
1218
1246
|
try {
|
|
1219
1247
|
const content = await manager.read(id, resourcePath);
|
|
@@ -1223,7 +1251,7 @@ ${installResult.output}`);
|
|
|
1223
1251
|
}
|
|
1224
1252
|
});
|
|
1225
1253
|
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) => {
|
|
1226
|
-
const projectDir =
|
|
1254
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
1227
1255
|
const manager = await connectConnectors(projectDir);
|
|
1228
1256
|
try {
|
|
1229
1257
|
await manager.write(id, resourcePath, { data: content });
|
|
@@ -1233,7 +1261,7 @@ ${installResult.output}`);
|
|
|
1233
1261
|
}
|
|
1234
1262
|
});
|
|
1235
1263
|
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", parseInt).action(async (id, resourcePath, opts) => {
|
|
1236
|
-
const projectDir =
|
|
1264
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
1237
1265
|
const manager = await connectConnectors(projectDir);
|
|
1238
1266
|
try {
|
|
1239
1267
|
const entries = await manager.list(id, resourcePath, {
|
|
@@ -1246,7 +1274,7 @@ ${installResult.output}`);
|
|
|
1246
1274
|
}
|
|
1247
1275
|
});
|
|
1248
1276
|
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) => {
|
|
1249
|
-
const projectDir =
|
|
1277
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
1250
1278
|
const manager = await connectConnectors(projectDir);
|
|
1251
1279
|
try {
|
|
1252
1280
|
const results = await manager.search(id, query);
|
|
@@ -1256,7 +1284,7 @@ ${installResult.output}`);
|
|
|
1256
1284
|
}
|
|
1257
1285
|
});
|
|
1258
1286
|
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) => {
|
|
1259
|
-
const projectDir =
|
|
1287
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
1260
1288
|
const manager = await connectConnectors(projectDir);
|
|
1261
1289
|
try {
|
|
1262
1290
|
const ok = await manager.delete(id, resourcePath);
|
|
@@ -1266,7 +1294,7 @@ ${installResult.output}`);
|
|
|
1266
1294
|
}
|
|
1267
1295
|
});
|
|
1268
1296
|
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) => {
|
|
1269
|
-
const projectDir =
|
|
1297
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
1270
1298
|
const manager = await connectConnectors(projectDir);
|
|
1271
1299
|
try {
|
|
1272
1300
|
if (!manager.has(id)) {
|
|
@@ -1357,7 +1385,7 @@ function makeDebugCommand() {
|
|
|
1357
1385
|
}
|
|
1358
1386
|
function makeDiffCommand() {
|
|
1359
1387
|
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((ref, opts) => {
|
|
1360
|
-
const am2 = new AssetManager({ projectDir:
|
|
1388
|
+
const am2 = new AssetManager({ projectDir: path16__default.resolve(opts.projectDir) });
|
|
1361
1389
|
const result = am2.diff(ref);
|
|
1362
1390
|
if (result === null) {
|
|
1363
1391
|
logInfo("No differences (or asset not found).");
|
|
@@ -1410,7 +1438,7 @@ function makeFlowCommand() {
|
|
|
1410
1438
|
function makeHistoryCommand() {
|
|
1411
1439
|
const cmd = new Command("history").description("Show recent add/remove/update actions");
|
|
1412
1440
|
cmd.argument("[limit]", "Number of entries to show", "20").option("--project-dir <path>", "Project directory", process.cwd()).action((limitStr, opts) => {
|
|
1413
|
-
const am2 = new AssetManager({ projectDir:
|
|
1441
|
+
const am2 = new AssetManager({ projectDir: path16__default.resolve(opts.projectDir) });
|
|
1414
1442
|
const limit = parseInt(limitStr, 10) || 20;
|
|
1415
1443
|
const entries = am2.history(limit);
|
|
1416
1444
|
if (entries.length === 0) {
|
|
@@ -1430,7 +1458,7 @@ function makeHistoryCommand() {
|
|
|
1430
1458
|
console.log();
|
|
1431
1459
|
});
|
|
1432
1460
|
cmd.command("clear").description("Clear action history").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
1433
|
-
const am2 = new AssetManager({ projectDir:
|
|
1461
|
+
const am2 = new AssetManager({ projectDir: path16__default.resolve(opts.projectDir) });
|
|
1434
1462
|
am2.clearHistory();
|
|
1435
1463
|
logOk("History cleared.");
|
|
1436
1464
|
});
|
|
@@ -1521,7 +1549,7 @@ function makeLibraryCommand() {
|
|
|
1521
1549
|
cmd.command("init <name>").description("Create a new local library at ~/.skaile/libraries/<name>").option("--git <url>", "Initialize as a git library tracking <url>").option("--store <url>", "Initialize as a store library at <url>").option("--owner", "Mark as owner (default for local; probe-overrides for git)").option("--contributor", "Mark as contributor").option("--reader", "Mark as reader").action(
|
|
1522
1550
|
async (name, opts) => {
|
|
1523
1551
|
const libDir = resolveLibraryDir();
|
|
1524
|
-
const libPath =
|
|
1552
|
+
const libPath = path16.join(libDir, name);
|
|
1525
1553
|
const ownership = opts.contributor ? "contributor" : opts.reader ? "reader" : "owner";
|
|
1526
1554
|
const { manager, close } = await openUserLibraryManager();
|
|
1527
1555
|
try {
|
|
@@ -1562,7 +1590,7 @@ function makeLibraryCommand() {
|
|
|
1562
1590
|
async (url, opts) => {
|
|
1563
1591
|
const derived = opts.name ?? url.replace(/\.git$/, "").split(/[/:]/).pop() ?? "library";
|
|
1564
1592
|
const libDir = resolveLibraryDir();
|
|
1565
|
-
const libPath =
|
|
1593
|
+
const libPath = path16.join(libDir, derived);
|
|
1566
1594
|
const { spawnSync } = await import('child_process');
|
|
1567
1595
|
const clone = spawnSync("git", ["clone", url, libPath], { stdio: "inherit" });
|
|
1568
1596
|
if (clone.status !== 0) {
|
|
@@ -1608,8 +1636,8 @@ function makeLibraryCommand() {
|
|
|
1608
1636
|
const { manager, close } = await openUserLibraryManager();
|
|
1609
1637
|
try {
|
|
1610
1638
|
const lib = await manager.requireLibrary(oldName);
|
|
1611
|
-
const parent =
|
|
1612
|
-
const newPath =
|
|
1639
|
+
const parent = path16.dirname(lib.path);
|
|
1640
|
+
const newPath = path16.join(parent, newName);
|
|
1613
1641
|
if (fs10.existsSync(newPath)) {
|
|
1614
1642
|
logErr(`Target directory already exists: ${newPath}`);
|
|
1615
1643
|
process.exit(1);
|
|
@@ -1772,9 +1800,9 @@ function makeLibraryStatusCommand() {
|
|
|
1772
1800
|
} catch {
|
|
1773
1801
|
secretsStrategy = "unavailable";
|
|
1774
1802
|
}
|
|
1775
|
-
const projectDir =
|
|
1776
|
-
const hasWorkspaceConfig = existsSync(
|
|
1777
|
-
const hasLockFile = existsSync(
|
|
1803
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
1804
|
+
const hasWorkspaceConfig = existsSync(path16__default.join(projectDir, "skaile.yaml"));
|
|
1805
|
+
const hasLockFile = existsSync(path16__default.join(projectDir, "skaile.lock.yaml"));
|
|
1778
1806
|
let subscriptions = [];
|
|
1779
1807
|
if (hasWorkspaceConfig) {
|
|
1780
1808
|
try {
|
|
@@ -1881,26 +1909,18 @@ function colorLine(line) {
|
|
|
1881
1909
|
return line;
|
|
1882
1910
|
}
|
|
1883
1911
|
function dockerAvailable() {
|
|
1884
|
-
|
|
1885
|
-
const result = Bun.spawnSync(["docker", "info"], { stdout: "pipe", stderr: "pipe" });
|
|
1886
|
-
return result.exitCode === 0;
|
|
1887
|
-
} catch {
|
|
1888
|
-
return false;
|
|
1889
|
-
}
|
|
1912
|
+
return portableSpawnSync(["docker", "info"]).exitCode === 0;
|
|
1890
1913
|
}
|
|
1891
1914
|
function listContainers() {
|
|
1892
|
-
const result =
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
{ stdout: "pipe", stderr: "pipe" }
|
|
1902
|
-
);
|
|
1903
|
-
return parseContainers(result.stdout.toString());
|
|
1915
|
+
const result = portableSpawnSync([
|
|
1916
|
+
"docker",
|
|
1917
|
+
"ps",
|
|
1918
|
+
"--filter",
|
|
1919
|
+
"label=skaile.managed=true",
|
|
1920
|
+
"--format",
|
|
1921
|
+
'{{.Names}} {{.Label "skaile.project-slug"}} {{.Status}} {{.CreatedAt}}'
|
|
1922
|
+
]);
|
|
1923
|
+
return parseContainers(result.stdout);
|
|
1904
1924
|
}
|
|
1905
1925
|
function makeLogsCommand() {
|
|
1906
1926
|
return new Command("logs").description("Tail logs from skaile Docker agent containers").option("--follow", "Follow log output (like tail -f)").option("--lines <n>", "Number of lines to show", "50").option("--filter <pattern>", "Filter log lines (regex)").option("--project <slug>", "Filter by project slug").option("--list", "List running skaile containers instead of showing logs").action(
|
|
@@ -1950,7 +1970,7 @@ function makeLogsCommand() {
|
|
|
1950
1970
|
if (opts.follow) args.push("--follow");
|
|
1951
1971
|
args.push(target.name);
|
|
1952
1972
|
if (opts.follow) {
|
|
1953
|
-
const proc =
|
|
1973
|
+
const proc = portableSpawn(args);
|
|
1954
1974
|
async function pipeStream(stream) {
|
|
1955
1975
|
const decoder = new TextDecoder();
|
|
1956
1976
|
const reader = stream.getReader();
|
|
@@ -1977,8 +1997,8 @@ function makeLogsCommand() {
|
|
|
1977
1997
|
}
|
|
1978
1998
|
await Promise.all([pipeStream(proc.stdout), pipeStream(proc.stderr)]);
|
|
1979
1999
|
} else {
|
|
1980
|
-
const result =
|
|
1981
|
-
const combined = result.stdout
|
|
2000
|
+
const result = portableSpawnSync(args);
|
|
2001
|
+
const combined = result.stdout + result.stderr;
|
|
1982
2002
|
const lines = combined.split("\n");
|
|
1983
2003
|
for (const line of lines) {
|
|
1984
2004
|
if (!line) continue;
|
|
@@ -2123,7 +2143,7 @@ function loadAssets() {
|
|
|
2123
2143
|
}
|
|
2124
2144
|
async function loadLibraries() {
|
|
2125
2145
|
try {
|
|
2126
|
-
const { openUserLibraryManager: openUserLibraryManager2 } = await import('../open-library-
|
|
2146
|
+
const { openUserLibraryManager: openUserLibraryManager2 } = await import('../open-library-S6FK4N4S.js');
|
|
2127
2147
|
const { manager, library, close } = await openUserLibraryManager2();
|
|
2128
2148
|
try {
|
|
2129
2149
|
const libs = await manager.listLibraries();
|
|
@@ -2581,13 +2601,13 @@ async function run(projectDir) {
|
|
|
2581
2601
|
}
|
|
2582
2602
|
function makeManageCommand() {
|
|
2583
2603
|
return new Command("manage").description("Interactive TUI for managing libraries and assets").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
2584
|
-
await run(
|
|
2604
|
+
await run(path16__default.resolve(opts.projectDir));
|
|
2585
2605
|
});
|
|
2586
2606
|
}
|
|
2587
2607
|
function makeMcpServerCommand() {
|
|
2588
2608
|
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) => {
|
|
2589
|
-
const
|
|
2590
|
-
const projectDir =
|
|
2609
|
+
const path32 = await import('path');
|
|
2610
|
+
const projectDir = path32.default.resolve(opts.projectDir);
|
|
2591
2611
|
const { LogStore, StdoutSink, registerLogStore } = await import('../core/logging.js');
|
|
2592
2612
|
registerLogStore(
|
|
2593
2613
|
new LogStore({
|
|
@@ -2618,60 +2638,11 @@ function makeMcpServerCommand() {
|
|
|
2618
2638
|
await plugin.runMcpServerStdio();
|
|
2619
2639
|
});
|
|
2620
2640
|
}
|
|
2621
|
-
async function connectMounts(projectDir) {
|
|
2622
|
-
const res = await import('../connectors/index.js');
|
|
2623
|
-
res.registerBuiltinMountDrivers();
|
|
2624
|
-
const declarations = res.loadMountDeclarations(projectDir);
|
|
2625
|
-
if (declarations.length === 0) {
|
|
2626
|
-
logErr("No mounts configured. Add mounts to skaile.yaml");
|
|
2627
|
-
process.exit(1);
|
|
2628
|
-
}
|
|
2629
|
-
const manager = new res.MountManager(projectDir);
|
|
2630
|
-
const report = await manager.mountAll(declarations);
|
|
2631
|
-
for (const r of report.results) {
|
|
2632
|
-
if (!r.mounted) {
|
|
2633
|
-
console.error(`Warning: Mount "${r.id}" failed to mount: ${r.error}`);
|
|
2634
|
-
}
|
|
2635
|
-
}
|
|
2636
|
-
return manager;
|
|
2637
|
-
}
|
|
2638
|
-
function makeMountCommand() {
|
|
2639
|
-
const cmd = new Command("mounts").description("Operate on mounts in a workspace");
|
|
2640
|
-
cmd.command("list").description("List all configured mounts").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
|
|
2641
|
-
const projectDir = path17__default.resolve(opts.projectDir);
|
|
2642
|
-
const manager = await connectMounts(projectDir);
|
|
2643
|
-
try {
|
|
2644
|
-
console.log(JSON.stringify(manager.listMounts(), null, 2));
|
|
2645
|
-
} finally {
|
|
2646
|
-
await manager.unmountAll();
|
|
2647
|
-
}
|
|
2648
|
-
});
|
|
2649
|
-
cmd.command("sync [id]").description("Re-sync a mount or all mounts").option("--all", "Sync all mounts").option("--project-dir <path>", "Workspace directory", process.cwd()).action(async (id, opts) => {
|
|
2650
|
-
const projectDir = path17__default.resolve(opts.projectDir);
|
|
2651
|
-
const manager = await connectMounts(projectDir);
|
|
2652
|
-
try {
|
|
2653
|
-
if (opts.all) {
|
|
2654
|
-
await manager.syncAll();
|
|
2655
|
-
console.log("All mounts synced.");
|
|
2656
|
-
} else if (id) {
|
|
2657
|
-
const result = await manager.sync(id);
|
|
2658
|
-
console.log(JSON.stringify(result, null, 2));
|
|
2659
|
-
} else {
|
|
2660
|
-
logErr("Provide a mount ID or use --all");
|
|
2661
|
-
process.exit(1);
|
|
2662
|
-
}
|
|
2663
|
-
} finally {
|
|
2664
|
-
await manager.unmountAll();
|
|
2665
|
-
}
|
|
2666
|
-
});
|
|
2667
|
-
cmd.action(() => cmd.help());
|
|
2668
|
-
return cmd;
|
|
2669
|
-
}
|
|
2670
2641
|
function makeNpxCommand() {
|
|
2671
2642
|
const npx = new Command("npx").description("Compatibility shim for npx skills syntax");
|
|
2672
2643
|
const skills = npx.command("skills").description("Skill installation from external repos");
|
|
2673
2644
|
skills.command("add <url>").description("Register a repo as a Library Source and install a skill from it").requiredOption("--skill <name>", "Skill name to install from the repo").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", "Agent framework", "claude-code").option("--global", "Deploy globally").action(async (url, opts) => {
|
|
2674
|
-
const projectDir =
|
|
2645
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
2675
2646
|
const spinner5 = p5.spinner();
|
|
2676
2647
|
let sourcePath;
|
|
2677
2648
|
const isUrl = /^(https?:|git@|git:)/.test(url);
|
|
@@ -2682,14 +2653,14 @@ function makeNpxCommand() {
|
|
|
2682
2653
|
if (!existsSync(sourcePath)) {
|
|
2683
2654
|
execSync(`git clone ${url} ${sourcePath}`, { stdio: "ignore" });
|
|
2684
2655
|
}
|
|
2685
|
-
spinner5.stop(`Cloned to ${
|
|
2656
|
+
spinner5.stop(`Cloned to ${path16__default.basename(sourcePath)}`);
|
|
2686
2657
|
} catch (err) {
|
|
2687
2658
|
spinner5.stop("Clone failed");
|
|
2688
2659
|
logErr(err instanceof Error ? err.message : String(err));
|
|
2689
2660
|
process.exit(1);
|
|
2690
2661
|
}
|
|
2691
2662
|
} else {
|
|
2692
|
-
sourcePath =
|
|
2663
|
+
sourcePath = path16__default.resolve(url);
|
|
2693
2664
|
if (!existsSync(sourcePath)) {
|
|
2694
2665
|
logErr(`Path does not exist: ${sourcePath}`);
|
|
2695
2666
|
process.exit(1);
|
|
@@ -2702,7 +2673,7 @@ function makeNpxCommand() {
|
|
|
2702
2673
|
if (!source) {
|
|
2703
2674
|
source = await library.addSource({
|
|
2704
2675
|
type: "local",
|
|
2705
|
-
name:
|
|
2676
|
+
name: path16__default.basename(sourcePath),
|
|
2706
2677
|
path: sourcePath
|
|
2707
2678
|
});
|
|
2708
2679
|
}
|
|
@@ -2742,7 +2713,7 @@ function makeNpxCommand() {
|
|
|
2742
2713
|
}
|
|
2743
2714
|
function cloneDestination(url) {
|
|
2744
2715
|
const cleaned = url.replace(/\.git$/, "");
|
|
2745
|
-
const root =
|
|
2716
|
+
const root = path16__default.join(homedir(), ".skaile", "clones");
|
|
2746
2717
|
let host = "unknown";
|
|
2747
2718
|
let pathPart = cleaned;
|
|
2748
2719
|
const httpMatch = cleaned.match(/^https?:\/\/([^/]+)\/(.+)$/);
|
|
@@ -2758,14 +2729,14 @@ function cloneDestination(url) {
|
|
|
2758
2729
|
host = gitProtoMatch[1];
|
|
2759
2730
|
pathPart = gitProtoMatch[2];
|
|
2760
2731
|
}
|
|
2761
|
-
return
|
|
2732
|
+
return path16__default.join(root, host, pathPart);
|
|
2762
2733
|
}
|
|
2763
2734
|
function makeOutdatedCommand() {
|
|
2764
2735
|
return new Command("outdated").description("Check for assets behind their repo").argument("[name]", "Check a specific asset (kind:name)").option("--project-dir <path>", "Project directory", process.cwd()).addOption(
|
|
2765
2736
|
new Option("--target <agent>", "Driver target").default("claude-code").choices(SUPPORTED_DRIVER_TARGETS)
|
|
2766
2737
|
).action((name, opts) => {
|
|
2767
2738
|
const am2 = new AssetManager({
|
|
2768
|
-
projectDir:
|
|
2739
|
+
projectDir: path16__default.resolve(opts.projectDir),
|
|
2769
2740
|
driverTarget: opts.target
|
|
2770
2741
|
});
|
|
2771
2742
|
const entries = am2.outdated();
|
|
@@ -2794,7 +2765,7 @@ function makeOutdatedCommand() {
|
|
|
2794
2765
|
function makePatchCommand() {
|
|
2795
2766
|
const cmd = new Command("patch").description("Patch workflow for skill improvement");
|
|
2796
2767
|
cmd.command("extract <ref>").alias("start").description("Extract asset for local editing").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
|
|
2797
|
-
const am2 = new AssetManager({ projectDir:
|
|
2768
|
+
const am2 = new AssetManager({ projectDir: path16__default.resolve(opts.projectDir) });
|
|
2798
2769
|
try {
|
|
2799
2770
|
const dest = am2.patch(ref);
|
|
2800
2771
|
logOk(`Extracted to ${S.dim(dest)}`);
|
|
@@ -2805,7 +2776,7 @@ function makePatchCommand() {
|
|
|
2805
2776
|
}
|
|
2806
2777
|
});
|
|
2807
2778
|
cmd.command("commit <ref>").description("Generate .patch file from edits").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
|
|
2808
|
-
const am2 = new AssetManager({ projectDir:
|
|
2779
|
+
const am2 = new AssetManager({ projectDir: path16__default.resolve(opts.projectDir) });
|
|
2809
2780
|
try {
|
|
2810
2781
|
const patchFile = am2.patchCommit(ref);
|
|
2811
2782
|
logOk(`Patch saved to ${S.dim(patchFile)}`);
|
|
@@ -2816,7 +2787,7 @@ function makePatchCommand() {
|
|
|
2816
2787
|
}
|
|
2817
2788
|
});
|
|
2818
2789
|
cmd.command("submit <ref>").description("Apply patch to repo clone and prepare for PR").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
|
|
2819
|
-
const am2 = new AssetManager({ projectDir:
|
|
2790
|
+
const am2 = new AssetManager({ projectDir: path16__default.resolve(opts.projectDir) });
|
|
2820
2791
|
try {
|
|
2821
2792
|
am2.patchSubmit(ref);
|
|
2822
2793
|
logOk("Patch applied to repo clone and committed.");
|
|
@@ -2829,7 +2800,7 @@ function makePatchCommand() {
|
|
|
2829
2800
|
}
|
|
2830
2801
|
});
|
|
2831
2802
|
cmd.command("remove <ref>").description("Remove local patch after upstream merge").option("--project-dir <path>", "Project directory", process.cwd()).action((ref, opts) => {
|
|
2832
|
-
const am2 = new AssetManager({ projectDir:
|
|
2803
|
+
const am2 = new AssetManager({ projectDir: path16__default.resolve(opts.projectDir) });
|
|
2833
2804
|
am2.patchRemove(ref);
|
|
2834
2805
|
logOk(`Patch removed for ${ref}`);
|
|
2835
2806
|
});
|
|
@@ -2843,7 +2814,7 @@ var MCP_SERVER_ENTRY = {
|
|
|
2843
2814
|
env: {}
|
|
2844
2815
|
};
|
|
2845
2816
|
function pluginDir(projectDir) {
|
|
2846
|
-
return
|
|
2817
|
+
return path16__default.join(projectDir, ".claude", "plugins", "skaile");
|
|
2847
2818
|
}
|
|
2848
2819
|
async function readJsonStrict(p7) {
|
|
2849
2820
|
let raw;
|
|
@@ -2861,7 +2832,7 @@ async function readJsonStrict(p7) {
|
|
|
2861
2832
|
}
|
|
2862
2833
|
}
|
|
2863
2834
|
async function writeJson(p7, value) {
|
|
2864
|
-
await fs5.mkdir(
|
|
2835
|
+
await fs5.mkdir(path16__default.dirname(p7), { recursive: true });
|
|
2865
2836
|
await fs5.writeFile(p7, `${JSON.stringify(value, null, 2)}
|
|
2866
2837
|
`);
|
|
2867
2838
|
}
|
|
@@ -2869,8 +2840,8 @@ async function copyDir(src, dest) {
|
|
|
2869
2840
|
await fs5.mkdir(dest, { recursive: true });
|
|
2870
2841
|
const entries = await fs5.readdir(src, { withFileTypes: true });
|
|
2871
2842
|
for (const entry of entries) {
|
|
2872
|
-
const srcPath =
|
|
2873
|
-
const destPath =
|
|
2843
|
+
const srcPath = path16__default.join(src, entry.name);
|
|
2844
|
+
const destPath = path16__default.join(dest, entry.name);
|
|
2874
2845
|
if (entry.isDirectory()) await copyDir(srcPath, destPath);
|
|
2875
2846
|
else await fs5.copyFile(srcPath, destPath);
|
|
2876
2847
|
}
|
|
@@ -2879,14 +2850,14 @@ async function install(projectDir, opts) {
|
|
|
2879
2850
|
return opts?.full ? installFullPlugin(projectDir) : installMcp(projectDir);
|
|
2880
2851
|
}
|
|
2881
2852
|
async function installMcp(projectDir) {
|
|
2882
|
-
const mcpPath =
|
|
2853
|
+
const mcpPath = path16__default.join(projectDir, ".claude", "mcp.json");
|
|
2883
2854
|
const existing = await readJsonStrict(mcpPath) ?? {};
|
|
2884
2855
|
const mcpServers = { ...existing.mcpServers ?? {} };
|
|
2885
2856
|
const previous = mcpServers[SKAILE_MCP_NAME];
|
|
2886
2857
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(MCP_SERVER_ENTRY);
|
|
2887
2858
|
let warning;
|
|
2888
2859
|
if (previous && !matches) {
|
|
2889
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${
|
|
2860
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME} entry in ${path16__default.relative(projectDir, mcpPath)}`;
|
|
2890
2861
|
}
|
|
2891
2862
|
mcpServers[SKAILE_MCP_NAME] = MCP_SERVER_ENTRY;
|
|
2892
2863
|
await writeJson(mcpPath, { ...existing, mcpServers });
|
|
@@ -2895,15 +2866,15 @@ async function installMcp(projectDir) {
|
|
|
2895
2866
|
async function installFullPlugin(projectDir) {
|
|
2896
2867
|
const dir = pluginDir(projectDir);
|
|
2897
2868
|
for (const [rel, content] of Object.entries(buildClaudePluginFiles())) {
|
|
2898
|
-
const dest =
|
|
2899
|
-
await fs5.mkdir(
|
|
2869
|
+
const dest = path16__default.join(dir, rel);
|
|
2870
|
+
await fs5.mkdir(path16__default.dirname(dest), { recursive: true });
|
|
2900
2871
|
await fs5.writeFile(dest, content);
|
|
2901
2872
|
}
|
|
2902
|
-
const projectSkillsDir =
|
|
2873
|
+
const projectSkillsDir = path16__default.join(projectDir, ".skaile", "skills");
|
|
2903
2874
|
if (existsSync(projectSkillsDir)) {
|
|
2904
|
-
await copyDir(projectSkillsDir,
|
|
2875
|
+
await copyDir(projectSkillsDir, path16__default.join(dir, "skills"));
|
|
2905
2876
|
}
|
|
2906
|
-
const settingsPath =
|
|
2877
|
+
const settingsPath = path16__default.join(projectDir, ".claude", "settings.json");
|
|
2907
2878
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2908
2879
|
const plugins = settings.plugins ?? [];
|
|
2909
2880
|
if (!plugins.includes(dir)) plugins.push(dir);
|
|
@@ -2911,8 +2882,8 @@ async function installFullPlugin(projectDir) {
|
|
|
2911
2882
|
return { changed: true, method: "plugin" };
|
|
2912
2883
|
}
|
|
2913
2884
|
async function uninstall(projectDir) {
|
|
2914
|
-
const settingsPath =
|
|
2915
|
-
const mcpPath =
|
|
2885
|
+
const settingsPath = path16__default.join(projectDir, ".claude", "settings.json");
|
|
2886
|
+
const mcpPath = path16__default.join(projectDir, ".claude", "mcp.json");
|
|
2916
2887
|
const dir = pluginDir(projectDir);
|
|
2917
2888
|
let changed = false;
|
|
2918
2889
|
const settings = await readJsonStrict(settingsPath);
|
|
@@ -2946,12 +2917,12 @@ async function uninstall(projectDir) {
|
|
|
2946
2917
|
async function detectInstall(projectDir) {
|
|
2947
2918
|
const dir = pluginDir(projectDir);
|
|
2948
2919
|
const settings = await readJsonStrict(
|
|
2949
|
-
|
|
2920
|
+
path16__default.join(projectDir, ".claude", "settings.json")
|
|
2950
2921
|
);
|
|
2951
|
-
if (existsSync(
|
|
2922
|
+
if (existsSync(path16__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir)) {
|
|
2952
2923
|
return { method: "plugin", pluginPath: dir };
|
|
2953
2924
|
}
|
|
2954
|
-
const mcp = await readJsonStrict(
|
|
2925
|
+
const mcp = await readJsonStrict(path16__default.join(projectDir, ".claude", "mcp.json"));
|
|
2955
2926
|
if (mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers) {
|
|
2956
2927
|
return { method: "mcp" };
|
|
2957
2928
|
}
|
|
@@ -2960,7 +2931,7 @@ async function detectInstall(projectDir) {
|
|
|
2960
2931
|
async function enable(projectDir) {
|
|
2961
2932
|
const detected = await detectInstall(projectDir);
|
|
2962
2933
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2963
|
-
const settingsPath =
|
|
2934
|
+
const settingsPath = path16__default.join(projectDir, ".claude", "settings.json");
|
|
2964
2935
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2965
2936
|
if (detected.method === "plugin") {
|
|
2966
2937
|
const disabled2 = settings.disabledPlugins ?? [];
|
|
@@ -2982,7 +2953,7 @@ async function enable(projectDir) {
|
|
|
2982
2953
|
async function disable(projectDir) {
|
|
2983
2954
|
const detected = await detectInstall(projectDir);
|
|
2984
2955
|
if (!detected) throw new Error("plugin not installed for claude-code");
|
|
2985
|
-
const settingsPath =
|
|
2956
|
+
const settingsPath = path16__default.join(projectDir, ".claude", "settings.json");
|
|
2986
2957
|
const settings = await readJsonStrict(settingsPath) ?? {};
|
|
2987
2958
|
if (detected.method === "plugin") {
|
|
2988
2959
|
const list2 = settings.disabledPlugins ?? [];
|
|
@@ -3002,12 +2973,12 @@ async function disable(projectDir) {
|
|
|
3002
2973
|
return { changed: true };
|
|
3003
2974
|
}
|
|
3004
2975
|
async function status(projectDir) {
|
|
3005
|
-
const settingsPath =
|
|
3006
|
-
const mcpPath =
|
|
2976
|
+
const settingsPath = path16__default.join(projectDir, ".claude", "settings.json");
|
|
2977
|
+
const mcpPath = path16__default.join(projectDir, ".claude", "mcp.json");
|
|
3007
2978
|
const dir = pluginDir(projectDir);
|
|
3008
2979
|
const settings = await readJsonStrict(settingsPath);
|
|
3009
2980
|
const mcp = await readJsonStrict(mcpPath);
|
|
3010
|
-
const pluginInstalled = !!(existsSync(
|
|
2981
|
+
const pluginInstalled = !!(existsSync(path16__default.join(dir, ".claude-plugin", "plugin.json")) && settings?.plugins?.includes(dir));
|
|
3011
2982
|
const mcpInstalled = !!(mcp?.mcpServers && SKAILE_MCP_NAME in mcp.mcpServers);
|
|
3012
2983
|
if (!pluginInstalled && !mcpInstalled) {
|
|
3013
2984
|
return {
|
|
@@ -3025,7 +2996,7 @@ async function status(projectDir) {
|
|
|
3025
2996
|
installed: "yes",
|
|
3026
2997
|
enabled: disabled2 ? "no" : "yes",
|
|
3027
2998
|
method: "plugin",
|
|
3028
|
-
location:
|
|
2999
|
+
location: path16__default.relative(projectDir, dir)
|
|
3029
3000
|
};
|
|
3030
3001
|
}
|
|
3031
3002
|
const disabled = settings?.disabledMcpjsonServers?.includes(SKAILE_MCP_NAME) ?? false;
|
|
@@ -3034,7 +3005,7 @@ async function status(projectDir) {
|
|
|
3034
3005
|
installed: "yes",
|
|
3035
3006
|
enabled: disabled ? "no" : "yes",
|
|
3036
3007
|
method: "mcp",
|
|
3037
|
-
location:
|
|
3008
|
+
location: path16__default.relative(projectDir, mcpPath)
|
|
3038
3009
|
};
|
|
3039
3010
|
}
|
|
3040
3011
|
var SKAILE_MCP_NAME2 = "skaile-workspace";
|
|
@@ -3061,7 +3032,7 @@ async function readConfig(p7) {
|
|
|
3061
3032
|
}
|
|
3062
3033
|
}
|
|
3063
3034
|
async function writeConfig(p7, value) {
|
|
3064
|
-
await fs5.mkdir(
|
|
3035
|
+
await fs5.mkdir(path16__default.dirname(p7), { recursive: true });
|
|
3065
3036
|
const cleaned = {};
|
|
3066
3037
|
for (const [k, v] of Object.entries(value)) {
|
|
3067
3038
|
if (v === void 0) continue;
|
|
@@ -3070,7 +3041,7 @@ async function writeConfig(p7, value) {
|
|
|
3070
3041
|
await fs5.writeFile(p7, stringify(cleaned));
|
|
3071
3042
|
}
|
|
3072
3043
|
function configPath(projectDir) {
|
|
3073
|
-
return
|
|
3044
|
+
return path16__default.join(projectDir, ".codex", "config.toml");
|
|
3074
3045
|
}
|
|
3075
3046
|
async function install2(projectDir) {
|
|
3076
3047
|
const p7 = configPath(projectDir);
|
|
@@ -3081,7 +3052,7 @@ async function install2(projectDir) {
|
|
|
3081
3052
|
const matches = previous && JSON.stringify(previous) === JSON.stringify(next);
|
|
3082
3053
|
let warning;
|
|
3083
3054
|
if (previous && !matches) {
|
|
3084
|
-
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${
|
|
3055
|
+
warning = `overwrote existing ${SKAILE_MCP_NAME2} entry in ${path16__default.relative(projectDir, p7)}`;
|
|
3085
3056
|
}
|
|
3086
3057
|
if (matches) return { changed: false, method: "toml" };
|
|
3087
3058
|
servers[SKAILE_MCP_NAME2] = next;
|
|
@@ -3122,12 +3093,12 @@ async function status2(projectDir) {
|
|
|
3122
3093
|
installed: "yes",
|
|
3123
3094
|
enabled: "n/a",
|
|
3124
3095
|
method: "mcp",
|
|
3125
|
-
location:
|
|
3096
|
+
location: path16__default.relative(projectDir, p7)
|
|
3126
3097
|
};
|
|
3127
3098
|
}
|
|
3128
3099
|
async function install3(projectDir) {
|
|
3129
|
-
const extDir =
|
|
3130
|
-
const extPath =
|
|
3100
|
+
const extDir = path16__default.join(projectDir, ".omp", "extensions");
|
|
3101
|
+
const extPath = path16__default.join(extDir, "skaile.ts");
|
|
3131
3102
|
await fs5.mkdir(extDir, { recursive: true });
|
|
3132
3103
|
const { WorkspacePlugin } = await import('../workspace-plugin/index.js');
|
|
3133
3104
|
const plugin = new WorkspacePlugin({ projectDir });
|
|
@@ -3142,7 +3113,7 @@ async function install3(projectDir) {
|
|
|
3142
3113
|
return { changed: true, method: "generated" };
|
|
3143
3114
|
}
|
|
3144
3115
|
async function uninstall3(projectDir) {
|
|
3145
|
-
const extPath =
|
|
3116
|
+
const extPath = path16__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
3146
3117
|
try {
|
|
3147
3118
|
await fs5.unlink(extPath);
|
|
3148
3119
|
return { changed: true };
|
|
@@ -3151,14 +3122,14 @@ async function uninstall3(projectDir) {
|
|
|
3151
3122
|
}
|
|
3152
3123
|
}
|
|
3153
3124
|
async function status3(projectDir) {
|
|
3154
|
-
const extPath =
|
|
3125
|
+
const extPath = path16__default.join(projectDir, ".omp", "extensions", "skaile.ts");
|
|
3155
3126
|
if (existsSync(extPath)) {
|
|
3156
3127
|
return {
|
|
3157
3128
|
backend: "omp",
|
|
3158
3129
|
installed: "yes",
|
|
3159
3130
|
enabled: "n/a",
|
|
3160
3131
|
method: "extension",
|
|
3161
|
-
location:
|
|
3132
|
+
location: path16__default.relative(projectDir, extPath)
|
|
3162
3133
|
};
|
|
3163
3134
|
}
|
|
3164
3135
|
return {
|
|
@@ -3179,7 +3150,7 @@ function resolveDriver(driver) {
|
|
|
3179
3150
|
throw new Error(`unknown driver: ${driver} (expected: claude-code | omp | codex | all)`);
|
|
3180
3151
|
}
|
|
3181
3152
|
async function runInstall(opts) {
|
|
3182
|
-
const projectDir =
|
|
3153
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
3183
3154
|
const targets = resolveDriver(opts.driver);
|
|
3184
3155
|
let exitCode = 0;
|
|
3185
3156
|
if (targets.includes("claude-code")) {
|
|
@@ -3234,7 +3205,7 @@ async function runInstall(opts) {
|
|
|
3234
3205
|
return exitCode;
|
|
3235
3206
|
}
|
|
3236
3207
|
async function runUninstall(opts) {
|
|
3237
|
-
const projectDir =
|
|
3208
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
3238
3209
|
const targets = resolveDriver(opts.driver);
|
|
3239
3210
|
let exitCode = 0;
|
|
3240
3211
|
if (targets.includes("claude-code")) {
|
|
@@ -3271,7 +3242,7 @@ async function runUninstall(opts) {
|
|
|
3271
3242
|
return exitCode;
|
|
3272
3243
|
}
|
|
3273
3244
|
async function runToggle(opts, action) {
|
|
3274
|
-
const projectDir =
|
|
3245
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
3275
3246
|
const requestedAll = opts.driver === "all";
|
|
3276
3247
|
const targets = resolveDriver(opts.driver);
|
|
3277
3248
|
if (!requestedAll) {
|
|
@@ -3306,7 +3277,7 @@ async function runToggle(opts, action) {
|
|
|
3306
3277
|
return exitCode;
|
|
3307
3278
|
}
|
|
3308
3279
|
async function runStatus(opts) {
|
|
3309
|
-
const projectDir =
|
|
3280
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
3310
3281
|
const targets = resolveDriver(opts.driver);
|
|
3311
3282
|
const rows = [];
|
|
3312
3283
|
let exitCode = 0;
|
|
@@ -3377,7 +3348,7 @@ async function runHook(event) {
|
|
|
3377
3348
|
await plugin.shutdown();
|
|
3378
3349
|
return;
|
|
3379
3350
|
}
|
|
3380
|
-
const store = new PluginStore(
|
|
3351
|
+
const store = new PluginStore(path16__default.join(projectDir, ".skaile", "plugin-state.json"));
|
|
3381
3352
|
await store.load();
|
|
3382
3353
|
const status4 = store.get("connector:status");
|
|
3383
3354
|
if (status4 && typeof status4 === "object" && Object.keys(status4).length > 0) {
|
|
@@ -3442,7 +3413,7 @@ function makePresetCommand() {
|
|
|
3442
3413
|
cmd.command("init [name]").description("Scaffold a new .preset.yaml file").option("--dir <path>", "Output directory", process.cwd()).action(async (name, opts) => {
|
|
3443
3414
|
const presetName = name ?? "my-preset";
|
|
3444
3415
|
const filename = `${presetName}.preset.yaml`;
|
|
3445
|
-
const outPath =
|
|
3416
|
+
const outPath = path16__default.join(path16__default.resolve(opts.dir), filename);
|
|
3446
3417
|
if (existsSync(outPath)) {
|
|
3447
3418
|
logErr(`File already exists: ${outPath}`);
|
|
3448
3419
|
logInfo("Choose a different name or remove the existing file.");
|
|
@@ -3456,7 +3427,7 @@ function makePresetCommand() {
|
|
|
3456
3427
|
logInfo(` skaile preset validate ${filename}`);
|
|
3457
3428
|
});
|
|
3458
3429
|
cmd.command("validate <path>").description("Validate a preset YAML file (schema + cycles + nesting depth)").action(async (filePath) => {
|
|
3459
|
-
const resolved =
|
|
3430
|
+
const resolved = path16__default.resolve(filePath);
|
|
3460
3431
|
if (!existsSync(resolved)) {
|
|
3461
3432
|
logErr(`File not found: ${resolved}`);
|
|
3462
3433
|
process.exit(1);
|
|
@@ -3482,7 +3453,7 @@ function makePresetCommand() {
|
|
|
3482
3453
|
logInfo(`Nested preset refs: ${nestedRefs.length} (depth validated at apply-time)`);
|
|
3483
3454
|
}
|
|
3484
3455
|
const { detectCycles } = await import('../discovery/index.js');
|
|
3485
|
-
const presetRef =
|
|
3456
|
+
const presetRef = path16__default.basename(resolved, ".preset.yaml");
|
|
3486
3457
|
const edges = [];
|
|
3487
3458
|
for (const item of preset.items) {
|
|
3488
3459
|
if (item.ref) {
|
|
@@ -3567,10 +3538,77 @@ items:
|
|
|
3567
3538
|
# credential_ref: "\${SECRET:EXAMPLE_KEY}" # for secret placeholders
|
|
3568
3539
|
`;
|
|
3569
3540
|
}
|
|
3541
|
+
var ASSET_REF_RE = /^@?([^/@\s]+)\/([^/@\s]+)@([^/@\s]+)$/;
|
|
3542
|
+
function supportsInstallManifest(source) {
|
|
3543
|
+
return typeof source?.getInstallManifest === "function";
|
|
3544
|
+
}
|
|
3545
|
+
async function runPointerOnlyInstall(ref, deps) {
|
|
3546
|
+
const m = ref.match(ASSET_REF_RE);
|
|
3547
|
+
if (!m) {
|
|
3548
|
+
throw new Error(
|
|
3549
|
+
`malformed asset ref '${ref}' \u2014 expected <publisher>/<name>@<version> (e.g. skaile/use-exa@1.0.0)`
|
|
3550
|
+
);
|
|
3551
|
+
}
|
|
3552
|
+
const manifest = await deps.catalog.getInstallManifest(ref);
|
|
3553
|
+
const normalizeRef = (r) => r.replace(/^@/, "");
|
|
3554
|
+
if (normalizeRef(manifest.ref) !== normalizeRef(ref)) {
|
|
3555
|
+
throw new Error(
|
|
3556
|
+
`catalog identity mismatch: requested '${ref}' but the catalog returned a manifest for '${manifest.ref}'`
|
|
3557
|
+
);
|
|
3558
|
+
}
|
|
3559
|
+
const { installPath } = await deps.library.install(manifest);
|
|
3560
|
+
return {
|
|
3561
|
+
installPath,
|
|
3562
|
+
commitSha: manifest.source.commitSha,
|
|
3563
|
+
fileCount: manifest.files.length
|
|
3564
|
+
};
|
|
3565
|
+
}
|
|
3570
3566
|
function makeInstallCommand() {
|
|
3571
|
-
return new Command("install").description(
|
|
3567
|
+
return new Command("install").description(
|
|
3568
|
+
"Install dependencies from skaile.yaml, or a single asset by ref (<publisher>/<name>@<version>)"
|
|
3569
|
+
).argument("[ref]", "Asset ref to install from the Catalog (<publisher>/<name>@<version>)").option("--locked", "Install from lock file (CI mode \u2014 fails on drift)").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", "Agent framework", "claude-code").action(async (ref, opts) => {
|
|
3570
|
+
if (ref !== void 0) {
|
|
3571
|
+
if (!ASSET_REF_RE.test(ref)) {
|
|
3572
|
+
logErr(
|
|
3573
|
+
`malformed asset ref '${ref}' \u2014 expected <publisher>/<name>@<version> (e.g. skaile/use-exa@1.0.0)`
|
|
3574
|
+
);
|
|
3575
|
+
process.exit(1);
|
|
3576
|
+
}
|
|
3577
|
+
const spinner6 = p5.spinner();
|
|
3578
|
+
spinner6.start(`Installing ${ref}`);
|
|
3579
|
+
try {
|
|
3580
|
+
const { openCatalogSource: openCatalogSource2, openLibrary: openLibrary2 } = await import('../open-library-S6FK4N4S.js');
|
|
3581
|
+
const catalog = await openCatalogSource2({ projectDir: path16__default.resolve(opts.projectDir) });
|
|
3582
|
+
if (!supportsInstallManifest(catalog)) {
|
|
3583
|
+
throw new Error(
|
|
3584
|
+
"pointer-only install (skaile install <ref>) requires a tRPC-framed Catalog. The configured catalog uses REST framing, which does not serve install manifests. Set catalog.url to https://skaile.store, or catalog.framing: trpc, in ~/.skaile/config.yaml."
|
|
3585
|
+
);
|
|
3586
|
+
}
|
|
3587
|
+
const library = await openLibrary2();
|
|
3588
|
+
try {
|
|
3589
|
+
const result = await runPointerOnlyInstall(ref, { catalog, library });
|
|
3590
|
+
spinner6.stop("Done");
|
|
3591
|
+
logOk(`Installed ${colorRef(ref)}`);
|
|
3592
|
+
logInfo(`Path: ${S.dim(result.installPath)}`);
|
|
3593
|
+
logInfo(`Commit: ${S.dim(result.commitSha)}`);
|
|
3594
|
+
logInfo(`Files: ${S.dim(String(result.fileCount))}`);
|
|
3595
|
+
} finally {
|
|
3596
|
+
library.close();
|
|
3597
|
+
}
|
|
3598
|
+
} catch (err) {
|
|
3599
|
+
spinner6.stop("Failed");
|
|
3600
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
3601
|
+
if (/unreachable/i.test(msg)) {
|
|
3602
|
+
logErr(`asset uninstallable \u2014 source commit no longer available (${msg})`);
|
|
3603
|
+
} else {
|
|
3604
|
+
logErr(msg);
|
|
3605
|
+
}
|
|
3606
|
+
process.exit(1);
|
|
3607
|
+
}
|
|
3608
|
+
return;
|
|
3609
|
+
}
|
|
3572
3610
|
const am2 = new AssetManager({
|
|
3573
|
-
projectDir:
|
|
3611
|
+
projectDir: path16__default.resolve(opts.projectDir),
|
|
3574
3612
|
driverTarget: opts.target
|
|
3575
3613
|
});
|
|
3576
3614
|
const spinner5 = p5.spinner();
|
|
@@ -3609,7 +3647,7 @@ function makeInstallCommand() {
|
|
|
3609
3647
|
}
|
|
3610
3648
|
function makeCheckCommand() {
|
|
3611
3649
|
return new Command("check").description("Check for unmet requirements").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
3612
|
-
const am2 = new AssetManager({ projectDir:
|
|
3650
|
+
const am2 = new AssetManager({ projectDir: path16__default.resolve(opts.projectDir) });
|
|
3613
3651
|
const issues = am2.doctor();
|
|
3614
3652
|
if (issues.length === 0) {
|
|
3615
3653
|
logOk("All dependencies satisfied.");
|
|
@@ -3626,10 +3664,10 @@ function makeCheckCommand() {
|
|
|
3626
3664
|
function makeCleanCommand() {
|
|
3627
3665
|
return new Command("clean").description("Remove all skaile-managed assets from the workspace").option("--all", "Full reset: also remove history, patches, repos, and lock file").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()).option("--target <agent>", "Agent framework", "claude-code").action(async (opts) => {
|
|
3628
3666
|
const am2 = new AssetManager({
|
|
3629
|
-
projectDir:
|
|
3667
|
+
projectDir: path16__default.resolve(opts.projectDir),
|
|
3630
3668
|
driverTarget: opts.target
|
|
3631
3669
|
});
|
|
3632
|
-
const lock = readLock(
|
|
3670
|
+
const lock = readLock(path16__default.resolve(opts.projectDir, "skaile.lock.yaml"));
|
|
3633
3671
|
if (!lock || Object.keys(lock.assets).length === 0) {
|
|
3634
3672
|
logInfo("Nothing to clean (no skaile-managed assets found).");
|
|
3635
3673
|
return;
|
|
@@ -3682,14 +3720,14 @@ function makeCleanCommand() {
|
|
|
3682
3720
|
}
|
|
3683
3721
|
function makeRebuildCommand() {
|
|
3684
3722
|
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) => {
|
|
3685
|
-
const projectDir =
|
|
3723
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
3686
3724
|
let agentDir;
|
|
3687
3725
|
if (agentArg) {
|
|
3688
3726
|
if (agentArg.includes("/") || agentArg.includes("\\")) {
|
|
3689
|
-
agentDir =
|
|
3727
|
+
agentDir = path16__default.resolve(projectDir, agentArg);
|
|
3690
3728
|
} else {
|
|
3691
3729
|
const resolved = resolveAgentDir(projectDir);
|
|
3692
|
-
agentDir = resolved ??
|
|
3730
|
+
agentDir = resolved ?? path16__default.resolve(projectDir, agentArg);
|
|
3693
3731
|
}
|
|
3694
3732
|
} else {
|
|
3695
3733
|
const resolved = resolveAgentDir(projectDir);
|
|
@@ -3767,7 +3805,7 @@ function makeFlowEventHandler() {
|
|
|
3767
3805
|
}
|
|
3768
3806
|
function makeRunCommand() {
|
|
3769
3807
|
const cmd = new Command("run").description("Start a flow or run a single-shot text prompt").argument("[flow-id-or-text...]", "Flow ID or text prompt").option("--project-dir <path>", "Project directory", process.cwd()).option("--driver <name>", "Driver backend (claude-sdk, codex, omp)").option("--provider <name>", "LLM provider").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) => {
|
|
3770
|
-
const projectDir =
|
|
3808
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
3771
3809
|
const cliDriver = opts.driver;
|
|
3772
3810
|
const dryRun = opts.dryRun ?? false;
|
|
3773
3811
|
let flowId = positional[0];
|
|
@@ -3821,15 +3859,15 @@ function makeRunCommand() {
|
|
|
3821
3859
|
let flowPath;
|
|
3822
3860
|
let dir = projectDir;
|
|
3823
3861
|
for (let i = 0; i < 6; i++) {
|
|
3824
|
-
const candidate =
|
|
3862
|
+
const candidate = path16__default.join(dir, "ai-assets");
|
|
3825
3863
|
if (fs10__default.existsSync(candidate)) {
|
|
3826
3864
|
for (const domain of fs10__default.readdirSync(candidate)) {
|
|
3827
|
-
const p_ =
|
|
3865
|
+
const p_ = path16__default.join(candidate, domain, "flows", `${flowId}.flow.yaml`);
|
|
3828
3866
|
if (fs10__default.existsSync(p_)) {
|
|
3829
3867
|
flowPath = p_;
|
|
3830
3868
|
break;
|
|
3831
3869
|
}
|
|
3832
|
-
const legacy =
|
|
3870
|
+
const legacy = path16__default.join(candidate, domain, "flows", `${flowId}.json`);
|
|
3833
3871
|
if (fs10__default.existsSync(legacy)) {
|
|
3834
3872
|
flowPath = legacy;
|
|
3835
3873
|
break;
|
|
@@ -3837,16 +3875,16 @@ function makeRunCommand() {
|
|
|
3837
3875
|
}
|
|
3838
3876
|
break;
|
|
3839
3877
|
}
|
|
3840
|
-
dir =
|
|
3878
|
+
dir = path16__default.dirname(dir);
|
|
3841
3879
|
}
|
|
3842
3880
|
if (!flowPath) {
|
|
3843
3881
|
for (const domain of fs10__default.readdirSync(AI_RESOURCES)) {
|
|
3844
|
-
const p_ =
|
|
3882
|
+
const p_ = path16__default.join(AI_RESOURCES, domain, "flows", `${flowId}.flow.yaml`);
|
|
3845
3883
|
if (fs10__default.existsSync(p_)) {
|
|
3846
3884
|
flowPath = p_;
|
|
3847
3885
|
break;
|
|
3848
3886
|
}
|
|
3849
|
-
const legacy =
|
|
3887
|
+
const legacy = path16__default.join(AI_RESOURCES, domain, "flows", `${flowId}.json`);
|
|
3850
3888
|
if (fs10__default.existsSync(legacy)) {
|
|
3851
3889
|
flowPath = legacy;
|
|
3852
3890
|
break;
|
|
@@ -3880,7 +3918,7 @@ function makeRunCommand() {
|
|
|
3880
3918
|
}
|
|
3881
3919
|
function makeResumeCommand() {
|
|
3882
3920
|
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) => {
|
|
3883
|
-
const projectDir =
|
|
3921
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
3884
3922
|
const sessionId = opts.session;
|
|
3885
3923
|
const dryRun = opts.dryRun ?? false;
|
|
3886
3924
|
const session = sessionId ? await loadSessionById(projectDir, sessionId) : await loadSession(projectDir);
|
|
@@ -3907,7 +3945,7 @@ function makeResumeCommand() {
|
|
|
3907
3945
|
}
|
|
3908
3946
|
function makeStatusCommand() {
|
|
3909
3947
|
return new Command("status").description("Show current session state").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
3910
|
-
const projectDir =
|
|
3948
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
3911
3949
|
const session = await loadSession(projectDir);
|
|
3912
3950
|
if (!session) {
|
|
3913
3951
|
logInfo("No active session.");
|
|
@@ -3932,7 +3970,7 @@ function makeStatusCommand() {
|
|
|
3932
3970
|
}
|
|
3933
3971
|
function makeClearCommand() {
|
|
3934
3972
|
return new Command("clear").description("Unset current session pointer").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
3935
|
-
const projectDir =
|
|
3973
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
3936
3974
|
await clearSession(projectDir);
|
|
3937
3975
|
logOk("Session cleared.");
|
|
3938
3976
|
});
|
|
@@ -3942,7 +3980,7 @@ function makeReplCommand() {
|
|
|
3942
3980
|
const { findWorkspaceRoot } = await import('../core/index.js');
|
|
3943
3981
|
const { startRepl } = await import('../tui/index.js');
|
|
3944
3982
|
const os = await import('os');
|
|
3945
|
-
const userCwd =
|
|
3983
|
+
const userCwd = path16__default.resolve(opts.projectDir ?? process.cwd());
|
|
3946
3984
|
const workspaceRoot = findWorkspaceRoot(userCwd);
|
|
3947
3985
|
let projectDir;
|
|
3948
3986
|
let agentCwd;
|
|
@@ -3964,12 +4002,12 @@ function makeReplCommand() {
|
|
|
3964
4002
|
p5.cancel("Cancelled.");
|
|
3965
4003
|
process.exit(0);
|
|
3966
4004
|
}
|
|
3967
|
-
const tmpDir = fs10__default.mkdtempSync(
|
|
4005
|
+
const tmpDir = fs10__default.mkdtempSync(path16__default.join(os.tmpdir(), "skaile-repl-"));
|
|
3968
4006
|
projectDir = tmpDir;
|
|
3969
4007
|
agentCwd = userCwd;
|
|
3970
4008
|
logOk(`Temporary workspace: ${S.cmd(tmpDir)}`);
|
|
3971
4009
|
if (!driverOverride) {
|
|
3972
|
-
const claudeDir =
|
|
4010
|
+
const claudeDir = path16__default.join(os.homedir(), ".claude");
|
|
3973
4011
|
if (fs10__default.existsSync(claudeDir)) {
|
|
3974
4012
|
driverOverride = "claude-sdk";
|
|
3975
4013
|
logInfo(`Detected ${S.cmd("~/.claude")} \u2192 using ${S.cmd("claude-sdk")} backend`);
|
|
@@ -4020,6 +4058,8 @@ async function runCompileTest(opts) {
|
|
|
4020
4058
|
const { dirname: dirname3, join: join4, resolve: resolve3 } = await import('path');
|
|
4021
4059
|
const { fileURLToPath } = await import('url');
|
|
4022
4060
|
const { unlinkSync, existsSync: existsSync11 } = await import('fs');
|
|
4061
|
+
const { spawn } = await import('child_process');
|
|
4062
|
+
const { portableSpawnSync: portableSpawnSync2 } = await import('../core/index.js');
|
|
4023
4063
|
const { MONOREPO_ROOT } = await import('../paths-FKKGS6BA.js');
|
|
4024
4064
|
if (MONOREPO_ROOT === null) {
|
|
4025
4065
|
logErr2("--compile-test is only available inside the skaile-dev workspace.");
|
|
@@ -4049,18 +4089,14 @@ async function runCompileTest(opts) {
|
|
|
4049
4089
|
"--define:__INCLUDE_CLAUDE_SDK__=true",
|
|
4050
4090
|
opts.withCodex ? "--define:__INCLUDE_CODEX__=true" : "--define:__INCLUDE_CODEX__=false"
|
|
4051
4091
|
];
|
|
4052
|
-
const buildProc =
|
|
4092
|
+
const buildProc = portableSpawnSync2(buildArgs, {
|
|
4053
4093
|
cwd: MONOREPO_ROOT,
|
|
4054
|
-
stdout: "pipe",
|
|
4055
|
-
stderr: "pipe",
|
|
4056
4094
|
env: { ...process.env }
|
|
4057
4095
|
});
|
|
4058
4096
|
if (buildProc.exitCode !== 0) {
|
|
4059
4097
|
logErr2("Build failed:");
|
|
4060
|
-
|
|
4061
|
-
if (
|
|
4062
|
-
const stdout = buildProc.stdout.toString();
|
|
4063
|
-
if (stdout) console.log(stdout);
|
|
4098
|
+
if (buildProc.stderr) console.error(buildProc.stderr);
|
|
4099
|
+
if (buildProc.stdout) console.log(buildProc.stdout);
|
|
4064
4100
|
process.exitCode = 1;
|
|
4065
4101
|
return;
|
|
4066
4102
|
}
|
|
@@ -4072,9 +4108,9 @@ async function runCompileTest(opts) {
|
|
|
4072
4108
|
if (opts.sessionId) serveArgs.push("--session-id", opts.sessionId);
|
|
4073
4109
|
logInfo2(`Running: ${S2.dim(serveArgs.join(" "))}`);
|
|
4074
4110
|
console.log();
|
|
4075
|
-
const
|
|
4076
|
-
|
|
4077
|
-
|
|
4111
|
+
const [serveBin, ...serveRest] = serveArgs;
|
|
4112
|
+
const serveProc = spawn(serveBin, serveRest, {
|
|
4113
|
+
stdio: "inherit",
|
|
4078
4114
|
env: { ...process.env }
|
|
4079
4115
|
});
|
|
4080
4116
|
function cleanup() {
|
|
@@ -4095,7 +4131,9 @@ async function runCompileTest(opts) {
|
|
|
4095
4131
|
cleanup();
|
|
4096
4132
|
process.exit(0);
|
|
4097
4133
|
});
|
|
4098
|
-
await
|
|
4134
|
+
await new Promise((res) => {
|
|
4135
|
+
serveProc.on("close", () => res());
|
|
4136
|
+
});
|
|
4099
4137
|
cleanup();
|
|
4100
4138
|
}
|
|
4101
4139
|
function formatEntries(entries, opts = {}) {
|
|
@@ -4192,30 +4230,16 @@ function rowToEntry(row) {
|
|
|
4192
4230
|
...row.error_json ? { error: JSON.parse(row.error_json) } : {}
|
|
4193
4231
|
};
|
|
4194
4232
|
}
|
|
4195
|
-
function loadBunSqlite() {
|
|
4196
|
-
const mod = __require("bun:sqlite");
|
|
4197
|
-
return mod.Database;
|
|
4198
|
-
}
|
|
4199
|
-
function toBindParams(params) {
|
|
4200
|
-
const out = { ...params };
|
|
4201
|
-
for (const [k, v] of Object.entries(params)) {
|
|
4202
|
-
if (k.startsWith("$")) {
|
|
4203
|
-
out[k.slice(1)] = v;
|
|
4204
|
-
}
|
|
4205
|
-
}
|
|
4206
|
-
return out;
|
|
4207
|
-
}
|
|
4208
4233
|
|
|
4209
4234
|
// cli/src/commands/session-logs/local-query.ts
|
|
4210
|
-
function localQuery(dbPath, q
|
|
4211
|
-
const
|
|
4212
|
-
const db = new Database(dbPath, { readonly: true });
|
|
4235
|
+
function localQuery(dbPath, q) {
|
|
4236
|
+
const db = openSqlite(dbPath, { readonly: true });
|
|
4213
4237
|
try {
|
|
4214
4238
|
db.exec("PRAGMA query_only=1;");
|
|
4215
4239
|
const limit = q.limit ?? 200;
|
|
4216
4240
|
const fetchN = limit + 1;
|
|
4217
4241
|
const { sql, params } = buildSelect({ ...q, limit: fetchN });
|
|
4218
|
-
const rows = db.prepare(sql).all(
|
|
4242
|
+
const rows = db.prepare(sql).all(params);
|
|
4219
4243
|
const all = rows.map(rowToEntry);
|
|
4220
4244
|
const hasMore = all.length > limit;
|
|
4221
4245
|
const trimmed = hasMore ? all.slice(0, limit) : all;
|
|
@@ -4280,15 +4304,14 @@ function buildSelect(q) {
|
|
|
4280
4304
|
var DEFAULT_INTERVAL_MS = 500;
|
|
4281
4305
|
var TAIL_BATCH_LIMIT = 200;
|
|
4282
4306
|
async function localTail(opts) {
|
|
4283
|
-
const Database = opts.databaseCtor ?? loadBunSqlite();
|
|
4284
4307
|
const intervalMs = opts.intervalMs ?? DEFAULT_INTERVAL_MS;
|
|
4285
4308
|
let lastSeen = opts.startAfterId ?? "";
|
|
4286
4309
|
while (!opts.signal?.aborted) {
|
|
4287
|
-
const db =
|
|
4310
|
+
const db = openSqlite(opts.dbPath, { readonly: true });
|
|
4288
4311
|
try {
|
|
4289
4312
|
db.exec("PRAGMA query_only=1;");
|
|
4290
4313
|
const { sql, params } = buildTailSelect({ ...opts.query, lastSeen });
|
|
4291
|
-
const rows = db.prepare(sql).all(
|
|
4314
|
+
const rows = db.prepare(sql).all(params);
|
|
4292
4315
|
for (const row of rows) {
|
|
4293
4316
|
const entry = rowToEntry(row);
|
|
4294
4317
|
opts.onEntry(entry);
|
|
@@ -4507,7 +4530,7 @@ function resolveMode(opts) {
|
|
|
4507
4530
|
if (opts.forceLocal && opts.forceRemote) {
|
|
4508
4531
|
throw new Error("Cannot use both --local and --remote");
|
|
4509
4532
|
}
|
|
4510
|
-
const startDir =
|
|
4533
|
+
const startDir = path16__default.resolve(opts.projectDir ?? process.cwd());
|
|
4511
4534
|
const localDb = findLogsDb(startDir);
|
|
4512
4535
|
if (opts.forceLocal) {
|
|
4513
4536
|
if (!localDb) {
|
|
@@ -4540,14 +4563,14 @@ function resolveMode(opts) {
|
|
|
4540
4563
|
function findLogsDb(startDir) {
|
|
4541
4564
|
let dir = startDir;
|
|
4542
4565
|
for (let i = 0; i < MAX_WALK_LEVELS; i++) {
|
|
4543
|
-
const candidate =
|
|
4566
|
+
const candidate = path16__default.join(dir, ".skaile", "logs.db");
|
|
4544
4567
|
if (existsSync(candidate)) {
|
|
4545
4568
|
try {
|
|
4546
4569
|
if (statSync(candidate).isFile()) return candidate;
|
|
4547
4570
|
} catch {
|
|
4548
4571
|
}
|
|
4549
4572
|
}
|
|
4550
|
-
const parent =
|
|
4573
|
+
const parent = path16__default.dirname(dir);
|
|
4551
4574
|
if (parent === dir) return void 0;
|
|
4552
4575
|
dir = parent;
|
|
4553
4576
|
}
|
|
@@ -4573,7 +4596,7 @@ function readApiToken() {
|
|
|
4573
4596
|
}
|
|
4574
4597
|
function readGlobalSettings() {
|
|
4575
4598
|
try {
|
|
4576
|
-
const settingsPath =
|
|
4599
|
+
const settingsPath = path16__default.join(homedir(), ".skaile", "settings.json");
|
|
4577
4600
|
if (!existsSync(settingsPath)) return {};
|
|
4578
4601
|
return JSON.parse(readFileSync(settingsPath, "utf8"));
|
|
4579
4602
|
} catch {
|
|
@@ -4721,7 +4744,7 @@ function parsePositiveInt(value, flag) {
|
|
|
4721
4744
|
function makeSessionCommand() {
|
|
4722
4745
|
const cmd = new Command("session").description("Manage sessions");
|
|
4723
4746
|
cmd.command("list").description("List all sessions for a project").option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
4724
|
-
const projectDir =
|
|
4747
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
4725
4748
|
const sessions = await listSessions(projectDir);
|
|
4726
4749
|
const current = await loadSession(projectDir);
|
|
4727
4750
|
if (sessions.length === 0) {
|
|
@@ -4749,7 +4772,7 @@ function makeSessionCommand() {
|
|
|
4749
4772
|
console.log();
|
|
4750
4773
|
});
|
|
4751
4774
|
cmd.command("show <run-id>").description("Show a specific session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
4752
|
-
const projectDir =
|
|
4775
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
4753
4776
|
const session = await loadSessionById(projectDir, runId);
|
|
4754
4777
|
if (!session) {
|
|
4755
4778
|
logErr(`Session not found: ${runId}`);
|
|
@@ -4758,12 +4781,12 @@ function makeSessionCommand() {
|
|
|
4758
4781
|
console.log(JSON.stringify(session, null, 2));
|
|
4759
4782
|
});
|
|
4760
4783
|
cmd.command("switch <run-id>").description("Switch the current session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
4761
|
-
const projectDir =
|
|
4784
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
4762
4785
|
await setCurrentSession(projectDir, runId);
|
|
4763
4786
|
logOk(`Switched to session: ${S.dim(runId.slice(0, 8))}`);
|
|
4764
4787
|
});
|
|
4765
4788
|
cmd.command("delete <run-id>").description("Delete a session").option("--project-dir <path>", "Project directory", process.cwd()).action(async (runId, opts) => {
|
|
4766
|
-
const projectDir =
|
|
4789
|
+
const projectDir = path16__default.resolve(opts.projectDir);
|
|
4767
4790
|
await deleteSession(projectDir, runId);
|
|
4768
4791
|
logOk(`Deleted session: ${S.dim(runId.slice(0, 8))}`);
|
|
4769
4792
|
});
|
|
@@ -4826,7 +4849,7 @@ function showAsset(am2, kind, name) {
|
|
|
4826
4849
|
function makeShowCommand() {
|
|
4827
4850
|
return new Command("show").description("Show deployed assets overview, or print asset content").argument("[kind]", "Asset kind (skill, agent, prompt, flow, bundle, contract)").argument("[name]", "Asset name").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", "Agent framework", "claude-code").action((kind, name, opts) => {
|
|
4828
4851
|
const am2 = new AssetManager({
|
|
4829
|
-
projectDir:
|
|
4852
|
+
projectDir: path16__default.resolve(opts.projectDir),
|
|
4830
4853
|
driverTarget: opts.target
|
|
4831
4854
|
});
|
|
4832
4855
|
if (!kind) {
|
|
@@ -5014,7 +5037,7 @@ function printTree(node, prefix = "", isLast = true) {
|
|
|
5014
5037
|
}
|
|
5015
5038
|
function makeTreeCommand() {
|
|
5016
5039
|
return new Command("tree").description("Show full dependency tree").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
5017
|
-
const am2 = new AssetManager({ projectDir:
|
|
5040
|
+
const am2 = new AssetManager({ projectDir: path16__default.resolve(opts.projectDir) });
|
|
5018
5041
|
const root = am2.tree();
|
|
5019
5042
|
if (root.children.length === 0) {
|
|
5020
5043
|
logInfo("No dependencies in lock file. Run `skaile install` first.");
|
|
@@ -5032,7 +5055,7 @@ function makeUpdateCommand() {
|
|
|
5032
5055
|
try {
|
|
5033
5056
|
const catalogSpinner = p5.spinner();
|
|
5034
5057
|
catalogSpinner.start("Refreshing catalog cache");
|
|
5035
|
-
const remote = await openCatalogSource({ projectDir:
|
|
5058
|
+
const remote = await openCatalogSource({ projectDir: path16__default.resolve(opts.projectDir) });
|
|
5036
5059
|
const result2 = await remote.refresh();
|
|
5037
5060
|
catalogSpinner.stop(
|
|
5038
5061
|
`Catalog refreshed: ${S.heading(String(result2.assetsCached))} assets cached`
|
|
@@ -5044,7 +5067,7 @@ function makeUpdateCommand() {
|
|
|
5044
5067
|
}
|
|
5045
5068
|
}
|
|
5046
5069
|
if (opts.catalogOnly) return;
|
|
5047
|
-
const am2 = new AssetManager({ projectDir:
|
|
5070
|
+
const am2 = new AssetManager({ projectDir: path16__default.resolve(opts.projectDir) });
|
|
5048
5071
|
const spinner5 = p5.spinner();
|
|
5049
5072
|
spinner5.start("Re-deploying assets");
|
|
5050
5073
|
const result = await am2.install();
|
|
@@ -5090,7 +5113,7 @@ function findManifestCandidates(rootPath) {
|
|
|
5090
5113
|
return;
|
|
5091
5114
|
}
|
|
5092
5115
|
for (const entry of entries) {
|
|
5093
|
-
const fullPath =
|
|
5116
|
+
const fullPath = path16__default.join(dir, entry.name);
|
|
5094
5117
|
if (entry.isDirectory()) {
|
|
5095
5118
|
if (!SKIP_DIRS.has(entry.name)) walk(fullPath);
|
|
5096
5119
|
} else if (entry.isFile()) {
|
|
@@ -5112,7 +5135,7 @@ function parseMdFrontmatter(content) {
|
|
|
5112
5135
|
return parse(fmMatch[1]);
|
|
5113
5136
|
}
|
|
5114
5137
|
function validateManifests(rootPath) {
|
|
5115
|
-
const absRoot =
|
|
5138
|
+
const absRoot = path16__default.resolve(rootPath);
|
|
5116
5139
|
if (!fs10__default.existsSync(absRoot)) {
|
|
5117
5140
|
logErr(`Path does not exist: ${absRoot}`);
|
|
5118
5141
|
return { total: 0, errors: 1, warnings: 0 };
|
|
@@ -5133,14 +5156,14 @@ function validateManifests(rootPath) {
|
|
|
5133
5156
|
try {
|
|
5134
5157
|
parsed = c.filePath.endsWith(".json") ? JSON.parse(content) : parse(content);
|
|
5135
5158
|
} catch (e) {
|
|
5136
|
-
const relPath2 =
|
|
5159
|
+
const relPath2 = path16__default.relative(absRoot, c.filePath);
|
|
5137
5160
|
logErr(`${relPath2} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
|
|
5138
5161
|
errors++;
|
|
5139
5162
|
continue;
|
|
5140
5163
|
}
|
|
5141
5164
|
}
|
|
5142
5165
|
const provider = registry.getProvider(c.kind);
|
|
5143
|
-
const relPath =
|
|
5166
|
+
const relPath = path16__default.relative(absRoot, c.filePath);
|
|
5144
5167
|
if (!provider) {
|
|
5145
5168
|
logWarn(`${relPath} [${c.kind}] \u2014 kind "${c.kind}" is not registered, skipping validation`);
|
|
5146
5169
|
warnings++;
|
|
@@ -5162,20 +5185,20 @@ function collectAssetVersions() {
|
|
|
5162
5185
|
if (!fs10__default.existsSync(AI_RESOURCES)) return assets;
|
|
5163
5186
|
const domains = fs10__default.readdirSync(AI_RESOURCES, { withFileTypes: true }).filter((d) => d.isDirectory() && !EXCLUDED_DOMAINS.has(d.name));
|
|
5164
5187
|
for (const d of domains) {
|
|
5165
|
-
const domainDir =
|
|
5166
|
-
const skillsDir =
|
|
5188
|
+
const domainDir = path16__default.join(AI_RESOURCES, d.name);
|
|
5189
|
+
const skillsDir = path16__default.join(domainDir, "skills");
|
|
5167
5190
|
if (fs10__default.existsSync(skillsDir)) {
|
|
5168
5191
|
collectSkillVersions(skillsDir, d.name, assets);
|
|
5169
5192
|
}
|
|
5170
|
-
const agentsDir =
|
|
5193
|
+
const agentsDir = path16__default.join(domainDir, "agents");
|
|
5171
5194
|
if (fs10__default.existsSync(agentsDir)) {
|
|
5172
5195
|
collectAgentVersions(agentsDir, d.name, assets);
|
|
5173
5196
|
}
|
|
5174
|
-
const flowsDir =
|
|
5197
|
+
const flowsDir = path16__default.join(domainDir, "flows");
|
|
5175
5198
|
if (fs10__default.existsSync(flowsDir)) {
|
|
5176
5199
|
for (const f of fs10__default.readdirSync(flowsDir)) {
|
|
5177
5200
|
if (!f.endsWith(".flow.yaml")) continue;
|
|
5178
|
-
const fp =
|
|
5201
|
+
const fp = path16__default.join(flowsDir, f);
|
|
5179
5202
|
const content = fs10__default.readFileSync(fp, "utf-8");
|
|
5180
5203
|
const parsed = parse(content);
|
|
5181
5204
|
assets.push({
|
|
@@ -5187,11 +5210,11 @@ function collectAssetVersions() {
|
|
|
5187
5210
|
});
|
|
5188
5211
|
}
|
|
5189
5212
|
}
|
|
5190
|
-
const promptsDir =
|
|
5213
|
+
const promptsDir = path16__default.join(domainDir, "prompts");
|
|
5191
5214
|
if (fs10__default.existsSync(promptsDir)) {
|
|
5192
5215
|
for (const f of fs10__default.readdirSync(promptsDir)) {
|
|
5193
5216
|
if (!f.endsWith(".prompt.md")) continue;
|
|
5194
|
-
const fp =
|
|
5217
|
+
const fp = path16__default.join(promptsDir, f);
|
|
5195
5218
|
const content = fs10__default.readFileSync(fp, "utf-8");
|
|
5196
5219
|
const fm = parseSkillFrontmatter(content);
|
|
5197
5220
|
assets.push({
|
|
@@ -5209,8 +5232,8 @@ function collectAssetVersions() {
|
|
|
5209
5232
|
function collectSkillVersions(dir, domain, out) {
|
|
5210
5233
|
for (const entry of fs10__default.readdirSync(dir, { withFileTypes: true })) {
|
|
5211
5234
|
if (!entry.isDirectory()) continue;
|
|
5212
|
-
const full =
|
|
5213
|
-
const skillMd =
|
|
5235
|
+
const full = path16__default.join(dir, entry.name);
|
|
5236
|
+
const skillMd = path16__default.join(full, "SKILL.md");
|
|
5214
5237
|
if (fs10__default.existsSync(skillMd)) {
|
|
5215
5238
|
const content = fs10__default.readFileSync(skillMd, "utf-8");
|
|
5216
5239
|
const fm = parseSkillFrontmatter(content);
|
|
@@ -5229,7 +5252,7 @@ function collectSkillVersions(dir, domain, out) {
|
|
|
5229
5252
|
function collectAgentVersions(dir, domain, out) {
|
|
5230
5253
|
for (const entry of fs10__default.readdirSync(dir, { withFileTypes: true })) {
|
|
5231
5254
|
if (!entry.isDirectory()) continue;
|
|
5232
|
-
const agentYaml =
|
|
5255
|
+
const agentYaml = path16__default.join(dir, entry.name, "agent.yaml");
|
|
5233
5256
|
if (!fs10__default.existsSync(agentYaml)) continue;
|
|
5234
5257
|
const content = fs10__default.readFileSync(agentYaml, "utf-8");
|
|
5235
5258
|
const parsed = parse(content);
|
|
@@ -5260,7 +5283,7 @@ function makeValidateCommand() {
|
|
|
5260
5283
|
"Validate asset manifests, versions, and changelogs"
|
|
5261
5284
|
);
|
|
5262
5285
|
cmd.argument("[path]", "Path to asset repo or directory to validate", ".").action((targetPath) => {
|
|
5263
|
-
const absPath =
|
|
5286
|
+
const absPath = path16__default.resolve(targetPath);
|
|
5264
5287
|
logInfo(`Validating manifests in ${absPath}`);
|
|
5265
5288
|
const { total, errors } = validateManifests(absPath);
|
|
5266
5289
|
console.log();
|
|
@@ -5281,7 +5304,7 @@ function makeValidateCommand() {
|
|
|
5281
5304
|
encoding: "utf-8"
|
|
5282
5305
|
});
|
|
5283
5306
|
const changedFiles = new Set(
|
|
5284
|
-
diffOutput.trim().split("\n").filter(Boolean).map((f) =>
|
|
5307
|
+
diffOutput.trim().split("\n").filter(Boolean).map((f) => path16__default.resolve(AI_RESOURCES, f))
|
|
5285
5308
|
);
|
|
5286
5309
|
assets = assets.filter((a) => changedFiles.has(a.filePath));
|
|
5287
5310
|
} catch {
|
|
@@ -5303,7 +5326,7 @@ function makeValidateCommand() {
|
|
|
5303
5326
|
if (opts.changedOnly) {
|
|
5304
5327
|
for (const a of assets) {
|
|
5305
5328
|
if (!a.version) continue;
|
|
5306
|
-
const relPath =
|
|
5329
|
+
const relPath = path16__default.relative(AI_RESOURCES, a.filePath);
|
|
5307
5330
|
try {
|
|
5308
5331
|
const headContent = execSync(`git show HEAD:${relPath}`, {
|
|
5309
5332
|
cwd: AI_RESOURCES,
|
|
@@ -5383,7 +5406,7 @@ function makeValidateCommand() {
|
|
|
5383
5406
|
let errors = 0;
|
|
5384
5407
|
for (const domain of modifiedDomains) {
|
|
5385
5408
|
const changelogModified = modifiedFiles.some(
|
|
5386
|
-
(f) => f === `${domain}/CHANGELOG.md` || f ===
|
|
5409
|
+
(f) => f === `${domain}/CHANGELOG.md` || f === path16__default.join(domain, "CHANGELOG.md")
|
|
5387
5410
|
);
|
|
5388
5411
|
if (changelogModified) {
|
|
5389
5412
|
logOk(`${domain}/CHANGELOG.md updated`);
|
|
@@ -5465,7 +5488,7 @@ function makeVerifyCommand() {
|
|
|
5465
5488
|
}
|
|
5466
5489
|
function makeWhyCommand() {
|
|
5467
5490
|
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((ref, opts) => {
|
|
5468
|
-
const am2 = new AssetManager({ projectDir:
|
|
5491
|
+
const am2 = new AssetManager({ projectDir: path16__default.resolve(opts.projectDir) });
|
|
5469
5492
|
const chain = am2.why(ref);
|
|
5470
5493
|
if (chain.length === 0) {
|
|
5471
5494
|
logErr(`${ref} not found in lock file. Run \`skaile install\` first.`);
|
|
@@ -5559,7 +5582,6 @@ Library (Asset Store v2):
|
|
|
5559
5582
|
|
|
5560
5583
|
Advanced:
|
|
5561
5584
|
flow list|show Flow browsing
|
|
5562
|
-
mounts ... Mount operations
|
|
5563
5585
|
connector ... Connector operations
|
|
5564
5586
|
path Show resolved paths
|
|
5565
5587
|
|
|
@@ -5571,8 +5593,8 @@ program.command("init [project-dir]").description("Initialize a project director
|
|
|
5571
5593
|
async (projectDir, opts) => {
|
|
5572
5594
|
projectDir = projectDir ?? ".";
|
|
5573
5595
|
const { scaffoldWorkspace } = await import('../asset-manager/scaffold.js');
|
|
5574
|
-
const resolved =
|
|
5575
|
-
const projectName =
|
|
5596
|
+
const resolved = path16__default.resolve(projectDir);
|
|
5597
|
+
const projectName = path16__default.basename(resolved);
|
|
5576
5598
|
const result = await scaffoldWorkspace({
|
|
5577
5599
|
dest: resolved,
|
|
5578
5600
|
template: opts.template,
|
|
@@ -5610,7 +5632,7 @@ program.command("init [project-dir]").description("Initialize a project director
|
|
|
5610
5632
|
logOk(`Initialized project at ${S.heading(resolved)}`);
|
|
5611
5633
|
console.log();
|
|
5612
5634
|
console.log(S.heading(" Next steps:"));
|
|
5613
|
-
const isCurrentDir = resolved ===
|
|
5635
|
+
const isCurrentDir = resolved === path16__default.resolve(".");
|
|
5614
5636
|
let step = 1;
|
|
5615
5637
|
if (!isCurrentDir) {
|
|
5616
5638
|
console.log(` ${S.dim(`${step}.`)} ${S.cmd(`cd ${projectDir}`)}`);
|
|
@@ -5623,7 +5645,7 @@ program.command("init [project-dir]").description("Initialize a project director
|
|
|
5623
5645
|
}
|
|
5624
5646
|
);
|
|
5625
5647
|
program.command("setup").description("Interactive provider setup wizard").action(async () => {
|
|
5626
|
-
const { cmdSetup } = await import('../setup-
|
|
5648
|
+
const { cmdSetup } = await import('../setup-PHFPBDBI.js');
|
|
5627
5649
|
await cmdSetup([], { projectDir: process.cwd() });
|
|
5628
5650
|
});
|
|
5629
5651
|
program.addCommand(makeInstallCommand());
|
|
@@ -5661,7 +5683,6 @@ program.addCommand(makeStatusCommand());
|
|
|
5661
5683
|
program.addCommand(makeClearCommand());
|
|
5662
5684
|
program.addCommand(makeFlowCommand(), { hidden: true });
|
|
5663
5685
|
program.addCommand(makeNpxCommand(), { hidden: true });
|
|
5664
|
-
program.addCommand(makeMountCommand());
|
|
5665
5686
|
program.addCommand(makeConnectorCommand());
|
|
5666
5687
|
program.addCommand(makeValidateCommand());
|
|
5667
5688
|
program.addCommand(makeAuthCommand());
|