@skaile/workspaces 5.12.0 → 5.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +114 -0
- package/README.md +2 -2
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-AM6PSSGM.js → asset-feeds-PAOX3FUT.js} +20 -20
- package/dist/{asset-feeds-AM6PSSGM.js.map → asset-feeds-PAOX3FUT.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +9 -9
- package/dist/asset-manager/index.js +15 -15
- package/dist/asset-manager/installer.js +11 -11
- package/dist/asset-manager/renderers.js +10 -10
- package/dist/asset-manager/src/index.d.ts +53 -10
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/asset-manager/src/installer.d.ts +0 -10
- package/dist/asset-manager/src/installer.d.ts.map +1 -1
- package/dist/bridge/drivers/claude-sdk.js +155 -18
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +73 -27
- package/dist/bridge/drivers/codex.js.map +1 -1
- package/dist/bridge/drivers/continue.js +12 -11
- package/dist/bridge/drivers/continue.js.map +1 -1
- package/dist/bridge/drivers/echo.js +4 -3
- package/dist/bridge/drivers/echo.js.map +1 -1
- package/dist/bridge/drivers/gemini.js +7 -6
- package/dist/bridge/drivers/goose.js +12 -11
- package/dist/bridge/drivers/goose.js.map +1 -1
- package/dist/bridge/drivers/omp.js +105 -29
- package/dist/bridge/drivers/omp.js.map +1 -1
- package/dist/bridge/drivers/opencode.js +12 -11
- package/dist/bridge/drivers/opencode.js.map +1 -1
- package/dist/bridge/drivers/qwen.js +7 -6
- package/dist/bridge/drivers/qwen.js.map +1 -1
- package/dist/bridge/index.js +16 -15
- package/dist/bridge/src/codex/config-toml.d.ts +8 -0
- package/dist/bridge/src/codex/config-toml.d.ts.map +1 -1
- package/dist/bridge/src/drivers/claude-sdk.d.ts +2 -0
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/drivers/claude-self-turns.d.ts +72 -0
- package/dist/bridge/src/drivers/claude-self-turns.d.ts.map +1 -0
- package/dist/bridge/src/drivers/codex.d.ts +6 -0
- package/dist/bridge/src/drivers/codex.d.ts.map +1 -1
- package/dist/bridge/src/drivers/omp-models-yml.d.ts +32 -0
- package/dist/bridge/src/drivers/omp-models-yml.d.ts.map +1 -1
- package/dist/bridge/src/drivers/omp.d.ts +20 -6
- package/dist/bridge/src/drivers/omp.d.ts.map +1 -1
- package/dist/bridge/src/normalizer.d.ts.map +1 -1
- package/dist/bridge/src/types.d.ts +12 -0
- package/dist/bridge/src/types.d.ts.map +1 -1
- package/dist/{chunk-QCEKGYHF.js → chunk-2BIESC6S.js} +3 -3
- package/dist/{chunk-QCEKGYHF.js.map → chunk-2BIESC6S.js.map} +1 -1
- package/dist/{chunk-P23WJCH2.js → chunk-3NNL334S.js} +23 -18
- package/dist/chunk-3NNL334S.js.map +1 -0
- package/dist/{chunk-6VLHITAM.js → chunk-57SF6W6E.js} +4 -3
- package/dist/chunk-57SF6W6E.js.map +1 -0
- package/dist/{chunk-GWD3QNVS.js → chunk-5IMGZAKH.js} +5 -5
- package/dist/{chunk-GWD3QNVS.js.map → chunk-5IMGZAKH.js.map} +1 -1
- package/dist/{chunk-NDF24LYP.js → chunk-5NVDOEWX.js} +15 -7
- package/dist/chunk-5NVDOEWX.js.map +1 -0
- package/dist/{chunk-3HUV2LJF.js → chunk-6JKIOPT3.js} +4 -4
- package/dist/{chunk-3HUV2LJF.js.map → chunk-6JKIOPT3.js.map} +1 -1
- package/dist/{chunk-MF54ZHWT.js → chunk-6VIVUBNN.js} +4 -271
- package/dist/chunk-6VIVUBNN.js.map +1 -0
- package/dist/{chunk-2X3JBVGD.js → chunk-7LGNJJ76.js} +18 -9
- package/dist/chunk-7LGNJJ76.js.map +1 -0
- package/dist/chunk-BASMWKPM.js +649 -0
- package/dist/chunk-BASMWKPM.js.map +1 -0
- package/dist/{chunk-PNOGX36L.js → chunk-CAPKENNF.js} +92 -26
- package/dist/chunk-CAPKENNF.js.map +1 -0
- package/dist/{chunk-7QWQTA5S.js → chunk-CNZI37HV.js} +4 -4
- package/dist/{chunk-7QWQTA5S.js.map → chunk-CNZI37HV.js.map} +1 -1
- package/dist/{chunk-PMECEZK3.js → chunk-D54T2F54.js} +5 -4
- package/dist/chunk-D54T2F54.js.map +1 -0
- package/dist/{chunk-F4NJDSR7.js → chunk-D5WTOVLG.js} +7 -4
- package/dist/chunk-D5WTOVLG.js.map +1 -0
- package/dist/{chunk-XZY6SBGU.js → chunk-DHUJRIQQ.js} +3 -3
- package/dist/{chunk-XZY6SBGU.js.map → chunk-DHUJRIQQ.js.map} +1 -1
- package/dist/chunk-DWRYUWOK.js +273 -0
- package/dist/chunk-DWRYUWOK.js.map +1 -0
- package/dist/{chunk-NJV5SLEK.js → chunk-FD2IPIE2.js} +46 -46
- package/dist/chunk-FD2IPIE2.js.map +1 -0
- package/dist/{chunk-POQ6PGNE.js → chunk-GJGEDWRT.js} +22 -6
- package/dist/chunk-GJGEDWRT.js.map +1 -0
- package/dist/{chunk-CPSIPIX7.js → chunk-IG5LZ3WU.js} +8 -6
- package/dist/chunk-IG5LZ3WU.js.map +1 -0
- package/dist/{chunk-3LVB3HGH.js → chunk-IPN7N2AZ.js} +3 -3
- package/dist/{chunk-3LVB3HGH.js.map → chunk-IPN7N2AZ.js.map} +1 -1
- package/dist/{chunk-NGJIVDDD.js → chunk-IQVZIVSA.js} +3 -3
- package/dist/{chunk-NGJIVDDD.js.map → chunk-IQVZIVSA.js.map} +1 -1
- package/dist/{chunk-CTP3XBMF.js → chunk-IY5E7Y5W.js} +57 -7
- package/dist/chunk-IY5E7Y5W.js.map +1 -0
- package/dist/{chunk-PNTXHTBC.js → chunk-J4OYIYFQ.js} +2 -2
- package/dist/{chunk-PNTXHTBC.js.map → chunk-J4OYIYFQ.js.map} +1 -1
- package/dist/{chunk-XTVSNWLL.js → chunk-M3P4BYRK.js} +34 -11
- package/dist/chunk-M3P4BYRK.js.map +1 -0
- package/dist/{chunk-X6LKA3TJ.js → chunk-MCLT3BJG.js} +6 -6
- package/dist/{chunk-X6LKA3TJ.js.map → chunk-MCLT3BJG.js.map} +1 -1
- package/dist/{chunk-7CR2OZPA.js → chunk-NVO6WECE.js} +9 -8
- package/dist/chunk-NVO6WECE.js.map +1 -0
- package/dist/chunk-O3Q3MOAV.js +64 -0
- package/dist/chunk-O3Q3MOAV.js.map +1 -0
- package/dist/{chunk-C3BMXXTN.js → chunk-ODQGLELI.js} +68 -24
- package/dist/chunk-ODQGLELI.js.map +1 -0
- package/dist/chunk-OKQXY6FS.js +1336 -0
- package/dist/chunk-OKQXY6FS.js.map +1 -0
- package/dist/{chunk-T5TSLSRO.js → chunk-OX2W5YF3.js} +8 -8
- package/dist/{chunk-T5TSLSRO.js.map → chunk-OX2W5YF3.js.map} +1 -1
- package/dist/{chunk-N5M2EISA.js → chunk-PAUM35HD.js} +250 -71
- package/dist/chunk-PAUM35HD.js.map +1 -0
- package/dist/{chunk-YQU2BPQD.js → chunk-PGVSOHWE.js} +2 -2
- package/dist/{chunk-YQU2BPQD.js.map → chunk-PGVSOHWE.js.map} +1 -1
- package/dist/{chunk-WI4T3KIS.js → chunk-PUG7IWFF.js} +130 -23
- package/dist/chunk-PUG7IWFF.js.map +1 -0
- package/dist/{chunk-2H73V6XR.js → chunk-PW3TYWOI.js} +3 -3
- package/dist/{chunk-2H73V6XR.js.map → chunk-PW3TYWOI.js.map} +1 -1
- package/dist/{chunk-UTKENBB6.js → chunk-PXDWTJ3P.js} +4 -4
- package/dist/{chunk-UTKENBB6.js.map → chunk-PXDWTJ3P.js.map} +1 -1
- package/dist/{chunk-TVAR4JHA.js → chunk-QAYL3PYY.js} +320 -51
- package/dist/chunk-QAYL3PYY.js.map +1 -0
- package/dist/{chunk-7XWUJC3A.js → chunk-QELQDY5K.js} +3 -3
- package/dist/{chunk-7XWUJC3A.js.map → chunk-QELQDY5K.js.map} +1 -1
- package/dist/{chunk-VRLKHL74.js → chunk-S6FZUR5H.js} +7 -6
- package/dist/chunk-S6FZUR5H.js.map +1 -0
- package/dist/{chunk-SHQMPGOL.js → chunk-TYUJPQNX.js} +10 -5
- package/dist/chunk-TYUJPQNX.js.map +1 -0
- package/dist/chunk-U27JRO5L.js +13 -0
- package/dist/chunk-U27JRO5L.js.map +1 -0
- package/dist/{chunk-ICIYSJBQ.js → chunk-UK3LRPJ5.js} +15 -7
- package/dist/chunk-UK3LRPJ5.js.map +1 -0
- package/dist/{chunk-KVSDRB35.js → chunk-UQ4SQOR6.js} +5 -5
- package/dist/{chunk-KVSDRB35.js.map → chunk-UQ4SQOR6.js.map} +1 -1
- package/dist/{chunk-G3X4MLDB.js → chunk-USHB5KEY.js} +3 -3
- package/dist/{chunk-G3X4MLDB.js.map → chunk-USHB5KEY.js.map} +1 -1
- package/dist/{chunk-HYMERG57.js → chunk-V7AWO5FL.js} +3 -3
- package/dist/{chunk-HYMERG57.js.map → chunk-V7AWO5FL.js.map} +1 -1
- package/dist/chunk-VTG5Z3KD.js +345 -0
- package/dist/chunk-VTG5Z3KD.js.map +1 -0
- package/dist/{chunk-27L6BBAT.js → chunk-VTXXBYB3.js} +10 -10
- package/dist/{chunk-27L6BBAT.js.map → chunk-VTXXBYB3.js.map} +1 -1
- package/dist/{chunk-XMAJJPA4.js → chunk-WTEYDNTR.js} +3 -3
- package/dist/{chunk-XMAJJPA4.js.map → chunk-WTEYDNTR.js.map} +1 -1
- package/dist/{chunk-NJXR5OAM.js → chunk-YFIHFJEB.js} +4 -4
- package/dist/{chunk-NJXR5OAM.js.map → chunk-YFIHFJEB.js.map} +1 -1
- package/dist/{chunk-VMKMFS2Q.js → chunk-YIDZJHY6.js} +3 -3
- package/dist/{chunk-VMKMFS2Q.js.map → chunk-YIDZJHY6.js.map} +1 -1
- package/dist/{chunk-2JFIFDDO.js → chunk-YTZFSKWL.js} +3 -3
- package/dist/{chunk-2JFIFDDO.js.map → chunk-YTZFSKWL.js.map} +1 -1
- package/dist/{chunk-SMT3LNAG.js → chunk-ZBD6EITA.js} +4 -4
- package/dist/{chunk-SMT3LNAG.js.map → chunk-ZBD6EITA.js.map} +1 -1
- package/dist/{chunk-JQ3DXNQV.js → chunk-ZDTZGEJG.js} +6 -6
- package/dist/{chunk-JQ3DXNQV.js.map → chunk-ZDTZGEJG.js.map} +1 -1
- package/dist/{chunk-X4BAYGMT.js → chunk-ZIW34FGO.js} +3 -3
- package/dist/{chunk-X4BAYGMT.js.map → chunk-ZIW34FGO.js.map} +1 -1
- package/dist/{chunk-DCHQ6BAZ.js → chunk-ZU24LWBI.js} +3 -3
- package/dist/{chunk-DCHQ6BAZ.js.map → chunk-ZU24LWBI.js.map} +1 -1
- package/dist/cli/index.js +493 -232
- 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-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts +2 -0
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/diff.d.ts +1 -1
- package/dist/cli/src/commands/diff.d.ts.map +1 -1
- package/dist/cli/src/commands/integration.d.ts.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/library-index.d.ts +10 -0
- package/dist/cli/src/commands/library-index.d.ts.map +1 -1
- package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
- package/dist/cli/src/commands/plugin/claude-code.d.ts.map +1 -1
- package/dist/cli/src/commands/plugin/types.d.ts +2 -0
- package/dist/cli/src/commands/plugin/types.d.ts.map +1 -1
- package/dist/cli/src/commands/plugin-registry-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/preset-apply.d.ts.map +1 -1
- package/dist/cli/src/commands/project.d.ts +8 -0
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/cli/src/commands/run.d.ts +9 -0
- package/dist/cli/src/commands/run.d.ts.map +1 -1
- package/dist/cli/src/commands/serve-preflight.d.ts +2 -1
- package/dist/cli/src/commands/serve-preflight.d.ts.map +1 -1
- package/dist/cli/src/commands/serve.d.ts +7 -0
- package/dist/cli/src/commands/serve.d.ts.map +1 -1
- package/dist/cli/src/commands/source-manifest.d.ts +1 -0
- package/dist/cli/src/commands/source-manifest.d.ts.map +1 -1
- package/dist/cli/src/commands/source.d.ts +9 -1
- package/dist/cli/src/commands/source.d.ts.map +1 -1
- package/dist/cli/src/commands/store.d.ts.map +1 -1
- package/dist/cli/src/commands/update.d.ts.map +1 -1
- package/dist/cli/src/commands/validate-instances.d.ts.map +1 -1
- package/dist/cli/src/commands/validate.d.ts +3 -2
- package/dist/cli/src/commands/validate.d.ts.map +1 -1
- package/dist/cli/src/driver-error.d.ts +7 -0
- package/dist/cli/src/driver-error.d.ts.map +1 -1
- package/dist/cli/src/helpers.d.ts +6 -0
- package/dist/cli/src/helpers.d.ts.map +1 -1
- package/dist/cli/src/plugin-store/index.d.ts +1 -1
- package/dist/cli/src/plugin-store/index.d.ts.map +1 -1
- package/dist/cli/src/plugin-store/reconcile.d.ts +24 -4
- package/dist/cli/src/plugin-store/reconcile.d.ts.map +1 -1
- package/dist/cli/src/skill-checks.d.ts +15 -4
- package/dist/cli/src/skill-checks.d.ts.map +1 -1
- package/dist/cli/src/store-addable.d.ts +7 -8
- package/dist/cli/src/store-addable.d.ts.map +1 -1
- package/dist/connectors/config.js +6 -6
- package/dist/connectors/index.js +20 -19
- package/dist/connectors/src/config.d.ts.map +1 -1
- package/dist/{connectors-UNKUKEPG.js → connectors-2TEGRRYC.js} +23 -22
- package/dist/{connectors-UNKUKEPG.js.map → connectors-2TEGRRYC.js.map} +1 -1
- package/dist/connectors-shared/index.js +2 -2
- package/dist/core/driver-targets.js +1 -1
- package/dist/core/index.js +8 -8
- package/dist/core/manifest.js +2 -2
- package/dist/core/models.js +1 -1
- package/dist/core/publish-manifest.js +4 -2
- package/dist/core/ref.js +1 -1
- package/dist/core/runtime-assets.js +6 -6
- package/dist/core/src/agent-instances.d.ts +5 -0
- package/dist/core/src/agent-instances.d.ts.map +1 -1
- package/dist/core/src/driver-targets.d.ts.map +1 -1
- package/dist/core/src/index.d.ts +2 -2
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/manifest.d.ts +9 -3
- package/dist/core/src/manifest.d.ts.map +1 -1
- package/dist/core/src/models.d.ts +8 -0
- package/dist/core/src/models.d.ts.map +1 -1
- package/dist/core/src/publish-manifest.d.ts +38 -1
- package/dist/core/src/publish-manifest.d.ts.map +1 -1
- package/dist/core/src/repo-manager.d.ts +8 -3
- package/dist/core/src/repo-manager.d.ts.map +1 -1
- package/dist/core/src/runtime-assets.d.ts.map +1 -1
- package/dist/core/src/store.d.ts +4 -0
- package/dist/core/src/store.d.ts.map +1 -1
- package/dist/core/src/walker.d.ts +2 -0
- package/dist/core/src/walker.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +40 -2
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/store.js +2 -2
- package/dist/core/workspace-config.js +5 -5
- package/dist/deploy/index.js +8 -8
- package/dist/discovery/index.js +5 -5
- package/dist/discovery/src/parse-manifest.d.ts.map +1 -1
- package/dist/discovery/src/source-config.d.ts +5 -3
- package/dist/discovery/src/source-config.d.ts.map +1 -1
- package/dist/{ensure-sources-POMEQSTM.js → ensure-sources-EG7YKKZL.js} +18 -18
- package/dist/{ensure-sources-POMEQSTM.js.map → ensure-sources-EG7YKKZL.js.map} +1 -1
- package/dist/factory-assets/README.md +1 -1
- package/dist/factory-assets/connectors/box.js +20 -19
- package/dist/factory-assets/connectors/deploy.js +20 -19
- package/dist/factory-assets/connectors/devserver.js +20 -19
- package/dist/factory-assets/connectors/flow/adapter.js +20 -19
- package/dist/factory-assets/connectors/flow/engine.js +9 -9
- package/dist/factory-assets/connectors/flow/run-flow.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.js +22 -21
- package/dist/factory-assets/connectors/flow.js +20 -19
- package/dist/factory-assets/connectors/git.js +20 -19
- package/dist/factory-assets/connectors/gmail.js +20 -19
- package/dist/factory-assets/connectors/googledrive.js +20 -19
- package/dist/factory-assets/connectors/local.js +20 -19
- package/dist/factory-assets/connectors/mattermost.js +20 -19
- package/dist/factory-assets/connectors/memory.js +20 -19
- package/dist/factory-assets/connectors/minio.js +20 -19
- package/dist/factory-assets/connectors/postgres.js +20 -19
- package/dist/factory-assets/connectors/s3.js +20 -19
- package/dist/factory-assets/connectors/sharepoint.js +20 -19
- package/dist/factory-assets/connectors/sqlite.js +20 -19
- package/dist/factory-assets/connectors/static-server.js +20 -19
- package/dist/factory-assets/connectors/tunnel.js +20 -19
- package/dist/factory-assets/connectors/webdav.js +20 -19
- package/dist/factory-assets/connectors/xstate-store.js +20 -19
- package/dist/factory-assets/connectors/xstate.js +20 -19
- package/dist/{flows-DVKMZKM4.js → flows-5TW3XFMH.js} +13 -13
- package/dist/{flows-DVKMZKM4.js.map → flows-5TW3XFMH.js.map} +1 -1
- package/dist/{helpers-Y4OT7VIS.js → helpers-BQGXEKRP.js} +18 -18
- package/dist/{helpers-Y4OT7VIS.js.map → helpers-BQGXEKRP.js.map} +1 -1
- package/dist/library/index.js +12 -12
- package/dist/library/install.js +5 -3
- package/dist/library/src/local/local-catalog-source.d.ts +6 -0
- package/dist/library/src/local/local-catalog-source.d.ts.map +1 -1
- package/dist/library/src/manifest-writer.d.ts +1 -1
- package/dist/library/src/manifest-writer.d.ts.map +1 -1
- package/dist/library/src/remote/remote-catalog-source.d.ts.map +1 -1
- package/dist/library/src/user-library.d.ts +2 -0
- package/dist/library/src/user-library.d.ts.map +1 -1
- package/dist/{library-publish-DI4Q5UOG.js → library-publish-EUP524PE.js} +28 -25
- package/dist/library-publish-EUP524PE.js.map +1 -0
- package/dist/model-endpoint/index.d.ts +2 -0
- package/dist/model-endpoint/index.js +9 -0
- package/dist/model-endpoint/index.js.map +1 -0
- package/dist/model-endpoint/src/index.d.ts +4 -0
- package/dist/model-endpoint/src/index.d.ts.map +1 -0
- package/dist/model-endpoint/src/openai-chat.d.ts +105 -0
- package/dist/model-endpoint/src/openai-chat.d.ts.map +1 -0
- package/dist/model-endpoint/src/openai-responses.d.ts +106 -0
- package/dist/model-endpoint/src/openai-responses.d.ts.map +1 -0
- package/dist/model-endpoint/src/openai-shared.d.ts +77 -0
- package/dist/model-endpoint/src/openai-shared.d.ts.map +1 -0
- package/dist/model-endpoint/src/resolve.d.ts +36 -0
- package/dist/model-endpoint/src/resolve.d.ts.map +1 -0
- package/dist/model-endpoint/src/server.d.ts +16 -0
- package/dist/model-endpoint/src/server.d.ts.map +1 -0
- package/dist/model-endpoint/src/types.d.ts +78 -0
- package/dist/model-endpoint/src/types.d.ts.map +1 -0
- package/dist/open-library-QNMIMZYS.js +40 -0
- package/dist/{open-library-N6ESO6IK.js.map → open-library-QNMIMZYS.js.map} +1 -1
- package/dist/open-registry-BOUCBDLF.js +32 -0
- package/dist/{open-registry-CBZ5MWTT.js.map → open-registry-BOUCBDLF.js.map} +1 -1
- package/dist/paths-B6SX6J6T.js +22 -0
- package/dist/{paths-U6W6MQNQ.js.map → paths-B6SX6J6T.js.map} +1 -1
- package/dist/{plugin-store-XMZSPVBF.js → plugin-store-MLFP3WJ7.js} +62 -20
- package/dist/plugin-store-MLFP3WJ7.js.map +1 -0
- package/dist/plugins/src/catalog-source.d.ts +6 -0
- package/dist/plugins/src/catalog-source.d.ts.map +1 -1
- package/dist/project-GXCIEJGM.js +82 -0
- package/dist/{project-UP52HEHC.js.map → project-GXCIEJGM.js.map} +1 -1
- package/dist/resolver/index.js +9 -9
- package/dist/runner/index.js +35 -32
- package/dist/runner/src/agent.d.ts.map +1 -1
- package/dist/runner/src/composition/index.d.ts +1 -1
- package/dist/runner/src/composition/index.d.ts.map +1 -1
- package/dist/runner/src/composition/prompt-sections.d.ts +18 -6
- package/dist/runner/src/composition/prompt-sections.d.ts.map +1 -1
- package/dist/runner/src/model-endpoint-discovery.d.ts +64 -0
- package/dist/runner/src/model-endpoint-discovery.d.ts.map +1 -0
- package/dist/runner/src/serve.d.ts +6 -0
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts +8 -0
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/runner/src/session.d.ts +2 -0
- package/dist/runner/src/session.d.ts.map +1 -1
- package/dist/runner/src/ws-auth-warning.d.ts +17 -0
- package/dist/runner/src/ws-auth-warning.d.ts.map +1 -0
- package/dist/sdk/asset-manager.js +15 -15
- package/dist/sdk/bridge.js +16 -15
- package/dist/sdk/core.js +8 -8
- package/dist/sdk/flow.js +9 -9
- package/dist/sdk/index.js +35 -32
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/resolver.js +9 -9
- package/dist/sdk/runner.js +35 -32
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/types.js +1 -1
- package/dist/serve-preflight-GNBW3O4U.js +64 -0
- package/dist/serve-preflight-GNBW3O4U.js.map +1 -0
- package/dist/session/index.js +2 -2
- package/dist/{setup-5IRUH5OS.js → setup-HJEYEXLS.js} +26 -25
- package/dist/setup-HJEYEXLS.js.map +1 -0
- package/dist/skills-4WMYGJDL.js +26 -0
- package/dist/{skills-HA36RFNM.js.map → skills-4WMYGJDL.js.map} +1 -1
- package/dist/source-5VL6PHER.js +42 -0
- package/dist/{source-DX5SGWEI.js.map → source-5VL6PHER.js.map} +1 -1
- package/dist/{source-manifest-publish-NMRLXWVW.js → source-manifest-publish-Q66H7EJI.js} +25 -24
- package/dist/source-manifest-publish-Q66H7EJI.js.map +1 -0
- package/dist/tui/index.js +52 -39
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/src/repl.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/manifests.js +1 -1
- package/dist/types/src/delivery.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +55 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/lifecycle.d.ts +2 -1
- package/dist/types/src/lifecycle.d.ts.map +1 -1
- package/dist/types/src/manifests/preset.d.ts +6 -1
- package/dist/types/src/manifests/preset.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +11 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +27 -26
- package/dist/workspace-plugin/adapters/omp.js +14 -14
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +12 -1
- package/dist/chunk-2X3JBVGD.js.map +0 -1
- package/dist/chunk-6VLHITAM.js.map +0 -1
- package/dist/chunk-7CR2OZPA.js.map +0 -1
- package/dist/chunk-C3BMXXTN.js.map +0 -1
- package/dist/chunk-CPSIPIX7.js.map +0 -1
- package/dist/chunk-CTP3XBMF.js.map +0 -1
- package/dist/chunk-F4NJDSR7.js.map +0 -1
- package/dist/chunk-ICIYSJBQ.js.map +0 -1
- package/dist/chunk-ID745F3R.js +0 -625
- package/dist/chunk-ID745F3R.js.map +0 -1
- package/dist/chunk-K4VOEYOR.js +0 -21
- package/dist/chunk-K4VOEYOR.js.map +0 -1
- package/dist/chunk-MF54ZHWT.js.map +0 -1
- package/dist/chunk-N5M2EISA.js.map +0 -1
- package/dist/chunk-NDF24LYP.js.map +0 -1
- package/dist/chunk-NJV5SLEK.js.map +0 -1
- package/dist/chunk-NR7H7ZJP.js +0 -400
- package/dist/chunk-NR7H7ZJP.js.map +0 -1
- package/dist/chunk-P23WJCH2.js.map +0 -1
- package/dist/chunk-PMECEZK3.js.map +0 -1
- package/dist/chunk-PNOGX36L.js.map +0 -1
- package/dist/chunk-POQ6PGNE.js.map +0 -1
- package/dist/chunk-SHQMPGOL.js.map +0 -1
- package/dist/chunk-TVAR4JHA.js.map +0 -1
- package/dist/chunk-VRLKHL74.js.map +0 -1
- package/dist/chunk-WI4T3KIS.js.map +0 -1
- package/dist/chunk-XTVSNWLL.js.map +0 -1
- package/dist/library-publish-DI4Q5UOG.js.map +0 -1
- package/dist/open-library-N6ESO6IK.js +0 -40
- package/dist/open-registry-CBZ5MWTT.js +0 -32
- package/dist/paths-U6W6MQNQ.js +0 -22
- package/dist/plugin-store-XMZSPVBF.js.map +0 -1
- package/dist/project-UP52HEHC.js +0 -79
- package/dist/serve-preflight-6P2JJEJ3.js +0 -47
- package/dist/serve-preflight-6P2JJEJ3.js.map +0 -1
- package/dist/setup-5IRUH5OS.js.map +0 -1
- package/dist/skills-HA36RFNM.js +0 -26
- package/dist/source-DX5SGWEI.js +0 -41
- package/dist/source-manifest-publish-NMRLXWVW.js.map +0 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { AssistantMessage, AssistantMessageEvent } from "@earendil-works/pi-ai";
|
|
2
|
+
import { type ParsedModelRequest } from "./openai-shared.js";
|
|
3
|
+
/** Parsed `POST /v1/responses` body, in pi terms (`includeUsage` is always true: Responses always reports usage). */
|
|
4
|
+
export type ResponsesRequest = ParsedModelRequest;
|
|
5
|
+
export interface ResponseSummaryPart {
|
|
6
|
+
type: "summary_text";
|
|
7
|
+
text: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ResponseReasoningItem {
|
|
10
|
+
type: "reasoning";
|
|
11
|
+
id: string;
|
|
12
|
+
summary: ResponseSummaryPart[];
|
|
13
|
+
}
|
|
14
|
+
export interface ResponseMessageItem {
|
|
15
|
+
type: "message";
|
|
16
|
+
id: string;
|
|
17
|
+
role: "assistant";
|
|
18
|
+
status: "in_progress" | "completed";
|
|
19
|
+
content: Array<{
|
|
20
|
+
type: "output_text";
|
|
21
|
+
text: string;
|
|
22
|
+
annotations: never[];
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
export interface ResponseFunctionCallItem {
|
|
26
|
+
type: "function_call";
|
|
27
|
+
id: string;
|
|
28
|
+
call_id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
arguments: string;
|
|
31
|
+
status: "in_progress" | "completed";
|
|
32
|
+
}
|
|
33
|
+
export type ResponseOutputItem = ResponseReasoningItem | ResponseMessageItem | ResponseFunctionCallItem;
|
|
34
|
+
export interface ResponseUsage {
|
|
35
|
+
input_tokens: number;
|
|
36
|
+
output_tokens: number;
|
|
37
|
+
total_tokens: number;
|
|
38
|
+
input_tokens_details: {
|
|
39
|
+
cached_tokens: number;
|
|
40
|
+
};
|
|
41
|
+
output_tokens_details: {
|
|
42
|
+
reasoning_tokens: number;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface ResponseObject {
|
|
46
|
+
id: string;
|
|
47
|
+
object: "response";
|
|
48
|
+
created_at: number;
|
|
49
|
+
model: string;
|
|
50
|
+
status: "in_progress" | "completed" | "incomplete";
|
|
51
|
+
incomplete_details: {
|
|
52
|
+
reason: "max_output_tokens";
|
|
53
|
+
} | null;
|
|
54
|
+
error: null;
|
|
55
|
+
output: ResponseOutputItem[];
|
|
56
|
+
usage: ResponseUsage | null;
|
|
57
|
+
}
|
|
58
|
+
export interface ResponsesMeta {
|
|
59
|
+
id: string;
|
|
60
|
+
created: number;
|
|
61
|
+
model: string;
|
|
62
|
+
}
|
|
63
|
+
/** One SSE event; `sequence_number` increases by one per event within a response. */
|
|
64
|
+
export interface ResponsesStreamEvent {
|
|
65
|
+
type: string;
|
|
66
|
+
sequence_number: number;
|
|
67
|
+
[key: string]: unknown;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Validates an OpenAI Responses body (stateless subset) and maps it to a pi `Context`.
|
|
71
|
+
* `previous_response_id` is rejected because the endpoint keeps no response state.
|
|
72
|
+
*/
|
|
73
|
+
export declare function parseResponsesRequest(body: unknown): ResponsesRequest;
|
|
74
|
+
/**
|
|
75
|
+
* Maps a finished pi message to a non-streaming Responses object. Output order is
|
|
76
|
+
* reasoning, message, then function calls. `error`/`aborted` throw 502.
|
|
77
|
+
*/
|
|
78
|
+
export declare function toResponse(message: AssistantMessage, meta: ResponsesMeta): ResponseObject;
|
|
79
|
+
interface OpenBlock {
|
|
80
|
+
kind: "message" | "reasoning";
|
|
81
|
+
outputIndex: number;
|
|
82
|
+
itemId: string;
|
|
83
|
+
text: string;
|
|
84
|
+
}
|
|
85
|
+
/** Mutable per-stream mapper state; `error` is set instead of emitting an event on upstream failure. */
|
|
86
|
+
export interface ResponsesStreamState {
|
|
87
|
+
readonly id: string;
|
|
88
|
+
readonly created: number;
|
|
89
|
+
readonly model: string;
|
|
90
|
+
/** Set when pi reports `error`/`aborted`; the server turns it into an SSE `error` event. */
|
|
91
|
+
error?: string;
|
|
92
|
+
sequence: number;
|
|
93
|
+
nextOutputIndex: number;
|
|
94
|
+
open: Map<number, OpenBlock>;
|
|
95
|
+
completed: Map<number, ResponseOutputItem>;
|
|
96
|
+
}
|
|
97
|
+
export declare function createResponsesStreamState(init: ResponsesMeta): ResponsesStreamState;
|
|
98
|
+
/**
|
|
99
|
+
* Stateful pi-event → Responses SSE mapper. Function calls are buffered until
|
|
100
|
+
* `toolcall_end` (pi only knows call id and name then) and then emitted as a
|
|
101
|
+
* complete added/arguments/done sequence. A length stop ends with
|
|
102
|
+
* `response.incomplete`, everything else with `response.completed`.
|
|
103
|
+
*/
|
|
104
|
+
export declare function responsesEvents(event: AssistantMessageEvent, state: ResponsesStreamState): ResponsesStreamEvent[];
|
|
105
|
+
export {};
|
|
106
|
+
//# sourceMappingURL=openai-responses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-responses.d.ts","sourceRoot":"","sources":["../../../model-endpoint/src/openai-responses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EAMtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAWL,KAAK,kBAAkB,EASxB,MAAM,oBAAoB,CAAC;AAG5B,qHAAqH;AACrH,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAElD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,cAAc,CAAC;IACrB,IAA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AE,aAAa,GAAG,oBAAoB,CAQpF;AA4GD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,qBAAqB,EAC5B,KAAK,EAAE,oBAAoB,GAC1B,oBAAoB,EAAE,CAgGxB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { AssistantMessage, Context, ImageContent, JsonObject, Message, SamplingParams, ThinkingLevel, Tool, ToolResultMessage, Usage } from "@earendil-works/pi-ai";
|
|
2
|
+
import { ModelEndpointError } from "./types.js";
|
|
3
|
+
/** Model-call options both OpenAI surfaces translate into pi `stream()` options. */
|
|
4
|
+
export interface ModelRequestOptions {
|
|
5
|
+
temperature?: number;
|
|
6
|
+
maxTokens?: number;
|
|
7
|
+
samplingParams?: SamplingParams;
|
|
8
|
+
reasoning?: ThinkingLevel;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Surface-independent result of parsing an OpenAI request. Both translators
|
|
12
|
+
* return this so the server can drive pi without knowing which wire format
|
|
13
|
+
* the caller spoke.
|
|
14
|
+
*/
|
|
15
|
+
export interface ParsedModelRequest {
|
|
16
|
+
model: string;
|
|
17
|
+
context: Context;
|
|
18
|
+
options: ModelRequestOptions;
|
|
19
|
+
stream: boolean;
|
|
20
|
+
includeUsage: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** `400 invalid_request_error` for malformed or unsupported caller input. */
|
|
23
|
+
export declare function badRequest(message: string): ModelEndpointError;
|
|
24
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
25
|
+
export declare function requireModel(body: Record<string, unknown>): string;
|
|
26
|
+
export declare function optionalBoolean(value: unknown, field: string): boolean;
|
|
27
|
+
export declare function optionalNumber(value: unknown, field: string): number | undefined;
|
|
28
|
+
export declare function optionalPositiveInt(value: unknown, field: string): number | undefined;
|
|
29
|
+
/** `none` (or absent) disables reasoning; anything else must be a pi thinking level. */
|
|
30
|
+
export declare function parseReasoningEffort(value: unknown, field: string): ThinkingLevel | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Copies request fields pi has no named option for (top_p, seed, stop, ...)
|
|
33
|
+
* into `samplingParams`, which OpenAI-compatible pi adapters merge into the
|
|
34
|
+
* upstream body as-is.
|
|
35
|
+
*/
|
|
36
|
+
export declare function pickSamplingParams(body: Record<string, unknown>, keys: readonly string[]): SamplingParams | undefined;
|
|
37
|
+
export declare function buildOptions(parts: {
|
|
38
|
+
temperature: number | undefined;
|
|
39
|
+
maxTokens: number | undefined;
|
|
40
|
+
samplingParams: SamplingParams | undefined;
|
|
41
|
+
reasoning: ThinkingLevel | undefined;
|
|
42
|
+
}): ModelRequestOptions;
|
|
43
|
+
/**
|
|
44
|
+
* Decodes a `data:` image URL into pi `ImageContent`. Remote URLs are rejected
|
|
45
|
+
* on purpose: fetching caller-supplied URLs from the runner would be an SSRF
|
|
46
|
+
* vector and the endpoint has no business doing I/O during translation.
|
|
47
|
+
*/
|
|
48
|
+
export declare function imageFromUrl(url: unknown, field: string): ImageContent;
|
|
49
|
+
/**
|
|
50
|
+
* Tool `arguments` arrive as a JSON string; pi wants an object. Invalid JSON or a
|
|
51
|
+
* non-object value becomes `{}` so one malformed history entry cannot fail the call.
|
|
52
|
+
*/
|
|
53
|
+
export declare function parseToolArguments(value: unknown): JsonObject;
|
|
54
|
+
export declare const DEFAULT_TOOL_PARAMETERS: {
|
|
55
|
+
readonly type: "object";
|
|
56
|
+
readonly properties: {};
|
|
57
|
+
};
|
|
58
|
+
export declare function toPiTool(name: string, description: unknown, parameters: unknown): Tool;
|
|
59
|
+
/**
|
|
60
|
+
* Applies OpenAI `tool_choice` to the tool list. pi's `stream()` has no
|
|
61
|
+
* tool-choice option, so the choice is enforced by what we declare: `none`
|
|
62
|
+
* declares nothing, a named function declares only that function.
|
|
63
|
+
*/
|
|
64
|
+
export declare function selectTools(tools: Tool[], choice: unknown, forcedName: (choice: Record<string, unknown>) => unknown): Tool[];
|
|
65
|
+
export declare function buildContext(systemParts: string[], messages: Message[], tools: Tool[]): Context;
|
|
66
|
+
export declare function emptyUsage(): Usage;
|
|
67
|
+
/** OpenAI counts cache reads/writes as prompt tokens; pi reports them separately. */
|
|
68
|
+
export declare function promptTokens(usage: Usage): number;
|
|
69
|
+
export declare function totalTokens(usage: Usage): number;
|
|
70
|
+
/**
|
|
71
|
+
* An assistant turn replayed from the caller's history. It is stamped with a
|
|
72
|
+
* foreign api/provider so pi treats it as cross-provider history (dropping
|
|
73
|
+
* provider-specific signatures) rather than as its own output.
|
|
74
|
+
*/
|
|
75
|
+
export declare function historyAssistant(model: string, content: AssistantMessage["content"]): AssistantMessage;
|
|
76
|
+
export declare function historyToolResult(toolCallId: string, toolName: string, text: string): ToolResultMessage;
|
|
77
|
+
//# sourceMappingURL=openai-shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-shared.d.ts","sourceRoot":"","sources":["../../../model-endpoint/src/openai-shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,OAAO,EACP,YAAY,EACZ,UAAU,EACV,OAAO,EACP,cAAc,EACd,aAAa,EACb,IAAI,EACJ,iBAAiB,EACjB,KAAK,EACN,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,oFAAoF;AACpF,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;CACvB;AAWD,6EAA6E;AAC7E,wBAAgB,UAAU,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AM,uBAAuB;;;CAA8C,CAAC;AAEnF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI,CAMtF;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,IAAI,EAAE,EACb,MAAM,EAAE,OAAO,EACf,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,GACvD,IAAI,EAAE,CAaR;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAK/F;AAED,wBAAgB,UAAU,IAAI,KAAK,CASlC;AAED,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAEjD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,GACnC,gBAAgB,CAWlB;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,iBAAiB,CASnB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registry → pi `Model` + request auth.
|
|
3
|
+
*
|
|
4
|
+
* Reuses the registry's own resolution (`parseModelRef`, `entrySurface`,
|
|
5
|
+
* `entryBaseUrl`, `entryCredentialValue`) so the endpoint routes exactly like a
|
|
6
|
+
* harness driver does; the only logic added here is the pi-specific base-URL
|
|
7
|
+
* spelling and the "unknown model" check `parseModelRef` does not make.
|
|
8
|
+
*/
|
|
9
|
+
import { type MergedAIProviderRegistry } from "@skaile/workspaces/core/provider-registry";
|
|
10
|
+
import { type ResolvedModel } from "./types.js";
|
|
11
|
+
/** What {@link resolveModel} reads from the live session. */
|
|
12
|
+
export interface ResolveDeps {
|
|
13
|
+
registry: MergedAIProviderRegistry;
|
|
14
|
+
lookupEnv: Record<string, string | undefined>;
|
|
15
|
+
roles?: Record<string, string>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Resolve a request's `model` selector to everything one upstream call needs.
|
|
19
|
+
*
|
|
20
|
+
* The selector is `<providerId>/<model>`, a bare model id, or `@role`
|
|
21
|
+
* (see `parseModelRef`). An entry that declares models (`model_map` /
|
|
22
|
+
* `capabilities`) is a closed list: ids outside it are 404, matching what
|
|
23
|
+
* `/v1/models` advertises. An entry that declares none is open and forwards the
|
|
24
|
+
* id to the provider unchanged (discovery-based presets).
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveModel(selector: string, deps: ResolveDeps): ResolvedModel;
|
|
27
|
+
/**
|
|
28
|
+
* Every model a caller can name, as `/v1/models` entries: ids are
|
|
29
|
+
* `<providerId>/<logicalId>` so two providers serving the same logical id stay
|
|
30
|
+
* distinguishable. Bare logical ids remain accepted on request.
|
|
31
|
+
*/
|
|
32
|
+
export declare function listModels(registry: MergedAIProviderRegistry): Array<{
|
|
33
|
+
id: string;
|
|
34
|
+
owned_by: string;
|
|
35
|
+
}>;
|
|
36
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../model-endpoint/src/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAGL,KAAK,wBAAwB,EAE9B,MAAM,2CAA2C,CAAC;AAQnD,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAEpE,6DAA6D;AAC7D,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,wBAAwB,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AA+BD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,aAAa,CA0D/E;AAOD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,wBAAwB,GACjC,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAOzC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The loopback OpenAI-compatible HTTP server.
|
|
3
|
+
*
|
|
4
|
+
* Plain `node:http` so it runs identically under Node and Bun. pi-ai is
|
|
5
|
+
* imported lazily inside the handlers: the package is an optional peer, and
|
|
6
|
+
* merely importing `@skaile/workspaces/model-endpoint` must not fail without it.
|
|
7
|
+
*/
|
|
8
|
+
import { type ModelEndpointHandle, type ModelEndpointOptions } from "./types.js";
|
|
9
|
+
/**
|
|
10
|
+
* Start the endpoint. Resolves once the socket is listening.
|
|
11
|
+
*
|
|
12
|
+
* Registry, env and roles are read per request through the getters so a
|
|
13
|
+
* session swap is visible immediately.
|
|
14
|
+
*/
|
|
15
|
+
export declare function startModelEndpoint(options: ModelEndpointOptions): Promise<ModelEndpointHandle>;
|
|
16
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../model-endpoint/src/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmBH,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAG1B,MAAM,YAAY,CAAC;AAcpB;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAqP9B"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types of the model endpoint.
|
|
3
|
+
*
|
|
4
|
+
* Only type-only imports from pi-ai live here (erased at build), so the
|
|
5
|
+
* translators and the server can depend on this file without loading pi-ai.
|
|
6
|
+
* pi-ai is an optional peer; it is loaded lazily per request.
|
|
7
|
+
*/
|
|
8
|
+
import type { Api, AssistantMessageEventStream, Model, StreamOptions, TranscriptContext } from "@earendil-works/pi-ai";
|
|
9
|
+
import type { MergedAIProviderRegistry } from "@skaile/workspaces/core/provider-registry";
|
|
10
|
+
/** Everything one upstream call needs. */
|
|
11
|
+
export interface ResolvedModel {
|
|
12
|
+
/** Registry id of the entry the model routes to. */
|
|
13
|
+
providerId: string;
|
|
14
|
+
/** Model id the caller asked for, after `@role` / provider-prefix stripping. */
|
|
15
|
+
logicalId: string;
|
|
16
|
+
/** pi model: `api` = entry surface, `baseUrl` = pi-ready entry endpoint, `id` = provider-side id (`model_map`). */
|
|
17
|
+
model: Model<Api>;
|
|
18
|
+
/** Resolved credential; `undefined` only for entries with an ambient credential chain. */
|
|
19
|
+
apiKey?: string;
|
|
20
|
+
/** Static `entry.headers`. */
|
|
21
|
+
headers?: Record<string, string>;
|
|
22
|
+
}
|
|
23
|
+
/** One request-log line sink. */
|
|
24
|
+
export type ModelEndpointLog = (line: string) => void;
|
|
25
|
+
/** pi-ai's per-surface `stream`, widened to the shape the server calls. */
|
|
26
|
+
export type StreamFn = (model: Model<Api>, context: TranscriptContext, options?: StreamOptions & Record<string, unknown>) => AssistantMessageEventStream;
|
|
27
|
+
/** The parts of a pi-ai `api/<surface>` module the server calls. */
|
|
28
|
+
export interface PiApiModule {
|
|
29
|
+
stream: StreamFn;
|
|
30
|
+
streamSimple?: StreamFn;
|
|
31
|
+
}
|
|
32
|
+
/** Options of `startModelEndpoint`. */
|
|
33
|
+
export interface ModelEndpointOptions {
|
|
34
|
+
/** Live registry view; read on every request so a `session_init` can swap it. */
|
|
35
|
+
getRegistry(): MergedAIProviderRegistry;
|
|
36
|
+
/** Env that credential refs and `SKAILE_AIP_<ID>_KEY` values resolve against; read per request. */
|
|
37
|
+
getLookupEnv(): Record<string, string | undefined>;
|
|
38
|
+
/** Roles table for `@role` selectors. */
|
|
39
|
+
getRoles?(): Record<string, string> | undefined;
|
|
40
|
+
/** Bearer token every request must present. */
|
|
41
|
+
token: string;
|
|
42
|
+
/** Bind address. Default `"127.0.0.1"`. */
|
|
43
|
+
host?: string;
|
|
44
|
+
/** Bind port. Default `0` (ephemeral). */
|
|
45
|
+
port?: number;
|
|
46
|
+
/** Request-log sink. */
|
|
47
|
+
log?: ModelEndpointLog;
|
|
48
|
+
/**
|
|
49
|
+
* Test seam: override pi-ai api loading. Default: dynamic import of `@earendil-works/pi-ai/api/<surface>`.
|
|
50
|
+
* `streamSimple` (every pi api module exports it) is used when the request asks for reasoning:
|
|
51
|
+
* only it maps a provider-neutral thinking level onto the surface's own effort field.
|
|
52
|
+
*/
|
|
53
|
+
loadApi?(surface: string): Promise<PiApiModule>;
|
|
54
|
+
/** Test seam for the `/v1/embeddings` pass-through. Default `globalThis.fetch`. */
|
|
55
|
+
fetch?: typeof fetch;
|
|
56
|
+
}
|
|
57
|
+
/** A running endpoint. */
|
|
58
|
+
export interface ModelEndpointHandle {
|
|
59
|
+
/** `http://${host}:${port}/v1` — what an OpenAI SDK takes as `baseURL`. */
|
|
60
|
+
url: string;
|
|
61
|
+
port: number;
|
|
62
|
+
token: string;
|
|
63
|
+
close(): Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
/** The OpenAI error `type` values the endpoint emits. */
|
|
66
|
+
export type ModelEndpointErrorType = "invalid_request_error" | "authentication_error" | "not_found_error" | "upstream_error" | "server_error";
|
|
67
|
+
/**
|
|
68
|
+
* A failure with a defined HTTP shape. Translators and the resolver throw it
|
|
69
|
+
* so the server can render the OpenAI-style `{ error: {...} }` body without
|
|
70
|
+
* each call site knowing about HTTP.
|
|
71
|
+
*/
|
|
72
|
+
export declare class ModelEndpointError extends Error {
|
|
73
|
+
readonly status: number;
|
|
74
|
+
readonly type: ModelEndpointErrorType;
|
|
75
|
+
readonly code?: string;
|
|
76
|
+
constructor(status: number, message: string, code?: string, type?: ModelEndpointErrorType);
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../model-endpoint/src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,GAAG,EACH,2BAA2B,EAC3B,KAAK,EACL,aAAa,EACb,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAE1F,0CAA0C;AAC1C,MAAM,WAAW,aAAa;IAC5B,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;IAClB,mHAAmH;IACnH,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,iCAAiC;AACjC,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;AAEtD,2EAA2E;AAC3E,MAAM,MAAM,QAAQ,GAAG,CACrB,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EACjB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC9C,2BAA2B,CAAC;AAEjC,oEAAoE;AACpE,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,QAAQ,CAAC;IACjB,YA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E,MAAM,EAAE,IAAI,CAAC,EAAE,sBAAsB;CAO1F"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export { LocalCatalogDisabledError, openCatalogSource, openLibrary, openLibraryManager, resolveCatalogSource } from './chunk-ZDTZGEJG.js';
|
|
2
|
+
import './chunk-GJGEDWRT.js';
|
|
3
|
+
import './chunk-5IMGZAKH.js';
|
|
4
|
+
import './chunk-QELQDY5K.js';
|
|
5
|
+
import './chunk-X3RMRJNR.js';
|
|
6
|
+
import './chunk-7RGTAEG6.js';
|
|
7
|
+
import './chunk-NUELZWCF.js';
|
|
8
|
+
import './chunk-QAYL3PYY.js';
|
|
9
|
+
import './chunk-ODQGLELI.js';
|
|
10
|
+
import './chunk-NVO6WECE.js';
|
|
11
|
+
import './chunk-PXDWTJ3P.js';
|
|
12
|
+
import './chunk-H5U7LNTJ.js';
|
|
13
|
+
import './chunk-3TXEJN4W.js';
|
|
14
|
+
import './chunk-FD2IPIE2.js';
|
|
15
|
+
import './chunk-NOA6EJXE.js';
|
|
16
|
+
import './chunk-KTBKW2FI.js';
|
|
17
|
+
import './chunk-UQ6LFBPZ.js';
|
|
18
|
+
import './chunk-CNZI37HV.js';
|
|
19
|
+
import './chunk-57SF6W6E.js';
|
|
20
|
+
import './chunk-OX2W5YF3.js';
|
|
21
|
+
import './chunk-4GY63JU6.js';
|
|
22
|
+
import './chunk-TYUJPQNX.js';
|
|
23
|
+
import './chunk-D54T2F54.js';
|
|
24
|
+
import './chunk-5BEFNLOR.js';
|
|
25
|
+
import './chunk-A2ULN3KX.js';
|
|
26
|
+
import './chunk-CAPKENNF.js';
|
|
27
|
+
import './chunk-L5VSIPQD.js';
|
|
28
|
+
import './chunk-IG5LZ3WU.js';
|
|
29
|
+
import './chunk-IY5E7Y5W.js';
|
|
30
|
+
import './chunk-RVRB27AN.js';
|
|
31
|
+
import './chunk-M3P4BYRK.js';
|
|
32
|
+
import './chunk-J4OYIYFQ.js';
|
|
33
|
+
import './chunk-ICSCSM5D.js';
|
|
34
|
+
import './chunk-DKXNKFKP.js';
|
|
35
|
+
import './chunk-MJHSLODD.js';
|
|
36
|
+
import './chunk-C3CAXQMA.js';
|
|
37
|
+
import './chunk-BOFL7GIF.js';
|
|
38
|
+
import './chunk-NSBPE2FW.js';
|
|
39
|
+
//# sourceMappingURL=open-library-QNMIMZYS.js.map
|
|
40
|
+
//# sourceMappingURL=open-library-QNMIMZYS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"open-library-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"open-library-QNMIMZYS.js"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export { getKindRegistry, getKnownKinds } from './chunk-5IMGZAKH.js';
|
|
2
|
+
import './chunk-QELQDY5K.js';
|
|
3
|
+
import './chunk-X3RMRJNR.js';
|
|
4
|
+
import './chunk-7RGTAEG6.js';
|
|
5
|
+
import './chunk-NUELZWCF.js';
|
|
6
|
+
import './chunk-ODQGLELI.js';
|
|
7
|
+
import './chunk-NVO6WECE.js';
|
|
8
|
+
import './chunk-PXDWTJ3P.js';
|
|
9
|
+
import './chunk-H5U7LNTJ.js';
|
|
10
|
+
import './chunk-3TXEJN4W.js';
|
|
11
|
+
import './chunk-57SF6W6E.js';
|
|
12
|
+
import './chunk-OX2W5YF3.js';
|
|
13
|
+
import './chunk-4GY63JU6.js';
|
|
14
|
+
import './chunk-TYUJPQNX.js';
|
|
15
|
+
import './chunk-D54T2F54.js';
|
|
16
|
+
import './chunk-5BEFNLOR.js';
|
|
17
|
+
import './chunk-A2ULN3KX.js';
|
|
18
|
+
import './chunk-CAPKENNF.js';
|
|
19
|
+
import './chunk-L5VSIPQD.js';
|
|
20
|
+
import './chunk-IG5LZ3WU.js';
|
|
21
|
+
import './chunk-IY5E7Y5W.js';
|
|
22
|
+
import './chunk-RVRB27AN.js';
|
|
23
|
+
import './chunk-M3P4BYRK.js';
|
|
24
|
+
import './chunk-J4OYIYFQ.js';
|
|
25
|
+
import './chunk-ICSCSM5D.js';
|
|
26
|
+
import './chunk-DKXNKFKP.js';
|
|
27
|
+
import './chunk-MJHSLODD.js';
|
|
28
|
+
import './chunk-C3CAXQMA.js';
|
|
29
|
+
import './chunk-BOFL7GIF.js';
|
|
30
|
+
import './chunk-NSBPE2FW.js';
|
|
31
|
+
//# sourceMappingURL=open-registry-BOUCBDLF.js.map
|
|
32
|
+
//# sourceMappingURL=open-registry-BOUCBDLF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"open-registry-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"open-registry-BOUCBDLF.js"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { AI_RESOURCES, MONOREPO_ROOT } from './chunk-ZBD6EITA.js';
|
|
2
|
+
export { aiResourceRoots } from './chunk-OX2W5YF3.js';
|
|
3
|
+
import './chunk-4GY63JU6.js';
|
|
4
|
+
import './chunk-TYUJPQNX.js';
|
|
5
|
+
import './chunk-D54T2F54.js';
|
|
6
|
+
import './chunk-5BEFNLOR.js';
|
|
7
|
+
import './chunk-A2ULN3KX.js';
|
|
8
|
+
import './chunk-CAPKENNF.js';
|
|
9
|
+
import './chunk-L5VSIPQD.js';
|
|
10
|
+
import './chunk-IG5LZ3WU.js';
|
|
11
|
+
import './chunk-IY5E7Y5W.js';
|
|
12
|
+
import './chunk-RVRB27AN.js';
|
|
13
|
+
import './chunk-M3P4BYRK.js';
|
|
14
|
+
import './chunk-J4OYIYFQ.js';
|
|
15
|
+
import './chunk-ICSCSM5D.js';
|
|
16
|
+
import './chunk-DKXNKFKP.js';
|
|
17
|
+
import './chunk-MJHSLODD.js';
|
|
18
|
+
import './chunk-C3CAXQMA.js';
|
|
19
|
+
import './chunk-BOFL7GIF.js';
|
|
20
|
+
import './chunk-NSBPE2FW.js';
|
|
21
|
+
//# sourceMappingURL=paths-B6SX6J6T.js.map
|
|
22
|
+
//# sourceMappingURL=paths-B6SX6J6T.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"paths-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"paths-B6SX6J6T.js"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { pluginRegistry } from './chunk-6E6PKKAD.js';
|
|
2
|
-
import { readPluginsLockSlice } from './chunk-
|
|
2
|
+
import { readPluginsLockSlice } from './chunk-OX2W5YF3.js';
|
|
3
3
|
import './chunk-4GY63JU6.js';
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
4
|
+
import './chunk-TYUJPQNX.js';
|
|
5
|
+
import './chunk-D54T2F54.js';
|
|
6
6
|
import './chunk-5BEFNLOR.js';
|
|
7
7
|
import './chunk-A2ULN3KX.js';
|
|
8
|
-
import './chunk-
|
|
8
|
+
import './chunk-CAPKENNF.js';
|
|
9
9
|
import './chunk-L5VSIPQD.js';
|
|
10
|
-
import './chunk-
|
|
11
|
-
import './chunk-
|
|
10
|
+
import './chunk-IG5LZ3WU.js';
|
|
11
|
+
import './chunk-IY5E7Y5W.js';
|
|
12
12
|
import './chunk-RVRB27AN.js';
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
13
|
+
import './chunk-M3P4BYRK.js';
|
|
14
|
+
import './chunk-J4OYIYFQ.js';
|
|
15
15
|
import './chunk-ICSCSM5D.js';
|
|
16
16
|
import './chunk-DKXNKFKP.js';
|
|
17
17
|
import './chunk-MJHSLODD.js';
|
|
@@ -19,7 +19,7 @@ import './chunk-C3CAXQMA.js';
|
|
|
19
19
|
import './chunk-BOFL7GIF.js';
|
|
20
20
|
import './chunk-NSBPE2FW.js';
|
|
21
21
|
import { pathToFileURL } from 'url';
|
|
22
|
-
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
22
|
+
import { existsSync, readFileSync, rmSync, writeFileSync, mkdirSync } from 'fs';
|
|
23
23
|
import { join, resolve } from 'path';
|
|
24
24
|
import { createHash } from 'crypto';
|
|
25
25
|
|
|
@@ -113,11 +113,9 @@ async function loadPlugins(projectDir, plugins, registry = pluginRegistry, opts
|
|
|
113
113
|
}
|
|
114
114
|
return { loaded, failed };
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
async function runCapture(args, cwd) {
|
|
117
117
|
const { portableSpawn } = await import('./core/index.js');
|
|
118
|
-
const
|
|
119
|
-
const args = hasLock ? ["bun", "install", "--frozen-lockfile"] : ["bun", "install"];
|
|
120
|
-
const proc = portableSpawn(args, { cwd: dir });
|
|
118
|
+
const proc = portableSpawn(args, { cwd });
|
|
121
119
|
const chunks = [];
|
|
122
120
|
const decoder = new TextDecoder();
|
|
123
121
|
const pump = async (stream) => {
|
|
@@ -130,7 +128,22 @@ var defaultInstall = async (dir) => {
|
|
|
130
128
|
};
|
|
131
129
|
await Promise.all([pump(proc.stdout), pump(proc.stderr)]);
|
|
132
130
|
const code = await proc.exited;
|
|
133
|
-
return {
|
|
131
|
+
return { started: proc.pid !== -1, code, output: chunks.join("") };
|
|
132
|
+
}
|
|
133
|
+
var defaultInstall = async (dir, opts = {}) => {
|
|
134
|
+
const hasBunLock = existsSync(`${dir}/bun.lock`) || existsSync(`${dir}/bun.lockb`);
|
|
135
|
+
const hasNpmLock = existsSync(`${dir}/package-lock.json`);
|
|
136
|
+
const frozen = opts.frozen !== false;
|
|
137
|
+
const bunArgs = frozen && (hasBunLock || hasNpmLock) ? ["bun", "install", "--frozen-lockfile"] : ["bun", "install"];
|
|
138
|
+
const withBun = await runCapture(bunArgs, dir);
|
|
139
|
+
if (withBun.started) return { ok: withBun.code === 0, output: withBun.output };
|
|
140
|
+
const npmArgs = frozen && hasNpmLock ? ["npm", "ci", "--ignore-scripts", "--no-audit", "--no-fund"] : ["npm", "install", "--ignore-scripts", "--no-audit", "--no-fund"];
|
|
141
|
+
const withNpm = await runCapture(npmArgs, dir);
|
|
142
|
+
if (withNpm.started) return { ok: withNpm.code === 0, output: withNpm.output };
|
|
143
|
+
return {
|
|
144
|
+
ok: false,
|
|
145
|
+
output: "neither bun nor npm found on PATH; plugin install needs one of them (https://bun.sh or https://nodejs.org)"
|
|
146
|
+
};
|
|
134
147
|
};
|
|
135
148
|
function writePackageJson(projectDir, plugins) {
|
|
136
149
|
const dependencies = {};
|
|
@@ -143,9 +156,20 @@ function writePackageJson(projectDir, plugins) {
|
|
|
143
156
|
private: true,
|
|
144
157
|
dependencies
|
|
145
158
|
};
|
|
159
|
+
const file = pluginsPkgJson(projectDir);
|
|
160
|
+
const previous = existsSync(file) ? readFileSync(file, "utf8") : void 0;
|
|
161
|
+
let before;
|
|
162
|
+
try {
|
|
163
|
+
before = previous === void 0 ? void 0 : JSON.parse(previous).dependencies;
|
|
164
|
+
} catch {
|
|
165
|
+
before = void 0;
|
|
166
|
+
}
|
|
167
|
+
const sortedJson = (d) => JSON.stringify(Object.entries(d ?? {}).sort(([a], [b]) => a.localeCompare(b)));
|
|
168
|
+
const depsChanged = before === void 0 || sortedJson(before) !== sortedJson(dependencies);
|
|
146
169
|
mkdirSync(pluginsDir(projectDir), { recursive: true });
|
|
147
|
-
writeFileSync(
|
|
170
|
+
writeFileSync(file, `${JSON.stringify(pkg, null, 2)}
|
|
148
171
|
`);
|
|
172
|
+
return { previous, depsChanged };
|
|
149
173
|
}
|
|
150
174
|
async function reconcilePlugins(projectDir, plugins, opts = {}) {
|
|
151
175
|
if (plugins.length === 0) {
|
|
@@ -160,16 +184,34 @@ async function reconcilePlugins(projectDir, plugins, opts = {}) {
|
|
|
160
184
|
return { changed: false, reason: "up-to-date" };
|
|
161
185
|
}
|
|
162
186
|
}
|
|
163
|
-
writePackageJson(projectDir, plugins);
|
|
187
|
+
const { previous, depsChanged } = writePackageJson(projectDir, plugins);
|
|
164
188
|
const install = opts.runInstall ?? defaultInstall;
|
|
165
|
-
const result = await install(pluginsDir(projectDir));
|
|
189
|
+
const result = await install(pluginsDir(projectDir), { frozen: !depsChanged });
|
|
166
190
|
if (!result.ok) {
|
|
191
|
+
if (previous === void 0) rmSync(pluginsPkgJson(projectDir), { force: true });
|
|
192
|
+
else writeFileSync(pluginsPkgJson(projectDir), previous);
|
|
167
193
|
throw new Error(`plugin install failed:
|
|
168
194
|
${result.output}`);
|
|
169
195
|
}
|
|
170
196
|
writeFileSync(hashFile, wantHash);
|
|
171
197
|
return { changed: true, reason: "reconciled" };
|
|
172
198
|
}
|
|
199
|
+
async function rollbackPluginStore(projectDir, previousPlugins, opts = {}) {
|
|
200
|
+
if (previousPlugins.length === 0) {
|
|
201
|
+
const dir = pluginsDir(projectDir);
|
|
202
|
+
rmSync(pluginsPkgJson(projectDir), { force: true });
|
|
203
|
+
rmSync(reconcileHashFile(projectDir), { force: true });
|
|
204
|
+
rmSync(nodeModulesDir(projectDir), { recursive: true, force: true });
|
|
205
|
+
for (const lock of ["bun.lock", "bun.lockb", "package-lock.json"]) {
|
|
206
|
+
rmSync(join(dir, lock), { force: true });
|
|
207
|
+
}
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
try {
|
|
211
|
+
await reconcilePlugins(projectDir, previousPlugins, opts);
|
|
212
|
+
} catch {
|
|
213
|
+
}
|
|
214
|
+
}
|
|
173
215
|
|
|
174
216
|
// cli/src/plugin-store/index.ts
|
|
175
217
|
async function ensurePluginsLoaded(projectDir, plugins, registry = pluginRegistry, opts = {}) {
|
|
@@ -180,6 +222,6 @@ async function ensurePluginsLoaded(projectDir, plugins, registry = pluginRegistr
|
|
|
180
222
|
return loadPlugins(projectDir, plugins, registry, { log: opts.log });
|
|
181
223
|
}
|
|
182
224
|
|
|
183
|
-
export { ensurePluginsLoaded, loadPlugins, reconcilePlugins, specName };
|
|
184
|
-
//# sourceMappingURL=plugin-store-
|
|
185
|
-
//# sourceMappingURL=plugin-store-
|
|
225
|
+
export { ensurePluginsLoaded, loadPlugins, reconcilePlugins, rollbackPluginStore, specName };
|
|
226
|
+
//# sourceMappingURL=plugin-store-MLFP3WJ7.js.map
|
|
227
|
+
//# sourceMappingURL=plugin-store-MLFP3WJ7.js.map
|