@skaile/workspaces 5.13.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 +18 -0
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-ALMTHLPV.js → asset-feeds-PAOX3FUT.js} +11 -11
- package/dist/{asset-feeds-ALMTHLPV.js.map → asset-feeds-PAOX3FUT.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +3 -3
- package/dist/asset-manager/index.js +7 -7
- package/dist/asset-manager/installer.js +5 -5
- package/dist/asset-manager/renderers.js +4 -4
- package/dist/bridge/drivers/claude-sdk.js +145 -10
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +6 -5
- package/dist/bridge/drivers/codex.js.map +1 -1
- package/dist/bridge/drivers/continue.js +7 -6
- 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 +6 -5
- package/dist/bridge/drivers/goose.js +7 -6
- package/dist/bridge/drivers/goose.js.map +1 -1
- package/dist/bridge/drivers/omp.js +5 -4
- package/dist/bridge/drivers/omp.js.map +1 -1
- package/dist/bridge/drivers/opencode.js +7 -6
- package/dist/bridge/drivers/opencode.js.map +1 -1
- package/dist/bridge/drivers/qwen.js +6 -5
- package/dist/bridge/drivers/qwen.js.map +1 -1
- package/dist/bridge/index.js +9 -8
- 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/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-6GICC4RJ.js → chunk-3NNL334S.js} +10 -10
- package/dist/{chunk-6GICC4RJ.js.map → chunk-3NNL334S.js.map} +1 -1
- package/dist/{chunk-4NJ3QQHZ.js → chunk-5IMGZAKH.js} +4 -4
- package/dist/{chunk-4NJ3QQHZ.js.map → chunk-5IMGZAKH.js.map} +1 -1
- package/dist/{chunk-6NQDDCIL.js → chunk-5NVDOEWX.js} +15 -7
- package/dist/chunk-5NVDOEWX.js.map +1 -0
- package/dist/{chunk-BVJU2GKE.js → chunk-6VIVUBNN.js} +4 -271
- package/dist/chunk-6VIVUBNN.js.map +1 -0
- package/dist/{chunk-GMDSRSGI.js → chunk-7LGNJJ76.js} +6 -6
- package/dist/{chunk-GMDSRSGI.js.map → chunk-7LGNJJ76.js.map} +1 -1
- package/dist/{chunk-FB3NREF7.js → chunk-BASMWKPM.js} +7 -7
- package/dist/{chunk-FB3NREF7.js.map → chunk-BASMWKPM.js.map} +1 -1
- package/dist/{chunk-L3ZGYSWY.js → chunk-CAPKENNF.js} +9 -4
- package/dist/chunk-CAPKENNF.js.map +1 -0
- package/dist/{chunk-4L4R5LV3.js → chunk-CNZI37HV.js} +3 -3
- package/dist/{chunk-4L4R5LV3.js.map → chunk-CNZI37HV.js.map} +1 -1
- package/dist/{chunk-F4NJDSR7.js → chunk-D5WTOVLG.js} +7 -4
- package/dist/chunk-D5WTOVLG.js.map +1 -0
- package/dist/{chunk-XJYBCDY2.js → chunk-DHUJRIQQ.js} +3 -3
- package/dist/{chunk-XJYBCDY2.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-5FYOM4RF.js → chunk-FD2IPIE2.js} +5 -5
- package/dist/{chunk-5FYOM4RF.js.map → chunk-FD2IPIE2.js.map} +1 -1
- package/dist/{chunk-PYTTF754.js → chunk-GJGEDWRT.js} +4 -4
- package/dist/{chunk-PYTTF754.js.map → chunk-GJGEDWRT.js.map} +1 -1
- package/dist/{chunk-FHDK3BFD.js → chunk-IPN7N2AZ.js} +3 -3
- package/dist/{chunk-FHDK3BFD.js.map → chunk-IPN7N2AZ.js.map} +1 -1
- package/dist/{chunk-4DLQESIY.js → chunk-IQVZIVSA.js} +3 -3
- package/dist/{chunk-4DLQESIY.js.map → chunk-IQVZIVSA.js.map} +1 -1
- package/dist/{chunk-NDUYFYJB.js → chunk-MCLT3BJG.js} +5 -5
- package/dist/{chunk-NDUYFYJB.js.map → chunk-MCLT3BJG.js.map} +1 -1
- package/dist/{chunk-PZOO7L26.js → chunk-O3Q3MOAV.js} +4 -4
- package/dist/{chunk-PZOO7L26.js.map → chunk-O3Q3MOAV.js.map} +1 -1
- package/dist/{chunk-DKGEV6SQ.js → chunk-ODQGLELI.js} +4 -4
- package/dist/{chunk-DKGEV6SQ.js.map → chunk-ODQGLELI.js.map} +1 -1
- package/dist/chunk-OKQXY6FS.js +1336 -0
- package/dist/chunk-OKQXY6FS.js.map +1 -0
- package/dist/{chunk-BF422IDP.js → chunk-OX2W5YF3.js} +4 -4
- package/dist/{chunk-BF422IDP.js.map → chunk-OX2W5YF3.js.map} +1 -1
- package/dist/{chunk-HBZD3MIW.js → chunk-PAUM35HD.js} +169 -33
- package/dist/chunk-PAUM35HD.js.map +1 -0
- package/dist/{chunk-J4DB5G36.js → chunk-PGVSOHWE.js} +2 -2
- package/dist/{chunk-J4DB5G36.js.map → chunk-PGVSOHWE.js.map} +1 -1
- package/dist/{chunk-ZSMMX3JD.js → chunk-PUG7IWFF.js} +11 -11
- package/dist/{chunk-ZSMMX3JD.js.map → chunk-PUG7IWFF.js.map} +1 -1
- 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-Y7WKXPWS.js → chunk-QAYL3PYY.js} +8 -8
- package/dist/{chunk-Y7WKXPWS.js.map → chunk-QAYL3PYY.js.map} +1 -1
- package/dist/{chunk-XBYSURMK.js → chunk-QELQDY5K.js} +3 -3
- package/dist/{chunk-XBYSURMK.js.map → chunk-QELQDY5K.js.map} +1 -1
- package/dist/{chunk-7SMP4GNW.js → chunk-S6FZUR5H.js} +7 -6
- package/dist/chunk-S6FZUR5H.js.map +1 -0
- package/dist/{chunk-QO7CR3KB.js → chunk-TYUJPQNX.js} +3 -3
- package/dist/{chunk-QO7CR3KB.js.map → chunk-TYUJPQNX.js.map} +1 -1
- package/dist/{chunk-5SKVCMRC.js → chunk-UK3LRPJ5.js} +3 -3
- package/dist/{chunk-5SKVCMRC.js.map → chunk-UK3LRPJ5.js.map} +1 -1
- package/dist/{chunk-R6QHJEHE.js → chunk-UQ4SQOR6.js} +5 -5
- package/dist/{chunk-R6QHJEHE.js.map → chunk-UQ4SQOR6.js.map} +1 -1
- package/dist/{chunk-V5JHD4I2.js → chunk-V7AWO5FL.js} +2 -2
- package/dist/{chunk-V5JHD4I2.js.map → chunk-V7AWO5FL.js.map} +1 -1
- package/dist/{chunk-PN44DOGP.js → chunk-VTG5Z3KD.js} +3 -3
- package/dist/{chunk-PN44DOGP.js.map → chunk-VTG5Z3KD.js.map} +1 -1
- package/dist/{chunk-Y4Z7LGSH.js → chunk-VTXXBYB3.js} +9 -9
- package/dist/{chunk-Y4Z7LGSH.js.map → chunk-VTXXBYB3.js.map} +1 -1
- package/dist/{chunk-AHCI4V5L.js → chunk-WTEYDNTR.js} +3 -3
- package/dist/{chunk-AHCI4V5L.js.map → chunk-WTEYDNTR.js.map} +1 -1
- package/dist/{chunk-B7CZYFB2.js → chunk-YFIHFJEB.js} +3 -3
- package/dist/{chunk-B7CZYFB2.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-HWGYJMME.js → chunk-ZBD6EITA.js} +4 -4
- package/dist/{chunk-HWGYJMME.js.map → chunk-ZBD6EITA.js.map} +1 -1
- package/dist/{chunk-VLBIME5L.js → chunk-ZDTZGEJG.js} +4 -4
- package/dist/{chunk-VLBIME5L.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/cli/index.js +86 -67
- package/dist/cli/index.js.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/connectors/config.js +2 -2
- package/dist/connectors/index.js +13 -12
- package/dist/{connectors-GFKMKAXV.js → connectors-2TEGRRYC.js} +16 -15
- package/dist/{connectors-GFKMKAXV.js.map → connectors-2TEGRRYC.js.map} +1 -1
- package/dist/connectors-shared/index.js +2 -2
- package/dist/core/index.js +3 -3
- package/dist/core/runtime-assets.js +2 -2
- package/dist/core/src/index.d.ts +1 -1
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +16 -0
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/workspace-config.js +1 -1
- package/dist/deploy/index.js +3 -3
- package/dist/{ensure-sources-VUKHL65L.js → ensure-sources-EG7YKKZL.js} +10 -10
- package/dist/{ensure-sources-VUKHL65L.js.map → ensure-sources-EG7YKKZL.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +13 -12
- package/dist/factory-assets/connectors/deploy.js +13 -12
- package/dist/factory-assets/connectors/devserver.js +13 -12
- package/dist/factory-assets/connectors/flow/adapter.js +13 -12
- package/dist/factory-assets/connectors/flow/engine.js +4 -4
- package/dist/factory-assets/connectors/flow/run-flow.js +14 -13
- package/dist/factory-assets/connectors/flow.js +13 -12
- package/dist/factory-assets/connectors/git.js +13 -12
- package/dist/factory-assets/connectors/gmail.js +13 -12
- package/dist/factory-assets/connectors/googledrive.js +13 -12
- package/dist/factory-assets/connectors/local.js +13 -12
- package/dist/factory-assets/connectors/mattermost.js +13 -12
- package/dist/factory-assets/connectors/memory.js +13 -12
- package/dist/factory-assets/connectors/minio.js +13 -12
- package/dist/factory-assets/connectors/postgres.js +13 -12
- package/dist/factory-assets/connectors/s3.js +13 -12
- package/dist/factory-assets/connectors/sharepoint.js +13 -12
- package/dist/factory-assets/connectors/sqlite.js +13 -12
- package/dist/factory-assets/connectors/static-server.js +13 -12
- package/dist/factory-assets/connectors/tunnel.js +13 -12
- package/dist/factory-assets/connectors/webdav.js +13 -12
- package/dist/factory-assets/connectors/xstate-store.js +13 -12
- package/dist/factory-assets/connectors/xstate.js +13 -12
- package/dist/{flows-A4YALSZY.js → flows-5TW3XFMH.js} +6 -6
- package/dist/{flows-A4YALSZY.js.map → flows-5TW3XFMH.js.map} +1 -1
- package/dist/{helpers-53XZW7KF.js → helpers-BQGXEKRP.js} +10 -10
- package/dist/{helpers-53XZW7KF.js.map → helpers-BQGXEKRP.js.map} +1 -1
- package/dist/library/index.js +4 -4
- package/dist/{library-publish-FFIPWIRM.js → library-publish-EUP524PE.js} +17 -17
- package/dist/{library-publish-FFIPWIRM.js.map → library-publish-EUP524PE.js.map} +1 -1
- 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-PZAT3TJA.js → open-library-QNMIMZYS.js} +13 -13
- package/dist/{open-library-PZAT3TJA.js.map → open-library-QNMIMZYS.js.map} +1 -1
- package/dist/{open-registry-W46UXZ3I.js → open-registry-BOUCBDLF.js} +8 -8
- package/dist/{open-registry-W46UXZ3I.js.map → open-registry-BOUCBDLF.js.map} +1 -1
- package/dist/{paths-KKY3NSBZ.js → paths-B6SX6J6T.js} +6 -6
- package/dist/{paths-KKY3NSBZ.js.map → paths-B6SX6J6T.js.map} +1 -1
- package/dist/{plugin-store-CK7YWRIC.js → plugin-store-MLFP3WJ7.js} +5 -5
- package/dist/{plugin-store-CK7YWRIC.js.map → plugin-store-MLFP3WJ7.js.map} +1 -1
- package/dist/{project-EZUH7PUJ.js → project-GXCIEJGM.js} +30 -27
- package/dist/{project-EZUH7PUJ.js.map → project-GXCIEJGM.js.map} +1 -1
- package/dist/resolver/index.js +3 -3
- package/dist/runner/index.js +22 -19
- 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/sdk/asset-manager.js +7 -7
- package/dist/sdk/bridge.js +9 -8
- package/dist/sdk/core.js +3 -3
- package/dist/sdk/flow.js +4 -4
- package/dist/sdk/index.js +22 -19
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/resolver.js +3 -3
- package/dist/sdk/runner.js +22 -19
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/types.js +1 -1
- package/dist/{serve-preflight-F7MYF747.js → serve-preflight-GNBW3O4U.js} +5 -5
- package/dist/{serve-preflight-F7MYF747.js.map → serve-preflight-GNBW3O4U.js.map} +1 -1
- package/dist/session/index.js +2 -2
- package/dist/{setup-L632QIHV.js → setup-HJEYEXLS.js} +17 -16
- package/dist/setup-HJEYEXLS.js.map +1 -0
- package/dist/{skills-OY3Y5GKA.js → skills-4WMYGJDL.js} +5 -5
- package/dist/{skills-OY3Y5GKA.js.map → skills-4WMYGJDL.js.map} +1 -1
- package/dist/{source-36FHMN5V.js → source-5VL6PHER.js} +15 -15
- package/dist/{source-36FHMN5V.js.map → source-5VL6PHER.js.map} +1 -1
- package/dist/{source-manifest-publish-NIXJSJ22.js → source-manifest-publish-Q66H7EJI.js} +17 -17
- package/dist/{source-manifest-publish-NIXJSJ22.js.map → source-manifest-publish-Q66H7EJI.js.map} +1 -1
- package/dist/tui/index.js +22 -19
- package/dist/tui/index.js.map +1 -1
- package/dist/types/index.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/version.d.ts +11 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +16 -15
- 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-6NQDDCIL.js.map +0 -1
- package/dist/chunk-7SMP4GNW.js.map +0 -1
- package/dist/chunk-BVJU2GKE.js.map +0 -1
- package/dist/chunk-F4NJDSR7.js.map +0 -1
- package/dist/chunk-HBZD3MIW.js.map +0 -1
- package/dist/chunk-L3ZGYSWY.js.map +0 -1
- package/dist/setup-L632QIHV.js.map +0 -1
|
@@ -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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M,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,E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AAO,KAAK,CAAC;CACtB;AAED,0BAA0B;AAC1B,MAAM,WAAW,mBAAmB;IAClC,2EAA2E;IAC3E,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,yDAAyD;AACzD,MAAM,MAAM,sBAAsB,GAC9B,uBAAuB,GACvB,sBAAsB,GACtB,iBAAiB,GACjB,gBAAgB,GAChB,cAAc,CAAC;AAEnB;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;gBAEX,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,sBAAsB;CAO1F"}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
export { LocalCatalogDisabledError, openCatalogSource, openLibrary, openLibraryManager, resolveCatalogSource } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
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
5
|
import './chunk-X3RMRJNR.js';
|
|
6
6
|
import './chunk-7RGTAEG6.js';
|
|
7
7
|
import './chunk-NUELZWCF.js';
|
|
8
|
-
import './chunk-
|
|
9
|
-
import './chunk-
|
|
8
|
+
import './chunk-QAYL3PYY.js';
|
|
9
|
+
import './chunk-ODQGLELI.js';
|
|
10
10
|
import './chunk-NVO6WECE.js';
|
|
11
11
|
import './chunk-PXDWTJ3P.js';
|
|
12
12
|
import './chunk-H5U7LNTJ.js';
|
|
13
13
|
import './chunk-3TXEJN4W.js';
|
|
14
|
-
import './chunk-
|
|
14
|
+
import './chunk-FD2IPIE2.js';
|
|
15
15
|
import './chunk-NOA6EJXE.js';
|
|
16
16
|
import './chunk-KTBKW2FI.js';
|
|
17
17
|
import './chunk-UQ6LFBPZ.js';
|
|
18
|
-
import './chunk-
|
|
18
|
+
import './chunk-CNZI37HV.js';
|
|
19
19
|
import './chunk-57SF6W6E.js';
|
|
20
|
-
import './chunk-
|
|
20
|
+
import './chunk-OX2W5YF3.js';
|
|
21
21
|
import './chunk-4GY63JU6.js';
|
|
22
|
-
import './chunk-
|
|
22
|
+
import './chunk-TYUJPQNX.js';
|
|
23
23
|
import './chunk-D54T2F54.js';
|
|
24
24
|
import './chunk-5BEFNLOR.js';
|
|
25
25
|
import './chunk-A2ULN3KX.js';
|
|
26
|
-
import './chunk-
|
|
26
|
+
import './chunk-CAPKENNF.js';
|
|
27
27
|
import './chunk-L5VSIPQD.js';
|
|
28
28
|
import './chunk-IG5LZ3WU.js';
|
|
29
29
|
import './chunk-IY5E7Y5W.js';
|
|
@@ -36,5 +36,5 @@ import './chunk-MJHSLODD.js';
|
|
|
36
36
|
import './chunk-C3CAXQMA.js';
|
|
37
37
|
import './chunk-BOFL7GIF.js';
|
|
38
38
|
import './chunk-NSBPE2FW.js';
|
|
39
|
-
//# sourceMappingURL=open-library-
|
|
40
|
-
//# sourceMappingURL=open-library-
|
|
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"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export { getKindRegistry, getKnownKinds } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { getKindRegistry, getKnownKinds } from './chunk-5IMGZAKH.js';
|
|
2
|
+
import './chunk-QELQDY5K.js';
|
|
3
3
|
import './chunk-X3RMRJNR.js';
|
|
4
4
|
import './chunk-7RGTAEG6.js';
|
|
5
5
|
import './chunk-NUELZWCF.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-ODQGLELI.js';
|
|
7
7
|
import './chunk-NVO6WECE.js';
|
|
8
8
|
import './chunk-PXDWTJ3P.js';
|
|
9
9
|
import './chunk-H5U7LNTJ.js';
|
|
10
10
|
import './chunk-3TXEJN4W.js';
|
|
11
11
|
import './chunk-57SF6W6E.js';
|
|
12
|
-
import './chunk-
|
|
12
|
+
import './chunk-OX2W5YF3.js';
|
|
13
13
|
import './chunk-4GY63JU6.js';
|
|
14
|
-
import './chunk-
|
|
14
|
+
import './chunk-TYUJPQNX.js';
|
|
15
15
|
import './chunk-D54T2F54.js';
|
|
16
16
|
import './chunk-5BEFNLOR.js';
|
|
17
17
|
import './chunk-A2ULN3KX.js';
|
|
18
|
-
import './chunk-
|
|
18
|
+
import './chunk-CAPKENNF.js';
|
|
19
19
|
import './chunk-L5VSIPQD.js';
|
|
20
20
|
import './chunk-IG5LZ3WU.js';
|
|
21
21
|
import './chunk-IY5E7Y5W.js';
|
|
@@ -28,5 +28,5 @@ import './chunk-MJHSLODD.js';
|
|
|
28
28
|
import './chunk-C3CAXQMA.js';
|
|
29
29
|
import './chunk-BOFL7GIF.js';
|
|
30
30
|
import './chunk-NSBPE2FW.js';
|
|
31
|
-
//# sourceMappingURL=open-registry-
|
|
32
|
-
//# sourceMappingURL=open-registry-
|
|
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"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { AI_RESOURCES, MONOREPO_ROOT } from './chunk-
|
|
2
|
-
export { aiResourceRoots } from './chunk-
|
|
1
|
+
export { AI_RESOURCES, MONOREPO_ROOT } from './chunk-ZBD6EITA.js';
|
|
2
|
+
export { aiResourceRoots } from './chunk-OX2W5YF3.js';
|
|
3
3
|
import './chunk-4GY63JU6.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-TYUJPQNX.js';
|
|
5
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
10
|
import './chunk-IG5LZ3WU.js';
|
|
11
11
|
import './chunk-IY5E7Y5W.js';
|
|
@@ -18,5 +18,5 @@ import './chunk-MJHSLODD.js';
|
|
|
18
18
|
import './chunk-C3CAXQMA.js';
|
|
19
19
|
import './chunk-BOFL7GIF.js';
|
|
20
20
|
import './chunk-NSBPE2FW.js';
|
|
21
|
-
//# sourceMappingURL=paths-
|
|
22
|
-
//# sourceMappingURL=paths-
|
|
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,11 +1,11 @@
|
|
|
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-
|
|
4
|
+
import './chunk-TYUJPQNX.js';
|
|
5
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
10
|
import './chunk-IG5LZ3WU.js';
|
|
11
11
|
import './chunk-IY5E7Y5W.js';
|
|
@@ -223,5 +223,5 @@ async function ensurePluginsLoaded(projectDir, plugins, registry = pluginRegistr
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
export { ensurePluginsLoaded, loadPlugins, reconcilePlugins, rollbackPluginStore, specName };
|
|
226
|
-
//# sourceMappingURL=plugin-store-
|
|
227
|
-
//# sourceMappingURL=plugin-store-
|
|
226
|
+
//# sourceMappingURL=plugin-store-MLFP3WJ7.js.map
|
|
227
|
+
//# sourceMappingURL=plugin-store-MLFP3WJ7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../cli/src/plugin-store/paths.ts","../cli/src/plugin-store/spec.ts","../cli/src/plugin-store/load.ts","../cli/src/plugin-store/reconcile.ts","../cli/src/plugin-store/index.ts"],"names":["existsSync","readFileSync","join"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,WAAW,UAAA,EAA4B;AACrD,EAAA,OAAO,IAAA,CAAK,UAAA,EAAY,SAAA,EAAW,SAAS,CAAA;AAC9C;AAGO,SAAS,eAAe,UAAA,EAA4B;AACzD,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG,cAAc,CAAA;AACpD;AAGO,SAAS,eAAe,UAAA,EAA4B;AACzD,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG,cAAc,CAAA;AACpD;AAGO,SAAS,kBAAkB,UAAA,EAA4B;AAC5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O,WAAA,CAAY,YAAY,OAAA,EAAS,QAAA,EAAU,EAAE,GAAA,EAAK,IAAA,CAAK,KAAK,CAAA;AACrE","file":"plugin-store-CK7YWRIC.js","sourcesContent":["/**\n * Pure path helpers for the project-local plugin store.\n *\n * The store is a self-contained npm workspace owned by the CLI under\n * `<projectDir>/.skaile/plugins/`. Only `resolvePluginEntry` reads the filesystem.\n */\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\n\n/** `<projectDir>/.skaile/plugins` — the store root. */\nexport function pluginsDir(projectDir: string): string {\n return join(projectDir, \".skaile\", \"plugins\");\n}\n\n/** `<store>/package.json` — generated, never user-edited. */\nexport function pluginsPkgJson(projectDir: string): string {\n return join(pluginsDir(projectDir), \"package.json\");\n}\n\n/** `<store>/node_modules` — where reconciled plugin packages land. */\nexport function nodeModulesDir(projectDir: string): string {\n return join(pluginsDir(projectDir), \"node_modules\");\n}\n\n/** `<store>/.reconcile-hash` — SHA of plugins-list + lock slice; skip reinstall when unchanged. */\nexport function reconcileHashFile(projectDir: string): string {\n return join(pluginsDir(projectDir), \".reconcile-hash\");\n}\n\n/** Pick the file an `exports` target points at, preferring the ESM-friendly conditions. */\nfunction exportsTarget(target: unknown): string | undefined {\n if (typeof target === \"string\") return target;\n if (Array.isArray(target)) {\n for (const t of target) {\n const hit = exportsTarget(t);\n if (hit) return hit;\n }\n return undefined;\n }\n if (target && typeof target === \"object\") {\n const map = target as Record<string, unknown>;\n for (const cond of [\"import\", \"node\", \"default\", \"require\"]) {\n if (cond in map) {\n const hit = exportsTarget(map[cond]);\n if (hit) return hit;\n }\n }\n }\n return undefined;\n}\n\n/**\n * Absolute path to a plugin package's entry file under the store's\n * `node_modules`, resolved from its `package.json` (`exports[\".\"]`, then\n * `module`, then `main`, then `index.js`). Node's ESM loader rejects directory\n * imports, so the entry must be a file; `import()` of the result works inside\n * compiled binaries via `pathToFileURL`.\n *\n * @throws When the package is not installed or declares no resolvable entry.\n */\nexport function resolvePluginEntry(projectDir: string, pkgName: string): string {\n const pkgDir = join(nodeModulesDir(projectDir), pkgName);\n const pkgJsonPath = join(pkgDir, \"package.json\");\n if (!existsSync(pkgJsonPath)) {\n throw new Error(`package \"${pkgName}\" is not installed in ${nodeModulesDir(projectDir)}`);\n }\n const pkg = JSON.parse(readFileSync(pkgJsonPath, \"utf8\")) as {\n exports?: unknown;\n module?: string;\n main?: string;\n };\n let rel: string | undefined;\n if (pkg.exports !== undefined) {\n const root =\n typeof pkg.exports === \"object\" && pkg.exports !== null && !Array.isArray(pkg.exports)\n ? ((pkg.exports as Record<string, unknown>)[\".\"] ?? pkg.exports)\n : pkg.exports;\n rel = exportsTarget(root);\n }\n rel ??= pkg.module ?? pkg.main ?? \"index.js\";\n const entry = resolve(pkgDir, rel);\n if (!existsSync(entry)) {\n throw new Error(`package \"${pkgName}\" entry ${rel} does not exist`);\n }\n return entry;\n}\n","/**\n * Parse npm package specifiers from the `plugins:` list into name + range.\n *\n * The leading `@` of a scope is NOT a separator: only the last `@` at a\n * non-zero index splits the package name from its semver range.\n * \"@skaile/provider-fly@^0.1.0\" → { name: \"@skaile/provider-fly\", range: \"^0.1.0\" }\n * \"@skaile/connector-redis\" → { name: \"@skaile/connector-redis\", range: \"*\" }\n * \"lodash@^4\" → { name: \"lodash\", range: \"^4\" }\n */\n\n/** A parsed plugin specifier: package name plus a semver range (`\"*\"` when omitted). */\nexport interface PluginSpec {\n name: string;\n range: string;\n}\n\n/**\n * Parse a single plugin specifier into `{ name, range }`.\n *\n * @param spec - An npm specifier, e.g. `\"@skaile/provider-fly@^0.1.0\"` or `\"lodash\"`.\n * @returns The package name and semver range (range defaults to `\"*\"`).\n * @throws Error when the specifier is empty.\n */\nexport function parseSpec(spec: string): PluginSpec {\n const trimmed = spec.trim();\n if (!trimmed) throw new Error(\"parseSpec: empty specifier\");\n\n // Find the version-separating `@` — the last one that is not the scope `@`\n // at index 0. A bare `@scope/name` has its only `@` at index 0 (no range).\n const at = trimmed.lastIndexOf(\"@\");\n if (at <= 0) {\n return { name: trimmed, range: \"*\" };\n }\n const name = trimmed.slice(0, at);\n const range = trimmed.slice(at + 1);\n return { name, range: range.length > 0 ? range : \"*\" };\n}\n\n/** Convenience: just the package name of a specifier. */\nexport function specName(spec: string): string {\n return parseSpec(spec).name;\n}\n","/**\n * Runtime plugin loader: dynamic-import each reconciled plugin and let it\n * self-register into the `pluginRegistry`.\n *\n * Each plugin specifier resolves to an absolute path under the store's\n * `node_modules`; we import it via a `file://` URL so the import works inside\n * `bun --compile` binaries (which bundle only the literal-string switches, but\n * can still execute a `file://` import against the unpacked store on disk).\n * Failures are caught per-plugin so one broken plugin never aborts the rest.\n */\n\nimport { pathToFileURL } from \"node:url\";\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { resolvePluginEntry } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/** Options for {@link loadPlugins}. */\nexport interface LoadOptions {\n log?: Logger;\n}\n\n/** Result of a load pass: which specs registered and which failed. */\nexport interface LoadResult {\n loaded: string[];\n failed: { spec: string; error: string }[];\n}\n\n/** The self-registration entrypoint a plugin module is expected to export. */\ntype PluginModule = { register?: (registry: PluginRegistry) => void };\n\n/**\n * Load and register each plugin in `plugins` into `registry`.\n *\n * @param projectDir - Project root holding `.skaile/plugins/node_modules`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param registry - Registry to register into. Defaults to the process-wide `pluginRegistry`.\n * @param opts - Optional logger.\n * @returns Loaded specs + per-plugin failures (never throws).\n */\nexport async function loadPlugins(\n projectDir: string,\n plugins: string[],\n registry: PluginRegistry = pluginRegistry,\n opts: LoadOptions = {},\n): Promise<LoadResult> {\n const loaded: string[] = [];\n const failed: { spec: string; error: string }[] = [];\n\n for (const spec of plugins) {\n try {\n const { name } = parseSpec(spec);\n const entry = resolvePluginEntry(projectDir, name);\n const mod = (await import(pathToFileURL(entry).href)) as PluginModule;\n if (typeof mod.register !== \"function\") {\n throw new Error(`plugin \"${name}\" does not export a register() function`);\n }\n mod.register(registry);\n loaded.push(spec);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n failed.push({ spec, error: `failed to load plugin \"${spec}\": ${message}` });\n opts.log?.warn(`plugin load failed: ${spec}`, { error: message });\n }\n }\n\n return { loaded, failed };\n}\n","/**\n * Reconcile the project-local plugin store (`<projectDir>/.skaile/plugins/`).\n *\n * The reconciler is hash-skipped: it computes a SHA-256 over the sorted plugin\n * list plus the lock file's `plugins` slice and compares it to the stored\n * `.reconcile-hash`. On a match it returns with zero further I/O; otherwise it\n * regenerates the store's `package.json` and runs `bun install` against it.\n *\n * The install step is injectable (`InstallFn`) so tests stay hermetic — they\n * pass a fake installer that records calls and writes a stub `node_modules`.\n */\n\nimport { createHash } from \"node:crypto\";\nimport { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { readPluginsLockSlice } from \"@skaile/workspaces/core\";\nimport { nodeModulesDir, pluginsDir, pluginsPkgJson, reconcileHashFile } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/** How `InstallFn` may treat the store's lock: `frozen` forbids lock changes. */\nexport interface InstallOptions {\n /**\n * `false` when the spec list changed since the last `package.json`, so the\n * lock has to change too. Defaults to `true` (frozen when a lock exists).\n */\n frozen?: boolean;\n}\n\n/**\n * Installs the store's dependencies. Returns `ok: false` (never throws) on a\n * failed install so the reconciler can surface the captured `output`.\n */\nexport type InstallFn = (\n pluginsDir: string,\n opts?: InstallOptions,\n) => Promise<{ ok: boolean; output: string }>;\n\n/** Options for {@link reconcilePlugins}. */\nexport interface ReconcileOptions {\n /** Injectable installer. Defaults to a real `bun install` of the store. */\n runInstall?: InstallFn;\n /**\n * Lock slice to fold into the reconcile-hash. Defaults to\n * `readPluginsLockSlice(projectDir)` so a lock edit invalidates the hash.\n */\n lockSlice?: unknown;\n}\n\n/** Result of a reconcile pass. */\nexport interface ReconcileResult {\n changed: boolean;\n reason: \"no-plugins\" | \"up-to-date\" | \"reconciled\";\n}\n\n/** Run a command to completion, capturing stdout+stderr. `started: false` when it cannot spawn. */\nasync function runCapture(\n args: string[],\n cwd: string,\n): Promise<{ started: boolean; code: number; output: string }> {\n const { portableSpawn } = await import(\"@skaile/workspaces/core\");\n const proc = portableSpawn(args, { cwd });\n const chunks: string[] = [];\n const decoder = new TextDecoder();\n const pump = async (stream: ReadableStream<Uint8Array>) => {\n const reader = stream.getReader();\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n if (value) chunks.push(decoder.decode(value, { stream: true }));\n }\n };\n await Promise.all([pump(proc.stdout), pump(proc.stderr)]);\n const code = await proc.exited;\n // `portableSpawn` reports a spawn error (ENOENT) as exit -1 with no pid.\n return { started: proc.pid !== -1, code, output: chunks.join(\"\") };\n}\n\n/**\n * The default real installer: `bun install` inside the store directory, or\n * `npm install` when `bun` is not on PATH. Frozen only when a lock exists and\n * the spec list did not change (`opts.frozen !== false`): a changed list has to\n * rewrite the lock, which a frozen install refuses.\n */\nexport const defaultInstall: InstallFn = async (dir, opts = {}) => {\n const hasBunLock = existsSync(`${dir}/bun.lock`) || existsSync(`${dir}/bun.lockb`);\n const hasNpmLock = existsSync(`${dir}/package-lock.json`);\n const frozen = opts.frozen !== false;\n\n const bunArgs =\n frozen && (hasBunLock || hasNpmLock)\n ? [\"bun\", \"install\", \"--frozen-lockfile\"]\n : [\"bun\", \"install\"];\n const withBun = await runCapture(bunArgs, dir);\n if (withBun.started) return { ok: withBun.code === 0, output: withBun.output };\n\n const npmArgs =\n frozen && hasNpmLock\n ? [\"npm\", \"ci\", \"--ignore-scripts\", \"--no-audit\", \"--no-fund\"]\n : [\"npm\", \"install\", \"--ignore-scripts\", \"--no-audit\", \"--no-fund\"];\n const withNpm = await runCapture(npmArgs, dir);\n if (withNpm.started) return { ok: withNpm.code === 0, output: withNpm.output };\n return {\n ok: false,\n output:\n \"neither bun nor npm found on PATH; plugin install needs one of them (https://bun.sh or https://nodejs.org)\",\n };\n};\n\n/**\n * Generate the store's `package.json` from the plugin specs. Returns the\n * previous file content (`undefined` when there was none) and whether the\n * dependency set changed.\n */\nfunction writePackageJson(\n projectDir: string,\n plugins: string[],\n): { previous: string | undefined; depsChanged: boolean } {\n const dependencies: Record<string, string> = {};\n for (const spec of plugins) {\n const { name, range } = parseSpec(spec);\n dependencies[name] = range;\n }\n const pkg = {\n name: \"skaile-project-plugins\",\n private: true,\n dependencies,\n };\n const file = pluginsPkgJson(projectDir);\n const previous = existsSync(file) ? readFileSync(file, \"utf8\") : undefined;\n let before: Record<string, string> | undefined;\n try {\n before = previous === undefined ? undefined : JSON.parse(previous).dependencies;\n } catch {\n before = undefined;\n }\n const sortedJson = (d: Record<string, string> | undefined) =>\n JSON.stringify(Object.entries(d ?? {}).sort(([a], [b]) => a.localeCompare(b)));\n const depsChanged = before === undefined || sortedJson(before) !== sortedJson(dependencies);\n mkdirSync(pluginsDir(projectDir), { recursive: true });\n writeFileSync(file, `${JSON.stringify(pkg, null, 2)}\\n`);\n return { previous, depsChanged };\n}\n\n/**\n * Reconcile the plugin store for a project.\n *\n * @param projectDir - Project root containing `skaile.yaml` / `skaile.lock.yaml`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param opts - Optional injectable installer + lock slice override.\n * @returns Whether the store changed and why.\n */\nexport async function reconcilePlugins(\n projectDir: string,\n plugins: string[],\n opts: ReconcileOptions = {},\n): Promise<ReconcileResult> {\n if (plugins.length === 0) {\n return { changed: false, reason: \"no-plugins\" };\n }\n\n const lockSlice = opts.lockSlice ?? readPluginsLockSlice(projectDir);\n const wantHash = createHash(\"sha256\")\n .update(JSON.stringify({ plugins: [...plugins].sort(), lock: lockSlice }))\n .digest(\"hex\");\n\n const hashFile = reconcileHashFile(projectDir);\n if (existsSync(hashFile)) {\n const have = readFileSync(hashFile, \"utf8\").trim();\n if (have === wantHash) {\n return { changed: false, reason: \"up-to-date\" };\n }\n }\n\n const { previous, depsChanged } = writePackageJson(projectDir, plugins);\n\n const install = opts.runInstall ?? defaultInstall;\n const result = await install(pluginsDir(projectDir), { frozen: !depsChanged });\n if (!result.ok) {\n // A failed install must not leave the spec behind: the next reconcile\n // would compare against it and treat the store as already changed.\n if (previous === undefined) rmSync(pluginsPkgJson(projectDir), { force: true });\n else writeFileSync(pluginsPkgJson(projectDir), previous);\n throw new Error(`plugin install failed:\\n${result.output}`);\n }\n\n writeFileSync(hashFile, wantHash);\n return { changed: true, reason: \"reconciled\" };\n}\n\n/**\n * Put the store back to `previousPlugins` after `plugin install` failed past\n * the reconcile (the plugin installed but does not load). Best effort: a\n * failing reinstall is swallowed, the store is then rebuilt by the next\n * reconcile because the hash no longer matches the declared list.\n *\n * With no previous plugins every generated file of the store goes away\n * (`package.json`, hash, lock file and `node_modules`), so the store keeps\n * neither the rejected spec nor its installed package.\n */\nexport async function rollbackPluginStore(\n projectDir: string,\n previousPlugins: string[],\n opts: ReconcileOptions = {},\n): Promise<void> {\n if (previousPlugins.length === 0) {\n const dir = pluginsDir(projectDir);\n rmSync(pluginsPkgJson(projectDir), { force: true });\n rmSync(reconcileHashFile(projectDir), { force: true });\n rmSync(nodeModulesDir(projectDir), { recursive: true, force: true });\n for (const lock of [\"bun.lock\", \"bun.lockb\", \"package-lock.json\"]) {\n rmSync(join(dir, lock), { force: true });\n }\n return;\n }\n try {\n await reconcilePlugins(projectDir, previousPlugins, opts);\n } catch {\n // the next reconcile retries\n }\n}\n","/**\n * The project-local plugin store: reconcile (`<projectDir>/.skaile/plugins/`)\n * then load the reconciled plugins into the `pluginRegistry`.\n *\n * `ensurePluginsLoaded` is the single entrypoint commands wire in. It is a\n * guarded no-op when `plugins` is empty/undefined — zero overhead for the\n * common case where no project declares `plugins:` in `skaile.yaml`.\n */\n\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { type LoadResult, loadPlugins } from \"./load.js\";\nimport { type ReconcileOptions, reconcilePlugins } from \"./reconcile.js\";\n\nexport type { LoadResult } from \"./load.js\";\nexport { loadPlugins } from \"./load.js\";\nexport type { ReconcileOptions } from \"./reconcile.js\";\nexport { reconcilePlugins, rollbackPluginStore } from \"./reconcile.js\";\nexport { specName } from \"./spec.js\";\n\n/** Options for {@link ensurePluginsLoaded}. */\nexport interface EnsurePluginsOptions extends ReconcileOptions {\n log?: Logger;\n}\n\n/**\n * Reconcile the plugin store then load each plugin into `registry`.\n *\n * No-op (returns immediately) when `plugins` is empty/undefined, so the common\n * no-plugins path costs nothing.\n *\n * @param projectDir - Project root.\n * @param plugins - The `skaile.yaml` `plugins:` list (may be undefined).\n * @param registry - Registry to register into. Defaults to `pluginRegistry`.\n * @param opts - Injectable installer / lock slice + optional logger.\n * @returns The load result, or an empty result when there are no plugins.\n */\nexport async function ensurePluginsLoaded(\n projectDir: string,\n plugins: string[] | undefined,\n registry: PluginRegistry = pluginRegistry,\n opts: EnsurePluginsOptions = {},\n): Promise<LoadResult> {\n if (!plugins || plugins.length === 0) {\n return { loaded: [], failed: [] };\n }\n await reconcilePlugins(projectDir, plugins, opts);\n return loadPlugins(projectDir, plugins, registry, { log: opts.log });\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../cli/src/plugin-store/paths.ts","../cli/src/plugin-store/spec.ts","../cli/src/plugin-store/load.ts","../cli/src/plugin-store/reconcile.ts","../cli/src/plugin-store/index.ts"],"names":["existsSync","readFileSync","join"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,WAAW,UAAA,EAA4B;AACrD,EAAA,OAAO,IAAA,CAAK,UAAA,EAAY,SAAA,EAAW,SAAS,CAAA;AAC9C;AAGO,SAAS,eAAe,UAAA,EAA4B;AACzD,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG,cAAc,CAAA;AACpD;AAGO,SAAS,eAAe,UAAA,EAA4B;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A,EAAQ,EAAC,EAAE;AAAA,EAClC;AACA,EAAA,MAAM,gBAAA,CAAiB,UAAA,EAAY,OAAA,EAAS,IAAI,CAAA;AAChD,EAAA,OAAO,WAAA,CAAY,YAAY,OAAA,EAAS,QAAA,EAAU,EAAE,GAAA,EAAK,IAAA,CAAK,KAAK,CAAA;AACrE","file":"plugin-store-MLFP3WJ7.js","sourcesContent":["/**\n * Pure path helpers for the project-local plugin store.\n *\n * The store is a self-contained npm workspace owned by the CLI under\n * `<projectDir>/.skaile/plugins/`. Only `resolvePluginEntry` reads the filesystem.\n */\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\n\n/** `<projectDir>/.skaile/plugins` — the store root. */\nexport function pluginsDir(projectDir: string): string {\n return join(projectDir, \".skaile\", \"plugins\");\n}\n\n/** `<store>/package.json` — generated, never user-edited. */\nexport function pluginsPkgJson(projectDir: string): string {\n return join(pluginsDir(projectDir), \"package.json\");\n}\n\n/** `<store>/node_modules` — where reconciled plugin packages land. */\nexport function nodeModulesDir(projectDir: string): string {\n return join(pluginsDir(projectDir), \"node_modules\");\n}\n\n/** `<store>/.reconcile-hash` — SHA of plugins-list + lock slice; skip reinstall when unchanged. */\nexport function reconcileHashFile(projectDir: string): string {\n return join(pluginsDir(projectDir), \".reconcile-hash\");\n}\n\n/** Pick the file an `exports` target points at, preferring the ESM-friendly conditions. */\nfunction exportsTarget(target: unknown): string | undefined {\n if (typeof target === \"string\") return target;\n if (Array.isArray(target)) {\n for (const t of target) {\n const hit = exportsTarget(t);\n if (hit) return hit;\n }\n return undefined;\n }\n if (target && typeof target === \"object\") {\n const map = target as Record<string, unknown>;\n for (const cond of [\"import\", \"node\", \"default\", \"require\"]) {\n if (cond in map) {\n const hit = exportsTarget(map[cond]);\n if (hit) return hit;\n }\n }\n }\n return undefined;\n}\n\n/**\n * Absolute path to a plugin package's entry file under the store's\n * `node_modules`, resolved from its `package.json` (`exports[\".\"]`, then\n * `module`, then `main`, then `index.js`). Node's ESM loader rejects directory\n * imports, so the entry must be a file; `import()` of the result works inside\n * compiled binaries via `pathToFileURL`.\n *\n * @throws When the package is not installed or declares no resolvable entry.\n */\nexport function resolvePluginEntry(projectDir: string, pkgName: string): string {\n const pkgDir = join(nodeModulesDir(projectDir), pkgName);\n const pkgJsonPath = join(pkgDir, \"package.json\");\n if (!existsSync(pkgJsonPath)) {\n throw new Error(`package \"${pkgName}\" is not installed in ${nodeModulesDir(projectDir)}`);\n }\n const pkg = JSON.parse(readFileSync(pkgJsonPath, \"utf8\")) as {\n exports?: unknown;\n module?: string;\n main?: string;\n };\n let rel: string | undefined;\n if (pkg.exports !== undefined) {\n const root =\n typeof pkg.exports === \"object\" && pkg.exports !== null && !Array.isArray(pkg.exports)\n ? ((pkg.exports as Record<string, unknown>)[\".\"] ?? pkg.exports)\n : pkg.exports;\n rel = exportsTarget(root);\n }\n rel ??= pkg.module ?? pkg.main ?? \"index.js\";\n const entry = resolve(pkgDir, rel);\n if (!existsSync(entry)) {\n throw new Error(`package \"${pkgName}\" entry ${rel} does not exist`);\n }\n return entry;\n}\n","/**\n * Parse npm package specifiers from the `plugins:` list into name + range.\n *\n * The leading `@` of a scope is NOT a separator: only the last `@` at a\n * non-zero index splits the package name from its semver range.\n * \"@skaile/provider-fly@^0.1.0\" → { name: \"@skaile/provider-fly\", range: \"^0.1.0\" }\n * \"@skaile/connector-redis\" → { name: \"@skaile/connector-redis\", range: \"*\" }\n * \"lodash@^4\" → { name: \"lodash\", range: \"^4\" }\n */\n\n/** A parsed plugin specifier: package name plus a semver range (`\"*\"` when omitted). */\nexport interface PluginSpec {\n name: string;\n range: string;\n}\n\n/**\n * Parse a single plugin specifier into `{ name, range }`.\n *\n * @param spec - An npm specifier, e.g. `\"@skaile/provider-fly@^0.1.0\"` or `\"lodash\"`.\n * @returns The package name and semver range (range defaults to `\"*\"`).\n * @throws Error when the specifier is empty.\n */\nexport function parseSpec(spec: string): PluginSpec {\n const trimmed = spec.trim();\n if (!trimmed) throw new Error(\"parseSpec: empty specifier\");\n\n // Find the version-separating `@` — the last one that is not the scope `@`\n // at index 0. A bare `@scope/name` has its only `@` at index 0 (no range).\n const at = trimmed.lastIndexOf(\"@\");\n if (at <= 0) {\n return { name: trimmed, range: \"*\" };\n }\n const name = trimmed.slice(0, at);\n const range = trimmed.slice(at + 1);\n return { name, range: range.length > 0 ? range : \"*\" };\n}\n\n/** Convenience: just the package name of a specifier. */\nexport function specName(spec: string): string {\n return parseSpec(spec).name;\n}\n","/**\n * Runtime plugin loader: dynamic-import each reconciled plugin and let it\n * self-register into the `pluginRegistry`.\n *\n * Each plugin specifier resolves to an absolute path under the store's\n * `node_modules`; we import it via a `file://` URL so the import works inside\n * `bun --compile` binaries (which bundle only the literal-string switches, but\n * can still execute a `file://` import against the unpacked store on disk).\n * Failures are caught per-plugin so one broken plugin never aborts the rest.\n */\n\nimport { pathToFileURL } from \"node:url\";\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { resolvePluginEntry } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/** Options for {@link loadPlugins}. */\nexport interface LoadOptions {\n log?: Logger;\n}\n\n/** Result of a load pass: which specs registered and which failed. */\nexport interface LoadResult {\n loaded: string[];\n failed: { spec: string; error: string }[];\n}\n\n/** The self-registration entrypoint a plugin module is expected to export. */\ntype PluginModule = { register?: (registry: PluginRegistry) => void };\n\n/**\n * Load and register each plugin in `plugins` into `registry`.\n *\n * @param projectDir - Project root holding `.skaile/plugins/node_modules`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param registry - Registry to register into. Defaults to the process-wide `pluginRegistry`.\n * @param opts - Optional logger.\n * @returns Loaded specs + per-plugin failures (never throws).\n */\nexport async function loadPlugins(\n projectDir: string,\n plugins: string[],\n registry: PluginRegistry = pluginRegistry,\n opts: LoadOptions = {},\n): Promise<LoadResult> {\n const loaded: string[] = [];\n const failed: { spec: string; error: string }[] = [];\n\n for (const spec of plugins) {\n try {\n const { name } = parseSpec(spec);\n const entry = resolvePluginEntry(projectDir, name);\n const mod = (await import(pathToFileURL(entry).href)) as PluginModule;\n if (typeof mod.register !== \"function\") {\n throw new Error(`plugin \"${name}\" does not export a register() function`);\n }\n mod.register(registry);\n loaded.push(spec);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n failed.push({ spec, error: `failed to load plugin \"${spec}\": ${message}` });\n opts.log?.warn(`plugin load failed: ${spec}`, { error: message });\n }\n }\n\n return { loaded, failed };\n}\n","/**\n * Reconcile the project-local plugin store (`<projectDir>/.skaile/plugins/`).\n *\n * The reconciler is hash-skipped: it computes a SHA-256 over the sorted plugin\n * list plus the lock file's `plugins` slice and compares it to the stored\n * `.reconcile-hash`. On a match it returns with zero further I/O; otherwise it\n * regenerates the store's `package.json` and runs `bun install` against it.\n *\n * The install step is injectable (`InstallFn`) so tests stay hermetic — they\n * pass a fake installer that records calls and writes a stub `node_modules`.\n */\n\nimport { createHash } from \"node:crypto\";\nimport { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { readPluginsLockSlice } from \"@skaile/workspaces/core\";\nimport { nodeModulesDir, pluginsDir, pluginsPkgJson, reconcileHashFile } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/** How `InstallFn` may treat the store's lock: `frozen` forbids lock changes. */\nexport interface InstallOptions {\n /**\n * `false` when the spec list changed since the last `package.json`, so the\n * lock has to change too. Defaults to `true` (frozen when a lock exists).\n */\n frozen?: boolean;\n}\n\n/**\n * Installs the store's dependencies. Returns `ok: false` (never throws) on a\n * failed install so the reconciler can surface the captured `output`.\n */\nexport type InstallFn = (\n pluginsDir: string,\n opts?: InstallOptions,\n) => Promise<{ ok: boolean; output: string }>;\n\n/** Options for {@link reconcilePlugins}. */\nexport interface ReconcileOptions {\n /** Injectable installer. Defaults to a real `bun install` of the store. */\n runInstall?: InstallFn;\n /**\n * Lock slice to fold into the reconcile-hash. Defaults to\n * `readPluginsLockSlice(projectDir)` so a lock edit invalidates the hash.\n */\n lockSlice?: unknown;\n}\n\n/** Result of a reconcile pass. */\nexport interface ReconcileResult {\n changed: boolean;\n reason: \"no-plugins\" | \"up-to-date\" | \"reconciled\";\n}\n\n/** Run a command to completion, capturing stdout+stderr. `started: false` when it cannot spawn. */\nasync function runCapture(\n args: string[],\n cwd: string,\n): Promise<{ started: boolean; code: number; output: string }> {\n const { portableSpawn } = await import(\"@skaile/workspaces/core\");\n const proc = portableSpawn(args, { cwd });\n const chunks: string[] = [];\n const decoder = new TextDecoder();\n const pump = async (stream: ReadableStream<Uint8Array>) => {\n const reader = stream.getReader();\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n if (value) chunks.push(decoder.decode(value, { stream: true }));\n }\n };\n await Promise.all([pump(proc.stdout), pump(proc.stderr)]);\n const code = await proc.exited;\n // `portableSpawn` reports a spawn error (ENOENT) as exit -1 with no pid.\n return { started: proc.pid !== -1, code, output: chunks.join(\"\") };\n}\n\n/**\n * The default real installer: `bun install` inside the store directory, or\n * `npm install` when `bun` is not on PATH. Frozen only when a lock exists and\n * the spec list did not change (`opts.frozen !== false`): a changed list has to\n * rewrite the lock, which a frozen install refuses.\n */\nexport const defaultInstall: InstallFn = async (dir, opts = {}) => {\n const hasBunLock = existsSync(`${dir}/bun.lock`) || existsSync(`${dir}/bun.lockb`);\n const hasNpmLock = existsSync(`${dir}/package-lock.json`);\n const frozen = opts.frozen !== false;\n\n const bunArgs =\n frozen && (hasBunLock || hasNpmLock)\n ? [\"bun\", \"install\", \"--frozen-lockfile\"]\n : [\"bun\", \"install\"];\n const withBun = await runCapture(bunArgs, dir);\n if (withBun.started) return { ok: withBun.code === 0, output: withBun.output };\n\n const npmArgs =\n frozen && hasNpmLock\n ? [\"npm\", \"ci\", \"--ignore-scripts\", \"--no-audit\", \"--no-fund\"]\n : [\"npm\", \"install\", \"--ignore-scripts\", \"--no-audit\", \"--no-fund\"];\n const withNpm = await runCapture(npmArgs, dir);\n if (withNpm.started) return { ok: withNpm.code === 0, output: withNpm.output };\n return {\n ok: false,\n output:\n \"neither bun nor npm found on PATH; plugin install needs one of them (https://bun.sh or https://nodejs.org)\",\n };\n};\n\n/**\n * Generate the store's `package.json` from the plugin specs. Returns the\n * previous file content (`undefined` when there was none) and whether the\n * dependency set changed.\n */\nfunction writePackageJson(\n projectDir: string,\n plugins: string[],\n): { previous: string | undefined; depsChanged: boolean } {\n const dependencies: Record<string, string> = {};\n for (const spec of plugins) {\n const { name, range } = parseSpec(spec);\n dependencies[name] = range;\n }\n const pkg = {\n name: \"skaile-project-plugins\",\n private: true,\n dependencies,\n };\n const file = pluginsPkgJson(projectDir);\n const previous = existsSync(file) ? readFileSync(file, \"utf8\") : undefined;\n let before: Record<string, string> | undefined;\n try {\n before = previous === undefined ? undefined : JSON.parse(previous).dependencies;\n } catch {\n before = undefined;\n }\n const sortedJson = (d: Record<string, string> | undefined) =>\n JSON.stringify(Object.entries(d ?? {}).sort(([a], [b]) => a.localeCompare(b)));\n const depsChanged = before === undefined || sortedJson(before) !== sortedJson(dependencies);\n mkdirSync(pluginsDir(projectDir), { recursive: true });\n writeFileSync(file, `${JSON.stringify(pkg, null, 2)}\\n`);\n return { previous, depsChanged };\n}\n\n/**\n * Reconcile the plugin store for a project.\n *\n * @param projectDir - Project root containing `skaile.yaml` / `skaile.lock.yaml`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param opts - Optional injectable installer + lock slice override.\n * @returns Whether the store changed and why.\n */\nexport async function reconcilePlugins(\n projectDir: string,\n plugins: string[],\n opts: ReconcileOptions = {},\n): Promise<ReconcileResult> {\n if (plugins.length === 0) {\n return { changed: false, reason: \"no-plugins\" };\n }\n\n const lockSlice = opts.lockSlice ?? readPluginsLockSlice(projectDir);\n const wantHash = createHash(\"sha256\")\n .update(JSON.stringify({ plugins: [...plugins].sort(), lock: lockSlice }))\n .digest(\"hex\");\n\n const hashFile = reconcileHashFile(projectDir);\n if (existsSync(hashFile)) {\n const have = readFileSync(hashFile, \"utf8\").trim();\n if (have === wantHash) {\n return { changed: false, reason: \"up-to-date\" };\n }\n }\n\n const { previous, depsChanged } = writePackageJson(projectDir, plugins);\n\n const install = opts.runInstall ?? defaultInstall;\n const result = await install(pluginsDir(projectDir), { frozen: !depsChanged });\n if (!result.ok) {\n // A failed install must not leave the spec behind: the next reconcile\n // would compare against it and treat the store as already changed.\n if (previous === undefined) rmSync(pluginsPkgJson(projectDir), { force: true });\n else writeFileSync(pluginsPkgJson(projectDir), previous);\n throw new Error(`plugin install failed:\\n${result.output}`);\n }\n\n writeFileSync(hashFile, wantHash);\n return { changed: true, reason: \"reconciled\" };\n}\n\n/**\n * Put the store back to `previousPlugins` after `plugin install` failed past\n * the reconcile (the plugin installed but does not load). Best effort: a\n * failing reinstall is swallowed, the store is then rebuilt by the next\n * reconcile because the hash no longer matches the declared list.\n *\n * With no previous plugins every generated file of the store goes away\n * (`package.json`, hash, lock file and `node_modules`), so the store keeps\n * neither the rejected spec nor its installed package.\n */\nexport async function rollbackPluginStore(\n projectDir: string,\n previousPlugins: string[],\n opts: ReconcileOptions = {},\n): Promise<void> {\n if (previousPlugins.length === 0) {\n const dir = pluginsDir(projectDir);\n rmSync(pluginsPkgJson(projectDir), { force: true });\n rmSync(reconcileHashFile(projectDir), { force: true });\n rmSync(nodeModulesDir(projectDir), { recursive: true, force: true });\n for (const lock of [\"bun.lock\", \"bun.lockb\", \"package-lock.json\"]) {\n rmSync(join(dir, lock), { force: true });\n }\n return;\n }\n try {\n await reconcilePlugins(projectDir, previousPlugins, opts);\n } catch {\n // the next reconcile retries\n }\n}\n","/**\n * The project-local plugin store: reconcile (`<projectDir>/.skaile/plugins/`)\n * then load the reconciled plugins into the `pluginRegistry`.\n *\n * `ensurePluginsLoaded` is the single entrypoint commands wire in. It is a\n * guarded no-op when `plugins` is empty/undefined — zero overhead for the\n * common case where no project declares `plugins:` in `skaile.yaml`.\n */\n\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { type LoadResult, loadPlugins } from \"./load.js\";\nimport { type ReconcileOptions, reconcilePlugins } from \"./reconcile.js\";\n\nexport type { LoadResult } from \"./load.js\";\nexport { loadPlugins } from \"./load.js\";\nexport type { ReconcileOptions } from \"./reconcile.js\";\nexport { reconcilePlugins, rollbackPluginStore } from \"./reconcile.js\";\nexport { specName } from \"./spec.js\";\n\n/** Options for {@link ensurePluginsLoaded}. */\nexport interface EnsurePluginsOptions extends ReconcileOptions {\n log?: Logger;\n}\n\n/**\n * Reconcile the plugin store then load each plugin into `registry`.\n *\n * No-op (returns immediately) when `plugins` is empty/undefined, so the common\n * no-plugins path costs nothing.\n *\n * @param projectDir - Project root.\n * @param plugins - The `skaile.yaml` `plugins:` list (may be undefined).\n * @param registry - Registry to register into. Defaults to `pluginRegistry`.\n * @param opts - Injectable installer / lock slice + optional logger.\n * @returns The load result, or an empty result when there are no plugins.\n */\nexport async function ensurePluginsLoaded(\n projectDir: string,\n plugins: string[] | undefined,\n registry: PluginRegistry = pluginRegistry,\n opts: EnsurePluginsOptions = {},\n): Promise<LoadResult> {\n if (!plugins || plugins.length === 0) {\n return { loaded: [], failed: [] };\n }\n await reconcilePlugins(projectDir, plugins, opts);\n return loadPlugins(projectDir, plugins, registry, { log: opts.log });\n}\n"]}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
export { REF_HINT, editedConventionFiles, makeCheckCommand, makeCleanCommand, makeInstallCommand, reportAgentInstances, reportInstalledSoftDeps, reportMoved, reportPresetExpansions, reportRelocked, reportReplaced, runPointerOnlyInstall, supportsInstallManifest } from './chunk-
|
|
1
|
+
export { REF_HINT, editedConventionFiles, makeCheckCommand, makeCleanCommand, makeInstallCommand, reportAgentInstances, reportInstalledSoftDeps, reportMoved, reportPresetExpansions, reportRelocked, reportReplaced, runPointerOnlyInstall, supportsInstallManifest } from './chunk-3NNL334S.js';
|
|
2
2
|
import './chunk-NESV47MF.js';
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
3
|
+
import './chunk-GJGEDWRT.js';
|
|
4
|
+
import './chunk-5IMGZAKH.js';
|
|
5
|
+
import './chunk-PAUM35HD.js';
|
|
6
|
+
import './chunk-PGVSOHWE.js';
|
|
7
|
+
import './chunk-MCLT3BJG.js';
|
|
8
|
+
import './chunk-DHUJRIQQ.js';
|
|
9
|
+
import './chunk-V7AWO5FL.js';
|
|
9
10
|
import './chunk-R6O6YWU7.js';
|
|
10
11
|
import './chunk-6JKIOPT3.js';
|
|
11
12
|
import './chunk-2BIESC6S.js';
|
|
12
13
|
import './chunk-4ZTPYIBE.js';
|
|
13
|
-
import './chunk-XJYBCDY2.js';
|
|
14
14
|
import './chunk-X5YPJV4N.js';
|
|
15
|
+
import './chunk-OKQXY6FS.js';
|
|
15
16
|
import './chunk-O7SG5PC2.js';
|
|
16
17
|
import './chunk-7QBNJTTQ.js';
|
|
17
18
|
import './chunk-O2SYFJWP.js';
|
|
@@ -19,50 +20,52 @@ import './chunk-OQ5MKDS3.js';
|
|
|
19
20
|
import './chunk-32NA4TVC.js';
|
|
20
21
|
import './chunk-W3UDISS2.js';
|
|
21
22
|
import './chunk-PHRNUTSG.js';
|
|
22
|
-
import './chunk-
|
|
23
|
+
import './chunk-IQVZIVSA.js';
|
|
24
|
+
import './chunk-7LGNJJ76.js';
|
|
23
25
|
import './chunk-4R6DROGN.js';
|
|
24
26
|
import './chunk-USHB5KEY.js';
|
|
25
27
|
import './chunk-ZU24LWBI.js';
|
|
26
28
|
import './chunk-ISHJITXJ.js';
|
|
27
|
-
import './chunk-
|
|
28
|
-
import './chunk-
|
|
29
|
-
import './chunk-
|
|
30
|
-
import './chunk-
|
|
29
|
+
import './chunk-VTXXBYB3.js';
|
|
30
|
+
import './chunk-ZIW34FGO.js';
|
|
31
|
+
import './chunk-UK3LRPJ5.js';
|
|
32
|
+
import './chunk-5NVDOEWX.js';
|
|
31
33
|
import './chunk-YTZFSKWL.js';
|
|
32
34
|
import './chunk-LOO5CB5M.js';
|
|
33
|
-
import './chunk-
|
|
34
|
-
import './chunk-
|
|
35
|
+
import './chunk-PW3TYWOI.js';
|
|
36
|
+
import './chunk-YFIHFJEB.js';
|
|
35
37
|
import './chunk-B4X2N7JQ.js';
|
|
36
38
|
import './chunk-YROR332M.js';
|
|
37
|
-
import './chunk-
|
|
39
|
+
import './chunk-DWRYUWOK.js';
|
|
40
|
+
import './chunk-6VIVUBNN.js';
|
|
38
41
|
import './chunk-6E6PKKAD.js';
|
|
39
42
|
import './chunk-IFGTRL2I.js';
|
|
40
|
-
import './chunk-
|
|
43
|
+
import './chunk-QELQDY5K.js';
|
|
41
44
|
import './chunk-LNFKL23K.js';
|
|
42
45
|
import './chunk-X3RMRJNR.js';
|
|
43
46
|
import './chunk-M3WPBTGJ.js';
|
|
44
47
|
import './chunk-7RGTAEG6.js';
|
|
45
48
|
import './chunk-NUELZWCF.js';
|
|
46
|
-
import './chunk-
|
|
47
|
-
import './chunk-
|
|
48
|
-
import './chunk-
|
|
49
|
+
import './chunk-D5WTOVLG.js';
|
|
50
|
+
import './chunk-QAYL3PYY.js';
|
|
51
|
+
import './chunk-ODQGLELI.js';
|
|
49
52
|
import './chunk-NVO6WECE.js';
|
|
50
53
|
import './chunk-PXDWTJ3P.js';
|
|
51
54
|
import './chunk-H5U7LNTJ.js';
|
|
52
55
|
import './chunk-3TXEJN4W.js';
|
|
53
|
-
import './chunk-
|
|
56
|
+
import './chunk-FD2IPIE2.js';
|
|
54
57
|
import './chunk-NOA6EJXE.js';
|
|
55
58
|
import './chunk-KTBKW2FI.js';
|
|
56
59
|
import './chunk-UQ6LFBPZ.js';
|
|
57
|
-
import './chunk-
|
|
60
|
+
import './chunk-CNZI37HV.js';
|
|
58
61
|
import './chunk-57SF6W6E.js';
|
|
59
|
-
import './chunk-
|
|
62
|
+
import './chunk-OX2W5YF3.js';
|
|
60
63
|
import './chunk-4GY63JU6.js';
|
|
61
|
-
import './chunk-
|
|
64
|
+
import './chunk-TYUJPQNX.js';
|
|
62
65
|
import './chunk-D54T2F54.js';
|
|
63
66
|
import './chunk-5BEFNLOR.js';
|
|
64
67
|
import './chunk-A2ULN3KX.js';
|
|
65
|
-
import './chunk-
|
|
68
|
+
import './chunk-CAPKENNF.js';
|
|
66
69
|
import './chunk-L5VSIPQD.js';
|
|
67
70
|
import './chunk-IG5LZ3WU.js';
|
|
68
71
|
import './chunk-IY5E7Y5W.js';
|
|
@@ -75,5 +78,5 @@ import './chunk-MJHSLODD.js';
|
|
|
75
78
|
import './chunk-C3CAXQMA.js';
|
|
76
79
|
import './chunk-BOFL7GIF.js';
|
|
77
80
|
import './chunk-NSBPE2FW.js';
|
|
78
|
-
//# sourceMappingURL=project-
|
|
79
|
-
//# sourceMappingURL=project-
|
|
81
|
+
//# sourceMappingURL=project-GXCIEJGM.js.map
|
|
82
|
+
//# sourceMappingURL=project-GXCIEJGM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"project-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"project-GXCIEJGM.js"}
|
package/dist/resolver/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { buildRequiresPreamble, parseCompactionDirectives, parseSkillFrontmatter, parseSkillRequirements, validateConnectorRequirements, validateFlowVersions, validateRequirements } from '../chunk-USHB5KEY.js';
|
|
2
|
-
import '../chunk-
|
|
2
|
+
import '../chunk-OX2W5YF3.js';
|
|
3
3
|
import '../chunk-4GY63JU6.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-TYUJPQNX.js';
|
|
5
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
10
|
import '../chunk-IG5LZ3WU.js';
|
|
11
11
|
import '../chunk-IY5E7Y5W.js';
|