@skaile/workspaces 6.4.0 → 6.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -1
- package/README.md +4 -0
- package/dist/ai-sdk.js +55 -25
- package/dist/ai-sdk.js.map +1 -1
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-UJSYGKCX.js → asset-feeds-WQ6YQPHV.js} +22 -22
- package/dist/{asset-feeds-UJSYGKCX.js.map → asset-feeds-WQ6YQPHV.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +8 -8
- package/dist/asset-manager/index.js +14 -14
- package/dist/asset-manager/installer.js +10 -10
- package/dist/asset-manager/renderers.js +9 -9
- package/dist/asset-manager/src/index.d.ts +114 -12
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/asset-manager/src/installer.d.ts +6 -0
- package/dist/asset-manager/src/installer.d.ts.map +1 -1
- package/dist/bridge/harnesses/claude-sdk.js +24 -19
- package/dist/bridge/harnesses/claude-sdk.js.map +1 -1
- package/dist/bridge/harnesses/codex.js +38 -36
- package/dist/bridge/harnesses/codex.js.map +1 -1
- package/dist/bridge/harnesses/continue.js +12 -13
- package/dist/bridge/harnesses/continue.js.map +1 -1
- package/dist/bridge/harnesses/echo.js +5 -6
- package/dist/bridge/harnesses/echo.js.map +1 -1
- package/dist/bridge/harnesses/gemini.js +9 -10
- package/dist/bridge/harnesses/goose.js +12 -13
- package/dist/bridge/harnesses/goose.js.map +1 -1
- package/dist/bridge/harnesses/omp.js +17 -12
- package/dist/bridge/harnesses/omp.js.map +1 -1
- package/dist/bridge/harnesses/opencode.js +12 -13
- package/dist/bridge/harnesses/opencode.js.map +1 -1
- package/dist/bridge/harnesses/qwen.js +9 -10
- package/dist/bridge/harnesses/qwen.js.map +1 -1
- package/dist/bridge/index.js +20 -21
- package/dist/bridge/src/ai-sdk.d.ts +0 -2
- package/dist/bridge/src/ai-sdk.d.ts.map +1 -1
- package/dist/bridge/src/codex/login-fallback.d.ts +39 -0
- package/dist/bridge/src/codex/login-fallback.d.ts.map +1 -0
- package/dist/bridge/src/error-classifier.d.ts +6 -0
- package/dist/bridge/src/error-classifier.d.ts.map +1 -1
- package/dist/bridge/src/harnesses/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/harnesses/codex.d.ts +0 -6
- package/dist/bridge/src/harnesses/codex.d.ts.map +1 -1
- package/dist/bridge/src/harnesses/omp.d.ts.map +1 -1
- package/dist/bridge/src/index.d.ts +1 -0
- package/dist/bridge/src/index.d.ts.map +1 -1
- package/dist/{chunk-GTMANMBZ.js → chunk-2M3VLKT2.js} +3 -3
- package/dist/{chunk-GTMANMBZ.js.map → chunk-2M3VLKT2.js.map} +1 -1
- package/dist/{chunk-2WOA3TKK.js → chunk-2TLPC6TQ.js} +34 -19
- package/dist/chunk-2TLPC6TQ.js.map +1 -0
- package/dist/{chunk-O7KAQQAI.js → chunk-4BFEPZ6J.js} +4 -4
- package/dist/{chunk-O7KAQQAI.js.map → chunk-4BFEPZ6J.js.map} +1 -1
- package/dist/{chunk-TPQKFX6X.js → chunk-4J7JQX4G.js} +4 -4
- package/dist/{chunk-TPQKFX6X.js.map → chunk-4J7JQX4G.js.map} +1 -1
- package/dist/{chunk-6OHZUUR7.js → chunk-5DE3DGVR.js} +11 -5
- package/dist/chunk-5DE3DGVR.js.map +1 -0
- package/dist/{chunk-Q4XWCVFA.js → chunk-5ETYBC2X.js} +8 -8
- package/dist/{chunk-Q4XWCVFA.js.map → chunk-5ETYBC2X.js.map} +1 -1
- package/dist/{chunk-ZWCGJYR7.js → chunk-5XHQBCB5.js} +3 -3
- package/dist/{chunk-ZWCGJYR7.js.map → chunk-5XHQBCB5.js.map} +1 -1
- package/dist/{chunk-JSWMRYLM.js → chunk-65UAC3ZR.js} +31 -7
- package/dist/chunk-65UAC3ZR.js.map +1 -0
- package/dist/{chunk-UBLZALKP.js → chunk-6A6HE5LW.js} +3 -3
- package/dist/{chunk-UBLZALKP.js.map → chunk-6A6HE5LW.js.map} +1 -1
- package/dist/{chunk-ABVWUM2E.js → chunk-6ARPZHOV.js} +47 -25
- package/dist/chunk-6ARPZHOV.js.map +1 -0
- package/dist/{chunk-TDKZL5ZC.js → chunk-6RHWTZPT.js} +4 -4
- package/dist/{chunk-TDKZL5ZC.js.map → chunk-6RHWTZPT.js.map} +1 -1
- package/dist/{chunk-6WQGJF65.js → chunk-6SXSVKQY.js} +88 -17
- package/dist/chunk-6SXSVKQY.js.map +1 -0
- package/dist/{chunk-YFGXYQW4.js → chunk-7I5PNB2G.js} +3 -3
- package/dist/{chunk-YFGXYQW4.js.map → chunk-7I5PNB2G.js.map} +1 -1
- package/dist/{serve-preflight-NPWI4MV6.js → chunk-7PVGND4J.js} +30 -61
- package/dist/chunk-7PVGND4J.js.map +1 -0
- package/dist/{chunk-P7EL7QRD.js → chunk-7SJHSGUV.js} +34 -20
- package/dist/chunk-7SJHSGUV.js.map +1 -0
- package/dist/{chunk-VSCLUPGZ.js → chunk-AQNW2FET.js} +289 -44
- package/dist/chunk-AQNW2FET.js.map +1 -0
- package/dist/{chunk-45KLCFQB.js → chunk-B6N653ZG.js} +6 -6
- package/dist/{chunk-45KLCFQB.js.map → chunk-B6N653ZG.js.map} +1 -1
- package/dist/{chunk-6UP2EDFN.js → chunk-BSMW3PX2.js} +313 -4
- package/dist/chunk-BSMW3PX2.js.map +1 -0
- package/dist/{chunk-HTGTNN2B.js → chunk-CMXDFTA2.js} +3 -3
- package/dist/{chunk-HTGTNN2B.js.map → chunk-CMXDFTA2.js.map} +1 -1
- package/dist/{chunk-YJNE4V2M.js → chunk-DI6J2PJB.js} +70 -37
- package/dist/chunk-DI6J2PJB.js.map +1 -0
- package/dist/{chunk-V4OXHEWY.js → chunk-DS6UUCFG.js} +4 -4
- package/dist/{chunk-V4OXHEWY.js.map → chunk-DS6UUCFG.js.map} +1 -1
- package/dist/{chunk-U6S5CXKB.js → chunk-E2EC6SAX.js} +4 -4
- package/dist/{chunk-U6S5CXKB.js.map → chunk-E2EC6SAX.js.map} +1 -1
- package/dist/{chunk-TF5CWJQZ.js → chunk-EPXZQIC6.js} +23 -80
- package/dist/chunk-EPXZQIC6.js.map +1 -0
- package/dist/{chunk-6X3GDPCB.js → chunk-F4CZQD3T.js} +3 -4
- package/dist/chunk-F4CZQD3T.js.map +1 -0
- package/dist/{chunk-VZU67OKK.js → chunk-G5SYFFMD.js} +2 -2
- package/dist/{chunk-VZU67OKK.js.map → chunk-G5SYFFMD.js.map} +1 -1
- package/dist/{chunk-VV2DJT4I.js → chunk-GNUA7XT2.js} +4 -3
- package/dist/chunk-GNUA7XT2.js.map +1 -0
- package/dist/{chunk-E237FGGX.js → chunk-GTAHU4N4.js} +4 -4
- package/dist/{chunk-E237FGGX.js.map → chunk-GTAHU4N4.js.map} +1 -1
- package/dist/{chunk-SISUT7VR.js → chunk-GTGWRKMJ.js} +7 -7
- package/dist/{chunk-SISUT7VR.js.map → chunk-GTGWRKMJ.js.map} +1 -1
- package/dist/{chunk-BX7PSWJA.js → chunk-HGZN6JLP.js} +4 -4
- package/dist/{chunk-BX7PSWJA.js.map → chunk-HGZN6JLP.js.map} +1 -1
- package/dist/{chunk-L45IHRDH.js → chunk-HQAPUPBE.js} +3 -3
- package/dist/{chunk-L45IHRDH.js.map → chunk-HQAPUPBE.js.map} +1 -1
- package/dist/{chunk-L4OYPFLB.js → chunk-I5IF3JCG.js} +4 -4
- package/dist/{chunk-L4OYPFLB.js.map → chunk-I5IF3JCG.js.map} +1 -1
- package/dist/{chunk-IYZAJ2J2.js → chunk-J262X4JU.js} +36 -36
- package/dist/chunk-J262X4JU.js.map +1 -0
- package/dist/{chunk-WENTJ5KP.js → chunk-J4WKNJHO.js} +6 -6
- package/dist/{chunk-WENTJ5KP.js.map → chunk-J4WKNJHO.js.map} +1 -1
- package/dist/{chunk-3ENE6ZOF.js → chunk-JIQUF3X2.js} +9 -8
- package/dist/chunk-JIQUF3X2.js.map +1 -0
- package/dist/{chunk-TGB4E5Z6.js → chunk-JRVQV7WC.js} +414 -95
- package/dist/chunk-JRVQV7WC.js.map +1 -0
- package/dist/{chunk-BOS7P2Y4.js → chunk-KSH5CFQS.js} +3 -3
- package/dist/{chunk-BOS7P2Y4.js.map → chunk-KSH5CFQS.js.map} +1 -1
- package/dist/{chunk-UUKCPPTQ.js → chunk-KSUT5KAE.js} +3 -3
- package/dist/{chunk-UUKCPPTQ.js.map → chunk-KSUT5KAE.js.map} +1 -1
- package/dist/{chunk-DF5WJC3Q.js → chunk-LBJ4M5J2.js} +4 -4
- package/dist/{chunk-DF5WJC3Q.js.map → chunk-LBJ4M5J2.js.map} +1 -1
- package/dist/{chunk-GBXQFJ4G.js → chunk-MMOWIRHP.js} +310 -175
- package/dist/chunk-MMOWIRHP.js.map +1 -0
- package/dist/{chunk-G63KOHFS.js → chunk-MXI3XWV6.js} +4 -4
- package/dist/{chunk-G63KOHFS.js.map → chunk-MXI3XWV6.js.map} +1 -1
- package/dist/{chunk-ACBL7X62.js → chunk-N2PBAXAA.js} +3 -3
- package/dist/{chunk-ACBL7X62.js.map → chunk-N2PBAXAA.js.map} +1 -1
- package/dist/{chunk-5NHBLKKU.js → chunk-O7QZI6MQ.js} +3 -3
- package/dist/{chunk-5NHBLKKU.js.map → chunk-O7QZI6MQ.js.map} +1 -1
- package/dist/{chunk-U3SXCVR7.js → chunk-OY22B7E2.js} +4 -4
- package/dist/{chunk-U3SXCVR7.js.map → chunk-OY22B7E2.js.map} +1 -1
- package/dist/{chunk-C7TQARGC.js → chunk-PTJTOPE5.js} +3 -3
- package/dist/{chunk-C7TQARGC.js.map → chunk-PTJTOPE5.js.map} +1 -1
- package/dist/{chunk-HSF665NV.js → chunk-RAU5QPI6.js} +5 -5
- package/dist/{chunk-HSF665NV.js.map → chunk-RAU5QPI6.js.map} +1 -1
- package/dist/{chunk-RKI35EAN.js → chunk-RHCEX2EV.js} +3 -3
- package/dist/{chunk-RKI35EAN.js.map → chunk-RHCEX2EV.js.map} +1 -1
- package/dist/{chunk-76WSWPOB.js → chunk-SCRYXAHH.js} +15 -6
- package/dist/chunk-SCRYXAHH.js.map +1 -0
- package/dist/{chunk-DKXNKFKP.js → chunk-SGI5MRKP.js} +75 -3
- package/dist/chunk-SGI5MRKP.js.map +1 -0
- package/dist/{chunk-24D7IW5O.js → chunk-SHTXMERQ.js} +7 -8
- package/dist/chunk-SHTXMERQ.js.map +1 -0
- package/dist/{chunk-IZV3HDVG.js → chunk-SZKCE7EC.js} +5 -5
- package/dist/{chunk-IZV3HDVG.js.map → chunk-SZKCE7EC.js.map} +1 -1
- package/dist/{chunk-UAOHR6AL.js → chunk-TCH5UDKT.js} +4 -4
- package/dist/{chunk-UAOHR6AL.js.map → chunk-TCH5UDKT.js.map} +1 -1
- package/dist/{chunk-UVTN4O7N.js → chunk-TUFNY6OD.js} +33 -10
- package/dist/chunk-TUFNY6OD.js.map +1 -0
- package/dist/{chunk-PTBX55QF.js → chunk-U3UDOX6I.js} +4 -4
- package/dist/{chunk-PTBX55QF.js.map → chunk-U3UDOX6I.js.map} +1 -1
- package/dist/{chunk-BUU2DLPC.js → chunk-USSP43U3.js} +3 -3
- package/dist/{chunk-BUU2DLPC.js.map → chunk-USSP43U3.js.map} +1 -1
- package/dist/{chunk-IZQOO6MN.js → chunk-V5KG6CCV.js} +2 -2
- package/dist/{chunk-IZQOO6MN.js.map → chunk-V5KG6CCV.js.map} +1 -1
- package/dist/{chunk-CK3CJSRY.js → chunk-VJRL6ZK6.js} +4 -4
- package/dist/{chunk-CK3CJSRY.js.map → chunk-VJRL6ZK6.js.map} +1 -1
- package/dist/{chunk-76FLBODK.js → chunk-VT6G5AJV.js} +10 -7
- package/dist/chunk-VT6G5AJV.js.map +1 -0
- package/dist/{chunk-EXRQKOY6.js → chunk-VXYZ5M7Z.js} +83 -34
- package/dist/chunk-VXYZ5M7Z.js.map +1 -0
- package/dist/{chunk-QSIFEHSN.js → chunk-WW5NAU6N.js} +3 -3
- package/dist/{chunk-QSIFEHSN.js.map → chunk-WW5NAU6N.js.map} +1 -1
- package/dist/chunk-XD3RYAMR.js +83 -0
- package/dist/chunk-XD3RYAMR.js.map +1 -0
- package/dist/{chunk-HXZ3FQQN.js → chunk-XYCYGN3Q.js} +82 -50
- package/dist/chunk-XYCYGN3Q.js.map +1 -0
- package/dist/{chunk-5T3DTK7A.js → chunk-YN6N3RBM.js} +9 -10
- package/dist/chunk-YN6N3RBM.js.map +1 -0
- package/dist/{chunk-DCJ4BION.js → chunk-Z4FERR4U.js} +2 -2
- package/dist/{chunk-DCJ4BION.js.map → chunk-Z4FERR4U.js.map} +1 -1
- package/dist/{claude-code-UBT4ZME7.js → claude-code-LZH7Y4Y5.js} +5 -5
- package/dist/{claude-code-UBT4ZME7.js.map → claude-code-LZH7Y4Y5.js.map} +1 -1
- package/dist/cli/index.js +308 -162
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/cache.d.ts.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/config.d.ts.map +1 -1
- package/dist/cli/src/commands/connector.d.ts.map +1 -1
- package/dist/cli/src/commands/deploy.d.ts.map +1 -1
- package/dist/cli/src/commands/harness.d.ts +5 -4
- package/dist/cli/src/commands/harness.d.ts.map +1 -1
- package/dist/cli/src/commands/integration.d.ts.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/library-index.d.ts +6 -0
- package/dist/cli/src/commands/library-index.d.ts.map +1 -1
- package/dist/cli/src/commands/migrate-files.d.ts +3 -6
- package/dist/cli/src/commands/migrate-files.d.ts.map +1 -1
- package/dist/cli/src/commands/migrate-harness.d.ts +4 -3
- package/dist/cli/src/commands/migrate-harness.d.ts.map +1 -1
- package/dist/cli/src/commands/migrate.d.ts +2 -2
- package/dist/cli/src/commands/outdated.d.ts.map +1 -1
- package/dist/cli/src/commands/plugin-registry-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/project.d.ts +7 -1
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/cli/src/commands/run.d.ts.map +1 -1
- package/dist/cli/src/commands/serve-preflight.d.ts +21 -0
- package/dist/cli/src/commands/serve-preflight.d.ts.map +1 -1
- package/dist/cli/src/commands/serve.d.ts.map +1 -1
- package/dist/cli/src/commands/source-manifest.d.ts.map +1 -1
- package/dist/cli/src/commands/source.d.ts +8 -0
- package/dist/cli/src/commands/source.d.ts.map +1 -1
- package/dist/cli/src/commands/update.d.ts.map +1 -1
- package/dist/cli/src/commands/validate-instances.d.ts +6 -0
- package/dist/cli/src/commands/validate-instances.d.ts.map +1 -1
- package/dist/cli/src/commands/validate.d.ts.map +1 -1
- package/dist/cli/src/commands/verify.d.ts.map +1 -1
- package/dist/cli/src/config-checks.d.ts +8 -0
- package/dist/cli/src/config-checks.d.ts.map +1 -1
- package/dist/cli/src/ensure-sources.d.ts.map +1 -1
- package/dist/cli/src/helpers.d.ts +3 -2
- package/dist/cli/src/helpers.d.ts.map +1 -1
- package/dist/cli/src/plugin-store/index.d.ts.map +1 -1
- package/dist/cli/src/plugin-store/reconcile.d.ts.map +1 -1
- package/dist/cli/src/plugin-store/spec.d.ts +1 -0
- package/dist/cli/src/plugin-store/spec.d.ts.map +1 -1
- package/dist/cli/src/skill-checks.d.ts +2 -0
- package/dist/cli/src/skill-checks.d.ts.map +1 -1
- package/dist/connectors/config.js +5 -5
- package/dist/connectors/index.js +24 -25
- package/dist/connectors/src/connector-manager.d.ts.map +1 -1
- package/dist/connectors/src/index.d.ts +2 -2
- package/dist/connectors/src/index.d.ts.map +1 -1
- package/dist/connectors/src/managed-gitconfig.d.ts +22 -0
- package/dist/connectors/src/managed-gitconfig.d.ts.map +1 -1
- package/dist/connectors/src/mount-ledger.d.ts.map +1 -1
- package/dist/connectors/src/npm-installer.d.ts +11 -3
- package/dist/connectors/src/npm-installer.d.ts.map +1 -1
- package/dist/connectors-HU5MHSUJ.js +49 -0
- package/dist/{connectors-4WH32NK2.js.map → connectors-HU5MHSUJ.js.map} +1 -1
- package/dist/connectors-shared/index.js +2 -2
- package/dist/core/index.js +7 -7
- package/dist/core/logging.js +1 -1
- package/dist/core/manifest.js +2 -2
- package/dist/core/models.js +1 -1
- package/dist/core/publish-manifest.js +3 -3
- package/dist/core/ref.js +1 -1
- package/dist/core/runtime-assets.js +5 -5
- package/dist/core/src/agent-instances.d.ts +6 -0
- package/dist/core/src/agent-instances.d.ts.map +1 -1
- package/dist/core/src/config-key-diagnostics.d.ts +2 -1
- package/dist/core/src/config-key-diagnostics.d.ts.map +1 -1
- package/dist/core/src/index.d.ts +4 -4
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/lock.d.ts +20 -1
- package/dist/core/src/lock.d.ts.map +1 -1
- package/dist/core/src/logging/index.d.ts +1 -0
- package/dist/core/src/logging/index.d.ts.map +1 -1
- package/dist/core/src/logging/log-safe-text.d.ts +20 -0
- package/dist/core/src/logging/log-safe-text.d.ts.map +1 -0
- package/dist/core/src/manifest-yaml-editor.d.ts +4 -1
- package/dist/core/src/manifest-yaml-editor.d.ts.map +1 -1
- package/dist/core/src/manifest.d.ts.map +1 -1
- package/dist/core/src/models.d.ts +10 -0
- package/dist/core/src/models.d.ts.map +1 -1
- package/dist/core/src/repo-manager.d.ts +11 -0
- package/dist/core/src/repo-manager.d.ts.map +1 -1
- package/dist/core/src/runtime-assets.d.ts +12 -1
- package/dist/core/src/runtime-assets.d.ts.map +1 -1
- package/dist/core/src/walker.d.ts +3 -0
- package/dist/core/src/walker.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +10 -2
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/workspace-config.js +4 -4
- package/dist/deploy/index.js +7 -7
- package/dist/discovery/index.js +5 -5
- package/dist/{ensure-sources-UC2RBYMP.js → ensure-sources-CAMWJTMR.js} +32 -32
- package/dist/ensure-sources-CAMWJTMR.js.map +1 -0
- package/dist/factory-assets/connectors/box.js +24 -25
- package/dist/factory-assets/connectors/deploy.js +24 -25
- package/dist/factory-assets/connectors/devserver.js +24 -25
- package/dist/factory-assets/connectors/flow/adapter.js +24 -25
- package/dist/factory-assets/connectors/flow/engine.js +8 -8
- package/dist/factory-assets/connectors/flow/run-flow.js +26 -27
- package/dist/factory-assets/connectors/flow.js +24 -25
- package/dist/factory-assets/connectors/git.js +24 -25
- package/dist/factory-assets/connectors/gmail.js +24 -25
- package/dist/factory-assets/connectors/googledrive.js +24 -25
- package/dist/factory-assets/connectors/local.js +24 -25
- package/dist/factory-assets/connectors/mattermost.js +24 -25
- package/dist/factory-assets/connectors/memory.js +24 -25
- package/dist/factory-assets/connectors/minio.js +24 -25
- package/dist/factory-assets/connectors/postgres.js +24 -25
- package/dist/factory-assets/connectors/s3.js +24 -25
- package/dist/factory-assets/connectors/sharepoint.js +24 -25
- package/dist/factory-assets/connectors/sqlite.js +24 -25
- package/dist/factory-assets/connectors/static-server.js +24 -25
- package/dist/factory-assets/connectors/tunnel.js +24 -25
- package/dist/factory-assets/connectors/webdav.js +24 -25
- package/dist/factory-assets/connectors/xstate-store.js +24 -25
- package/dist/factory-assets/connectors/xstate.js +24 -25
- package/dist/factory-assets/skills/authoring-skaile-assets/SKILL.md +2 -1
- package/dist/{flows-LYTKNGKE.js → flows-GVOVQGQW.js} +12 -12
- package/dist/{flows-LYTKNGKE.js.map → flows-GVOVQGQW.js.map} +1 -1
- package/dist/{helpers-SSSKT5XK.js → helpers-WMCCODAV.js} +29 -30
- package/dist/{helpers-SSSKT5XK.js.map → helpers-WMCCODAV.js.map} +1 -1
- package/dist/library/index.js +11 -11
- package/dist/library/install.js +4 -4
- package/dist/library/src/manifest-writer.d.ts +9 -0
- package/dist/library/src/manifest-writer.d.ts.map +1 -1
- package/dist/library/src/remote/remote-catalog-source.d.ts +9 -0
- package/dist/library/src/remote/remote-catalog-source.d.ts.map +1 -1
- package/dist/library/src/remote/rest-catalog-source.d.ts +1 -0
- package/dist/library/src/remote/rest-catalog-source.d.ts.map +1 -1
- package/dist/{library-publish-GQMNTAKK.js → library-publish-UQQMHTND.js} +55 -55
- package/dist/{library-publish-GQMNTAKK.js.map → library-publish-UQQMHTND.js.map} +1 -1
- package/dist/model-endpoint/index.js +10 -11
- package/dist/open-library-OJ4HT2X4.js +57 -0
- package/dist/{open-library-XGUCUJYE.js.map → open-library-OJ4HT2X4.js.map} +1 -1
- package/dist/open-registry-LWGIOJDK.js +32 -0
- package/dist/{open-registry-DIFEPDF6.js.map → open-registry-LWGIOJDK.js.map} +1 -1
- package/dist/paths-FR2752HV.js +22 -0
- package/dist/{paths-G4GFJLE2.js.map → paths-FR2752HV.js.map} +1 -1
- package/dist/{plugin-store-BBLDFD3L.js → plugin-store-IALJUBN2.js} +10 -10
- package/dist/{plugin-store-BBLDFD3L.js.map → plugin-store-IALJUBN2.js.map} +1 -1
- package/dist/project-UQFCYHYS.js +88 -0
- package/dist/{project-LB745WVZ.js.map → project-UQFCYHYS.js.map} +1 -1
- package/dist/resolver/index.js +8 -8
- package/dist/runner/index.js +40 -41
- package/dist/runner/src/composition/resolve-instance.d.ts.map +1 -1
- package/dist/runner/src/composition/resolve.d.ts +6 -0
- package/dist/runner/src/composition/resolve.d.ts.map +1 -1
- package/dist/runner/src/credential-notice.d.ts +3 -2
- package/dist/runner/src/credential-notice.d.ts.map +1 -1
- package/dist/runner/src/external-mcp.d.ts +22 -0
- package/dist/runner/src/external-mcp.d.ts.map +1 -1
- package/dist/runner/src/mcp-tools-snapshot.d.ts +13 -0
- package/dist/runner/src/mcp-tools-snapshot.d.ts.map +1 -0
- package/dist/runner/src/resources.d.ts +14 -0
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +14 -14
- package/dist/sdk/bridge.js +20 -21
- package/dist/sdk/core.js +7 -7
- package/dist/sdk/flow.js +8 -8
- package/dist/sdk/index.js +40 -41
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/resolver.js +8 -8
- package/dist/sdk/runner.js +40 -41
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/transport/ws/server.js +8 -8
- package/dist/sdk/transport/ws.js +8 -8
- package/dist/sdk/transport.js +8 -8
- package/dist/sdk/types.js +1 -1
- package/dist/serve-preflight-TYEKHC32.js +56 -0
- package/dist/serve-preflight-TYEKHC32.js.map +1 -0
- package/dist/session/index.js +2 -2
- package/dist/{setup-X6ZYH2MW.js → setup-4JV2IMCB.js} +30 -31
- package/dist/setup-4JV2IMCB.js.map +1 -0
- package/dist/{skills-62PXDBPJ.js → skills-6QTKFMLW.js} +13 -13
- package/dist/{skills-62PXDBPJ.js.map → skills-6QTKFMLW.js.map} +1 -1
- package/dist/source-XYMMJVKR.js +86 -0
- package/dist/{source-LAYCTRHP.js.map → source-XYMMJVKR.js.map} +1 -1
- package/dist/{source-manifest-publish-3S6PJ25W.js → source-manifest-publish-SZFGGKB4.js} +52 -53
- package/dist/source-manifest-publish-SZFGGKB4.js.map +1 -0
- package/dist/transport/index.js +8 -8
- package/dist/transport/ws/server.js +8 -8
- package/dist/transport/ws.js +8 -8
- package/dist/tui/index.js +40 -41
- package/dist/tui/index.js.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/manifests.js +1 -1
- package/dist/types/src/manifests/agent.d.ts +2 -2
- package/dist/types/src/manifests/agent.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +8 -8
- package/dist/workspace-plugin/adapters/mcp.js +31 -32
- package/dist/workspace-plugin/adapters/omp.js +14 -14
- package/dist/workspace-plugin/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-24D7IW5O.js.map +0 -1
- package/dist/chunk-2WOA3TKK.js.map +0 -1
- package/dist/chunk-3ENE6ZOF.js.map +0 -1
- package/dist/chunk-5T3DTK7A.js.map +0 -1
- package/dist/chunk-6OHZUUR7.js.map +0 -1
- package/dist/chunk-6UP2EDFN.js.map +0 -1
- package/dist/chunk-6WQGJF65.js.map +0 -1
- package/dist/chunk-6X3GDPCB.js.map +0 -1
- package/dist/chunk-76FLBODK.js.map +0 -1
- package/dist/chunk-76WSWPOB.js.map +0 -1
- package/dist/chunk-ABVWUM2E.js.map +0 -1
- package/dist/chunk-DKXNKFKP.js.map +0 -1
- package/dist/chunk-EXRQKOY6.js.map +0 -1
- package/dist/chunk-GBXQFJ4G.js.map +0 -1
- package/dist/chunk-HXZ3FQQN.js.map +0 -1
- package/dist/chunk-IYZAJ2J2.js.map +0 -1
- package/dist/chunk-JSWMRYLM.js.map +0 -1
- package/dist/chunk-P7EL7QRD.js.map +0 -1
- package/dist/chunk-QJQQNBVT.js +0 -315
- package/dist/chunk-QJQQNBVT.js.map +0 -1
- package/dist/chunk-TF5CWJQZ.js.map +0 -1
- package/dist/chunk-TGB4E5Z6.js.map +0 -1
- package/dist/chunk-UVTN4O7N.js.map +0 -1
- package/dist/chunk-VSCLUPGZ.js.map +0 -1
- package/dist/chunk-VV2DJT4I.js.map +0 -1
- package/dist/chunk-YJNE4V2M.js.map +0 -1
- package/dist/connectors-4WH32NK2.js +0 -50
- package/dist/ensure-sources-UC2RBYMP.js.map +0 -1
- package/dist/open-library-XGUCUJYE.js +0 -58
- package/dist/open-registry-DIFEPDF6.js +0 -32
- package/dist/paths-G4GFJLE2.js +0 -22
- package/dist/project-LB745WVZ.js +0 -88
- package/dist/serve-preflight-NPWI4MV6.js.map +0 -1
- package/dist/setup-X6ZYH2MW.js.map +0 -1
- package/dist/source-LAYCTRHP.js +0 -87
- package/dist/source-manifest-publish-3S6PJ25W.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../core/src/fs-deadline.ts","../core/src/requirements.ts","../core/src/manifest.ts"],"names":["parse"],"mappings":";;;;;;;;AA4BO,IAAM,sBAAA,GAAyB;AAQ/B,IAAM,mBAAA,GAAsB;AAQ5B,IAAM,eAAA,GAAN,cAA8B,KAAA,CAAM;AAAA,EAChC,SAAA;AAAA,EACA,SAAA;AAAA,EAET,W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VV2DJT4I.js","sourcesContent":["/**\n * Deadline guards for filesystem work that can land on a network mount.\n *\n * Inside the agent container `/skaile/workspace` **is** an rclone FUSE mount\n * (SharePoint / OneDrive / WebDAV). When the host rclone process wedges, a\n * filesystem call against that path parks in an uninterruptible kernel wait.\n * A **synchronous** call there stops the entire single-threaded event loop —\n * the whole `skaile serve` process stops serving, and the platform reads the\n * session as dead or idle. A hang is not an error, so `try/catch` never fires.\n *\n * Two rules follow, and both matter:\n *\n * 1. **Never touch a mount synchronously.** Async `node:fs/promises` keeps the\n * loop free, so a wedged mount degrades to one stuck request instead of a\n * dead session. This is the actual fix.\n * 2. **Bound the wait.** {@link withFsDeadline} converts an unbounded wait into\n * a bounded failure so the requester gets an error rather than nothing.\n *\n * `withFsDeadline` does **not** cancel the underlying operation — Node cannot\n * abort a syscall already in the kernel. The losing promise stays pending until\n * the mount recovers or the process exits. That is acceptable precisely because\n * rule 1 holds: a pending promise costs one handle, not the event loop.\n *\n * Modelled on `connectors/src/fleet-utils.ts` (`ensureFleetMounted`), which\n * already does async-stat-with-deadline correctly.\n */\n\n/** Default deadline for a single filesystem operation on a possibly-networked mount. */\nexport const DEFAULT_FS_DEADLINE_MS = 15_000;\n\n/**\n * Env override for {@link DEFAULT_FS_DEADLINE_MS}, in milliseconds.\n *\n * A cloud-backed mount over a slow link can legitimately need longer than the\n * default; operators raise this rather than patching call sites.\n */\nexport const FS_DEADLINE_ENV_VAR = \"SKAILE_FS_DEADLINE_MS\";\n\n/**\n * Thrown when a filesystem operation misses its deadline.\n *\n * Distinct from a plain `Error` so callers can tell \"the mount is wedged\" apart\n * from \"the file does not exist\" and surface the right message to the frontend.\n */\nexport class FsDeadlineError extends Error {\n readonly timeoutMs: number;\n readonly operation: string;\n\n constructor(operation: string, timeoutMs: number) {\n super(\n `filesystem operation \"${operation}\" exceeded ${timeoutMs}ms — the mount may be unresponsive`,\n );\n this.name = \"FsDeadlineError\";\n this.operation = operation;\n this.timeoutMs = timeoutMs;\n }\n}\n\n/**\n * Resolve the effective filesystem deadline.\n *\n * Reads {@link FS_DEADLINE_ENV_VAR} on every call rather than caching it: the\n * runner mutates `process.env` while wiring a session, so a module-load-time\n * snapshot would pin the value set before configuration ran.\n *\n * @param fallback - Deadline to use when the env var is absent or unusable.\n * @returns The deadline in milliseconds.\n */\nexport function fsDeadlineMs(fallback: number = DEFAULT_FS_DEADLINE_MS): number {\n const raw = process.env[FS_DEADLINE_ENV_VAR];\n if (raw === undefined) return fallback;\n const parsed = Number.parseInt(raw, 10);\n // A non-positive or non-numeric override would disable the guard entirely,\n // which is exactly the failure mode this module exists to prevent.\n return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;\n}\n\n/**\n * Run an async filesystem operation under a deadline.\n *\n * @param operation - Short label used in the timeout message (e.g. `\"readdir /skaile/workspace\"`).\n * @param fn - Thunk performing the operation. Called immediately.\n * @param timeoutMs - Deadline override; defaults to {@link fsDeadlineMs}.\n * @returns The operation's result.\n * @throws {FsDeadlineError} when the deadline elapses first.\n * @throws Whatever `fn` rejects with, unchanged, when it loses no race.\n * @docLink packages/core/api-reference#with-fs-deadline\n */\nexport async function withFsDeadline<T>(\n operation: string,\n fn: () => Promise<T>,\n timeoutMs: number = fsDeadlineMs(),\n): Promise<T> {\n let timer: ReturnType<typeof setTimeout> | undefined;\n try {\n return await Promise.race([\n fn(),\n new Promise<never>((_resolve, reject) => {\n timer = setTimeout(() => reject(new FsDeadlineError(operation, timeoutMs)), timeoutMs);\n // Never hold the process open on the guard alone — without unref a\n // pending deadline would keep `skaile serve` alive after shutdown.\n timer.unref?.();\n }),\n ]);\n } finally {\n if (timer !== undefined) clearTimeout(timer);\n }\n}\n\n/**\n * Run an async filesystem operation under a deadline, mapping every failure to\n * `fallback`.\n *\n * For best-effort probes that previously used `existsSync` — a missing file, an\n * unreadable file, and a wedged mount are all \"nothing usable here\", and the\n * caller has no better move than to continue without it.\n *\n * @param operation - Short label used in the timeout message.\n * @param fn - Thunk performing the operation.\n * @param fallback - Value returned when `fn` rejects or the deadline elapses.\n * @param timeoutMs - Deadline override; defaults to {@link fsDeadlineMs}.\n */\nexport async function tryWithFsDeadline<T>(\n operation: string,\n fn: () => Promise<T>,\n fallback: T,\n timeoutMs: number = fsDeadlineMs(),\n): Promise<T> {\n try {\n return await withFsDeadline(operation, fn, timeoutMs);\n } catch {\n return fallback;\n }\n}\n","/**\n * Requirement identity — one key for \"asset X requires asset Y\", wherever the\n * declaration comes from (a SKILL.md `metadata.requires` entry, a manifest\n * `dependencies:` entry, a lock-time edge).\n *\n * A requirement is identified by `publisher/kind:name`. A declaration that names\n * no publisher means \"the declaring asset's own publisher\", so `report-table` on a\n * `@skaile-ai` asset and `skill:@skaile-ai/report-table` are the same requirement.\n * Every command that lists, dedupes or compares requirements goes through here.\n */\n\nimport { type Dependency, depToStr, parseDep } from \"./models.js\";\n\n/**\n * `publisher/kind:name` identity of a requirement. A dependency that names no\n * publisher takes `fallbackPublisher` (the declaring asset's); without either, the\n * key is the unqualified `kind:name`.\n */\nexport function requirementKey(dep: Dependency, fallbackPublisher?: string): string {\n const publisher = dep.publisher ?? fallbackPublisher ?? \"\";\n return publisher ? `${publisher}/${dep.kind}:${dep.name}` : `${dep.kind}:${dep.name}`;\n}\n\n/**\n * Each requirement once, in first-seen order. Two declarations of the same\n * {@link requirementKey} collapse into one; the surviving entry carries the\n * publisher and the pin of whichever declaration named them.\n */\nexport function dedupeRequirements(\n deps: readonly Dependency[],\n fallbackPublisher?: string,\n): Dependency[] {\n const out: Dependency[] = [];\n const at = new Map<string, number>();\n for (const dep of deps) {\n const key = requirementKey(dep, fallbackPublisher);\n const i = at.get(key);\n if (i === undefined) {\n at.set(key, out.length);\n out.push({ ...dep });\n continue;\n }\n const kept = out[i] as Dependency;\n if (!kept.publisher && dep.publisher) kept.publisher = dep.publisher;\n if (!kept.pin && dep.pin) kept.pin = dep.pin;\n }\n return out;\n}\n\n/** {@link dedupeRequirements} for requirement strings (`kind:name[#pin]`, `kind:@pub/name[#pin]`). */\nexport function dedupeRequirementRefs(\n refs: readonly string[],\n fallbackPublisher?: string,\n): string[] {\n const parse = (ref: string): Dependency => {\n const dep = parseDep(ref);\n // The scoped form carries its own pin; a bare `kind:name#pin` keeps it in the name.\n const hash = dep.name.indexOf(\"#\");\n if (hash === -1) return dep;\n const pin = dep.name.slice(hash + 1).trim();\n dep.name = dep.name.slice(0, hash);\n if (pin && !dep.pin) dep.pin = pin;\n return dep;\n };\n return dedupeRequirements(refs.map(parse), fallbackPublisher).map(depToStr);\n}\n","/**\n * Manifest parsing — reads SKILL.md, AGENT.md, agent.yaml, CONTRACT.md,\n * CONNECTOR.md, *.prompt.md, *.flow.yaml, *.preset.yaml files and\n * produces CatalogEntry objects.\n * Used by @skaile/asset-manager for on-demand repo scanning.\n *\n * **All filesystem access here is async and bounded** (issue #454). A repo root\n * can resolve onto the rclone FUSE mount at `/skaile/workspace` — either\n * directly (a `sources[].path` pointing into the workspace) or indirectly, since\n * the walk follows symlinks and an off-mount tree can link into one. A\n * synchronous `readdirSync`/`statSync`/`readFileSync` there parks the whole\n * `skaile serve` event loop in an uninterruptible kernel wait, and a hang is not\n * an error so `try/catch` never fires. Every call goes through\n * {@link withFsDeadline}/{@link tryWithFsDeadline}, and the walk itself is\n * bounded by depth, entry count, a wall-clock budget, and an ancestor-inode set.\n */\n\nimport type { Dirent } from \"node:fs\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { opendir, readFile, stat } from \"node:fs/promises\";\nimport { basename, dirname, join } from \"node:path\";\nimport { parse } from \"yaml\";\nimport { fsDeadlineMs, tryWithFsDeadline, withFsDeadline } from \"./fs-deadline.js\";\nimport { createLogger } from \"./logging/create-logger.js\";\nimport type { AssetKind, CatalogEntry, Dependency } from \"./models.js\";\nimport { isValidAssetName, parseDep, slugifyAssetName } from \"./models.js\";\nimport { dedupeRequirements } from \"./requirements.js\";\nimport type { Diagnostic } from \"./workspace-config.js\";\n\n// ── Bounded manifest I/O ──────────────────────────────────────────────────────\n\n/**\n * Read one manifest file under a deadline.\n *\n * @param filePath - Absolute path to the manifest.\n * @param timeoutMs - Per-operation deadline; defaults to {@link fsDeadlineMs}.\n * @throws {import(\"./fs-deadline.js\").FsDeadlineError} when the read outlives the deadline.\n */\nfunction readManifestFile(filePath: string, timeoutMs?: number): Promise<string> {\n return withFsDeadline(`readFile ${filePath}`, () => readFile(filePath, \"utf8\"), timeoutMs);\n}\n\n/**\n * Read one manifest file under a deadline, degrading an unreadable/slow file to\n * an empty document. Mirrors the pre-#454 `try { readFileSync } catch {}` shape\n * of the YAML parsers: a file we cannot read yields `{}` metadata rather than\n * aborting the caller.\n */\nfunction readManifestFileOrEmpty(filePath: string, timeoutMs?: number): Promise<string> {\n return tryWithFsDeadline(`readFile ${filePath}`, () => readFile(filePath, \"utf8\"), \"\", timeoutMs);\n}\n\n// ── Frontmatter helpers ───────────────────────────────────────────────────────\n\n/**\n * Result of parsing YAML frontmatter from a markdown file.\n * @docLink packages/core/concepts#frontmatter-result\n */\nexport interface FrontmatterResult {\n /** Parsed YAML data. Empty object if no frontmatter block is present. */\n data: Record<string, unknown>;\n /** Markdown body below the frontmatter block (trimmed). */\n body: string;\n}\n\n/**\n * Parse YAML frontmatter from a markdown file (`---` delimited).\n * Returns `{ data: {}, body: text }` when no frontmatter block is present.\n * A leading UTF-8 byte-order mark and `\\r\\n` line endings (Windows editors, `git` autocrlf)\n * are read as plain `\\n` text: the same file parses the same on every platform, and a\n * scalar never carries a trailing `\\r`.\n *\n * @param raw - Raw file contents\n * @returns Parsed frontmatter data and the remaining body text\n * @docLink packages/core/concepts#parse-frontmatter\n */\nexport function parseFrontmatter(raw: string): FrontmatterResult {\n const text = raw.replace(/^\\uFEFF/, \"\").replace(/\\r\\n/g, \"\\n\");\n const m = text.match(/^---\\s*\\n([\\s\\S]*?)\\n---/);\n if (!m) return { data: {}, body: text.trim() };\n try {\n const data = (parse(m[1]!) as Record<string, unknown>) ?? {};\n const body = text.slice(m[0].length).trim();\n return { data, body };\n } catch {\n return { data: {}, body: text.trim() };\n }\n}\n\n/**\n * The 1-based line a YAML parser message points at (`at line 5, column 5` of the `yaml` package,\n * `(5:5)` of js-yaml), or `undefined` when the message names none.\n */\nfunction yamlErrorLine(message: string): number | undefined {\n const m = /at line (\\d+)|\\((\\d+):\\d+\\)/.exec(message);\n const line = m?.[1] ?? m?.[2];\n return line === undefined ? undefined : Number(line);\n}\n\n/** A line of YAML without its quoted strings and its comment. */\nfunction unquotedYamlLine(line: string): string {\n return line.replace(/\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^']|'')*'/g, '\"\"').replace(/(^|\\s)#.*$/, \"\");\n}\n\n/**\n * The sentence that tells an author to quote a value YAML cannot start (`- @acme/dep-a`), or `\"\"`.\n * Read from the parser's `cause` (`Plain value cannot start with reserved character @`) or, for\n * a parser that words it otherwise (`bad indentation of a sequence entry`, `missed comma between\n * flow collection entries`), from the line of `text` the error points at: a value that starts with\n * `@` in a list item, after a key or inside a flow list on that line. An error on a line without\n * an unquoted `@` value (an unclosed `[` further down, `@` inside a quoted string or a comment)\n * gets no hint. One text for every YAML file skaile reads (p1750).\n *\n * @param cause - The parser message (its first line)\n * @param text - The YAML the parser read\n * @param line - 1-based error line in `text`; read from `cause` when omitted\n */\nexport function yamlQuotingHint(cause: string, text?: string, line?: number): string {\n const reserved = /reserved character|cannot start/i.test(cause);\n const at = line ?? yamlErrorLine(cause);\n const errorLine = text !== undefined && at !== undefined ? text.split(\"\\n\")[at - 1] : undefined;\n const startsWithAt =\n errorLine !== undefined &&\n /^\\s*-\\s+@|^\\s*[^\\s#][^#]*?:\\s+@|[[,]\\s*@/.test(unquotedYamlLine(errorLine));\n if (!reserved && !startsWithAt) return \"\";\n const example = startsWithAt || /character @/.test(cause) ? ', e.g. \"@publisher/name\"' : \"\";\n return ` Put the value in double quotes${example}.`;\n}\n\n/**\n * A YAML parser message with {@link yamlQuotingHint} after its first line (the cause); the source\n * excerpt the parser appends below it stays where it was. `message` unchanged when no hint applies.\n */\nexport function withYamlQuotingHint(message: string, text: string): string {\n const [first = \"\", ...rest] = message.split(\"\\n\");\n const hint = yamlQuotingHint(first, text);\n if (hint === \"\" || first.includes(\"double quotes\")) return message;\n const cause = first.replace(/[.:]$/, \"\");\n return [`${cause}.${hint}`, ...rest].join(\"\\n\");\n}\n\n/**\n * Why a `---` front matter block is not valid YAML, `undefined` when the file has no block or the\n * block parses. {@link parseFrontmatter} reads such a block as no front matter at all, so a\n * caller that says \"no front matter\" for a file that has one names the YAML error here instead:\n * the cause, the file line, and for a value YAML cannot start (`- @acme/dep-a`) the quoting fix\n * (p1551).\n *\n * @param raw - Raw file contents\n */\nexport function frontmatterYamlProblem(raw: string): string | undefined {\n const text = raw.replace(/^\\uFEFF/, \"\").replace(/\\r\\n/g, \"\\n\");\n const m = text.match(/^---\\s*\\n([\\s\\S]*?)\\n---/);\n if (!m) return undefined;\n try {\n parse(m[1]!);\n return undefined;\n } catch (e) {\n const err = e as { message?: string; linePos?: Array<{ line: number }> };\n const cause = (err.message ?? String(e)).split(\" at line \")[0]!.trim();\n const before = text.slice(0, m[0].length - m[1]!.length - 4).split(\"\\n\").length - 1;\n const line = err.linePos?.[0]?.line;\n const where = line === undefined ? \"\" : ` (line ${before + line} of the file)`;\n const quoting = yamlQuotingHint(cause, m[1], line);\n return `the front matter is not valid YAML: ${cause}${where}.${quoting}`;\n }\n}\n\n/** Extract version from frontmatter, checking both top-level and metadata.version. */\nfunction extractVersion(meta: Record<string, unknown>): string {\n return String(\n meta.version ?? (meta.metadata as Record<string, unknown> | undefined)?.version ?? \"\",\n );\n}\n\n/**\n * Parse the `requires:` field from manifest frontmatter into typed `Dependency` objects.\n * Accepts a comma-separated string or an array of `\"kind:name\"` strings. Reads from either\n * the root or `metadata.requires` (matching `extractVersion`'s dual-location behavior) so\n * skill authors can follow the agentskills.io convention of placing skaile extensions under\n * `metadata:` while remaining backward-compatible with root-level declarations.\n *\n * @param meta - Parsed frontmatter data object\n * @returns Array of `Dependency` objects (empty when `requires` is absent)\n * @docLink packages/core/concepts#parse-requires\n */\nexport function parseRequires(meta: Record<string, unknown>): Dependency[] {\n const raw = meta.requires ?? (meta.metadata as Record<string, unknown> | undefined)?.requires;\n if (!raw) return [];\n const list =\n typeof raw === \"string\"\n ? raw.split(\",\").map((s) => s.trim())\n : Array.isArray(raw)\n ? (raw as string[])\n : [];\n return list.filter(Boolean).map(parseDep);\n}\n\n// ── agent.yaml composes → requires ─────────────────────────────────────────────\n\n/**\n * Collect the catalog refs of an `agent.yaml` `composes[]` list as requires so\n * `skaile install` pulls them automatically. Local paths (`.`/`/`) and\n * `library://` instance refs are skipped — not catalog assets. A ref without a\n * `kind:` prefix takes the item's `kind`; the publisher scope, `@version` and\n * `#pin` are stripped so only `kind:name` is tracked.\n */\nfunction collectComposeRefs(raw: unknown, out: Dependency[]): void {\n if (!Array.isArray(raw)) return;\n for (const item of raw) {\n if (typeof item !== \"object\" || item === null) continue;\n const { kind: itemKind, ref } = item as Record<string, unknown>;\n if (typeof ref !== \"string\" || !ref) continue;\n if (ref.startsWith(\".\") || ref.startsWith(\"/\") || ref.includes(\"://\")) continue;\n if (typeof itemKind !== \"string\" || !itemKind) continue;\n const normalized = ref.includes(\":\") ? ref : `${itemKind}:${ref}`;\n const colonIdx = normalized.indexOf(\":\");\n const kind = normalized.slice(0, colonIdx).trim();\n let rest = normalized.slice(colonIdx + 1).trim();\n const hashIdx = rest.indexOf(\"#\");\n if (hashIdx !== -1) rest = rest.slice(0, hashIdx).trim();\n if (rest.startsWith(\"@\")) {\n // Scoped form @publisher/name → name is the segment after the slash.\n const slashIdx = rest.indexOf(\"/\");\n rest = slashIdx !== -1 ? rest.slice(slashIdx + 1).trim() : \"\";\n }\n // A trailing `@<version>` range (`name@^1`) is not part of the name.\n const atIdx = rest.indexOf(\"@\");\n const name = atIdx !== -1 ? rest.slice(0, atIdx).trim() : rest;\n if (name) out.push({ kind, name });\n }\n}\n\n// ── Manifest parsers ──────────────────────────────────────────────────────────\n\n/**\n * Thrown when a `SKILL.md`-style manifest declares a `type:` that is not a\n * registered asset kind. The kind registry is the only authority on kinds, so an\n * unregistered `type:` is reported (see {@link manifestKindDiagnostic}) instead\n * of being silently catalogued as a skill.\n */\nexport class ManifestKindError extends Error {\n constructor(\n readonly filePath: string,\n readonly kind: string,\n ) {\n super(`${filePath}: unknown asset kind \"${kind}\" in frontmatter \\`type:\\``);\n this.name = \"ManifestKindError\";\n }\n}\n\n/** Convert a {@link ManifestKindError} into the `unknown_asset_kind` error diagnostic. */\nexport function manifestKindDiagnostic(err: ManifestKindError): Diagnostic {\n return {\n code: \"unknown_asset_kind\",\n severity: \"error\",\n message: `${err.filePath}: asset kind \"${err.kind}\" is not registered`,\n path: err.filePath,\n };\n}\n\n/**\n * Parse a `SKILL.md` file into a `CatalogEntry`.\n * The `kind` field defaults to `\"skill\"` but can be overridden via the `type:`\n * frontmatter key to any registered kind. Falls back to the parent directory name\n * when `name:` is absent.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the `SKILL.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @param knownKinds - Registered asset kinds (`registry.getAllKinds()`); a `type:` outside it throws\n * @returns Populated `CatalogEntry` with kind, name, description, version, and requires\n * @throws {ManifestKindError} when `type:` names an unregistered kind\n * @docLink packages/core/concepts#from-skill-md\n */\nexport async function fromSkillMd(\n filePath: string,\n repoName: string,\n knownKinds: ReadonlySet<string>,\n): Promise<CatalogEntry> {\n return fromSkillMdContent(await readManifestFile(filePath), repoName, filePath, knownKinds);\n}\n\n/** Pure {@link fromSkillMd} core over already-read content (no I/O). */\nfunction fromSkillMdContent(\n content: string,\n repoName: string,\n filePath: string,\n knownKinds: ReadonlySet<string>,\n): CatalogEntry {\n const { data: meta } = parseFrontmatter(content);\n // An absent `type:` is the SKILL.md default; an explicit one must be registered.\n const kind = meta.type === undefined ? \"skill\" : String(meta.type);\n if (meta.type !== undefined && !knownKinds.has(kind)) throw new ManifestKindError(filePath, kind);\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind,\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Parse an `AGENT.md` file into a `CatalogEntry` with `kind: \"agent\"`.\n * Falls back to the parent directory name when `name:` is absent.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the `AGENT.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"agent\"`\n * @docLink packages/core/concepts#from-agent-md\n */\nexport async function fromAgentMd(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromAgentMdContent(await readManifestFile(filePath), repoName, filePath);\n}\n\n/** Pure {@link fromAgentMd} core over already-read content (no I/O). */\nfunction fromAgentMdContent(content: string, repoName: string, filePath: string): CatalogEntry {\n const { data: meta } = parseFrontmatter(content);\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind: \"agent\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Parse an `agent.yaml` file into a `CatalogEntry` with `kind: \"agent\"`.\n * `requires` lists the catalog refs of `composes[]` (local paths and `library://`\n * instances excluded). The deprecated 0.1 fields (`skills`, `requires`, `persona`,\n * …) are not read; `skaile validate` reports them.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the `agent.yaml` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"agent\"` and full dependency graph\n * @docLink packages/core/concepts#from-agent-yaml\n */\nexport async function fromAgentYaml(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromAgentYamlContent(await readManifestFileOrEmpty(filePath), repoName, filePath);\n}\n\n/**\n * The catalog requirements of an `agent.yaml` text: its `composes[]` refs (see\n * {@link collectComposeRefs}). Empty for text that is not YAML.\n */\nexport function agentYamlRequires(content: string): Dependency[] {\n let meta: Record<string, unknown> = {};\n try {\n meta = (parse(content) as Record<string, unknown>) ?? {};\n } catch {}\n const requires: Dependency[] = [];\n collectComposeRefs(meta.composes, requires);\n return requires;\n}\n\n/** Pure {@link fromAgentYaml} core over already-read content (no I/O). */\nfunction fromAgentYamlContent(content: string, repoName: string, filePath: string): CatalogEntry {\n let meta: Record<string, unknown> = {};\n try {\n meta = (parse(content) as Record<string, unknown>) ?? {};\n } catch {}\n\n const requires = agentYamlRequires(content);\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind: \"agent\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: String(meta.version ?? \"\"),\n requires,\n dependencies: [],\n };\n}\n\n/**\n * Parse a `*.prompt.md` file into a `CatalogEntry` with `kind: \"prompt\"`.\n * The name defaults to the filename stem (without the `.prompt.md` suffix)\n * when no `name:` frontmatter key is present.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the `.prompt.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"prompt\"`\n * @docLink packages/core/concepts#from-prompt-md\n */\nexport async function fromPromptMd(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromPromptMdContent(await readManifestFile(filePath), repoName, filePath);\n}\n\n/** Pure {@link fromPromptMd} core over already-read content (no I/O). */\nfunction fromPromptMdContent(content: string, repoName: string, filePath: string): CatalogEntry {\n const { data: meta } = parseFrontmatter(content);\n const name = String(meta.name ?? basename(filePath).replace(/\\.prompt\\.md$/, \"\"));\n return {\n name,\n kind: \"prompt\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Parse a `*.flow.yaml` or `*.flow.json` file into a `CatalogEntry` with `kind: \"flow\"`.\n * The name resolves from `id:` (a flow asset is named by its id, which the flow engine loads it\n * by), then `name:`, falling back to the filename stem; `name:` stays a display label.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the flow definition file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"flow\"`\n * @docLink packages/core/concepts#from-flow-yaml\n */\nexport async function fromFlowYaml(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromFlowYamlContent(await readManifestFileOrEmpty(filePath), repoName, filePath);\n}\n\n/**\n * The `kind:name[#pin]` refs the nodes of a v2 flow name in `run.assets`, deduped. They are the\n * flow's dependencies: `add flow:…` deploys them and `info` / `check` list them (p676). A string\n * without a `kind:` prefix is no asset ref and is left out.\n */\nfunction flowNodeAssetRefs(meta: Record<string, unknown>): string[] {\n const refs = new Set<string>();\n if (!Array.isArray(meta.nodes)) return [];\n for (const node of meta.nodes) {\n const run = (node as { run?: { assets?: unknown } } | null)?.run;\n if (!Array.isArray(run?.assets)) continue;\n for (const asset of run.assets) {\n if (typeof asset === \"string\" && /^[a-z][a-z-]*:/.test(asset.trim())) refs.add(asset.trim());\n }\n }\n return [...refs];\n}\n\n/** Pure {@link fromFlowYaml} core over already-read content (no I/O). */\nfunction fromFlowYamlContent(content: string, repoName: string, filePath: string): CatalogEntry {\n let meta: Record<string, unknown> = {};\n try {\n meta = (parse(content) as Record<string, unknown>) ?? {};\n } catch {}\n\n const stem = basename(filePath)\n .replace(/\\.flow\\.yaml$/, \"\")\n .replace(/\\.flow\\.json$/, \"\");\n return {\n name: String(meta.id ?? meta.name ?? stem),\n kind: \"flow\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: String(meta.version ?? \"\"),\n requires: parseRequires(meta),\n dependencies: flowNodeAssetRefs(meta),\n };\n}\n\n/**\n * Split a preset's `items[]` into the asset refs a dependency expansion installs\n * and the instance items it cannot: `library://` instance refs, `#item` cross\n * references, items that prompt for `placeholders`, and `connector:`/`mcp:` items\n * with an `id` (those become `skaile.yaml` declarations through\n * `skaile preset apply`). Refs are kept verbatim — publisher/pin qualifiers\n * preserved, nested `preset:` refs included.\n *\n * @param items - The raw `items` value of a parsed preset manifest.\n * @returns Deduped asset refs plus the count of skipped instance items.\n * @docLink packages/core/concepts#preset-item-refs\n */\nexport function presetItemRefs(items: unknown): { refs: string[]; skipped: number } {\n const refs = new Set<string>();\n let skipped = 0;\n if (!Array.isArray(items)) return { refs: [], skipped };\n for (const raw of items) {\n if (raw === null || typeof raw !== \"object\") continue;\n const item = raw as Record<string, unknown>;\n const ref = typeof item.ref === \"string\" ? item.ref.trim() : \"\";\n if (!ref) continue;\n const hasPlaceholders = Array.isArray(item.placeholders) && item.placeholders.length > 0;\n const declaresInstance =\n typeof item.id === \"string\" && (ref.startsWith(\"connector:\") || ref.startsWith(\"mcp:\"));\n if (\n ref.startsWith(\"library://\") ||\n ref.startsWith(\"#\") ||\n hasPlaceholders ||\n declaresInstance\n ) {\n skipped++;\n continue;\n }\n refs.add(ref);\n }\n return { refs: [...refs], skipped };\n}\n\n/**\n * Parse a `*.preset.yaml` file into a `CatalogEntry` with `kind: \"preset\"`.\n * `dependencies` carries the asset refs of its items (see {@link presetItemRefs}).\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the preset YAML file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"preset\"`\n * @docLink packages/core/concepts#from-preset-yaml\n */\nexport async function fromPresetYaml(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromPresetYamlContent(await readManifestFileOrEmpty(filePath), repoName, filePath);\n}\n\n/** Pure {@link fromPresetYaml} core over already-read content (no I/O). */\nfunction fromPresetYamlContent(content: string, repoName: string, filePath: string): CatalogEntry {\n let meta: Record<string, unknown> = {};\n try {\n meta = (parse(content) as Record<string, unknown>) ?? {};\n } catch {}\n\n const { refs, skipped } = presetItemRefs(meta.items);\n return {\n name: String(meta.name ?? basename(filePath).replace(/\\.preset\\.yaml$/, \"\")),\n kind: \"preset\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: String(meta.version ?? \"\"),\n requires: [],\n dependencies: refs,\n ...(skipped > 0 ? { skippedItems: skipped } : {}),\n };\n}\n\n/**\n * Extract an asset's raw transitive dependency ref strings from its manifest\n * file, kept verbatim (publisher/pin qualifiers preserved, comments dropped by\n * the parser): a `*.preset.yaml`'s asset items (see {@link presetItemRefs}) or the\n * union of a `*.flow.{yaml,json}`'s top-level `requires` / `dependencies`. Unlike\n * {@link parseRequires}, refs are returned as-is — the resolver needs the full\n * `kind:@<publisher>/name[#pin]` form, not a publisher-stripped {@link Dependency}.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to a `.preset.yaml` or `.flow.{yaml,json}`.\n * @returns Deduped `refs` (`[]` on parse failure or no deps) and the count of\n * preset instance items that are not expanded.\n * @docLink packages/core/concepts#asset-dep-refs\n */\nexport async function assetDepRefs(filePath: string): Promise<{ refs: string[]; skipped: number }> {\n return assetDepRefsFromContent(await readManifestFileOrEmpty(filePath), filePath);\n}\n\n/** Pure {@link assetDepRefs} core over already-read content (no I/O). */\nfunction assetDepRefsFromContent(\n content: string,\n filePath: string,\n): { refs: string[]; skipped: number } {\n // YAML is a JSON superset, so `parse` reads `.flow.json` too.\n let meta: Record<string, unknown> = {};\n try {\n meta = (parse(content) as Record<string, unknown>) ?? {};\n } catch {\n return { refs: [], skipped: 0 };\n }\n if (filePath.endsWith(\".preset.yaml\")) return presetItemRefs(meta.items);\n const out: string[] = [];\n const collect = (v: unknown) => {\n if (Array.isArray(v))\n for (const x of v) if (typeof x === \"string\" && x.trim()) out.push(x.trim());\n };\n collect(meta.requires);\n collect((meta.metadata as Record<string, unknown> | undefined)?.requires);\n collect(meta.dependencies);\n return { refs: [...new Set(out)], skipped: 0 };\n}\n\n/**\n * Parse a `CONTRACT.md` file into a `CatalogEntry` with `kind: \"contract\"`.\n * Falls back to the parent directory name when `name:` is absent.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the `CONTRACT.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"contract\"`\n * @docLink packages/core/concepts#from-contract-md\n */\nexport async function fromContractMd(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromContractMdContent(await readManifestFile(filePath), repoName, filePath);\n}\n\n/** Pure {@link fromContractMd} core over already-read content (no I/O). */\nfunction fromContractMdContent(content: string, repoName: string, filePath: string): CatalogEntry {\n const { data: meta } = parseFrontmatter(content);\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind: \"contract\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Pure core of a standalone, composition-only markdown asset (`PERSONA.md`, `RULESET.md`):\n * identity from the frontmatter, the parent directory name when `name:` is absent. A library\n * lists these in its manifest, validates and indexes them like every other kind (p1041).\n */\nfunction fromComposableMdContent(\n kind: \"persona\" | \"ruleset\",\n content: string,\n repoName: string,\n filePath: string,\n): CatalogEntry {\n const { data: meta } = parseFrontmatter(content);\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind,\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: [],\n dependencies: [],\n };\n}\n\n/**\n * Parse an `MCP.md` file into a `CatalogEntry` with `kind: \"mcp-server\"`.\n * Falls back to the parent directory name when `name:` is absent.\n *\n * Frontmatter fields (catalog identity):\n * - `name` — server name (default: parent dir name)\n * - `description` — short description\n * - `version` — semver\n * - `keywords` — array of discovery tags\n *\n * Frontmatter fields (runtime defaults, stored in `metadata`):\n * - `transport` — \"stdio\" | \"sse\" | \"http\" (default: \"stdio\")\n * - `command` — command to execute (stdio)\n * - `args` — command arguments (stdio)\n * - `env` — environment variables (stdio)\n * - `url` — server URL (sse/http)\n * - `headers` — HTTP headers (sse/http)\n *\n * When `mcp:name` appears in `skaile.yaml` `dependencies`, the runner reads\n * these defaults from `metadata` to build a `McpServerDeclaration` without\n * requiring verbose inline config.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the `MCP.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"mcp-server\"`\n * @docLink packages/core/concepts#from-mcp-server-md\n */\nexport async function fromMcpServerMd(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromMcpServerMdContent(await readManifestFile(filePath), repoName, filePath);\n}\n\n/**\n * Parse pre-read MCP.md content into a `CatalogEntry`.\n * Callers that already hold the file content (e.g. to avoid a second read) use\n * this directly; `fromMcpServerMd` is a thin wrapper that reads then delegates here.\n *\n * @param content - UTF-8 content of the `MCP.md` file\n * @param repoName - Repository name used as the `publisher` field of the entry\n * @param filePath - Absolute path (used as `source` and for name fallback)\n * @returns Populated `CatalogEntry` with kind `\"mcp-server\"`\n */\nexport function fromMcpServerMdContent(\n content: string,\n repoName: string,\n filePath: string,\n): CatalogEntry {\n const { data: meta } = parseFrontmatter(content);\n\n // Extract runtime defaults into metadata\n const metadata: Record<string, unknown> = {};\n if (meta.transport) metadata.transport = String(meta.transport);\n if (meta.command) metadata.command = String(meta.command);\n if (Array.isArray(meta.args)) metadata.args = meta.args.map(String);\n if (meta.env && typeof meta.env === \"object\" && !Array.isArray(meta.env)) {\n metadata.env = meta.env as Record<string, string>;\n }\n if (meta.url) metadata.url = String(meta.url);\n if (typeof meta.ca === \"string\") metadata.ca = meta.ca;\n if (meta.headers && typeof meta.headers === \"object\" && !Array.isArray(meta.headers)) {\n metadata.headers = meta.headers as Record<string, string>;\n }\n if (meta.recipe && typeof meta.recipe === \"object\" && !Array.isArray(meta.recipe)) {\n metadata.recipe = meta.recipe;\n }\n if (meta.payload && typeof meta.payload === \"object\" && !Array.isArray(meta.payload)) {\n metadata.payload = meta.payload;\n }\n if (Array.isArray(meta.fields)) {\n metadata.fields = meta.fields;\n }\n\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind: \"mcp-server\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n metadata: Object.keys(metadata).length > 0 ? metadata : undefined,\n };\n}\n\n/**\n * Parse a `knowledge.yaml` file into a `CatalogEntry` with `kind: \"knowledge\"`.\n * Falls back to the parent directory name when `name:` is absent.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the `knowledge.yaml` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"knowledge\"`\n * @docLink packages/core/concepts#from-knowledge-yaml\n */\nexport async function fromKnowledgeYaml(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromKnowledgeYamlContent(await readManifestFileOrEmpty(filePath), repoName, filePath);\n}\n\n/** Pure {@link fromKnowledgeYaml} core over already-read content (no I/O). */\nfunction fromKnowledgeYamlContent(\n content: string,\n repoName: string,\n filePath: string,\n): CatalogEntry {\n let meta: Record<string, unknown> = {};\n try {\n meta = (parse(content) as Record<string, unknown>) ?? {};\n } catch {}\n return {\n name: String(meta.name ?? basename(dirname(filePath))),\n kind: \"knowledge\",\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: String(meta.version ?? \"\"),\n requires: parseRequires(meta),\n dependencies: [],\n };\n}\n\n/**\n * Parse a `CONNECTOR.md` file into a `CatalogEntry` with `kind: \"connector\"`.\n * Falls back to the parent directory name when `name:` is absent.\n *\n * Frontmatter fields (catalog identity):\n * - `name` — connector name (default: parent dir name)\n * - `description` — short description\n * - `version` — semver\n *\n * Frontmatter fields (runtime defaults, stored in `metadata`):\n * - `entry` — adapter entry point (default: \"./adapter.ts\")\n * - `npm_deps` — npm dependencies required by the adapter\n * - `fields` — configuration fields the adapter expects\n * - `health_check` — whether to run a health check on connect\n *\n * The markdown body (below the frontmatter) is stored in `metadata.body`\n * so the runner can inject the connector's skill description into the\n * system prompt when `expose_as_skill` is enabled.\n *\n * Async since #454 — the file may live on the FUSE workspace mount.\n *\n * @param filePath - Absolute path to the `CONNECTOR.md` file\n * @param repoName - Repository name used as the `repository` field of the entry\n * @returns Populated `CatalogEntry` with kind `\"connector\"`\n * @docLink packages/core/concepts#from-connector-md\n */\nexport async function fromConnectorMd(filePath: string, repoName: string): Promise<CatalogEntry> {\n return fromConnectorMdContent(await readManifestFile(filePath), repoName, filePath);\n}\n\n/** Pure {@link fromConnectorMd} core over already-read content (no I/O). */\nfunction fromConnectorMdContent(content: string, repoName: string, filePath: string): CatalogEntry {\n const { data: meta, body } = parseFrontmatter(content);\n const name = String(meta.name ?? basename(dirname(filePath)));\n return {\n name,\n kind: \"connector\" as AssetKind,\n description: String(meta.description ?? \"\"),\n source: filePath,\n publisher: repoName,\n version: extractVersion(meta),\n requires: parseRequires(meta),\n dependencies: [],\n metadata: {\n entry: meta.entry ?? \"./adapter.ts\",\n npm_deps: meta.npm_deps ?? {},\n fields: meta.fields ?? [],\n health_check: meta.health_check ?? null,\n body,\n },\n };\n}\n\n// ── Recursive walker ──────────────────────────────────────────────────────────\n\ninterface WalkEntry {\n path: string;\n name: string;\n}\n\n/** Default maximum directory nesting the walk descends into. */\nexport const DEFAULT_WALK_MAX_DEPTH = 32;\n\n/** Default maximum number of directory entries a single walk may examine. */\nexport const DEFAULT_WALK_MAX_ENTRIES = 50_000;\n\n/** Default wall-clock budget for one whole walk / scan pass, in milliseconds. */\nexport const DEFAULT_WALK_BUDGET_MS = 60_000;\n\n/** Env override for {@link DEFAULT_WALK_MAX_DEPTH}. */\nexport const WALK_MAX_DEPTH_ENV_VAR = \"SKAILE_SCAN_MAX_DEPTH\";\n\n/** Env override for {@link DEFAULT_WALK_MAX_ENTRIES}. */\nexport const WALK_MAX_ENTRIES_ENV_VAR = \"SKAILE_SCAN_MAX_ENTRIES\";\n\n/** Env override for {@link DEFAULT_WALK_BUDGET_MS}. */\nexport const WALK_BUDGET_MS_ENV_VAR = \"SKAILE_SCAN_DEADLINE_MS\";\n\n/** Read a positive-integer env override, falling back when absent or unusable. */\nfunction envInt(name: string, fallback: number): number {\n const raw = process.env[name];\n if (raw === undefined) return fallback;\n const parsed = Number.parseInt(raw, 10);\n return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;\n}\n\n/**\n * Why a walk stopped early. Every one of these means the returned entries are a\n * **partial** view of the tree — never present a truncated walk as complete.\n *\n * @docLink packages/core/concepts#walk-dir\n */\nexport interface WalkTruncation {\n reason: \"depth\" | \"entries\" | \"budget\" | \"cycle\" | \"unreadable\";\n /** Directory (or symlink) at which the bound was hit. */\n path: string;\n /** The bound that was hit, when the reason has a numeric limit. */\n limit?: number;\n}\n\n/**\n * Bounds for {@link walkDir} / {@link scanDirectory}.\n *\n * @docLink packages/core/concepts#walk-dir\n */\nexport interface WalkOptions {\n /** Maximum nesting depth below the root. Default {@link DEFAULT_WALK_MAX_DEPTH}. */\n maxDepth?: number;\n /** Maximum directory entries examined across the whole walk. Default {@link DEFAULT_WALK_MAX_ENTRIES}. */\n maxEntries?: number;\n /**\n * Wall-clock budget for the whole walk. Default {@link DEFAULT_WALK_BUDGET_MS}.\n * The check is inclusive, so `0` yields no entries at all.\n */\n budgetMs?: number;\n /** Per-`opendir`/`stat`/`readFile` deadline. Default {@link fsDeadlineMs}. */\n opTimeoutMs?: number;\n /**\n * Called once per distinct truncation reason. Defaults to a `warn` on the\n * core logger — override to route the signal somewhere the caller can act on.\n */\n onTruncate?: (info: WalkTruncation) => void;\n}\n\n/**\n * Options for {@link scanDirectory}: the walk bounds plus the registered kind set\n * (`new Set(registry.getAllKinds())`) that typed frontmatter is checked against.\n */\nexport interface ScanOptions extends WalkOptions {\n /** Registered asset kinds; a `SKILL.md` `type:` outside it is reported, not catalogued. */\n knownKinds: ReadonlySet<string>;\n /** Sink for scan diagnostics (`unknown_asset_kind`). Defaults to a `warn` on the core logger. */\n onDiagnostic?: (diagnostic: Diagnostic) => void;\n /**\n * Return every asset found instead of one per `kind:name`. The default keeps the\n * alphabetically later source path, which hides a second directory holding the\n * same asset; a caller that must report such duplicates (`library index`) sets this.\n */\n keepDuplicates?: boolean;\n}\n\n/** Mutable bookkeeping threaded through one walk. */\ninterface WalkState {\n maxDepth: number;\n maxEntries: number;\n opTimeoutMs: number | undefined;\n deadlineAt: number;\n examined: number;\n /**\n * `dev:ino` of the directories on the **current path from the root** — an\n * ancestor stack, not an ever-visited set. Re-entering an ancestor is a cycle;\n * re-reaching a directory off the current path is a diamond, and must be walked.\n */\n ancestors: Set<string>;\n reported: Set<WalkTruncation[\"reason\"]>;\n onTruncate: (info: WalkTruncation) => void;\n}\n\nlet walkLogger: ReturnType<typeof createLogger> | undefined;\n\n/** `root` + reason pairs already warned about in this process (see {@link warnTruncation}). */\nconst warnedTruncations = new Set<string>();\n\n/**\n * Where the default truncation warning goes. A library embedded in a program leaves it unset and\n * gets a `warn` on the core logger; the CLI sets it to print one `!` line of its own instead of a\n * raw timestamped log record in the middle of a command's output (p1622).\n */\nlet truncationSink: ((info: WalkTruncation, root: string) => void) | undefined;\n\n/** Route the default truncation warning of {@link walkDir} / {@link scanDirectory} (see above). */\nexport function setWalkTruncationSink(\n sink: ((info: WalkTruncation, root: string) => void) | undefined,\n): void {\n truncationSink = sink;\n}\n\n/**\n * Default truncation sink: a warning naming the walked directory (the library) and the bound\n * that was hit, once per directory and reason for the whole process. A command that looks at\n * several libraries (`add`, `search --local`) walks each more than once; a symlink cycle in one\n * of them must not repeat on every walk (p524). A cycle says what to do: remove the symlink.\n */\nfunction warnTruncation(info: WalkTruncation, root: string): void {\n const key = `${root}\\0${info.reason}`;\n if (warnedTruncations.has(key)) return;\n warnedTruncations.add(key);\n if (truncationSink) {\n truncationSink(info, root);\n return;\n }\n walkLogger ??= createLogger({ kind: \"runner\", subkind: \"asset-scan\" });\n if (info.reason === \"cycle\") {\n walkLogger.warn(\n `asset scan truncated (cycle) — results are incomplete: in ${root}, the symlink ${info.path} points back into the tree; remove the symlink`,\n );\n return;\n }\n walkLogger.warn(`asset scan truncated (${info.reason}) — results are incomplete: ${root}`, {\n ...info,\n });\n}\n\n/** Default diagnostic sink for {@link scanDirectory}. */\nfunction warnDiagnostic(d: Diagnostic): void {\n walkLogger ??= createLogger({ kind: \"runner\", subkind: \"asset-scan\" });\n walkLogger.warn(d.message, { code: d.code, path: d.path });\n}\n\n/** Record a truncation once per reason so a wide tree does not spam the log. */\nfunction truncate(state: WalkState, info: WalkTruncation): void {\n if (state.reported.has(info.reason)) return;\n state.reported.add(info.reason);\n state.onTruncate(info);\n}\n\n/**\n * Stable identity (`dev:ino`) of the directory `path` resolves to, or `null`\n * when it cannot be stat'ed within the deadline. Used to terminate symlink\n * cycles — the pre-#454 walker recursed forever on `a/link -> a`.\n */\nasync function dirIdentity(path: string, timeoutMs: number | undefined): Promise<string | null> {\n const st = await tryWithFsDeadline(`stat ${path}`, () => stat(path), null, timeoutMs);\n return st ? `${st.dev}:${st.ino}` : null;\n}\n\n/**\n * Read one directory's entries under a deadline, capped at the walk's remaining\n * entry budget. Uses `opendir` rather than `readdir` so a pathological directory\n * streams instead of materialising in full; entries are collected and sorted\n * because the `scanDirectory` dedup rule (\"alphabetically later source wins\")\n * depends on a deterministic per-level order.\n */\nasync function readDirEntries(\n dir: string,\n state: WalkState,\n): Promise<{ entries: Dirent[]; capped: boolean } | null> {\n const remaining = state.maxEntries - state.examined;\n if (remaining <= 0) return { entries: [], capped: true };\n try {\n return await withFsDeadline(\n `opendir ${dir}`,\n async () => {\n const handle = await opendir(dir);\n const entries: Dirent[] = [];\n let capped = false;\n for await (const e of handle) {\n // Stop *before* keeping the over-budget entry, so `capped` means \"an\n // entry was actually dropped\". Breaking after the push instead marked\n // a directory of exactly `remaining` entries as truncated — and since\n // `truncate()` reports once per reason for the whole walk, that\n // spurious first report swallowed a later genuine one.\n if (entries.length >= remaining) {\n capped = true;\n break;\n }\n entries.push(e);\n }\n entries.sort((a, b) => (a.name < b.name ? -1 : 1));\n return { entries, capped };\n },\n state.opTimeoutMs,\n );\n } catch {\n // Unreadable (permissions, vanished mid-walk) or the mount missed its\n // deadline. Either way this subtree contributes nothing; keep walking.\n truncate(state, { reason: \"unreadable\", path: dir });\n return null;\n }\n}\n\n/**\n * Recursively yield every file entry under `dir`, sorted alphabetically at each\n * level. Skips `.git` and `node_modules` directories and follows symlinks\n * (resolving to the stat target). `node_modules` is excluded because Bun's\n * `node_modules/.bun/...` layout contains symlink farms that form cycles when\n * packages reference each other transitively.\n *\n * **Async and bounded since #454.** A repo root can resolve onto the rclone FUSE\n * mount, where the previous synchronous `readdirSync`/`statSync` walk parked the\n * whole event loop. Four bounds now hold, and hitting any of them reports a\n * {@link WalkTruncation} — a truncated walk is never presented as a complete one:\n *\n * - **depth** ({@link WalkOptions.maxDepth}) — also the backstop for a cycle no\n * inode check can see, e.g. a bind mount of the root inside itself.\n * - **entry count** ({@link WalkOptions.maxEntries}) — total directory entries\n * examined, so an enormous tree cannot run unbounded.\n * - **wall-clock budget** ({@link WalkOptions.budgetMs}) — a wedged mount that\n * times out one operation at a time cannot add up to an unbounded scan.\n * - **ancestor inodes** — the `dev:ino` of every directory on the path from the\n * root is held while its subtree is walked, so `a/link -> a` terminates\n * instead of recursing forever. Two sibling symlinks onto one shared\n * directory are a diamond, not a cycle: both are walked, at the price of\n * visiting the shared subtree twice — bounded by the entry and time budgets.\n *\n * @param dir - Absolute path to the directory to walk\n * @param options - Bounds and truncation sink; see {@link WalkOptions}\n * @docLink packages/core/concepts#walk-dir\n */\nexport async function* walkDir(dir: string, options: WalkOptions = {}): AsyncGenerator<WalkEntry> {\n const state: WalkState = {\n maxDepth: options.maxDepth ?? envInt(WALK_MAX_DEPTH_ENV_VAR, DEFAULT_WALK_MAX_DEPTH),\n maxEntries: options.maxEntries ?? envInt(WALK_MAX_ENTRIES_ENV_VAR, DEFAULT_WALK_MAX_ENTRIES),\n opTimeoutMs: options.opTimeoutMs,\n deadlineAt:\n Date.now() + (options.budgetMs ?? envInt(WALK_BUDGET_MS_ENV_VAR, DEFAULT_WALK_BUDGET_MS)),\n examined: 0,\n ancestors: new Set<string>(),\n reported: new Set<WalkTruncation[\"reason\"]>(),\n onTruncate: options.onTruncate ?? ((info) => warnTruncation(info, dir)),\n };\n // The root is an ancestor of everything, so it is seeded here and never\n // popped — a self-referential `root/link -> root` is caught on first descent.\n const rootId = await dirIdentity(dir, state.opTimeoutMs);\n if (rootId) state.ancestors.add(rootId);\n yield* walkFrom(dir, 0, state);\n}\n\nasync function* walkFrom(dir: string, depth: number, state: WalkState): AsyncGenerator<WalkEntry> {\n if (depth > state.maxDepth) {\n truncate(state, { reason: \"depth\", path: dir, limit: state.maxDepth });\n return;\n }\n if (Date.now() >= state.deadlineAt) {\n truncate(state, { reason: \"budget\", path: dir });\n return;\n }\n\n const read = await readDirEntries(dir, state);\n if (!read) return;\n if (read.capped) truncate(state, { reason: \"entries\", path: dir, limit: state.maxEntries });\n\n for (const e of read.entries) {\n if (state.examined >= state.maxEntries) {\n truncate(state, { reason: \"entries\", path: dir, limit: state.maxEntries });\n return;\n }\n if (Date.now() >= state.deadlineAt) {\n truncate(state, { reason: \"budget\", path: dir });\n return;\n }\n state.examined++;\n const full = join(dir, e.name);\n\n if (e.isSymbolicLink()) {\n // A symlink is the only way a cycle can enter this walk, so identity is\n // resolved here and nowhere else — one extra stat per link, none per\n // ordinary directory.\n const st = await tryWithFsDeadline(`stat ${full}`, () => stat(full), null, state.opTimeoutMs);\n if (!st) continue;\n if (st.isDirectory()) {\n if (e.name === \".git\" || e.name === \"node_modules\") continue;\n const id = `${st.dev}:${st.ino}`;\n // Only an *ancestor* is a cycle. A target already walked elsewhere in\n // the tree is a diamond (`a/link -> shared`, `b/link -> shared`) and\n // dropping it would silently lose that subtree from the scan.\n if (state.ancestors.has(id)) {\n truncate(state, { reason: \"cycle\", path: full });\n continue;\n }\n state.ancestors.add(id);\n try {\n yield* walkFrom(full, depth + 1, state);\n } finally {\n // finally, not a trailing delete: an early `return` from the bounds\n // checks — or an abandoned consumer — would otherwise leave the\n // ancestor stack holding a directory the walk has already left.\n state.ancestors.delete(id);\n }\n } else {\n yield { path: full, name: e.name };\n }\n } else if (e.isDirectory()) {\n if (e.name !== \".git\" && e.name !== \"node_modules\") yield* walkFrom(full, depth + 1, state);\n } else if (e.isFile()) {\n yield { path: full, name: e.name };\n }\n }\n}\n\n// ── Public scanner ────────────────────────────────────────────────────────────\n\n/**\n * Coerce a scanned entry's `name` to a canonical asset name in place. When the\n * raw name is already canonical this is a no-op; otherwise the original is stashed\n * on `metadata.displayName` (only when not already set) so callers keep the pretty\n * label for display while identity uses the slug. A name that slugifies to empty\n * is left untouched — `parseAssetRef` will reject it downstream with its full hint.\n */\nfunction normalizeEntryName(e: CatalogEntry): void {\n if (isValidAssetName(e.name)) return;\n let slug: string;\n try {\n slug = slugifyAssetName(e.name);\n } catch {\n return;\n }\n const original = e.name;\n e.name = slug;\n if (e.metadata?.displayName === undefined) {\n e.metadata = { ...e.metadata, displayName: original };\n }\n}\n\n/**\n * Build a `CatalogEntry` from an already-read manifest, dispatching on filename.\n * Returns `null` when the filename is not a recognized manifest.\n */\nfunction entryFromManifest(\n name: string,\n content: string,\n filePath: string,\n repoName: string,\n knownKinds: ReadonlySet<string>,\n): CatalogEntry | null {\n if (name === \"SKILL.md\") return fromSkillMdContent(content, repoName, filePath, knownKinds);\n if (name === \"AGENT.md\") return fromAgentMdContent(content, repoName, filePath);\n if (name === \"agent.yaml\") return fromAgentYamlContent(content, repoName, filePath);\n if (name === \"CONTRACT.md\") return fromContractMdContent(content, repoName, filePath);\n if (name === \"PERSONA.md\") return fromComposableMdContent(\"persona\", content, repoName, filePath);\n if (name === \"RULESET.md\") return fromComposableMdContent(\"ruleset\", content, repoName, filePath);\n if (name === \"MCP.md\") return fromMcpServerMdContent(content, repoName, filePath);\n if (name === \"CONNECTOR.md\") return fromConnectorMdContent(content, repoName, filePath);\n if (name === \"knowledge.yaml\") return fromKnowledgeYamlContent(content, repoName, filePath);\n if (name.endsWith(\".prompt.md\")) return fromPromptMdContent(content, repoName, filePath);\n if (name.endsWith(\".preset.yaml\")) return fromPresetYamlContent(content, repoName, filePath);\n if (name.endsWith(\".flow.yaml\") || name.endsWith(\".flow.json\"))\n return fromFlowYamlContent(content, repoName, filePath);\n return null;\n}\n\n/** Filenames {@link scanDirectory} recognises as asset manifests. */\nexport function isManifestName(name: string): boolean {\n return (\n name === \"SKILL.md\" ||\n name === \"AGENT.md\" ||\n name === \"agent.yaml\" ||\n name === \"CONTRACT.md\" ||\n name === \"PERSONA.md\" ||\n name === \"RULESET.md\" ||\n name === \"MCP.md\" ||\n name === \"CONNECTOR.md\" ||\n name === \"knowledge.yaml\" ||\n name.endsWith(\".prompt.md\") ||\n name.endsWith(\".preset.yaml\") ||\n name.endsWith(\".flow.yaml\") ||\n name.endsWith(\".flow.json\")\n );\n}\n\n/** Per-asset values a `skaile.manifest.yaml` `assets[]` entry overrides on the scanned entry. */\ninterface ManifestAssetOverride {\n publisher?: string;\n version?: string;\n dependencies: string[];\n}\n\n/**\n * Per-asset overrides declared in `<root>/skaile.manifest.yaml` `assets[]` (`publisher`,\n * `dependencies`), keyed `kind:name`. Empty when the manifest is absent, unreadable within\n * the deadline, or not valid YAML — a scan never fails on it.\n */\nasync function readManifestAssetOverrides(\n root: string,\n opTimeoutMs: number,\n): Promise<Record<string, ManifestAssetOverride>> {\n const out: Record<string, ManifestAssetOverride> = {};\n const file = join(root, \"skaile.manifest.yaml\");\n const content = await tryWithFsDeadline(\n `readFile ${file}`,\n () => readFile(file, \"utf8\"),\n null,\n opTimeoutMs,\n );\n if (content === null) return out;\n let doc: unknown;\n try {\n doc = parse(content);\n } catch {\n return out;\n }\n const assets = (doc as { assets?: unknown } | null)?.assets;\n if (!Array.isArray(assets)) return out;\n for (const a of assets) {\n const { kind, name, publisher, dependencies, version } = (a ?? {}) as Record<string, unknown>;\n if (typeof kind !== \"string\" || typeof name !== \"string\") continue;\n const override: ManifestAssetOverride = {\n dependencies: Array.isArray(dependencies)\n ? dependencies.filter((d): d is string => typeof d === \"string\" && d.trim().length > 0)\n : [],\n };\n const bare = typeof publisher === \"string\" ? publisher.trim().replace(/^@/, \"\") : \"\";\n if (bare) override.publisher = bare;\n if (typeof version === \"string\" && version.trim() !== \"\") override.version = version.trim();\n if (override.publisher || override.version || override.dependencies.length > 0)\n out[`${kind}:${name}`] = override;\n }\n return out;\n}\n\n/**\n * Fold a manifest entry's `dependencies` into `entry.requires`: the manifest field is the\n * author-declared requirement list of the entry (same meaning as `requires`), so every\n * consumer of the scanned entry (`add`, `install`, `info`, `check`, `doctor`) sees it.\n * A requirement the file already declares is not repeated, by {@link requirementKey}\n * identity: the file's bare `report-table` and the manifest's `skill:@pub/report-table`\n * are one requirement when `pub` is the entry's own publisher.\n */\nfunction mergeManifestDependencies(entry: CatalogEntry, dependencies: readonly string[]): void {\n entry.requires = dedupeRequirements(\n [...entry.requires, ...dependencies.map((raw) => parseDep(raw))],\n entry.publisher,\n );\n}\n\n/**\n * Walk `root` recursively and return a `CatalogEntry` for every recognized asset manifest found.\n *\n * Recognized filenames: `SKILL.md`, `AGENT.md`, `agent.yaml`, `CONTRACT.md`, `MCP.md`,\n * `CONNECTOR.md`, `knowledge.yaml`, `*.prompt.md`, `*.preset.yaml`, `*.flow.yaml`, `*.flow.json`.\n *\n * When two entries share the same `kind:name` key, the one with the alphabetically\n * later source path wins (consistent with catalog precedence rules), unless\n * {@link ScanOptions.keepDuplicates} asks for every copy.\n *\n * **Async and bounded since #454.** `root` can resolve onto the rclone FUSE mount\n * (a `sources[].path` under `/skaile/workspace`), and the walk follows symlinks, so\n * even an off-mount root can descend into one. Every `opendir`/`stat`/`readFile`\n * is deadline-bounded and the walk is capped by depth, entry count, a wall-clock\n * budget, and an ancestor-inode set — see {@link walkDir}. Hitting any bound reports\n * a {@link WalkTruncation} through {@link WalkOptions.onTruncate} (a `warn` by\n * default); the returned array is then a **partial** scan, never a complete one.\n *\n * A manifest that cannot be read within its deadline is skipped rather than\n * failing the whole scan — one unreachable file must not cost the whole catalog.\n *\n * **Per-asset publisher.** When `root` holds a `skaile.manifest.yaml` whose `assets[]`\n * entry names a `publisher` for a scanned `kind`/`name`, that publisher replaces\n * `repoName` on the produced entry — the same identity the library index and\n * `library create --publisher` write, so `kind:@<publisher>/<name>` resolves.\n *\n * **Per-asset dependencies.** The same entry's `dependencies` (`kind:@<publisher>/name[#pin]`)\n * are appended to the produced entry's `requires`, next to the file's own `requires`.\n *\n * @param root - Absolute path to the directory tree to scan\n * @param repoName - Publisher attached to every produced entry without a per-asset override\n * @param options - Walk bounds and truncation sink; see {@link WalkOptions}\n * @returns Array of deduplicated `CatalogEntry` objects, one per manifest file\n * @docLink packages/core/concepts#scan-directory\n */\nexport async function scanDirectory(\n root: string,\n repoName: string,\n options: ScanOptions,\n): Promise<CatalogEntry[]> {\n const entries = new Map<string, CatalogEntry>();\n const copies: CatalogEntry[] = [];\n const onTruncate = options.onTruncate ?? ((info: WalkTruncation) => warnTruncation(info, root));\n const reported = new Set<WalkTruncation[\"reason\"]>();\n const relay = (info: WalkTruncation) => {\n reported.add(info.reason);\n onTruncate(info);\n };\n const opTimeoutMs = options.opTimeoutMs ?? fsDeadlineMs();\n const manifestOverrides = await readManifestAssetOverrides(root, opTimeoutMs);\n\n function add(e: CatalogEntry): void {\n // Boundary normalization: a third-party source we don't control may name an\n // asset with a human-styled identity (\"Complex App\"). Slugify it to a\n // canonical name so the ref it produces parses, preserving the original on\n // `metadata.displayName` for display. No-op for already-canonical names.\n normalizeEntryName(e);\n const key = `${e.kind}:${e.name}`;\n const override = manifestOverrides[key];\n if (override?.publisher) e.publisher = override.publisher;\n // A file that declares no version (AGENT.md, agent.yaml) has the manifest entry's, so every\n // library holding it agrees on the version.\n if (!e.version && override?.version) e.version = override.version;\n if (override) mergeManifestDependencies(e, override.dependencies);\n if (options.keepDuplicates) {\n copies.push(e);\n return;\n }\n const existing = entries.get(key);\n if (!existing) {\n entries.set(key, e);\n return;\n }\n // Among duplicates, alphabetically later source path wins\n if (e.source > existing.source) entries.set(key, e);\n }\n\n for await (const { path: filePath, name } of walkDir(root, {\n ...options,\n opTimeoutMs,\n onTruncate: relay,\n })) {\n if (!isManifestName(name)) continue;\n const content = await tryWithFsDeadline(\n `readFile ${filePath}`,\n () => readFile(filePath, \"utf8\"),\n null,\n opTimeoutMs,\n );\n if (content === null) {\n // Unreadable or past its deadline — the catalog loses this asset, not the\n // whole scan. Reported once so a wedged mount is visible in the logs.\n if (!reported.has(\"unreadable\")) relay({ reason: \"unreadable\", path: filePath });\n continue;\n }\n try {\n const entry = entryFromManifest(name, content, filePath, repoName, options.knownKinds);\n if (entry) add(entry);\n } catch (err) {\n if (err instanceof ManifestKindError) {\n (options.onDiagnostic ?? warnDiagnostic)(manifestKindDiagnostic(err));\n }\n }\n }\n\n return options.keepDuplicates ? copies : [...entries.values()];\n}\n\n/**\n * The prompt text of a manifest file, as the scaffold-body check wants it: the\n * markdown body of a `.md` marker (`SKILL.md`, `AGENT.md`, …), the `SOUL.md` next to\n * an `agent.yaml` agent, `undefined` for every other YAML manifest.\n *\n * @param file Absolute path of the manifest file.\n * @param text The file's content.\n */\nexport function readAssetBody(file: string, text: string): string | undefined {\n if (file.endsWith(\".md\")) return parseFrontmatter(text).body;\n if (basename(file) !== \"agent.yaml\") return undefined;\n const soul = join(dirname(file), \"SOUL.md\");\n return existsSync(soul) ? readFileSync(soul, \"utf8\").trim() : undefined;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../asset-manager/src/install-agent.ts","../asset-manager/src/installer.ts"],"names":["parseYaml","parseFrontmatter","join","basename","relative","resolve","existsSync","readFileSync","stringifyYaml","deployed"],"mappings":";;;;;;;;;;;;;;;;;AA+CA,IAAM,aAAA,GAAgB,UAAA;AAGtB,SAAS,kBAAkB,KAAA,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AAA,EAAM,aAAa,GAAG,MAAM,CAAA;AAClF,IAAA,aAAA,CAAcA,KAAK,IAAA,EAAM,SAAS,GAAG,YAAA,CAAa,IAAI,GAAG,MAAM,CAAA;AAAA,EACjE,CAAA,MAAA,IAAW,SAAS,UAAA,EAAY;AAC9B,IAAA,aAAA;AAAA,MACEA,IAAAA,CAAK,MAAM,aAAa,CAAA;AAAA,MACxB,gBAAA,CAAiB,IAAA,EAAM,aAAA,EAAe,yBAAyB,CAAA;AAAA,MAC/D;AAAA,KACF;AAAA,EACF,CAAA,MAAO;AACL,IAAA,aAAA;AAAA,MACEA,IAAAA,CAAK,MAAM,UAAU,CAAA;AAAA,MACrB,gBAAA,CAAiB,IAAA,EAAM,aAAA,EAAe,sBAAsB,CAAA;AAAA,MAC5D;AAAA,KACF;AAAA,EACF;AAEA,EAAA,OAAO,EAAE,EAAA,EAAI,IAAA,EAAM,IAAA,EAAM,IAAA,EAAK;AAChC","file":"chunk-YJNE4V2M.js","sourcesContent":["/**\n * Agent installation — renders a GitAgent package (agent.yaml + SOUL.md + RULES.md)\n * into the framework-native format (`.claude/agents/<name>.md`, `.omp/agents/<name>/`,\n * `.codex/agents/<name>.toml`) and resolves abilities, contracts, fragments, and\n * prompt extensions from the workspace config along the way.\n *\n * System prompt phases (per agent):\n * 1. extends merge — inherit from parent agent.yaml if manifest.extends is set\n * 2. instance overrides — model / budget / lifecycle of the `skaile.yaml` instance\n * 3. ability refs — read SKILL.md frontmatter of the composed skills\n * 4. contract refs — locate CONTRACT.md files of the composed contracts\n * 5. fragments — resolve framework fragments (agent-mode, handoff, etc.)\n * 6. prompt-extensions — load per-project markdown extensions from skaile.yaml\n *\n * Used by `installer.ts` (the asset-install path, one agent asset under its own\n * name) and `install-instances.ts` (`skaile install`, one rendering per\n * `skaile.yaml` agent instance, named by the instance id). Sub-agents composed as\n * `composes: [{ kind: agent }]` (binding `delegate`, the default) are installed\n * flat (no nesting) in the same deploy directory; `binding: run` sub-agents are\n * host-executed and get no native file.\n */\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { basename, join, relative, resolve } from \"node:path\";\nimport type { AgentInstanceConfig, HarnessName, SkWorkspaceConfig } from \"@skaile/workspaces/core\";\nimport {\n AGENT_INSTANCE_ID_PATTERN,\n HARNESS_TARGETS,\n parseFrontmatter as parseMarkdownFrontmatter,\n parseAssetRefLoose,\n resolveAgentDefinitionDir,\n} from \"@skaile/workspaces/core\";\nimport type { AgentComposeItem, AgentLifecycle } from \"@skaile/workspaces/types/manifests\";\nimport { parse as parseYaml } from \"yaml\";\nimport {\n type AbilityRef,\n type ConnectorRef,\n type ContractRef,\n type FragmentContext,\n loadPromptExtensions,\n resolveFragments,\n} from \"./fragments.js\";\nimport { type AgentManifest, type AgentRenderInput, renderAgentToFramework } from \"./renderers.js\";\n\n// ── Helpers ───────────────────────────────────────────────────────────────────\n\n/** Source file of the legacy markdown agent form: frontmatter + the system prompt as body. */\nconst AGENT_MD_FILE = \"AGENT.md\";\n\n/** A Claude-style `tools:` value (`\"Read, Grep\"` or a list) as the manifest's `tools.allowed`. */\nfunction toolsFromMarkdown(value: unknown): AgentManifest[\"tools\"] | undefined {\n if (Array.isArray(value)) return { allowed: value.map(String) };\n if (typeof value === \"string\") {\n const allowed = value.split(/[,\\s]+/).filter(Boolean);\n return allowed.length > 0 ? { allowed } : undefined;\n }\n return value && typeof value === \"object\" ? (value as AgentManifest[\"tools\"]) : undefined;\n}\n\n/**\n * The `AGENT.md` form of an agent as a manifest: the frontmatter, with the\n * Claude-style scalar `model:` / `tools:` shapes mapped to the manifest's\n * `model.preferred` / `tools.allowed`, and `metadata.version` read as `version`.\n */\nfunction readAgentMdManifest(agentDir: string): { manifest: AgentManifest; body: string } | null {\n const mdPath = join(agentDir, AGENT_MD_FILE);\n if (!existsSync(mdPath)) return null;\n try {\n const { data, body } = parseMarkdownFrontmatter(readFileSync(mdPath, \"utf-8\"));\n const meta = data.metadata as { version?: unknown } | undefined;\n const manifest: Record<string, unknown> = { ...data };\n if (manifest.version === undefined && meta?.version !== undefined) {\n manifest.version = String(meta.version);\n }\n if (typeof data.model === \"string\") manifest.model = { preferred: data.model };\n if (data.tools !== undefined) manifest.tools = toolsFromMarkdown(data.tools);\n return { manifest: manifest as AgentManifest, body };\n } catch {\n return null;\n }\n}\n\n/**\n * The agent's manifest: `agent.yaml`, else the frontmatter of the legacy\n * `AGENT.md`. `null` when the directory holds neither (or it cannot be parsed).\n */\nexport function readManifest(agentDir: string): AgentManifest | null {\n const yamlPath = join(agentDir, \"agent.yaml\");\n if (!existsSync(yamlPath)) return readAgentMdManifest(agentDir)?.manifest ?? null;\n try {\n return parseYaml(readFileSync(yamlPath, \"utf-8\")) as AgentManifest;\n } catch {\n return null;\n }\n}\n\nfunction readFile(agentDir: string, name: string): string | null {\n const p = join(agentDir, name);\n if (!existsSync(p)) return null;\n try {\n return readFileSync(p, \"utf-8\");\n } catch {\n return null;\n }\n}\n\n/**\n * The agent's identity text: `SOUL.md`; for an `AGENT.md` agent the markdown body\n * comes first, so a `SOUL.md` next to it extends the prompt rather than replacing it.\n */\nexport function readSoul(agentDir: string): string | null {\n const soul = readFile(agentDir, \"SOUL.md\");\n if (existsSync(join(agentDir, \"agent.yaml\"))) return soul;\n const body = readAgentMdManifest(agentDir)?.body;\n if (!body) return soul;\n return soul ? `${body}\\n\\n${soul}` : body;\n}\n\n/**\n * A name becomes a file or directory name under the deploy dir; one with a path\n * segment (`../x`, `a/b`) would write outside it. Refused, never sanitized.\n */\nfunction isSafeFileName(name: string): boolean {\n return name.length > 0 && name !== \".\" && name !== \"..\" && !/[\\\\/\\0]/.test(name);\n}\n\n/** Extract YAML frontmatter from a markdown file (content between first two --- delimiters). */\nfunction parseFrontmatter(content: string): Record<string, unknown> {\n const match = content.match(/^---\\n([\\s\\S]*?)\\n---/);\n if (!match) return {};\n try {\n return (parseYaml(match[1]!) as Record<string, unknown>) ?? {};\n } catch {\n return {};\n }\n}\n\n/**\n * Merge parent and child agent manifests.\n * Scalars: child wins. Arrays: parent + child, deduplicated (`composes` by\n * kind + ref + slot id, other arrays by value).\n */\nfunction mergeManifests(parent: AgentManifest, child: AgentManifest): AgentManifest {\n const result: AgentManifest = { ...parent };\n for (const [k, val] of Object.entries(child) as [keyof AgentManifest, unknown][]) {\n if (val === undefined) continue;\n const parentVal = result[k as keyof AgentManifest];\n if (k === \"composes\" && Array.isArray(val) && Array.isArray(parentVal)) {\n const merged = new Map<string, AgentComposeItem>();\n for (const item of [...parentVal, ...val] as AgentComposeItem[]) {\n merged.set(`${item.kind}\\u0000${item.ref}\\u0000${item.id ?? \"\"}`, item);\n }\n result.composes = [...merged.values()];\n } else if (Array.isArray(val) && Array.isArray(parentVal)) {\n (result as Record<string, unknown>)[k] = [...new Set([...parentVal, ...val])];\n } else {\n (result as Record<string, unknown>)[k] = val;\n }\n }\n return result;\n}\n\n/**\n * Phase 1: inherit scalars/arrays from a parent agent when `manifest.extends` is set.\n * Returns the (possibly merged) manifest; pushes a warning when the parent is missing.\n */\nfunction applyExtendsMerge(\n manifest: AgentManifest,\n srcDir: string,\n warnings: string[],\n): AgentManifest {\n if (!manifest.extends) return manifest;\n const parentDir = resolve(srcDir, manifest.extends);\n const parentManifest = readManifest(parentDir);\n if (parentManifest) {\n return mergeManifests(parentManifest, manifest);\n }\n warnings.push(\n `extends: parent agent not found at \"${manifest.extends}\" (from ${srcDir}) — skipping inheritance`,\n );\n return manifest;\n}\n\n/**\n * Phase 2: apply the instance's overrides to the asset's manifest — the model\n * selector, the turn budget (`budget.max_turns` → `runtime.max_turns`) and the\n * lifecycle. Returns the effective manifest and lifecycle.\n */\nfunction applyInstanceOverrides(\n manifest: AgentManifest,\n instance: AgentInstanceConfig | undefined,\n): { manifest: AgentManifest; lifecycle: AgentLifecycle } {\n const lifecycle = instance?.lifecycle ?? manifest.lifecycle ?? \"standing\";\n if (!instance) return { manifest, lifecycle };\n const effective: AgentManifest = { ...manifest, lifecycle };\n if (instance.model) {\n effective.model = { ...manifest.model, ...instance.model } as AgentManifest[\"model\"];\n }\n if (instance.budget?.max_turns !== undefined) {\n effective.runtime = { ...manifest.runtime, max_turns: instance.budget.max_turns };\n }\n return { manifest: effective, lifecycle };\n}\n\n/**\n * The name a composed asset is installed under: the asset name of a canonical\n * ref (`skill:@pub/name#1.0.0` → `name`), else the last path segment\n * (`./skills/name` → `name`).\n */\nfunction composeRefName(ref: string): string {\n const parsed = parseAssetRefLoose(ref);\n if (parsed) return parsed.name;\n const tail = ref.replace(/\\/+$/, \"\").split(\"/\").pop() ?? ref;\n return tail.replace(/^[a-z-]+:/, \"\").replace(/#.*$/, \"\") || ref;\n}\n\n/** Names of the composed items of `kind`, in declaration order, de-duplicated. */\nfunction composedNames(manifest: AgentManifest, kind: string): string[] {\n const names = (manifest.composes ?? [])\n .filter((item) => item.kind === kind)\n .map((item) => composeRefName(item.ref));\n return [...new Set(names)];\n}\n\n/**\n * Names of the agents the agent at `srcDir` calls as `delegate` sub-agents (its `kind: agent`\n * composes whose binding is not `run`). {@link installAgent} renders them next to it as\n * sub-agents, so a caller that renders the same agent on its own must do so as one too.\n */\nexport function delegateNamesOf(srcDir: string): string[] {\n const manifest = readManifest(srcDir);\n const names = (manifest?.composes ?? [])\n .filter((item) => item.kind === \"agent\" && item.binding !== \"run\")\n .map((item) => composeRefName(item.ref));\n return [...new Set(names)];\n}\n\n/**\n * The MCP servers an agent's `mcp-server` slots are bound to: the server the\n * instance's `connectors` map binds the slot id to, else the composed asset's\n * own name (the id its server is rendered under).\n */\nfunction boundMcpServers(\n manifest: AgentManifest,\n instance: AgentInstanceConfig | undefined,\n): string[] {\n const names = (manifest.composes ?? [])\n .filter((item) => item.kind === \"mcp-server\")\n .map(\n (item) => (item.id ? instance?.connectors?.[item.id] : undefined) ?? composeRefName(item.ref),\n );\n return [...new Set(names)];\n}\n\n/**\n * The workspace connector ids an agent's `connector` slots are bound to: the connector the\n * instance's `connectors` map binds the slot id to, else the slot id (a slot is usually named\n * after the workspace connector it uses), else the composed asset's own name.\n */\nfunction boundConnectorIds(\n manifest: AgentManifest,\n instance: AgentInstanceConfig | undefined,\n): string[] {\n const ids = (manifest.composes ?? [])\n .filter((item) => item.kind === \"connector\")\n .flatMap((item) => {\n const bound = item.id ? instance?.connectors?.[item.id] : undefined;\n return bound ? [bound] : [item.id, composeRefName(item.ref)].filter((s): s is string => !!s);\n });\n return [...new Set(ids)];\n}\n\n/** Phase 3: resolve ability refs — read description from the installed SKILL.md of each composed skill. */\nfunction resolveAbilityRefs(\n manifest: AgentManifest,\n workspaceRoot: string,\n skillsRelDir: string,\n): AbilityRef[] {\n const abilityRefs: AbilityRef[] = [];\n for (const name of composedNames(manifest, \"skill\")) {\n const skillMdPath = join(workspaceRoot, skillsRelDir, name, \"SKILL.md\");\n if (!existsSync(skillMdPath)) continue;\n try {\n const fm = parseFrontmatter(readFileSync(skillMdPath, \"utf-8\"));\n const desc = typeof fm.description === \"string\" ? fm.description : undefined;\n if (desc) abilityRefs.push({ name, description: desc });\n } catch {\n // skip unreadable SKILL.md\n }\n }\n return abilityRefs;\n}\n\n/** Phase 4: resolve contract refs — locate the CONTRACT.md of each composed contract in the skills dir. */\nfunction resolveContractRefs(\n manifest: AgentManifest,\n workspaceRoot: string,\n skillsRelDir: string,\n): ContractRef[] {\n const contractRefs: ContractRef[] = [];\n for (const name of composedNames(manifest, \"contract\")) {\n const contractAbsPath = join(workspaceRoot, skillsRelDir, name, \"CONTRACT.md\");\n if (!existsSync(contractAbsPath)) continue;\n contractRefs.push({ name, relativePath: relative(workspaceRoot, contractAbsPath) });\n }\n return contractRefs;\n}\n\n/** A `kind: agent` composition item rendered as its own native sub-agent file. */\ninterface DelegateSubAgent {\n /** `composes[].ref` as written. */\n ref: string;\n /** Absolute path of the sub-agent's source directory. */\n srcDir: string;\n /** File name: the item's `as`, else the sub-agent's own `name`. */\n name: string;\n /** `composes[].as`, forwarded as the install name override. */\n alias: string | undefined;\n}\n\n/**\n * Phase 5a: the `delegate` sub-agents of an agent — its `kind: agent` items\n * whose binding is not `run` (`delegate` is the default for the harnesses that\n * render native agent files). Catalog refs resolve like `agents.<id>.ref`;\n * anything else is a path relative to the composing agent's directory. An\n * unresolvable item is skipped with a warning.\n */\nfunction resolveDelegates(\n manifest: AgentManifest,\n agentName: string,\n srcDir: string,\n workspaceRoot: string,\n warnings: string[],\n): DelegateSubAgent[] {\n const delegates: DelegateSubAgent[] = [];\n for (const item of manifest.composes ?? []) {\n if (item.kind !== \"agent\" || item.binding === \"run\") continue;\n let subSrc: string | undefined;\n try {\n subSrc =\n item.ref.startsWith(\"agent:\") || item.ref.startsWith(\"ai-assets://\")\n ? resolveAgentDefinitionDir(workspaceRoot, item.ref)\n : resolve(srcDir, item.ref);\n } catch (err) {\n warnings.push(\n `Sub-agent ${item.ref} (from ${agentName}): ${err instanceof Error ? err.message : String(err)}`,\n );\n continue;\n }\n if (!subSrc || !existsSync(subSrc)) {\n warnings.push(`Sub-agent source not found: ${item.ref} (from ${agentName})`);\n continue;\n }\n const sub = readManifest(subSrc);\n const name = item.as ?? sub?.name ?? basename(subSrc);\n // The name is a file name under the deploy dir: refuse anything that is not a plain id.\n if (typeof name !== \"string\" || !AGENT_INSTANCE_ID_PATTERN.test(name)) {\n warnings.push(\n `Sub-agent ${item.ref} (from ${agentName}): name ${JSON.stringify(name)} must match ${AGENT_INSTANCE_ID_PATTERN} — skipped`,\n );\n continue;\n }\n delegates.push({\n ref: item.ref,\n srcDir: subSrc,\n name,\n alias: item.as,\n });\n }\n return delegates;\n}\n\n/** Phase 5b: assemble the fragment context from the manifest, workspace config, and resolved refs. */\nfunction buildFragmentContext(\n subAgentNames: string[],\n harness: string,\n skillsRelDir: string,\n wsConfig: SkWorkspaceConfig | undefined,\n abilityRefs: AbilityRef[],\n contractRefs: ContractRef[],\n /** Set for an agent that another agent calls: the connector ids its own slots are bound to. */\n callee?: { subAgent: boolean; connectorIds: string[] },\n): FragmentContext {\n const connectors: ConnectorRef[] = (wsConfig?.connectors ?? [])\n .filter((c) => !callee || callee.connectorIds.includes(c.id))\n .map((c) => ({\n id: c.id,\n driver: c.driver,\n access: c.access ?? \"read-write\",\n }));\n\n const agentsRelDir = HARNESS_TARGETS[harness as HarnessName]?.local.agent ?? \"\";\n\n return {\n framework: harness,\n skillsDir: skillsRelDir,\n agentsDir: agentsRelDir,\n subAgents: subAgentNames,\n ...(callee ? { subAgent: callee.subAgent } : {}),\n connectors,\n abilityRefs,\n contractRefs,\n };\n}\n\n// ── Core installation ─────────────────────────────────────────────────────────\n\n/**\n * Install a single GitAgent source directory using the appropriate renderer.\n *\n * When `includeSubAgents` is `true`, recursively installs the `delegate`\n * sub-agents (`composes: [{ kind: agent }]`) as separate flat agents in the\n * same deploy directory (no nesting). Tracks visited directories to prevent\n * infinite loops in sub-agent cycles.\n *\n * @param srcDir - Absolute path to the GitAgent source directory (contains `agent.yaml`).\n * @param agentDeployDir - Absolute path to the framework's agent deploy directory.\n * @param workspaceRoot - Absolute path to the workspace root.\n * @param harness - Agent framework ID used to select the renderer.\n * @param skillsRelDir - Relative path to the installed skills dir (e.g. `\".claude/skills\"`).\n * @param nameOverride - Override name for the installed agent. Defaults to `manifest.name`;\n * an instance render passes the instance id.\n * @param includeSubAgents - When `true`, recursively install `delegate` sub-agents.\n * @param visited - Set of resolved source paths already processed (cycle guard).\n * @param wsConfig - Workspace config from `skaile.yaml` (fragments, connectors, extensions).\n * @param log - Optional logger callback for progress messages.\n * @param instance - The `skaile.yaml` instance being rendered; its model / budget / lifecycle\n * override the asset's and its `connectors` map binds the `mcp-server` slots.\n * @returns Object with `created` file paths (every rendered file), `changed` (the subset whose\n * bytes differ from what was deployed before) and `warnings` list.\n * @docLink packages/asset-manager/concepts#install-agent\n */\nexport function installAgent(\n srcDir: string,\n agentDeployDir: string,\n workspaceRoot: string,\n harness: string,\n /** Relative path to the installed skills dir (e.g. \".claude/skills\") */\n skillsRelDir: string,\n nameOverride: string | undefined,\n includeSubAgents: boolean,\n visited: Set<string>,\n wsConfig: SkWorkspaceConfig | undefined,\n log?: (msg: string) => void,\n instance?: AgentInstanceConfig,\n /** `true` for a `delegate` sub-agent rendered for the agent that calls it. */\n delegated = false,\n): { created: string[]; changed: string[]; warnings: string[] } {\n const created: string[] = [];\n const changed: string[] = [];\n const warnings: string[] = [];\n\n const realSrc = resolve(srcDir);\n if (visited.has(realSrc)) return { created, changed, warnings };\n visited.add(realSrc);\n\n const initialManifest = readManifest(srcDir);\n if (!initialManifest) {\n warnings.push(`${srcDir} has no agent.yaml or AGENT.md — skipping (not an agent package)`);\n return { created, changed, warnings };\n }\n\n // Phase 1: extends merge — inherit scalars/arrays from parent agent\n // Phase 2: instance overrides — model / budget / lifecycle\n const { manifest, lifecycle } = applyInstanceOverrides(\n applyExtendsMerge(initialManifest, srcDir, warnings),\n instance,\n );\n\n const agentName = nameOverride ?? manifest.name ?? basename(srcDir);\n if (typeof agentName !== \"string\" || !isSafeFileName(agentName)) {\n warnings.push(\n `${srcDir}: agent name ${JSON.stringify(agentName)} is not a valid file name (no path separators) — skipping`,\n );\n return { created, changed, warnings };\n }\n\n log?.(`Installing git-agent: ${agentName} (${harness})`);\n\n // Phase 3: resolve ability refs — read description from installed SKILL.md files\n const abilityRefs = resolveAbilityRefs(manifest, workspaceRoot, skillsRelDir);\n\n // Phase 4: resolve contract refs — locate CONTRACT.md files in the skills dir\n const contractRefs = resolveContractRefs(manifest, workspaceRoot, skillsRelDir);\n\n // Phase 5: delegate sub-agents, fragment context, framework fragments + prompt extensions\n const delegates = resolveDelegates(manifest, agentName, srcDir, workspaceRoot, warnings);\n // A `role`, and a `delegate` sub-agent, is called by another agent: it is told so, and sees\n // only the connectors it composes.\n const subAgent = lifecycle === \"role\" || delegated;\n const fragmentCtx = buildFragmentContext(\n delegates.map((d) => d.name),\n harness,\n skillsRelDir,\n wsConfig,\n abilityRefs,\n contractRefs,\n subAgent ? { subAgent, connectorIds: boundConnectorIds(manifest, instance) } : undefined,\n );\n\n const frameworkFragments = resolveFragments(\n fragmentCtx,\n wsConfig?.agent?.fragments,\n workspaceRoot,\n );\n const promptExtensions = loadPromptExtensions(\n wsConfig?.agent?.[\"prompt-extensions\"],\n workspaceRoot,\n );\n\n const input: AgentRenderInput = {\n manifest,\n soul: readSoul(srcDir),\n rules: readFile(srcDir, \"RULES.md\"),\n duties: readFile(srcDir, \"DUTIES.md\"),\n agentName,\n agentDeployDir,\n workspaceRoot,\n abilityRefs,\n contractRefs,\n frameworkFragments,\n promptExtensions,\n lifecycle,\n skills: composedNames(manifest, \"skill\"),\n mcpServers: boundMcpServers(manifest, instance),\n srcDir,\n };\n\n const result = renderAgentToFramework(input, harness, log);\n created.push(...result.created);\n changed.push(...result.changed);\n warnings.push(...result.warnings);\n\n // Recursively install delegate sub-agents as flat top-level agents\n if (includeSubAgents) {\n for (const delegate of delegates) {\n const sub = installAgent(\n delegate.srcDir,\n agentDeployDir,\n workspaceRoot,\n harness,\n skillsRelDir,\n delegate.alias, // undefined → the sub-agent's own name from its agent.yaml\n includeSubAgents,\n visited,\n wsConfig,\n log,\n undefined,\n true,\n );\n created.push(...sub.created);\n changed.push(...sub.changed);\n warnings.push(...sub.warnings);\n }\n }\n\n return { created, changed, warnings };\n}\n","/**\n * Asset deployment — copies assets into framework dirs by default (self-contained,\n * cache-safe, portable); `--link` opts into a symlink for the local-path dev loop.\n */\n\nimport { spawnSync } from \"node:child_process\";\nimport {\n cpSync,\n existsSync,\n lstatSync,\n mkdirSync,\n readFileSync,\n mkdtempSync,\n readdirSync,\n readlinkSync,\n renameSync,\n rmSync,\n statSync,\n symlinkSync,\n type Stats,\n unlinkSync,\n writeFileSync,\n} from \"node:fs\";\nimport { homedir, tmpdir } from \"node:os\";\nimport { basename, dirname, join, normalize, relative, resolve, sep } from \"node:path\";\nimport type {\n AgentInstanceConfig,\n AiComponent,\n CatalogEntry,\n HarnessName,\n SourceDeclaration,\n} from \"@skaile/workspaces/core\";\nimport {\n agentSourceCacheDir,\n applyPatch,\n assetRefToStr,\n computeHash,\n HARNESS_TARGETS,\n deployedBase,\n deployedDir,\n deployedPaths,\n globalSkaileDir,\n isDeployed,\n resolveSkWorkspaceConfig,\n} from \"@skaile/workspaces/core\";\nimport {\n isEnvFileName,\n isNonAssetDir,\n isNonAssetFile,\n isSecretFileName,\n librarySymlinkMessage,\n listAssetFiles,\n listSecretFiles,\n listSkippedSymlinks,\n} from \"@skaile/workspaces/core/publish-manifest\";\nimport {\n AGENT_BODY_PLACEHOLDER,\n CONTRACT_BODY_PLACEHOLDER,\n FLOW_NODE_INSTRUCTION_PLACEHOLDER,\n PRESET_ITEM_PLACEHOLDER_REF,\n PROMPT_BODY_PLACEHOLDER,\n SKILL_BODY_PLACEHOLDER,\n SKILL_DESCRIPTION_PLACEHOLDER,\n SKILL_DESCRIPTION_PLACEHOLDER_PREFIX,\n} from \"@skaile/workspaces/types/manifests\";\nimport type { IAssetKindProvider, IAssetKindRegistry } from \"@skaile/workspaces/plugins\";\nimport { isMap, isSeq, parseDocument, stringify as stringifyYaml } from \"yaml\";\nimport { delegateNamesOf, installAgent, readManifest, readSoul } from \"./install-agent.js\";\nimport { CODEX_IDENTITY_DIR, type Log } from \"./renderers.js\";\n\nexport type { Log } from \"./renderers.js\";\n\nconst noop: Log = () => {};\n\n/**\n * The printable canonical ref of a resolved entry — `kind:@publisher/name#version`,\n * the one ref grammar the CLI shows. An entry whose `publisher` is a clone key\n * carries the real ref in `canonicalRef`; with neither a `canonicalRef` nor a\n * publisher there is nothing to namespace it by, so it falls back to `kind:name`.\n */\nexport function canonicalEntryRef(entry: CatalogEntry): string {\n if (entry.canonicalRef) return entry.canonicalRef;\n const publisher = entry.publisher?.replace(/^@/, \"\");\n if (!publisher) return `${entry.kind}:${entry.name}`;\n return assetRefToStr({\n kind: entry.kind,\n name: entry.name,\n publisher,\n pin: entry.version || undefined,\n });\n}\n\n// ── Filesystem helpers ────────────────────────────────────────────────────────\n\nfunction clearDest(dest: string): void {\n try {\n const s = lstatSync(dest);\n if (s.isSymbolicLink()) unlinkSync(dest);\n else rmSync(dest, { recursive: true, force: true });\n } catch {}\n}\n\n/**\n * A credential file (not an `.env*` file, which stays the owner's local file) inside a deployed\n * copy: releases before 5.17 deployed these (`.npmrc`, `id_rsa`, `token.json`, ...), a deploy now\n * withholds them (p1040). A re-deploy deletes the leftover and `check` reports it as extra, so a\n * leaked credential is not kept for good.\n */\nfunction isLeakedSecret(name: string): boolean {\n return isSecretFileName(name) && !isEnvFileName(name);\n}\n\n/**\n * Empty a deployed asset directory before a copy deploy, but keep what is not part of an\n * asset (`.env`, `.venv/`, `__pycache__/`, `*.pyc`, ...): those are the owner's local files, the\n * lock never covers them, so a re-deploy must not delete them. Anything else — including a\n * symlink — goes. A `dest` that is a symlink or a file is removed whole.\n */\nfunction clearDeployedAsset(dest: string): void {\n let s: ReturnType<typeof lstatSync>;\n try {\n s = lstatSync(dest);\n } catch {\n return;\n }\n if (!s.isDirectory()) {\n clearDest(dest);\n return;\n }\n const empty = (dir: string): boolean => {\n let kept = false;\n for (const e of readdirSync(dir, { withFileTypes: true })) {\n const path = join(dir, e.name);\n if (e.isDirectory()) {\n if (isNonAssetDir(e.name)) kept = true;\n else if (!empty(path)) kept = true;\n else rmSync(path, { recursive: true, force: true });\n } else if (e.isFile() && isNonAssetFile(e.name) && !isLeakedSecret(e.name)) {\n kept = true;\n } else {\n rmSync(path, { force: true });\n }\n }\n return !kept;\n };\n try {\n empty(dest);\n } catch {\n clearDest(dest);\n }\n}\n\n/**\n * The harness component directory a kind installs into — the provider's\n * `installTarget` — or `undefined` for composition-only kinds (connector,\n * mcp-server, knowledge, persona, ruleset, preset) and unregistered kinds.\n * The registry is the only authority: there is no static list of deployable kinds.\n */\nexport function installTargetOf(\n registry: IAssetKindRegistry,\n kind: string,\n): AiComponent | undefined {\n return registry.getProvider(kind)?.installTarget;\n}\n\n/**\n * The manifest file of a resolved entry. `source` is normally the manifest file\n * itself; a directory source is searched for the provider's manifest.\n * `undefined` when `source` is a directory holding none.\n */\nfunction manifestFileOf(provider: IAssetKindProvider, source: string): string | undefined {\n if (!statSync(source).isDirectory()) return source;\n const hit = readdirSync(source).find((f) => provider.matchesPath(f));\n return hit ? join(source, hit) : undefined;\n}\n\n/**\n * A resolved entry ready to deploy: a {@link CatalogEntry} that may carry the\n * asset's authoritative file list.\n */\nexport interface DeployableEntry extends CatalogEntry {\n /**\n * Asset files relative to the manifest's directory. Set for store-staged\n * assets, whose verified pointer (not the provider's default filter) defines\n * what the asset is — a manifest-mode publish may list files the default filter\n * would not pick. Absent → the provider's `defaultFileFilter`.\n */\n files?: readonly string[];\n}\n\n/**\n * Throw when the asset's own folder holds a symlink the library would refuse. A lone manifest\n * file shares its directory with other assets, so only an asset that owns its directory (several\n * files, or a directory named after it) is checked.\n */\nfunction assertNoSymlinks(\n provider: IAssetKindProvider,\n entry: DeployableEntry,\n manifestPath: string | null | undefined,\n): void {\n let root = entry.source;\n if (manifestPath) {\n const filter = provider.defaultFileFilter(manifestPath);\n const files = entry.files ?? filter.files;\n if (files.length <= 1 && basename(filter.assetRoot) !== entry.name) return;\n root = filter.assetRoot;\n }\n const [rel] = listSkippedSymlinks(root);\n if (rel === undefined) return;\n const link = join(root, rel);\n throw new Error(\n `${canonicalEntryRef(entry)}: ${librarySymlinkMessage({ path: join(basename(root), rel), target: readlinkSync(link) })} Nothing was added.`,\n );\n}\n\n/**\n * Refuse, before anything is written, every entry whose own folder holds a symlink (p743).\n * `add`, `install` and `update` call this ahead of the first deploy and ahead of the removal of\n * stale assets, so `Nothing was added` is true: a refusal in the middle of {@link deployAll}\n * would leave the copies of the entries before it behind. Composition-only kinds, entries that a\n * `--link` deploy symlinks (no copy) and entries without a readable source are skipped. An agent\n * counts too: it is rendered, but its source is copied into the agent cache.\n */\nexport function assertNoLibrarySymlinks(\n entries: readonly DeployableEntry[],\n registry: IAssetKindRegistry,\n repositories: Record<string, SourceDeclaration> = {},\n link = false,\n): void {\n for (const entry of entries) {\n const provider = registry.getProvider(entry.kind);\n if (!provider?.installTarget) continue;\n if (link) {\n const decl = entry.publisher ? repositories[entry.publisher] : undefined;\n if (decl?.path != null && decl.factory !== true) continue;\n }\n let manifestPath: string | undefined;\n try {\n manifestPath = manifestFileOf(provider, entry.source);\n } catch {\n continue;\n }\n assertNoSymlinks(provider, entry, manifestPath);\n }\n}\n\n/**\n * Copy an asset into `dest`: the entry's explicit `files` when it has them, else\n * exactly the files the provider's `defaultFileFilter` selects (the same set the\n * store publishes and hashes). A directory source without a recognisable\n * manifest is copied whole.\n */\nfunction copyAsset(\n provider: IAssetKindProvider,\n entry: DeployableEntry,\n dest: string,\n onSecretFile?: (entry: DeployableEntry, path: string) => void,\n): void {\n const source = entry.source;\n const manifestPath = manifestFileOf(provider, source);\n // A library holds plain files: a symlink in the asset's folder refuses the deploy, as `library\n // index`, `validate` and the publish plan refuse the library (p743). Nothing is cleared or copied.\n assertNoSymlinks(provider, entry, manifestPath);\n clearDeployedAsset(dest);\n if (!manifestPath) {\n // Same ignore list as the content hash: leftovers and symlinks are not part of the asset.\n cpSync(source, dest, {\n recursive: true,\n filter: (src) => {\n if (src === source) return true;\n const name = basename(src);\n const stat = lstatSync(src);\n if (stat.isSymbolicLink()) return false;\n // A directory is only left out by name; a file by `isNonAssetFile`: a folder called\n // `credentials` or `build.log` is an ordinary folder.\n if (stat.isDirectory() ? isNonAssetDir(name) : isNonAssetFile(name)) {\n if (stat.isFile() && isSecretFileName(name)) {\n onSecretFile?.(entry, join(basename(source), relative(source, src)));\n }\n return false;\n }\n return true;\n },\n });\n return;\n }\n const filter = provider.defaultFileFilter(manifestPath);\n const assetRoot = filter.assetRoot;\n const files = entry.files ?? filter.files;\n mkdirSync(dest, { recursive: true });\n for (const rel of files) {\n const target = join(dest, rel);\n mkdirSync(dirname(target), { recursive: true });\n cpSync(join(assetRoot, rel), target);\n }\n // A lone manifest file shares its directory with other assets: only an asset that owns its\n // directory (several files, or a directory named after it) can say which secrets it drops.\n if (files.length > 1 || basename(assetRoot) === entry.name) {\n if (onSecretFile) {\n for (const rel of listSecretFiles(assetRoot))\n onSecretFile(entry, join(basename(assetRoot), rel));\n }\n }\n}\n\n/**\n * Whether the source file is executable but its deployed copy is not: the bytes match, yet the\n * copy shows as a mode change in `git status`, so a repeat install writes it again (p1657).\n */\nfunction execBitLost(source: string, deployed: string): boolean {\n try {\n return (lstatSync(source).mode & 0o111) !== 0 && (lstatSync(deployed).mode & 0o100) === 0;\n } catch {\n return false;\n }\n}\n\n/**\n * Symlink an asset (the `--link` dev-loop). A multi-file asset, or one living in\n * a directory named after it, links its whole directory; a lone manifest file\n * links into `dest/`.\n */\nfunction symlinkAsset(\n provider: IAssetKindProvider,\n source: string,\n dest: string,\n name: string,\n): void {\n clearDest(dest);\n mkdirSync(dirname(dest), { recursive: true });\n const manifestPath = manifestFileOf(provider, source);\n if (!manifestPath) {\n symlinkSync(resolve(source), dest);\n return;\n }\n const { assetRoot, files } = provider.defaultFileFilter(manifestPath);\n if (files.length > 1 || basename(assetRoot) === name) {\n symlinkSync(resolve(assetRoot), dest);\n } else {\n mkdirSync(dest, { recursive: true });\n symlinkSync(resolve(manifestPath), join(dest, basename(manifestPath)));\n }\n}\n\n/** What differs between a deployed asset directory and the bytes a deploy of the entry writes. */\nexport interface DeployedDrift {\n /** Deployed files (relative to the deployed asset directory) whose bytes differ from the source. */\n modified: string[];\n /** Files in the deployed asset directory that the asset does not ship. */\n extra: string[];\n}\n\n/**\n * Compare the deployed copy of `entry` with the bytes a copy deploy writes from its source: the\n * same file set {@link copyAsset} copies, so a tool leftover (`__pycache__/`, `.env`) in the\n * deployed directory is not drift. `null` when there is nothing to compare: a kind that is\n * not copied into a harness directory (composition-only, or an agent, which is rendered), no\n * deployed directory, a symlinked deploy (`--link`) or an unreadable source.\n */\nexport function deployedAssetDrift(\n entry: DeployableEntry,\n opts: Pick<DeployOptions, \"registry\" | \"harness\" | \"global\" | \"cwd\">,\n): DeployedDrift | null {\n const provider = opts.registry.getProvider(entry.kind);\n const component = provider?.installTarget;\n if (!provider || !component || component === \"agent\") return null;\n const dest = deployedDir(\n component,\n entry.name,\n opts.harness ?? \"claude-code\",\n opts.global ?? false,\n opts.cwd,\n );\n try {\n const deployed = lstatSync(dest);\n if (deployed.isSymbolicLink() || !deployed.isDirectory()) return null;\n const manifestPath = manifestFileOf(provider, entry.source);\n const filter = manifestPath ? provider.defaultFileFilter(manifestPath) : undefined;\n const assetRoot = filter ? filter.assetRoot : entry.source;\n const files = filter ? (entry.files ?? filter.files) : listAssetFiles(entry.source);\n const modified: string[] = [];\n for (const rel of files) {\n const deployedFile = join(dest, rel);\n if (!existsSync(deployedFile)) continue;\n if (computeHash(join(assetRoot, rel)) !== computeHash(deployedFile)) modified.push(rel);\n }\n const expected = new Set(files);\n const extra = [\n ...listAssetFiles(dest),\n ...listSecretFiles(dest).filter((rel) => isLeakedSecret(basename(rel))),\n ].filter((rel) => !expected.has(rel));\n return { modified, extra };\n } catch {\n return null;\n }\n}\n\n// ── Deploy options ───────────────────────────────────────────────────────────\n\n/**\n * Options controlling where and how assets are deployed.\n *\n * @docLink packages/asset-manager/api-reference#installer\n */\nexport interface DeployOptions {\n /** Asset-kind registry — decides, per kind, the harness install target and file set. */\n registry: IAssetKindRegistry;\n /** Agent framework to target (determines framework-specific directory layout). Defaults to `\"claude-code\"`. */\n harness?: HarnessName;\n /** When `true`, deploy into the global Skaile cache rather than a project workspace. */\n global?: boolean;\n /** Absolute path to the workspace root. Defaults to `process.cwd()`. */\n cwd?: string;\n /**\n * Opt into a symlink (the author dev-loop) instead of a copy — honoured only\n * when the source has a real local path. Machine-local / not for committing;\n * for store/factory sources (no stable local path) it is a no-op (still copy).\n */\n link?: boolean;\n /**\n * Called once per secret file ({@link isSecretFileName}: `.env*`, private keys, credential\n * files) inside an asset's own directory that a copy deploy leaves out (secrets are never part\n * of an asset), with the path relative to the asset directory's parent.\n */\n onSecretFile?: (entry: DeployableEntry, path: string) => void;\n /**\n * The lock's record of an agent's `../` compose folders: project-relative paths under\n * `.skaile/cache/agents/<agent>/composes/` with sha256. While a record exists the cached\n * folders keep exactly those bytes: a deploy does not copy the library's newer ones (only\n * {@link DeployOptions.refreshComposed} does, p1511).\n */\n lockedComposed?: (agent: string) => ReadonlyArray<{ path: string; sha256: string }> | undefined;\n /** Copy every `../` compose folder from its source again, whatever the lock records (`update`, `add`). */\n refreshComposed?: boolean;\n /**\n * Called once per `../` compose folder the lock records but neither the cached copy nor the\n * source holds any more: the source moved on and only `update` moves the lock to it.\n */\n onComposedDrift?: (entry: DeployableEntry, ref: string) => void;\n}\n\n/**\n * Keep the agent's source (`agent.yaml`, `SOUL.md`, …) under\n * `<project>/.skaile/cache/agents/<name>/`, the one place `agents.<id>.ref:\n * agent:@pub/name` resolves an added library / source / store agent from: the\n * deployed copy is a rendering (`.claude/agents/<name>.md`) that has lost the\n * composition, triggers and slots an instance needs. An `AGENT.md` agent is stored\n * in the `agent.yaml` + `SOUL.md` form so every instance consumer reads one shape.\n * A failure is logged, never fatal: the rendered agent is deployed either way.\n */\nfunction materializeAgentSource(\n provider: IAssetKindProvider,\n entry: DeployableEntry,\n srcDir: string,\n workspaceRoot: string,\n log: Log,\n opts: DeployOptions,\n): void {\n const dest = join(agentSourceCacheDir(workspaceRoot), entry.name);\n // `skaile rebuild` (or the compile an earlier add/install made) pins the composition in\n // `compile_manifest.json`; the copy below clears the folder, the pin is put back after it.\n // The CLI recompiles a pin whose content the source no longer serves (p413, p1310).\n const pinFile = join(dest, COMPILE_PIN_FILENAME);\n const pin = existsSync(pinFile) ? readFileSync(pinFile) : undefined;\n // The cached `../` compose folders are locked: set them aside so the copy below does not\n // clear them, and put back what the lock still describes (p1511).\n const composesDir = join(dest, \"composes\");\n const keptDir = existsSync(composesDir)\n ? join(agentSourceCacheDir(workspaceRoot), `.${entry.name}.composes-kept`)\n : undefined;\n if (keptDir) {\n rmSync(keptDir, { recursive: true, force: true });\n renameSync(composesDir, keptDir);\n }\n // `bundleParentComposes` settles the kept folders (puts back or replaces each); only after it\n // ran are the leftovers safe to delete. Any earlier exit puts the locked bytes back.\n let bundled = false;\n try {\n copyAsset(provider, entry, dest);\n if (!existsSync(join(dest, \"agent.yaml\"))) {\n const manifest = readManifest(srcDir);\n if (!manifest) return;\n writeFileSync(\n join(dest, \"agent.yaml\"),\n stringifyYaml({ ...manifest, name: manifest.name ?? entry.name }),\n \"utf8\",\n );\n const soul = readSoul(srcDir);\n if (soul) writeFileSync(join(dest, \"SOUL.md\"), `${soul}\\n`, \"utf8\");\n }\n bundleParentComposes(dest, srcDir, { entry, workspaceRoot, keptDir, opts });\n bundled = true;\n } catch (err) {\n const reason = err instanceof Error ? err.message : String(err);\n log(` warn: could not keep the source of agent ${entry.name}: ${reason}`);\n } finally {\n if (keptDir) {\n if (bundled || restoreKeptComposes(keptDir, composesDir)) {\n rmSync(keptDir, { recursive: true, force: true });\n }\n }\n if (pin && existsSync(dest) && !existsSync(pinFile)) writeFileSync(pinFile, pin);\n }\n}\n\n/**\n * Put the compose folders set aside by {@link materializeAgentSource} back under `composes/`\n * after a copy that did not finish, so the bytes the lock records are not lost (p1511). A folder\n * the failed run already placed there is left as it is. Returns `false` when a folder could not be moved back, so the caller keeps the set-aside copy.\n */\nfunction restoreKeptComposes(keptDir: string, composesDir: string): boolean {\n try {\n mkdirSync(composesDir, { recursive: true });\n for (const name of readdirSync(keptDir)) {\n const target = join(composesDir, name);\n if (!existsSync(target)) renameSync(join(keptDir, name), target);\n }\n return true;\n } catch {\n // the kept copy stays on disk next to the cache folder if it cannot be moved back\n return false;\n }\n}\n\n/** Name of the compile pin `skaile rebuild` writes (`COMPILE_MANIFEST_FILENAME` of the runner, which this layer cannot import). */\nconst COMPILE_PIN_FILENAME = \"compile_manifest.json\";\n\n/** Relative path → sha256 of the files of a compose folder (or of a lone file, under the key `\"\"`). */\nfunction composeRows(root: string): Map<string, string> {\n const out = new Map<string, string>();\n let top: Stats;\n try {\n top = lstatSync(root);\n } catch {\n return out;\n }\n if (top.isSymbolicLink()) return out;\n if (top.isFile()) {\n out.set(\"\", computeHash(root));\n return out;\n }\n const walk = (dir: string, rel: string): void => {\n for (const name of readdirSync(dir).sort()) {\n const abs = join(dir, name);\n const stat = lstatSync(abs);\n const here = rel ? `${rel}/${name}` : name;\n if (stat.isSymbolicLink()) continue;\n if (stat.isDirectory()) {\n if (!isNonAssetDir(name)) walk(abs, here);\n } else if (stat.isFile() && !isNonAssetFile(name)) {\n out.set(here, computeHash(abs));\n }\n }\n };\n walk(root, \"\");\n return out;\n}\n\nfunction sameRows(a: ReadonlyMap<string, string>, b: ReadonlyMap<string, string>): boolean {\n if (a.size !== b.size) return false;\n for (const [k, v] of a) if (b.get(k) !== v) return false;\n return true;\n}\n\n/** The rows of the lock record that lie under `targetRel` (project-relative, POSIX), keyed like {@link composeRows}. */\nfunction lockedRowsUnder(\n record: ReadonlyArray<{ path: string; sha256: string }> | undefined,\n targetRel: string,\n): Map<string, string> | undefined {\n if (!record) return undefined;\n const rows = new Map<string, string>();\n for (const f of record) {\n if (f.path === targetRel) rows.set(\"\", f.sha256);\n else if (f.path.startsWith(`${targetRel}/`))\n rows.set(f.path.slice(targetRel.length + 1), f.sha256);\n }\n return rows.size > 0 ? rows : undefined;\n}\n\n/** The `../` compose folders of an agent source: the cache folder name each one is copied to, its ref and its source folder. */\nfunction outerComposeFolders(\n srcDir: string,\n refs: readonly string[],\n): Array<{ ref: string; name: string; from: string }> {\n const taken = new Map<string, string>();\n const out: Array<{ ref: string; name: string; from: string }> = [];\n for (const ref of refs) {\n if (!normalize(ref).startsWith(\"..\")) continue;\n const from = resolve(srcDir, ref);\n let name = basename(from);\n for (let n = 2; taken.has(name) && taken.get(name) !== from; n++) {\n name = `${basename(from)}-${n}`;\n }\n taken.set(name, from);\n out.push({ ref, name, from });\n }\n return out;\n}\n\n/**\n * The files (project-relative, with sha256) the `../` compose folders of the agent source at\n * `srcDir` would occupy in the project cache now: what a copy of the source would record in the\n * lock. `outdated` compares them with `LockEntry.composed` (p1511).\n */\nexport function sourceComposedFiles(\n srcDir: string,\n agentName: string,\n workspaceRoot: string,\n): Array<{ path: string; sha256: string }> {\n const refs = (readManifest(srcDir)?.composes ?? []).map((c) => c.ref);\n const out: Array<{ path: string; sha256: string }> = [];\n for (const { name, from } of outerComposeFolders(srcDir, refs)) {\n if (!existsSync(from)) continue;\n const base = join(agentSourceCacheDir(workspaceRoot), agentName, \"composes\", name);\n for (const [rel, sha256] of composeRows(from)) {\n out.push({\n path: relative(workspaceRoot, rel ? join(base, rel) : base)\n .split(sep)\n .join(\"/\"),\n sha256,\n });\n }\n }\n return out.sort((a, b) => a.path.localeCompare(b.path));\n}\n\n/** The files (project-relative, with sha256) the project cache holds for the `../` compose folders of agent `agentName`. */\nexport function cachedComposedFiles(\n agentName: string,\n workspaceRoot: string,\n): Array<{ path: string; sha256: string }> {\n const dir = join(agentSourceCacheDir(workspaceRoot), agentName, \"composes\");\n return [...composeRows(dir)]\n .map(([rel, sha256]) => ({\n path: relative(workspaceRoot, join(dir, rel)).split(sep).join(\"/\"),\n sha256,\n }))\n .sort((a, b) => a.path.localeCompare(b.path));\n}\n\n/**\n * The `../` compose folders of the agent `entry` that a deploy with `opts.lockedComposed` would\n * report as drift ({@link DeployOptions.onComposedDrift}): the lock records the folder, the cache\n * no longer holds those bytes, and the source does not either. Reads only; nothing is written.\n * `install --locked` asks it before it deploys anything (p1642).\n *\n * @returns The `composes:` refs of the drifted folders (`../shared-rules/extra`).\n */\nexport function composedDriftRefs(\n entry: DeployableEntry,\n opts: Pick<DeployOptions, \"cwd\" | \"lockedComposed\">,\n): string[] {\n const workspaceRoot = opts.cwd ?? process.cwd();\n const srcDir = statSync(entry.source).isDirectory() ? entry.source : dirname(entry.source);\n const refs = (readManifest(srcDir)?.composes ?? []).map((c) => c.ref);\n const record = opts.lockedComposed?.(entry.name);\n const composesDir = join(agentSourceCacheDir(workspaceRoot), entry.name, \"composes\");\n const out: string[] = [];\n for (const { ref, name, from } of outerComposeFolders(srcDir, refs)) {\n const target = join(composesDir, name);\n const locked = lockedRowsUnder(record, relative(workspaceRoot, target).split(sep).join(\"/\"));\n const keptRows = existsSync(target) ? composeRows(target) : undefined;\n if (locked && keptRows && sameRows(keptRows, locked)) continue;\n if (!existsSync(from)) {\n if (locked) out.push(ref);\n continue;\n }\n if (locked && !sameRows(composeRows(from), locked)) out.push(ref);\n }\n return out;\n}\n\n/**\n * A `composes:` ref that climbs out of the agent folder (`../shared-rules/x`) names a folder\n * that does not exist beside the cache copy (`.skaile/cache/agents/<name>/`), so `skaile run`\n * could not serve it. Copy each such folder from the source into `composes/<name>/` and point\n * the ref there, as the omp rendering does (p1312).\n *\n * The folder is part of the lock (p1511): once the lock records its files, a deploy keeps the\n * cached copy while it still holds those bytes, writes the source's copy back only when it\n * holds them too, and otherwise reports the drift. Only `refreshComposed` (`update`, `add`)\n * copies the source's current bytes.\n */\nfunction bundleParentComposes(\n dest: string,\n srcDir: string,\n ctx: {\n entry: DeployableEntry;\n workspaceRoot: string;\n /** The previous `composes/` folder, set aside before the copy cleared the cache dir. */\n keptDir: string | undefined;\n opts: DeployOptions;\n },\n): void {\n const file = join(dest, \"agent.yaml\");\n const doc = parseDocument(readFileSync(file, \"utf8\"));\n const composes = doc.get(\"composes\");\n if (!isSeq(composes)) return;\n const record = ctx.opts.refreshComposed ? undefined : ctx.opts.lockedComposed?.(ctx.entry.name);\n const taken = new Map<string, string>();\n let changed = false;\n for (const item of composes.items) {\n if (!isMap(item)) continue;\n const ref = item.get(\"ref\");\n if (typeof ref !== \"string\" || !normalize(ref).startsWith(\"..\")) continue;\n const from = resolve(srcDir, ref);\n let name = basename(from);\n for (let n = 2; taken.has(name) && taken.get(name) !== from; n++) {\n name = `${basename(from)}-${n}`;\n }\n const target = join(dest, \"composes\", name);\n const targetRel = relative(ctx.workspaceRoot, target).split(sep).join(\"/\");\n const locked = lockedRowsUnder(record, targetRel);\n const kept = ctx.keptDir ? join(ctx.keptDir, name) : undefined;\n const keptRows = kept && existsSync(kept) ? composeRows(kept) : undefined;\n let how: \"copy\" | \"keep\" | \"drift\" | \"skip\";\n if (locked && keptRows && sameRows(keptRows, locked)) how = \"keep\";\n else if (!existsSync(from)) how = locked ? \"drift\" : \"skip\";\n else if (!locked || sameRows(composeRows(from), locked)) how = \"copy\";\n else how = \"drift\";\n taken.set(name, from);\n if (how === \"skip\") continue;\n rmSync(target, { recursive: true, force: true });\n mkdirSync(dirname(target), { recursive: true });\n if (how === \"copy\") {\n cpSync(from, target, {\n recursive: true,\n filter: (src) => {\n if (src === from) return true;\n const stat = lstatSync(src);\n if (stat.isSymbolicLink()) return false;\n return stat.isDirectory()\n ? !isNonAssetDir(basename(src))\n : !isNonAssetFile(basename(src));\n },\n });\n } else {\n // `keep` puts the locked bytes back; `drift` leaves what the cache held (hand edits\n // included) and says that only `update` moves the lock to the source.\n if (kept && existsSync(kept)) renameSync(kept, target);\n if (how === \"drift\") ctx.opts.onComposedDrift?.(ctx.entry, ref);\n }\n item.set(\"ref\", `./composes/${name}`);\n changed = true;\n }\n if (changed) writeFileSync(file, doc.toString(), \"utf8\");\n}\n\n// ── Deploy / remove ──────────────────────────────────────────────────────────\n\n/**\n * Deploy a single asset to the framework-specific directory.\n *\n * Copies by default — self-contained, cache-safe, and portable, so a deployed\n * asset survives a `cache clean` of its source and a committed `.claude/` stays\n * machine-independent. `opts.link` opts into a symlink (the live dev-loop), but\n * only when the source has a real local path; store/factory sources (no stable\n * local path) ignore it and still copy. Agents are rendered via the enriched\n * `installAgent` path which resolves abilities, contracts, and framework\n * fragments before writing the native agent file.\n *\n * @param entry - Catalog entry describing the asset to deploy.\n * @param repositories - Repository declarations from `skaile.yaml` (used to\n * determine whether the source is a local path or a remote clone).\n * @param opts - Deployment target options.\n * @param log - Optional logger callback for progress messages.\n * @returns `true` when the asset was deployed successfully.\n * @docLink packages/asset-manager/api-reference#installer\n */\nexport function deployAsset(\n entry: DeployableEntry,\n repositories: Record<string, SourceDeclaration>,\n opts: DeployOptions,\n log: Log = noop,\n): boolean {\n return deployEntry(entry, repositories, opts, log).deployed;\n}\n\n/**\n * {@link deployAsset} plus whether the deploy altered anything on disk. A copied asset always\n * counts as changed; an agent is re-rendered every time but counts as changed only when a\n * rendered file's bytes differ from the deployed one (an unchanged agent is left untouched).\n */\nfunction deployEntry(\n entry: DeployableEntry,\n repositories: Record<string, SourceDeclaration>,\n opts: DeployOptions,\n log: Log,\n /** `true` when {@link deployAll} already kept this agent's source under `.skaile/cache/agents/`. */\n sourceKept = false,\n /** `true` when another agent deployed in this call composes this one as a `delegate` sub-agent. */\n delegated = false,\n): { deployed: boolean; changed: boolean } {\n const harness = opts.harness ?? \"claude-code\";\n const globalInstall = opts.global ?? false;\n const cwd = opts.cwd;\n\n // Composition-only kinds (no `installTarget`) never land in a harness dir:\n // they are fetched + verified into the store cache and composed at session start.\n const provider = opts.registry.getProvider(entry.kind);\n const component = provider?.installTarget;\n if (!provider || !component) return { deployed: true, changed: false };\n\n // Agents need framework-specific rendering via the enriched installAgent path\n if (component === \"agent\") {\n const workspaceRoot = cwd ?? process.cwd();\n const agentDeployDir = deployedBase(component, harness as HarnessName, globalInstall, cwd);\n const targetMap = HARNESS_TARGETS[harness as HarnessName];\n const skillsRelDir = targetMap?.local.skill ?? \"\";\n const wsConfig = resolveSkWorkspaceConfig(workspaceRoot);\n const srcDir = statSync(entry.source).isDirectory() ? entry.source : dirname(entry.source);\n // A symlink at a path the render writes is the user's own wiring: replace the link, never\n // write through it into the file or folder it points at (p1060).\n for (const held of deployedPaths(component, entry.name, harness, globalInstall, cwd)) {\n try {\n if (lstatSync(held).isSymbolicLink()) unlinkSync(held);\n } catch {\n // nothing there\n }\n }\n const result = installAgent(\n srcDir,\n agentDeployDir,\n workspaceRoot,\n harness,\n skillsRelDir,\n entry.name,\n /* includeSubAgents */ true,\n new Set<string>(),\n wsConfig,\n log,\n undefined,\n delegated,\n );\n for (const w of result.warnings) log(` warn: ${w}`);\n if (result.created.length > 0) {\n let changed = result.changed.length > 0;\n // An `AGENT.md` agent used to deploy raw into `<base>/<name>/AGENT.md`, which no\n // harness but omp (whose rendering is that directory) reads: drop the stale copy.\n const staleRawCopy = join(agentDeployDir, entry.name);\n if (harness !== \"omp\" && existsSync(staleRawCopy)) {\n clearDest(staleRawCopy);\n changed = true;\n }\n if (!globalInstall && !sourceKept) {\n materializeAgentSource(provider, entry, srcDir, workspaceRoot, log, opts);\n }\n return { deployed: true, changed };\n }\n // Fall through to raw deploy if renderer produces no files (unsupported framework, etc.)\n }\n\n const dest = deployedDir(component, entry.name, harness, globalInstall, cwd);\n mkdirSync(dirname(dest), { recursive: true });\n\n // Symlink only on explicit opt-in AND when the source has a real local path.\n // Factory sources have a `path` (the bundled dir under node_modules, replaced\n // on every upgrade) but no stable dev-loop, so they always copy. Default copy\n // keeps deploys cache-safe and portable.\n const repoDecl = entry.publisher ? repositories[entry.publisher] : undefined;\n const hasLocalPath = repoDecl?.path != null && repoDecl.factory !== true;\n\n if (opts.link === true && hasLocalPath) {\n symlinkAsset(provider, entry.source, dest, entry.name);\n log(` symlink ${entry.kind}:${entry.name}`);\n } else {\n copyAsset(provider, entry, dest, opts.onSecretFile);\n log(` copy ${entry.kind}:${entry.name}`);\n }\n return { deployed: true, changed: true };\n}\n\n/**\n * Deploy all resolved assets, applying patches where configured.\n *\n * Already-deployed assets are skipped unless their deployed manifest content differs\n * from the source. This handles copies that have gone stale after a source update.\n * In copy mode (the default, `!opts.link`) an existing **symlink** dest is healed:\n * it is removed and re-deployed as a real copy, so an old/legacy symlink deploy is\n * silently upgraded. With `opts.link` an existing symlink is left alone.\n *\n * @param resolved - Catalog entries to deploy (output of `resolveAll`).\n * @param repositories - Repository declarations from `skaile.yaml`.\n * @param patches - Map of `kind:name` → patch file path for patch application.\n * @param opts - Deployment target options.\n * @param log - Optional logger callback for progress messages.\n * @returns Canonical refs (`kind:@publisher/name[#version]`; bare `kind:name`\n * when the entry carries no publisher) of the assets newly deployed in this call.\n * @docLink packages/asset-manager/api-reference#installer\n */\nexport function deployAll(\n resolved: DeployableEntry[],\n repositories: Record<string, SourceDeclaration>,\n patches: Record<string, string>,\n opts: DeployOptions,\n log: Log = noop,\n): string[] {\n // Before any copy: a symlink in a later entry must not leave the earlier ones behind (p743).\n assertNoLibrarySymlinks(resolved, opts.registry, repositories, opts.link === true);\n const deployed: string[] = [];\n const deployedAt: Array<[number, string]> = [];\n const harness = opts.harness ?? \"claude-code\";\n const globalInstall = opts.global ?? false;\n const cwd = opts.cwd;\n\n // An agent is rendered from its composed skills (`## Installed Abilities`), contracts and\n // delegate sub-agents, which `deployAll` deploys in this same call: render the agents last, with\n // every agent's source already kept, so one pass writes the file a later `install` would write.\n const isAgent = (entry: DeployableEntry): boolean =>\n installTargetOf(opts.registry, entry.kind) === \"agent\";\n const keptSources = new Set<DeployableEntry>();\n if (!globalInstall) {\n for (const entry of resolved.filter(isAgent)) {\n const provider = opts.registry.getProvider(entry.kind);\n if (!provider) continue;\n const srcDir = statSync(entry.source).isDirectory() ? entry.source : dirname(entry.source);\n materializeAgentSource(provider, entry, srcDir, cwd ?? process.cwd(), noop, opts);\n keptSources.add(entry);\n }\n }\n\n // `resolved` lists an asset before what it requires, so the agents go in reverse: a delegate\n // sub-agent is rendered by its own entry before its composer renders it again. Both renders\n // must write the same bytes, so an agent that another agent of this call delegates to is\n // rendered as a sub-agent by its own entry too (else the two writes alternate, and the file\n // is reported as changed on every run).\n const agentsLast = resolved.filter(isAgent).reverse();\n const delegatedNames = new Set<string>();\n for (const entry of agentsLast) {\n const srcDir = statSync(entry.source).isDirectory() ? entry.source : dirname(entry.source);\n for (const name of delegateNamesOf(srcDir)) delegatedNames.add(name);\n }\n for (const entry of [...resolved.filter((e) => !isAgent(e)), ...agentsLast]) {\n // Skip composition-only kinds (no `installTarget`) — they live in the store\n // cache and are composed at session start, never copied into a harness dir.\n const component = installTargetOf(opts.registry, entry.kind);\n if (!component) continue;\n\n const ref = `${entry.kind}:${entry.name}`;\n\n // Agents are compiled artifacts: always re-rendered, never skipped on a manifest hash\n // (and a stale raw `<name>/AGENT.md` copy of the old layout must be replaced, not kept).\n if (component !== \"agent\" && isDeployed(component, entry.name, harness, globalInstall, cwd)) {\n // Compare the deployed manifest file against the source to detect stale copies.\n // For symlinks the deployed path resolves through to the source file, so hashes\n // always match — symlinked installs are never needlessly re-linked.\n const dest = deployedDir(component, entry.name, harness, globalInstall, cwd);\n // Heal: in copy mode an existing symlink dest is left to fall through to a\n // real copy below (cache-safe + portable) — bypass the hash skip entirely.\n // With --link a symlink dest is intentional, so it takes the normal skip path.\n let destIsSymlink = false;\n try {\n destIsSymlink = lstatSync(dest).isSymbolicLink();\n } catch {}\n const healSymlink = destIsSymlink && opts.link !== true;\n // Surface the one-time symlink→copy migration so an author who relied on a\n // live symlink dev-loop knows why edits stopped reflecting.\n if (healSymlink) log(` healed symlink → copy: ${ref} (use --link for the dev-loop)`);\n\n if (!healSymlink) {\n const manifestName = basename(entry.source);\n const deployedManifest = join(dest, manifestName);\n // isDeployed() only lstats the dir, so a present-but-empty dir (manifest\n // file deleted) reads as deployed. A missing manifest must never count as\n // \"already deployed\" — fall through to re-deploy instead of skipping.\n // (existsSync follows symlinks, so for symlinked installs the manifest\n // resolves through to the live source and the hash check below still\n // skips them.)\n if (existsSync(deployedManifest)) {\n let manifestUnchanged: boolean;\n try {\n manifestUnchanged =\n computeHash(entry.source) === computeHash(deployedManifest) &&\n !execBitLost(entry.source, deployedManifest);\n } catch {\n // Deployed manifest unreadable (e.g. agent rendered to a different path) — skip\n log(` already deployed: ${ref}`);\n continue;\n }\n // Every other file the deploy writes must be present and identical too —\n // the manifest alone misses a deleted or stale companion (`.gitignore`,\n // `resources/`, `scripts/`) the copy below would restore. A companion\n // that cannot be compared counts as changed, so it is healed, not skipped.\n const srcRoot = dirname(entry.source);\n const companionsUnchanged = (entry.files ?? [])\n .filter((rel) => rel !== manifestName)\n .every((rel) => {\n const deployed = join(dest, rel);\n try {\n return (\n existsSync(deployed) &&\n computeHash(join(srcRoot, rel)) === computeHash(deployed) &&\n !execBitLost(join(srcRoot, rel), deployed)\n );\n } catch {\n return false;\n }\n });\n // A file the asset does not ship (a stray `extra.txt`) is drift too: the copy below\n // clears the directory, so a repeat install restores the asset exactly.\n const strayFiles =\n deployedAssetDrift(entry, { ...opts, harness, global: globalInstall, cwd })?.extra\n .length ?? 0;\n if (manifestUnchanged && companionsUnchanged && strayFiles === 0) {\n log(` already deployed: ${ref}`);\n continue;\n }\n log(` updating: ${ref} (content changed)`);\n // fall through to redeploy\n }\n }\n }\n\n // An agent is re-rendered every time; it is reported as deployed only when a rendered file\n // changed, so a repeat install leaves it (and the report) alone.\n const { changed } = deployEntry(\n entry,\n repositories,\n opts,\n log,\n keptSources.has(entry),\n isAgent(entry) && delegatedNames.has(entry.name),\n );\n if (changed) deployedAt.push([resolved.indexOf(entry), canonicalEntryRef(entry)]);\n\n // Apply patch if configured\n const patchFile = patches[ref];\n if (patchFile && existsSync(patchFile)) {\n const dest = deployedDir(component, entry.name, harness, globalInstall, cwd);\n if (applyPatch(dest, patchFile)) {\n log(` patched ${ref}`);\n } else {\n log(` patch failed for ${ref}`);\n }\n }\n }\n\n // Report in the order the assets were resolved, not the order they were rendered.\n deployed.push(...deployedAt.sort((a, b) => a[0] - b[0]).map(([, ref]) => ref));\n return deployed;\n}\n\n/**\n * Unified diff from a deployed agent to its source, `-` lines in the deployed copy only and `+`\n * lines in the source only. An agent is a rendering, not a copy, so the source is rendered the way\n * {@link deployAsset} renders it (same renderer, same workspace context) into a scratch directory\n * and that is compared with what the harness holds: `<name>.md` for claude-code, `<name>.toml`\n * plus the `skaile-agents/<name>.md` identity for codex, the `<name>/` directory for omp.\n *\n * @param entry - The agent's catalog entry (`source` is its `agent.yaml` / `AGENT.md`).\n * @param opts - Deployment target options (must match the options used at install time).\n * @param instance - Compare the rendering of one agent instance of `skaile.yaml` (named by its id,\n * with its settings) instead of the one named after the asset (p925).\n * @returns `null` when none of the agent's rendered files is deployed, else the diff text\n * (`\"\"` when the deployed agent matches its source).\n * @throws When `diff(1)` itself fails (exit status other than 0/1).\n */\nexport function diffDeployedAgent(\n entry: DeployableEntry,\n opts: DeployOptions,\n instance?: { id: string; srcDir: string; config: AgentInstanceConfig },\n): string | null {\n const harness = opts.harness ?? \"claude-code\";\n const workspaceRoot = opts.cwd ?? process.cwd();\n const deployedAgents = deployedBase(\"agent\", harness, opts.global ?? false, opts.cwd);\n const scratch = mkdtempSync(join(tmpdir(), \"skaile-diff-agent-\"));\n try {\n const renderedAgents = join(scratch, \"agents\");\n const srcDir =\n instance?.srcDir ??\n (statSync(entry.source).isDirectory() ? entry.source : dirname(entry.source));\n // An instance renders the way `install` renders it: named by its id, with its own settings.\n const rendered = installAgent(\n srcDir,\n renderedAgents,\n workspaceRoot,\n harness,\n HARNESS_TARGETS[harness]?.local.skill ?? \"\",\n instance?.id ?? entry.name,\n /* includeSubAgents */ instance !== undefined,\n new Set<string>(),\n resolveSkWorkspaceConfig(workspaceRoot),\n undefined,\n instance?.config,\n );\n if (rendered.created.length === 0) return null;\n\n // Each rendered top-level item pairs with the deployed item of the same name.\n const pairs: Array<[from: string, to: string]> = [];\n for (const [renderedRoot, deployedRoot] of [\n [renderedAgents, deployedAgents],\n [join(scratch, CODEX_IDENTITY_DIR), join(dirname(deployedAgents), CODEX_IDENTITY_DIR)],\n ] as const) {\n if (!existsSync(renderedRoot)) continue;\n for (const item of readdirSync(renderedRoot)) {\n pairs.push([join(deployedRoot, item), join(renderedRoot, item)]);\n }\n }\n if (!pairs.some(([from]) => existsSync(from))) return null;\n\n const diffs: string[] = [];\n for (const [from, to] of pairs) {\n const r = spawnSync(\"diff\", [\"-ruN\", from, to], { encoding: \"utf8\" });\n if (r.status === 1) diffs.push(r.stdout);\n else if (r.status !== 0) {\n throw new Error(\n `diff failed for agent:${entry.name}: ${r.stderr || r.error?.message || \"unknown error\"}`,\n );\n }\n }\n return diffs.join(\"\").split(`${scratch}${sep}`).join(`rendered${sep}`);\n } finally {\n rmSync(scratch, { recursive: true, force: true });\n }\n}\n\n/** The file that remembers the old `~/.omp/<dir>/<name>` folders a sweep decided are not skaile's. */\nfunction keptLegacyFile(): string {\n return join(globalSkaileDir(), \"kept-omp-copies.json\");\n}\n\n/** The old omp folders skaile never deletes (kept by an earlier run: it did not write them). */\nexport function readKeptLegacyCopies(): Set<string> {\n try {\n const parsed: unknown = JSON.parse(readFileSync(keptLegacyFile(), \"utf-8\"));\n return new Set(Array.isArray(parsed) ? parsed.filter((v) => typeof v === \"string\") : []);\n } catch {\n return new Set();\n }\n}\n\nexport function writeKeptLegacyCopies(paths: Set<string>): void {\n mkdirSync(dirname(keptLegacyFile()), { recursive: true });\n writeFileSync(keptLegacyFile(), `${JSON.stringify([...paths].sort(), null, 2)}\\n`);\n}\n\n/**\n * Remove a deployed asset from the framework directory.\n *\n * Removes symlinks with `unlink`; removes copied directories with `rm -rf`.\n *\n * @param kind - Asset kind (`skill`, `agent`, `prompt`, `flow`, `contract`).\n * @param name - Asset name as registered in the catalog.\n * @param opts - Deployment target options (must match the options used at install time).\n * @returns `true` if the asset existed and was removed; `false` if it was not deployed.\n * @docLink packages/asset-manager/api-reference#installer\n */\nexport function removeAsset(kind: string, name: string, opts: DeployOptions): boolean {\n const harness = opts.harness ?? \"claude-code\";\n const globalInstall = opts.global ?? false;\n const cwd = opts.cwd;\n\n // Composition-only kinds have no harness dir — never resolve (and delete) one.\n const component = installTargetOf(opts.registry, kind);\n if (!component) return false;\n let removed = false;\n // Before 5.13.0 an omp global install wrote to `~/.omp/<skills|agents|…>/`, a place omp does\n // not read (it reads `~/.omp/agent/…`). Removing the asset removes that dead copy too.\n // A flow lives under `~/.skaile` in both layouts: nothing to add.\n // A folder an earlier sweep kept (skaile did not write it) is never deleted.\n const kept = globalInstall ? readKeptLegacyCopies() : new Set<string>();\n const legacyOmp =\n globalInstall && harness === \"omp\" && component !== \"flow\"\n ? deployedPaths(component, name, \"omp\", false, homedir()).filter((p) => !kept.has(p))\n : [];\n for (const dest of [\n ...deployedPaths(component, name, harness, globalInstall, cwd),\n ...legacyOmp,\n ]) {\n try {\n const s = lstatSync(dest);\n if (s.isSymbolicLink()) unlinkSync(dest);\n else rmSync(dest, { recursive: true, force: true });\n removed = true;\n } catch {\n // not deployed at this path\n }\n }\n if (component === \"agent\") {\n // The Codex identity file and the kept source live beside the deployed agent.\n const agentDir = deployedBase(component, harness, globalInstall, cwd);\n const extras = [join(dirname(agentDir), CODEX_IDENTITY_DIR, `${name}.md`)];\n if (!globalInstall) extras.push(join(agentSourceCacheDir(cwd ?? process.cwd()), name));\n for (const extra of extras) {\n if (existsSync(extra)) {\n rmSync(extra, { recursive: true, force: true });\n removed = true;\n }\n }\n }\n return removed;\n}\n\n// ── Scaffold ─────────────────────────────────────────────────────────────────\n\n/** Markdown-marker scaffold (SKILL.md / CONTRACT.md / `*.prompt.md`); `body` is the kind's placeholder. */\nfunction markdownTemplate(name: string, description: string, body: string): string {\n // JSON.stringify yields a valid YAML double-quoted scalar, so any\n // user-supplied description (colons, quotes, `#`) survives the round-trip.\n return `---\nname: \"${name}\"\ndescription: ${JSON.stringify(description)}\nmetadata:\n version: \"0.1.0\"\n---\n\n# ${name}\n\n${body}\n`;\n}\n\n/** `agent.yaml` (spec 0.2) scaffold; the system prompt lives in the `SOUL.md` next to it. */\nfunction agentTemplate(name: string, description: string): string {\n return `spec_version: \"0.2\"\nname: \"${name}\"\nversion: 0.1.0\ndescription: ${JSON.stringify(description)}\nlifecycle: standing\n`;\n}\n\nfunction soulTemplate(name: string): string {\n return `# ${name}\n\n${AGENT_BODY_PLACEHOLDER}\n`;\n}\n\nfunction presetTemplate(name: string, description: string): string {\n return `name: ${name}\ndescription: ${JSON.stringify(description)}\nversion: 0.1.0\nitems:\n - ref: ${PRESET_ITEM_PLACEHOLDER_REF}\n`;\n}\n\n/**\n * `<name>.flow.yaml` scaffold: a strict v2 flow (`schemaVersion: 2`) with one example `agent` node\n * and no edges. The instruction is a placeholder the checks of `validate` / `index` / the plan\n * refuse until the author replaces it, like every other scaffold.\n */\nfunction flowTemplate(name: string, description: string): string {\n return `schemaVersion: 2\nid: \"${name}\"\nversion: \"0.1.0\"\nname: \"${name}\"\ndescription: ${JSON.stringify(description)}\n\n# One node per step; join steps with edges (\\`type: flow\\`). Rename or replace the example node.\nnodes:\n - id: example\n label: Example step\n description: Replace this node with the first step of the flow.\n run:\n kind: agent\n instruction: ${JSON.stringify(FLOW_NODE_INSTRUCTION_PLACEHOLDER)}\n\nedges: []\n`;\n}\n\n/** Asset kinds {@link createScaffold} has a real template for. */\nexport const SCAFFOLD_KINDS = [\"skill\", \"agent\", \"prompt\", \"flow\", \"preset\", \"contract\"] as const;\n\n/** Options for {@link createScaffold}. */\nexport interface ScaffoldOptions {\n /**\n * Description written into the manifest. Omitted: every kind gets a\n * `TODO:` placeholder that `skaile validate` rejects until it is replaced.\n */\n description?: string;\n}\n\n/**\n * Create a minimal scaffold directory for a new asset.\n *\n * Writes the appropriate manifest file (`SKILL.md`, `agent.yaml` + `SOUL.md`, `CONTRACT.md`,\n * `<name>.preset.yaml`, `<name>.flow.yaml`, or `<name>.prompt.md`) inside a\n * new `<destDir>/<name>/` directory.\n *\n * @param name - Asset name (also used as the directory name).\n * @param kind - Asset kind: `skill` | `agent` | `preset` | `flow` | `prompt` | `contract`.\n * @param destDir - Parent directory to create the asset in.\n * @param opts - Optional scaffold content ({@link ScaffoldOptions}).\n * @returns `{ ok: true, path }` on success, `{ ok: false, path: errorMessage }` if the\n * directory already exists or `kind` is not one of {@link SCAFFOLD_KINDS}\n * (`Cannot scaffold kind \"<kind>\". Expected: ...`); nothing is created then.\n * @docLink packages/asset-manager/api-reference#installer\n */\nexport function createScaffold(\n name: string,\n kind: string,\n destDir: string,\n opts: ScaffoldOptions = {},\n): { ok: boolean; path: string } {\n if (!(SCAFFOLD_KINDS as readonly string[]).includes(kind)) {\n return {\n ok: false,\n path: `Cannot scaffold kind \"${kind}\". Expected: ${SCAFFOLD_KINDS.join(\", \")}.`,\n };\n }\n const dest = join(destDir, name);\n if (existsSync(dest)) {\n return { ok: false, path: `Directory '${name}' already exists in ${destDir}` };\n }\n mkdirSync(dest, { recursive: true });\n\n const mdDescription =\n opts.description ??\n ([\"agent\", \"contract\", \"prompt\", \"flow\", \"preset\"].includes(kind)\n ? `${SKILL_DESCRIPTION_PLACEHOLDER_PREFIX} describe this ${kind}.`\n : SKILL_DESCRIPTION_PLACEHOLDER);\n\n if (kind === \"preset\") {\n writeFileSync(join(dest, `${name}.preset.yaml`), presetTemplate(name, mdDescription), \"utf8\");\n } else if (kind === \"flow\") {\n writeFileSync(join(dest, `${name}.flow.yaml`), flowTemplate(name, mdDescription), \"utf8\");\n } else if (kind === \"prompt\") {\n writeFileSync(\n join(dest, `${name}.prompt.md`),\n markdownTemplate(name, mdDescription, PROMPT_BODY_PLACEHOLDER),\n \"utf8\",\n );\n } else if (kind === \"agent\") {\n writeFileSync(join(dest, \"agent.yaml\"), agentTemplate(name, mdDescription), \"utf8\");\n writeFileSync(join(dest, \"SOUL.md\"), soulTemplate(name), \"utf8\");\n } else if (kind === \"contract\") {\n writeFileSync(\n join(dest, \"CONTRACT.md\"),\n markdownTemplate(name, mdDescription, CONTRACT_BODY_PLACEHOLDER),\n \"utf8\",\n );\n } else {\n writeFileSync(\n join(dest, \"SKILL.md\"),\n markdownTemplate(name, mdDescription, SKILL_BODY_PLACEHOLDER),\n \"utf8\",\n );\n }\n\n return { ok: true, path: dest };\n}\n"]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export { connectorDescribe, connectorExec, connectorList, connectorLoadSkill, connectorRead, connectorSearch, connectorWrite, mountList, mountRead, mountStatus, mountSync } from './chunk-YFGXYQW4.js';
|
|
2
|
-
import './chunk-3MWQKQUB.js';
|
|
3
|
-
import './chunk-EXRQKOY6.js';
|
|
4
|
-
import './chunk-GTMANMBZ.js';
|
|
5
|
-
import './chunk-O7KAQQAI.js';
|
|
6
|
-
import './chunk-5T3DTK7A.js';
|
|
7
|
-
import './chunk-UAOHR6AL.js';
|
|
8
|
-
import './chunk-PTBX55QF.js';
|
|
9
|
-
import './chunk-JSWMRYLM.js';
|
|
10
|
-
import './chunk-LOO5CB5M.js';
|
|
11
|
-
import './chunk-UUKCPPTQ.js';
|
|
12
|
-
import './chunk-U3SXCVR7.js';
|
|
13
|
-
import './chunk-6X3GDPCB.js';
|
|
14
|
-
import './chunk-6OHZUUR7.js';
|
|
15
|
-
import './chunk-7DN6JKP2.js';
|
|
16
|
-
import './chunk-QSIFEHSN.js';
|
|
17
|
-
import './chunk-QJQQNBVT.js';
|
|
18
|
-
import './chunk-G5SUWZEU.js';
|
|
19
|
-
import './chunk-G63KOHFS.js';
|
|
20
|
-
import './chunk-6UP2EDFN.js';
|
|
21
|
-
import './chunk-IFGTRL2I.js';
|
|
22
|
-
import './chunk-ZWCGJYR7.js';
|
|
23
|
-
import './chunk-WD3L5QSU.js';
|
|
24
|
-
import './chunk-7RGTAEG6.js';
|
|
25
|
-
import './chunk-VZU67OKK.js';
|
|
26
|
-
import './chunk-LNFKL23K.js';
|
|
27
|
-
import './chunk-JRN5QF4C.js';
|
|
28
|
-
import './chunk-NUELZWCF.js';
|
|
29
|
-
import './chunk-76FLBODK.js';
|
|
30
|
-
import './chunk-ABVWUM2E.js';
|
|
31
|
-
import './chunk-4GY63JU6.js';
|
|
32
|
-
import './chunk-3ENE6ZOF.js';
|
|
33
|
-
import './chunk-5KRMNUL4.js';
|
|
34
|
-
import './chunk-C5HFK34M.js';
|
|
35
|
-
import './chunk-MWXYN6NY.js';
|
|
36
|
-
import './chunk-6WQGJF65.js';
|
|
37
|
-
import './chunk-L5VSIPQD.js';
|
|
38
|
-
import './chunk-VTETQCR6.js';
|
|
39
|
-
import './chunk-U6S5CXKB.js';
|
|
40
|
-
import './chunk-VV2DJT4I.js';
|
|
41
|
-
import './chunk-RVRB27AN.js';
|
|
42
|
-
import './chunk-IZQOO6MN.js';
|
|
43
|
-
import './chunk-VSX2G7LA.js';
|
|
44
|
-
import './chunk-RXGPFAMN.js';
|
|
45
|
-
import './chunk-DKXNKFKP.js';
|
|
46
|
-
import './chunk-C3CAXQMA.js';
|
|
47
|
-
import './chunk-BOFL7GIF.js';
|
|
48
|
-
import './chunk-NSBPE2FW.js';
|
|
49
|
-
//# sourceMappingURL=connectors-4WH32NK2.js.map
|
|
50
|
-
//# sourceMappingURL=connectors-4WH32NK2.js.map
|