@skaile/workspaces 5.15.0 → 5.16.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 +60 -0
- package/dist/{asset-feeds-LIDC7547.js → asset-feeds-BELBSJEE.js} +18 -18
- package/dist/{asset-feeds-LIDC7547.js.map → asset-feeds-BELBSJEE.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +7 -7
- package/dist/asset-manager/index.js +13 -13
- package/dist/asset-manager/installer.js +9 -9
- package/dist/asset-manager/renderers.js +8 -8
- package/dist/asset-manager/src/index.d.ts +105 -6
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/asset-manager/src/installer.d.ts +11 -2
- package/dist/asset-manager/src/installer.d.ts.map +1 -1
- package/dist/asset-manager/src/mcp-config.d.ts.map +1 -1
- package/dist/bridge/drivers/claude-sdk.js +150 -19
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +15 -128
- package/dist/bridge/drivers/codex.js.map +1 -1
- package/dist/bridge/drivers/continue.js +10 -10
- package/dist/bridge/drivers/echo.js +2 -2
- package/dist/bridge/drivers/gemini.js +7 -7
- package/dist/bridge/drivers/goose.js +10 -10
- package/dist/bridge/drivers/omp.js +61 -5
- package/dist/bridge/drivers/omp.js.map +1 -1
- package/dist/bridge/drivers/opencode.js +10 -10
- package/dist/bridge/drivers/qwen.js +7 -7
- package/dist/bridge/index.js +13 -12
- package/dist/bridge/src/approval-card.d.ts +24 -0
- package/dist/bridge/src/approval-card.d.ts.map +1 -0
- package/dist/bridge/src/driver-model-check.d.ts +21 -0
- package/dist/bridge/src/driver-model-check.d.ts.map +1 -0
- package/dist/bridge/src/drivers/claude-sdk.d.ts +22 -0
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/drivers/omp-models-yml.d.ts.map +1 -1
- package/dist/bridge/src/drivers/omp.d.ts.map +1 -1
- package/dist/bridge/src/index.d.ts +2 -0
- package/dist/bridge/src/index.d.ts.map +1 -1
- package/dist/bridge/src/types.d.ts +23 -0
- package/dist/bridge/src/types.d.ts.map +1 -1
- package/dist/{chunk-YUURCZWY.js → chunk-2SKPPIV7.js} +5 -5
- package/dist/{chunk-YUURCZWY.js.map → chunk-2SKPPIV7.js.map} +1 -1
- package/dist/{chunk-PK5XQBOC.js → chunk-46IRZJV4.js} +4 -4
- package/dist/{chunk-PK5XQBOC.js.map → chunk-46IRZJV4.js.map} +1 -1
- package/dist/{chunk-AXNX2SKZ.js → chunk-5CE6J4DB.js} +46 -67
- package/dist/chunk-5CE6J4DB.js.map +1 -0
- package/dist/{chunk-54TVXZP3.js → chunk-5DCOG5B5.js} +3 -3
- package/dist/{chunk-54TVXZP3.js.map → chunk-5DCOG5B5.js.map} +1 -1
- package/dist/{chunk-X7DIT65W.js → chunk-5RDZ5JHH.js} +4 -4
- package/dist/{chunk-X7DIT65W.js.map → chunk-5RDZ5JHH.js.map} +1 -1
- package/dist/{chunk-BV7NLPI6.js → chunk-6GSE63K2.js} +4 -4
- package/dist/{chunk-BV7NLPI6.js.map → chunk-6GSE63K2.js.map} +1 -1
- package/dist/{chunk-GQ5OYFVD.js → chunk-6Q7NKTDG.js} +47 -47
- package/dist/chunk-6Q7NKTDG.js.map +1 -0
- package/dist/chunk-6RTEUWXX.js +125 -0
- package/dist/chunk-6RTEUWXX.js.map +1 -0
- package/dist/{chunk-RTYDYSUV.js → chunk-72KZJE3G.js} +82 -22
- package/dist/chunk-72KZJE3G.js.map +1 -0
- package/dist/{chunk-SAKVAG23.js → chunk-A26MUUN7.js} +7 -7
- package/dist/{chunk-SAKVAG23.js.map → chunk-A26MUUN7.js.map} +1 -1
- package/dist/{chunk-KUB4HFGK.js → chunk-A7AZ3RL5.js} +6 -6
- package/dist/{chunk-KUB4HFGK.js.map → chunk-A7AZ3RL5.js.map} +1 -1
- package/dist/{chunk-LEOXPIC6.js → chunk-AP24HESN.js} +3 -3
- package/dist/{chunk-LEOXPIC6.js.map → chunk-AP24HESN.js.map} +1 -1
- package/dist/{chunk-SRKU7QUG.js → chunk-CQFVKN6S.js} +230 -62
- package/dist/chunk-CQFVKN6S.js.map +1 -0
- package/dist/{chunk-OOQ5Q75W.js → chunk-D3PU3C6F.js} +41 -16
- package/dist/chunk-D3PU3C6F.js.map +1 -0
- package/dist/{chunk-WXKNM2JJ.js → chunk-D5REDKVU.js} +3 -3
- package/dist/{chunk-WXKNM2JJ.js.map → chunk-D5REDKVU.js.map} +1 -1
- package/dist/{chunk-XX4C72CC.js → chunk-DADAZLFW.js} +648 -76
- package/dist/chunk-DADAZLFW.js.map +1 -0
- package/dist/{chunk-AVUJBSFA.js → chunk-DQOAPR4M.js} +2 -2
- package/dist/{chunk-AVUJBSFA.js.map → chunk-DQOAPR4M.js.map} +1 -1
- package/dist/{chunk-SCUEPCSJ.js → chunk-E634MBP6.js} +12 -9
- package/dist/chunk-E634MBP6.js.map +1 -0
- package/dist/{chunk-NKDSU4Q7.js → chunk-ES6ARJPQ.js} +21 -7
- package/dist/chunk-ES6ARJPQ.js.map +1 -0
- package/dist/{chunk-WWUWMOX2.js → chunk-FSLVMZXR.js} +37 -17
- package/dist/chunk-FSLVMZXR.js.map +1 -0
- package/dist/{chunk-MKTJZLQM.js → chunk-FSSRBWYL.js} +4 -4
- package/dist/{chunk-MKTJZLQM.js.map → chunk-FSSRBWYL.js.map} +1 -1
- package/dist/{chunk-VY6NTFE7.js → chunk-FT4ZHLYR.js} +3 -2
- package/dist/chunk-FT4ZHLYR.js.map +1 -0
- package/dist/chunk-FWAJUWXQ.js +1016 -0
- package/dist/chunk-FWAJUWXQ.js.map +1 -0
- package/dist/{chunk-ANSZULXH.js → chunk-H7R7R5BN.js} +21 -6
- package/dist/chunk-H7R7R5BN.js.map +1 -0
- package/dist/{chunk-4AKR4XPQ.js → chunk-HG52NGAV.js} +3 -3
- package/dist/chunk-HG52NGAV.js.map +1 -0
- package/dist/{plugin-store-BIITCNOZ.js → chunk-HUKUYWBJ.js} +32 -23
- package/dist/chunk-HUKUYWBJ.js.map +1 -0
- package/dist/{chunk-D2MZZ2KB.js → chunk-ISSYT5AZ.js} +3 -3
- package/dist/{chunk-D2MZZ2KB.js.map → chunk-ISSYT5AZ.js.map} +1 -1
- package/dist/{chunk-2LTF2ZHH.js → chunk-J4RRH2NP.js} +4 -4
- package/dist/{chunk-2LTF2ZHH.js.map → chunk-J4RRH2NP.js.map} +1 -1
- package/dist/{chunk-NOF73BUH.js → chunk-L6UMSKDF.js} +10 -2
- package/dist/chunk-L6UMSKDF.js.map +1 -0
- package/dist/{chunk-TCWECSEB.js → chunk-NSNM2ZXF.js} +28 -4
- package/dist/chunk-NSNM2ZXF.js.map +1 -0
- package/dist/{chunk-QR7W5JV4.js → chunk-OHNNCXMB.js} +114 -81
- package/dist/chunk-OHNNCXMB.js.map +1 -0
- package/dist/{chunk-DP6YRAPZ.js → chunk-OJHPG6HK.js} +57 -13
- package/dist/chunk-OJHPG6HK.js.map +1 -0
- package/dist/{chunk-SZPE55SB.js → chunk-PGZDSDOB.js} +3 -3
- package/dist/{chunk-SZPE55SB.js.map → chunk-PGZDSDOB.js.map} +1 -1
- package/dist/{chunk-4QINFQ27.js → chunk-PIC23DDE.js} +59 -17
- package/dist/chunk-PIC23DDE.js.map +1 -0
- package/dist/{chunk-GLMKS6V6.js → chunk-RTNWU2UD.js} +4 -4
- package/dist/{chunk-GLMKS6V6.js.map → chunk-RTNWU2UD.js.map} +1 -1
- package/dist/{chunk-YL23KWBX.js → chunk-SAGBVBY2.js} +5 -5
- package/dist/{chunk-YL23KWBX.js.map → chunk-SAGBVBY2.js.map} +1 -1
- package/dist/{chunk-JHP6MIW2.js → chunk-SMUIYYCH.js} +70 -34
- package/dist/chunk-SMUIYYCH.js.map +1 -0
- package/dist/{chunk-N36S36OZ.js → chunk-SPV2CXJ3.js} +3 -3
- package/dist/{chunk-N36S36OZ.js.map → chunk-SPV2CXJ3.js.map} +1 -1
- package/dist/{chunk-KRRHADE7.js → chunk-SXWGLW23.js} +4 -4
- package/dist/{chunk-KRRHADE7.js.map → chunk-SXWGLW23.js.map} +1 -1
- package/dist/{chunk-74THIMZV.js → chunk-TADJCATD.js} +3 -3
- package/dist/{chunk-74THIMZV.js.map → chunk-TADJCATD.js.map} +1 -1
- package/dist/{chunk-PQF5QHVS.js → chunk-TKI7YDWE.js} +19 -5
- package/dist/chunk-TKI7YDWE.js.map +1 -0
- package/dist/{chunk-O673TBWJ.js → chunk-TXGVG7VH.js} +3 -3
- package/dist/{chunk-O673TBWJ.js.map → chunk-TXGVG7VH.js.map} +1 -1
- package/dist/{chunk-PIDMOE7R.js → chunk-VJ2DZLDM.js} +62 -6
- package/dist/chunk-VJ2DZLDM.js.map +1 -0
- package/dist/{chunk-PV47EEHD.js → chunk-WKEBNB5S.js} +4 -4
- package/dist/{chunk-PV47EEHD.js.map → chunk-WKEBNB5S.js.map} +1 -1
- package/dist/{chunk-ESXZJP4M.js → chunk-WXWQNJCT.js} +3 -3
- package/dist/{chunk-ESXZJP4M.js.map → chunk-WXWQNJCT.js.map} +1 -1
- package/dist/{chunk-DPCEQOIZ.js → chunk-XGR7IDTY.js} +3 -3
- package/dist/{chunk-DPCEQOIZ.js.map → chunk-XGR7IDTY.js.map} +1 -1
- package/dist/{chunk-I3JO3NIZ.js → chunk-Y25V2MW2.js} +4 -4
- package/dist/{chunk-I3JO3NIZ.js.map → chunk-Y25V2MW2.js.map} +1 -1
- package/dist/{chunk-MGM5EJQQ.js → chunk-YK3XLEQJ.js} +40 -26
- package/dist/chunk-YK3XLEQJ.js.map +1 -0
- package/dist/{chunk-SP5NGNBV.js → chunk-YW2BNDSE.js} +11 -4
- package/dist/chunk-YW2BNDSE.js.map +1 -0
- package/dist/{chunk-J76LDUDS.js → chunk-ZVZTCDUN.js} +26 -10
- package/dist/chunk-ZVZTCDUN.js.map +1 -0
- package/dist/cli/index.js +899 -1617
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/agent-checks.d.ts +22 -10
- package/dist/cli/src/agent-checks.d.ts.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/config.d.ts.map +1 -1
- package/dist/cli/src/commands/integration.d.ts.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/library-index.d.ts +6 -0
- package/dist/cli/src/commands/library-index.d.ts.map +1 -1
- package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
- package/dist/cli/src/commands/outdated.d.ts.map +1 -1
- package/dist/cli/src/commands/plugin/codex.d.ts +10 -0
- package/dist/cli/src/commands/plugin/codex.d.ts.map +1 -1
- package/dist/cli/src/commands/plugin/types.d.ts +5 -2
- package/dist/cli/src/commands/plugin/types.d.ts.map +1 -1
- package/dist/cli/src/commands/preset-export.d.ts.map +1 -1
- package/dist/cli/src/commands/project.d.ts +6 -0
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/cli/src/commands/rebuild.d.ts.map +1 -1
- package/dist/cli/src/commands/run.d.ts.map +1 -1
- package/dist/cli/src/commands/serve-preflight.d.ts +13 -0
- package/dist/cli/src/commands/serve-preflight.d.ts.map +1 -1
- package/dist/cli/src/commands/serve.d.ts.map +1 -1
- package/dist/cli/src/commands/show.d.ts.map +1 -1
- package/dist/cli/src/commands/source.d.ts +2 -1
- package/dist/cli/src/commands/source.d.ts.map +1 -1
- package/dist/cli/src/commands/store.d.ts.map +1 -1
- package/dist/cli/src/commands/update.d.ts.map +1 -1
- package/dist/cli/src/commands/validate.d.ts +6 -1
- package/dist/cli/src/commands/validate.d.ts.map +1 -1
- package/dist/cli/src/commands/verify.d.ts.map +1 -1
- package/dist/cli/src/helpers.d.ts +23 -0
- package/dist/cli/src/helpers.d.ts.map +1 -1
- package/dist/cli/src/plugin-store/index.d.ts +8 -0
- package/dist/cli/src/plugin-store/index.d.ts.map +1 -1
- package/dist/cli/src/plugin-store/load.d.ts +1 -0
- package/dist/cli/src/plugin-store/load.d.ts.map +1 -1
- package/dist/cli/src/skill-checks.d.ts +9 -21
- package/dist/cli/src/skill-checks.d.ts.map +1 -1
- package/dist/connectors/config.js +5 -5
- package/dist/connectors/index.js +16 -15
- package/dist/{connectors-JQR5RAMC.js → connectors-44RE2QEM.js} +19 -18
- package/dist/{connectors-JQR5RAMC.js.map → connectors-44RE2QEM.js.map} +1 -1
- package/dist/core/index.js +6 -6
- package/dist/core/manifest.js +2 -2
- package/dist/core/models.js +1 -1
- package/dist/core/publish-manifest.js +3 -3
- package/dist/core/ref.js +1 -1
- package/dist/core/runtime-assets.js +5 -5
- package/dist/core/src/conformance.d.ts.map +1 -1
- package/dist/core/src/driver-sdk.d.ts +12 -2
- package/dist/core/src/driver-sdk.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 +7 -0
- package/dist/core/src/lock.d.ts.map +1 -1
- package/dist/core/src/manifest.d.ts +9 -0
- package/dist/core/src/manifest.d.ts.map +1 -1
- package/dist/core/src/models.d.ts.map +1 -1
- package/dist/core/src/publish-manifest.d.ts +5 -2
- package/dist/core/src/publish-manifest.d.ts.map +1 -1
- package/dist/core/src/repo-manager.d.ts +14 -0
- package/dist/core/src/repo-manager.d.ts.map +1 -1
- package/dist/core/workspace-config.js +4 -4
- package/dist/deploy/index.js +6 -6
- package/dist/discovery/index.js +5 -5
- package/dist/discovery/src/index.d.ts +2 -2
- package/dist/discovery/src/index.d.ts.map +1 -1
- package/dist/discovery/src/parse-manifest.d.ts +7 -0
- package/dist/discovery/src/parse-manifest.d.ts.map +1 -1
- package/dist/discovery/src/source-config.d.ts +6 -0
- package/dist/discovery/src/source-config.d.ts.map +1 -1
- package/dist/{ensure-sources-NAGBSMJE.js → ensure-sources-R6AHZ7RV.js} +16 -16
- package/dist/{ensure-sources-NAGBSMJE.js.map → ensure-sources-R6AHZ7RV.js.map} +1 -1
- package/dist/factory-assets/README.md +1 -1
- package/dist/factory-assets/connectors/box.js +16 -15
- package/dist/factory-assets/connectors/deploy.js +16 -15
- package/dist/factory-assets/connectors/devserver.js +16 -15
- package/dist/factory-assets/connectors/flow/adapter.js +16 -15
- package/dist/factory-assets/connectors/flow/engine.js +7 -7
- package/dist/factory-assets/connectors/flow/run-flow.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.js +18 -17
- package/dist/factory-assets/connectors/flow.js +16 -15
- package/dist/factory-assets/connectors/git/CONNECTOR.md +1 -0
- package/dist/factory-assets/connectors/git/lifecycle.d.ts.map +1 -1
- package/dist/factory-assets/connectors/git/repo.d.ts +17 -3
- package/dist/factory-assets/connectors/git/repo.d.ts.map +1 -1
- package/dist/factory-assets/connectors/git.js +16 -15
- package/dist/factory-assets/connectors/gmail.js +16 -15
- package/dist/factory-assets/connectors/googledrive.js +16 -15
- package/dist/factory-assets/connectors/local.js +16 -15
- package/dist/factory-assets/connectors/mattermost.js +16 -15
- package/dist/factory-assets/connectors/memory.js +16 -15
- package/dist/factory-assets/connectors/minio.js +16 -15
- package/dist/factory-assets/connectors/postgres.js +16 -15
- package/dist/factory-assets/connectors/s3.js +16 -15
- package/dist/factory-assets/connectors/sharepoint.js +16 -15
- package/dist/factory-assets/connectors/sqlite.js +16 -15
- package/dist/factory-assets/connectors/static-server.js +16 -15
- package/dist/factory-assets/connectors/tunnel.js +16 -15
- package/dist/factory-assets/connectors/webdav.js +16 -15
- package/dist/factory-assets/connectors/xstate-store.js +16 -15
- package/dist/factory-assets/connectors/xstate.js +16 -15
- package/dist/factory-assets/skills/authoring-skaile-assets/SKILL.md +12 -11
- package/dist/factory-assets/skills/authoring-skaile-manifests/SKILL.md +11 -7
- package/dist/factory-assets/skills/skailify/SKILL.md +3 -3
- package/dist/{flows-CYJI3URW.js → flows-YKC53LDP.js} +11 -11
- package/dist/{flows-CYJI3URW.js.map → flows-YKC53LDP.js.map} +1 -1
- package/dist/{helpers-XFHJDJOA.js → helpers-FNQL5PI7.js} +16 -16
- package/dist/{helpers-XFHJDJOA.js.map → helpers-FNQL5PI7.js.map} +1 -1
- package/dist/library/index.js +10 -10
- package/dist/library/install.js +4 -4
- package/dist/library/src/index.d.ts +1 -1
- package/dist/library/src/index.d.ts.map +1 -1
- package/dist/library/src/local/store-paths.d.ts +8 -0
- package/dist/library/src/local/store-paths.d.ts.map +1 -1
- package/dist/library/src/manifest-writer.d.ts +5 -1
- package/dist/library/src/manifest-writer.d.ts.map +1 -1
- package/dist/library/src/remote/remote-catalog-source.d.ts +3 -2
- package/dist/library/src/remote/remote-catalog-source.d.ts.map +1 -1
- package/dist/{library-publish-FC3ZABR2.js → library-publish-GHPVY42Y.js} +56 -48
- package/dist/library-publish-GHPVY42Y.js.map +1 -0
- package/dist/model-endpoint/index.js +19 -3
- package/dist/model-endpoint/src/index.d.ts +1 -1
- package/dist/model-endpoint/src/index.d.ts.map +1 -1
- package/dist/model-endpoint/src/resolve.d.ts +5 -0
- package/dist/model-endpoint/src/resolve.d.ts.map +1 -1
- package/dist/model-endpoint/src/server.d.ts +7 -0
- package/dist/model-endpoint/src/server.d.ts.map +1 -1
- package/dist/model-endpoint/src/types.d.ts +41 -7
- package/dist/model-endpoint/src/types.d.ts.map +1 -1
- package/dist/{open-library-5ET7SAJC.js → open-library-YSUGNP36.js} +19 -19
- package/dist/{open-library-5ET7SAJC.js.map → open-library-YSUGNP36.js.map} +1 -1
- package/dist/{open-registry-X6YQVP7V.js → open-registry-YPRQDUMK.js} +14 -14
- package/dist/{open-registry-X6YQVP7V.js.map → open-registry-YPRQDUMK.js.map} +1 -1
- package/dist/{paths-NXWIBZCX.js → paths-P55DTBEK.js} +9 -9
- package/dist/{paths-NXWIBZCX.js.map → paths-P55DTBEK.js.map} +1 -1
- package/dist/plugin-store-IPIBZRBX.js +23 -0
- package/dist/plugin-store-IPIBZRBX.js.map +1 -0
- package/dist/project-NDSLXERO.js +83 -0
- package/dist/{project-2UXHSVVA.js.map → project-NDSLXERO.js.map} +1 -1
- package/dist/resolver/index.js +7 -7
- package/dist/resolver/src/types.d.ts +1 -0
- package/dist/resolver/src/types.d.ts.map +1 -1
- package/dist/resolver/src/validator.d.ts +1 -1
- package/dist/runner/index.js +32 -31
- package/dist/runner/src/agent.d.ts +9 -1
- package/dist/runner/src/agent.d.ts.map +1 -1
- package/dist/runner/src/agents/in-process-host.d.ts.map +1 -1
- package/dist/runner/src/composition/content-source.d.ts.map +1 -1
- package/dist/runner/src/composition/index.d.ts +1 -1
- package/dist/runner/src/composition/index.d.ts.map +1 -1
- package/dist/runner/src/composition/resolve-instance.d.ts +20 -0
- package/dist/runner/src/composition/resolve-instance.d.ts.map +1 -1
- package/dist/runner/src/model-endpoint-discovery.d.ts.map +1 -1
- package/dist/runner/src/resource-handler.d.ts.map +1 -1
- package/dist/runner/src/runner-capabilities.d.ts +9 -3
- package/dist/runner/src/runner-capabilities.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts +10 -0
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts +20 -1
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/runner/src/session-capability-wiring.d.ts +5 -0
- package/dist/runner/src/session-capability-wiring.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +13 -13
- package/dist/sdk/bridge.js +13 -12
- package/dist/sdk/core.js +6 -6
- package/dist/sdk/flow.js +7 -7
- package/dist/sdk/index.js +32 -31
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/resolver.js +7 -7
- package/dist/sdk/runner.js +32 -31
- package/dist/sdk/transport/ws/server.js +1 -1
- package/dist/sdk/transport/ws.js +1 -1
- package/dist/sdk/transport.js +1 -1
- package/dist/{serve-preflight-GD7IQFA3.js → serve-preflight-ON2LS3SD.js} +15 -9
- package/dist/serve-preflight-ON2LS3SD.js.map +1 -0
- package/dist/{setup-IKH4R7UN.js → setup-MFPEQS2I.js} +23 -22
- package/dist/setup-MFPEQS2I.js.map +1 -0
- package/dist/{skills-XVHOXOOH.js → skills-7G6QCDEM.js} +12 -12
- package/dist/{skills-XVHOXOOH.js.map → skills-7G6QCDEM.js.map} +1 -1
- package/dist/{source-M6IARYNO.js → source-4QVRD5NV.js} +42 -41
- package/dist/{source-M6IARYNO.js.map → source-4QVRD5NV.js.map} +1 -1
- package/dist/{source-manifest-publish-UP2IS2QW.js → source-manifest-publish-ZIO24GUM.js} +44 -43
- package/dist/source-manifest-publish-ZIO24GUM.js.map +1 -0
- package/dist/transport/index.js +1 -1
- package/dist/transport/src/ws/server.d.ts +9 -0
- package/dist/transport/src/ws/server.d.ts.map +1 -1
- package/dist/transport/ws/server.js +1 -1
- package/dist/transport/ws.js +1 -1
- package/dist/tui/index.js +107 -41
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/src/repl-session.d.ts +7 -0
- package/dist/tui/src/repl-session.d.ts.map +1 -1
- package/dist/tui/src/repl.d.ts +16 -0
- package/dist/tui/src/repl.d.ts.map +1 -1
- package/dist/types/manifests.js +1 -1
- package/dist/types/src/manifests/index.d.ts +1 -0
- package/dist/types/src/manifests/index.d.ts.map +1 -1
- package/dist/types/src/manifests/scaffold-body.d.ts +8 -0
- package/dist/types/src/manifests/scaffold-body.d.ts.map +1 -0
- package/dist/workspace-plugin/adapters/mcp.js +23 -22
- package/dist/workspace-plugin/adapters/omp.js +14 -14
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-4AKR4XPQ.js.map +0 -1
- package/dist/chunk-4QINFQ27.js.map +0 -1
- package/dist/chunk-ANSZULXH.js.map +0 -1
- package/dist/chunk-AXNX2SKZ.js.map +0 -1
- package/dist/chunk-DP6YRAPZ.js.map +0 -1
- package/dist/chunk-GQ5OYFVD.js.map +0 -1
- package/dist/chunk-J76LDUDS.js.map +0 -1
- package/dist/chunk-JHP6MIW2.js.map +0 -1
- package/dist/chunk-MGM5EJQQ.js.map +0 -1
- package/dist/chunk-NKDSU4Q7.js.map +0 -1
- package/dist/chunk-NOF73BUH.js.map +0 -1
- package/dist/chunk-OOQ5Q75W.js.map +0 -1
- package/dist/chunk-PIDMOE7R.js.map +0 -1
- package/dist/chunk-PQF5QHVS.js.map +0 -1
- package/dist/chunk-QR7W5JV4.js.map +0 -1
- package/dist/chunk-RTYDYSUV.js.map +0 -1
- package/dist/chunk-SCUEPCSJ.js.map +0 -1
- package/dist/chunk-SP5NGNBV.js.map +0 -1
- package/dist/chunk-SRKU7QUG.js.map +0 -1
- package/dist/chunk-TCWECSEB.js.map +0 -1
- package/dist/chunk-VY6NTFE7.js.map +0 -1
- package/dist/chunk-WWUWMOX2.js.map +0 -1
- package/dist/chunk-XX4C72CC.js.map +0 -1
- package/dist/library-publish-FC3ZABR2.js.map +0 -1
- package/dist/plugin-store-BIITCNOZ.js.map +0 -1
- package/dist/project-2UXHSVVA.js +0 -82
- package/dist/serve-preflight-GD7IQFA3.js.map +0 -1
- package/dist/setup-IKH4R7UN.js.map +0 -1
- package/dist/source-manifest-publish-UP2IS2QW.js.map +0 -1
|
@@ -0,0 +1,1016 @@
|
|
|
1
|
+
import { registeredAssetKeys, unresolvedManifestDependencies, warnIgnoredDomainFiles, warnLegacyBundleFiles, removedDomainOption, rejectRemovedDomainOption, reportLibrarySymlinks, composeRefContext, assetEntryRef, manifestPublisherProblems, manifestRootProblems, manifestEntryNameProblems, manifestRequiresProblems, findAssetManifestFile, declaredVersion, manifestVersionMismatchMessage, checkAsset, invalidSemverText } from './chunk-5CE6J4DB.js';
|
|
2
|
+
import { AI_RESOURCES } from './chunk-WKEBNB5S.js';
|
|
3
|
+
import { logErr, logInfo, logWarn, logOk } from './chunk-VJ2DZLDM.js';
|
|
4
|
+
import { getKindRegistry } from './chunk-2SKPPIV7.js';
|
|
5
|
+
import { validateFlowVersions } from './chunk-D5REDKVU.js';
|
|
6
|
+
import { loadFlow } from './chunk-SPV2CXJ3.js';
|
|
7
|
+
import { flowSkillVersionPins } from './chunk-7RGTAEG6.js';
|
|
8
|
+
import { missingRootAssets, assertManifestEditable } from './chunk-D3PU3C6F.js';
|
|
9
|
+
import { parseManifestFile } from './chunk-ES6ARJPQ.js';
|
|
10
|
+
import { resolveRuntimeAssets } from './chunk-5RDZ5JHH.js';
|
|
11
|
+
import { decodeSkaileYaml, normalizeAgentInstances, agentBlockKeyDiagnostics, agentInstanceDiagnostics, localConnectorMountDir, isInsideProject, resolveAgentDefinitionDir, AgentRefResolutionError } from './chunk-ZVZTCDUN.js';
|
|
12
|
+
import { SKAILE_MANIFEST_FILENAME, loadSkPublishManifest, isNonAssetPath } from './chunk-H7R7R5BN.js';
|
|
13
|
+
import { readAssetBody } from './chunk-YW2BNDSE.js';
|
|
14
|
+
import { parseAssetRef, isValidAssetName, ASSET_NAME_HINT } from './chunk-FT4ZHLYR.js';
|
|
15
|
+
import { execFileSync } from 'child_process';
|
|
16
|
+
import fs2 from 'fs';
|
|
17
|
+
import path2 from 'path';
|
|
18
|
+
import { Command } from 'commander';
|
|
19
|
+
import { parse } from 'yaml';
|
|
20
|
+
|
|
21
|
+
// cli/src/type-guards.ts
|
|
22
|
+
function isRecord(value) {
|
|
23
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// cli/src/commands/validate-instances.ts
|
|
27
|
+
var AGENT_MANIFEST_FILE = "agent.yaml";
|
|
28
|
+
var TRIGGER_REQUIRED_FIELDS = {
|
|
29
|
+
schedule: ["cron", "prompt"],
|
|
30
|
+
webhook: ["prompt"],
|
|
31
|
+
channel: ["when"],
|
|
32
|
+
event: ["event"]
|
|
33
|
+
};
|
|
34
|
+
var err = (code, message, at) => ({
|
|
35
|
+
code,
|
|
36
|
+
severity: "error",
|
|
37
|
+
message,
|
|
38
|
+
path: at
|
|
39
|
+
});
|
|
40
|
+
function readAssetFacts(manifest) {
|
|
41
|
+
const facts = {
|
|
42
|
+
lifecycle: manifest.lifecycle,
|
|
43
|
+
hasIo: manifest.io !== void 0 && manifest.io !== null,
|
|
44
|
+
connectorSlots: [],
|
|
45
|
+
otherSlots: [],
|
|
46
|
+
triggerIds: []
|
|
47
|
+
};
|
|
48
|
+
for (const item of Array.isArray(manifest.composes) ? manifest.composes : []) {
|
|
49
|
+
if (!isRecord(item) || typeof item.id !== "string") continue;
|
|
50
|
+
(item.kind === "connector" ? facts.connectorSlots : facts.otherSlots).push(item.id);
|
|
51
|
+
}
|
|
52
|
+
for (const t of Array.isArray(manifest.triggers) ? manifest.triggers : []) {
|
|
53
|
+
if (isRecord(t) && typeof t.id === "string") facts.triggerIds.push(t.id);
|
|
54
|
+
}
|
|
55
|
+
return facts;
|
|
56
|
+
}
|
|
57
|
+
function loadAsset(projectDir, id, ref) {
|
|
58
|
+
const at = `agents.${id}.ref`;
|
|
59
|
+
let dir;
|
|
60
|
+
try {
|
|
61
|
+
dir = resolveAgentDefinitionDir(projectDir, ref);
|
|
62
|
+
} catch (e) {
|
|
63
|
+
if (!(e instanceof AgentRefResolutionError)) throw e;
|
|
64
|
+
return { diagnostic: err("agent_ref_unresolved", `agents.${id}: ${e.message}`, at) };
|
|
65
|
+
}
|
|
66
|
+
if (dir === void 0) {
|
|
67
|
+
return {
|
|
68
|
+
diagnostic: err(
|
|
69
|
+
"agent_ref_unresolved",
|
|
70
|
+
`agents.${id}: ref "${ref}" cannot be resolved \u2014 no ai-assets/ directory above the project`,
|
|
71
|
+
at
|
|
72
|
+
)
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
const manifestPath = path2.join(dir, AGENT_MANIFEST_FILE);
|
|
76
|
+
let text;
|
|
77
|
+
try {
|
|
78
|
+
text = fs2.readFileSync(manifestPath, "utf-8");
|
|
79
|
+
} catch {
|
|
80
|
+
return {
|
|
81
|
+
diagnostic: err(
|
|
82
|
+
"agent_ref_unresolved",
|
|
83
|
+
`agents.${id}: ref "${ref}" resolves to ${dir}, which has no ${AGENT_MANIFEST_FILE}`,
|
|
84
|
+
at
|
|
85
|
+
)
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
let manifest;
|
|
89
|
+
try {
|
|
90
|
+
manifest = parse(text);
|
|
91
|
+
} catch (e) {
|
|
92
|
+
return {
|
|
93
|
+
diagnostic: err(
|
|
94
|
+
"agent_manifest_invalid",
|
|
95
|
+
`agents.${id}: ${manifestPath} is not valid YAML: ${e instanceof Error ? e.message : String(e)}`,
|
|
96
|
+
at
|
|
97
|
+
)
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if (!isRecord(manifest)) {
|
|
101
|
+
return {
|
|
102
|
+
diagnostic: err(
|
|
103
|
+
"agent_manifest_invalid",
|
|
104
|
+
`agents.${id}: ${manifestPath} is not a mapping`,
|
|
105
|
+
at
|
|
106
|
+
)
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
return { facts: readAssetFacts(manifest) };
|
|
110
|
+
}
|
|
111
|
+
function checkTriggers(id, triggers, assetTriggerIds) {
|
|
112
|
+
const out = [];
|
|
113
|
+
const seen = /* @__PURE__ */ new Set();
|
|
114
|
+
triggers.forEach((trigger, i) => {
|
|
115
|
+
const at = `agents.${id}.triggers[${i}]`;
|
|
116
|
+
if (seen.has(trigger.id)) {
|
|
117
|
+
out.push(
|
|
118
|
+
err(
|
|
119
|
+
"agent_trigger_duplicate",
|
|
120
|
+
`agents.${id}: trigger id "${trigger.id}" is declared twice`,
|
|
121
|
+
`${at}.id`
|
|
122
|
+
)
|
|
123
|
+
);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
seen.add(trigger.id);
|
|
127
|
+
if (!assetTriggerIds || assetTriggerIds.includes(trigger.id)) return;
|
|
128
|
+
if (!trigger.kind) {
|
|
129
|
+
out.push(
|
|
130
|
+
err(
|
|
131
|
+
"agent_trigger_unknown",
|
|
132
|
+
`agents.${id}: trigger "${trigger.id}" is not declared by the agent asset (${assetTriggerIds.length > 0 ? `has: ${assetTriggerIds.join(", ")}` : "it declares no triggers"}) \u2014 add \`kind\` and the trigger's fields to declare a new one`,
|
|
133
|
+
`${at}.id`
|
|
134
|
+
)
|
|
135
|
+
);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const missing = TRIGGER_REQUIRED_FIELDS[trigger.kind].filter(
|
|
139
|
+
(field) => trigger[field] === void 0
|
|
140
|
+
);
|
|
141
|
+
if (missing.length > 0) {
|
|
142
|
+
out.push(
|
|
143
|
+
err(
|
|
144
|
+
"agent_trigger_incomplete",
|
|
145
|
+
`agents.${id}: trigger "${trigger.id}" (kind ${trigger.kind}) is not in the asset, so it must declare ${missing.join(", ")}`,
|
|
146
|
+
at
|
|
147
|
+
)
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
return out;
|
|
152
|
+
}
|
|
153
|
+
function checkConnectors(id, instance, facts, connectorIds) {
|
|
154
|
+
const out = [];
|
|
155
|
+
for (const [slot, connectorId] of Object.entries(instance.connectors ?? {})) {
|
|
156
|
+
const at = `agents.${id}.connectors.${slot}`;
|
|
157
|
+
if (!facts.connectorSlots.includes(slot)) {
|
|
158
|
+
const hint = facts.otherSlots.includes(slot) ? `"${slot}" is a slot of a non-connector item` : facts.connectorSlots.length > 0 ? `the asset's connector slots are: ${facts.connectorSlots.join(", ")}` : "the asset declares no connector slots";
|
|
159
|
+
out.push(
|
|
160
|
+
err(
|
|
161
|
+
"agent_connector_slot_unknown",
|
|
162
|
+
`agents.${id}: connectors.${slot} is not a connector slot id of the agent asset (${hint})`,
|
|
163
|
+
at
|
|
164
|
+
)
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
if (!connectorIds.includes(connectorId)) {
|
|
168
|
+
out.push(
|
|
169
|
+
err(
|
|
170
|
+
"agent_connector_unknown",
|
|
171
|
+
`agents.${id}: connectors.${slot} points at "${connectorId}", which is not in skaile.yaml connectors[]${connectorIds.length > 0 ? ` (has: ${connectorIds.join(", ")})` : ""}`,
|
|
172
|
+
at
|
|
173
|
+
)
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return out;
|
|
178
|
+
}
|
|
179
|
+
function checkAgentInstances(projectDir, parsed) {
|
|
180
|
+
const diagnostics = [];
|
|
181
|
+
const instances = normalizeAgentInstances(parsed.agents, diagnostics);
|
|
182
|
+
const agent = isRecord(parsed.agent) ? parsed.agent : void 0;
|
|
183
|
+
diagnostics.push(...agentBlockKeyDiagnostics(parsed.agent));
|
|
184
|
+
if (agent?.subagents !== void 0) {
|
|
185
|
+
diagnostics.push(
|
|
186
|
+
err(
|
|
187
|
+
"agent_subagents_removed",
|
|
188
|
+
"`agent.subagents` was removed \u2014 declare each subagent as an agent asset and bind it under `agents:` with `lifecycle: role`",
|
|
189
|
+
"agent.subagents"
|
|
190
|
+
)
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
if (agent?.instances !== void 0) {
|
|
194
|
+
diagnostics.push(
|
|
195
|
+
err(
|
|
196
|
+
"misplaced_agent_instances",
|
|
197
|
+
"`agent.instances` is not a skaile.yaml key \u2014 declare instances under root `agents:`",
|
|
198
|
+
"agent.instances"
|
|
199
|
+
)
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
diagnostics.push(
|
|
203
|
+
...agentInstanceDiagnostics({
|
|
204
|
+
agent: {
|
|
205
|
+
definition: typeof agent?.definition === "string" ? agent.definition : void 0,
|
|
206
|
+
instances
|
|
207
|
+
}
|
|
208
|
+
})
|
|
209
|
+
);
|
|
210
|
+
if (!instances) return diagnostics;
|
|
211
|
+
const connectorIds = (Array.isArray(parsed.connectors) ? parsed.connectors : []).flatMap(
|
|
212
|
+
(c) => isRecord(c) && typeof c.id === "string" ? [c.id] : []
|
|
213
|
+
);
|
|
214
|
+
for (const [id, instance] of Object.entries(instances)) {
|
|
215
|
+
const loaded = loadAsset(projectDir, id, instance.ref);
|
|
216
|
+
if ("diagnostic" in loaded) {
|
|
217
|
+
diagnostics.push(loaded.diagnostic, ...checkTriggers(id, instance.triggers ?? [], void 0));
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
const { facts } = loaded;
|
|
221
|
+
const lifecycle = instance.lifecycle ?? facts.lifecycle ?? "standing";
|
|
222
|
+
if (lifecycle === "role" && !facts.hasIo) {
|
|
223
|
+
diagnostics.push(
|
|
224
|
+
err(
|
|
225
|
+
"agent_role_missing_io",
|
|
226
|
+
`agents.${id}: lifecycle "role" needs the agent asset to declare \`io\` ({ input, output } JSON Schemas)`,
|
|
227
|
+
`agents.${id}.lifecycle`
|
|
228
|
+
)
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
diagnostics.push(...checkConnectors(id, instance, facts, connectorIds));
|
|
232
|
+
diagnostics.push(...checkTriggers(id, instance.triggers ?? [], facts.triggerIds));
|
|
233
|
+
}
|
|
234
|
+
return diagnostics;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// cli/src/commands/validate.ts
|
|
238
|
+
var MANIFEST_GLOBS = [
|
|
239
|
+
{ pattern: /\/SKILL\.md$/, kind: "skill" },
|
|
240
|
+
{ pattern: /\/agent\.yaml$/, kind: "agent" },
|
|
241
|
+
{ pattern: /\/AGENT\.md$/, kind: "agent" },
|
|
242
|
+
{ pattern: /\/CONTRACT\.md$/, kind: "contract" },
|
|
243
|
+
{ pattern: /\.flow\.yaml$/, kind: "flow" },
|
|
244
|
+
{ pattern: /\.flow\.json$/, kind: "flow" },
|
|
245
|
+
{ pattern: /\/CONNECTOR\.md$/, kind: "connector" },
|
|
246
|
+
{ pattern: /\.prompt\.md$/, kind: "prompt" },
|
|
247
|
+
{ pattern: /\/MCP\.md$/, kind: "mcp-server" },
|
|
248
|
+
{ pattern: /\/knowledge\.yaml$/, kind: "knowledge" },
|
|
249
|
+
{ pattern: /\/knowledge\/index\.yaml$/, kind: "knowledge" },
|
|
250
|
+
{ pattern: /\.preset\.yaml$/, kind: "preset" }
|
|
251
|
+
];
|
|
252
|
+
var HARNESS_DIRS = /* @__PURE__ */ new Set([".claude", ".codex", ".omp"]);
|
|
253
|
+
var SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
254
|
+
"node_modules",
|
|
255
|
+
"dist",
|
|
256
|
+
".git",
|
|
257
|
+
".skaile",
|
|
258
|
+
"__pycache__",
|
|
259
|
+
...HARNESS_DIRS
|
|
260
|
+
]);
|
|
261
|
+
function findManifestCandidates(rootPath) {
|
|
262
|
+
const candidates = [];
|
|
263
|
+
function walk(dir) {
|
|
264
|
+
let entries;
|
|
265
|
+
try {
|
|
266
|
+
entries = fs2.readdirSync(dir, { withFileTypes: true });
|
|
267
|
+
} catch {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
for (const entry of entries) {
|
|
271
|
+
const fullPath = path2.join(dir, entry.name);
|
|
272
|
+
if (entry.isDirectory()) {
|
|
273
|
+
if (!SKIP_DIRS.has(entry.name)) walk(fullPath);
|
|
274
|
+
} else if (entry.isFile()) {
|
|
275
|
+
for (const glob of MANIFEST_GLOBS) {
|
|
276
|
+
if (glob.pattern.test(fullPath)) {
|
|
277
|
+
candidates.push({ filePath: fullPath, kind: glob.kind });
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
walk(rootPath);
|
|
285
|
+
return candidates;
|
|
286
|
+
}
|
|
287
|
+
function parseManifestCandidate(c, absRoot) {
|
|
288
|
+
const content = fs2.readFileSync(c.filePath, "utf-8");
|
|
289
|
+
const res = parseManifestFile(c.filePath, content);
|
|
290
|
+
if (!res.ok) {
|
|
291
|
+
logErr(`${path2.relative(absRoot, c.filePath)} [${c.kind}] \u2014 parse error: ${res.reason}`);
|
|
292
|
+
return { kind: "error" };
|
|
293
|
+
}
|
|
294
|
+
return {
|
|
295
|
+
kind: "value",
|
|
296
|
+
parsed: res.data,
|
|
297
|
+
body: readAssetBody(c.filePath, content)
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
function libraryRootOf(absRoot) {
|
|
301
|
+
for (let dir = absRoot; ; dir = path2.dirname(dir)) {
|
|
302
|
+
if (fs2.existsSync(path2.join(dir, SKAILE_MANIFEST_FILENAME))) return dir;
|
|
303
|
+
if (path2.dirname(dir) === dir) return absRoot;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
function validateManifestCandidate(c, parsed, body, absRoot, registry, strictConformance, composeRefs) {
|
|
307
|
+
const relPath = path2.relative(absRoot, c.filePath);
|
|
308
|
+
let errors = 0;
|
|
309
|
+
let warnings = 0;
|
|
310
|
+
const dirName = path2.basename(path2.dirname(c.filePath));
|
|
311
|
+
const checked = checkAsset(
|
|
312
|
+
c.kind,
|
|
313
|
+
parsed ?? {},
|
|
314
|
+
body,
|
|
315
|
+
dirName,
|
|
316
|
+
registry,
|
|
317
|
+
fs2.readFileSync(c.filePath, "utf-8"),
|
|
318
|
+
path2.basename(c.filePath),
|
|
319
|
+
{ dir: path2.dirname(c.filePath), libraryRoot: libraryRootOf(absRoot), composeRefs }
|
|
320
|
+
);
|
|
321
|
+
for (const f of checked.errors) {
|
|
322
|
+
logErr(`${relPath} [${f.tag}] \u2014 ${f.text}`);
|
|
323
|
+
errors++;
|
|
324
|
+
}
|
|
325
|
+
for (const f of checked.advisories) {
|
|
326
|
+
const line = `${relPath} [${f.tag}] \u2014 ${f.text}`;
|
|
327
|
+
if (f.conformance && strictConformance || f.scaffoldBody) {
|
|
328
|
+
logErr(line);
|
|
329
|
+
errors++;
|
|
330
|
+
} else {
|
|
331
|
+
logWarn(line);
|
|
332
|
+
warnings++;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return { errors, warnings };
|
|
336
|
+
}
|
|
337
|
+
function scanIdentities(root) {
|
|
338
|
+
const identities = /* @__PURE__ */ new Set();
|
|
339
|
+
for (const c of findManifestCandidates(root)) {
|
|
340
|
+
let parsed;
|
|
341
|
+
try {
|
|
342
|
+
const res = parseManifestFile(c.filePath, fs2.readFileSync(c.filePath, "utf-8"));
|
|
343
|
+
if (!res.ok) continue;
|
|
344
|
+
parsed = res.data;
|
|
345
|
+
} catch {
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
if (parsed === null || typeof parsed !== "object") continue;
|
|
349
|
+
const identity = parsed[c.kind === "flow" ? "id" : "name"];
|
|
350
|
+
if (typeof identity === "string" && identity.length > 0)
|
|
351
|
+
identities.add(`${c.kind}:${identity}`);
|
|
352
|
+
}
|
|
353
|
+
return identities;
|
|
354
|
+
}
|
|
355
|
+
function validateManifests(rootPath, strictConformance, registeredAssets = /* @__PURE__ */ new Set()) {
|
|
356
|
+
const absRoot = path2.resolve(rootPath);
|
|
357
|
+
if (!fs2.existsSync(absRoot)) {
|
|
358
|
+
logErr(`Path does not exist: ${absRoot}`);
|
|
359
|
+
return { total: 0, errors: 1, warnings: 0 };
|
|
360
|
+
}
|
|
361
|
+
const registry = getKindRegistry();
|
|
362
|
+
const candidates = findManifestCandidates(absRoot);
|
|
363
|
+
const isLibrary = fs2.existsSync(path2.join(absRoot, SKAILE_MANIFEST_FILENAME));
|
|
364
|
+
let errors = reportLibrarySymlinks(absRoot, {
|
|
365
|
+
wholeTree: isLibrary,
|
|
366
|
+
skipDirs: isLibrary ? void 0 : HARNESS_DIRS
|
|
367
|
+
});
|
|
368
|
+
let warnings = 0;
|
|
369
|
+
const seenIdentity = /* @__PURE__ */ new Map();
|
|
370
|
+
const libraryRoot = libraryRootOf(absRoot);
|
|
371
|
+
const composeRefs = composeRefContext(
|
|
372
|
+
scanIdentities(libraryRoot),
|
|
373
|
+
registeredAssets,
|
|
374
|
+
loadSkPublishManifest(libraryRoot)?.publisher
|
|
375
|
+
);
|
|
376
|
+
for (const c of candidates) {
|
|
377
|
+
const parseResult = parseManifestCandidate(c, absRoot);
|
|
378
|
+
if (parseResult.kind === "error") {
|
|
379
|
+
errors++;
|
|
380
|
+
continue;
|
|
381
|
+
}
|
|
382
|
+
const delta = validateManifestCandidate(
|
|
383
|
+
c,
|
|
384
|
+
parseResult.parsed,
|
|
385
|
+
parseResult.body,
|
|
386
|
+
absRoot,
|
|
387
|
+
registry,
|
|
388
|
+
strictConformance,
|
|
389
|
+
composeRefs
|
|
390
|
+
);
|
|
391
|
+
errors += delta.errors;
|
|
392
|
+
warnings += delta.warnings;
|
|
393
|
+
const obj = parseResult.parsed;
|
|
394
|
+
const identity = obj && typeof obj === "object" ? obj[c.kind === "flow" ? "id" : "name"] : null;
|
|
395
|
+
if (typeof identity === "string" && identity.length > 0) {
|
|
396
|
+
const dir = path2.dirname(c.filePath);
|
|
397
|
+
const key = `${c.kind}:${identity}`;
|
|
398
|
+
const first = seenIdentity.get(key);
|
|
399
|
+
if (first === void 0) {
|
|
400
|
+
seenIdentity.set(key, dir);
|
|
401
|
+
} else if (first !== dir) {
|
|
402
|
+
logErr(
|
|
403
|
+
`${path2.relative(absRoot, c.filePath)} [${c.kind}] \u2014 ${key} is also defined in ${path2.relative(absRoot, first) || "."}; two directories cannot share a kind and name (\`skaile library index\` keeps only the first).`
|
|
404
|
+
);
|
|
405
|
+
errors++;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
return { total: candidates.length, errors, warnings };
|
|
410
|
+
}
|
|
411
|
+
function findWorkspaceManifests(rootPath) {
|
|
412
|
+
const out = [];
|
|
413
|
+
function walk(dir) {
|
|
414
|
+
let entries;
|
|
415
|
+
try {
|
|
416
|
+
entries = fs2.readdirSync(dir, { withFileTypes: true });
|
|
417
|
+
} catch {
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
for (const entry of entries) {
|
|
421
|
+
const full = path2.join(dir, entry.name);
|
|
422
|
+
if (entry.isDirectory()) {
|
|
423
|
+
if (!SKIP_DIRS.has(entry.name)) walk(full);
|
|
424
|
+
} else if (entry.isFile() && /(^|\.)skaile\.yaml$/.test(entry.name)) {
|
|
425
|
+
out.push(full);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
walk(rootPath);
|
|
430
|
+
return out;
|
|
431
|
+
}
|
|
432
|
+
function collectWorkspaceRefFields(parsed) {
|
|
433
|
+
const refFields = [];
|
|
434
|
+
if (Array.isArray(parsed.dependencies)) {
|
|
435
|
+
for (const d of parsed.dependencies) {
|
|
436
|
+
if (typeof d === "string") refFields.push(["dependencies", d]);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
if (Array.isArray(parsed.overrides)) {
|
|
440
|
+
for (const o of parsed.overrides) {
|
|
441
|
+
const ref = o?.ref;
|
|
442
|
+
if (typeof ref === "string") refFields.push(["overrides.ref", ref]);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
return refFields;
|
|
446
|
+
}
|
|
447
|
+
function validateWorkspaceRefs(refFields, relPath) {
|
|
448
|
+
let errors = 0;
|
|
449
|
+
for (const [field, ref] of refFields) {
|
|
450
|
+
try {
|
|
451
|
+
parseAssetRef(ref);
|
|
452
|
+
} catch (e) {
|
|
453
|
+
logErr(`${relPath} [${field}] \u2014 ${e instanceof Error ? e.message : String(e)}`);
|
|
454
|
+
errors++;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
return errors;
|
|
458
|
+
}
|
|
459
|
+
function validateWorkspaceAssets(parsed, relPath) {
|
|
460
|
+
if (!Array.isArray(parsed.assets)) return 0;
|
|
461
|
+
let errors = 0;
|
|
462
|
+
const topPublisher = typeof parsed.publisher === "string" ? parsed.publisher : void 0;
|
|
463
|
+
for (const a of parsed.assets) {
|
|
464
|
+
const asset = a;
|
|
465
|
+
const name = asset?.name;
|
|
466
|
+
const kind = typeof asset?.kind === "string" ? asset.kind : "skill";
|
|
467
|
+
if (typeof name !== "string" || name.length === 0) continue;
|
|
468
|
+
const publisher = typeof asset?.publisher === "string" ? asset.publisher : topPublisher;
|
|
469
|
+
if (publisher !== void 0) {
|
|
470
|
+
try {
|
|
471
|
+
parseAssetRef(`${kind}:@${publisher}/${name}`);
|
|
472
|
+
} catch (e) {
|
|
473
|
+
logErr(`${relPath} [assets] \u2014 ${e instanceof Error ? e.message : String(e)}`);
|
|
474
|
+
errors++;
|
|
475
|
+
}
|
|
476
|
+
} else if (!isValidAssetName(name)) {
|
|
477
|
+
logErr(`${relPath} [assets] \u2014 invalid asset name "${name}" \u2014 ${ASSET_NAME_HINT}`);
|
|
478
|
+
errors++;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
return errors;
|
|
482
|
+
}
|
|
483
|
+
var CONNECTOR_ERROR_CODES = [
|
|
484
|
+
"connector_missing_driver",
|
|
485
|
+
"connector_missing_id",
|
|
486
|
+
"connector_duplicate_id",
|
|
487
|
+
"connector_invalid_access"
|
|
488
|
+
];
|
|
489
|
+
function validateLocalConnectorMountPaths(projectDir, relPath, connectors) {
|
|
490
|
+
let errors = 0;
|
|
491
|
+
for (const c of connectors) {
|
|
492
|
+
if (c.driver !== "local" || c.mount) continue;
|
|
493
|
+
const dir = localConnectorMountDir(c, projectDir);
|
|
494
|
+
if (!dir) continue;
|
|
495
|
+
if (!fs2.existsSync(dir)) {
|
|
496
|
+
logErr(
|
|
497
|
+
`${relPath} [connectors] \u2014 connector_mount_path_missing: connectors.${c.id}.mountPath: ${dir} does not exist; create the directory or fix the path`
|
|
498
|
+
);
|
|
499
|
+
errors++;
|
|
500
|
+
} else if (!isInsideProject(dir, projectDir)) {
|
|
501
|
+
logWarn(
|
|
502
|
+
`${relPath} [connectors] \u2014 connectors.${c.id}.mountPath: ${dir} is outside the project ${projectDir}; the agent reads${c.access === "read-write" ? " and writes" : ""} there`
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
return errors;
|
|
507
|
+
}
|
|
508
|
+
async function validateWorkspaceManifests(rootPath) {
|
|
509
|
+
const absRoot = path2.resolve(rootPath);
|
|
510
|
+
const files = findWorkspaceManifests(absRoot);
|
|
511
|
+
let errors = 0;
|
|
512
|
+
for (const file of files) {
|
|
513
|
+
const relPath = path2.relative(absRoot, file);
|
|
514
|
+
let parsed;
|
|
515
|
+
try {
|
|
516
|
+
parsed = parse(fs2.readFileSync(file, "utf-8")) ?? {};
|
|
517
|
+
} catch (e) {
|
|
518
|
+
logErr(`${relPath} \u2014 parse error: ${e instanceof Error ? e.message : String(e)}`);
|
|
519
|
+
errors++;
|
|
520
|
+
continue;
|
|
521
|
+
}
|
|
522
|
+
errors += validateWorkspaceRefs(collectWorkspaceRefFields(parsed), relPath);
|
|
523
|
+
errors += validateWorkspaceAssets(parsed, relPath);
|
|
524
|
+
for (const d of checkAgentInstances(path2.dirname(file), parsed)) {
|
|
525
|
+
const line = `${relPath} [agents] \u2014 ${d.code}: ${d.path ? `${d.path}: ` : ""}${d.message}`;
|
|
526
|
+
if (d.severity === "error") {
|
|
527
|
+
logErr(line);
|
|
528
|
+
errors++;
|
|
529
|
+
} else {
|
|
530
|
+
logWarn(line);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
const decoded = decodeSkaileYaml(fs2.readFileSync(file, "utf-8"));
|
|
534
|
+
for (const d of decoded.diagnostics) {
|
|
535
|
+
if (!CONNECTOR_ERROR_CODES.includes(d.code)) continue;
|
|
536
|
+
logErr(`${relPath} [connectors] \u2014 ${d.code}: ${d.path ? `${d.path}: ` : ""}${d.message}`);
|
|
537
|
+
errors++;
|
|
538
|
+
}
|
|
539
|
+
errors += validateLocalConnectorMountPaths(
|
|
540
|
+
path2.dirname(file),
|
|
541
|
+
relPath,
|
|
542
|
+
decoded.config?.connectors ?? []
|
|
543
|
+
);
|
|
544
|
+
if ((decoded.config?.connectors ?? []).length > 0) {
|
|
545
|
+
const assets = await resolveRuntimeAssets(path2.dirname(file));
|
|
546
|
+
if (!assets.warnings.some((w) => w.code === "repo_unavailable")) {
|
|
547
|
+
for (const w of assets.warnings) {
|
|
548
|
+
if (w.code !== "missing_driver" || !w.name) continue;
|
|
549
|
+
logErr(`${relPath} [connectors] \u2014 ${w.code}: ${w.message}`);
|
|
550
|
+
errors++;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
return { total: files.length, errors };
|
|
556
|
+
}
|
|
557
|
+
function validatePublishManifestRoots(rootPath) {
|
|
558
|
+
const absRoot = path2.resolve(rootPath);
|
|
559
|
+
const manifest = loadSkPublishManifest(absRoot);
|
|
560
|
+
if (!manifest) return 0;
|
|
561
|
+
const missing = missingRootAssets(absRoot, manifest);
|
|
562
|
+
for (const a of missing) {
|
|
563
|
+
logErr(
|
|
564
|
+
`${SKAILE_MANIFEST_FILENAME} [assets] \u2014 ${assetEntryRef(a, manifest)}: root "${a.root}" does not exist. Run \`skaile library index <library>\` to drop the entry, or restore the directory.`
|
|
565
|
+
);
|
|
566
|
+
}
|
|
567
|
+
return missing.length;
|
|
568
|
+
}
|
|
569
|
+
function validatePublishManifestRequires(rootPath) {
|
|
570
|
+
const problems = manifestRequiresProblems(path2.resolve(rootPath));
|
|
571
|
+
for (const p of problems) {
|
|
572
|
+
logErr(
|
|
573
|
+
`${SKAILE_MANIFEST_FILENAME} [assets] \u2014 ${p.asset}: ${p.message}. Use the \`kind:@<publisher>/name[#version]\` form.`
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
return problems.length;
|
|
577
|
+
}
|
|
578
|
+
function validatePublishManifestPublisherSlugs(rootPath) {
|
|
579
|
+
const problems = manifestPublisherProblems(path2.resolve(rootPath));
|
|
580
|
+
for (const message of problems) logErr(message);
|
|
581
|
+
return problems.length;
|
|
582
|
+
}
|
|
583
|
+
function validatePublishManifestRootPaths(rootPath) {
|
|
584
|
+
const problems = [
|
|
585
|
+
...manifestRootProblems(path2.resolve(rootPath)),
|
|
586
|
+
...manifestEntryNameProblems(path2.resolve(rootPath))
|
|
587
|
+
];
|
|
588
|
+
for (const message of problems) logErr(message);
|
|
589
|
+
return problems.length;
|
|
590
|
+
}
|
|
591
|
+
function validatePublishManifestParses(rootPath) {
|
|
592
|
+
try {
|
|
593
|
+
assertManifestEditable(path2.resolve(rootPath));
|
|
594
|
+
return 0;
|
|
595
|
+
} catch (err2) {
|
|
596
|
+
logErr(err2 instanceof Error ? err2.message : String(err2));
|
|
597
|
+
return 1;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
function validatePublishManifestVersions(rootPath) {
|
|
601
|
+
const absRoot = path2.resolve(rootPath);
|
|
602
|
+
const manifest = loadSkPublishManifest(absRoot);
|
|
603
|
+
if (!manifest || manifest.source) return 0;
|
|
604
|
+
let warnings = 0;
|
|
605
|
+
for (const a of manifest.assets ?? []) {
|
|
606
|
+
if (!a.root || a.source || !a.version) continue;
|
|
607
|
+
const file = findAssetManifestFile(path2.join(absRoot, a.root), a.kind, a.name);
|
|
608
|
+
if (!file) continue;
|
|
609
|
+
const res = parseManifestFile(file, fs2.readFileSync(file, "utf-8"));
|
|
610
|
+
if (!res.ok) continue;
|
|
611
|
+
const fileVersion = declaredVersion(res.data);
|
|
612
|
+
if (fileVersion === void 0 || fileVersion === a.version) continue;
|
|
613
|
+
logWarn(
|
|
614
|
+
manifestVersionMismatchMessage(
|
|
615
|
+
assetEntryRef(a, manifest),
|
|
616
|
+
a.version,
|
|
617
|
+
toPosix(path2.relative(absRoot, file)),
|
|
618
|
+
fileVersion
|
|
619
|
+
)
|
|
620
|
+
);
|
|
621
|
+
warnings++;
|
|
622
|
+
}
|
|
623
|
+
return warnings;
|
|
624
|
+
}
|
|
625
|
+
function validatePublishManifestPublishers(rootPath) {
|
|
626
|
+
const absRoot = path2.resolve(rootPath);
|
|
627
|
+
const manifest = loadSkPublishManifest(absRoot);
|
|
628
|
+
if (!manifest || manifest.source) return 0;
|
|
629
|
+
const bare = (p) => p.trim().replace(/^@/, "");
|
|
630
|
+
let warnings = 0;
|
|
631
|
+
for (const a of manifest.assets ?? []) {
|
|
632
|
+
const resolved = a.publisher ?? manifest.publisher;
|
|
633
|
+
if (!a.root || a.source || !resolved) continue;
|
|
634
|
+
const file = findAssetManifestFile(path2.join(absRoot, a.root), a.kind, a.name);
|
|
635
|
+
if (!file) continue;
|
|
636
|
+
const res = parseManifestFile(file, fs2.readFileSync(file, "utf-8"));
|
|
637
|
+
if (!res.ok) continue;
|
|
638
|
+
const meta = res.data.metadata;
|
|
639
|
+
const declared = meta !== null && typeof meta === "object" ? meta.publisher : null;
|
|
640
|
+
if (typeof declared !== "string" || bare(declared) === bare(resolved)) continue;
|
|
641
|
+
logWarn(
|
|
642
|
+
`${toPosix(path2.relative(absRoot, file))} [publisher] \u2014 metadata.publisher "${bare(declared)}" differs from the manifest publisher "${bare(resolved)}" for ${assetEntryRef(a, manifest)}. The manifest wins and the file value is ignored: delete \`metadata.publisher\` from the file, or set the publisher in ${SKAILE_MANIFEST_FILENAME}.`
|
|
643
|
+
);
|
|
644
|
+
warnings++;
|
|
645
|
+
}
|
|
646
|
+
return warnings;
|
|
647
|
+
}
|
|
648
|
+
var EXCLUDED_PATHS = ["skaileup-shared/", "external/", "docs/"];
|
|
649
|
+
function toPosix(p) {
|
|
650
|
+
return p.split(path2.sep).join("/");
|
|
651
|
+
}
|
|
652
|
+
function isExcludedPath(relPath) {
|
|
653
|
+
const rel = toPosix(relPath);
|
|
654
|
+
return EXCLUDED_PATHS.some((prefix) => rel.startsWith(prefix));
|
|
655
|
+
}
|
|
656
|
+
var VERSIONED_KINDS = {
|
|
657
|
+
skill: true,
|
|
658
|
+
agent: true,
|
|
659
|
+
flow: true,
|
|
660
|
+
prompt: true,
|
|
661
|
+
preset: true,
|
|
662
|
+
contract: true
|
|
663
|
+
};
|
|
664
|
+
function readAssetVersion(c) {
|
|
665
|
+
const kind = c.kind;
|
|
666
|
+
const fileName = path2.basename(c.filePath);
|
|
667
|
+
const dirName = path2.basename(path2.dirname(c.filePath));
|
|
668
|
+
const content = fs2.readFileSync(c.filePath, "utf-8");
|
|
669
|
+
if (c.filePath.endsWith(".md")) {
|
|
670
|
+
const res = parseManifestFile(c.filePath, content);
|
|
671
|
+
const data = res.ok ? res.data : {};
|
|
672
|
+
const stem = fileName.replace(/\.prompt\.md$/, "");
|
|
673
|
+
return {
|
|
674
|
+
kind,
|
|
675
|
+
name: typeof data.name === "string" ? data.name : kind === "prompt" ? stem : dirName,
|
|
676
|
+
version: declaredVersion(data) ?? "",
|
|
677
|
+
filePath: c.filePath
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
let parsed = null;
|
|
681
|
+
try {
|
|
682
|
+
parsed = parse(content);
|
|
683
|
+
} catch {
|
|
684
|
+
}
|
|
685
|
+
if (kind === "flow") {
|
|
686
|
+
return {
|
|
687
|
+
kind,
|
|
688
|
+
name: String(parsed?.id ?? fileName.replace(".flow.yaml", "")),
|
|
689
|
+
version: String(parsed?.version ?? ""),
|
|
690
|
+
filePath: c.filePath
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
return {
|
|
694
|
+
kind,
|
|
695
|
+
name: String(parsed?.name ?? dirName),
|
|
696
|
+
version: String(parsed?.version ?? ""),
|
|
697
|
+
filePath: c.filePath
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
function collectAssetVersions(root) {
|
|
701
|
+
if (!fs2.existsSync(root)) return [];
|
|
702
|
+
const assets = [];
|
|
703
|
+
for (const c of findManifestCandidates(root)) {
|
|
704
|
+
if (!VERSIONED_KINDS[c.kind]) continue;
|
|
705
|
+
if (c.filePath.endsWith(".flow.json")) continue;
|
|
706
|
+
if (isExcludedPath(path2.relative(root, c.filePath))) continue;
|
|
707
|
+
assets.push(readAssetVersion(c));
|
|
708
|
+
}
|
|
709
|
+
return assets;
|
|
710
|
+
}
|
|
711
|
+
function assetLocation(a, root) {
|
|
712
|
+
return toPosix(path2.relative(root, a.filePath));
|
|
713
|
+
}
|
|
714
|
+
function findChangelogUnit(assetRelPath, root) {
|
|
715
|
+
let dir = path2.posix.dirname(toPosix(assetRelPath));
|
|
716
|
+
for (; ; ) {
|
|
717
|
+
const candidate = dir === "." ? "CHANGELOG.md" : `${dir}/CHANGELOG.md`;
|
|
718
|
+
if (fs2.existsSync(path2.join(root, candidate))) return candidate;
|
|
719
|
+
if (dir === ".") return null;
|
|
720
|
+
dir = path2.posix.dirname(dir);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
function checkChangelogUnits(modifiedFiles, root) {
|
|
724
|
+
const modified = new Set(modifiedFiles.map(toPosix));
|
|
725
|
+
const assetPattern = /(SKILL\.md|agent\.yaml|\.flow\.yaml|\.prompt\.md)$/;
|
|
726
|
+
const units = /* @__PURE__ */ new Set();
|
|
727
|
+
const orphans = [];
|
|
728
|
+
for (const f of modified) {
|
|
729
|
+
if (!assetPattern.test(f) || isExcludedPath(f)) continue;
|
|
730
|
+
const unit = findChangelogUnit(f, root);
|
|
731
|
+
if (unit) units.add(unit);
|
|
732
|
+
else orphans.push(f);
|
|
733
|
+
}
|
|
734
|
+
const updated = [...units].filter((u) => modified.has(u));
|
|
735
|
+
const stale = [...units].filter((u) => !modified.has(u));
|
|
736
|
+
return { updated, stale, orphans };
|
|
737
|
+
}
|
|
738
|
+
function extractVersionFromContent(filePath, content) {
|
|
739
|
+
if (filePath.endsWith(".yaml")) {
|
|
740
|
+
const parsed2 = parse(content);
|
|
741
|
+
return parsed2?.version ?? null;
|
|
742
|
+
}
|
|
743
|
+
const fmMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
744
|
+
if (!fmMatch) return null;
|
|
745
|
+
const parsed = parse(fmMatch[1]);
|
|
746
|
+
return parsed?.metadata?.version ?? parsed?.version ?? null;
|
|
747
|
+
}
|
|
748
|
+
function checkAssetVersions(assets, root) {
|
|
749
|
+
let errors = 0;
|
|
750
|
+
const warnings = 0;
|
|
751
|
+
for (const a of assets) {
|
|
752
|
+
const location = assetLocation(a, root);
|
|
753
|
+
if (!a.version) {
|
|
754
|
+
logErr(`${a.kind}:${a.name} (${location}) \u2014 missing version`);
|
|
755
|
+
errors++;
|
|
756
|
+
continue;
|
|
757
|
+
}
|
|
758
|
+
const invalid = invalidSemverText(a.version);
|
|
759
|
+
if (invalid) {
|
|
760
|
+
logErr(`${a.kind}:${a.name} (${location}) \u2014 ${invalid}`);
|
|
761
|
+
errors++;
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
return { errors, warnings };
|
|
765
|
+
}
|
|
766
|
+
function checkVersionBumps(assets, root) {
|
|
767
|
+
let warnings = 0;
|
|
768
|
+
for (const a of assets) {
|
|
769
|
+
if (!a.version) continue;
|
|
770
|
+
const relPath = toPosix(path2.relative(root, a.filePath));
|
|
771
|
+
try {
|
|
772
|
+
const headContent = execFileSync("git", ["show", `HEAD:./${relPath}`], {
|
|
773
|
+
cwd: root,
|
|
774
|
+
encoding: "utf-8",
|
|
775
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
776
|
+
});
|
|
777
|
+
const headVersion = extractVersionFromContent(a.filePath, headContent);
|
|
778
|
+
if (headVersion && headVersion === a.version) {
|
|
779
|
+
logWarn(
|
|
780
|
+
`${a.kind}:${a.name} (${assetLocation(a, root)}) \u2014 file changed but version not bumped (${a.version})`
|
|
781
|
+
);
|
|
782
|
+
warnings++;
|
|
783
|
+
}
|
|
784
|
+
} catch {
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
return warnings;
|
|
788
|
+
}
|
|
789
|
+
function checkFlowVersionPins(assets, root) {
|
|
790
|
+
const flows = assets.filter((a) => a.kind === "flow");
|
|
791
|
+
const skillVersionMap = /* @__PURE__ */ new Map();
|
|
792
|
+
for (const a of assets.filter((a2) => a2.kind === "skill")) {
|
|
793
|
+
skillVersionMap.set(a.name, a.version);
|
|
794
|
+
}
|
|
795
|
+
let errors = 0;
|
|
796
|
+
let warnings = 0;
|
|
797
|
+
for (const f of flows) {
|
|
798
|
+
let pins;
|
|
799
|
+
try {
|
|
800
|
+
pins = flowSkillVersionPins(loadFlow(f.filePath));
|
|
801
|
+
} catch (err2) {
|
|
802
|
+
logWarn(
|
|
803
|
+
`flow:${f.name} (${path2.relative(root, f.filePath)}) \u2014 could not be read: ${err2 instanceof Error ? err2.message : err2}`
|
|
804
|
+
);
|
|
805
|
+
warnings++;
|
|
806
|
+
continue;
|
|
807
|
+
}
|
|
808
|
+
if (pins.length === 0) continue;
|
|
809
|
+
const checks = validateFlowVersions(pins, skillVersionMap);
|
|
810
|
+
for (const c of checks.filter((c2) => !c2.satisfied)) {
|
|
811
|
+
logErr(
|
|
812
|
+
`flow:${f.name} node ${c.nodeId} \u2014 wants ${c.requested}, found ${c.actual || "(none)"}`
|
|
813
|
+
);
|
|
814
|
+
errors++;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
return { errors, warnings };
|
|
818
|
+
}
|
|
819
|
+
function resolveCheckRoot(pathArg) {
|
|
820
|
+
if (pathArg) {
|
|
821
|
+
const abs = path2.resolve(pathArg);
|
|
822
|
+
if (!fs2.existsSync(abs)) {
|
|
823
|
+
logErr(`Path does not exist: ${abs}`);
|
|
824
|
+
return null;
|
|
825
|
+
}
|
|
826
|
+
return abs;
|
|
827
|
+
}
|
|
828
|
+
for (let dir = process.cwd(); ; dir = path2.dirname(dir)) {
|
|
829
|
+
if (fs2.existsSync(path2.join(dir, SKAILE_MANIFEST_FILENAME))) return dir;
|
|
830
|
+
if (path2.dirname(dir) === dir) return AI_RESOURCES;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
function isInGitWorkTree(root) {
|
|
834
|
+
try {
|
|
835
|
+
return execFileSync("git", ["rev-parse", "--is-inside-work-tree"], {
|
|
836
|
+
cwd: root,
|
|
837
|
+
encoding: "utf-8",
|
|
838
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
839
|
+
}).trim() === "true";
|
|
840
|
+
} catch {
|
|
841
|
+
return false;
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
function changedFiles(root, ref, what, opts = {}) {
|
|
845
|
+
if (!isInGitWorkTree(root)) {
|
|
846
|
+
logErr(`${what} needs a git repository: ${root} is not inside a git work tree.`);
|
|
847
|
+
return null;
|
|
848
|
+
}
|
|
849
|
+
try {
|
|
850
|
+
const out = execFileSync(
|
|
851
|
+
"git",
|
|
852
|
+
["diff", "--name-only", "--relative", "--end-of-options", ref],
|
|
853
|
+
{
|
|
854
|
+
cwd: root,
|
|
855
|
+
encoding: "utf-8",
|
|
856
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
857
|
+
}
|
|
858
|
+
);
|
|
859
|
+
const changed = out.trim().split("\n").filter(Boolean);
|
|
860
|
+
if (opts.untracked) {
|
|
861
|
+
const fresh = execFileSync("git", ["ls-files", "--others", "--exclude-standard"], {
|
|
862
|
+
cwd: root,
|
|
863
|
+
encoding: "utf-8",
|
|
864
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
865
|
+
});
|
|
866
|
+
changed.push(...fresh.trim().split("\n").filter(Boolean));
|
|
867
|
+
}
|
|
868
|
+
return changed;
|
|
869
|
+
} catch (err2) {
|
|
870
|
+
const stderr = err2 instanceof Error && "stderr" in err2 ? String(err2.stderr).trim() : "";
|
|
871
|
+
const reason = (stderr || (err2 instanceof Error ? err2.message : String(err2))).split("\n")[0];
|
|
872
|
+
logErr(`git diff failed in ${root}: ${reason}`);
|
|
873
|
+
return null;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
function assetOwnDir(a) {
|
|
877
|
+
const dir = path2.dirname(a.filePath);
|
|
878
|
+
if (["skill", "agent", "contract"].includes(a.kind) || path2.basename(dir) === a.name) return dir;
|
|
879
|
+
return null;
|
|
880
|
+
}
|
|
881
|
+
function assetChanged(a, changedAbs) {
|
|
882
|
+
if (changedAbs.has(a.filePath)) return true;
|
|
883
|
+
const dir = assetOwnDir(a);
|
|
884
|
+
if (dir === null) return false;
|
|
885
|
+
for (const f of changedAbs) {
|
|
886
|
+
const rel = path2.relative(dir, f);
|
|
887
|
+
if (rel.startsWith("..") || path2.isAbsolute(rel)) continue;
|
|
888
|
+
if (!isNonAssetPath(toPosix(rel))) return true;
|
|
889
|
+
}
|
|
890
|
+
return false;
|
|
891
|
+
}
|
|
892
|
+
function runVersionsCheck(pathArg, opts) {
|
|
893
|
+
const root = resolveCheckRoot(pathArg);
|
|
894
|
+
if (root === null) {
|
|
895
|
+
process.exit(1);
|
|
896
|
+
return;
|
|
897
|
+
}
|
|
898
|
+
let assets = collectAssetVersions(root);
|
|
899
|
+
if (opts.changedOnly) {
|
|
900
|
+
const changed = changedFiles(root, "HEAD", "--changed-only", { untracked: true });
|
|
901
|
+
if (changed === null) {
|
|
902
|
+
process.exit(1);
|
|
903
|
+
return;
|
|
904
|
+
}
|
|
905
|
+
const changedAbs = new Set(changed.map((f) => path2.resolve(root, f)));
|
|
906
|
+
assets = assets.filter((a) => assetChanged(a, changedAbs));
|
|
907
|
+
}
|
|
908
|
+
logInfo(`Checking versions in ${root}`);
|
|
909
|
+
const versionCheck = checkAssetVersions(assets, root);
|
|
910
|
+
let errors = versionCheck.errors;
|
|
911
|
+
let warnings = versionCheck.warnings;
|
|
912
|
+
if (opts.changedOnly) {
|
|
913
|
+
warnings += checkVersionBumps(assets, root);
|
|
914
|
+
}
|
|
915
|
+
const pinCheck = checkFlowVersionPins(assets, root);
|
|
916
|
+
errors += pinCheck.errors;
|
|
917
|
+
warnings += pinCheck.warnings;
|
|
918
|
+
console.log();
|
|
919
|
+
logInfo(`Checked ${assets.length} assets`);
|
|
920
|
+
if (errors === 0 && warnings === 0) {
|
|
921
|
+
logOk("All versions valid");
|
|
922
|
+
} else {
|
|
923
|
+
if (errors > 0) logErr(`${errors} error(s)`);
|
|
924
|
+
if (warnings > 0) logWarn(`${warnings} warning(s)`);
|
|
925
|
+
}
|
|
926
|
+
if (errors > 0 || opts.strict && warnings > 0) {
|
|
927
|
+
process.exit(1);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
function makeValidateCommand() {
|
|
931
|
+
const cmd = new Command("validate").description(
|
|
932
|
+
"Validate asset manifests, versions, and changelogs"
|
|
933
|
+
);
|
|
934
|
+
cmd.argument("[path]", "Path to asset repo or directory to validate", ".").option(
|
|
935
|
+
"--strict-conformance",
|
|
936
|
+
"Treat Agent Skills (agentskills.io) standard findings as errors"
|
|
937
|
+
).action(async (targetPath, opts) => {
|
|
938
|
+
const absPath = path2.resolve(targetPath);
|
|
939
|
+
if (fs2.existsSync(absPath) && !fs2.statSync(absPath).isDirectory()) {
|
|
940
|
+
logErr(`${absPath} is not a directory: nothing to validate. Pass the library directory.`);
|
|
941
|
+
process.exit(1);
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
944
|
+
logInfo(`Validating manifests in ${absPath}`);
|
|
945
|
+
const { total, errors, warnings } = validateManifests(
|
|
946
|
+
absPath,
|
|
947
|
+
opts.strictConformance ?? false,
|
|
948
|
+
await registeredAssetKeys(libraryRootOf(absPath))
|
|
949
|
+
);
|
|
950
|
+
const ws = await validateWorkspaceManifests(absPath);
|
|
951
|
+
const rootErrors = validatePublishManifestRoots(absPath);
|
|
952
|
+
const slugErrors = validatePublishManifestPublisherSlugs(absPath);
|
|
953
|
+
const rootPathErrors = validatePublishManifestRootPaths(absPath);
|
|
954
|
+
const parseErrors = validatePublishManifestParses(absPath);
|
|
955
|
+
const requiresErrors = validatePublishManifestRequires(absPath);
|
|
956
|
+
const versionWarnings = validatePublishManifestVersions(absPath);
|
|
957
|
+
const publisherWarnings = validatePublishManifestPublishers(absPath);
|
|
958
|
+
const dependencyProblems = await unresolvedManifestDependencies(absPath);
|
|
959
|
+
for (const w of dependencyProblems) logWarn(w);
|
|
960
|
+
const dependencyWarnings = dependencyProblems.length;
|
|
961
|
+
const totalErrors = errors + ws.errors + rootErrors + slugErrors + rootPathErrors + parseErrors + requiresErrors;
|
|
962
|
+
console.log();
|
|
963
|
+
warnIgnoredDomainFiles(absPath);
|
|
964
|
+
warnLegacyBundleFiles(absPath);
|
|
965
|
+
logInfo(`Scanned ${total} asset manifest(s) and ${ws.total} skaile.yaml file(s)`);
|
|
966
|
+
if (total === 0 && ws.total === 0 && totalErrors === 0 && !fs2.existsSync(path2.join(absPath, SKAILE_MANIFEST_FILENAME))) {
|
|
967
|
+
logErr(
|
|
968
|
+
`Nothing to validate in ${absPath}: no asset manifest, skaile.yaml or ${SKAILE_MANIFEST_FILENAME} found.`
|
|
969
|
+
);
|
|
970
|
+
process.exit(1);
|
|
971
|
+
return;
|
|
972
|
+
}
|
|
973
|
+
const totalWarnings = warnings + versionWarnings + publisherWarnings + dependencyWarnings;
|
|
974
|
+
if (totalWarnings > 0) logWarn(`${totalWarnings} warning(s)`);
|
|
975
|
+
if (totalErrors === 0) {
|
|
976
|
+
logOk("All manifests valid");
|
|
977
|
+
} else {
|
|
978
|
+
logErr(`${totalErrors} validation error(s)`);
|
|
979
|
+
process.exit(1);
|
|
980
|
+
}
|
|
981
|
+
});
|
|
982
|
+
cmd.command("versions").description("Check version fields and flow version pins").argument("[path]", "Library or asset directory (default: the current library)").option("--changed-only", "Only check assets modified since last commit").option("--strict", "Exit 1 on warnings (for CI)").addOption(removedDomainOption()).action(
|
|
983
|
+
(pathArg, opts) => {
|
|
984
|
+
rejectRemovedDomainOption(opts);
|
|
985
|
+
runVersionsCheck(pathArg, opts);
|
|
986
|
+
}
|
|
987
|
+
);
|
|
988
|
+
cmd.command("changelog").description("Check that modified assets have an updated nearest CHANGELOG.md").argument("[path]", "Library or asset directory (default: the current library)").option("--base <ref>", "Git base ref for diff", "HEAD").action((pathArg, opts) => {
|
|
989
|
+
const root = resolveCheckRoot(pathArg);
|
|
990
|
+
if (root === null) {
|
|
991
|
+
process.exit(1);
|
|
992
|
+
return;
|
|
993
|
+
}
|
|
994
|
+
const modifiedFiles = changedFiles(root, opts.base, "changelog");
|
|
995
|
+
if (modifiedFiles === null) {
|
|
996
|
+
process.exit(1);
|
|
997
|
+
return;
|
|
998
|
+
}
|
|
999
|
+
const { updated, stale, orphans } = checkChangelogUnits(modifiedFiles, root);
|
|
1000
|
+
if (updated.length + stale.length + orphans.length === 0) {
|
|
1001
|
+
logOk("No modified assets found");
|
|
1002
|
+
return;
|
|
1003
|
+
}
|
|
1004
|
+
for (const unit of updated) logOk(`${unit} updated`);
|
|
1005
|
+
for (const unit of stale) logErr(`${unit} not updated (assets were modified)`);
|
|
1006
|
+
for (const asset of orphans) {
|
|
1007
|
+
logErr(`${asset} \u2014 no CHANGELOG.md in any ancestor directory up to the asset root`);
|
|
1008
|
+
}
|
|
1009
|
+
if (stale.length + orphans.length > 0) process.exit(1);
|
|
1010
|
+
});
|
|
1011
|
+
return cmd;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
export { isRecord, makeValidateCommand, scanIdentities };
|
|
1015
|
+
//# sourceMappingURL=chunk-FWAJUWXQ.js.map
|
|
1016
|
+
//# sourceMappingURL=chunk-FWAJUWXQ.js.map
|