@skaile/workspaces 5.6.1 → 5.8.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 +176 -0
- package/README.md +4 -2
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-LU7NHOAP.js → asset-feeds-EYRZR4K5.js} +55 -31
- package/dist/asset-feeds-EYRZR4K5.js.map +1 -0
- package/dist/asset-manager/catalog-deployer.js +10 -10
- package/dist/asset-manager/index.js +16 -16
- package/dist/asset-manager/installer.js +12 -12
- package/dist/asset-manager/renderers.js +11 -11
- package/dist/asset-manager/src/index.d.ts +364 -30
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/asset-manager/src/install-agent.d.ts +11 -0
- package/dist/asset-manager/src/install-agent.d.ts.map +1 -1
- package/dist/asset-manager/src/installer.d.ts +6 -3
- package/dist/asset-manager/src/installer.d.ts.map +1 -1
- package/dist/bridge/drivers/claude-sdk.js +148 -212
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +91 -67
- package/dist/bridge/drivers/codex.js.map +1 -1
- package/dist/bridge/drivers/continue.js +16 -17
- package/dist/bridge/drivers/continue.js.map +1 -1
- package/dist/bridge/drivers/echo.js +4 -4
- package/dist/bridge/drivers/gemini.js +8 -8
- package/dist/bridge/drivers/goose.js +16 -17
- package/dist/bridge/drivers/goose.js.map +1 -1
- package/dist/bridge/drivers/omp.js +68 -104
- package/dist/bridge/drivers/omp.js.map +1 -1
- package/dist/bridge/drivers/opencode.js +16 -17
- package/dist/bridge/drivers/opencode.js.map +1 -1
- package/dist/bridge/drivers/qwen.js +8 -8
- package/dist/bridge/index.js +17 -18
- package/dist/bridge/src/codex/managed-driver.d.ts +13 -10
- package/dist/bridge/src/codex/managed-driver.d.ts.map +1 -1
- package/dist/bridge/src/drivers/_subprocess-cli.d.ts +12 -2
- package/dist/bridge/src/drivers/_subprocess-cli.d.ts.map +1 -1
- package/dist/bridge/src/drivers/claude-sdk.d.ts +37 -62
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/drivers/codex.d.ts +26 -10
- package/dist/bridge/src/drivers/codex.d.ts.map +1 -1
- package/dist/bridge/src/drivers/continue.d.ts +2 -2
- package/dist/bridge/src/drivers/continue.d.ts.map +1 -1
- package/dist/bridge/src/drivers/gemini.d.ts +2 -2
- package/dist/bridge/src/drivers/gemini.d.ts.map +1 -1
- package/dist/bridge/src/drivers/goose.d.ts +2 -2
- package/dist/bridge/src/drivers/goose.d.ts.map +1 -1
- package/dist/bridge/src/drivers/omp.d.ts +24 -35
- package/dist/bridge/src/drivers/omp.d.ts.map +1 -1
- package/dist/bridge/src/drivers/opencode.d.ts +2 -2
- package/dist/bridge/src/drivers/opencode.d.ts.map +1 -1
- package/dist/bridge/src/drivers/recovery-policy.d.ts +79 -0
- package/dist/bridge/src/drivers/recovery-policy.d.ts.map +1 -0
- package/dist/bridge/src/index.d.ts +1 -0
- package/dist/bridge/src/index.d.ts.map +1 -1
- package/dist/bridge/src/reconfigure-ledger.d.ts +117 -0
- package/dist/bridge/src/reconfigure-ledger.d.ts.map +1 -0
- package/dist/bridge/src/types.d.ts +57 -6
- package/dist/bridge/src/types.d.ts.map +1 -1
- package/dist/{chunk-OLLAQLFJ.js → chunk-2FRUUDZY.js} +5 -5
- package/dist/{chunk-OLLAQLFJ.js.map → chunk-2FRUUDZY.js.map} +1 -1
- package/dist/{chunk-SDFROXSA.js → chunk-2LWYNQK7.js} +3 -3
- package/dist/{chunk-SDFROXSA.js.map → chunk-2LWYNQK7.js.map} +1 -1
- package/dist/{chunk-TZCQ7ZWQ.js → chunk-36AFURKZ.js} +10 -11
- package/dist/chunk-36AFURKZ.js.map +1 -0
- package/dist/{chunk-MX3UQXLU.js → chunk-4MQS7CAF.js} +256 -92
- package/dist/chunk-4MQS7CAF.js.map +1 -0
- package/dist/{chunk-45VFGT7A.js → chunk-4PTSR4UU.js} +3 -3
- package/dist/{chunk-45VFGT7A.js.map → chunk-4PTSR4UU.js.map} +1 -1
- package/dist/{chunk-VX3INFBA.js → chunk-6GRX5L6A.js} +5 -5
- package/dist/{chunk-VX3INFBA.js.map → chunk-6GRX5L6A.js.map} +1 -1
- package/dist/{chunk-NFGRW3L7.js → chunk-7RGTAEG6.js} +3 -3
- package/dist/{chunk-NFGRW3L7.js.map → chunk-7RGTAEG6.js.map} +1 -1
- package/dist/{chunk-5B5IZVEP.js → chunk-AWQYXZVG.js} +15 -6
- package/dist/chunk-AWQYXZVG.js.map +1 -0
- package/dist/{chunk-XBSQ4KMC.js → chunk-B4X2N7JQ.js} +205 -3
- package/dist/chunk-B4X2N7JQ.js.map +1 -0
- package/dist/{chunk-FRHE7FFB.js → chunk-B6GIW55K.js} +5 -3
- package/dist/chunk-B6GIW55K.js.map +1 -0
- package/dist/{chunk-LLKKLKZJ.js → chunk-BJNUNQAW.js} +3 -3
- package/dist/{chunk-LLKKLKZJ.js.map → chunk-BJNUNQAW.js.map} +1 -1
- package/dist/{chunk-7ZHLYXTI.js → chunk-BTE2V4IW.js} +3 -3
- package/dist/{chunk-7ZHLYXTI.js.map → chunk-BTE2V4IW.js.map} +1 -1
- package/dist/{chunk-ZBBM6O6P.js → chunk-CGT45WN7.js} +3 -3
- package/dist/{chunk-ZBBM6O6P.js.map → chunk-CGT45WN7.js.map} +1 -1
- package/dist/{chunk-47ZD34KB.js → chunk-CIFS5K6T.js} +3 -3
- package/dist/{chunk-47ZD34KB.js.map → chunk-CIFS5K6T.js.map} +1 -1
- package/dist/{chunk-BTISGSK4.js → chunk-CKQEIY43.js} +4 -4
- package/dist/{chunk-BTISGSK4.js.map → chunk-CKQEIY43.js.map} +1 -1
- package/dist/{chunk-KXTO7HON.js → chunk-EAZECHPM.js} +3 -3
- package/dist/{chunk-KXTO7HON.js.map → chunk-EAZECHPM.js.map} +1 -1
- package/dist/{chunk-VKSXST23.js → chunk-EF7NPDDU.js} +4 -4
- package/dist/{chunk-VKSXST23.js.map → chunk-EF7NPDDU.js.map} +1 -1
- package/dist/chunk-EPBKISS5.js +84 -0
- package/dist/chunk-EPBKISS5.js.map +1 -0
- package/dist/{chunk-VJENKWXF.js → chunk-F2EKONM7.js} +3 -3
- package/dist/{chunk-VJENKWXF.js.map → chunk-F2EKONM7.js.map} +1 -1
- package/dist/{chunk-DMLDYFDS.js → chunk-F3RDEH5U.js} +7 -4
- package/dist/chunk-F3RDEH5U.js.map +1 -0
- package/dist/{chunk-UAP2XHRF.js → chunk-FTJJO3EM.js} +39 -29
- package/dist/chunk-FTJJO3EM.js.map +1 -0
- package/dist/{chunk-2GRB5ITE.js → chunk-FVJK4QWM.js} +4 -4
- package/dist/{chunk-2GRB5ITE.js.map → chunk-FVJK4QWM.js.map} +1 -1
- package/dist/{chunk-AOAZCSDI.js → chunk-FZNG4V4J.js} +16 -30
- package/dist/chunk-FZNG4V4J.js.map +1 -0
- package/dist/{chunk-BF33SCLY.js → chunk-GB7WDMH2.js} +4 -4
- package/dist/{chunk-BF33SCLY.js.map → chunk-GB7WDMH2.js.map} +1 -1
- package/dist/{chunk-NARITJS2.js → chunk-GCICGXDD.js} +3 -3
- package/dist/{chunk-NARITJS2.js.map → chunk-GCICGXDD.js.map} +1 -1
- package/dist/{chunk-PA7WLID3.js → chunk-GTILM2CI.js} +56 -5
- package/dist/chunk-GTILM2CI.js.map +1 -0
- package/dist/{chunk-WIHQWVWL.js → chunk-GXXFLBUQ.js} +26 -27
- package/dist/chunk-GXXFLBUQ.js.map +1 -0
- package/dist/{chunk-PTO2YDDG.js → chunk-H7QUDDKH.js} +1337 -168
- package/dist/chunk-H7QUDDKH.js.map +1 -0
- package/dist/{chunk-I4QBZLOR.js → chunk-HG34RNTK.js} +7 -13
- package/dist/chunk-HG34RNTK.js.map +1 -0
- package/dist/{chunk-65EYRFZJ.js → chunk-HYDRDNKN.js} +10 -6
- package/dist/chunk-HYDRDNKN.js.map +1 -0
- package/dist/{chunk-4GNJELPH.js → chunk-I6NLLJHZ.js} +2 -2
- package/dist/{chunk-4GNJELPH.js.map → chunk-I6NLLJHZ.js.map} +1 -1
- package/dist/{chunk-VSQFGU5D.js → chunk-ILFGVSTJ.js} +3 -3
- package/dist/{chunk-VSQFGU5D.js.map → chunk-ILFGVSTJ.js.map} +1 -1
- package/dist/{chunk-2XFUXGV6.js → chunk-IONAUNWB.js} +3 -3
- package/dist/{chunk-2XFUXGV6.js.map → chunk-IONAUNWB.js.map} +1 -1
- package/dist/{chunk-CT6NQSA4.js → chunk-ISHJITXJ.js} +3 -3
- package/dist/{chunk-CT6NQSA4.js.map → chunk-ISHJITXJ.js.map} +1 -1
- package/dist/chunk-IZCR27MU.js +60 -0
- package/dist/chunk-IZCR27MU.js.map +1 -0
- package/dist/{chunk-2W4LBLIN.js → chunk-JAKOMFC6.js} +68 -20
- package/dist/chunk-JAKOMFC6.js.map +1 -0
- package/dist/{chunk-MFHKHXDE.js → chunk-L5VSIPQD.js} +5 -5
- package/dist/chunk-L5VSIPQD.js.map +1 -0
- package/dist/{chunk-RGXVQZOV.js → chunk-LEMHVDET.js} +89 -67
- package/dist/chunk-LEMHVDET.js.map +1 -0
- package/dist/{chunk-37FTLYFP.js → chunk-LNFKL23K.js} +3 -3
- package/dist/{chunk-37FTLYFP.js.map → chunk-LNFKL23K.js.map} +1 -1
- package/dist/{chunk-6NPINANG.js → chunk-LSXHED6I.js} +6 -6
- package/dist/{chunk-6NPINANG.js.map → chunk-LSXHED6I.js.map} +1 -1
- package/dist/{chunk-XUUYAS3Z.js → chunk-M3WPBTGJ.js} +3 -3
- package/dist/{chunk-XUUYAS3Z.js.map → chunk-M3WPBTGJ.js.map} +1 -1
- package/dist/{chunk-QZLWJETK.js → chunk-MGGFBZWA.js} +3 -3
- package/dist/{chunk-QZLWJETK.js.map → chunk-MGGFBZWA.js.map} +1 -1
- package/dist/{chunk-QD772CGQ.js → chunk-NPLPCRW5.js} +5 -5
- package/dist/{chunk-QD772CGQ.js.map → chunk-NPLPCRW5.js.map} +1 -1
- package/dist/{chunk-QCI6D7E4.js → chunk-NUELZWCF.js} +266 -170
- package/dist/chunk-NUELZWCF.js.map +1 -0
- package/dist/{chunk-GP6ZL7PE.js → chunk-OFBIWVCR.js} +3 -3
- package/dist/{chunk-GP6ZL7PE.js.map → chunk-OFBIWVCR.js.map} +1 -1
- package/dist/{chunk-D2V42LUE.js → chunk-P23M65LB.js} +93 -52
- package/dist/chunk-P23M65LB.js.map +1 -0
- package/dist/{chunk-46OVMT76.js → chunk-PMECEZK3.js} +16 -10
- package/dist/chunk-PMECEZK3.js.map +1 -0
- package/dist/{chunk-27HS2DHB.js → chunk-PTSGWKHR.js} +4 -4
- package/dist/{chunk-27HS2DHB.js.map → chunk-PTSGWKHR.js.map} +1 -1
- package/dist/{chunk-OKGUDNDT.js → chunk-Q6E6FM7P.js} +35 -33
- package/dist/chunk-Q6E6FM7P.js.map +1 -0
- package/dist/{chunk-PJS2YWGG.js → chunk-QOP6KDFR.js} +8 -9
- package/dist/chunk-QOP6KDFR.js.map +1 -0
- package/dist/{chunk-AO7VJ6G6.js → chunk-QVNRCDTV.js} +29 -8
- package/dist/chunk-QVNRCDTV.js.map +1 -0
- package/dist/{chunk-VBBBZDI7.js → chunk-S53LOR7B.js} +3 -3
- package/dist/{chunk-VBBBZDI7.js.map → chunk-S53LOR7B.js.map} +1 -1
- package/dist/{chunk-KUFNKVBM.js → chunk-SH5D7U7N.js} +20 -7
- package/dist/{chunk-KUFNKVBM.js.map → chunk-SH5D7U7N.js.map} +1 -1
- package/dist/{chunk-SX4UIDKT.js → chunk-UAROCOXF.js} +3 -3
- package/dist/{chunk-SX4UIDKT.js.map → chunk-UAROCOXF.js.map} +1 -1
- package/dist/{chunk-JMKB7IB4.js → chunk-UMVKJM4Q.js} +4 -4
- package/dist/chunk-UMVKJM4Q.js.map +1 -0
- package/dist/{chunk-HCYS7GFP.js → chunk-V2DXZYBB.js} +3 -3
- package/dist/{chunk-HCYS7GFP.js.map → chunk-V2DXZYBB.js.map} +1 -1
- package/dist/{chunk-KYXOGHY6.js → chunk-W5DWWE4Y.js} +4 -4
- package/dist/{chunk-KYXOGHY6.js.map → chunk-W5DWWE4Y.js.map} +1 -1
- package/dist/{chunk-FK6HPLQA.js → chunk-WTQ3TATB.js} +3 -3
- package/dist/{chunk-FK6HPLQA.js.map → chunk-WTQ3TATB.js.map} +1 -1
- package/dist/{chunk-OGLDAJFL.js → chunk-Y4N2NUZD.js} +4 -4
- package/dist/{chunk-OGLDAJFL.js.map → chunk-Y4N2NUZD.js.map} +1 -1
- package/dist/{chunk-XOGG7VDZ.js → chunk-Y7QA2OLD.js} +17 -25
- package/dist/chunk-Y7QA2OLD.js.map +1 -0
- package/dist/{chunk-2KOKBTR4.js → chunk-YSHVQGUS.js} +123 -28
- package/dist/chunk-YSHVQGUS.js.map +1 -0
- package/dist/chunk-ZAOGFXDO.js +112 -0
- package/dist/chunk-ZAOGFXDO.js.map +1 -0
- package/dist/{chunk-7KLC4LZO.js → chunk-ZKSJMZKD.js} +17 -13
- package/dist/chunk-ZKSJMZKD.js.map +1 -0
- package/dist/cli/index.js +1169 -672
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/asset-feeds.d.ts +5 -2
- package/dist/cli/src/asset-feeds.d.ts.map +1 -1
- package/dist/cli/src/commands/asset-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts +27 -5
- package/dist/cli/src/commands/catalog.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 +49 -4
- package/dist/cli/src/commands/library-index.d.ts.map +1 -1
- package/dist/cli/src/commands/library-publish.d.ts +9 -0
- package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
- package/dist/cli/src/commands/manage.d.ts +8 -2
- package/dist/cli/src/commands/manage.d.ts.map +1 -1
- package/dist/cli/src/commands/outdated.d.ts +10 -4
- package/dist/cli/src/commands/outdated.d.ts.map +1 -1
- package/dist/cli/src/commands/project.d.ts +15 -4
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/cli/src/commands/publish-core.d.ts +10 -1
- package/dist/cli/src/commands/publish-core.d.ts.map +1 -1
- package/dist/cli/src/commands/session.d.ts.map +1 -1
- package/dist/cli/src/commands/source.d.ts +18 -3
- package/dist/cli/src/commands/source.d.ts.map +1 -1
- package/dist/cli/src/commands/tree.d.ts.map +1 -1
- package/dist/cli/src/commands/update.d.ts +1 -1
- package/dist/cli/src/commands/update.d.ts.map +1 -1
- package/dist/cli/src/commands/validate.d.ts.map +1 -1
- package/dist/cli/src/flow-discovery.d.ts +8 -5
- package/dist/cli/src/flow-discovery.d.ts.map +1 -1
- package/dist/cli/src/open-library.d.ts +0 -11
- package/dist/cli/src/open-library.d.ts.map +1 -1
- package/dist/cli/src/skill-checks.d.ts +30 -10
- package/dist/cli/src/skill-checks.d.ts.map +1 -1
- package/dist/connectors/config.js +6 -6
- package/dist/connectors/index.js +26 -27
- package/dist/connectors/src/access-policy.d.ts +33 -0
- package/dist/connectors/src/access-policy.d.ts.map +1 -0
- package/dist/connectors/src/connector-manager.d.ts.map +1 -1
- package/dist/connectors/src/index.d.ts +2 -0
- package/dist/connectors/src/index.d.ts.map +1 -1
- package/dist/connectors-O6Y6VESP.js +44 -0
- package/dist/{connectors-HWENZFKW.js.map → connectors-O6Y6VESP.js.map} +1 -1
- package/dist/connectors-shared/index.js +2 -2
- package/dist/core/index.js +9 -9
- 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 +2 -2
- package/dist/core/ref.js +1 -1
- package/dist/core/runtime-assets.js +6 -6
- package/dist/core/src/cache-paths.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 +3 -3
- package/dist/core/src/lock.d.ts.map +1 -1
- package/dist/core/src/logging/config.d.ts +9 -1
- package/dist/core/src/logging/config.d.ts.map +1 -1
- package/dist/core/src/manifest.d.ts +17 -2
- package/dist/core/src/manifest.d.ts.map +1 -1
- package/dist/core/src/models.d.ts +22 -6
- package/dist/core/src/models.d.ts.map +1 -1
- package/dist/core/src/repo-manager.d.ts +41 -6
- package/dist/core/src/repo-manager.d.ts.map +1 -1
- package/dist/core/src/store.d.ts +16 -2
- package/dist/core/src/store.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +10 -1
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/store.js +2 -2
- package/dist/core/workspace-config.js +5 -5
- package/dist/deploy/index.js +9 -9
- package/dist/discovery/index.js +5 -5
- package/dist/discovery/src/index.d.ts +1 -1
- package/dist/discovery/src/index.d.ts.map +1 -1
- package/dist/discovery/src/source-config.d.ts +12 -0
- package/dist/discovery/src/source-config.d.ts.map +1 -1
- package/dist/discovery/src/tree-entries.d.ts.map +1 -1
- package/dist/{ensure-sources-DSTSXJWK.js → ensure-sources-SKLNM4UZ.js} +19 -19
- package/dist/{ensure-sources-DSTSXJWK.js.map → ensure-sources-SKLNM4UZ.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +26 -27
- package/dist/factory-assets/connectors/deploy.js +26 -27
- package/dist/factory-assets/connectors/devserver.js +26 -27
- package/dist/factory-assets/connectors/flow/adapter.d.ts +6 -0
- package/dist/factory-assets/connectors/flow/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/adapter.js +26 -27
- package/dist/factory-assets/connectors/flow/contract/expression.d.ts +3 -0
- package/dist/factory-assets/connectors/flow/contract/expression.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/contract/output-fields.d.ts +1 -1
- package/dist/factory-assets/connectors/flow/contract/output-fields.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/contract/schema.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/contract.js +4 -4
- package/dist/factory-assets/connectors/flow/engine/flow-output.d.ts +4 -3
- package/dist/factory-assets/connectors/flow/engine/flow-output.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine/output-schema.d.ts +6 -1
- package/dist/factory-assets/connectors/flow/engine/output-schema.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine.js +13 -13
- package/dist/factory-assets/connectors/flow/inline-sub-flow-host.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/prompt-fragments.js +3 -3
- package/dist/factory-assets/connectors/flow/run-flow.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.js +28 -29
- package/dist/factory-assets/connectors/flow.js +26 -27
- package/dist/factory-assets/connectors/git/config.d.ts.map +1 -1
- package/dist/factory-assets/connectors/git.js +26 -27
- package/dist/factory-assets/connectors/gmail.js +26 -27
- package/dist/factory-assets/connectors/googledrive.js +26 -27
- package/dist/factory-assets/connectors/local.js +26 -27
- package/dist/factory-assets/connectors/mattermost.js +26 -27
- package/dist/factory-assets/connectors/memory.js +26 -27
- package/dist/factory-assets/connectors/minio.js +26 -27
- package/dist/factory-assets/connectors/postgres.js +26 -27
- package/dist/factory-assets/connectors/s3.js +26 -27
- package/dist/factory-assets/connectors/sharepoint.js +26 -27
- package/dist/factory-assets/connectors/sqlite.js +26 -27
- package/dist/factory-assets/connectors/static-server.js +26 -27
- package/dist/factory-assets/connectors/tunnel.js +26 -27
- package/dist/factory-assets/connectors/webdav.js +26 -27
- package/dist/factory-assets/connectors/xstate-store.js +26 -27
- package/dist/factory-assets/connectors/xstate.js +26 -27
- package/dist/factory-assets/skills/skaile-author-asset/SKILL.md +10 -7
- package/dist/flows-CBYRSAGS.js +26 -0
- package/dist/{flows-ENQY2DV7.js.map → flows-CBYRSAGS.js.map} +1 -1
- package/dist/{helpers-R44RUTDY.js → helpers-MWZDRBLD.js} +19 -19
- package/dist/{helpers-R44RUTDY.js.map → helpers-MWZDRBLD.js.map} +1 -1
- package/dist/library/index.js +13 -13
- package/dist/library/install.js +3 -3
- package/dist/library/src/index.d.ts +5 -3
- package/dist/library/src/index.d.ts.map +1 -1
- package/dist/library/src/local/library-manager.d.ts +6 -0
- package/dist/library/src/local/library-manager.d.ts.map +1 -1
- package/dist/library/src/local/local-catalog-source.d.ts +5 -2
- package/dist/library/src/local/local-catalog-source.d.ts.map +1 -1
- package/dist/library/src/local/scan-authoring-libraries.d.ts +43 -0
- package/dist/library/src/local/scan-authoring-libraries.d.ts.map +1 -0
- package/dist/library/src/manifest-writer.d.ts +46 -1
- package/dist/library/src/manifest-writer.d.ts.map +1 -1
- package/dist/library/src/sync/git-driver.d.ts +12 -0
- package/dist/library/src/sync/git-driver.d.ts.map +1 -1
- package/dist/{library-publish-LFOJJVMK.js → library-publish-PICMDSB2.js} +129 -49
- package/dist/library-publish-PICMDSB2.js.map +1 -0
- package/dist/open-library-OG457THY.js +40 -0
- package/dist/{open-library-4WUMQHES.js.map → open-library-OG457THY.js.map} +1 -1
- package/dist/open-registry-ZUZJ7MS7.js +32 -0
- package/dist/{open-registry-NVPCQPND.js.map → open-registry-ZUZJ7MS7.js.map} +1 -1
- package/dist/paths-FQ64OLJG.js +22 -0
- package/dist/{paths-YUCP7K6U.js.map → paths-FQ64OLJG.js.map} +1 -1
- package/dist/{plugin-store-66QFBNEO.js → plugin-store-MPAMD5OT.js} +11 -11
- package/dist/{plugin-store-66QFBNEO.js.map → plugin-store-MPAMD5OT.js.map} +1 -1
- package/dist/project-2GFT5LEZ.js +41 -0
- package/dist/{project-VMOHUXBD.js.map → project-2GFT5LEZ.js.map} +1 -1
- package/dist/resolver/index.js +10 -10
- package/dist/runner/index.js +41 -42
- package/dist/runner/src/logging-bootstrap.d.ts +6 -0
- package/dist/runner/src/logging-bootstrap.d.ts.map +1 -1
- package/dist/runner/src/reconfigure-handler.d.ts +38 -17
- package/dist/runner/src/reconfigure-handler.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-capability-wiring.d.ts +0 -2
- package/dist/runner/src/session-capability-wiring.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +16 -16
- package/dist/sdk/bridge.js +17 -18
- package/dist/sdk/core.js +9 -9
- package/dist/sdk/flow.js +13 -13
- package/dist/sdk/index.js +69 -46
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/resolver.js +10 -10
- package/dist/sdk/runner.js +41 -42
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/src/agent-session.d.ts +8 -0
- package/dist/sdk/src/agent-session.d.ts.map +1 -1
- package/dist/sdk/store.js +2 -1
- package/dist/sdk/types.js +1 -1
- package/dist/secrets/index.js +2 -2
- package/dist/session/index.js +2 -2
- package/dist/{setup-PYY23HGZ.js → setup-WHMCSIF2.js} +27 -28
- package/dist/setup-WHMCSIF2.js.map +1 -0
- package/dist/skills-TVO26Y4V.js +26 -0
- package/dist/{skills-CS7NE5TT.js.map → skills-TVO26Y4V.js.map} +1 -1
- package/dist/source-LKOFTOEK.js +41 -0
- package/dist/{source-JCF6KSQN.js.map → source-LKOFTOEK.js.map} +1 -1
- package/dist/{source-manifest-publish-O6P7G2M7.js → source-manifest-publish-L5J3QXER.js} +28 -28
- package/dist/{source-manifest-publish-O6P7G2M7.js.map → source-manifest-publish-L5J3QXER.js.map} +1 -1
- package/dist/store/index.js +2 -1
- package/dist/store/src/store.d.ts +8 -5
- package/dist/store/src/store.d.ts.map +1 -1
- package/dist/tui/index.js +41 -42
- 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/ask-slots.d.ts +68 -0
- package/dist/types/src/ask-slots.d.ts.map +1 -0
- package/dist/types/src/delivery.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +29 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/manifests/index.d.ts +1 -1
- package/dist/types/src/manifests/index.d.ts.map +1 -1
- package/dist/types/src/manifests/preset.d.ts +4 -0
- package/dist/types/src/manifests/preset.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +12 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +33 -34
- package/dist/workspace-plugin/adapters/omp.js +14 -14
- package/dist/workspace-plugin/index.js +2 -2
- package/package.json +1 -1
- package/dist/asset-feeds-LU7NHOAP.js.map +0 -1
- package/dist/chunk-2KOKBTR4.js.map +0 -1
- package/dist/chunk-2NYXQYHN.js +0 -22
- package/dist/chunk-2NYXQYHN.js.map +0 -1
- package/dist/chunk-2W4LBLIN.js.map +0 -1
- package/dist/chunk-46OVMT76.js.map +0 -1
- package/dist/chunk-5B5IZVEP.js.map +0 -1
- package/dist/chunk-65EYRFZJ.js.map +0 -1
- package/dist/chunk-7KLC4LZO.js.map +0 -1
- package/dist/chunk-AO7VJ6G6.js.map +0 -1
- package/dist/chunk-AOAZCSDI.js.map +0 -1
- package/dist/chunk-D2V42LUE.js.map +0 -1
- package/dist/chunk-DMLDYFDS.js.map +0 -1
- package/dist/chunk-EINLFFP6.js +0 -59
- package/dist/chunk-EINLFFP6.js.map +0 -1
- package/dist/chunk-FRHE7FFB.js.map +0 -1
- package/dist/chunk-I4QBZLOR.js.map +0 -1
- package/dist/chunk-JMKB7IB4.js.map +0 -1
- package/dist/chunk-MFHKHXDE.js.map +0 -1
- package/dist/chunk-MX3UQXLU.js.map +0 -1
- package/dist/chunk-OKGUDNDT.js.map +0 -1
- package/dist/chunk-PA7WLID3.js.map +0 -1
- package/dist/chunk-PJS2YWGG.js.map +0 -1
- package/dist/chunk-PTO2YDDG.js.map +0 -1
- package/dist/chunk-QCI6D7E4.js.map +0 -1
- package/dist/chunk-RGXVQZOV.js.map +0 -1
- package/dist/chunk-TZCQ7ZWQ.js.map +0 -1
- package/dist/chunk-UAP2XHRF.js.map +0 -1
- package/dist/chunk-WIHQWVWL.js.map +0 -1
- package/dist/chunk-XBSQ4KMC.js.map +0 -1
- package/dist/chunk-XOGG7VDZ.js.map +0 -1
- package/dist/connectors-HWENZFKW.js +0 -45
- package/dist/flows-ENQY2DV7.js +0 -26
- package/dist/library-publish-LFOJJVMK.js.map +0 -1
- package/dist/open-library-4WUMQHES.js +0 -40
- package/dist/open-registry-NVPCQPND.js +0 -32
- package/dist/paths-YUCP7K6U.js +0 -22
- package/dist/project-VMOHUXBD.js +0 -41
- package/dist/setup-PYY23HGZ.js.map +0 -1
- package/dist/skills-CS7NE5TT.js +0 -26
- package/dist/source-JCF6KSQN.js +0 -41
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { makeHttpPublisherClient } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import { isStoreAuthenticated, bareName, assetNamespace, refFor, assetEntryRef, manifestNamespaces, plannedRefs, formatNamespaceAvailability, preflightNamespace, publishToStore } from './chunk-
|
|
4
|
-
import { openLibraryManager } from './chunk-
|
|
5
|
-
import { logErr, logInfo, logOk, logWarn, S } from './chunk-
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
9
|
-
import './chunk-
|
|
10
|
-
import './chunk-
|
|
11
|
-
import './chunk-
|
|
12
|
-
import { missingRootAssets } from './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
1
|
+
import { makeHttpPublisherClient } from './chunk-OFBIWVCR.js';
|
|
2
|
+
import { findAssetManifestFile, readAssetBody, declaredVersion, checkAssetManifest } from './chunk-ZAOGFXDO.js';
|
|
3
|
+
import { isStoreAuthenticated, bareName, assetNamespace, refFor, assetEntryRef, manifestNamespaces, plannedRefs, formatNamespaceAvailability, preflightNamespace, publishToStore } from './chunk-HYDRDNKN.js';
|
|
4
|
+
import { openLibraryManager } from './chunk-HG34RNTK.js';
|
|
5
|
+
import { logErr, logInfo, logOk, logWarn, S } from './chunk-F2EKONM7.js';
|
|
6
|
+
import './chunk-2FRUUDZY.js';
|
|
7
|
+
import './chunk-FZNG4V4J.js';
|
|
8
|
+
import './chunk-MGGFBZWA.js';
|
|
9
|
+
import './chunk-7RGTAEG6.js';
|
|
10
|
+
import './chunk-NUELZWCF.js';
|
|
11
|
+
import './chunk-H7QUDDKH.js';
|
|
12
|
+
import { missingRootAssets, upsertManifestAsset } from './chunk-4MQS7CAF.js';
|
|
13
|
+
import { parseManifestFile, SEMVER_RE } from './chunk-Y7QA2OLD.js';
|
|
14
|
+
import './chunk-CKQEIY43.js';
|
|
15
15
|
import './chunk-R7FOF242.js';
|
|
16
16
|
import './chunk-3TXEJN4W.js';
|
|
17
|
-
import './chunk-
|
|
17
|
+
import './chunk-YSHVQGUS.js';
|
|
18
18
|
import './chunk-CGYEHQOX.js';
|
|
19
19
|
import './chunk-KTBKW2FI.js';
|
|
20
20
|
import './chunk-UQ6LFBPZ.js';
|
|
21
|
-
import './chunk-
|
|
22
|
-
import './chunk-
|
|
23
|
-
import './chunk-
|
|
21
|
+
import './chunk-EF7NPDDU.js';
|
|
22
|
+
import './chunk-B6GIW55K.js';
|
|
23
|
+
import './chunk-36AFURKZ.js';
|
|
24
24
|
import './chunk-4GY63JU6.js';
|
|
25
|
-
import './chunk-
|
|
26
|
-
import './chunk-
|
|
25
|
+
import './chunk-GB7WDMH2.js';
|
|
26
|
+
import './chunk-PMECEZK3.js';
|
|
27
27
|
import './chunk-5BEFNLOR.js';
|
|
28
28
|
import './chunk-A2ULN3KX.js';
|
|
29
|
-
import './chunk-
|
|
30
|
-
import './chunk-
|
|
29
|
+
import './chunk-JAKOMFC6.js';
|
|
30
|
+
import './chunk-L5VSIPQD.js';
|
|
31
31
|
import './chunk-CPSIPIX7.js';
|
|
32
|
-
import { loadSkPublishManifest, decodeSkaileManifest } from './chunk-
|
|
32
|
+
import { loadSkPublishManifest, decodeSkaileManifest } from './chunk-BTE2V4IW.js';
|
|
33
33
|
import './chunk-RVRB27AN.js';
|
|
34
|
-
import
|
|
35
|
-
import './chunk-
|
|
34
|
+
import './chunk-GTILM2CI.js';
|
|
35
|
+
import './chunk-QVNRCDTV.js';
|
|
36
36
|
import './chunk-ICSCSM5D.js';
|
|
37
|
-
import './chunk-
|
|
37
|
+
import './chunk-UMVKJM4Q.js';
|
|
38
38
|
import './chunk-MJHSLODD.js';
|
|
39
39
|
import './chunk-C3CAXQMA.js';
|
|
40
40
|
import './chunk-BOFL7GIF.js';
|
|
41
41
|
import './chunk-NSBPE2FW.js';
|
|
42
42
|
import { spawnSync } from 'child_process';
|
|
43
43
|
import { readFileSync, existsSync } from 'fs';
|
|
44
|
-
import { join, relative, basename } from 'path';
|
|
44
|
+
import { join, relative, sep, basename } from 'path';
|
|
45
45
|
|
|
46
46
|
var MANIFEST_FILENAME = "skaile.manifest.yaml";
|
|
47
47
|
function remoteUrlOf(lib) {
|
|
@@ -132,31 +132,86 @@ function isGithubRemote(url) {
|
|
|
132
132
|
url.trim()
|
|
133
133
|
);
|
|
134
134
|
}
|
|
135
|
+
function notGithubRemoteMessage(name, url) {
|
|
136
|
+
return `The remote of library "${name}" is not a GitHub url: ${url}. The store fetches published assets from GitHub \u2014 repoint it with \`skaile library set ${name} backendConfig.url=https://github.com/<owner>/<repo>\`.`;
|
|
137
|
+
}
|
|
135
138
|
var MAX_LISTED_UNTRACKED = 10;
|
|
136
|
-
function
|
|
139
|
+
function planAssets(libPath, manifest, targetName) {
|
|
140
|
+
const out = [];
|
|
141
|
+
for (const entry of manifest.assets ?? []) {
|
|
142
|
+
if (targetName && entry.name !== targetName) continue;
|
|
143
|
+
if (!entry.root || entry.source || manifest.source) continue;
|
|
144
|
+
const file = findAssetManifestFile(join(libPath, entry.root), entry.kind, entry.name);
|
|
145
|
+
if (!file) continue;
|
|
146
|
+
const text = readFileSync(file, "utf-8");
|
|
147
|
+
out.push({
|
|
148
|
+
entry,
|
|
149
|
+
rel: relative(libPath, file),
|
|
150
|
+
parsed: parseManifestFile(file, text),
|
|
151
|
+
body: readAssetBody(file, text)
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
return out;
|
|
155
|
+
}
|
|
156
|
+
function manifestWithFileVersions(manifest, assets) {
|
|
157
|
+
return {
|
|
158
|
+
...manifest,
|
|
159
|
+
assets: manifest.assets?.map((entry) => {
|
|
160
|
+
const planned = assets.find((a) => a.entry === entry);
|
|
161
|
+
const fileVersion = planned?.parsed.ok ? declaredVersion(planned.parsed.data) : void 0;
|
|
162
|
+
return fileVersion === void 0 ? entry : { ...entry, version: fileVersion };
|
|
163
|
+
})
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function versionDrift(assets, manifest) {
|
|
167
|
+
const out = [];
|
|
168
|
+
for (const asset of assets) {
|
|
169
|
+
if (!asset.parsed.ok) continue;
|
|
170
|
+
const fileVersion = declaredVersion(asset.parsed.data);
|
|
171
|
+
const entryVersion = asset.entry.version ?? manifest.version;
|
|
172
|
+
if (fileVersion !== void 0 && fileVersion !== entryVersion) {
|
|
173
|
+
out.push({ asset, ref: assetEntryRef(asset.entry, manifest), entryVersion, fileVersion });
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return out;
|
|
177
|
+
}
|
|
178
|
+
var describeDrift = (d) => `${d.ref}: manifest version ${d.entryVersion ?? "(none)"} \u2192 ${d.fileVersion} (${d.asset.rel.split(sep).join("/")})`;
|
|
179
|
+
function assetRefusals(assets, manifest) {
|
|
180
|
+
const refusals = [];
|
|
181
|
+
for (const { entry, rel, parsed } of assets) {
|
|
182
|
+
const ref = assetEntryRef(entry, manifest);
|
|
183
|
+
if (!parsed.ok) {
|
|
184
|
+
refusals.push(`${ref} (${rel}) \u2014 manifest file could not be parsed: ${parsed.reason}`);
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
const fileVersion = declaredVersion(parsed.data);
|
|
188
|
+
for (const version of /* @__PURE__ */ new Set([entry.version, fileVersion])) {
|
|
189
|
+
if (version !== void 0 && !SEMVER_RE.test(version)) {
|
|
190
|
+
refusals.push(`${ref} (${rel}) \u2014 version "${version}" is not valid semver`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return refusals;
|
|
195
|
+
}
|
|
196
|
+
function assetWarnings(assets, manifest) {
|
|
137
197
|
const warnings = [];
|
|
138
|
-
for (const
|
|
139
|
-
if (
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
const { data, body } = parseFrontmatter(readFileSync(file, "utf-8"));
|
|
144
|
-
if (!data || Object.keys(data).length === 0) continue;
|
|
145
|
-
const rel = relative(libPath, file);
|
|
146
|
-
for (const f of checkSkillManifest(data, body, basename(join(libPath, a.root)))) {
|
|
147
|
-
warnings.push(`${assetEntryRef(a, manifest)} (${rel}) [${f.tag}] \u2014 ${f.text}`);
|
|
198
|
+
for (const { entry, rel, parsed, body } of assets) {
|
|
199
|
+
if (!parsed.ok || Object.keys(parsed.data).length === 0) continue;
|
|
200
|
+
const findings = checkAssetManifest(entry.kind, parsed.data, body, basename(entry.root ?? ""));
|
|
201
|
+
for (const f of findings) {
|
|
202
|
+
warnings.push(`${assetEntryRef(entry, manifest)} (${rel}) [${f.tag}] \u2014 ${f.text}`);
|
|
148
203
|
}
|
|
149
204
|
}
|
|
150
205
|
return warnings;
|
|
151
206
|
}
|
|
152
|
-
function publishWarnings(libPath, spawn, skipPush, manifest,
|
|
207
|
+
function publishWarnings(libPath, spawn, skipPush, manifest, assets) {
|
|
153
208
|
const warnings = [];
|
|
154
209
|
if (!existsSync(join(libPath, "LICENSE")) && !existsSync(join(libPath, "LICENSE.md"))) {
|
|
155
210
|
warnings.push(
|
|
156
211
|
"No LICENSE or LICENSE.md in the library root \u2014 a public repo without a license grants consumers no rights to use it."
|
|
157
212
|
);
|
|
158
213
|
}
|
|
159
|
-
warnings.push(...assetWarnings(
|
|
214
|
+
warnings.push(...assetWarnings(assets, manifest));
|
|
160
215
|
if (!skipPush) {
|
|
161
216
|
const status = runGit(spawn, libPath, ["status", "--porcelain", "--untracked-files=all"]);
|
|
162
217
|
if (status.status === 0) {
|
|
@@ -236,16 +291,31 @@ async function publishLibrary(name, opts, client, spawn = spawnSync) {
|
|
|
236
291
|
process.exit(1);
|
|
237
292
|
}
|
|
238
293
|
} else if (!isGithubRemote(remoteUrl)) {
|
|
239
|
-
logErr(
|
|
240
|
-
`The remote of library "${name}" is not a GitHub url: ${remoteUrl}. The store fetches published assets from GitHub \u2014 repoint it with \`skaile library set ${name} backendConfig.url=https://github.com/<owner>/<repo>\`.`
|
|
241
|
-
);
|
|
294
|
+
logErr(notGithubRemoteMessage(name, remoteUrl));
|
|
242
295
|
process.exit(1);
|
|
243
296
|
}
|
|
244
297
|
const targetName = opts.asset ? bareName(opts.asset) : void 0;
|
|
245
298
|
const namespaces = manifestNamespaces(manifest, targetName);
|
|
246
|
-
const
|
|
299
|
+
const assets = planAssets(lib.path, manifest, targetName);
|
|
300
|
+
const wouldBeRefs = plannedRefs(manifestWithFileVersions(manifest, assets), targetName);
|
|
301
|
+
const refusals = assetRefusals(assets, manifest);
|
|
302
|
+
if (refusals.length > 0) {
|
|
303
|
+
for (const r of refusals) logErr(r);
|
|
304
|
+
logErr(
|
|
305
|
+
`These assets cannot be published. Fix them (see \`skaile validate\`), then run \`skaile library index ${name}\` and re-run.`
|
|
306
|
+
);
|
|
307
|
+
process.exit(1);
|
|
308
|
+
}
|
|
309
|
+
const drift = versionDrift(assets, manifest);
|
|
310
|
+
if (drift.length > 0 && opts.skipPush) {
|
|
311
|
+
for (const d of drift) logErr(describeDrift(d));
|
|
312
|
+
logErr(
|
|
313
|
+
`register publishes the remote HEAD as-is, so these manifest versions would be recorded instead of the file versions. Run \`skaile library index ${name}\`, commit and push, then re-run.`
|
|
314
|
+
);
|
|
315
|
+
process.exit(1);
|
|
316
|
+
}
|
|
247
317
|
const sourceRef = opts.ref ?? branchOf(lib);
|
|
248
|
-
const warnings = publishWarnings(lib.path, spawn, opts.skipPush, manifest,
|
|
318
|
+
const warnings = publishWarnings(lib.path, spawn, opts.skipPush, manifest, assets);
|
|
249
319
|
if (opts.dryRun) {
|
|
250
320
|
logInfo(`Publish plan for ${S.bold(name)}:`);
|
|
251
321
|
logInfo(
|
|
@@ -270,6 +340,7 @@ async function publishLibrary(name, opts, client, spawn = spawnSync) {
|
|
|
270
340
|
logInfo(` source ref: ${sourceRef}`);
|
|
271
341
|
logInfo(` would publish ${wouldBeRefs.length} asset(s):`);
|
|
272
342
|
for (const r of wouldBeRefs) logInfo(` ${r}`);
|
|
343
|
+
for (const d of drift) logInfo(` would update the manifest: ${describeDrift(d)}`);
|
|
273
344
|
for (const w of warnings) logWarn(w);
|
|
274
345
|
return;
|
|
275
346
|
}
|
|
@@ -286,6 +357,15 @@ async function publishLibrary(name, opts, client, spawn = spawnSync) {
|
|
|
286
357
|
process.exit(1);
|
|
287
358
|
}
|
|
288
359
|
}
|
|
360
|
+
for (const d of drift) {
|
|
361
|
+
upsertManifestAsset(lib.path, {
|
|
362
|
+
kind: d.asset.entry.kind,
|
|
363
|
+
name: d.asset.entry.name,
|
|
364
|
+
root: d.asset.entry.root ?? "",
|
|
365
|
+
version: d.fileVersion
|
|
366
|
+
});
|
|
367
|
+
logInfo(`Updated the manifest: ${describeDrift(d)}`);
|
|
368
|
+
}
|
|
289
369
|
if (!opts.skipPush) {
|
|
290
370
|
logInfo(
|
|
291
371
|
`Committing the library and pushing to the PUBLIC remote ${S.dim(remoteUrl)} (.gitignore honored; anything else in the working tree becomes public).`
|
|
@@ -296,7 +376,7 @@ async function publishLibrary(name, opts, client, spawn = spawnSync) {
|
|
|
296
376
|
const { published } = await publishToStore({
|
|
297
377
|
sourceUrl: remoteUrl,
|
|
298
378
|
ref: sourceRef,
|
|
299
|
-
manifest,
|
|
379
|
+
manifest: manifestWithFileVersions(manifest, assets),
|
|
300
380
|
assetName: targetName,
|
|
301
381
|
client: pub
|
|
302
382
|
});
|
|
@@ -363,6 +443,6 @@ async function runLibraryYank(name, opts, client) {
|
|
|
363
443
|
}
|
|
364
444
|
}
|
|
365
445
|
|
|
366
|
-
export { runLibraryPublish, runLibraryRegister, runLibraryYank };
|
|
367
|
-
//# sourceMappingURL=library-publish-
|
|
368
|
-
//# sourceMappingURL=library-publish-
|
|
446
|
+
export { isGithubRemote, notGithubRemoteMessage, runLibraryPublish, runLibraryRegister, runLibraryYank };
|
|
447
|
+
//# sourceMappingURL=library-publish-PICMDSB2.js.map
|
|
448
|
+
//# sourceMappingURL=library-publish-PICMDSB2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../cli/src/commands/library-publish.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,IAAM,iBAAA,GAAoB,sBAAA;AAG1B,SAAS,YAAY,GAAA,EAAkC;AACrD,EAAA,IAAI,GAAA,CAAI,OAAA,KAAY,KAAA,EAAO,OAAO,MAAA;AAClC,EAAA,OAAQ,IAAI,aAAA,CAAmC,GAAA;AACjD;AAGA,SAAS,SAAS,GAAA,EAAsB;AACtC,EAAA,IAAI,GAAA,CAAI,OAAA,KAAY,KAAA,EAAO,OAAO,MAAA;AAClC,EAAA,OAAQ,GAAA,CAAI,cAAmC,MAAA,IAAU,MAAA;AAC3D;AAMA,SAAS,aAAa,OAAA,EAAoC;AACxD,EAAA,IAAI,IAAA;AACJ,EAAA,IAAI;AACF,IAAA,IAAA,GAAO,YAAA,CAAa,IAAA,CAAK,OAAA,EAAS,iBAAiB,GAAG,OAAO,CAAA;AAAA,EAC/D,CAAA,CAAA,MAAQ;AACN,IAAA,MAAA;AAAA,MACE,CAAA,GAAA,EAAM,CAAA,CAAE,GAAA,CAAI,iBAAiB,CAAC,CAAA,+GAAA;AAAA,KAEhC;AACA,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EAChB;AACA,EAAA,MAAM,EAAE,QAAA,EAAU,WAAA,EAAY,GAAI,qBAAqB,IAAI,CAAA;AAC3D,EAAA,MAAM,SAAS,WAAA,CAAY,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,OAAO,CAAA;AAC/D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AAC;AAC1B,IAAA,KAAA,MAAW,KAAK,UAAA,EAAY;AAC1B,MAAA,IAAI;AACF,QAAA,MAAM,GAAA,CAAI,cAAA,CAAe,CAAA,CAAE,EAAE,CAAA;AAC7B,QAAA,MAAM,KAAA,GAAQ,QAAA,EAAU,MAAA,EAAQ,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,IAAA,KAAS,CAAA,CAAE,IAAA,IAAQ,CAAA,CAAE,IAAA,KAAS,EAAE,IAAI,CAAA;AAClF,QAAA,MAAM,KAAK,QAAA,IAAY,KAAA,GAAQ,cAAA,CAAe,KAAA,EAAO,QAAQ,CAAA,GAAI,KAAA,CAAA;AACjE,QAAA,MAAA,CAAO,KAAK,EAAA,GAAK,MAAA,CAAO,CAAA,CAAE,IAAA,EAAM,IAAI,CAAA,CAAE,IAAA,EAAM,CAAA,CAAE,OAAO,IAAI,CAAA,EAAG,CAAA,CAAE,IAAI,CAAA,CAAA,EAAI,CAAA,CAAE,IAAI,CAAA,CAAE,CAAA;AAAA,MAChF,SAAS,GAAA,EAAK;AACZ,QAAA,MAAA;AAAA,UACE,CAAA,eAAA,EAAkB,CAAA,CAAE,IAAI,CAAA,CAAA,EAAI,CAAA,CAAE,IAAI,CAAA,EAAA,EAAK,GAAA,YAAe,KAAA,GAAQ,GAAA,CAAI,OAAA,GAAU,MAAA,CAAO,GAAG,CAAC,CAAA;AAAA,SACzF;AAAA,MACF;AAAA,IACF;AAEA,IAAA,KAAA,CAAM,CAAA,OAAA,EAAU,MAAA,CAAO,MAAM,CAAA,UAAA,CAAY,CAAA;AACzC,IAAA,KAAA,MAAW,CAAA,IAAK,MAAA,EAAQ,OAAA,CAAQ,CAAA,EAAA,EAAK,CAAC,CAAA,CAAE,CAAA;AAAA,EAC1C,CAAA,SAAE;AACA,IAAA,KAAA,EAAM;AAAA,EACR;AACF","file":"library-publish-PICMDSB2.js","sourcesContent":["/**\n * `skaile library publish / register / yank` — the first-party publish flow.\n * A git-backed library you own carries an in-repo `skaile.manifest.yaml`; this\n * commits + pushes the library repo (publish), or takes the current remote HEAD\n * as-is (register), then registers + syncs it as a store source and publishes\n * the manifest's assets, each under its own namespace — `assets[].publisher`,\n * else the manifest's top-level `publisher` (no namespace remap — first-party\n * authors intend their declared namespace). Every distinct namespace is\n * preflighted before the push. The plan phase (dry-run and real) also requires the\n * remote to be a GitHub url and warns about a missing LICENSE and, for `publish`,\n * untracked files that `git add -A` would make public.\n *\n * - `publish` = commit (if dirty) + push + register + sync + publish.\n * - `register` = same, but skip the commit/push (bytes already on GitHub).\n * - `yank` = unpublish the library's published assets (all, or one).\n *\n * The store REST surface is reached through the injectable {@link PublisherClient}\n * (default HTTP); git side-effects go through an injectable `spawn`. Both seams\n * keep the flow unit/integration-testable without a live store or a real remote.\n *\n * @docLink cli/commands/library\n */\n\nimport { spawnSync } from \"node:child_process\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { basename, join, relative, sep } from \"node:path\";\nimport {\n type AssetEntry,\n decodeSkaileManifest,\n loadSkPublishManifest,\n type SkPublishManifest,\n} from \"@skaile/workspaces/core\";\nimport {\n type ParseManifestResult,\n parseManifestFile,\n SEMVER_RE,\n} from \"@skaile/workspaces/discovery\";\nimport {\n type GitBackendConfig,\n type Library,\n missingRootAssets,\n upsertManifestAsset,\n} from \"@skaile/workspaces/library\";\nimport { logErr, logInfo, logOk, logWarn, S } from \"../helpers.ts\";\nimport { openLibraryManager } from \"../open-library.ts\";\nimport {\n checkAssetManifest,\n declaredVersion,\n findAssetManifestFile,\n readAssetBody,\n} from \"../skill-checks.ts\";\nimport { isStoreAuthenticated } from \"../store-client.ts\";\nimport { makeHttpPublisherClient, type PublisherClient } from \"../store-publisher.ts\";\nimport {\n assetEntryRef,\n assetNamespace,\n bareName,\n formatNamespaceAvailability,\n manifestNamespaces,\n plannedRefs,\n preflightNamespace,\n publishToStore,\n refFor,\n} from \"./publish-core.ts\";\n\n/** Injectable spawn contract — the subset of `spawnSync` these helpers use. */\ntype SpawnLike = typeof spawnSync;\n\n/** The fixed filename a library carries at its root for publication. */\nconst MANIFEST_FILENAME = \"skaile.manifest.yaml\";\n\n/** The remote url of a git-backed library, or `undefined` for a local one. */\nfunction remoteUrlOf(lib: Library): string | undefined {\n if (lib.backend !== \"git\") return undefined;\n return (lib.backendConfig as GitBackendConfig).url;\n}\n\n/** The publish branch of a git-backed library (defaults to `main`). */\nfunction branchOf(lib: Library): string {\n if (lib.backend !== \"git\") return \"main\";\n return (lib.backendConfig as GitBackendConfig).branch ?? \"main\";\n}\n\n/**\n * Read + decode the in-repo `skaile.manifest.yaml`. Prints each error\n * diagnostic and exits (1) — mirroring the sidecar flow's validation gate.\n */\nfunction loadManifest(libPath: string): SkPublishManifest {\n let text: string;\n try {\n text = readFileSync(join(libPath, MANIFEST_FILENAME), \"utf-8\");\n } catch {\n logErr(\n `No ${S.dim(MANIFEST_FILENAME)} in the library — author it (see \\`skaile library create\\`) ` +\n \"and run `skaile validate` before publishing.\",\n );\n process.exit(1);\n }\n const { manifest, diagnostics } = decodeSkaileManifest(text);\n const errors = diagnostics.filter((d) => d.severity === \"error\");\n if (errors.length > 0) {\n for (const d of errors) logErr(`${d.code}: ${d.message}`);\n logErr(\"The manifest has errors — fix them with `skaile validate` before publishing.\");\n process.exit(1);\n }\n return manifest;\n}\n\n/** Run a git command in `cwd` via the injected spawn; returns the result. */\nfunction runGit(spawn: SpawnLike, cwd: string, args: string[]) {\n return spawn(\"git\", [\"-C\", cwd, ...args], { encoding: \"utf-8\" });\n}\n\n/**\n * Ensure `libPath` is a git repo whose `origin` points at `remoteUrl`, then\n * commit any changes and push to `branch`. Idempotent re-publish: an unchanged\n * tree makes `git commit` fail with \"nothing to commit\" — swallowed. Push (or\n * any other git) failures surface as thrown Errors carrying git's stderr.\n */\nfunction commitAndPush(opts: {\n libPath: string;\n remoteUrl: string;\n branch: string;\n spawn: SpawnLike;\n}): void {\n const { libPath, remoteUrl, branch, spawn } = opts;\n\n const gitDir = runGit(spawn, libPath, [\"rev-parse\", \"--git-dir\"]);\n if (gitDir.status !== 0) {\n const init = runGit(spawn, libPath, [\"init\"]);\n if (init.status !== 0) {\n throw new Error(\n `git init failed: ${(init.stderr ?? \"\").toString().trim() || `exit ${init.status}`}`,\n );\n }\n }\n\n // Point origin at the resolved remote (add if absent, else set-url).\n const getUrl = runGit(spawn, libPath, [\"remote\", \"get-url\", \"origin\"]);\n const originArgs =\n getUrl.status === 0\n ? [\"remote\", \"set-url\", \"origin\", remoteUrl]\n : [\"remote\", \"add\", \"origin\", remoteUrl];\n const setOrigin = runGit(spawn, libPath, originArgs);\n if (setOrigin.status !== 0) {\n throw new Error(\n `git remote failed: ${(setOrigin.stderr ?? \"\").toString().trim() || `exit ${setOrigin.status}`}`,\n );\n }\n\n const add = runGit(spawn, libPath, [\"add\", \"-A\"]);\n if (add.status !== 0) {\n throw new Error(\n `git add failed: ${(add.stderr ?? \"\").toString().trim() || `exit ${add.status}`}`,\n );\n }\n\n // Fixed bot identity via -c so the commit succeeds regardless of the author's\n // git config (the publish commit is a machine action).\n const commit = spawn(\n \"git\",\n [\n \"-C\",\n libPath,\n \"-c\",\n \"user.email=publish@skaile.store\",\n \"-c\",\n \"user.name=skaile\",\n \"commit\",\n \"-m\",\n \"chore: publish\",\n ],\n { encoding: \"utf-8\" },\n );\n if (commit.status !== 0) {\n const out = `${commit.stdout ?? \"\"}${commit.stderr ?? \"\"}`;\n if (!/nothing to commit/i.test(out)) {\n throw new Error(`git commit failed: ${out.trim() || `exit ${commit.status}`}`);\n }\n }\n\n const push = runGit(spawn, libPath, [\"push\", \"origin\", `HEAD:${branch}`]);\n if (push.status !== 0) {\n throw new Error(\n `git push failed: ${(push.stderr ?? \"\").toString().trim() || `exit ${push.status}`}`,\n );\n }\n}\n\n/**\n * `true` when `url` is a GitHub repo remote the store can fetch: `https://github.com/<o>/<r>[.git]`,\n * `git@github.com:<o>/<r>[.git]` or `ssh://git@github.com/<o>/<r>[.git]`. The store is\n * pointer-only and fetches bytes from GitHub, so any other remote (a local path, a `file://`\n * url, another host) can be pushed to but never published.\n */\nexport function isGithubRemote(url: string): boolean {\n return /^(?:https:\\/\\/github\\.com\\/|git@github\\.com:|ssh:\\/\\/git@github\\.com\\/)[^/\\s]+\\/[^/\\s]+?(?:\\.git)?\\/?$/i.test(\n url.trim(),\n );\n}\n\n/** The advisory for a remote `library publish` cannot use (see {@link isGithubRemote}). */\nexport function notGithubRemoteMessage(name: string, url: string): string {\n return (\n `The remote of library \"${name}\" is not a GitHub url: ${url}. ` +\n \"The store fetches published assets from GitHub — repoint it with \" +\n `\\`skaile library set ${name} backendConfig.url=https://github.com/<owner>/<repo>\\`.`\n );\n}\n\n/** How many untracked paths the publish plan lists before collapsing to \"and N more\". */\nconst MAX_LISTED_UNTRACKED = 10;\n\n/** A first-party manifest asset resolved to its on-disk manifest file, read and parsed. */\ninterface PlanAsset {\n entry: AssetEntry;\n /** Path relative to the library root, for messages. */\n rel: string;\n parsed: ParseManifestResult;\n /** Markdown body (`SKILL.md`, `AGENT.md`) or an `agent.yaml` agent's `SOUL.md`; `undefined` otherwise. */\n body: string | undefined;\n}\n\n/**\n * The first-party `root:` assets the plan covers, each with its manifest file read.\n * Curated entries (`source`) carry no library directory and a root with no manifest\n * file is `missingRootAssets`' concern, so both are left out.\n */\nfunction planAssets(\n libPath: string,\n manifest: SkPublishManifest,\n targetName: string | undefined,\n): PlanAsset[] {\n const out: PlanAsset[] = [];\n for (const entry of manifest.assets ?? []) {\n if (targetName && entry.name !== targetName) continue;\n if (!entry.root || entry.source || manifest.source) continue;\n const file = findAssetManifestFile(join(libPath, entry.root), entry.kind, entry.name);\n if (!file) continue;\n const text = readFileSync(file, \"utf-8\");\n out.push({\n entry,\n rel: relative(libPath, file),\n parsed: parseManifestFile(file, text),\n body: readAssetBody(file, text),\n });\n }\n return out;\n}\n\n/**\n * The manifest with every entry's `version` replaced by the one in its asset\n * file — the version a publish ships (the file is the source of truth; the\n * entry only mirrors it after `skaile library index`).\n */\nfunction manifestWithFileVersions(\n manifest: SkPublishManifest,\n assets: PlanAsset[],\n): SkPublishManifest {\n return {\n ...manifest,\n assets: manifest.assets?.map((entry) => {\n const planned = assets.find((a) => a.entry === entry);\n const fileVersion = planned?.parsed.ok ? declaredVersion(planned.parsed.data) : undefined;\n return fileVersion === undefined ? entry : { ...entry, version: fileVersion };\n }),\n };\n}\n\n/** A manifest entry whose version differs from the one in its asset file. */\ninterface VersionDrift {\n asset: PlanAsset;\n ref: string;\n /** The version the manifest records (`assets[].version ?? version`), `undefined` when none. */\n entryVersion: string | undefined;\n fileVersion: string;\n}\n\n/**\n * The planned assets whose manifest entry does not carry the version of their asset\n * file. The store reads the manifest it finds in the pushed repo, so a publish\n * records the entry's version — {@link manifestWithFileVersions} is what the plan\n * shows, and these are the entries a real publish has to rewrite to match it.\n */\nfunction versionDrift(assets: PlanAsset[], manifest: SkPublishManifest): VersionDrift[] {\n const out: VersionDrift[] = [];\n for (const asset of assets) {\n if (!asset.parsed.ok) continue;\n const fileVersion = declaredVersion(asset.parsed.data);\n const entryVersion = asset.entry.version ?? manifest.version;\n if (fileVersion !== undefined && fileVersion !== entryVersion) {\n out.push({ asset, ref: assetEntryRef(asset.entry, manifest), entryVersion, fileVersion });\n }\n }\n return out;\n}\n\nconst describeDrift = (d: VersionDrift): string =>\n `${d.ref}: manifest version ${d.entryVersion ?? \"(none)\"} → ${d.fileVersion} (${d.asset.rel.split(sep).join(\"/\")})`;\n\n/**\n * Reasons the plan cannot publish an asset: its manifest file cannot be parsed (an\n * empty `SKILL.md`) or carries a version that is not semver. The same two cases\n * `skaile library index` keeps out of the manifest and `skaile validate` fails on;\n * a hand-edited manifest can still list one, so the plan stops rather than ships it.\n */\nfunction assetRefusals(assets: PlanAsset[], manifest: SkPublishManifest): string[] {\n const refusals: string[] = [];\n for (const { entry, rel, parsed } of assets) {\n const ref = assetEntryRef(entry, manifest);\n if (!parsed.ok) {\n refusals.push(`${ref} (${rel}) — manifest file could not be parsed: ${parsed.reason}`);\n continue;\n }\n const fileVersion = declaredVersion(parsed.data);\n for (const version of new Set([entry.version, fileVersion])) {\n if (version !== undefined && !SEMVER_RE.test(version)) {\n refusals.push(`${ref} (${rel}) — version \"${version}\" is not valid semver`);\n }\n }\n }\n return refusals;\n}\n\n/**\n * Per-asset advisories for the assets the plan would publish — the same checks\n * `skaile validate` runs (agentskills.io conformance for skills, the untouched\n * `library create` scaffold for skill, agent, prompt, contract, flow and preset), one line per\n * asset/finding. An unparsable manifest is {@link assetRefusals}' to report.\n */\nfunction assetWarnings(assets: PlanAsset[], manifest: SkPublishManifest): string[] {\n const warnings: string[] = [];\n for (const { entry, rel, parsed, body } of assets) {\n if (!parsed.ok || Object.keys(parsed.data).length === 0) continue;\n const findings = checkAssetManifest(entry.kind, parsed.data, body, basename(entry.root ?? \"\"));\n for (const f of findings) {\n warnings.push(`${assetEntryRef(entry, manifest)} (${rel}) [${f.tag}] — ${f.text}`);\n }\n }\n return warnings;\n}\n\n/**\n * Advisory publish-plan warnings: a missing LICENSE (a public repo without one grants\n * consumers no rights), per-asset skill warnings ({@link assetWarnings}) and — for `publish`,\n * which runs `git add -A` — untracked files that would become public. Never throws; a\n * non-git directory simply yields no untracked warning.\n */\nfunction publishWarnings(\n libPath: string,\n spawn: SpawnLike,\n skipPush: boolean,\n manifest: SkPublishManifest,\n assets: PlanAsset[],\n): string[] {\n const warnings: string[] = [];\n if (!existsSync(join(libPath, \"LICENSE\")) && !existsSync(join(libPath, \"LICENSE.md\"))) {\n warnings.push(\n \"No LICENSE or LICENSE.md in the library root — a public repo without a license grants consumers no rights to use it.\",\n );\n }\n warnings.push(...assetWarnings(assets, manifest));\n if (!skipPush) {\n const status = runGit(spawn, libPath, [\"status\", \"--porcelain\", \"--untracked-files=all\"]);\n if (status.status === 0) {\n const untracked = (status.stdout ?? \"\")\n .toString()\n .split(\"\\n\")\n .filter((l) => l.startsWith(\"?? \"))\n .map((l) => l.slice(3));\n if (untracked.length > 0) {\n const shown = untracked.slice(0, MAX_LISTED_UNTRACKED).join(\", \");\n const more =\n untracked.length > MAX_LISTED_UNTRACKED\n ? ` and ${untracked.length - MAX_LISTED_UNTRACKED} more`\n : \"\";\n warnings.push(\n `${untracked.length} untracked file(s) will be committed by \\`git add -A\\` and published: ${shown}${more}.`,\n );\n }\n }\n }\n return warnings;\n}\n\n/**\n * The store only registers PUBLIC repos (the backend rejects a private one with \"must be\n * public\"), so a repo provisioned with `--private` can be created and linked but not published.\n */\nconst PRIVATE_REPO_WARNING =\n \"--private: the store only accepts PUBLIC repos — registering a private repo is rejected. \" +\n \"The repo will be created private, but publishing it will fail; share it directly \" +\n \"(`skaile source add <url>` with the consumer's own git credentials) instead.\";\n\n/**\n * Provision a GitHub repo `github.com/<you>/<name>` via `gh` (public unless `isPrivate`) and\n * return its https url. Parses the url `gh` prints on success. Throws on failure.\n */\nfunction createRepoViaGh(name: string, spawn: SpawnLike, isPrivate: boolean): string {\n const res = spawn(\"gh\", [\"repo\", \"create\", name, isPrivate ? \"--private\" : \"--public\"], {\n encoding: \"utf-8\",\n });\n if (res.status !== 0) {\n const stderr = (res.stderr ?? \"\").toString().trim();\n throw new Error(`gh repo create ${name} failed: ${stderr || `exit ${res.status}`}`);\n }\n // `gh repo create` prints the repo url (e.g. `https://github.com/<owner>/<name>`);\n // scan combined output for the first github.com url so we capture whatever\n // owner gh resolved (the authed user).\n const out = `${res.stdout ?? \"\"}\\n${res.stderr ?? \"\"}`;\n const match = out.match(/https:\\/\\/github\\.com\\/[^\\s]+/);\n if (!match) {\n throw new Error(`gh repo create ${name} succeeded but printed no repo url:\\n${out.trim()}`);\n }\n return match[0].replace(/\\.git$/, \"\").trim();\n}\n\n/** Shared publish body for `publish` (pushes) and `register` (skips the push). */\nasync function publishLibrary(\n name: string,\n opts: {\n asset?: string;\n createRepo?: boolean;\n private?: boolean;\n ref?: string;\n dryRun?: boolean;\n skipPush: boolean;\n },\n client?: PublisherClient,\n spawn: SpawnLike = spawnSync,\n): Promise<void> {\n const injected = client !== undefined;\n const { manager, close } = await openLibraryManager();\n try {\n const lib = await manager.requireLibrary(name);\n const manifest = loadManifest(lib.path);\n\n // A manifest entry whose directory is gone would publish a catalog entry\n // that points at nothing — refuse (dry-run included) rather than plan it.\n const missing = missingRootAssets(lib.path, manifest);\n if (missing.length > 0) {\n for (const a of missing) {\n logErr(`${assetEntryRef(a, manifest)} — root \"${a.root}\" does not exist in the library.`);\n }\n logErr(\n \"The manifest lists assets that are no longer on disk. Run \" +\n `\\`skaile library index ${name}\\` to drop them from the manifest, then re-run.`,\n );\n process.exit(1);\n }\n\n // Resolve the remote: git-backed → its url; local + --create-repo → provision\n // and link; else stop with a hint.\n let remoteUrl = remoteUrlOf(lib);\n let wouldCreateRepo = false;\n if (opts.private && !opts.createRepo) {\n logErr(\n \"--private only applies together with --create-repo (it sets the new repo's visibility).\",\n );\n process.exit(1);\n }\n const visibility = opts.private ? \"private\" : \"public\";\n if (!remoteUrl) {\n if (opts.createRepo) {\n if (opts.private) logWarn(PRIVATE_REPO_WARNING);\n if (opts.dryRun) {\n // A dry-run must not provision anything — defer the real\n // `gh repo create` to the live run and just show the would-be remote.\n wouldCreateRepo = true;\n remoteUrl = `https://github.com/<your-account>/${lib.name}`;\n } else {\n remoteUrl = createRepoViaGh(lib.name, spawn, opts.private === true);\n await manager.updateLibrary(name, {\n backend: \"git\",\n backendConfig: { url: remoteUrl, branch: \"main\", authHint: \"ssh\" },\n });\n logOk(`Created + linked ${S.dim(remoteUrl)} (${visibility}).`);\n }\n } else {\n logErr(\n `Library \"${name}\" has no remote — run ${S.cmd(`skaile library link ${name} <url>`)} ` +\n \"first, or pass `--create-repo` to provision a public repo.\",\n );\n process.exit(1);\n }\n } else if (!isGithubRemote(remoteUrl)) {\n // Plan-phase gate (dry-run and real): the store fetches from GitHub, so a\n // local-path / other-host remote can never be published. A remote here means\n // the library is already git-backed, where `library link` refuses.\n logErr(notGithubRemoteMessage(name, remoteUrl));\n process.exit(1);\n }\n\n // Each asset publishes under `assets[].publisher ?? manifest.publisher`\n // (first-party — no remap), so one library can span several namespaces.\n const targetName = opts.asset ? bareName(opts.asset) : undefined;\n const namespaces = manifestNamespaces(manifest, targetName);\n\n // An asset whose manifest file cannot be parsed or carries a non-semver version\n // must not be planned (dry-run included): it would publish as a broken entry.\n const assets = planAssets(lib.path, manifest, targetName);\n const wouldBeRefs = plannedRefs(manifestWithFileVersions(manifest, assets), targetName);\n const refusals = assetRefusals(assets, manifest);\n if (refusals.length > 0) {\n for (const r of refusals) logErr(r);\n logErr(\n \"These assets cannot be published. Fix them (see `skaile validate`), then run \" +\n `\\`skaile library index ${name}\\` and re-run.`,\n );\n process.exit(1);\n }\n\n // The store records the version of the manifest it finds in the pushed repo, so\n // the plan (file versions) and the publish only agree when the entries match the\n // files. `publish` rewrites them before it commits; `register` pushes nothing,\n // so it cannot, and stops instead.\n const drift = versionDrift(assets, manifest);\n if (drift.length > 0 && opts.skipPush) {\n for (const d of drift) logErr(describeDrift(d));\n logErr(\n \"register publishes the remote HEAD as-is, so these manifest versions would be recorded \" +\n `instead of the file versions. Run \\`skaile library index ${name}\\`, commit and push, then re-run.`,\n );\n process.exit(1);\n }\n\n const sourceRef = opts.ref ?? branchOf(lib);\n const warnings = publishWarnings(lib.path, spawn, opts.skipPush, manifest, assets);\n\n if (opts.dryRun) {\n logInfo(`Publish plan for ${S.bold(name)}:`);\n logInfo(\n ` remote: ${remoteUrl}${wouldCreateRepo ? ` (would be created ${visibility} via \\`gh repo create --${visibility}\\`)` : \"\"}`,\n );\n logInfo(\n ` publisher: ${namespaces.length > 0 ? namespaces.join(\", \") : \"<manifest publisher>\"}`,\n );\n // Best-effort namespace-availability probe — a read-only GET, only when\n // signed in (or a client is injected). A failure keeps dry-run offline-safe.\n const canCheck = injected || isStoreAuthenticated();\n if (!canCheck) {\n // The real run stops at \"Not signed in\" before any namespace check.\n logWarn(\"namespace check skipped: not signed in (run `skaile store login`)\");\n } else if (namespaces.length > 0) {\n for (const ns of namespaces) {\n try {\n const avail = await (client ?? makeHttpPublisherClient()).namespaceAvailability(ns);\n const prefix = namespaces.length > 1 ? `@${ns} — ` : \"\";\n logInfo(` namespace: ${prefix}${formatNamespaceAvailability(avail)}`);\n } catch {\n // Store unreachable / not signed in — skip the advisory, never fail.\n }\n }\n }\n logInfo(` source ref: ${sourceRef}`);\n logInfo(` would publish ${wouldBeRefs.length} asset(s):`);\n for (const r of wouldBeRefs) logInfo(` ${r}`);\n for (const d of drift) logInfo(` would update the manifest: ${describeDrift(d)}`);\n for (const w of warnings) logWarn(w);\n return;\n }\n\n // Real run: surface the same advisories before anything is pushed.\n for (const w of warnings) logWarn(w);\n\n // A real publish makes store calls, so it needs a token (injected fakes bypass).\n if (!injected && !isStoreAuthenticated()) {\n logErr(\"Not signed in — run `skaile store login` first.\");\n process.exit(1);\n }\n\n const pub = client ?? makeHttpPublisherClient();\n\n // Preflight EVERY distinct namespace BEFORE the public git push, so a\n // reserved/unclaimed one fails fast with guidance instead of after publishing bytes.\n for (const ns of namespaces) {\n const gate = await preflightNamespace(pub, ns);\n if (!gate.ok) {\n logErr(gate.message ?? `Cannot publish under @${ns}.`);\n process.exit(1);\n }\n }\n\n // Bring the entries to the file versions the plan showed, before they are committed.\n for (const d of drift) {\n upsertManifestAsset(lib.path, {\n kind: d.asset.entry.kind,\n name: d.asset.entry.name,\n root: d.asset.entry.root ?? \"\",\n version: d.fileVersion,\n });\n logInfo(`Updated the manifest: ${describeDrift(d)}`);\n }\n\n // publish commits + pushes the library repo; register takes the remote HEAD as-is.\n if (!opts.skipPush) {\n // `git add -A` stages every non-ignored file → a PUBLIC push. Surface it so\n // an unexpected file in the working tree is not silently published.\n logInfo(\n `Committing the library and pushing to the PUBLIC remote ${S.dim(remoteUrl)} ` +\n \"(.gitignore honored; anything else in the working tree becomes public).\",\n );\n commitAndPush({ libPath: lib.path, remoteUrl, branch: branchOf(lib), spawn });\n logOk(`Pushed ${S.dim(name)} to ${S.dim(remoteUrl)}.`);\n }\n\n const { published } = await publishToStore({\n sourceUrl: remoteUrl,\n ref: sourceRef,\n manifest: manifestWithFileVersions(manifest, assets),\n assetName: targetName,\n client: pub,\n });\n\n if (published.length > 0) {\n logInfo(`Consumers can now \\`skaile add ${published[0]}\\`.`);\n }\n } finally {\n close();\n }\n}\n\n/**\n * `skaile library publish <lib>` — commit + push the library repo, register +\n * sync it as a store source, and publish its manifest's assets under the\n * manifest publisher. See the module header for the full flow.\n */\nexport async function runLibraryPublish(\n name: string,\n opts: {\n asset?: string;\n createRepo?: boolean;\n private?: boolean;\n ref?: string;\n dryRun?: boolean;\n },\n client?: PublisherClient,\n spawn: SpawnLike = spawnSync,\n): Promise<void> {\n await publishLibrary(name, { ...opts, skipPush: false }, client, spawn);\n}\n\n/**\n * `skaile library register <lib>` — same as publish but skips the commit/push\n * (the bytes are already on GitHub at the current remote HEAD). Still requires a\n * git-backed remote.\n */\nexport async function runLibraryRegister(\n name: string,\n opts: { asset?: string; ref?: string; dryRun?: boolean },\n client?: PublisherClient,\n spawn: SpawnLike = spawnSync,\n): Promise<void> {\n await publishLibrary(name, { ...opts, skipPush: true }, client, spawn);\n}\n\n/**\n * `skaile library yank <lib>` — unpublish the library's published assets from\n * the store (all, or the single asset matching `opts.asset`'s name).\n * Auth-gated like publish.\n */\nexport async function runLibraryYank(\n name: string,\n opts: { asset?: string },\n client?: PublisherClient,\n): Promise<void> {\n const injected = client !== undefined;\n const { manager, close } = await openLibraryManager();\n try {\n const lib = await manager.requireLibrary(name);\n const remoteUrl = remoteUrlOf(lib);\n if (!remoteUrl) {\n logErr(`Library \"${name}\" has no remote — nothing published to yank.`);\n process.exit(1);\n }\n\n if (!injected && !isStoreAuthenticated()) {\n logErr(\"Not signed in — run `skaile store login` first.\");\n process.exit(1);\n }\n\n const pub = client ?? makeHttpPublisherClient();\n const rows = await pub.sourcesList();\n const source = rows.find((r) => r.url === remoteUrl);\n if (!source) {\n logErr(`Library \"${name}\" is not registered in the store — nothing to yank.`);\n process.exit(1);\n }\n\n const targetName = opts.asset ? bareName(opts.asset) : undefined;\n const candidates = (await pub.sourceCandidates(source.id)).filter(\n (c) => c.published && (!targetName || c.name === targetName),\n );\n if (candidates.length === 0) {\n logInfo(\"No published assets matched — nothing to yank.\");\n return;\n }\n\n // Report each yanked asset under its own namespace\n // (`assets[].publisher ?? manifest.publisher`); fall back to `kind:name`\n // when the manifest is absent or declares no namespace for it.\n const manifest = loadSkPublishManifest(lib.path);\n const yanked: string[] = [];\n for (const c of candidates) {\n try {\n await pub.assetUnpublish(c.id);\n const entry = manifest?.assets?.find((a) => a.kind === c.kind && a.name === c.name);\n const ns = manifest && entry ? assetNamespace(entry, manifest) : undefined;\n yanked.push(ns ? refFor(c.kind, ns, c.name, c.version) : `${c.kind}:${c.name}`);\n } catch (err) {\n logErr(\n `Failed to yank ${c.kind}:${c.name}: ${err instanceof Error ? err.message : String(err)}`,\n );\n }\n }\n\n logOk(`Yanked ${yanked.length} asset(s):`);\n for (const r of yanked) logInfo(` ${r}`);\n } finally {\n close();\n }\n}\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export { LocalCatalogDisabledError, openCatalogSource, openLibrary, openLibraryManager, resolveCatalogSource } from './chunk-HG34RNTK.js';
|
|
2
|
+
import './chunk-F2EKONM7.js';
|
|
3
|
+
import './chunk-2FRUUDZY.js';
|
|
4
|
+
import './chunk-FZNG4V4J.js';
|
|
5
|
+
import './chunk-MGGFBZWA.js';
|
|
6
|
+
import './chunk-7RGTAEG6.js';
|
|
7
|
+
import './chunk-NUELZWCF.js';
|
|
8
|
+
import './chunk-H7QUDDKH.js';
|
|
9
|
+
import './chunk-4MQS7CAF.js';
|
|
10
|
+
import './chunk-Y7QA2OLD.js';
|
|
11
|
+
import './chunk-CKQEIY43.js';
|
|
12
|
+
import './chunk-R7FOF242.js';
|
|
13
|
+
import './chunk-3TXEJN4W.js';
|
|
14
|
+
import './chunk-YSHVQGUS.js';
|
|
15
|
+
import './chunk-CGYEHQOX.js';
|
|
16
|
+
import './chunk-KTBKW2FI.js';
|
|
17
|
+
import './chunk-UQ6LFBPZ.js';
|
|
18
|
+
import './chunk-EF7NPDDU.js';
|
|
19
|
+
import './chunk-B6GIW55K.js';
|
|
20
|
+
import './chunk-36AFURKZ.js';
|
|
21
|
+
import './chunk-4GY63JU6.js';
|
|
22
|
+
import './chunk-GB7WDMH2.js';
|
|
23
|
+
import './chunk-PMECEZK3.js';
|
|
24
|
+
import './chunk-5BEFNLOR.js';
|
|
25
|
+
import './chunk-A2ULN3KX.js';
|
|
26
|
+
import './chunk-JAKOMFC6.js';
|
|
27
|
+
import './chunk-L5VSIPQD.js';
|
|
28
|
+
import './chunk-CPSIPIX7.js';
|
|
29
|
+
import './chunk-BTE2V4IW.js';
|
|
30
|
+
import './chunk-RVRB27AN.js';
|
|
31
|
+
import './chunk-GTILM2CI.js';
|
|
32
|
+
import './chunk-QVNRCDTV.js';
|
|
33
|
+
import './chunk-ICSCSM5D.js';
|
|
34
|
+
import './chunk-UMVKJM4Q.js';
|
|
35
|
+
import './chunk-MJHSLODD.js';
|
|
36
|
+
import './chunk-C3CAXQMA.js';
|
|
37
|
+
import './chunk-BOFL7GIF.js';
|
|
38
|
+
import './chunk-NSBPE2FW.js';
|
|
39
|
+
//# sourceMappingURL=open-library-OG457THY.js.map
|
|
40
|
+
//# sourceMappingURL=open-library-OG457THY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"open-library-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"open-library-OG457THY.js"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export { getKindRegistry, getKnownKinds } from './chunk-2FRUUDZY.js';
|
|
2
|
+
import './chunk-FZNG4V4J.js';
|
|
3
|
+
import './chunk-MGGFBZWA.js';
|
|
4
|
+
import './chunk-7RGTAEG6.js';
|
|
5
|
+
import './chunk-NUELZWCF.js';
|
|
6
|
+
import './chunk-4MQS7CAF.js';
|
|
7
|
+
import './chunk-Y7QA2OLD.js';
|
|
8
|
+
import './chunk-CKQEIY43.js';
|
|
9
|
+
import './chunk-R7FOF242.js';
|
|
10
|
+
import './chunk-3TXEJN4W.js';
|
|
11
|
+
import './chunk-B6GIW55K.js';
|
|
12
|
+
import './chunk-36AFURKZ.js';
|
|
13
|
+
import './chunk-4GY63JU6.js';
|
|
14
|
+
import './chunk-GB7WDMH2.js';
|
|
15
|
+
import './chunk-PMECEZK3.js';
|
|
16
|
+
import './chunk-5BEFNLOR.js';
|
|
17
|
+
import './chunk-A2ULN3KX.js';
|
|
18
|
+
import './chunk-JAKOMFC6.js';
|
|
19
|
+
import './chunk-L5VSIPQD.js';
|
|
20
|
+
import './chunk-CPSIPIX7.js';
|
|
21
|
+
import './chunk-BTE2V4IW.js';
|
|
22
|
+
import './chunk-RVRB27AN.js';
|
|
23
|
+
import './chunk-GTILM2CI.js';
|
|
24
|
+
import './chunk-QVNRCDTV.js';
|
|
25
|
+
import './chunk-ICSCSM5D.js';
|
|
26
|
+
import './chunk-UMVKJM4Q.js';
|
|
27
|
+
import './chunk-MJHSLODD.js';
|
|
28
|
+
import './chunk-C3CAXQMA.js';
|
|
29
|
+
import './chunk-BOFL7GIF.js';
|
|
30
|
+
import './chunk-NSBPE2FW.js';
|
|
31
|
+
//# sourceMappingURL=open-registry-ZUZJ7MS7.js.map
|
|
32
|
+
//# sourceMappingURL=open-registry-ZUZJ7MS7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"open-registry-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"open-registry-ZUZJ7MS7.js"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { AI_RESOURCES, MONOREPO_ROOT } from './chunk-Y4N2NUZD.js';
|
|
2
|
+
export { aiResourceRoots } from './chunk-36AFURKZ.js';
|
|
3
|
+
import './chunk-4GY63JU6.js';
|
|
4
|
+
import './chunk-GB7WDMH2.js';
|
|
5
|
+
import './chunk-PMECEZK3.js';
|
|
6
|
+
import './chunk-5BEFNLOR.js';
|
|
7
|
+
import './chunk-A2ULN3KX.js';
|
|
8
|
+
import './chunk-JAKOMFC6.js';
|
|
9
|
+
import './chunk-L5VSIPQD.js';
|
|
10
|
+
import './chunk-CPSIPIX7.js';
|
|
11
|
+
import './chunk-BTE2V4IW.js';
|
|
12
|
+
import './chunk-RVRB27AN.js';
|
|
13
|
+
import './chunk-GTILM2CI.js';
|
|
14
|
+
import './chunk-QVNRCDTV.js';
|
|
15
|
+
import './chunk-ICSCSM5D.js';
|
|
16
|
+
import './chunk-UMVKJM4Q.js';
|
|
17
|
+
import './chunk-MJHSLODD.js';
|
|
18
|
+
import './chunk-C3CAXQMA.js';
|
|
19
|
+
import './chunk-BOFL7GIF.js';
|
|
20
|
+
import './chunk-NSBPE2FW.js';
|
|
21
|
+
//# sourceMappingURL=paths-FQ64OLJG.js.map
|
|
22
|
+
//# sourceMappingURL=paths-FQ64OLJG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"paths-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"paths-FQ64OLJG.js"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { pluginRegistry } from './chunk-6E6PKKAD.js';
|
|
2
|
-
import { readPluginsLockSlice } from './chunk-
|
|
2
|
+
import { readPluginsLockSlice } from './chunk-36AFURKZ.js';
|
|
3
3
|
import './chunk-4GY63JU6.js';
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
4
|
+
import './chunk-GB7WDMH2.js';
|
|
5
|
+
import './chunk-PMECEZK3.js';
|
|
6
6
|
import './chunk-5BEFNLOR.js';
|
|
7
7
|
import './chunk-A2ULN3KX.js';
|
|
8
|
-
import './chunk-
|
|
9
|
-
import './chunk-
|
|
8
|
+
import './chunk-JAKOMFC6.js';
|
|
9
|
+
import './chunk-L5VSIPQD.js';
|
|
10
10
|
import './chunk-CPSIPIX7.js';
|
|
11
|
-
import './chunk-
|
|
11
|
+
import './chunk-BTE2V4IW.js';
|
|
12
12
|
import './chunk-RVRB27AN.js';
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
13
|
+
import './chunk-GTILM2CI.js';
|
|
14
|
+
import './chunk-QVNRCDTV.js';
|
|
15
15
|
import './chunk-ICSCSM5D.js';
|
|
16
|
-
import './chunk-
|
|
16
|
+
import './chunk-UMVKJM4Q.js';
|
|
17
17
|
import './chunk-MJHSLODD.js';
|
|
18
18
|
import './chunk-C3CAXQMA.js';
|
|
19
19
|
import './chunk-BOFL7GIF.js';
|
|
@@ -145,5 +145,5 @@ async function ensurePluginsLoaded(projectDir, plugins, registry = pluginRegistr
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
export { ensurePluginsLoaded, loadPlugins, reconcilePlugins, specName };
|
|
148
|
-
//# sourceMappingURL=plugin-store-
|
|
149
|
-
//# sourceMappingURL=plugin-store-
|
|
148
|
+
//# sourceMappingURL=plugin-store-MPAMD5OT.js.map
|
|
149
|
+
//# sourceMappingURL=plugin-store-MPAMD5OT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../cli/src/plugin-store/paths.ts","../cli/src/plugin-store/spec.ts","../cli/src/plugin-store/load.ts","../cli/src/plugin-store/reconcile.ts","../cli/src/plugin-store/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAUO,SAAS,WAAW,UAAA,EAA4B;AACrD,EAAA,OAAO,IAAA,CAAK,UAAA,EAAY,SAAA,EAAW,SAAS,CAAA;AAC9C;AAGO,SAAS,eAAe,UAAA,EAA4B;AACzD,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG,cAAc,CAAA;AACpD;AAGO,SAAS,eAAe,UAAA,EAA4B;AACzD,EAAA,OAAO,IAAA,CAAK,UAAA,CA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AA;AACnD,EAAA,IAAI,CAAC,OAAO,EAAA,EAAI;AACd,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA;AAAA,EAA2B,MAAA,CAAO,MAAM,CAAA,CAAE,CAAA;AAAA,EAC5D;AAEA,EAAA,aAAA,CAAc,UAAU,QAAQ,CAAA;AAChC,EAAA,OAAO,EAAE,OAAA,EAAS,IAAA,EAAM,MAAA,EAAQ,YAAA,EAAa;AAC/C;;;ACxFA,eAAsB,oBACpB,UAAA,EACA,OAAA,EACA,WAA2B,cAAA,EAC3B,IAAA,GAA6B,EAAC,EACT;AACrB,EAAA,IAAI,CAAC,OAAA,IAAW,OAAA,CAAQ,MAAA,KAAW,CAAA,EAAG;AACpC,IAAA,OAAO,EAAE,MAAA,EAAQ,EAAC,EAAG,MAAA,EAAQ,EAAC,EAAE;AAAA,EAClC;AACA,EAAA,MAAM,gBAAA,CAAiB,UAAA,EAAY,OAAA,EAAS,IAAI,CAAA;AAChD,EAAA,OAAO,WAAA,CAAY,YAAY,OAAA,EAAS,QAAA,EAAU,EAAE,GAAA,EAAK,IAAA,CAAK,KAAK,CAAA;AACrE","file":"plugin-store-66QFBNEO.js","sourcesContent":["/**\n * Pure path helpers for the project-local plugin store.\n *\n * The store is a self-contained npm workspace owned by the CLI under\n * `<projectDir>/.skaile/plugins/`. Nothing here touches the filesystem.\n */\n\nimport { join } from \"node:path\";\n\n/** `<projectDir>/.skaile/plugins` — the store root. */\nexport function pluginsDir(projectDir: string): string {\n return join(projectDir, \".skaile\", \"plugins\");\n}\n\n/** `<store>/package.json` — generated, never user-edited. */\nexport function pluginsPkgJson(projectDir: string): string {\n return join(pluginsDir(projectDir), \"package.json\");\n}\n\n/** `<store>/node_modules` — where reconciled plugin packages land. */\nexport function nodeModulesDir(projectDir: string): string {\n return join(pluginsDir(projectDir), \"node_modules\");\n}\n\n/** `<store>/.reconcile-hash` — SHA of plugins-list + lock slice; skip reinstall when unchanged. */\nexport function reconcileHashFile(projectDir: string): string {\n return join(pluginsDir(projectDir), \".reconcile-hash\");\n}\n\n/**\n * Absolute path to a plugin package's entry directory under the store's\n * `node_modules`. Dynamic `import()` against this absolute path works inside\n * compiled binaries via `pathToFileURL`.\n */\nexport function resolvePluginEntry(projectDir: string, pkgName: string): string {\n return join(nodeModulesDir(projectDir), pkgName);\n}\n","/**\n * Parse npm package specifiers from the `plugins:` list into name + range.\n *\n * The leading `@` of a scope is NOT a separator: only the last `@` at a\n * non-zero index splits the package name from its semver range.\n * \"@skaile/provider-fly@^0.1.0\" → { name: \"@skaile/provider-fly\", range: \"^0.1.0\" }\n * \"@skaile/connector-redis\" → { name: \"@skaile/connector-redis\", range: \"*\" }\n * \"lodash@^4\" → { name: \"lodash\", range: \"^4\" }\n */\n\n/** A parsed plugin specifier: package name plus a semver range (`\"*\"` when omitted). */\nexport interface PluginSpec {\n name: string;\n range: string;\n}\n\n/**\n * Parse a single plugin specifier into `{ name, range }`.\n *\n * @param spec - An npm specifier, e.g. `\"@skaile/provider-fly@^0.1.0\"` or `\"lodash\"`.\n * @returns The package name and semver range (range defaults to `\"*\"`).\n * @throws Error when the specifier is empty.\n */\nexport function parseSpec(spec: string): PluginSpec {\n const trimmed = spec.trim();\n if (!trimmed) throw new Error(\"parseSpec: empty specifier\");\n\n // Find the version-separating `@` — the last one that is not the scope `@`\n // at index 0. A bare `@scope/name` has its only `@` at index 0 (no range).\n const at = trimmed.lastIndexOf(\"@\");\n if (at <= 0) {\n return { name: trimmed, range: \"*\" };\n }\n const name = trimmed.slice(0, at);\n const range = trimmed.slice(at + 1);\n return { name, range: range.length > 0 ? range : \"*\" };\n}\n\n/** Convenience: just the package name of a specifier. */\nexport function specName(spec: string): string {\n return parseSpec(spec).name;\n}\n","/**\n * Runtime plugin loader: dynamic-import each reconciled plugin and let it\n * self-register into the `pluginRegistry`.\n *\n * Each plugin specifier resolves to an absolute path under the store's\n * `node_modules`; we import it via a `file://` URL so the import works inside\n * `bun --compile` binaries (which bundle only the literal-string switches, but\n * can still execute a `file://` import against the unpacked store on disk).\n * Failures are caught per-plugin so one broken plugin never aborts the rest.\n */\n\nimport { pathToFileURL } from \"node:url\";\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { resolvePluginEntry } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/** Options for {@link loadPlugins}. */\nexport interface LoadOptions {\n log?: Logger;\n}\n\n/** Result of a load pass: which specs registered and which failed. */\nexport interface LoadResult {\n loaded: string[];\n failed: { spec: string; error: string }[];\n}\n\n/** The self-registration entrypoint a plugin module is expected to export. */\ntype PluginModule = { register?: (registry: PluginRegistry) => void };\n\n/**\n * Load and register each plugin in `plugins` into `registry`.\n *\n * @param projectDir - Project root holding `.skaile/plugins/node_modules`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param registry - Registry to register into. Defaults to the process-wide `pluginRegistry`.\n * @param opts - Optional logger.\n * @returns Loaded specs + per-plugin failures (never throws).\n */\nexport async function loadPlugins(\n projectDir: string,\n plugins: string[],\n registry: PluginRegistry = pluginRegistry,\n opts: LoadOptions = {},\n): Promise<LoadResult> {\n const loaded: string[] = [];\n const failed: { spec: string; error: string }[] = [];\n\n for (const spec of plugins) {\n try {\n const { name } = parseSpec(spec);\n const entry = resolvePluginEntry(projectDir, name);\n const mod = (await import(pathToFileURL(entry).href)) as PluginModule;\n if (typeof mod.register !== \"function\") {\n throw new Error(`plugin \"${name}\" does not export a register() function`);\n }\n mod.register(registry);\n loaded.push(spec);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n failed.push({ spec, error: `failed to load plugin \"${spec}\": ${message}` });\n opts.log?.warn(`plugin load failed: ${spec}`, { error: message });\n }\n }\n\n return { loaded, failed };\n}\n","/**\n * Reconcile the project-local plugin store (`<projectDir>/.skaile/plugins/`).\n *\n * The reconciler is hash-skipped: it computes a SHA-256 over the sorted plugin\n * list plus the lock file's `plugins` slice and compares it to the stored\n * `.reconcile-hash`. On a match it returns with zero further I/O; otherwise it\n * regenerates the store's `package.json` and runs `bun install` against it.\n *\n * The install step is injectable (`InstallFn`) so tests stay hermetic — they\n * pass a fake installer that records calls and writes a stub `node_modules`.\n */\n\nimport { createHash } from \"node:crypto\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { readPluginsLockSlice } from \"@skaile/workspaces/core\";\nimport { pluginsDir, pluginsPkgJson, reconcileHashFile } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/**\n * Installs the store's dependencies. Returns `ok: false` (never throws) on a\n * failed install so the reconciler can surface the captured `output`.\n */\nexport type InstallFn = (pluginsDir: string) => Promise<{ ok: boolean; output: string }>;\n\n/** Options for {@link reconcilePlugins}. */\nexport interface ReconcileOptions {\n /** Injectable installer. Defaults to a real `bun install` of the store. */\n runInstall?: InstallFn;\n /**\n * Lock slice to fold into the reconcile-hash. Defaults to\n * `readPluginsLockSlice(projectDir)` so a lock edit invalidates the hash.\n */\n lockSlice?: unknown;\n}\n\n/** Result of a reconcile pass. */\nexport interface ReconcileResult {\n changed: boolean;\n reason: \"no-plugins\" | \"up-to-date\" | \"reconciled\";\n}\n\n/**\n * The default real installer: `bun install` inside the store directory.\n * Frozen on subsequent runs (a `bun.lock`/`bun.lockb` already exists), and\n * non-frozen on the first run so a lock can be generated.\n */\nexport const defaultInstall: InstallFn = async (dir) => {\n const { portableSpawn } = await import(\"@skaile/workspaces/core\");\n const hasLock =\n existsSync(`${dir}/bun.lock`) ||\n existsSync(`${dir}/bun.lockb`) ||\n existsSync(`${dir}/package-lock.json`);\n const args = hasLock ? [\"bun\", \"install\", \"--frozen-lockfile\"] : [\"bun\", \"install\"];\n const proc = portableSpawn(args, { cwd: dir });\n const chunks: string[] = [];\n const decoder = new TextDecoder();\n const pump = async (stream: ReadableStream<Uint8Array>) => {\n const reader = stream.getReader();\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n if (value) chunks.push(decoder.decode(value, { stream: true }));\n }\n };\n await Promise.all([pump(proc.stdout), pump(proc.stderr)]);\n const code = await proc.exited;\n return { ok: code === 0, output: chunks.join(\"\") };\n};\n\n/** Generate the store's `package.json` from the plugin specs. */\nfunction writePackageJson(projectDir: string, plugins: string[]): void {\n const dependencies: Record<string, string> = {};\n for (const spec of plugins) {\n const { name, range } = parseSpec(spec);\n dependencies[name] = range;\n }\n const pkg = {\n name: \"skaile-project-plugins\",\n private: true,\n dependencies,\n };\n mkdirSync(pluginsDir(projectDir), { recursive: true });\n writeFileSync(pluginsPkgJson(projectDir), `${JSON.stringify(pkg, null, 2)}\\n`);\n}\n\n/**\n * Reconcile the plugin store for a project.\n *\n * @param projectDir - Project root containing `skaile.yaml` / `skaile.lock.yaml`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param opts - Optional injectable installer + lock slice override.\n * @returns Whether the store changed and why.\n */\nexport async function reconcilePlugins(\n projectDir: string,\n plugins: string[],\n opts: ReconcileOptions = {},\n): Promise<ReconcileResult> {\n if (plugins.length === 0) {\n return { changed: false, reason: \"no-plugins\" };\n }\n\n const lockSlice = opts.lockSlice ?? readPluginsLockSlice(projectDir);\n const wantHash = createHash(\"sha256\")\n .update(JSON.stringify({ plugins: [...plugins].sort(), lock: lockSlice }))\n .digest(\"hex\");\n\n const hashFile = reconcileHashFile(projectDir);\n if (existsSync(hashFile)) {\n const have = readFileSync(hashFile, \"utf8\").trim();\n if (have === wantHash) {\n return { changed: false, reason: \"up-to-date\" };\n }\n }\n\n writePackageJson(projectDir, plugins);\n\n const install = opts.runInstall ?? defaultInstall;\n const result = await install(pluginsDir(projectDir));\n if (!result.ok) {\n throw new Error(`plugin install failed:\\n${result.output}`);\n }\n\n writeFileSync(hashFile, wantHash);\n return { changed: true, reason: \"reconciled\" };\n}\n","/**\n * The project-local plugin store: reconcile (`<projectDir>/.skaile/plugins/`)\n * then load the reconciled plugins into the `pluginRegistry`.\n *\n * `ensurePluginsLoaded` is the single entrypoint commands wire in. It is a\n * guarded no-op when `plugins` is empty/undefined — zero overhead for the\n * common case where no project declares `plugins:` in `skaile.yaml`.\n */\n\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { type LoadResult, loadPlugins } from \"./load.js\";\nimport { type ReconcileOptions, reconcilePlugins } from \"./reconcile.js\";\n\nexport type { LoadResult } from \"./load.js\";\nexport { loadPlugins } from \"./load.js\";\nexport type { ReconcileOptions } from \"./reconcile.js\";\nexport { reconcilePlugins } from \"./reconcile.js\";\nexport { specName } from \"./spec.js\";\n\n/** Options for {@link ensurePluginsLoaded}. */\nexport interface EnsurePluginsOptions extends ReconcileOptions {\n log?: Logger;\n}\n\n/**\n * Reconcile the plugin store then load each plugin into `registry`.\n *\n * No-op (returns immediately) when `plugins` is empty/undefined, so the common\n * no-plugins path costs nothing.\n *\n * @param projectDir - Project root.\n * @param plugins - The `skaile.yaml` `plugins:` list (may be undefined).\n * @param registry - Registry to register into. Defaults to `pluginRegistry`.\n * @param opts - Injectable installer / lock slice + optional logger.\n * @returns The load result, or an empty result when there are no plugins.\n */\nexport async function ensurePluginsLoaded(\n projectDir: string,\n plugins: string[] | undefined,\n registry: PluginRegistry = pluginRegistry,\n opts: EnsurePluginsOptions = {},\n): Promise<LoadResult> {\n if (!plugins || plugins.length === 0) {\n return { loaded: [], failed: [] };\n }\n await reconcilePlugins(projectDir, plugins, opts);\n return loadPlugins(projectDir, plugins, registry, { log: opts.log });\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../cli/src/plugin-store/paths.ts","../cli/src/plugin-store/spec.ts","../cli/src/plugin-store/load.ts","../cli/src/plugin-store/reconcile.ts","../cli/src/plugin-store/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAUO,SAAS,WAAW,UAAA,EAA4B;AACrD,EAAA,OAAO,IAAA,CAAK,UAAA,EAAY,SAAA,EAAW,SAAS,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IAChD;AAAA,EACF;AAEA,EAAA,gBAAA,CAAiB,YAAY,OAAO,CAAA;AAEpC,EAAA,MAAM,OAAA,GAAU,KAAK,UAAA,IAAc,cAAA;AACnC,EAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,UAAA,CAAW,UAAU,CAAC,CAAA;AACnD,EAAA,IAAI,CAAC,OAAO,EAAA,EAAI;AACd,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA;AAAA,EAA2B,MAAA,CAAO,MAAM,CAAA,CAAE,CAAA;AAAA,EAC5D;AAEA,EAAA,aAAA,CAAc,UAAU,QAAQ,CAAA;AAChC,EAAA,OAAO,EAAE,OAAA,EAAS,IAAA,EAAM,MAAA,EAAQ,YAAA,EAAa;AAC/C;;;ACxFA,eAAsB,oBACpB,UAAA,EACA,OAAA,EACA,WAA2B,cAAA,EAC3B,IAAA,GAA6B,EAAC,EACT;AACrB,EAAA,IAAI,CAAC,OAAA,IAAW,OAAA,CAAQ,MAAA,KAAW,CAAA,EAAG;AACpC,IAAA,OAAO,EAAE,MAAA,EAAQ,EAAC,EAAG,MAAA,EAAQ,EAAC,EAAE;AAAA,EAClC;AACA,EAAA,MAAM,gBAAA,CAAiB,UAAA,EAAY,OAAA,EAAS,IAAI,CAAA;AAChD,EAAA,OAAO,WAAA,CAAY,YAAY,OAAA,EAAS,QAAA,EAAU,EAAE,GAAA,EAAK,IAAA,CAAK,KAAK,CAAA;AACrE","file":"plugin-store-MPAMD5OT.js","sourcesContent":["/**\n * Pure path helpers for the project-local plugin store.\n *\n * The store is a self-contained npm workspace owned by the CLI under\n * `<projectDir>/.skaile/plugins/`. Nothing here touches the filesystem.\n */\n\nimport { join } from \"node:path\";\n\n/** `<projectDir>/.skaile/plugins` — the store root. */\nexport function pluginsDir(projectDir: string): string {\n return join(projectDir, \".skaile\", \"plugins\");\n}\n\n/** `<store>/package.json` — generated, never user-edited. */\nexport function pluginsPkgJson(projectDir: string): string {\n return join(pluginsDir(projectDir), \"package.json\");\n}\n\n/** `<store>/node_modules` — where reconciled plugin packages land. */\nexport function nodeModulesDir(projectDir: string): string {\n return join(pluginsDir(projectDir), \"node_modules\");\n}\n\n/** `<store>/.reconcile-hash` — SHA of plugins-list + lock slice; skip reinstall when unchanged. */\nexport function reconcileHashFile(projectDir: string): string {\n return join(pluginsDir(projectDir), \".reconcile-hash\");\n}\n\n/**\n * Absolute path to a plugin package's entry directory under the store's\n * `node_modules`. Dynamic `import()` against this absolute path works inside\n * compiled binaries via `pathToFileURL`.\n */\nexport function resolvePluginEntry(projectDir: string, pkgName: string): string {\n return join(nodeModulesDir(projectDir), pkgName);\n}\n","/**\n * Parse npm package specifiers from the `plugins:` list into name + range.\n *\n * The leading `@` of a scope is NOT a separator: only the last `@` at a\n * non-zero index splits the package name from its semver range.\n * \"@skaile/provider-fly@^0.1.0\" → { name: \"@skaile/provider-fly\", range: \"^0.1.0\" }\n * \"@skaile/connector-redis\" → { name: \"@skaile/connector-redis\", range: \"*\" }\n * \"lodash@^4\" → { name: \"lodash\", range: \"^4\" }\n */\n\n/** A parsed plugin specifier: package name plus a semver range (`\"*\"` when omitted). */\nexport interface PluginSpec {\n name: string;\n range: string;\n}\n\n/**\n * Parse a single plugin specifier into `{ name, range }`.\n *\n * @param spec - An npm specifier, e.g. `\"@skaile/provider-fly@^0.1.0\"` or `\"lodash\"`.\n * @returns The package name and semver range (range defaults to `\"*\"`).\n * @throws Error when the specifier is empty.\n */\nexport function parseSpec(spec: string): PluginSpec {\n const trimmed = spec.trim();\n if (!trimmed) throw new Error(\"parseSpec: empty specifier\");\n\n // Find the version-separating `@` — the last one that is not the scope `@`\n // at index 0. A bare `@scope/name` has its only `@` at index 0 (no range).\n const at = trimmed.lastIndexOf(\"@\");\n if (at <= 0) {\n return { name: trimmed, range: \"*\" };\n }\n const name = trimmed.slice(0, at);\n const range = trimmed.slice(at + 1);\n return { name, range: range.length > 0 ? range : \"*\" };\n}\n\n/** Convenience: just the package name of a specifier. */\nexport function specName(spec: string): string {\n return parseSpec(spec).name;\n}\n","/**\n * Runtime plugin loader: dynamic-import each reconciled plugin and let it\n * self-register into the `pluginRegistry`.\n *\n * Each plugin specifier resolves to an absolute path under the store's\n * `node_modules`; we import it via a `file://` URL so the import works inside\n * `bun --compile` binaries (which bundle only the literal-string switches, but\n * can still execute a `file://` import against the unpacked store on disk).\n * Failures are caught per-plugin so one broken plugin never aborts the rest.\n */\n\nimport { pathToFileURL } from \"node:url\";\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { resolvePluginEntry } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/** Options for {@link loadPlugins}. */\nexport interface LoadOptions {\n log?: Logger;\n}\n\n/** Result of a load pass: which specs registered and which failed. */\nexport interface LoadResult {\n loaded: string[];\n failed: { spec: string; error: string }[];\n}\n\n/** The self-registration entrypoint a plugin module is expected to export. */\ntype PluginModule = { register?: (registry: PluginRegistry) => void };\n\n/**\n * Load and register each plugin in `plugins` into `registry`.\n *\n * @param projectDir - Project root holding `.skaile/plugins/node_modules`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param registry - Registry to register into. Defaults to the process-wide `pluginRegistry`.\n * @param opts - Optional logger.\n * @returns Loaded specs + per-plugin failures (never throws).\n */\nexport async function loadPlugins(\n projectDir: string,\n plugins: string[],\n registry: PluginRegistry = pluginRegistry,\n opts: LoadOptions = {},\n): Promise<LoadResult> {\n const loaded: string[] = [];\n const failed: { spec: string; error: string }[] = [];\n\n for (const spec of plugins) {\n try {\n const { name } = parseSpec(spec);\n const entry = resolvePluginEntry(projectDir, name);\n const mod = (await import(pathToFileURL(entry).href)) as PluginModule;\n if (typeof mod.register !== \"function\") {\n throw new Error(`plugin \"${name}\" does not export a register() function`);\n }\n mod.register(registry);\n loaded.push(spec);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n failed.push({ spec, error: `failed to load plugin \"${spec}\": ${message}` });\n opts.log?.warn(`plugin load failed: ${spec}`, { error: message });\n }\n }\n\n return { loaded, failed };\n}\n","/**\n * Reconcile the project-local plugin store (`<projectDir>/.skaile/plugins/`).\n *\n * The reconciler is hash-skipped: it computes a SHA-256 over the sorted plugin\n * list plus the lock file's `plugins` slice and compares it to the stored\n * `.reconcile-hash`. On a match it returns with zero further I/O; otherwise it\n * regenerates the store's `package.json` and runs `bun install` against it.\n *\n * The install step is injectable (`InstallFn`) so tests stay hermetic — they\n * pass a fake installer that records calls and writes a stub `node_modules`.\n */\n\nimport { createHash } from \"node:crypto\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { readPluginsLockSlice } from \"@skaile/workspaces/core\";\nimport { pluginsDir, pluginsPkgJson, reconcileHashFile } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/**\n * Installs the store's dependencies. Returns `ok: false` (never throws) on a\n * failed install so the reconciler can surface the captured `output`.\n */\nexport type InstallFn = (pluginsDir: string) => Promise<{ ok: boolean; output: string }>;\n\n/** Options for {@link reconcilePlugins}. */\nexport interface ReconcileOptions {\n /** Injectable installer. Defaults to a real `bun install` of the store. */\n runInstall?: InstallFn;\n /**\n * Lock slice to fold into the reconcile-hash. Defaults to\n * `readPluginsLockSlice(projectDir)` so a lock edit invalidates the hash.\n */\n lockSlice?: unknown;\n}\n\n/** Result of a reconcile pass. */\nexport interface ReconcileResult {\n changed: boolean;\n reason: \"no-plugins\" | \"up-to-date\" | \"reconciled\";\n}\n\n/**\n * The default real installer: `bun install` inside the store directory.\n * Frozen on subsequent runs (a `bun.lock`/`bun.lockb` already exists), and\n * non-frozen on the first run so a lock can be generated.\n */\nexport const defaultInstall: InstallFn = async (dir) => {\n const { portableSpawn } = await import(\"@skaile/workspaces/core\");\n const hasLock =\n existsSync(`${dir}/bun.lock`) ||\n existsSync(`${dir}/bun.lockb`) ||\n existsSync(`${dir}/package-lock.json`);\n const args = hasLock ? [\"bun\", \"install\", \"--frozen-lockfile\"] : [\"bun\", \"install\"];\n const proc = portableSpawn(args, { cwd: dir });\n const chunks: string[] = [];\n const decoder = new TextDecoder();\n const pump = async (stream: ReadableStream<Uint8Array>) => {\n const reader = stream.getReader();\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n if (value) chunks.push(decoder.decode(value, { stream: true }));\n }\n };\n await Promise.all([pump(proc.stdout), pump(proc.stderr)]);\n const code = await proc.exited;\n return { ok: code === 0, output: chunks.join(\"\") };\n};\n\n/** Generate the store's `package.json` from the plugin specs. */\nfunction writePackageJson(projectDir: string, plugins: string[]): void {\n const dependencies: Record<string, string> = {};\n for (const spec of plugins) {\n const { name, range } = parseSpec(spec);\n dependencies[name] = range;\n }\n const pkg = {\n name: \"skaile-project-plugins\",\n private: true,\n dependencies,\n };\n mkdirSync(pluginsDir(projectDir), { recursive: true });\n writeFileSync(pluginsPkgJson(projectDir), `${JSON.stringify(pkg, null, 2)}\\n`);\n}\n\n/**\n * Reconcile the plugin store for a project.\n *\n * @param projectDir - Project root containing `skaile.yaml` / `skaile.lock.yaml`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param opts - Optional injectable installer + lock slice override.\n * @returns Whether the store changed and why.\n */\nexport async function reconcilePlugins(\n projectDir: string,\n plugins: string[],\n opts: ReconcileOptions = {},\n): Promise<ReconcileResult> {\n if (plugins.length === 0) {\n return { changed: false, reason: \"no-plugins\" };\n }\n\n const lockSlice = opts.lockSlice ?? readPluginsLockSlice(projectDir);\n const wantHash = createHash(\"sha256\")\n .update(JSON.stringify({ plugins: [...plugins].sort(), lock: lockSlice }))\n .digest(\"hex\");\n\n const hashFile = reconcileHashFile(projectDir);\n if (existsSync(hashFile)) {\n const have = readFileSync(hashFile, \"utf8\").trim();\n if (have === wantHash) {\n return { changed: false, reason: \"up-to-date\" };\n }\n }\n\n writePackageJson(projectDir, plugins);\n\n const install = opts.runInstall ?? defaultInstall;\n const result = await install(pluginsDir(projectDir));\n if (!result.ok) {\n throw new Error(`plugin install failed:\\n${result.output}`);\n }\n\n writeFileSync(hashFile, wantHash);\n return { changed: true, reason: \"reconciled\" };\n}\n","/**\n * The project-local plugin store: reconcile (`<projectDir>/.skaile/plugins/`)\n * then load the reconciled plugins into the `pluginRegistry`.\n *\n * `ensurePluginsLoaded` is the single entrypoint commands wire in. It is a\n * guarded no-op when `plugins` is empty/undefined — zero overhead for the\n * common case where no project declares `plugins:` in `skaile.yaml`.\n */\n\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { type LoadResult, loadPlugins } from \"./load.js\";\nimport { type ReconcileOptions, reconcilePlugins } from \"./reconcile.js\";\n\nexport type { LoadResult } from \"./load.js\";\nexport { loadPlugins } from \"./load.js\";\nexport type { ReconcileOptions } from \"./reconcile.js\";\nexport { reconcilePlugins } from \"./reconcile.js\";\nexport { specName } from \"./spec.js\";\n\n/** Options for {@link ensurePluginsLoaded}. */\nexport interface EnsurePluginsOptions extends ReconcileOptions {\n log?: Logger;\n}\n\n/**\n * Reconcile the plugin store then load each plugin into `registry`.\n *\n * No-op (returns immediately) when `plugins` is empty/undefined, so the common\n * no-plugins path costs nothing.\n *\n * @param projectDir - Project root.\n * @param plugins - The `skaile.yaml` `plugins:` list (may be undefined).\n * @param registry - Registry to register into. Defaults to `pluginRegistry`.\n * @param opts - Injectable installer / lock slice + optional logger.\n * @returns The load result, or an empty result when there are no plugins.\n */\nexport async function ensurePluginsLoaded(\n projectDir: string,\n plugins: string[] | undefined,\n registry: PluginRegistry = pluginRegistry,\n opts: EnsurePluginsOptions = {},\n): Promise<LoadResult> {\n if (!plugins || plugins.length === 0) {\n return { loaded: [], failed: [] };\n }\n await reconcilePlugins(projectDir, plugins, opts);\n return loadPlugins(projectDir, plugins, registry, { log: opts.log });\n}\n"]}
|