@skaile/workspaces 5.17.0 → 5.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/dist/{asset-feeds-MALYFZUM.js → asset-feeds-MKB5JUML.js} +21 -21
- package/dist/{asset-feeds-MALYFZUM.js.map → asset-feeds-MKB5JUML.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +8 -8
- package/dist/asset-manager/index.js +18 -14
- package/dist/asset-manager/installer.js +10 -10
- package/dist/asset-manager/renderers.js +9 -9
- package/dist/asset-manager/src/index.d.ts +122 -5
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/asset-manager/src/installer.d.ts +13 -10
- package/dist/asset-manager/src/installer.d.ts.map +1 -1
- package/dist/asset-manager/src/mcp-config.d.ts +61 -1
- package/dist/asset-manager/src/mcp-config.d.ts.map +1 -1
- package/dist/asset-manager/src/renderers.d.ts.map +1 -1
- package/dist/bridge/drivers/claude-sdk.js +12 -12
- package/dist/bridge/drivers/codex.js +12 -12
- package/dist/bridge/drivers/continue.js +11 -11
- package/dist/bridge/drivers/echo.js +27 -8
- package/dist/bridge/drivers/echo.js.map +1 -1
- package/dist/bridge/drivers/gemini.js +7 -7
- package/dist/bridge/drivers/goose.js +11 -11
- package/dist/bridge/drivers/omp.js +31 -5
- package/dist/bridge/drivers/omp.js.map +1 -1
- package/dist/bridge/drivers/opencode.js +11 -11
- package/dist/bridge/drivers/qwen.js +7 -7
- package/dist/bridge/index.js +14 -14
- package/dist/bridge/src/driver-model-check.d.ts +8 -8
- package/dist/bridge/src/driver-model-check.d.ts.map +1 -1
- package/dist/bridge/src/drivers/echo.d.ts +3 -0
- package/dist/bridge/src/drivers/echo.d.ts.map +1 -1
- package/dist/bridge/src/drivers/omp-models-yml.d.ts +5 -0
- 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 +1 -1
- package/dist/bridge/src/index.d.ts.map +1 -1
- package/dist/{chunk-CWAWYXD5.js → chunk-2ABUJYVI.js} +3 -3
- package/dist/{chunk-CWAWYXD5.js.map → chunk-2ABUJYVI.js.map} +1 -1
- package/dist/{chunk-ZVZTCDUN.js → chunk-2NOLF7B2.js} +37 -9
- package/dist/chunk-2NOLF7B2.js.map +1 -0
- package/dist/{chunk-QSLXB44M.js → chunk-34C2EKWJ.js} +3 -3
- package/dist/{chunk-QSLXB44M.js.map → chunk-34C2EKWJ.js.map} +1 -1
- package/dist/{chunk-3OYOBTY4.js → chunk-3KMREAR2.js} +3 -3
- package/dist/{chunk-3OYOBTY4.js.map → chunk-3KMREAR2.js.map} +1 -1
- package/dist/{chunk-D54T2F54.js → chunk-5TBFN46Z.js} +4 -4
- package/dist/chunk-5TBFN46Z.js.map +1 -0
- package/dist/{chunk-PGZDSDOB.js → chunk-6Z5KTFJT.js} +3 -3
- package/dist/{chunk-PGZDSDOB.js.map → chunk-6Z5KTFJT.js.map} +1 -1
- package/dist/{chunk-WY22FMZF.js → chunk-7ANRSTNR.js} +5 -5
- package/dist/{chunk-WY22FMZF.js.map → chunk-7ANRSTNR.js.map} +1 -1
- package/dist/{chunk-GYZJKZPJ.js → chunk-7FHZB2QU.js} +3 -3
- package/dist/{chunk-GYZJKZPJ.js.map → chunk-7FHZB2QU.js.map} +1 -1
- package/dist/{chunk-QBY74UBH.js → chunk-AIBAOXDU.js} +7 -7
- package/dist/{chunk-QBY74UBH.js.map → chunk-AIBAOXDU.js.map} +1 -1
- package/dist/{chunk-ZPCABSSW.js → chunk-BBWSGVVE.js} +4 -4
- package/dist/{chunk-ZPCABSSW.js.map → chunk-BBWSGVVE.js.map} +1 -1
- package/dist/{chunk-QEX75L77.js → chunk-BO426QWN.js} +13 -7
- package/dist/chunk-BO426QWN.js.map +1 -0
- package/dist/{chunk-46IRZJV4.js → chunk-CD7SVH6W.js} +4 -4
- package/dist/{chunk-46IRZJV4.js.map → chunk-CD7SVH6W.js.map} +1 -1
- package/dist/{chunk-WKEBNB5S.js → chunk-CKBCX3HQ.js} +4 -4
- package/dist/{chunk-WKEBNB5S.js.map → chunk-CKBCX3HQ.js.map} +1 -1
- package/dist/{chunk-H7R7R5BN.js → chunk-CKICWXMU.js} +18 -15
- package/dist/chunk-CKICWXMU.js.map +1 -0
- package/dist/{chunk-YK3XLEQJ.js → chunk-CKNIYIV2.js} +83 -77
- package/dist/chunk-CKNIYIV2.js.map +1 -0
- package/dist/{chunk-SPV2CXJ3.js → chunk-D6UBEYQH.js} +4 -4
- package/dist/{chunk-SPV2CXJ3.js.map → chunk-D6UBEYQH.js.map} +1 -1
- package/dist/{chunk-D5REDKVU.js → chunk-FKU57Q5Q.js} +3 -3
- package/dist/{chunk-D5REDKVU.js.map → chunk-FKU57Q5Q.js.map} +1 -1
- package/dist/{chunk-5SWED2LW.js → chunk-GBYNC5V3.js} +3 -3
- package/dist/{chunk-5SWED2LW.js.map → chunk-GBYNC5V3.js.map} +1 -1
- package/dist/{chunk-YW2BNDSE.js → chunk-GOCWM7FN.js} +22 -4
- package/dist/chunk-GOCWM7FN.js.map +1 -0
- package/dist/{chunk-ZWUJ22RF.js → chunk-GOK4QRJR.js} +16 -23
- package/dist/chunk-GOK4QRJR.js.map +1 -0
- package/dist/{chunk-AP24HESN.js → chunk-H6UVIKQ2.js} +3 -3
- package/dist/{chunk-AP24HESN.js.map → chunk-H6UVIKQ2.js.map} +1 -1
- package/dist/{chunk-ES6ARJPQ.js → chunk-HPVMTX6M.js} +15 -10
- package/dist/chunk-HPVMTX6M.js.map +1 -0
- package/dist/{chunk-BVXXBZWA.js → chunk-IW6F6R2W.js} +24 -15
- package/dist/chunk-IW6F6R2W.js.map +1 -0
- package/dist/{chunk-HUKUYWBJ.js → chunk-JYWW32JI.js} +17 -6
- package/dist/chunk-JYWW32JI.js.map +1 -0
- package/dist/{chunk-5RDZ5JHH.js → chunk-KC6HGWXN.js} +4 -4
- package/dist/{chunk-5RDZ5JHH.js.map → chunk-KC6HGWXN.js.map} +1 -1
- package/dist/{chunk-FACRITOL.js → chunk-KSBDLCZI.js} +8 -4
- package/dist/chunk-KSBDLCZI.js.map +1 -0
- package/dist/{chunk-LQT2IKYY.js → chunk-KY4UXX7M.js} +2 -2
- package/dist/{chunk-LQT2IKYY.js.map → chunk-KY4UXX7M.js.map} +1 -1
- package/dist/{chunk-L6UMSKDF.js → chunk-LW7ZI6EQ.js} +8 -36
- package/dist/chunk-LW7ZI6EQ.js.map +1 -0
- package/dist/{chunk-DR5ZOEYI.js → chunk-OYIENLJI.js} +32 -18
- package/dist/chunk-OYIENLJI.js.map +1 -0
- package/dist/{chunk-EOKWTN4N.js → chunk-PBSN4RTV.js} +44 -29
- package/dist/chunk-PBSN4RTV.js.map +1 -0
- package/dist/{chunk-WXWQNJCT.js → chunk-PUK7TQT4.js} +3 -3
- package/dist/{chunk-WXWQNJCT.js.map → chunk-PUK7TQT4.js.map} +1 -1
- package/dist/{chunk-5DCOG5B5.js → chunk-RD6N2D7I.js} +3 -3
- package/dist/{chunk-5DCOG5B5.js.map → chunk-RD6N2D7I.js.map} +1 -1
- package/dist/{chunk-OXUCYHL5.js → chunk-RP3FZ2T6.js} +53 -16
- package/dist/chunk-RP3FZ2T6.js.map +1 -0
- package/dist/{chunk-6GSE63K2.js → chunk-SRNCN4X2.js} +13 -5
- package/dist/chunk-SRNCN4X2.js.map +1 -0
- package/dist/{chunk-PIC23DDE.js → chunk-T2TQAH2X.js} +42 -11
- package/dist/chunk-T2TQAH2X.js.map +1 -0
- package/dist/{chunk-SXWGLW23.js → chunk-U2FI547Z.js} +4 -4
- package/dist/{chunk-SXWGLW23.js.map → chunk-U2FI547Z.js.map} +1 -1
- package/dist/{chunk-KZWZRNIY.js → chunk-U7V5SIFW.js} +55 -17
- package/dist/chunk-U7V5SIFW.js.map +1 -0
- package/dist/{chunk-EYDRONKO.js → chunk-V3D4HQMS.js} +4 -4
- package/dist/{chunk-EYDRONKO.js.map → chunk-V3D4HQMS.js.map} +1 -1
- package/dist/{chunk-D3PU3C6F.js → chunk-VKPBUPH7.js} +41 -15
- package/dist/chunk-VKPBUPH7.js.map +1 -0
- package/dist/{chunk-W44KA24A.js → chunk-VM3PH7BB.js} +695 -96
- package/dist/chunk-VM3PH7BB.js.map +1 -0
- package/dist/{chunk-HLETG3CX.js → chunk-VOBXINUZ.js} +3 -3
- package/dist/{chunk-HLETG3CX.js.map → chunk-VOBXINUZ.js.map} +1 -1
- package/dist/{chunk-FT4ZHLYR.js → chunk-WDXZA7QW.js} +33 -3
- package/dist/chunk-WDXZA7QW.js.map +1 -0
- package/dist/{chunk-FSSRBWYL.js → chunk-WJCQFNF6.js} +4 -4
- package/dist/chunk-WJCQFNF6.js.map +1 -0
- package/dist/{chunk-2SKPPIV7.js → chunk-WJLYL6RY.js} +5 -5
- package/dist/{chunk-2SKPPIV7.js.map → chunk-WJLYL6RY.js.map} +1 -1
- package/dist/{chunk-MMARPEV7.js → chunk-WMF2C5U7.js} +6 -6
- package/dist/{chunk-MMARPEV7.js.map → chunk-WMF2C5U7.js.map} +1 -1
- package/dist/{chunk-OQN7PCI4.js → chunk-X3AUS4RW.js} +4 -4
- package/dist/{chunk-OQN7PCI4.js.map → chunk-X3AUS4RW.js.map} +1 -1
- package/dist/{chunk-BBRMS4IC.js → chunk-X6GUNN7X.js} +8 -8
- package/dist/{chunk-BBRMS4IC.js.map → chunk-X6GUNN7X.js.map} +1 -1
- package/dist/{chunk-QXA2W6UB.js → chunk-XTO436PV.js} +3 -3
- package/dist/{chunk-QXA2W6UB.js.map → chunk-XTO436PV.js.map} +1 -1
- package/dist/{chunk-QW534EZB.js → chunk-YARXR3CN.js} +53 -8
- package/dist/chunk-YARXR3CN.js.map +1 -0
- package/dist/{chunk-FSLVMZXR.js → chunk-YZ3N7IUU.js} +72 -31
- package/dist/chunk-YZ3N7IUU.js.map +1 -0
- package/dist/{chunk-V5CDPKDA.js → chunk-ZBMC6IAE.js} +44 -27
- package/dist/chunk-ZBMC6IAE.js.map +1 -0
- package/dist/cli/index.js +346 -147
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/asset-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/config.d.ts.map +1 -1
- package/dist/cli/src/commands/integration.d.ts.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
- package/dist/cli/src/commands/plugin/claude-code.d.ts.map +1 -1
- package/dist/cli/src/commands/plugin/codex.d.ts +6 -0
- package/dist/cli/src/commands/plugin/codex.d.ts.map +1 -1
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/cli/src/commands/run.d.ts.map +1 -1
- package/dist/cli/src/commands/serve.d.ts +5 -0
- package/dist/cli/src/commands/serve.d.ts.map +1 -1
- package/dist/cli/src/commands/source.d.ts.map +1 -1
- package/dist/cli/src/commands/validate.d.ts.map +1 -1
- package/dist/cli/src/commands/verify.d.ts.map +1 -1
- package/dist/cli/src/driver-error.d.ts +3 -1
- package/dist/cli/src/driver-error.d.ts.map +1 -1
- package/dist/cli/src/helpers.d.ts +6 -4
- package/dist/cli/src/helpers.d.ts.map +1 -1
- package/dist/cli/src/plugin-store/index.d.ts +6 -0
- package/dist/cli/src/plugin-store/index.d.ts.map +1 -1
- package/dist/cli/src/skill-checks.d.ts +4 -3
- package/dist/cli/src/skill-checks.d.ts.map +1 -1
- package/dist/connectors/config.js +5 -5
- package/dist/connectors/index.js +20 -20
- package/dist/connectors/src/connector-manager.d.ts.map +1 -1
- package/dist/connectors/src/connector-types.d.ts +5 -0
- package/dist/connectors/src/connector-types.d.ts.map +1 -1
- package/dist/connectors/src/watcher.d.ts.map +1 -1
- package/dist/{connectors-CIEIMJY2.js → connectors-YNQ3WJGM.js} +23 -23
- package/dist/{connectors-CIEIMJY2.js.map → connectors-YNQ3WJGM.js.map} +1 -1
- package/dist/core/index.js +7 -7
- package/dist/core/manifest.js +2 -2
- package/dist/core/models.js +1 -1
- package/dist/core/publish-manifest.js +3 -3
- package/dist/core/ref.js +1 -1
- package/dist/core/runtime-assets.js +5 -5
- package/dist/core/src/bind.d.ts +30 -0
- package/dist/core/src/bind.d.ts.map +1 -0
- package/dist/core/src/index.d.ts +4 -3
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/lock.d.ts +11 -2
- package/dist/core/src/lock.d.ts.map +1 -1
- package/dist/core/src/manifest.d.ts.map +1 -1
- package/dist/core/src/models.d.ts +19 -0
- package/dist/core/src/models.d.ts.map +1 -1
- package/dist/core/src/publish-manifest.d.ts +15 -13
- package/dist/core/src/publish-manifest.d.ts.map +1 -1
- package/dist/core/src/store.d.ts +2 -1
- package/dist/core/src/store.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +26 -1
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/store.js +1 -1
- package/dist/core/workspace-config.js +4 -4
- package/dist/deploy/index.js +7 -7
- package/dist/discovery/index.js +5 -5
- package/dist/discovery/src/parse-manifest.d.ts +1 -1
- package/dist/discovery/src/source-config.d.ts +2 -1
- package/dist/discovery/src/source-config.d.ts.map +1 -1
- package/dist/{ensure-sources-I62QMZZP.js → ensure-sources-UJWEZSR3.js} +21 -17
- package/dist/ensure-sources-UJWEZSR3.js.map +1 -0
- package/dist/factory-assets/connectors/box.js +20 -20
- package/dist/factory-assets/connectors/deploy.js +20 -20
- package/dist/factory-assets/connectors/devserver.js +20 -20
- package/dist/factory-assets/connectors/flow/adapter.js +20 -20
- package/dist/factory-assets/connectors/flow/engine.js +9 -9
- package/dist/factory-assets/connectors/flow/run-flow.js +22 -22
- package/dist/factory-assets/connectors/flow.js +20 -20
- package/dist/factory-assets/connectors/git.js +20 -20
- package/dist/factory-assets/connectors/gmail.js +20 -20
- package/dist/factory-assets/connectors/googledrive.js +20 -20
- package/dist/factory-assets/connectors/local.js +20 -20
- package/dist/factory-assets/connectors/mattermost.js +20 -20
- package/dist/factory-assets/connectors/memory.js +20 -20
- package/dist/factory-assets/connectors/minio.js +20 -20
- package/dist/factory-assets/connectors/postgres.js +20 -20
- package/dist/factory-assets/connectors/s3.js +20 -20
- package/dist/factory-assets/connectors/sharepoint.js +20 -20
- package/dist/factory-assets/connectors/sqlite.js +20 -20
- package/dist/factory-assets/connectors/static-server.js +20 -20
- package/dist/factory-assets/connectors/tunnel.js +20 -20
- package/dist/factory-assets/connectors/webdav.js +20 -20
- package/dist/factory-assets/connectors/xstate-store/adapter.d.ts +1 -1
- package/dist/factory-assets/connectors/xstate-store/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/xstate-store.js +20 -20
- package/dist/factory-assets/connectors/xstate.js +20 -20
- package/dist/{flows-YKC53LDP.js → flows-BHY73K3O.js} +12 -12
- package/dist/{flows-YKC53LDP.js.map → flows-BHY73K3O.js.map} +1 -1
- package/dist/{helpers-3FOM37BO.js → helpers-3CG7ZVX4.js} +21 -17
- package/dist/{helpers-3FOM37BO.js.map → helpers-3CG7ZVX4.js.map} +1 -1
- package/dist/library/index.js +11 -11
- 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/manifest-writer.d.ts +17 -1
- package/dist/library/src/manifest-writer.d.ts.map +1 -1
- package/dist/{library-publish-EFKITCGE.js → library-publish-NWWVYJUK.js} +60 -63
- package/dist/library-publish-NWWVYJUK.js.map +1 -0
- package/dist/model-endpoint/index.js +10 -10
- package/dist/model-endpoint/src/server.d.ts.map +1 -1
- package/dist/open-library-7ZG2FFAX.js +42 -0
- package/dist/{open-library-NZUI4XGF.js.map → open-library-7ZG2FFAX.js.map} +1 -1
- package/dist/open-registry-RBELV5YH.js +32 -0
- package/dist/{open-registry-YPRQDUMK.js.map → open-registry-RBELV5YH.js.map} +1 -1
- package/dist/paths-BFM6K2QO.js +22 -0
- package/dist/{paths-P55DTBEK.js.map → paths-BFM6K2QO.js.map} +1 -1
- package/dist/plugin-store-QOQDM24E.js +23 -0
- package/dist/{plugin-store-IPIBZRBX.js.map → plugin-store-QOQDM24E.js.map} +1 -1
- package/dist/{project-2BNFZ2CR.js → project-YQM3I25D.js} +45 -45
- package/dist/{project-2BNFZ2CR.js.map → project-YQM3I25D.js.map} +1 -1
- package/dist/resolver/index.js +8 -8
- package/dist/runner/index.js +37 -37
- package/dist/runner/src/agent.d.ts.map +1 -1
- package/dist/runner/src/capability-roundtrip.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +18 -14
- package/dist/sdk/bridge.js +14 -14
- package/dist/sdk/core.js +7 -7
- package/dist/sdk/flow.js +9 -9
- package/dist/sdk/index.js +37 -37
- package/dist/sdk/resolver.js +8 -8
- package/dist/sdk/runner.js +37 -37
- package/dist/sdk/transport/ws/server.js +19 -1
- package/dist/sdk/transport/ws.js +19 -1
- package/dist/sdk/transport.js +19 -1
- package/dist/{serve-preflight-V5GM33T3.js → serve-preflight-5QMY7DBC.js} +9 -9
- package/dist/{serve-preflight-V5GM33T3.js.map → serve-preflight-5QMY7DBC.js.map} +1 -1
- package/dist/{setup-ZMAPTKJW.js → setup-AAHVAXRA.js} +28 -24
- package/dist/setup-AAHVAXRA.js.map +1 -0
- package/dist/{skills-7G6QCDEM.js → skills-RSZVUIYZ.js} +13 -13
- package/dist/{skills-7G6QCDEM.js.map → skills-RSZVUIYZ.js.map} +1 -1
- package/dist/{source-6BZA34F5.js → source-KWMCMEMB.js} +47 -47
- package/dist/{source-6BZA34F5.js.map → source-KWMCMEMB.js.map} +1 -1
- package/dist/{source-manifest-publish-MJXCSUKT.js → source-manifest-publish-EDYKM4YZ.js} +49 -49
- package/dist/{source-manifest-publish-MJXCSUKT.js.map → source-manifest-publish-EDYKM4YZ.js.map} +1 -1
- package/dist/transport/index.js +19 -1
- package/dist/transport/src/ws/server.d.ts +2 -16
- package/dist/transport/src/ws/server.d.ts.map +1 -1
- package/dist/transport/ws/server.js +19 -1
- package/dist/transport/ws.js +19 -1
- package/dist/tui/index.js +54 -42
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/src/repl.d.ts +4 -1
- 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 -1
- 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 -1
- package/dist/types/src/manifests/skill.d.ts +0 -2
- package/dist/types/src/manifests/skill.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +27 -27
- package/dist/workspace-plugin/adapters/omp.js +32 -18
- package/dist/workspace-plugin/adapters/omp.js.map +1 -1
- package/dist/workspace-plugin/index.js +1 -1
- package/dist/workspace-plugin/src/adapters/claude-code.d.ts +1 -1
- package/dist/workspace-plugin/src/adapters/omp.d.ts +8 -5
- package/dist/workspace-plugin/src/adapters/omp.d.ts.map +1 -1
- package/dist/workspace-plugin/src/plugin.d.ts +7 -1
- package/dist/workspace-plugin/src/plugin.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-6GSE63K2.js.map +0 -1
- package/dist/chunk-BVXXBZWA.js.map +0 -1
- package/dist/chunk-D3PU3C6F.js.map +0 -1
- package/dist/chunk-D54T2F54.js.map +0 -1
- package/dist/chunk-DR5ZOEYI.js.map +0 -1
- package/dist/chunk-EOKWTN4N.js.map +0 -1
- package/dist/chunk-ES6ARJPQ.js.map +0 -1
- package/dist/chunk-FACRITOL.js.map +0 -1
- package/dist/chunk-FSLVMZXR.js.map +0 -1
- package/dist/chunk-FSSRBWYL.js.map +0 -1
- package/dist/chunk-FT4ZHLYR.js.map +0 -1
- package/dist/chunk-H7R7R5BN.js.map +0 -1
- package/dist/chunk-HUKUYWBJ.js.map +0 -1
- package/dist/chunk-KZWZRNIY.js.map +0 -1
- package/dist/chunk-L6UMSKDF.js.map +0 -1
- package/dist/chunk-OXUCYHL5.js.map +0 -1
- package/dist/chunk-PIC23DDE.js.map +0 -1
- package/dist/chunk-QEX75L77.js.map +0 -1
- package/dist/chunk-QW534EZB.js.map +0 -1
- package/dist/chunk-V5CDPKDA.js.map +0 -1
- package/dist/chunk-W44KA24A.js.map +0 -1
- package/dist/chunk-YK3XLEQJ.js.map +0 -1
- package/dist/chunk-YW2BNDSE.js.map +0 -1
- package/dist/chunk-ZVZTCDUN.js.map +0 -1
- package/dist/chunk-ZWUJ22RF.js.map +0 -1
- package/dist/ensure-sources-I62QMZZP.js.map +0 -1
- package/dist/library-publish-EFKITCGE.js.map +0 -1
- package/dist/open-library-NZUI4XGF.js +0 -40
- package/dist/open-registry-YPRQDUMK.js +0 -32
- package/dist/paths-P55DTBEK.js +0 -22
- package/dist/plugin-store-IPIBZRBX.js +0 -23
- package/dist/setup-ZMAPTKJW.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { withFsDeadline, tryWithFsDeadline, walkDir } from './chunk-
|
|
1
|
+
import { withFsDeadline, tryWithFsDeadline, walkDir } from './chunk-GOCWM7FN.js';
|
|
2
2
|
import { createLogger } from './chunk-BOFL7GIF.js';
|
|
3
3
|
import { parse } from 'yaml';
|
|
4
4
|
import { readFile, stat } from 'fs/promises';
|
|
@@ -329,5 +329,5 @@ function validateFlowVersions(nodes, skillVersions) {
|
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
export { buildRequiresPreamble, parseCompactionDirectives, parseSkillFrontmatter, parseSkillRequirements, validateConnectorRequirements, validateFlowVersions, validateRequirements };
|
|
332
|
-
//# sourceMappingURL=chunk-
|
|
333
|
-
//# sourceMappingURL=chunk-
|
|
332
|
+
//# sourceMappingURL=chunk-FKU57Q5Q.js.map
|
|
333
|
+
//# sourceMappingURL=chunk-FKU57Q5Q.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../resolver/src/parser.ts","../resolver/src/preamble.ts","../resolver/src/validator.ts","../resol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,IAAI,CAAC,KAAK,gBAAA,EAAkB;AAE5B,IAAA,MAAM,MAAA,GAAS,aAAA,CAAc,GAAA,CAAI,IAAA,CAAK,OAAO,CAAA,IAAK,EAAA;AAClD,IAAA,MAAM,YAAY,IAAA,CAAK,gBAAA;AAGvB,IAAA,MAAM,UAAA,GAAa,UAAA,CAAW,SAAS,CAAA,KAAM,IAAA;AAC7C,IAAA,MAAM,WAAA,GAAc,MAAA,KAAW,EAAA,IAAM,KAAA,CAAM,MAAM,CAAA,KAAM,IAAA;AACvD,IAAA,MAAM,WAAA,GAAc,UAAA,IAAc,WAAA,IAAe,SAAA,CAAU,QAAQ,SAAS,CAAA;AAE5E,IAAA,MAAA,CAAO,IAAA,CAAK;AAAA,MACV,QAAQ,IAAA,CAAK,MAAA;AAAA,MACb,SAAS,IAAA,CAAK,OAAA;AAAA,MACd,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,EAAW;AAAA,KACZ,CAAA;AAAA,EACH;AAEA,EAAA,OAAO,MAAA;AACT","file":"chunk-D5REDKVU.js","sourcesContent":["import { parse as parseYaml } from \"yaml\";\nimport type { ConnectorRequirement, InputField, SkillRequirements } from \"./types.js\";\n\n/**\n * Extract YAML frontmatter from a SKILL.md string.\n *\n * Frontmatter is delimited by leading `---` fences. Returns the parsed object,\n * or an empty object `{}` if no frontmatter block is found or if the YAML is malformed.\n * Errors are silently swallowed — callers should treat an empty result as \"no requirements\".\n *\n * @param content - Raw SKILL.md file content (full string, including `---` fences)\n * @returns Parsed frontmatter object, or `{}` on absence or parse failure\n *\n * @docLink packages/resolver/api-reference#parseskill-frontmatter\n */\nexport function parseSkillFrontmatter(content: string): Record<string, any> {\n const match = content.match(/^---\\n([\\s\\S]*?)\\n---/);\n if (!match) return {};\n try {\n return parseYaml(match[1]!) ?? {};\n } catch {\n return {};\n }\n}\n\n/**\n * Parse skill requirements from raw SKILL.md content into a `SkillRequirements` object.\n *\n * Supports two frontmatter formats:\n * 1. **New format** — `metadata.prerequisites` with explicit\n * `files`, `inputs_required`, `inputs_optional`, `reads`, `produces`, and `resources` arrays.\n * 2. **Legacy format** — `metadata.user_inputs.dialog[]` array, automatically promoted to\n * `inputs_required` / `inputs_optional` based on each entry's `required` flag.\n *\n * Returns empty requirements `{ files: [], inputs_required: [], inputs_optional: [], reads: [], produces: [], resources: [] }`\n * when no recognisable prerequisites section is found.\n *\n * @param content - Raw SKILL.md file content (full string, including `---` fences)\n * @returns Structured `SkillRequirements` (never throws)\n *\n * @docLink packages/resolver/api-reference#parseskill-requirements\n */\nexport function parseSkillRequirements(content: string): SkillRequirements {\n const fm = parseSkillFrontmatter(content);\n const meta = fm.metadata ?? {};\n const prerequisites = meta.prerequisites ?? {};\n\n const empty: SkillRequirements = {\n files: [],\n inputs_required: [],\n inputs_optional: [],\n reads: [],\n produces: [],\n resources: [],\n connectors: [],\n };\n\n // New format: metadata.prerequisites\n if (\n prerequisites.files ||\n prerequisites.inputs_required ||\n prerequisites.inputs_optional ||\n prerequisites.reads ||\n prerequisites.produces ||\n prerequisites.resources ||\n prerequisites.connectors\n ) {\n return {\n files: (prerequisites.files ?? []).map((f: any) => ({\n path: f.path,\n gate: f.gate ?? \"hard\",\n description: f.description ?? \"\",\n ...(f.min_entries != null ? { min_entries: f.min_entries } : {}),\n })),\n inputs_required: (prerequisites.inputs_required ?? []).map(normalizeInputField(true)),\n inputs_optional: (prerequisites.inputs_optional ?? []).map(normalizeInputField(false)),\n reads: (prerequisites.reads ?? []).map((r: any) => ({\n path: r.path,\n description: r.description ?? \"\",\n })),\n produces: (prerequisites.produces ?? []).map((p: any) => ({\n path: p.path,\n description: p.description ?? \"\",\n })),\n resources: (prerequisites.resources ?? []).map((r: any) => ({\n id: r.id,\n ...(r.operations ? { operations: r.operations } : {}),\n optional: r.optional ?? false,\n ...(r.description ? { description: r.description } : {}),\n })),\n connectors: parseConnectorRequirements(prerequisites.connectors),\n };\n }\n\n // Legacy format: metadata.user_inputs.dialog[]\n const dialog = meta.user_inputs?.dialog;\n if (Array.isArray(dialog)) {\n const required: InputField[] = [];\n const optional: InputField[] = [];\n for (const d of dialog) {\n const field = normalizeInputField(d.required ?? false)(d);\n if (d.required) required.push(field);\n else optional.push(field);\n }\n return { ...empty, inputs_required: required, inputs_optional: optional, resources: [] };\n }\n\n return empty;\n}\n\n/**\n * Extract compaction directives from a SKILL.md markdown body.\n *\n * Scans the markdown body (not frontmatter) for a `## Compaction Directives` section\n * and returns each bullet point as a trimmed string. Compaction directives are hints\n * the agent uses to summarise context when the conversation history grows long.\n * Returns an empty array when the section is absent.\n *\n * @param content - Raw SKILL.md file content (full string including frontmatter and body)\n * @returns Array of directive strings extracted from the bullet list, or `[]` if none found\n *\n * @docLink packages/resolver/api-reference#parse-compaction-directives\n */\nexport function parseCompactionDirectives(content: string): string[] {\n const headerIdx = content.search(/^## Compaction Directives/m);\n if (headerIdx === -1) return [];\n\n // Header on the last line (no trailing newline) → no body to scan.\n const newlineIdx = content.indexOf(\"\\n\", headerIdx);\n if (newlineIdx === -1) return [];\n const bodyStart = newlineIdx + 1;\n const rest = content.slice(bodyStart);\n const nextSection = rest.search(/^##\\s/m);\n const sectionBody = nextSection === -1 ? rest : rest.slice(0, nextSection);\n\n const bullets: string[] = [];\n for (const line of sectionBody.split(\"\\n\")) {\n const match = line.match(/^\\s*[-*]\\s+(.+)/);\n if (match) bullets.push(match[1].trim());\n }\n return bullets;\n}\n\nfunction normalizeInputField(defaultRequired: boolean) {\n return (d: any): InputField => ({\n // UserInputSchema permits `key` or `id`; `prompt` is the legacy label alias.\n id: d.id ?? d.key,\n label: d.label ?? d.prompt ?? d.id ?? d.key,\n type: d.type ?? \"text\",\n required: d.required ?? defaultRequired,\n ...(d.options ? { options: d.options } : {}),\n ...(d.default != null ? { default: d.default } : {}),\n ...(d.hint ? { hint: d.hint } : {}),\n ...(d.schema ? { schema: d.schema } : {}),\n });\n}\n\nfunction parseConnectorRequirements(raw: unknown): ConnectorRequirement[] {\n if (!Array.isArray(raw)) return [];\n return raw\n .filter((c): c is Record<string, unknown> => typeof c === \"object\" && c !== null)\n .map((c) => ({\n driver: String(c.driver ?? \"\"),\n ...(c.access === \"read-write\"\n ? { access: \"read-write\" as const }\n : { access: \"read-only\" as const }),\n }))\n .filter((c) => c.driver.length > 0);\n}\n","import type { SkillRequirements } from \"./types.js\";\n\n/**\n * Generate a DSL-format preamble from skill requirements.\n *\n * The preamble is prepended to the skill prompt when the skill runs standalone\n * (without an orchestrator), giving the agent an explicit checklist of what to\n * verify before starting work. Each section maps to a requirement category:\n *\n * - `REQUIRES` — file/directory gates (`hard:` or `soft:` prefix)\n * - `INPUT` — user input fields, with a pointer to `input.json` if `skillId` is provided\n * - `READS` — informational read sources (not gated)\n * - `WRITES` — files the skill will produce\n * - `RESOURCE` — runtime resource dependencies\n *\n * Sections with no entries are omitted. Returns an empty string when all\n * requirement arrays are empty.\n *\n * @param requirements - Parsed requirements (output of `parseSkillRequirements`)\n * @param skillId - Optional skill identifier; when provided, the INPUT section includes\n * the canonical `input.json` path so the agent knows where to read collected values\n * @returns Multi-section DSL string, or `\"\"` if there are no requirements to list\n *\n * @example\n * ```ts\n * const preamble = buildRequiresPreamble(requirements, \"cf_overview\");\n * const fullPrompt = preamble ? `${preamble}\\n\\n${skillBody}` : skillBody;\n * ```\n *\n * @docLink packages/resolver/api-reference#build-requires-preamble\n */\nexport function buildRequiresPreamble(requirements: SkillRequirements, skillId?: string): string {\n const sections: string[] = [];\n\n pushSection(sections, buildRequiresSection(requirements));\n pushSection(sections, buildInputSection(requirements, skillId));\n pushSection(sections, buildReadsSection(requirements));\n pushSection(sections, buildWritesSection(requirements));\n pushSection(sections, buildResourceSection(requirements));\n\n return sections.join(\"\\n\\n\");\n}\n\n/** Append a section to the list when it produced output. */\nfunction pushSection(sections: string[], section: string | null): void {\n if (section !== null) sections.push(section);\n}\n\n/** REQUIRES section (file gates). Returns `null` when there are no file gates. */\nfunction buildRequiresSection(requirements: SkillRequirements): string | null {\n if (requirements.files.length === 0) return null;\n const lines = [\"REQUIRES\"];\n for (const f of requirements.files) {\n const prefix = f.gate === \"hard\" ? \"hard\" : \"soft\";\n lines.push(` ${prefix}: ${f.path} — ${f.description}`);\n }\n return lines.join(\"\\n\");\n}\n\n/** INPUT section (user inputs). Returns `null` when there are no inputs. */\nfunction buildInputSection(requirements: SkillRequirements, skillId?: string): string | null {\n const allInputs = [...requirements.inputs_required, ...requirements.inputs_optional];\n if (allInputs.length === 0) return null;\n const lines = [\"INPUT\"];\n if (skillId) {\n lines.push(` Read from: _concept/_grounding/${skillId}/input.json`);\n lines.push(\n ` If input.json is missing, ask the user for the following values and write the file:`,\n );\n }\n for (const input of allInputs) {\n const req = input.required ? \"(required)\" : \"(optional)\";\n const opts = input.options ? ` [${input.options.join(\" | \")}]` : \"\";\n const def = input.default != null ? ` default: ${input.default}` : \"\";\n lines.push(` - ${input.id}: ${input.label} ${req}${opts}${def}`);\n if (input.hint) lines.push(` hint: ${input.hint}`);\n }\n return lines.join(\"\\n\");\n}\n\n/** READS section. Returns `null` when there are no read sources. */\nfunction buildReadsSection(requirements: SkillRequirements): string | null {\n if (requirements.reads.length === 0) return null;\n const lines = [\"READS\"];\n for (const r of requirements.reads) {\n lines.push(` ? ${r.path} — ${r.description}`);\n }\n return lines.join(\"\\n\");\n}\n\n/** WRITES section (produces). Returns `null` when there is nothing produced. */\nfunction buildWritesSection(requirements: SkillRequirements): string | null {\n if (requirements.produces.length === 0) return null;\n const lines = [\"WRITES\"];\n for (const p of requirements.produces) {\n lines.push(` ${p.path} — ${p.description}`);\n }\n return lines.join(\"\\n\");\n}\n\n/** RESOURCE section. Returns `null` when there are no resources. */\nfunction buildResourceSection(requirements: SkillRequirements): string | null {\n if (!requirements.resources || requirements.resources.length === 0) return null;\n const lines = [\"RESOURCE\"];\n for (const r of requirements.resources) {\n const req = r.optional ? \"(optional)\" : \"(required)\";\n const ops = r.operations ? ` ops: [${r.operations.join(\", \")}]` : \"\";\n lines.push(` ${r.id} ${req}${ops}`);\n if (r.description) lines.push(` — ${r.description}`);\n }\n return lines.join(\"\\n\");\n}\n","import { readFile, stat } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport {\n tryWithFsDeadline,\n walkDir,\n type WalkTruncation,\n withFsDeadline,\n} from \"@skaile/workspaces/core\";\nimport { createLogger } from \"@skaile/workspaces/core/logging\";\nimport type {\n ConnectorRequirement,\n FileCheck,\n InputCheck,\n NodeOverrides,\n ReadCheck,\n RequirementsReport,\n ResourceCheck,\n SkillInputFile,\n SkillRequirements,\n} from \"./types.js\";\n\nlet validatorLogger: ReturnType<typeof createLogger> | undefined;\n\nfunction log(): ReturnType<typeof createLogger> {\n validatorLogger ??= createLogger({ kind: \"runner\", subkind: \"skill-requirements\" });\n return validatorLogger;\n}\n\n/** Best-effort existence probe. A missing path, an unreadable one, and an\n * unresponsive mount are all \"not usable here\" for a requirement check. */\nasync function pathExists(target: string): Promise<boolean> {\n return tryWithFsDeadline(\n `stat ${target}`,\n async () => {\n await stat(target);\n return true;\n },\n false,\n );\n}\n\n/**\n * Validate skill requirements against the filesystem and collected inputs.\n *\n * File checks resolve paths relative to `projectDir`. Hard-gate files that are absent\n * set `satisfied: false` on the returned report; soft-gate misses are recorded but do not block.\n * Input checks read `_concept/_grounding/{skillId}/input.json`; missing files are treated as\n * no inputs collected. Resource checks are always recorded as `available: true` — actual\n * availability must be confirmed by the runner's `ResourceManager`.\n *\n * **Async and bounded since #454.** `projectDir` reaches this function straight\n * from the agent — `workspace_check_skill_requirements` takes `target_dir` as a\n * tool argument — so it can be `/skaile/workspace`, the rclone FUSE mount. Every\n * probe is now awaited and deadline-bounded, and the `min_entries` count walks\n * through the bounded {@link walkDir}, so a wedged mount or a symlink cycle\n * costs one failed tool call instead of the whole `skaile serve` event loop.\n *\n * @param skillId - Canonical skill identifier, used to locate `input.json`\n * @param requirements - Parsed requirements from SKILL.md (`parseSkillRequirements` output)\n * @param projectDir - Absolute path to the project root directory\n * @param overrides - Optional overrides (SDK only; a v2 flow file cannot carry them); paths in `skip_checks` are treated as present\n * @param producesIndex - Maps file paths to the skill ID that produces them, enabling \"produced by\" hints in the report\n * @returns `RequirementsReport` with per-check results and an overall `satisfied` flag\n *\n * @docLink packages/resolver/api-reference#validate-requirements\n */\nexport async function validateRequirements(\n skillId: string,\n requirements: SkillRequirements,\n projectDir: string,\n overrides?: NodeOverrides,\n producesIndex?: Map<string, string>,\n): Promise<RequirementsReport> {\n const skipSet = new Set(overrides?.skip_checks ?? []);\n\n // Check files. Serial on purpose: `projectDir` may be one network mount, and\n // fanning every probe out concurrently multiplies the queue depth on exactly\n // the resource that is already the bottleneck.\n const files: FileCheck[] = [];\n for (const req of requirements.files) {\n if (skipSet.has(req.path)) {\n files.push({ path: req.path, gate: req.gate, exists: true, description: req.description });\n continue;\n }\n\n const fullPath = path.join(projectDir, req.path);\n const check: FileCheck = {\n path: req.path,\n gate: req.gate,\n exists: false,\n description: req.description,\n producedBy: producesIndex?.get(req.path),\n };\n\n if (req.min_entries != null) {\n const counted = await checkDirectoryMinEntries(fullPath, req.min_entries);\n check.exists = counted.satisfied;\n if (counted.truncated) check.truncated = true;\n } else {\n check.exists = await pathExists(fullPath);\n }\n\n files.push(check);\n }\n\n // Check inputs — look for _concept/_grounding/{skillId}/input.json\n const inputFile = path.join(projectDir, \"_concept\", \"_grounding\", skillId, \"input.json\");\n let collectedValues: Record<string, any> = {};\n try {\n const raw = await withFsDeadline(`readFile ${inputFile}`, () => readFile(inputFile, \"utf-8\"));\n const parsed = JSON.parse(raw) as SkillInputFile;\n collectedValues = parsed.values ?? {};\n } catch {\n // No input file — all inputs are missing\n }\n\n const allInputs = [\n ...requirements.inputs_required.map((f) => ({ field: f, required: true })),\n ...requirements.inputs_optional.map((f) => ({ field: f, required: false })),\n ];\n\n const inputs: InputCheck[] = allInputs.map(({ field, required }) => ({\n id: field.id,\n required,\n present: field.id in collectedValues,\n field,\n }));\n\n // Check reads (informational only)\n const reads: ReadCheck[] = [];\n for (const r of requirements.reads) {\n reads.push({\n path: r.path,\n exists: await pathExists(path.join(projectDir, r.path)),\n description: r.description,\n });\n }\n\n // Check resources (validated at a higher level if a ResourceManager is available;\n // here we just record them in the report with unknown status)\n const resources: ResourceCheck[] = (requirements.resources ?? []).map((r) => ({\n id: r.id,\n available: true, // Actual availability checked by runner with ResourceManager\n missingOps: [],\n optional: r.optional ?? false,\n }));\n\n // Satisfaction: all hard file gates pass AND all required inputs present\n const hardFilesSatisfied = files.filter((f) => f.gate === \"hard\").every((f) => f.exists);\n\n const requiredInputsSatisfied = inputs.filter((i) => i.required).every((i) => i.present);\n\n const requiredResourcesSatisfied = resources.filter((r) => !r.optional).every((r) => r.available);\n\n return {\n skillId,\n satisfied: hardFilesSatisfied && requiredInputsSatisfied && requiredResourcesSatisfied,\n files,\n inputs,\n reads,\n resources,\n };\n}\n\n/**\n * A warning produced by `validateConnectorRequirements` when a skill's declared\n * connector requirement is not satisfied by the connectors in skaile.yaml.\n * Each warning covers either a missing driver or an insufficient access level.\n *\n * @docLink packages/resolver/api-reference#connector-validation-warning\n */\nexport interface ConnectorValidationWarning {\n /** Driver name that triggered the warning. */\n driver: string;\n /** Human-readable explanation of the gap, including a remediation command where applicable. */\n message: string;\n}\n\n/** Minimal structural type accepted by validateConnectorRequirements. Compatible with both\n * ConnectorDeclaration shapes in @skaile/workspaces/core and @skaile/workspaces/connectors. */\ninterface AvailableConnector {\n driver: string;\n access?: \"read-only\" | \"read-write\";\n}\n\n/**\n * Check that all connector requirements declared in a skill's SKILL.md are\n * satisfied by the connectors declared in skaile.yaml.\n *\n * Returns one warning per gap — either a missing driver or an insufficient\n * access level. This is a pre-flight advisory; no runtime enforcement is done.\n *\n * @param requirements - Connector requirements from `parseSkillRequirements().connectors`\n * @param available - Connector declarations from `skaile.yaml` (via `loadConnectorDeclarations`)\n * @returns Array of warnings — one per gap. Empty array when all requirements are satisfied.\n *\n * @docLink packages/resolver/api-reference#validate-connector-requirements\n */\nexport function validateConnectorRequirements(\n requirements: ConnectorRequirement[],\n available: AvailableConnector[],\n): ConnectorValidationWarning[] {\n const warnings: ConnectorValidationWarning[] = [];\n\n for (const req of requirements) {\n const matches = available.filter((a) => a.driver === req.driver);\n\n if (matches.length === 0) {\n warnings.push({\n driver: req.driver,\n message:\n `Skill requires connector driver \"${req.driver}\" but none is declared in skaile.yaml. ` +\n `Run: skaile connector add ${req.driver}`,\n });\n continue;\n }\n\n if (req.access === \"read-write\") {\n const hasReadWrite = matches.some((m) => (m.access ?? \"read-only\") === \"read-write\");\n if (!hasReadWrite) {\n warnings.push({\n driver: req.driver,\n message:\n `Skill requires \"${req.driver}\" with read-write access, but all declared instances ` +\n `are read-only. Update access in skaile.yaml.`,\n });\n }\n }\n }\n\n return warnings;\n}\n\n/**\n * Does `dirPath` hold at least `minEntries` files, counted recursively?\n *\n * `truncated` is set when a walk bound was hit *and* the count still fell\n * short: the number is then a floor, not the truth, so `satisfied: false` is\n * \"we could not prove it\" rather than \"there are not enough files\". Reaching\n * `minEntries` short-circuits the walk, so the common case never pays for the\n * whole tree and a bound hit after that point is irrelevant.\n */\nasync function checkDirectoryMinEntries(\n dirPath: string,\n minEntries: number,\n): Promise<{ satisfied: boolean; truncated: boolean }> {\n const st = await tryWithFsDeadline(`stat ${dirPath}`, () => stat(dirPath), null);\n if (!st?.isDirectory()) return { satisfied: false, truncated: false };\n\n const { count, truncation } = await countFilesRecursive(dirPath, minEntries);\n const satisfied = count >= minEntries;\n if (!satisfied && truncation) {\n log().warn(\"min_entries count truncated — result is a lower bound, not the file count\", {\n dirPath,\n minEntries,\n count,\n ...truncation,\n });\n }\n return { satisfied, truncated: !satisfied && truncation !== undefined };\n}\n\n/**\n * Count files under `dirPath`, stopping at `limit`.\n *\n * Delegates to core's {@link walkDir} rather than recursing here: `dirPath` is\n * agent-supplied and can be a network mount, so the walk needs the deadline per\n * `opendir`, the depth / entry / wall-clock bounds, and the visited-inode cycle\n * guard that walker already owns. The pre-#454 `readdirSync` recursion had none\n * of them and recursed forever on `a/link -> a`.\n *\n * Inheriting `walkDir` also inherits its skip list: `.git` and `node_modules`\n * no longer count toward `min_entries`, which is what a prerequisite like\n * \"at least 3 feature files\" meant in the first place.\n */\nasync function countFilesRecursive(\n dirPath: string,\n limit: number,\n): Promise<{ count: number; truncation?: WalkTruncation }> {\n let count = 0;\n let truncation: WalkTruncation | undefined;\n for await (const _entry of walkDir(dirPath, {\n onTruncate: (info) => {\n truncation ??= info;\n },\n })) {\n count++;\n // Enough is enough — no reason to keep walking a large tree (or a wedged\n // mount) once the requirement is already met.\n if (count >= limit) return { count };\n }\n return { count, truncation };\n}\n","import { satisfies, valid, validRange } from \"semver\";\n\n/**\n * Result of a single flow-node version pin check.\n * Returned in the array produced by `validateFlowVersions()` for every\n * node that declares a `requestedVersion`.\n *\n * @docLink packages/resolver/api-reference#version-check\n */\nexport interface VersionCheck {\n /** Flow node identifier. */\n nodeId: string;\n /** Canonical skill identifier. */\n skillId: string;\n /** Semver range from the flow node (e.g. \"^1.0.0\") */\n requested: string;\n /** Version from the skill's frontmatter */\n actual: string;\n /** Whether `actual` satisfies the `requested` semver range. */\n satisfied: boolean;\n}\n\n/**\n * Minimal descriptor for a flow node that optionally pins a skill version.\n * Passed as input to `validateFlowVersions()`. Nodes without `requestedVersion`\n * are skipped during version checking.\n *\n * @docLink packages/resolver/api-reference#flow-version-node\n */\nexport interface FlowVersionNode {\n /** Flow node identifier. */\n nodeId: string;\n /** Canonical skill identifier referenced by this node. */\n skillId: string;\n /** Optional semver range the node requires (e.g. `\"^1.2.0\"`). Omit to skip version checking. */\n requestedVersion?: string;\n}\n\n/**\n * Validate flow node version pins against discovered skill versions.\n *\n * Only checks nodes that declare a `requestedVersion`. Nodes without a\n * version pin are skipped entirely (no entry is produced for those nodes).\n * A check is marked `satisfied: false` when the range is invalid, the actual\n * version string is not valid semver, or the version does not satisfy the range.\n *\n * @param nodes - Flow nodes to check; only those with `requestedVersion` are evaluated\n * @param skillVersions - Map from skill ID to the semver version string in its frontmatter\n * @returns Array of `VersionCheck` results, one per node that declared a version pin\n *\n * @docLink packages/resolver/api-reference#validate-flow-versions\n */\nexport function validateFlowVersions(\n nodes: FlowVersionNode[],\n skillVersions: Map<string, string>,\n): VersionCheck[] {\n const checks: VersionCheck[] = [];\n\n for (const node of nodes) {\n if (!node.requestedVersion) continue;\n\n const actual = skillVersions.get(node.skillId) ?? \"\";\n const requested = node.requestedVersion;\n\n // Invalid range or missing/invalid actual version → not satisfied\n const rangeValid = validRange(requested) !== null;\n const actualValid = actual !== \"\" && valid(actual) !== null;\n const isSatisfied = rangeValid && actualValid && satisfies(actual, requested);\n\n checks.push({\n nodeId: node.nodeId,\n skillId: node.skillId,\n requested,\n actual,\n satisfied: isSatisfied,\n });\n }\n\n return checks;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../resolver/src/parser.ts","../resolver/src/preamble.ts","../resolver/src/validator.ts","../resolver/src/version.ts"],"names":["parseYaml"],"mappings":";;;;;;;AAeO,SAAS,sBAAsB,OAAA,EAAsC;AAC1E,EAAA,MAAM,KAAA,GAAQ,OAAA,CAAQ,KAAA,CAAM,uBAAuB,CAAA;AACnD,EAAA,IAAI,CAAC,KAAA,EAAO,OAAO,EAAC;AACpB,EAAA,IAAI;AACF,IAAA,OAAOA,KAAA,CAAU,KAAA,CAAM,CAAC,CAAE,KAAK,EAAC;AAAA,EAClC,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,EAAC;AAAA,EACV;AACF;AAmBO,SAAS,uBAAuB,OAAA,EAAoC;AACzE,EAAA,MAAM,EAAA,GAAK,sBAAsB,OAAO,CAAA;AACxC,EAAA,MAAM,IAAA,GAAO,EAAA,CAAG,QAAA,IAAY,EAAC;AAC7B,EAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,aAAA,IAAiB,EAAC;AAE7C,EAAA,MAAM,KAAA,GAA2B;AAAA,IAC/B,OAAO,EAAC;AAAA,IACR,iBAAiB,EAAC;AAAA,IAClB,iBAAiB,EAAC;AAAA,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as parseYaml } from \"yaml\";\nimport type { ConnectorRequirement, InputField, SkillRequirements } from \"./types.js\";\n\n/**\n * Extract YAML frontmatter from a SKILL.md string.\n *\n * Frontmatter is delimited by leading `---` fences. Returns the parsed object,\n * or an empty object `{}` if no frontmatter block is found or if the YAML is malformed.\n * Errors are silently swallowed — callers should treat an empty result as \"no requirements\".\n *\n * @param content - Raw SKILL.md file content (full string, including `---` fences)\n * @returns Parsed frontmatter object, or `{}` on absence or parse failure\n *\n * @docLink packages/resolver/api-reference#parseskill-frontmatter\n */\nexport function parseSkillFrontmatter(content: string): Record<string, any> {\n const match = content.match(/^---\\n([\\s\\S]*?)\\n---/);\n if (!match) return {};\n try {\n return parseYaml(match[1]!) ?? {};\n } catch {\n return {};\n }\n}\n\n/**\n * Parse skill requirements from raw SKILL.md content into a `SkillRequirements` object.\n *\n * Supports two frontmatter formats:\n * 1. **New format** — `metadata.prerequisites` with explicit\n * `files`, `inputs_required`, `inputs_optional`, `reads`, `produces`, and `resources` arrays.\n * 2. **Legacy format** — `metadata.user_inputs.dialog[]` array, automatically promoted to\n * `inputs_required` / `inputs_optional` based on each entry's `required` flag.\n *\n * Returns empty requirements `{ files: [], inputs_required: [], inputs_optional: [], reads: [], produces: [], resources: [] }`\n * when no recognisable prerequisites section is found.\n *\n * @param content - Raw SKILL.md file content (full string, including `---` fences)\n * @returns Structured `SkillRequirements` (never throws)\n *\n * @docLink packages/resolver/api-reference#parseskill-requirements\n */\nexport function parseSkillRequirements(content: string): SkillRequirements {\n const fm = parseSkillFrontmatter(content);\n const meta = fm.metadata ?? {};\n const prerequisites = meta.prerequisites ?? {};\n\n const empty: SkillRequirements = {\n files: [],\n inputs_required: [],\n inputs_optional: [],\n reads: [],\n produces: [],\n resources: [],\n connectors: [],\n };\n\n // New format: metadata.prerequisites\n if (\n prerequisites.files ||\n prerequisites.inputs_required ||\n prerequisites.inputs_optional ||\n prerequisites.reads ||\n prerequisites.produces ||\n prerequisites.resources ||\n prerequisites.connectors\n ) {\n return {\n files: (prerequisites.files ?? []).map((f: any) => ({\n path: f.path,\n gate: f.gate ?? \"hard\",\n description: f.description ?? \"\",\n ...(f.min_entries != null ? { min_entries: f.min_entries } : {}),\n })),\n inputs_required: (prerequisites.inputs_required ?? []).map(normalizeInputField(true)),\n inputs_optional: (prerequisites.inputs_optional ?? []).map(normalizeInputField(false)),\n reads: (prerequisites.reads ?? []).map((r: any) => ({\n path: r.path,\n description: r.description ?? \"\",\n })),\n produces: (prerequisites.produces ?? []).map((p: any) => ({\n path: p.path,\n description: p.description ?? \"\",\n })),\n resources: (prerequisites.resources ?? []).map((r: any) => ({\n id: r.id,\n ...(r.operations ? { operations: r.operations } : {}),\n optional: r.optional ?? false,\n ...(r.description ? { description: r.description } : {}),\n })),\n connectors: parseConnectorRequirements(prerequisites.connectors),\n };\n }\n\n // Legacy format: metadata.user_inputs.dialog[]\n const dialog = meta.user_inputs?.dialog;\n if (Array.isArray(dialog)) {\n const required: InputField[] = [];\n const optional: InputField[] = [];\n for (const d of dialog) {\n const field = normalizeInputField(d.required ?? false)(d);\n if (d.required) required.push(field);\n else optional.push(field);\n }\n return { ...empty, inputs_required: required, inputs_optional: optional, resources: [] };\n }\n\n return empty;\n}\n\n/**\n * Extract compaction directives from a SKILL.md markdown body.\n *\n * Scans the markdown body (not frontmatter) for a `## Compaction Directives` section\n * and returns each bullet point as a trimmed string. Compaction directives are hints\n * the agent uses to summarise context when the conversation history grows long.\n * Returns an empty array when the section is absent.\n *\n * @param content - Raw SKILL.md file content (full string including frontmatter and body)\n * @returns Array of directive strings extracted from the bullet list, or `[]` if none found\n *\n * @docLink packages/resolver/api-reference#parse-compaction-directives\n */\nexport function parseCompactionDirectives(content: string): string[] {\n const headerIdx = content.search(/^## Compaction Directives/m);\n if (headerIdx === -1) return [];\n\n // Header on the last line (no trailing newline) → no body to scan.\n const newlineIdx = content.indexOf(\"\\n\", headerIdx);\n if (newlineIdx === -1) return [];\n const bodyStart = newlineIdx + 1;\n const rest = content.slice(bodyStart);\n const nextSection = rest.search(/^##\\s/m);\n const sectionBody = nextSection === -1 ? rest : rest.slice(0, nextSection);\n\n const bullets: string[] = [];\n for (const line of sectionBody.split(\"\\n\")) {\n const match = line.match(/^\\s*[-*]\\s+(.+)/);\n if (match) bullets.push(match[1].trim());\n }\n return bullets;\n}\n\nfunction normalizeInputField(defaultRequired: boolean) {\n return (d: any): InputField => ({\n // UserInputSchema permits `key` or `id`; `prompt` is the legacy label alias.\n id: d.id ?? d.key,\n label: d.label ?? d.prompt ?? d.id ?? d.key,\n type: d.type ?? \"text\",\n required: d.required ?? defaultRequired,\n ...(d.options ? { options: d.options } : {}),\n ...(d.default != null ? { default: d.default } : {}),\n ...(d.hint ? { hint: d.hint } : {}),\n ...(d.schema ? { schema: d.schema } : {}),\n });\n}\n\nfunction parseConnectorRequirements(raw: unknown): ConnectorRequirement[] {\n if (!Array.isArray(raw)) return [];\n return raw\n .filter((c): c is Record<string, unknown> => typeof c === \"object\" && c !== null)\n .map((c) => ({\n driver: String(c.driver ?? \"\"),\n ...(c.access === \"read-write\"\n ? { access: \"read-write\" as const }\n : { access: \"read-only\" as const }),\n }))\n .filter((c) => c.driver.length > 0);\n}\n","import type { SkillRequirements } from \"./types.js\";\n\n/**\n * Generate a DSL-format preamble from skill requirements.\n *\n * The preamble is prepended to the skill prompt when the skill runs standalone\n * (without an orchestrator), giving the agent an explicit checklist of what to\n * verify before starting work. Each section maps to a requirement category:\n *\n * - `REQUIRES` — file/directory gates (`hard:` or `soft:` prefix)\n * - `INPUT` — user input fields, with a pointer to `input.json` if `skillId` is provided\n * - `READS` — informational read sources (not gated)\n * - `WRITES` — files the skill will produce\n * - `RESOURCE` — runtime resource dependencies\n *\n * Sections with no entries are omitted. Returns an empty string when all\n * requirement arrays are empty.\n *\n * @param requirements - Parsed requirements (output of `parseSkillRequirements`)\n * @param skillId - Optional skill identifier; when provided, the INPUT section includes\n * the canonical `input.json` path so the agent knows where to read collected values\n * @returns Multi-section DSL string, or `\"\"` if there are no requirements to list\n *\n * @example\n * ```ts\n * const preamble = buildRequiresPreamble(requirements, \"cf_overview\");\n * const fullPrompt = preamble ? `${preamble}\\n\\n${skillBody}` : skillBody;\n * ```\n *\n * @docLink packages/resolver/api-reference#build-requires-preamble\n */\nexport function buildRequiresPreamble(requirements: SkillRequirements, skillId?: string): string {\n const sections: string[] = [];\n\n pushSection(sections, buildRequiresSection(requirements));\n pushSection(sections, buildInputSection(requirements, skillId));\n pushSection(sections, buildReadsSection(requirements));\n pushSection(sections, buildWritesSection(requirements));\n pushSection(sections, buildResourceSection(requirements));\n\n return sections.join(\"\\n\\n\");\n}\n\n/** Append a section to the list when it produced output. */\nfunction pushSection(sections: string[], section: string | null): void {\n if (section !== null) sections.push(section);\n}\n\n/** REQUIRES section (file gates). Returns `null` when there are no file gates. */\nfunction buildRequiresSection(requirements: SkillRequirements): string | null {\n if (requirements.files.length === 0) return null;\n const lines = [\"REQUIRES\"];\n for (const f of requirements.files) {\n const prefix = f.gate === \"hard\" ? \"hard\" : \"soft\";\n lines.push(` ${prefix}: ${f.path} — ${f.description}`);\n }\n return lines.join(\"\\n\");\n}\n\n/** INPUT section (user inputs). Returns `null` when there are no inputs. */\nfunction buildInputSection(requirements: SkillRequirements, skillId?: string): string | null {\n const allInputs = [...requirements.inputs_required, ...requirements.inputs_optional];\n if (allInputs.length === 0) return null;\n const lines = [\"INPUT\"];\n if (skillId) {\n lines.push(` Read from: _concept/_grounding/${skillId}/input.json`);\n lines.push(\n ` If input.json is missing, ask the user for the following values and write the file:`,\n );\n }\n for (const input of allInputs) {\n const req = input.required ? \"(required)\" : \"(optional)\";\n const opts = input.options ? ` [${input.options.join(\" | \")}]` : \"\";\n const def = input.default != null ? ` default: ${input.default}` : \"\";\n lines.push(` - ${input.id}: ${input.label} ${req}${opts}${def}`);\n if (input.hint) lines.push(` hint: ${input.hint}`);\n }\n return lines.join(\"\\n\");\n}\n\n/** READS section. Returns `null` when there are no read sources. */\nfunction buildReadsSection(requirements: SkillRequirements): string | null {\n if (requirements.reads.length === 0) return null;\n const lines = [\"READS\"];\n for (const r of requirements.reads) {\n lines.push(` ? ${r.path} — ${r.description}`);\n }\n return lines.join(\"\\n\");\n}\n\n/** WRITES section (produces). Returns `null` when there is nothing produced. */\nfunction buildWritesSection(requirements: SkillRequirements): string | null {\n if (requirements.produces.length === 0) return null;\n const lines = [\"WRITES\"];\n for (const p of requirements.produces) {\n lines.push(` ${p.path} — ${p.description}`);\n }\n return lines.join(\"\\n\");\n}\n\n/** RESOURCE section. Returns `null` when there are no resources. */\nfunction buildResourceSection(requirements: SkillRequirements): string | null {\n if (!requirements.resources || requirements.resources.length === 0) return null;\n const lines = [\"RESOURCE\"];\n for (const r of requirements.resources) {\n const req = r.optional ? \"(optional)\" : \"(required)\";\n const ops = r.operations ? ` ops: [${r.operations.join(\", \")}]` : \"\";\n lines.push(` ${r.id} ${req}${ops}`);\n if (r.description) lines.push(` — ${r.description}`);\n }\n return lines.join(\"\\n\");\n}\n","import { readFile, stat } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport {\n tryWithFsDeadline,\n walkDir,\n type WalkTruncation,\n withFsDeadline,\n} from \"@skaile/workspaces/core\";\nimport { createLogger } from \"@skaile/workspaces/core/logging\";\nimport type {\n ConnectorRequirement,\n FileCheck,\n InputCheck,\n NodeOverrides,\n ReadCheck,\n RequirementsReport,\n ResourceCheck,\n SkillInputFile,\n SkillRequirements,\n} from \"./types.js\";\n\nlet validatorLogger: ReturnType<typeof createLogger> | undefined;\n\nfunction log(): ReturnType<typeof createLogger> {\n validatorLogger ??= createLogger({ kind: \"runner\", subkind: \"skill-requirements\" });\n return validatorLogger;\n}\n\n/** Best-effort existence probe. A missing path, an unreadable one, and an\n * unresponsive mount are all \"not usable here\" for a requirement check. */\nasync function pathExists(target: string): Promise<boolean> {\n return tryWithFsDeadline(\n `stat ${target}`,\n async () => {\n await stat(target);\n return true;\n },\n false,\n );\n}\n\n/**\n * Validate skill requirements against the filesystem and collected inputs.\n *\n * File checks resolve paths relative to `projectDir`. Hard-gate files that are absent\n * set `satisfied: false` on the returned report; soft-gate misses are recorded but do not block.\n * Input checks read `_concept/_grounding/{skillId}/input.json`; missing files are treated as\n * no inputs collected. Resource checks are always recorded as `available: true` — actual\n * availability must be confirmed by the runner's `ResourceManager`.\n *\n * **Async and bounded since #454.** `projectDir` reaches this function straight\n * from the agent — `workspace_check_skill_requirements` takes `target_dir` as a\n * tool argument — so it can be `/skaile/workspace`, the rclone FUSE mount. Every\n * probe is now awaited and deadline-bounded, and the `min_entries` count walks\n * through the bounded {@link walkDir}, so a wedged mount or a symlink cycle\n * costs one failed tool call instead of the whole `skaile serve` event loop.\n *\n * @param skillId - Canonical skill identifier, used to locate `input.json`\n * @param requirements - Parsed requirements from SKILL.md (`parseSkillRequirements` output)\n * @param projectDir - Absolute path to the project root directory\n * @param overrides - Optional overrides (SDK only; a v2 flow file cannot carry them); paths in `skip_checks` are treated as present\n * @param producesIndex - Maps file paths to the skill ID that produces them, enabling \"produced by\" hints in the report\n * @returns `RequirementsReport` with per-check results and an overall `satisfied` flag\n *\n * @docLink packages/resolver/api-reference#validate-requirements\n */\nexport async function validateRequirements(\n skillId: string,\n requirements: SkillRequirements,\n projectDir: string,\n overrides?: NodeOverrides,\n producesIndex?: Map<string, string>,\n): Promise<RequirementsReport> {\n const skipSet = new Set(overrides?.skip_checks ?? []);\n\n // Check files. Serial on purpose: `projectDir` may be one network mount, and\n // fanning every probe out concurrently multiplies the queue depth on exactly\n // the resource that is already the bottleneck.\n const files: FileCheck[] = [];\n for (const req of requirements.files) {\n if (skipSet.has(req.path)) {\n files.push({ path: req.path, gate: req.gate, exists: true, description: req.description });\n continue;\n }\n\n const fullPath = path.join(projectDir, req.path);\n const check: FileCheck = {\n path: req.path,\n gate: req.gate,\n exists: false,\n description: req.description,\n producedBy: producesIndex?.get(req.path),\n };\n\n if (req.min_entries != null) {\n const counted = await checkDirectoryMinEntries(fullPath, req.min_entries);\n check.exists = counted.satisfied;\n if (counted.truncated) check.truncated = true;\n } else {\n check.exists = await pathExists(fullPath);\n }\n\n files.push(check);\n }\n\n // Check inputs — look for _concept/_grounding/{skillId}/input.json\n const inputFile = path.join(projectDir, \"_concept\", \"_grounding\", skillId, \"input.json\");\n let collectedValues: Record<string, any> = {};\n try {\n const raw = await withFsDeadline(`readFile ${inputFile}`, () => readFile(inputFile, \"utf-8\"));\n const parsed = JSON.parse(raw) as SkillInputFile;\n collectedValues = parsed.values ?? {};\n } catch {\n // No input file — all inputs are missing\n }\n\n const allInputs = [\n ...requirements.inputs_required.map((f) => ({ field: f, required: true })),\n ...requirements.inputs_optional.map((f) => ({ field: f, required: false })),\n ];\n\n const inputs: InputCheck[] = allInputs.map(({ field, required }) => ({\n id: field.id,\n required,\n present: field.id in collectedValues,\n field,\n }));\n\n // Check reads (informational only)\n const reads: ReadCheck[] = [];\n for (const r of requirements.reads) {\n reads.push({\n path: r.path,\n exists: await pathExists(path.join(projectDir, r.path)),\n description: r.description,\n });\n }\n\n // Check resources (validated at a higher level if a ResourceManager is available;\n // here we just record them in the report with unknown status)\n const resources: ResourceCheck[] = (requirements.resources ?? []).map((r) => ({\n id: r.id,\n available: true, // Actual availability checked by runner with ResourceManager\n missingOps: [],\n optional: r.optional ?? false,\n }));\n\n // Satisfaction: all hard file gates pass AND all required inputs present\n const hardFilesSatisfied = files.filter((f) => f.gate === \"hard\").every((f) => f.exists);\n\n const requiredInputsSatisfied = inputs.filter((i) => i.required).every((i) => i.present);\n\n const requiredResourcesSatisfied = resources.filter((r) => !r.optional).every((r) => r.available);\n\n return {\n skillId,\n satisfied: hardFilesSatisfied && requiredInputsSatisfied && requiredResourcesSatisfied,\n files,\n inputs,\n reads,\n resources,\n };\n}\n\n/**\n * A warning produced by `validateConnectorRequirements` when a skill's declared\n * connector requirement is not satisfied by the connectors in skaile.yaml.\n * Each warning covers either a missing driver or an insufficient access level.\n *\n * @docLink packages/resolver/api-reference#connector-validation-warning\n */\nexport interface ConnectorValidationWarning {\n /** Driver name that triggered the warning. */\n driver: string;\n /** Human-readable explanation of the gap, including a remediation command where applicable. */\n message: string;\n}\n\n/** Minimal structural type accepted by validateConnectorRequirements. Compatible with both\n * ConnectorDeclaration shapes in @skaile/workspaces/core and @skaile/workspaces/connectors. */\ninterface AvailableConnector {\n driver: string;\n access?: \"read-only\" | \"read-write\";\n}\n\n/**\n * Check that all connector requirements declared in a skill's SKILL.md are\n * satisfied by the connectors declared in skaile.yaml.\n *\n * Returns one warning per gap — either a missing driver or an insufficient\n * access level. This is a pre-flight advisory; no runtime enforcement is done.\n *\n * @param requirements - Connector requirements from `parseSkillRequirements().connectors`\n * @param available - Connector declarations from `skaile.yaml` (via `loadConnectorDeclarations`)\n * @returns Array of warnings — one per gap. Empty array when all requirements are satisfied.\n *\n * @docLink packages/resolver/api-reference#validate-connector-requirements\n */\nexport function validateConnectorRequirements(\n requirements: ConnectorRequirement[],\n available: AvailableConnector[],\n): ConnectorValidationWarning[] {\n const warnings: ConnectorValidationWarning[] = [];\n\n for (const req of requirements) {\n const matches = available.filter((a) => a.driver === req.driver);\n\n if (matches.length === 0) {\n warnings.push({\n driver: req.driver,\n message:\n `Skill requires connector driver \"${req.driver}\" but none is declared in skaile.yaml. ` +\n `Run: skaile connector add ${req.driver}`,\n });\n continue;\n }\n\n if (req.access === \"read-write\") {\n const hasReadWrite = matches.some((m) => (m.access ?? \"read-only\") === \"read-write\");\n if (!hasReadWrite) {\n warnings.push({\n driver: req.driver,\n message:\n `Skill requires \"${req.driver}\" with read-write access, but all declared instances ` +\n `are read-only. Update access in skaile.yaml.`,\n });\n }\n }\n }\n\n return warnings;\n}\n\n/**\n * Does `dirPath` hold at least `minEntries` files, counted recursively?\n *\n * `truncated` is set when a walk bound was hit *and* the count still fell\n * short: the number is then a floor, not the truth, so `satisfied: false` is\n * \"we could not prove it\" rather than \"there are not enough files\". Reaching\n * `minEntries` short-circuits the walk, so the common case never pays for the\n * whole tree and a bound hit after that point is irrelevant.\n */\nasync function checkDirectoryMinEntries(\n dirPath: string,\n minEntries: number,\n): Promise<{ satisfied: boolean; truncated: boolean }> {\n const st = await tryWithFsDeadline(`stat ${dirPath}`, () => stat(dirPath), null);\n if (!st?.isDirectory()) return { satisfied: false, truncated: false };\n\n const { count, truncation } = await countFilesRecursive(dirPath, minEntries);\n const satisfied = count >= minEntries;\n if (!satisfied && truncation) {\n log().warn(\"min_entries count truncated — result is a lower bound, not the file count\", {\n dirPath,\n minEntries,\n count,\n ...truncation,\n });\n }\n return { satisfied, truncated: !satisfied && truncation !== undefined };\n}\n\n/**\n * Count files under `dirPath`, stopping at `limit`.\n *\n * Delegates to core's {@link walkDir} rather than recursing here: `dirPath` is\n * agent-supplied and can be a network mount, so the walk needs the deadline per\n * `opendir`, the depth / entry / wall-clock bounds, and the visited-inode cycle\n * guard that walker already owns. The pre-#454 `readdirSync` recursion had none\n * of them and recursed forever on `a/link -> a`.\n *\n * Inheriting `walkDir` also inherits its skip list: `.git` and `node_modules`\n * no longer count toward `min_entries`, which is what a prerequisite like\n * \"at least 3 feature files\" meant in the first place.\n */\nasync function countFilesRecursive(\n dirPath: string,\n limit: number,\n): Promise<{ count: number; truncation?: WalkTruncation }> {\n let count = 0;\n let truncation: WalkTruncation | undefined;\n for await (const _entry of walkDir(dirPath, {\n onTruncate: (info) => {\n truncation ??= info;\n },\n })) {\n count++;\n // Enough is enough — no reason to keep walking a large tree (or a wedged\n // mount) once the requirement is already met.\n if (count >= limit) return { count };\n }\n return { count, truncation };\n}\n","import { satisfies, valid, validRange } from \"semver\";\n\n/**\n * Result of a single flow-node version pin check.\n * Returned in the array produced by `validateFlowVersions()` for every\n * node that declares a `requestedVersion`.\n *\n * @docLink packages/resolver/api-reference#version-check\n */\nexport interface VersionCheck {\n /** Flow node identifier. */\n nodeId: string;\n /** Canonical skill identifier. */\n skillId: string;\n /** Semver range from the flow node (e.g. \"^1.0.0\") */\n requested: string;\n /** Version from the skill's frontmatter */\n actual: string;\n /** Whether `actual` satisfies the `requested` semver range. */\n satisfied: boolean;\n}\n\n/**\n * Minimal descriptor for a flow node that optionally pins a skill version.\n * Passed as input to `validateFlowVersions()`. Nodes without `requestedVersion`\n * are skipped during version checking.\n *\n * @docLink packages/resolver/api-reference#flow-version-node\n */\nexport interface FlowVersionNode {\n /** Flow node identifier. */\n nodeId: string;\n /** Canonical skill identifier referenced by this node. */\n skillId: string;\n /** Optional semver range the node requires (e.g. `\"^1.2.0\"`). Omit to skip version checking. */\n requestedVersion?: string;\n}\n\n/**\n * Validate flow node version pins against discovered skill versions.\n *\n * Only checks nodes that declare a `requestedVersion`. Nodes without a\n * version pin are skipped entirely (no entry is produced for those nodes).\n * A check is marked `satisfied: false` when the range is invalid, the actual\n * version string is not valid semver, or the version does not satisfy the range.\n *\n * @param nodes - Flow nodes to check; only those with `requestedVersion` are evaluated\n * @param skillVersions - Map from skill ID to the semver version string in its frontmatter\n * @returns Array of `VersionCheck` results, one per node that declared a version pin\n *\n * @docLink packages/resolver/api-reference#validate-flow-versions\n */\nexport function validateFlowVersions(\n nodes: FlowVersionNode[],\n skillVersions: Map<string, string>,\n): VersionCheck[] {\n const checks: VersionCheck[] = [];\n\n for (const node of nodes) {\n if (!node.requestedVersion) continue;\n\n const actual = skillVersions.get(node.skillId) ?? \"\";\n const requested = node.requestedVersion;\n\n // Invalid range or missing/invalid actual version → not satisfied\n const rangeValid = validRange(requested) !== null;\n const actualValid = actual !== \"\" && valid(actual) !== null;\n const isSatisfied = rangeValid && actualValid && satisfies(actual, requested);\n\n checks.push({\n nodeId: node.nodeId,\n skillId: node.skillId,\n requested,\n actual,\n satisfied: isSatisfied,\n });\n }\n\n return checks;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getProviderPreset, providerCredentialEnvName } from './chunk-
|
|
1
|
+
import { getProviderPreset, providerCredentialEnvName } from './chunk-KY4UXX7M.js';
|
|
2
2
|
import { globalSkaileDir } from './chunk-L5VSIPQD.js';
|
|
3
3
|
import { registryEntries, parseModelRef, isEntryEnabled, resolveEntryBaseUrl } from './chunk-MJHSLODD.js';
|
|
4
4
|
import { createHash } from 'crypto';
|
|
@@ -121,5 +121,5 @@ function writeCodexConfigToml(home, document) {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
export { buildCodexConfigDocument, codexProviderTableId, codexSessionHome, writeCodexConfigToml };
|
|
124
|
-
//# sourceMappingURL=chunk-
|
|
125
|
-
//# sourceMappingURL=chunk-
|
|
124
|
+
//# sourceMappingURL=chunk-GBYNC5V3.js.map
|
|
125
|
+
//# sourceMappingURL=chunk-GBYNC5V3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../bridge/src/codex/config-toml.ts"],"names":["stringifyToml"],"mappings":";;;;;;;;AAyDA,IAAM,cAAA,GAA6D;AAAA,EACjE,wBAAA,EAA0B,WAAA;AAAA,EAC1B,kBAAA,EAAoB,WAAA;AAAA,EACpB,wBAAA,EAA0B;AAC5B,CAAA;AAQA,IAAM,8CAAmD,IAAI,GAAA,CAAI,CAAC,QAAA,EAAU,QAAA,EAAU,UAAU,CAAC,CAAA;AAM1F,SAAS,qBAAqB,EAAA,EAAoB;AACvD,EAAA,OAAO,4BAA4B,GAAA,CAAI,EAAE,CAAA,GAAI,CAAA,OAAA,EAAU,EAAE,CAAA,CAAA,GAAK,EAAA;AAChE;AAGA,IAAM,yBAAA,GAAkD;AAAA,EACtD,cAAA,EAAgB,IAAA;AAAA,EAChB,MAAA,EAAQ,IAAA;AAAA,EACR,OAAA,EAAS;AACX,CAAA;AAyDA,SAAS,mBAAA,CACP,KAAA,EACA,QAAA,EACA,QAAA,EACS;AACT,EAAA,IAAI,QAAA,CAAS,IAAA,IAAQ,QAAA,CAAS,OAAA,KAAY,QAAW,OAAO,IAAA;AAC5D,EAAA,MAAM,QAAA,GAAW,MAAM,QAAA,EAAU,IAAA,MAAU,KAAA,CAAM,KAAA,EAAO,MAAK,IAAK,EAAA;AAClE,EAAA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K,QAAA,CAAS,eAAe,CAAA,CAAE,WAAW,CAAA,EAAG;AACtD,IAAA,MAAA,CAAO,IAAA,EAAM,EAAE,KAAA,EAAO,IAAA,EAAM,CAAA;AAC5B,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,MAAM,SAAA,GAAY,IAAA,CAAK,IAAA,EAAM,iBAAiB,CAAA;AAC9C,EAAA,MAAA,CAAO,SAAA,EAAW,EAAE,KAAA,EAAO,IAAA,EAAM,CAAA;AACjC,EAAA,aAAA,CAAc,SAAA,EAAW,sBAAsB,QAAQ,CAAA,EAAG,EAAE,IAAA,EAAM,GAAA,EAAO,IAAA,EAAM,IAAA,EAAM,CAAA;AACrF,EAAA,UAAA,CAAW,WAAW,IAAI,CAAA;AAC1B,EAAA,OAAO,IAAA;AACT","file":"chunk-5SWED2LW.js","sourcesContent":["/**\n * Codex's `config.toml` adapter — the AI provider registry materialized into\n * the only provider surface the Codex CLI reads (plan §2.3, codex rows).\n *\n * Codex is a **file-shaped** driver: it takes its endpoints from\n * `$CODEX_HOME/config.toml`, never from per-request options. Both codex modes\n * therefore get a session-private `CODEX_HOME` holding a rendered document:\n *\n * - every addressable registry entry becomes `[model_providers.<id>]` with\n * `base_url`, `env_key`, `wire_api`, `query_params` and `http_headers`\n * mapping 1:1 onto the entry's `base_url`, `credential`, `surface`,\n * `query_params` and `headers`;\n * - `model_provider` and `model` at the top level name the selected entry.\n *\n * The rendered file never contains a credential **value** — `env_key` holds\n * the *name* of the per-entry variable (`SKAILE_AIP_<ID>_KEY`, minted by\n * {@link providerCredentialEnvName}), and the value rides in the child\n * environment. An `oauth` entry has no env carrier at all: it gets\n * `requires_openai_auth`, which routes codex to its own auth manager.\n *\n * **Surface coverage.** Codex names the wire protocol `wire_api` and, as of\n * codex-cli 0.154, accepts exactly one value: `responses`. `chat` was removed\n * (\"`wire_api = \\\"chat\\\"` is no longer supported\", openai/codex#7782), and an\n * unknown value fails the *whole* document at load time — one unaddressable\n * entry would take the rest of the registry down with it. Entries whose\n * surface codex cannot speak (`openai-completions`, `anthropic-messages`,\n * `bedrock-converse-stream`, `google-*`) are therefore left out and reported\n * in {@link CodexConfigBuild.skipped} for the driver to log.\n *\n * @docLink packages/bridge/drivers#codex-driver\n */\n\nimport { createHash } from \"node:crypto\";\nimport { mkdirSync, renameSync, rmSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { globalSkaileDir } from \"@skaile/workspaces/core\";\nimport {\n type AIProviderEntry,\n type AIProviderLlmEntry,\n type AIProviderRegistry,\n type AIProviderSurface,\n isEntryEnabled,\n type MergedAIProviderRegistry,\n parseModelRef,\n registryEntries,\n type ResolvedModelRef,\n resolveEntryBaseUrl,\n} from \"@skaile/workspaces/core/provider-registry\";\nimport { stringify as stringifyToml } from \"smol-toml\";\nimport { getProviderPreset } from \"../provider-catalog.js\";\nimport { providerCredentialEnvName } from \"../provider-materialize/credential-env.js\";\n\n/**\n * `surface` → codex `wire_api`. Only the responses-flavoured surfaces have a\n * codex spelling; see the module docstring for why `openai-completions` is\n * absent rather than mapped to the removed `chat` value.\n */\nconst CODEX_WIRE_API: Partial<Record<AIProviderSurface, string>> = {\n \"openai-codex-responses\": \"responses\",\n \"openai-responses\": \"responses\",\n \"azure-openai-responses\": \"responses\",\n};\n\n/**\n * Provider ids codex reserves for its own built-ins. A `[model_providers.<id>]`\n * table under one of them fails the whole document (\"model_providers contains\n * reserved built-in provider IDs\"), so such an entry is rendered under\n * {@link codexProviderTableId}.\n */\nconst CODEX_RESERVED_PROVIDER_IDS: ReadonlySet<string> = new Set([\"openai\", \"ollama\", \"lmstudio\"]);\n\n/**\n * The `[model_providers.<id>]` table name for a registry entry: the entry id,\n * or `skaile-<id>` when codex reserves that id (the `openai` preset).\n */\nexport function codexProviderTableId(id: string): string {\n return CODEX_RESERVED_PROVIDER_IDS.has(id) ? `skaile-${id}` : id;\n}\n\n/** Credential kinds whose value the adapter hands over in an env var. */\nconst ENV_DELIVERED_CREDENTIALS: Record<string, true> = {\n api_key_header: true,\n bearer: true,\n command: true,\n};\n\n/** One `[model_providers.<id>]` table, in codex's own vocabulary. */\nexport interface CodexModelProviderTable {\n /** Display name. Codex rejects a provider table without one. */\n name: string;\n base_url?: string;\n /** Name of the variable carrying the credential — never the credential. */\n env_key?: string;\n wire_api?: string;\n /** Routes codex to its own auth manager (ChatGPT subscription / stored key). */\n requires_openai_auth?: boolean;\n query_params?: Record<string, string>;\n http_headers?: Record<string, string>;\n}\n\n/** The subset of codex's `config.toml` this adapter owns. */\nexport interface CodexConfigDocument {\n /** Table id the session addresses (see {@link codexProviderTableId}); absent when nothing rendered. */\n model_provider?: string;\n /** Provider-side model id. */\n model?: string;\n model_providers: Record<string, CodexModelProviderTable>;\n}\n\n/** An entry codex cannot address, and why. */\nexport interface CodexSkippedEntry {\n id: string;\n reason: string;\n}\n\n/** Result of {@link buildCodexConfigDocument}. */\nexport interface CodexConfigBuild {\n document: CodexConfigDocument;\n /** Selected registry entry id (not the table id), when it rendered. */\n providerId?: string;\n /** Provider-side model id of the selection, when the selector named one. */\n model?: string;\n /**\n * Entries left out of the document. Non-fatal: codex keeps its built-in\n * providers, so a session whose selection was skipped behaves exactly as it\n * did before the registry existed.\n */\n skipped: CodexSkippedEntry[];\n /** Notes from `modelRef` resolution (dangling role, disabled provider, …). */\n warnings: string[];\n /**\n * Set when the selector named an entry codex cannot address: the session\n * must stop with `reason`, not fall back to codex's built-in providers.\n */\n unaddressable?: { id: string; reason: string };\n}\n\n/**\n * Whether the session's selector named the entry `selected` resolved to, rather\n * than reaching it by registry order alone.\n */\nfunction selectionNamesEntry(\n input: CodexConfigInput,\n selected: ResolvedModelRef,\n registry: AIProviderRegistry | MergedAIProviderRegistry,\n): boolean {\n if (selected.role && selected.modelId !== undefined) return true;\n const selector = input.modelRef?.trim() || input.model?.trim() || \"\";\n if (selector.startsWith(`${selected.providerId}/`)) return true;\n const entry = registryEntries(registry).find(([id]) => id === selected.providerId)?.[1] as\n | AIProviderLlmEntry\n | undefined;\n const modelId = selected.modelId;\n return (\n modelId !== undefined &&\n (entry?.model_map?.[modelId] !== undefined || entry?.capabilities?.[modelId] !== undefined)\n );\n}\n\n/** Inputs {@link buildCodexConfigDocument} reads off an `AgentConfig`. */\nexport interface CodexConfigInput {\n registry?: AIProviderRegistry | MergedAIProviderRegistry;\n /** `\"<providerId>/<modelId>\"`, a bare model id, or `\"@role\"`. */\n modelRef?: string;\n /** Legacy model field, used as the selector when `modelRef` is absent. */\n model?: string;\n /** Roles table (`skaile.yaml`), consulted for an `@role` selector. */\n roles?: Record<string, string>;\n}\n\n/**\n * Render one entry as a codex provider table, or explain why codex cannot\n * address it.\n */\nexport function renderCodexProviderTable(\n id: string,\n entry: AIProviderEntry,\n): { table: CodexModelProviderTable } | { skipped: string } {\n if (!isEntryEnabled(entry)) return { skipped: \"entry is disabled\" };\n if (entry.kind !== \"llm\" && entry.kind !== \"embed\")\n return { skipped: `kind '${entry.kind}' is not a model endpoint` };\n const llm = entry as AIProviderLlmEntry;\n // `surface` and `base_url` may live on the catalog preset the entry names —\n // the catalog layer fills them during a merge, but an entry handed straight\n // to a driver has not necessarily been through one.\n const preset = entry.preset ? getProviderPreset(entry.preset) : undefined;\n const surface = llm.surface ?? preset?.surface;\n const wireApi = surface ? CODEX_WIRE_API[surface] : undefined;\n if (!wireApi)\n return {\n skipped: surface\n ? `codex has no wire_api for surface '${surface}'`\n : \"entry declares no surface\",\n };\n const credentialKind = entry.credential?.kind;\n const table: CodexModelProviderTable = { name: entry.label ?? id };\n const baseUrl = resolveEntryBaseUrl(entry) ?? preset?.base_url;\n if (baseUrl) table.base_url = baseUrl;\n if (credentialKind && ENV_DELIVERED_CREDENTIALS[credentialKind])\n table.env_key = providerCredentialEnvName(id);\n table.wire_api = wireApi;\n if (credentialKind === \"oauth\") table.requires_openai_auth = true;\n if (llm.query_params && Object.keys(llm.query_params).length > 0)\n table.query_params = { ...llm.query_params };\n if (entry.headers && Object.keys(entry.headers).length > 0)\n table.http_headers = { ...entry.headers };\n return { table };\n}\n\n/**\n * Build the document for a session: every addressable entry, plus the\n * selection when it resolved to one of them.\n */\nexport function buildCodexConfigDocument(input: CodexConfigInput): CodexConfigBuild {\n const document: CodexConfigDocument = { model_providers: {} };\n const skipped: CodexSkippedEntry[] = [];\n const entries = input.registry ? registryEntries(input.registry) : [];\n for (const [id, entry] of entries) {\n const rendered = renderCodexProviderTable(id, entry);\n if (\"skipped\" in rendered) skipped.push({ id, reason: rendered.skipped });\n else document.model_providers[codexProviderTableId(id)] = rendered.table;\n }\n\n if (!input.registry) return { document, skipped, warnings: [] };\n // An empty selector resolves the same way a bare one does — first entry in\n // registry order. A session that configured an endpoint and named no model\n // still means that endpoint, not codex's built-in default.\n const selected = parseModelRef(\n input.modelRef?.trim() || input.model?.trim() || \"\",\n input.registry,\n input.roles,\n );\n if (!selected) return { document, skipped, warnings: [] };\n const warnings = selected.warnings;\n const tableId = codexProviderTableId(selected.providerId);\n if (!document.model_providers[tableId]) {\n // A selector that names the entry (`ollama/llama3`, a role or a model its\n // `model_map` lists) and cannot be rendered must not fall through to\n // codex's built-in OpenAI: the prompt would go to a provider the user did\n // not pick. A bare model id that matched no entry only landed on the first\n // entry by registry order, so codex's own providers stay the right answer.\n const reason = skipped.find((s) => s.id === selected.providerId)?.reason;\n if (reason && selectionNamesEntry(input, selected, input.registry)) {\n return {\n document,\n skipped,\n warnings,\n unaddressable: { id: selected.providerId, reason },\n };\n }\n return { document, skipped, warnings };\n }\n document.model_provider = tableId;\n if (selected.providerModelId) document.model = selected.providerModelId;\n return {\n document,\n providerId: selected.providerId,\n ...(selected.providerModelId ? { model: selected.providerModelId } : {}),\n skipped,\n warnings,\n };\n}\n\n/** Serialize a document to TOML. Deterministic: registry order throughout. */\nexport function renderCodexConfigToml(document: CodexConfigDocument): string {\n const ordered: Record<string, unknown> = {};\n if (document.model_provider) ordered.model_provider = document.model_provider;\n if (document.model) ordered.model = document.model;\n ordered.model_providers = document.model_providers;\n return `${stringifyToml(ordered)}\\n`;\n}\n\n/**\n * The session-private codex home.\n *\n * Deliberately outside `cwd`: codex's `workspace-write` sandbox makes the\n * working tree writable by the model, and a config home inside it would let a\n * turn rewrite its own `base_url`. `$SKAILE_HOME` (honoured by\n * {@link globalSkaileDir}) relocates the whole tree, which is also the test\n * seam.\n */\nexport function codexSessionHome(config: { cwd: string; sessionId?: string }): string {\n const key =\n config.sessionId && /^[A-Za-z0-9._-]{1,128}$/.test(config.sessionId)\n ? config.sessionId\n : createHash(\"sha256\")\n .update(config.sessionId ?? config.cwd)\n .digest(\"hex\")\n .slice(0, 32);\n return join(globalSkaileDir(), \"codex\", key);\n}\n\n/**\n * Write `<home>/config.toml`, creating the home always. Atomic: a\n * partially written document would fail codex's config load for the whole\n * session.\n *\n * A document with no provider tables says nothing codex does not already\n * know, so nothing is written and a file left by an earlier render is\n * removed — a session that no longer carries a registry must not keep\n * answering to the one it used to have.\n *\n * @returns the absolute path written, or `undefined` when there was nothing\n * to render.\n */\nexport function writeCodexConfigToml(\n home: string,\n document: CodexConfigDocument,\n): string | undefined {\n const path = join(home, \"config.toml\");\n // codex exits when CODEX_HOME names a directory that does not exist, so the\n // home exists before the early return too.\n mkdirSync(home, { recursive: true, mode: 0o700 });\n if (Object.keys(document.model_providers).length === 0) {\n rmSync(path, { force: true });\n return undefined;\n }\n const temporary = join(home, \"config.toml.new\");\n rmSync(temporary, { force: true });\n writeFileSync(temporary, renderCodexConfigToml(document), { mode: 0o600, flag: \"wx\" });\n renameSync(temporary, path);\n return path;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../bridge/src/codex/config-toml.ts"],"names":["stringifyToml"],"mappings":";;;;;;;;AAyDA,IAAM,cAAA,GAA6D;AAAA,EACjE,wBAAA,EAA0B,WAAA;AAAA,EAC1B,kBAAA,EAAoB,WAAA;AAAA,EACpB,wBAAA,EAA0B;AAC5B,CAAA;AAQA,IAAM,8CAAmD,IAAI,GAAA,CAAI,CAAC,QAAA,EAAU,QAAA,EA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,SAAA,IAAa,yBAAA,CAA0B,IAAA,CAAK,OAAO,SAAS,CAAA,GAC/D,MAAA,CAAO,SAAA,GACP,UAAA,CAAW,QAAQ,EAChB,MAAA,CAAO,MAAA,CAAO,SAAA,IAAa,MAAA,CAAO,GAAG,CAAA,CACrC,OAAO,KAAK,CAAA,CACZ,KAAA,CAAM,CAAA,EAAG,EAAE,CAAA;AACpB,EAAA,OAAO,IAAA,CAAK,eAAA,EAAgB,EAAG,OAAA,EAAS,GAAG,CAAA;AAC7C;AAeO,SAAS,oBAAA,CACd,MACA,QAAA,EACoB;AACpB,EAAA,MAAM,IAAA,GAAO,IAAA,CAAK,IAAA,EAAM,aAAa,CAAA;AAGrC,EAAA,SAAA,CAAU,MAAM,EAAE,SAAA,EAAW,IAAA,EAAM,IAAA,EAAM,KAAO,CAAA;AAChD,EAAA,IAAI,OAAO,IAAA,CAAK,QAAA,CAAS,eAAe,CAAA,CAAE,WAAW,CAAA,EAAG;AACtD,IAAA,MAAA,CAAO,IAAA,EAAM,EAAE,KAAA,EAAO,IAAA,EAAM,CAAA;AAC5B,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,MAAM,SAAA,GAAY,IAAA,CAAK,IAAA,EAAM,iBAAiB,CAAA;AAC9C,EAAA,MAAA,CAAO,SAAA,EAAW,EAAE,KAAA,EAAO,IAAA,EAAM,CAAA;AACjC,EAAA,aAAA,CAAc,SAAA,EAAW,sBAAsB,QAAQ,CAAA,EAAG,EAAE,IAAA,EAAM,GAAA,EAAO,IAAA,EAAM,IAAA,EAAM,CAAA;AACrF,EAAA,UAAA,CAAW,WAAW,IAAI,CAAA;AAC1B,EAAA,OAAO,IAAA;AACT","file":"chunk-GBYNC5V3.js","sourcesContent":["/**\n * Codex's `config.toml` adapter — the AI provider registry materialized into\n * the only provider surface the Codex CLI reads (plan §2.3, codex rows).\n *\n * Codex is a **file-shaped** driver: it takes its endpoints from\n * `$CODEX_HOME/config.toml`, never from per-request options. Both codex modes\n * therefore get a session-private `CODEX_HOME` holding a rendered document:\n *\n * - every addressable registry entry becomes `[model_providers.<id>]` with\n * `base_url`, `env_key`, `wire_api`, `query_params` and `http_headers`\n * mapping 1:1 onto the entry's `base_url`, `credential`, `surface`,\n * `query_params` and `headers`;\n * - `model_provider` and `model` at the top level name the selected entry.\n *\n * The rendered file never contains a credential **value** — `env_key` holds\n * the *name* of the per-entry variable (`SKAILE_AIP_<ID>_KEY`, minted by\n * {@link providerCredentialEnvName}), and the value rides in the child\n * environment. An `oauth` entry has no env carrier at all: it gets\n * `requires_openai_auth`, which routes codex to its own auth manager.\n *\n * **Surface coverage.** Codex names the wire protocol `wire_api` and, as of\n * codex-cli 0.154, accepts exactly one value: `responses`. `chat` was removed\n * (\"`wire_api = \\\"chat\\\"` is no longer supported\", openai/codex#7782), and an\n * unknown value fails the *whole* document at load time — one unaddressable\n * entry would take the rest of the registry down with it. Entries whose\n * surface codex cannot speak (`openai-completions`, `anthropic-messages`,\n * `bedrock-converse-stream`, `google-*`) are therefore left out and reported\n * in {@link CodexConfigBuild.skipped} for the driver to log.\n *\n * @docLink packages/bridge/drivers#codex-driver\n */\n\nimport { createHash } from \"node:crypto\";\nimport { mkdirSync, renameSync, rmSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { globalSkaileDir } from \"@skaile/workspaces/core\";\nimport {\n type AIProviderEntry,\n type AIProviderLlmEntry,\n type AIProviderRegistry,\n type AIProviderSurface,\n isEntryEnabled,\n type MergedAIProviderRegistry,\n parseModelRef,\n registryEntries,\n type ResolvedModelRef,\n resolveEntryBaseUrl,\n} from \"@skaile/workspaces/core/provider-registry\";\nimport { stringify as stringifyToml } from \"smol-toml\";\nimport { getProviderPreset } from \"../provider-catalog.js\";\nimport { providerCredentialEnvName } from \"../provider-materialize/credential-env.js\";\n\n/**\n * `surface` → codex `wire_api`. Only the responses-flavoured surfaces have a\n * codex spelling; see the module docstring for why `openai-completions` is\n * absent rather than mapped to the removed `chat` value.\n */\nconst CODEX_WIRE_API: Partial<Record<AIProviderSurface, string>> = {\n \"openai-codex-responses\": \"responses\",\n \"openai-responses\": \"responses\",\n \"azure-openai-responses\": \"responses\",\n};\n\n/**\n * Provider ids codex reserves for its own built-ins. A `[model_providers.<id>]`\n * table under one of them fails the whole document (\"model_providers contains\n * reserved built-in provider IDs\"), so such an entry is rendered under\n * {@link codexProviderTableId}.\n */\nconst CODEX_RESERVED_PROVIDER_IDS: ReadonlySet<string> = new Set([\"openai\", \"ollama\", \"lmstudio\"]);\n\n/**\n * The `[model_providers.<id>]` table name for a registry entry: the entry id,\n * or `skaile-<id>` when codex reserves that id (the `openai` preset).\n */\nexport function codexProviderTableId(id: string): string {\n return CODEX_RESERVED_PROVIDER_IDS.has(id) ? `skaile-${id}` : id;\n}\n\n/** Credential kinds whose value the adapter hands over in an env var. */\nconst ENV_DELIVERED_CREDENTIALS: Record<string, true> = {\n api_key_header: true,\n bearer: true,\n command: true,\n};\n\n/** One `[model_providers.<id>]` table, in codex's own vocabulary. */\nexport interface CodexModelProviderTable {\n /** Display name. Codex rejects a provider table without one. */\n name: string;\n base_url?: string;\n /** Name of the variable carrying the credential — never the credential. */\n env_key?: string;\n wire_api?: string;\n /** Routes codex to its own auth manager (ChatGPT subscription / stored key). */\n requires_openai_auth?: boolean;\n query_params?: Record<string, string>;\n http_headers?: Record<string, string>;\n}\n\n/** The subset of codex's `config.toml` this adapter owns. */\nexport interface CodexConfigDocument {\n /** Table id the session addresses (see {@link codexProviderTableId}); absent when nothing rendered. */\n model_provider?: string;\n /** Provider-side model id. */\n model?: string;\n model_providers: Record<string, CodexModelProviderTable>;\n}\n\n/** An entry codex cannot address, and why. */\nexport interface CodexSkippedEntry {\n id: string;\n reason: string;\n}\n\n/** Result of {@link buildCodexConfigDocument}. */\nexport interface CodexConfigBuild {\n document: CodexConfigDocument;\n /** Selected registry entry id (not the table id), when it rendered. */\n providerId?: string;\n /** Provider-side model id of the selection, when the selector named one. */\n model?: string;\n /**\n * Entries left out of the document. Non-fatal: codex keeps its built-in\n * providers, so a session whose selection was skipped behaves exactly as it\n * did before the registry existed.\n */\n skipped: CodexSkippedEntry[];\n /** Notes from `modelRef` resolution (dangling role, disabled provider, …). */\n warnings: string[];\n /**\n * Set when the selector named an entry codex cannot address: the session\n * must stop with `reason`, not fall back to codex's built-in providers.\n */\n unaddressable?: { id: string; reason: string };\n}\n\n/**\n * Whether the session's selector named the entry `selected` resolved to, rather\n * than reaching it by registry order alone.\n */\nfunction selectionNamesEntry(\n input: CodexConfigInput,\n selected: ResolvedModelRef,\n registry: AIProviderRegistry | MergedAIProviderRegistry,\n): boolean {\n if (selected.role && selected.modelId !== undefined) return true;\n const selector = input.modelRef?.trim() || input.model?.trim() || \"\";\n if (selector.startsWith(`${selected.providerId}/`)) return true;\n const entry = registryEntries(registry).find(([id]) => id === selected.providerId)?.[1] as\n | AIProviderLlmEntry\n | undefined;\n const modelId = selected.modelId;\n return (\n modelId !== undefined &&\n (entry?.model_map?.[modelId] !== undefined || entry?.capabilities?.[modelId] !== undefined)\n );\n}\n\n/** Inputs {@link buildCodexConfigDocument} reads off an `AgentConfig`. */\nexport interface CodexConfigInput {\n registry?: AIProviderRegistry | MergedAIProviderRegistry;\n /** `\"<providerId>/<modelId>\"`, a bare model id, or `\"@role\"`. */\n modelRef?: string;\n /** Legacy model field, used as the selector when `modelRef` is absent. */\n model?: string;\n /** Roles table (`skaile.yaml`), consulted for an `@role` selector. */\n roles?: Record<string, string>;\n}\n\n/**\n * Render one entry as a codex provider table, or explain why codex cannot\n * address it.\n */\nexport function renderCodexProviderTable(\n id: string,\n entry: AIProviderEntry,\n): { table: CodexModelProviderTable } | { skipped: string } {\n if (!isEntryEnabled(entry)) return { skipped: \"entry is disabled\" };\n if (entry.kind !== \"llm\" && entry.kind !== \"embed\")\n return { skipped: `kind '${entry.kind}' is not a model endpoint` };\n const llm = entry as AIProviderLlmEntry;\n // `surface` and `base_url` may live on the catalog preset the entry names —\n // the catalog layer fills them during a merge, but an entry handed straight\n // to a driver has not necessarily been through one.\n const preset = entry.preset ? getProviderPreset(entry.preset) : undefined;\n const surface = llm.surface ?? preset?.surface;\n const wireApi = surface ? CODEX_WIRE_API[surface] : undefined;\n if (!wireApi)\n return {\n skipped: surface\n ? `codex has no wire_api for surface '${surface}'`\n : \"entry declares no surface\",\n };\n const credentialKind = entry.credential?.kind;\n const table: CodexModelProviderTable = { name: entry.label ?? id };\n const baseUrl = resolveEntryBaseUrl(entry) ?? preset?.base_url;\n if (baseUrl) table.base_url = baseUrl;\n if (credentialKind && ENV_DELIVERED_CREDENTIALS[credentialKind])\n table.env_key = providerCredentialEnvName(id);\n table.wire_api = wireApi;\n if (credentialKind === \"oauth\") table.requires_openai_auth = true;\n if (llm.query_params && Object.keys(llm.query_params).length > 0)\n table.query_params = { ...llm.query_params };\n if (entry.headers && Object.keys(entry.headers).length > 0)\n table.http_headers = { ...entry.headers };\n return { table };\n}\n\n/**\n * Build the document for a session: every addressable entry, plus the\n * selection when it resolved to one of them.\n */\nexport function buildCodexConfigDocument(input: CodexConfigInput): CodexConfigBuild {\n const document: CodexConfigDocument = { model_providers: {} };\n const skipped: CodexSkippedEntry[] = [];\n const entries = input.registry ? registryEntries(input.registry) : [];\n for (const [id, entry] of entries) {\n const rendered = renderCodexProviderTable(id, entry);\n if (\"skipped\" in rendered) skipped.push({ id, reason: rendered.skipped });\n else document.model_providers[codexProviderTableId(id)] = rendered.table;\n }\n\n if (!input.registry) return { document, skipped, warnings: [] };\n // An empty selector resolves the same way a bare one does — first entry in\n // registry order. A session that configured an endpoint and named no model\n // still means that endpoint, not codex's built-in default.\n const selected = parseModelRef(\n input.modelRef?.trim() || input.model?.trim() || \"\",\n input.registry,\n input.roles,\n );\n if (!selected) return { document, skipped, warnings: [] };\n const warnings = selected.warnings;\n const tableId = codexProviderTableId(selected.providerId);\n if (!document.model_providers[tableId]) {\n // A selector that names the entry (`ollama/llama3`, a role or a model its\n // `model_map` lists) and cannot be rendered must not fall through to\n // codex's built-in OpenAI: the prompt would go to a provider the user did\n // not pick. A bare model id that matched no entry only landed on the first\n // entry by registry order, so codex's own providers stay the right answer.\n const reason = skipped.find((s) => s.id === selected.providerId)?.reason;\n if (reason && selectionNamesEntry(input, selected, input.registry)) {\n return {\n document,\n skipped,\n warnings,\n unaddressable: { id: selected.providerId, reason },\n };\n }\n return { document, skipped, warnings };\n }\n document.model_provider = tableId;\n if (selected.providerModelId) document.model = selected.providerModelId;\n return {\n document,\n providerId: selected.providerId,\n ...(selected.providerModelId ? { model: selected.providerModelId } : {}),\n skipped,\n warnings,\n };\n}\n\n/** Serialize a document to TOML. Deterministic: registry order throughout. */\nexport function renderCodexConfigToml(document: CodexConfigDocument): string {\n const ordered: Record<string, unknown> = {};\n if (document.model_provider) ordered.model_provider = document.model_provider;\n if (document.model) ordered.model = document.model;\n ordered.model_providers = document.model_providers;\n return `${stringifyToml(ordered)}\\n`;\n}\n\n/**\n * The session-private codex home.\n *\n * Deliberately outside `cwd`: codex's `workspace-write` sandbox makes the\n * working tree writable by the model, and a config home inside it would let a\n * turn rewrite its own `base_url`. `$SKAILE_HOME` (honoured by\n * {@link globalSkaileDir}) relocates the whole tree, which is also the test\n * seam.\n */\nexport function codexSessionHome(config: { cwd: string; sessionId?: string }): string {\n const key =\n config.sessionId && /^[A-Za-z0-9._-]{1,128}$/.test(config.sessionId)\n ? config.sessionId\n : createHash(\"sha256\")\n .update(config.sessionId ?? config.cwd)\n .digest(\"hex\")\n .slice(0, 32);\n return join(globalSkaileDir(), \"codex\", key);\n}\n\n/**\n * Write `<home>/config.toml`, creating the home always. Atomic: a\n * partially written document would fail codex's config load for the whole\n * session.\n *\n * A document with no provider tables says nothing codex does not already\n * know, so nothing is written and a file left by an earlier render is\n * removed — a session that no longer carries a registry must not keep\n * answering to the one it used to have.\n *\n * @returns the absolute path written, or `undefined` when there was nothing\n * to render.\n */\nexport function writeCodexConfigToml(\n home: string,\n document: CodexConfigDocument,\n): string | undefined {\n const path = join(home, \"config.toml\");\n // codex exits when CODEX_HOME names a directory that does not exist, so the\n // home exists before the early return too.\n mkdirSync(home, { recursive: true, mode: 0o700 });\n if (Object.keys(document.model_providers).length === 0) {\n rmSync(path, { force: true });\n return undefined;\n }\n const temporary = join(home, \"config.toml.new\");\n rmSync(temporary, { force: true });\n writeFileSync(temporary, renderCodexConfigToml(document), { mode: 0o600, flag: \"wx\" });\n renameSync(temporary, path);\n return path;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { depToStr, parseDep, isValidAssetName, slugifyAssetName } from './chunk-
|
|
1
|
+
import { depToStr, parseDep, isValidAssetName, slugifyAssetName } from './chunk-WDXZA7QW.js';
|
|
2
2
|
import { createLogger } from './chunk-BOFL7GIF.js';
|
|
3
3
|
import { existsSync, readFileSync } from 'fs';
|
|
4
4
|
import { stat, readFile, opendir } from 'fs/promises';
|
|
@@ -348,6 +348,19 @@ function fromContractMdContent(content, repoName, filePath) {
|
|
|
348
348
|
dependencies: []
|
|
349
349
|
};
|
|
350
350
|
}
|
|
351
|
+
function fromComposableMdContent(kind, content, repoName, filePath) {
|
|
352
|
+
const { data: meta } = parseFrontmatter(content);
|
|
353
|
+
return {
|
|
354
|
+
name: String(meta.name ?? basename(dirname(filePath))),
|
|
355
|
+
kind,
|
|
356
|
+
description: String(meta.description ?? ""),
|
|
357
|
+
source: filePath,
|
|
358
|
+
publisher: repoName,
|
|
359
|
+
version: extractVersion(meta),
|
|
360
|
+
requires: [],
|
|
361
|
+
dependencies: []
|
|
362
|
+
};
|
|
363
|
+
}
|
|
351
364
|
async function fromMcpServerMd(filePath, repoName) {
|
|
352
365
|
return fromMcpServerMdContent(await readManifestFile(filePath), repoName, filePath);
|
|
353
366
|
}
|
|
@@ -371,6 +384,9 @@ function fromMcpServerMdContent(content, repoName, filePath) {
|
|
|
371
384
|
if (meta.payload && typeof meta.payload === "object" && !Array.isArray(meta.payload)) {
|
|
372
385
|
metadata.payload = meta.payload;
|
|
373
386
|
}
|
|
387
|
+
if (Array.isArray(meta.fields)) {
|
|
388
|
+
metadata.fields = meta.fields;
|
|
389
|
+
}
|
|
374
390
|
return {
|
|
375
391
|
name: String(meta.name ?? basename(dirname(filePath))),
|
|
376
392
|
kind: "mcp-server",
|
|
@@ -579,6 +595,8 @@ function entryFromManifest(name, content, filePath, repoName, knownKinds) {
|
|
|
579
595
|
if (name === "AGENT.md") return fromAgentMdContent(content, repoName, filePath);
|
|
580
596
|
if (name === "agent.yaml") return fromAgentYamlContent(content, repoName, filePath);
|
|
581
597
|
if (name === "CONTRACT.md") return fromContractMdContent(content, repoName, filePath);
|
|
598
|
+
if (name === "PERSONA.md") return fromComposableMdContent("persona", content, repoName, filePath);
|
|
599
|
+
if (name === "RULESET.md") return fromComposableMdContent("ruleset", content, repoName, filePath);
|
|
582
600
|
if (name === "MCP.md") return fromMcpServerMdContent(content, repoName, filePath);
|
|
583
601
|
if (name === "CONNECTOR.md") return fromConnectorMdContent(content, repoName, filePath);
|
|
584
602
|
if (name === "knowledge.yaml") return fromKnowledgeYamlContent(content, repoName, filePath);
|
|
@@ -589,7 +607,7 @@ function entryFromManifest(name, content, filePath, repoName, knownKinds) {
|
|
|
589
607
|
return null;
|
|
590
608
|
}
|
|
591
609
|
function isManifestName(name) {
|
|
592
|
-
return name === "SKILL.md" || name === "AGENT.md" || name === "agent.yaml" || name === "CONTRACT.md" || name === "MCP.md" || name === "CONNECTOR.md" || name === "knowledge.yaml" || name.endsWith(".prompt.md") || name.endsWith(".preset.yaml") || name.endsWith(".flow.yaml") || name.endsWith(".flow.json");
|
|
610
|
+
return name === "SKILL.md" || name === "AGENT.md" || name === "agent.yaml" || name === "CONTRACT.md" || name === "PERSONA.md" || name === "RULESET.md" || name === "MCP.md" || name === "CONNECTOR.md" || name === "knowledge.yaml" || name.endsWith(".prompt.md") || name.endsWith(".preset.yaml") || name.endsWith(".flow.yaml") || name.endsWith(".flow.json");
|
|
593
611
|
}
|
|
594
612
|
async function readManifestAssetOverrides(root, opTimeoutMs) {
|
|
595
613
|
const out = {};
|
|
@@ -693,5 +711,5 @@ function readAssetBody(file, text) {
|
|
|
693
711
|
}
|
|
694
712
|
|
|
695
713
|
export { DEFAULT_FS_DEADLINE_MS, DEFAULT_WALK_BUDGET_MS, DEFAULT_WALK_MAX_DEPTH, DEFAULT_WALK_MAX_ENTRIES, FS_DEADLINE_ENV_VAR, FsDeadlineError, ManifestKindError, WALK_BUDGET_MS_ENV_VAR, WALK_MAX_DEPTH_ENV_VAR, WALK_MAX_ENTRIES_ENV_VAR, agentYamlRequires, assetDepRefs, dedupeRequirementRefs, dedupeRequirements, fromAgentMd, fromAgentYaml, fromConnectorMd, fromContractMd, fromFlowYaml, fromKnowledgeYaml, fromMcpServerMd, fromMcpServerMdContent, fromPresetYaml, fromPromptMd, fromSkillMd, fsDeadlineMs, isManifestName, manifestKindDiagnostic, parseFrontmatter, parseRequires, presetItemRefs, readAssetBody, requirementKey, scanDirectory, tryWithFsDeadline, walkDir, withFsDeadline };
|
|
696
|
-
//# sourceMappingURL=chunk-
|
|
697
|
-
//# sourceMappingURL=chunk-
|
|
714
|
+
//# sourceMappingURL=chunk-GOCWM7FN.js.map
|
|
715
|
+
//# sourceMappingURL=chunk-GOCWM7FN.js.map
|