@skaile/workspaces 6.3.0 → 6.4.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 +22 -0
- package/dist/ai-sdk.js +28 -16
- package/dist/ai-sdk.js.map +1 -1
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-3YO2352Y.js → asset-feeds-UJSYGKCX.js} +19 -19
- package/dist/{asset-feeds-3YO2352Y.js.map → asset-feeds-UJSYGKCX.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +6 -6
- package/dist/asset-manager/index.js +11 -11
- package/dist/asset-manager/installer.js +7 -7
- package/dist/asset-manager/renderers.js +6 -6
- package/dist/asset-manager/src/index.d.ts +42 -15
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/asset-manager/src/install-instances.d.ts +2 -0
- package/dist/asset-manager/src/install-instances.d.ts.map +1 -1
- package/dist/asset-manager/src/installer.d.ts.map +1 -1
- package/dist/bridge/harnesses/claude-sdk.js +10 -10
- package/dist/bridge/harnesses/codex.js +8 -8
- package/dist/bridge/harnesses/continue.js +9 -9
- package/dist/bridge/harnesses/echo.js +4 -4
- package/dist/bridge/harnesses/gemini.js +5 -5
- package/dist/bridge/harnesses/goose.js +9 -9
- package/dist/bridge/harnesses/omp.js +6 -6
- package/dist/bridge/harnesses/opencode.js +9 -9
- package/dist/bridge/harnesses/qwen.js +5 -5
- package/dist/bridge/index.js +15 -15
- package/dist/bridge/src/ai-sdk.d.ts +5 -0
- package/dist/bridge/src/ai-sdk.d.ts.map +1 -1
- package/dist/bridge/src/harness-model-check.d.ts +11 -7
- package/dist/bridge/src/harness-model-check.d.ts.map +1 -1
- package/dist/{chunk-72NT2TJU.js → chunk-24D7IW5O.js} +6 -6
- package/dist/{chunk-72NT2TJU.js.map → chunk-24D7IW5O.js.map} +1 -1
- package/dist/{chunk-HH2H2ZV7.js → chunk-2WOA3TKK.js} +12 -12
- package/dist/chunk-2WOA3TKK.js.map +1 -0
- package/dist/{chunk-6WH2WE4B.js → chunk-3ENE6ZOF.js} +4 -4
- package/dist/{chunk-6WH2WE4B.js.map → chunk-3ENE6ZOF.js.map} +1 -1
- package/dist/{chunk-32FYVSSW.js → chunk-45KLCFQB.js} +5 -5
- package/dist/{chunk-32FYVSSW.js.map → chunk-45KLCFQB.js.map} +1 -1
- package/dist/{chunk-BPTWWKGF.js → chunk-5NHBLKKU.js} +3 -3
- package/dist/{chunk-BPTWWKGF.js.map → chunk-5NHBLKKU.js.map} +1 -1
- package/dist/{chunk-7MV3NHPT.js → chunk-5T3DTK7A.js} +41 -23
- package/dist/chunk-5T3DTK7A.js.map +1 -0
- package/dist/{chunk-XBQTXGY4.js → chunk-6WQGJF65.js} +18 -6
- package/dist/chunk-6WQGJF65.js.map +1 -0
- package/dist/{chunk-H622YULS.js → chunk-6X3GDPCB.js} +3 -3
- package/dist/{chunk-H622YULS.js.map → chunk-6X3GDPCB.js.map} +1 -1
- package/dist/{chunk-7QG2WRSN.js → chunk-76WSWPOB.js} +15 -7
- package/dist/{chunk-7QG2WRSN.js.map → chunk-76WSWPOB.js.map} +1 -1
- package/dist/{chunk-J5JRGBKK.js → chunk-ABVWUM2E.js} +27 -17
- package/dist/chunk-ABVWUM2E.js.map +1 -0
- package/dist/{chunk-V5BPDB4J.js → chunk-ACBL7X62.js} +3 -3
- package/dist/{chunk-V5BPDB4J.js.map → chunk-ACBL7X62.js.map} +1 -1
- package/dist/{chunk-VUJXZDCY.js → chunk-BOS7P2Y4.js} +3 -3
- package/dist/{chunk-VUJXZDCY.js.map → chunk-BOS7P2Y4.js.map} +1 -1
- package/dist/{chunk-PNUM7GUY.js → chunk-BUU2DLPC.js} +3 -3
- package/dist/{chunk-PNUM7GUY.js.map → chunk-BUU2DLPC.js.map} +1 -1
- package/dist/{chunk-PL52CI4U.js → chunk-BX7PSWJA.js} +4 -4
- package/dist/{chunk-PL52CI4U.js.map → chunk-BX7PSWJA.js.map} +1 -1
- package/dist/{chunk-URCJIV7T.js → chunk-C7TQARGC.js} +3 -3
- package/dist/{chunk-URCJIV7T.js.map → chunk-C7TQARGC.js.map} +1 -1
- package/dist/{chunk-E5NQRHEB.js → chunk-CK3CJSRY.js} +3 -3
- package/dist/{chunk-E5NQRHEB.js.map → chunk-CK3CJSRY.js.map} +1 -1
- package/dist/{chunk-4QRJBY2P.js → chunk-DCJ4BION.js} +2 -2
- package/dist/{chunk-4QRJBY2P.js.map → chunk-DCJ4BION.js.map} +1 -1
- package/dist/{chunk-HGOJEVHY.js → chunk-DF5WJC3Q.js} +4 -4
- package/dist/{chunk-HGOJEVHY.js.map → chunk-DF5WJC3Q.js.map} +1 -1
- package/dist/{chunk-QK7AG5AV.js → chunk-E237FGGX.js} +4 -4
- package/dist/{chunk-QK7AG5AV.js.map → chunk-E237FGGX.js.map} +1 -1
- package/dist/{chunk-ZEH4WFEG.js → chunk-EXRQKOY6.js} +11 -11
- package/dist/{chunk-ZEH4WFEG.js.map → chunk-EXRQKOY6.js.map} +1 -1
- package/dist/{chunk-QFFMFZIR.js → chunk-G63KOHFS.js} +3 -3
- package/dist/{chunk-QFFMFZIR.js.map → chunk-G63KOHFS.js.map} +1 -1
- package/dist/{chunk-Y3I4KGLX.js → chunk-GBXQFJ4G.js} +8 -8
- package/dist/{chunk-Y3I4KGLX.js.map → chunk-GBXQFJ4G.js.map} +1 -1
- package/dist/{chunk-6GWSDPBP.js → chunk-GTMANMBZ.js} +3 -3
- package/dist/{chunk-6GWSDPBP.js.map → chunk-GTMANMBZ.js.map} +1 -1
- package/dist/{chunk-YW4ASEUP.js → chunk-HSF665NV.js} +5 -5
- package/dist/{chunk-YW4ASEUP.js.map → chunk-HSF665NV.js.map} +1 -1
- package/dist/{chunk-LEJQAX7G.js → chunk-HXZ3FQQN.js} +14 -14
- package/dist/{chunk-LEJQAX7G.js.map → chunk-HXZ3FQQN.js.map} +1 -1
- package/dist/{chunk-ROVZCGTN.js → chunk-IYZAJ2J2.js} +16 -13
- package/dist/chunk-IYZAJ2J2.js.map +1 -0
- package/dist/{chunk-PHAMYCZH.js → chunk-IZV3HDVG.js} +5 -5
- package/dist/{chunk-PHAMYCZH.js.map → chunk-IZV3HDVG.js.map} +1 -1
- package/dist/{chunk-ELSGFI3I.js → chunk-JSWMRYLM.js} +3 -3
- package/dist/{chunk-ELSGFI3I.js.map → chunk-JSWMRYLM.js.map} +1 -1
- package/dist/{chunk-TSTRH4SM.js → chunk-L45IHRDH.js} +3 -3
- package/dist/{chunk-TSTRH4SM.js.map → chunk-L45IHRDH.js.map} +1 -1
- package/dist/{chunk-Q7CU5GQO.js → chunk-L4OYPFLB.js} +3 -3
- package/dist/{chunk-Q7CU5GQO.js.map → chunk-L4OYPFLB.js.map} +1 -1
- package/dist/{chunk-7TSNR5H5.js → chunk-O7KAQQAI.js} +4 -4
- package/dist/{chunk-7TSNR5H5.js.map → chunk-O7KAQQAI.js.map} +1 -1
- package/dist/{chunk-EQNIBBB6.js → chunk-P7EL7QRD.js} +14 -14
- package/dist/{chunk-EQNIBBB6.js.map → chunk-P7EL7QRD.js.map} +1 -1
- package/dist/{chunk-2TFKXSB5.js → chunk-PTBX55QF.js} +4 -4
- package/dist/{chunk-2TFKXSB5.js.map → chunk-PTBX55QF.js.map} +1 -1
- package/dist/{chunk-DU26AVK2.js → chunk-Q4XWCVFA.js} +7 -7
- package/dist/{chunk-DU26AVK2.js.map → chunk-Q4XWCVFA.js.map} +1 -1
- package/dist/{chunk-S6KZHPR4.js → chunk-QJQQNBVT.js} +2 -2
- package/dist/{chunk-S6KZHPR4.js.map → chunk-QJQQNBVT.js.map} +1 -1
- package/dist/{chunk-HDVLBEEX.js → chunk-QSIFEHSN.js} +3 -3
- package/dist/{chunk-HDVLBEEX.js.map → chunk-QSIFEHSN.js.map} +1 -1
- package/dist/{chunk-VUWRGMT6.js → chunk-RKI35EAN.js} +3 -3
- package/dist/{chunk-VUWRGMT6.js.map → chunk-RKI35EAN.js.map} +1 -1
- package/dist/{chunk-7RH6E332.js → chunk-SISUT7VR.js} +7 -7
- package/dist/{chunk-7RH6E332.js.map → chunk-SISUT7VR.js.map} +1 -1
- package/dist/{chunk-TGV2EWGL.js → chunk-TDKZL5ZC.js} +3 -3
- package/dist/{chunk-TGV2EWGL.js.map → chunk-TDKZL5ZC.js.map} +1 -1
- package/dist/{chunk-KIPCBIFJ.js → chunk-TF5CWJQZ.js} +5 -5
- package/dist/{chunk-KIPCBIFJ.js.map → chunk-TF5CWJQZ.js.map} +1 -1
- package/dist/{chunk-KGHYXXXV.js → chunk-TGB4E5Z6.js} +188 -52
- package/dist/chunk-TGB4E5Z6.js.map +1 -0
- package/dist/{chunk-AMJ6KEV7.js → chunk-TPQKFX6X.js} +4 -4
- package/dist/{chunk-AMJ6KEV7.js.map → chunk-TPQKFX6X.js.map} +1 -1
- package/dist/{chunk-KPKGWXUJ.js → chunk-U6S5CXKB.js} +3 -3
- package/dist/{chunk-KPKGWXUJ.js.map → chunk-U6S5CXKB.js.map} +1 -1
- package/dist/{chunk-JGH7NB47.js → chunk-UAOHR6AL.js} +4 -4
- package/dist/{chunk-JGH7NB47.js.map → chunk-UAOHR6AL.js.map} +1 -1
- package/dist/{chunk-COUJOTAJ.js → chunk-UBLZALKP.js} +3 -3
- package/dist/{chunk-COUJOTAJ.js.map → chunk-UBLZALKP.js.map} +1 -1
- package/dist/{chunk-BIRW3HOG.js → chunk-UUKCPPTQ.js} +3 -3
- package/dist/{chunk-BIRW3HOG.js.map → chunk-UUKCPPTQ.js.map} +1 -1
- package/dist/{chunk-TO5SSMRI.js → chunk-UVTN4O7N.js} +42 -17
- package/dist/chunk-UVTN4O7N.js.map +1 -0
- package/dist/{chunk-LD6O6QKU.js → chunk-V4OXHEWY.js} +3 -3
- package/dist/{chunk-LD6O6QKU.js.map → chunk-V4OXHEWY.js.map} +1 -1
- package/dist/{chunk-QTLUZUF2.js → chunk-VSCLUPGZ.js} +28 -26
- package/dist/chunk-VSCLUPGZ.js.map +1 -0
- package/dist/{chunk-JMIKGAUA.js → chunk-VV2DJT4I.js} +15 -5
- package/dist/chunk-VV2DJT4I.js.map +1 -0
- package/dist/{chunk-JCPD4QRM.js → chunk-VZU67OKK.js} +2 -2
- package/dist/{chunk-JCPD4QRM.js.map → chunk-VZU67OKK.js.map} +1 -1
- package/dist/{chunk-XEVFSDIF.js → chunk-WENTJ5KP.js} +4 -4
- package/dist/{chunk-XEVFSDIF.js.map → chunk-WENTJ5KP.js.map} +1 -1
- package/dist/{chunk-MD3FUZS3.js → chunk-YFGXYQW4.js} +3 -3
- package/dist/{chunk-MD3FUZS3.js.map → chunk-YFGXYQW4.js.map} +1 -1
- package/dist/{chunk-MYXFR27L.js → chunk-YJNE4V2M.js} +16 -9
- package/dist/chunk-YJNE4V2M.js.map +1 -0
- package/dist/{chunk-RFQONXET.js → chunk-ZWCGJYR7.js} +3 -3
- package/dist/{chunk-RFQONXET.js.map → chunk-ZWCGJYR7.js.map} +1 -1
- package/dist/{claude-code-EUKDGOOO.js → claude-code-UBT4ZME7.js} +4 -4
- package/dist/{claude-code-EUKDGOOO.js.map → claude-code-UBT4ZME7.js.map} +1 -1
- package/dist/cli/index.js +103 -89
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/library-index.d.ts.map +1 -1
- package/dist/cli/src/commands/plugin-registry-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/preset-cmd.d.ts.map +1 -1
- package/dist/cli/src/helpers.d.ts +10 -2
- 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.map +1 -1
- package/dist/cli/src/plugin-store/spec.d.ts +19 -14
- package/dist/cli/src/plugin-store/spec.d.ts.map +1 -1
- package/dist/cli/src/setup.d.ts.map +1 -1
- package/dist/connectors/config.js +4 -4
- package/dist/connectors/index.js +19 -19
- package/dist/{connectors-XYPE2DCQ.js → connectors-4WH32NK2.js} +22 -22
- package/dist/{connectors-XYPE2DCQ.js.map → connectors-4WH32NK2.js.map} +1 -1
- package/dist/connectors-shared/index.js +2 -2
- package/dist/core/index.js +5 -5
- package/dist/core/manifest.js +1 -1
- package/dist/core/publish-manifest.js +2 -2
- package/dist/core/runtime-assets.js +4 -4
- package/dist/core/src/index.d.ts +1 -1
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/lock.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/workspace-config.d.ts +15 -0
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/src/workspace-yaml-editor.d.ts.map +1 -1
- package/dist/core/workspace-config.js +3 -3
- package/dist/deploy/index.js +5 -5
- package/dist/discovery/index.js +3 -3
- package/dist/{ensure-sources-IN3VKHUA.js → ensure-sources-UC2RBYMP.js} +24 -24
- package/dist/{ensure-sources-IN3VKHUA.js.map → ensure-sources-UC2RBYMP.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +19 -19
- package/dist/factory-assets/connectors/deploy.js +19 -19
- package/dist/factory-assets/connectors/devserver.js +19 -19
- package/dist/factory-assets/connectors/flow/adapter.js +19 -19
- package/dist/factory-assets/connectors/flow/engine.js +6 -6
- package/dist/factory-assets/connectors/flow/run-flow.js +21 -21
- package/dist/factory-assets/connectors/flow.js +19 -19
- package/dist/factory-assets/connectors/git.js +19 -19
- package/dist/factory-assets/connectors/gmail.js +19 -19
- package/dist/factory-assets/connectors/googledrive.js +19 -19
- package/dist/factory-assets/connectors/local.js +19 -19
- package/dist/factory-assets/connectors/mattermost.js +19 -19
- package/dist/factory-assets/connectors/memory.js +19 -19
- package/dist/factory-assets/connectors/minio.js +19 -19
- package/dist/factory-assets/connectors/postgres.js +19 -19
- package/dist/factory-assets/connectors/s3.js +19 -19
- package/dist/factory-assets/connectors/sharepoint.js +19 -19
- package/dist/factory-assets/connectors/sqlite.js +19 -19
- package/dist/factory-assets/connectors/static-server.js +19 -19
- package/dist/factory-assets/connectors/tunnel.js +19 -19
- package/dist/factory-assets/connectors/webdav.js +19 -19
- package/dist/factory-assets/connectors/xstate-store.js +19 -19
- package/dist/factory-assets/connectors/xstate.js +19 -19
- package/dist/{flows-QAO63TDV.js → flows-LYTKNGKE.js} +10 -10
- package/dist/{flows-QAO63TDV.js.map → flows-LYTKNGKE.js.map} +1 -1
- package/dist/{helpers-HDVGCF3M.js → helpers-SSSKT5XK.js} +24 -24
- package/dist/{helpers-HDVGCF3M.js.map → helpers-SSSKT5XK.js.map} +1 -1
- package/dist/library/index.js +8 -8
- package/dist/library/install.js +3 -3
- package/dist/{library-publish-62OWCNB5.js → library-publish-GQMNTAKK.js} +48 -48
- package/dist/{library-publish-62OWCNB5.js.map → library-publish-GQMNTAKK.js.map} +1 -1
- package/dist/model-endpoint/index.js +8 -8
- package/dist/{open-library-TZ7OSDEJ.js → open-library-XGUCUJYE.js} +27 -27
- package/dist/{open-library-TZ7OSDEJ.js.map → open-library-XGUCUJYE.js.map} +1 -1
- package/dist/{open-registry-RLZKTJG3.js → open-registry-DIFEPDF6.js} +12 -12
- package/dist/{open-registry-RLZKTJG3.js.map → open-registry-DIFEPDF6.js.map} +1 -1
- package/dist/{paths-D6LBQETQ.js → paths-G4GFJLE2.js} +8 -8
- package/dist/{paths-D6LBQETQ.js.map → paths-G4GFJLE2.js.map} +1 -1
- package/dist/{plugin-store-A5J4TLCH.js → plugin-store-BBLDFD3L.js} +8 -8
- package/dist/{plugin-store-A5J4TLCH.js.map → plugin-store-BBLDFD3L.js.map} +1 -1
- package/dist/{project-4AVRES3M.js → project-LB745WVZ.js} +44 -44
- package/dist/{project-4AVRES3M.js.map → project-LB745WVZ.js.map} +1 -1
- package/dist/resolver/index.js +6 -6
- package/dist/runner/index.js +34 -34
- package/dist/runner/src/capability-roundtrip.d.ts +4 -1
- package/dist/runner/src/capability-roundtrip.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +11 -11
- package/dist/sdk/bridge.js +15 -15
- package/dist/sdk/core.js +5 -5
- package/dist/sdk/flow.js +6 -6
- package/dist/sdk/index.js +34 -34
- package/dist/sdk/resolver.js +6 -6
- package/dist/sdk/runner.js +34 -34
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/transport/ws/server.js +6 -6
- package/dist/sdk/transport/ws.js +6 -6
- package/dist/sdk/transport.js +6 -6
- package/dist/sdk/types.js +1 -1
- package/dist/{serve-preflight-H2AYMGJ6.js → serve-preflight-NPWI4MV6.js} +25 -25
- package/dist/{serve-preflight-H2AYMGJ6.js.map → serve-preflight-NPWI4MV6.js.map} +1 -1
- package/dist/session/index.js +2 -2
- package/dist/{setup-NSPQD4V4.js → setup-X6ZYH2MW.js} +30 -27
- package/dist/setup-X6ZYH2MW.js.map +1 -0
- package/dist/{skills-B533SRVZ.js → skills-62PXDBPJ.js} +11 -11
- package/dist/{skills-B533SRVZ.js.map → skills-62PXDBPJ.js.map} +1 -1
- package/dist/{source-VTECABUO.js → source-LAYCTRHP.js} +44 -44
- package/dist/{source-VTECABUO.js.map → source-LAYCTRHP.js.map} +1 -1
- package/dist/{source-manifest-publish-YORI42MN.js → source-manifest-publish-3S6PJ25W.js} +46 -46
- package/dist/{source-manifest-publish-YORI42MN.js.map → source-manifest-publish-3S6PJ25W.js.map} +1 -1
- package/dist/transport/index.js +6 -6
- package/dist/transport/ws/server.js +6 -6
- package/dist/transport/ws.js +6 -6
- package/dist/tui/index.js +34 -34
- package/dist/types/index.js +1 -1
- package/dist/types/src/capabilities.d.ts +9 -1
- package/dist/types/src/capabilities.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +26 -26
- package/dist/workspace-plugin/adapters/omp.js +14 -14
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-7MV3NHPT.js.map +0 -1
- package/dist/chunk-HH2H2ZV7.js.map +0 -1
- package/dist/chunk-J5JRGBKK.js.map +0 -1
- package/dist/chunk-JMIKGAUA.js.map +0 -1
- package/dist/chunk-KGHYXXXV.js.map +0 -1
- package/dist/chunk-MYXFR27L.js.map +0 -1
- package/dist/chunk-QTLUZUF2.js.map +0 -1
- package/dist/chunk-ROVZCGTN.js.map +0 -1
- package/dist/chunk-TO5SSMRI.js.map +0 -1
- package/dist/chunk-XBQTXGY4.js.map +0 -1
- package/dist/setup-NSPQD4V4.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { registryCredentialEnv, providerCredentialEnvName, BUILTIN_HARNESS_CATALOG } from './chunk-
|
|
1
|
+
import { registryCredentialEnv, providerCredentialEnvName, BUILTIN_HARNESS_CATALOG } from './chunk-QJQQNBVT.js';
|
|
2
2
|
import { getProviderPreset } from './chunk-6UP2EDFN.js';
|
|
3
3
|
import { mergeRegistries, resolveEntryBaseUrl, normalizeEntryBaseUrl, registryEntries, isEntryEnabled, parseModelRef } from './chunk-RXGPFAMN.js';
|
|
4
4
|
|
|
@@ -138,5 +138,5 @@ function continueRoleBinding(session) {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
export { bindSingleProviderEntry, continueRoleBinding, credentialsForEveryProvider, entryBaseUrl, entryModelIds, entrySurface, harnessModelSelector, harnessProviderName, isStockCatalogEndpoint, registryModelEntries, resolveEnvHarnessSession, resolveRegistryBinding, selectableEntries, versionedAnthropicBaseUrl };
|
|
141
|
-
//# sourceMappingURL=chunk-
|
|
142
|
-
//# sourceMappingURL=chunk-
|
|
141
|
+
//# sourceMappingURL=chunk-6X3GDPCB.js.map
|
|
142
|
+
//# sourceMappingURL=chunk-6X3GDPCB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../bridge/src/provider-materialize/env-harnesses.ts"],"names":[],"mappings":";;;;;AAyEO,SAAS,wBAAA,CACd,MAAA,EACA,UAAA,GAAiD,OAAA,CAAQ,GAAA,EACtC;AACnB,EAAA,OA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,EAA6D;AAC/F,EAAA,MAAM,OAAA,GAAU,uBAAuB,OAAO,CAAA;AAC9C,EAAA,IAAI,CAAC,SAAS,OAAO,MAAA;AACrB,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,MAAA;AAAA,IACN,YAAY,OAAA,CAAQ,UAAA;AAAA,IACpB,UAAU,OAAA,CAAQ,iBAAA;AAAA,IAClB,GAAI,QAAQ,eAAA,GAAkB,EAAE,OAAO,OAAA,CAAQ,eAAA,KAAoB,EAAC;AAAA,IACpE,GAAI,OAAA,CAAQ,OAAA,GACR,EAAE,OAAA,EAAS,yBAAA,CAA0B,OAAA,CAAQ,OAAA,EAAS,OAAA,CAAQ,OAAO,CAAA,EAAE,GACvE,EAAC;AAAA,IACL,SAAA,EAAW,yBAAA,CAA0B,OAAA,CAAQ,UAAU;AAAA,GACzD;AACF","file":"chunk-H622YULS.js","sourcesContent":["/**\n * Registry adapter for the **env-shaped CLI harnesses** — Gemini, Qwen, OpenCode,\n * Goose and Continue (§2.3).\n *\n * These harnesses take their endpoint from the environment rather than from a\n * config file, so the adapter's job is three things: resolve which registry\n * entry the session's model selector names, refuse at start when that entry\n * speaks a wire surface the harness cannot, and hand the harness the\n * provider-side model id it must put on the command line.\n *\n * Two pluralities meet here (`BUILTIN_HARNESS_CATALOG.providerPlurality`):\n *\n * - `single` — Gemini and Qwen address exactly one endpoint. The bound entry\n * supplies the credential *and* the base URL, and a surface mismatch is\n * fatal: a Gemini CLI pointed at an `openai-completions` endpoint cannot\n * work, and failing at start names the surface instead of leaving the user\n * with an opaque error mid-turn.\n * - `credentials-n` — OpenCode, Goose and Continue accept every enabled\n * entry's credential at once and select one active model. The credential\n * fan-out is `registryCredentialEnv`; the active model is this module's\n * `<provider>/<model>` binding.\n *\n * Writing the per-endpoint config files those three need for *custom*\n * endpoints (`opencode.json`, Goose `custom_providers/*.json`, Continue\n * `config.yaml`) is the file half, and is deliberately not here.\n *\n * @see PROVIDER-CONFIG-PLAN.md §2.3\n */\n\nimport {\n type AIProviderLlmEntry,\n type AIProviderSurface,\n isEntryEnabled,\n type MergedAIProviderRegistry,\n mergeRegistries,\n normalizeEntryBaseUrl,\n parseModelRef,\n registryEntries,\n resolveEntryBaseUrl,\n} from \"@skaile/workspaces/core/provider-registry\";\nimport type { ModelEntry } from \"../models.js\";\nimport { getProviderPreset } from \"../provider-catalog.js\";\nimport { BUILTIN_HARNESS_CATALOG } from \"../registry.js\";\nimport type { AgentConfig } from \"../types.js\";\nimport { providerCredentialEnvName, registryCredentialEnv } from \"./credential-env.js\";\n\n/**\n * Everything a CLI harness needs to know about this session's AI providers,\n * resolved once from its {@link AgentConfig}.\n */\nexport interface EnvHarnessSession {\n /** The merged registry this session may address. Empty when none was configured. */\n registry: MergedAIProviderRegistry;\n /**\n * Environment `credential.ref` lookups resolve against — the process\n * environment widened with `config.env`, which is where the session\n * boundary delivered every resolved `SKAILE_AIP_<ID>_KEY`.\n */\n lookupEnv: Record<string, string | undefined>;\n /** Model selector: `<providerId>/<modelId>`, a bare id, or `@role`. */\n modelRef?: string;\n /** Roles table an `@role` selector resolves through. */\n roles?: Record<string, string>;\n}\n\n/**\n * Resolve the session's providers once, from its {@link AgentConfig}.\n *\n * `config.env` is folded into `lookupEnv` rather than kept apart: it is part\n * of the session's environment, not an extra, and a credential or\n * `*_BASE_URL` delivered there must be visible exactly as the child will see\n * it.\n */\nexport function resolveEnvHarnessSession(\n config: AgentConfig,\n processEnv: Record<string, string | undefined> = process.env,\n): EnvHarnessSession {\n return {\n registry: config.registry ?? mergeRegistries([]),\n lookupEnv: { ...processEnv, ...config.env },\n ...(config.modelRef ? { modelRef: config.modelRef } : {}),\n ...(config.roles ? { roles: config.roles } : {}),\n };\n}\n\n/** One resolved endpoint + model — everything a harness needs to spawn. */\nexport interface RegistryModelBinding {\n /** Registry id of the selected entry. */\n providerId: string;\n /** The selected entry itself. */\n entry: AIProviderLlmEntry;\n /** Logical model id, after `@role` expansion and before `model_map`. */\n modelId?: string;\n /** Provider-side model id — what goes on the wire / command line. */\n providerModelId?: string;\n /** Wire protocol, from the entry or its preset. */\n surface?: AIProviderSurface;\n /** Resolved endpoint, from the entry, its transport params, or its preset. */\n baseUrl?: string;\n /**\n * The provider name the *harness* knows this endpoint by — a catalog preset\n * id for a stock endpoint, the registry id for anything custom. See\n * {@link harnessProviderName}.\n */\n harnessProviderId: string;\n /** Non-fatal notes from `parseModelRef` (dangling role, disabled provider). */\n warnings: string[];\n}\n\n/** The entry's wire surface: its own, else its preset's. */\nexport function entrySurface(entry: AIProviderLlmEntry): AIProviderSurface | undefined {\n if (entry.surface) return entry.surface;\n return entry.preset ? getProviderPreset(entry.preset)?.surface : undefined;\n}\n\n/**\n * The entry's endpoint: its literal or transport-derived URL, else its\n * preset's literal, in the canonical spelling for its surface\n * (`normalizeEntryBaseUrl`: an `anthropic-messages` endpoint is its host root,\n * so `https://api.anthropic.com/v1` reads as `https://api.anthropic.com`).\n * Transport templates that still carry `{param}` placeholders never come\n * back — `resolveEntryBaseUrl` withholds those, and a preset's template is not\n * a URL.\n *\n * Every adapter reads the endpoint here and only re-spells it for a client\n * that wants something else ({@link versionedAnthropicBaseUrl}).\n */\nexport function entryBaseUrl(entry: AIProviderLlmEntry): string | undefined {\n const resolved =\n resolveEntryBaseUrl(entry) ??\n (entry.preset ? getProviderPreset(entry.preset)?.base_url : undefined);\n return normalizeEntryBaseUrl(resolved, entrySurface(entry));\n}\n\n/**\n * An `anthropic-messages` endpoint spelled for a client that appends only\n * `/messages` — `@ai-sdk/anthropic` (OpenCode) and Continue — rather than\n * `/v1/messages` like the Claude CLI, the Anthropic SDK and Goose. `baseUrl`\n * must already be canonical ({@link entryBaseUrl}); every other surface passes\n * through unchanged.\n */\nexport function versionedAnthropicBaseUrl(\n baseUrl: string,\n surface: AIProviderSurface | undefined,\n): string {\n if (surface !== \"anthropic-messages\") return baseUrl;\n // Append to the path, not the string: a query or fragment stays at the end.\n try {\n const url = new URL(baseUrl);\n url.pathname = `${url.pathname.replace(/\\/+$/, \"\")}/v1`;\n return url.toString();\n } catch {\n return `${baseUrl}/v1`;\n }\n}\n\n/**\n * True when a `credentials-n` harness already knows this endpoint under its\n * own catalog name — the entry names a preset and did not move it somewhere\n * else. Both sides are compared canonically, so `https://api.anthropic.com/v1`\n * is still the `anthropic` preset's endpoint.\n *\n * The one rule both halves of §2.3 read: it decides the name the env half\n * puts on the command line ({@link harnessProviderName}) *and* whether the\n * file half has to describe the endpoint at all. Reading it twice is what\n * keeps `-m <name>/<model>` and the generated provider file talking about the\n * same thing.\n */\nexport function isStockCatalogEndpoint(entry: AIProviderLlmEntry): boolean {\n const preset = entry.preset ? getProviderPreset(entry.preset) : undefined;\n if (!preset) return false;\n return entryBaseUrl(entry) === normalizeEntryBaseUrl(preset.base_url, entrySurface(entry));\n}\n\n/**\n * The provider name to give a `credentials-n` harness (`-m <name>/<model>`,\n * `GOOSE_PROVIDER`).\n *\n * A stock catalog endpoint is named by its preset, because that is the name\n * OpenCode's models.dev list and Goose's built-in provider table already use —\n * `prod-claude: {preset: anthropic}` is still Anthropic to them. An entry with\n * an endpoint of its own is named by its registry id: no built-in table knows\n * it, so the id is what its generated provider file is keyed by (the file half\n * of §2.3).\n */\nexport function harnessProviderName(providerId: string, entry: AIProviderLlmEntry): string {\n const preset = entry.preset ? getProviderPreset(entry.preset) : undefined;\n if (!preset || !isStockCatalogEndpoint(entry)) return providerId;\n return preset.id;\n}\n\n/**\n * Enabled `llm`/`embed` entries, in registry order. Also the set the file\n * adapters render (`opencode-config.ts`, `goose-custom-providers.ts`,\n * `continue-config-yaml.ts`): the env half and the file half must agree on\n * which entries exist before they can agree on what to call them.\n */\nexport function selectableEntries(\n registry: MergedAIProviderRegistry,\n): Array<[string, AIProviderLlmEntry]> {\n return registryEntries(registry).filter(\n (pair): pair is [string, AIProviderLlmEntry] =>\n (pair[1].kind === \"llm\" || pair[1].kind === \"embed\") && isEntryEnabled(pair[1]),\n );\n}\n\n/**\n * The provider-side model ids an entry declares, as `[logicalId, providerId]`\n * pairs in declaration order: every `model_map` entry, plus every\n * `capabilities` key the map does not rename.\n */\nexport function entryModelIds(entry: AIProviderLlmEntry): Array<[string, string]> {\n const logicalIds = [\n ...Object.keys(entry.model_map ?? {}),\n ...Object.keys(entry.capabilities ?? {}).filter((id) => !(id in (entry.model_map ?? {}))),\n ];\n return logicalIds.map((id) => [id, entry.model_map?.[id] ?? id]);\n}\n\nfunction describeBinding(\n providerId: string,\n entry: AIProviderLlmEntry,\n modelId: string | undefined,\n providerModelId: string | undefined,\n warnings: string[],\n): RegistryModelBinding {\n const surface = entrySurface(entry);\n const baseUrl = entryBaseUrl(entry);\n return {\n providerId,\n entry,\n ...(modelId === undefined ? {} : { modelId }),\n ...(providerModelId === undefined ? {} : { providerModelId }),\n ...(surface ? { surface } : {}),\n ...(baseUrl ? { baseUrl } : {}),\n harnessProviderId: harnessProviderName(providerId, entry),\n warnings,\n };\n}\n\n/**\n * Resolve the session's endpoint + model.\n *\n * With no selector the first entry in registry order wins and the harness\n * keeps its own default model — exactly what an absent `model` meant before\n * the registry existed. Returns `undefined` when no entry can serve a model\n * (an empty, fully-disabled or voice-only registry).\n */\nexport function resolveRegistryBinding(\n session: EnvHarnessSession,\n): RegistryModelBinding | undefined {\n const entries = selectableEntries(session.registry);\n if (entries.length === 0) return undefined;\n\n const selector = session.modelRef?.trim();\n if (!selector) {\n const [providerId, entry] = entries[0];\n return describeBinding(providerId, entry, undefined, undefined, []);\n }\n\n // A selector that is exactly an entry id names the endpoint and nothing\n // else: the harness keeps its own default model. `parseModelRef` would read\n // it as a bare *model* id and fall back to registry order.\n const named = entries.find(([id]) => id === selector);\n if (named) return describeBinding(named[0], named[1], undefined, undefined, []);\n\n const resolved = parseModelRef(selector, session.registry, session.roles);\n if (!resolved) return undefined;\n const match = entries.find(([id]) => id === resolved.providerId);\n if (!match) return undefined;\n return describeBinding(\n match[0],\n match[1],\n resolved.modelId,\n resolved.providerModelId,\n resolved.warnings,\n );\n}\n\n/**\n * Every credential a `credentials-n` harness may use: one variable per\n * enabled registry entry. OpenCode, Goose and Continue have always received\n * *all* of them, not just the selected endpoint's, because they route across\n * providers inside a single session.\n */\nexport function credentialsForEveryProvider(session: EnvHarnessSession): Record<string, string> {\n return registryCredentialEnv(session.registry, { env: session.lookupEnv });\n}\n\n/**\n * Throw when the bound entry speaks a wire surface this harness cannot.\n *\n * The message names the offending surface and lists the ones the harness does\n * speak (`BUILTIN_HARNESS_CATALOG[harnessId].surfaces`). An entry that declares\n * no surface and names no preset is not judged — there is nothing to compare.\n */\nexport function assertHarnessSpeaksSurface(\n harnessId: string,\n productName: string,\n binding: RegistryModelBinding,\n): void {\n const supported = BUILTIN_HARNESS_CATALOG[harnessId]?.surfaces;\n if (!supported || supported.length === 0) return;\n const surface = binding.surface;\n if (!surface || supported.includes(surface)) return;\n throw new Error(\n `${productName} cannot speak the '${surface}' surface of AI provider entry ` +\n `'${binding.providerId}'. ${productName} speaks: ${supported.join(\", \")}. ` +\n `Point this session's model at an entry with one of those surfaces, ` +\n `or run it on a harness that speaks '${surface}'.`,\n );\n}\n\n/**\n * The models a `credentials-n` harness can be pointed at, straight from the\n * registry: every enabled entry's mapped ids, namespaced the way the harness\n * takes them (`-m <provider>/<model>`).\n *\n * These harnesses have no model-list endpoint of their own — OpenCode reads\n * models.dev, Goose and Continue read their config — so the registry is the\n * only list that describes *this* session's reachable models, and it needs no\n * network call to produce.\n */\nexport function registryModelEntries(session: EnvHarnessSession): ModelEntry[] {\n const out: ModelEntry[] = [];\n const seen = new Set<string>();\n for (const [providerId, entry] of selectableEntries(session.registry)) {\n const harnessId = harnessProviderName(providerId, entry);\n const label = entry.label ?? providerId;\n for (const [logicalId, providerModelId] of entryModelIds(entry)) {\n const id = `${harnessId}/${providerModelId}`;\n if (seen.has(id)) continue;\n seen.add(id);\n out.push({ id, name: `${label} ${logicalId}` });\n }\n }\n return out;\n}\n\n/**\n * Resolve the binding and enforce the surface — what a `single`-plurality\n * harness does at start.\n *\n * The registry is authoritative: pointing the harness at an entry it cannot\n * speak throws rather than silently running somewhere else. `undefined` when\n * the session configured no endpoint at all, which leaves the harness on its\n * own native auth.\n */\nexport function bindSingleProviderEntry(\n harnessId: string,\n productName: string,\n session: EnvHarnessSession,\n): RegistryModelBinding | undefined {\n const binding = resolveRegistryBinding(session);\n if (!binding) return undefined;\n assertHarnessSpeaksSurface(harnessId, productName, binding);\n return binding;\n}\n\n/**\n * The `<provider>/<model>` selector a `credentials-n` harness takes on its\n * command line (`opencode -m`). `undefined` when no model was selected — the\n * harness then uses its own default rather than being handed a bare provider.\n */\nexport function harnessModelSelector(binding: RegistryModelBinding): string | undefined {\n if (!binding.providerModelId) return undefined;\n return `${binding.harnessProviderId}/${binding.providerModelId}`;\n}\n\n/**\n * Continue's model selection is a **role binding**, not a flag: `cn` has no\n * `--model` option (only `--config <slug>`), and its `config.yaml` binds each\n * model to roles (`chat`, `edit`, `apply`, …). This is the binding for the\n * role a headless `cn -p` turn runs as, and the shape its generated\n * `config.yaml` is rendered from.\n *\n * `apiKeyEnv` is a variable *name*: the secret travels in the child\n * environment, never in a rendered config.\n */\nexport interface ContinueRoleBinding {\n /** Continue role this model serves. A headless prompt is a `chat` turn. */\n role: \"chat\";\n /** Registry id of the entry. */\n providerId: string;\n /** Provider name Continue knows the endpoint by. */\n provider: string;\n /** Provider-side model id. */\n model?: string;\n /** Endpoint, when the entry states one, spelled the way Continue's `apiBase` wants it. */\n apiBase?: string;\n /** Env var holding the credential — the name, never the value. */\n apiKeyEnv: string;\n}\n\n/**\n * Map the session's chosen endpoint onto the Continue role a headless turn\n * runs as. `undefined` when the session configured no endpoint — `cn` then\n * runs against whatever its own `config.yaml` / Hub login provides.\n */\nexport function continueRoleBinding(session: EnvHarnessSession): ContinueRoleBinding | undefined {\n const binding = resolveRegistryBinding(session);\n if (!binding) return undefined;\n return {\n role: \"chat\",\n providerId: binding.providerId,\n provider: binding.harnessProviderId,\n ...(binding.providerModelId ? { model: binding.providerModelId } : {}),\n ...(binding.baseUrl\n ? { apiBase: versionedAnthropicBaseUrl(binding.baseUrl, binding.surface) }\n : {}),\n apiKeyEnv: providerCredentialEnvName(binding.providerId),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../bridge/src/provider-materialize/env-harnesses.ts"],"names":[],"mappings":";;;;;AAyEO,SAAS,wBAAA,CACd,MAAA,EACA,UAAA,GAAiD,OAAA,CAAQ,GAAA,EACtC;AACnB,EAAA,OAAO;AAAA,IACL,QAAA,EAAU,MAAA,CAAO,QAAA,IAAY,eAAA,CAAgB,EAAE,CAAA;AAAA,IAC/C,WAAW,EAAE,GAAG,UAAA,EAAY,GAAG,OAAO,GAAA,EAAI;AAAA,IAC1C,GAAI,OAAO,QAAA,GAAW,EAAE,UAAU,MAAA,CAAO,QAAA,KAAa,EAAC;AAAA,IACvD,GAAI,OAAO,KAAA,GAAQ,EAAE,OAAO,MAAA,CAAO,KAAA,KAAU;AAAC,GAChD;AACF;AA2BO,SAAS,aAAa,KAAA,EAA0D;AACrF,EAAA,IAAI,KAAA,CAAM,OAAA,EAAS,OAAO,KAAA,CAAM,OAAA;AAChC,EAAA,OAAO,MAAM,MAAA,GAAS,iBAAA,CAAkB,KAAA,CAAM,MAAM,GAAG,OAAA,GAAU,MAAA;AACnE;AAcO,SAAS,aAAa,KAAA,EAA+C;AAC1E,EAAA,MAAM,QAAA,GACJ,mBAAA,CAAoB,KAAK,CAAA,KACxB,KAAA,CAAM,SAAS,iBAAA,CAAkB,KAAA,CAAM,MAAM,CAAA,EAAG,QAAA,GAAW,MAAA,CAAA;AAC9D,EAAA,OAAO,qBAAA,CAAsB,QAAA,EAAU,YAAA,CAAa,KAAK,CAAC,CAAA;AAC5D;AASO,SAAS,yBAAA,CACd,SACA,OAAA,EACQ;AACR,EAAA,IAAI,OAAA,KAAY,sBAAsB,OAAO,OAAA;AAE7C,EAAA,IAAI;AACF,IAAA,MAAM,GAAA,GAAM,IAAI,GAAA,CAAI,OAAO,CAAA;AAC3B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SAAA,EAAW,aAAa,OAAO,CAAA;AAC1D,EAAA,OAAO,OAAA;AACT;AAOO,SAAS,qBAAqB,OAAA,EAAmD;AACtF,EAAA,IAAI,CAAC,OAAA,CAAQ,eAAA,EAAiB,OAAO,MAAA;AACrC,EAAA,OAAO,CAAA,EAAG,OAAA,CAAQ,iBAAiB,CAAA,CAAA,EAAI,QAAQ,eAAe,CAAA,CAAA;AAChE;AAgCO,SAAS,oBAAoB,OAAA,EAA6D;AAC/F,EAAA,MAAM,OAAA,GAAU,uBAAuB,OAAO,CAAA;AAC9C,EAAA,IAAI,CAAC,SAAS,OAAO,MAAA;AACrB,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,MAAA;AAAA,IACN,YAAY,OAAA,CAAQ,UAAA;AAAA,IACpB,UAAU,OAAA,CAAQ,iBAAA;AAAA,IAClB,GAAI,QAAQ,eAAA,GAAkB,EAAE,OAAO,OAAA,CAAQ,eAAA,KAAoB,EAAC;AAAA,IACpE,GAAI,OAAA,CAAQ,OAAA,GACR,EAAE,OAAA,EAAS,yBAAA,CAA0B,OAAA,CAAQ,OAAA,EAAS,OAAA,CAAQ,OAAO,CAAA,EAAE,GACvE,EAAC;AAAA,IACL,SAAA,EAAW,yBAAA,CAA0B,OAAA,CAAQ,UAAU;AAAA,GACzD;AACF","file":"chunk-6X3GDPCB.js","sourcesContent":["/**\n * Registry adapter for the **env-shaped CLI harnesses** — Gemini, Qwen, OpenCode,\n * Goose and Continue (§2.3).\n *\n * These harnesses take their endpoint from the environment rather than from a\n * config file, so the adapter's job is three things: resolve which registry\n * entry the session's model selector names, refuse at start when that entry\n * speaks a wire surface the harness cannot, and hand the harness the\n * provider-side model id it must put on the command line.\n *\n * Two pluralities meet here (`BUILTIN_HARNESS_CATALOG.providerPlurality`):\n *\n * - `single` — Gemini and Qwen address exactly one endpoint. The bound entry\n * supplies the credential *and* the base URL, and a surface mismatch is\n * fatal: a Gemini CLI pointed at an `openai-completions` endpoint cannot\n * work, and failing at start names the surface instead of leaving the user\n * with an opaque error mid-turn.\n * - `credentials-n` — OpenCode, Goose and Continue accept every enabled\n * entry's credential at once and select one active model. The credential\n * fan-out is `registryCredentialEnv`; the active model is this module's\n * `<provider>/<model>` binding.\n *\n * Writing the per-endpoint config files those three need for *custom*\n * endpoints (`opencode.json`, Goose `custom_providers/*.json`, Continue\n * `config.yaml`) is the file half, and is deliberately not here.\n *\n * @see PROVIDER-CONFIG-PLAN.md §2.3\n */\n\nimport {\n type AIProviderLlmEntry,\n type AIProviderSurface,\n isEntryEnabled,\n type MergedAIProviderRegistry,\n mergeRegistries,\n normalizeEntryBaseUrl,\n parseModelRef,\n registryEntries,\n resolveEntryBaseUrl,\n} from \"@skaile/workspaces/core/provider-registry\";\nimport type { ModelEntry } from \"../models.js\";\nimport { getProviderPreset } from \"../provider-catalog.js\";\nimport { BUILTIN_HARNESS_CATALOG } from \"../registry.js\";\nimport type { AgentConfig } from \"../types.js\";\nimport { providerCredentialEnvName, registryCredentialEnv } from \"./credential-env.js\";\n\n/**\n * Everything a CLI harness needs to know about this session's AI providers,\n * resolved once from its {@link AgentConfig}.\n */\nexport interface EnvHarnessSession {\n /** The merged registry this session may address. Empty when none was configured. */\n registry: MergedAIProviderRegistry;\n /**\n * Environment `credential.ref` lookups resolve against — the process\n * environment widened with `config.env`, which is where the session\n * boundary delivered every resolved `SKAILE_AIP_<ID>_KEY`.\n */\n lookupEnv: Record<string, string | undefined>;\n /** Model selector: `<providerId>/<modelId>`, a bare id, or `@role`. */\n modelRef?: string;\n /** Roles table an `@role` selector resolves through. */\n roles?: Record<string, string>;\n}\n\n/**\n * Resolve the session's providers once, from its {@link AgentConfig}.\n *\n * `config.env` is folded into `lookupEnv` rather than kept apart: it is part\n * of the session's environment, not an extra, and a credential or\n * `*_BASE_URL` delivered there must be visible exactly as the child will see\n * it.\n */\nexport function resolveEnvHarnessSession(\n config: AgentConfig,\n processEnv: Record<string, string | undefined> = process.env,\n): EnvHarnessSession {\n return {\n registry: config.registry ?? mergeRegistries([]),\n lookupEnv: { ...processEnv, ...config.env },\n ...(config.modelRef ? { modelRef: config.modelRef } : {}),\n ...(config.roles ? { roles: config.roles } : {}),\n };\n}\n\n/** One resolved endpoint + model — everything a harness needs to spawn. */\nexport interface RegistryModelBinding {\n /** Registry id of the selected entry. */\n providerId: string;\n /** The selected entry itself. */\n entry: AIProviderLlmEntry;\n /** Logical model id, after `@role` expansion and before `model_map`. */\n modelId?: string;\n /** Provider-side model id — what goes on the wire / command line. */\n providerModelId?: string;\n /** Wire protocol, from the entry or its preset. */\n surface?: AIProviderSurface;\n /** Resolved endpoint, from the entry, its transport params, or its preset. */\n baseUrl?: string;\n /**\n * The provider name the *harness* knows this endpoint by — a catalog preset\n * id for a stock endpoint, the registry id for anything custom. See\n * {@link harnessProviderName}.\n */\n harnessProviderId: string;\n /** Non-fatal notes from `parseModelRef` (dangling role, disabled provider). */\n warnings: string[];\n}\n\n/** The entry's wire surface: its own, else its preset's. */\nexport function entrySurface(entry: AIProviderLlmEntry): AIProviderSurface | undefined {\n if (entry.surface) return entry.surface;\n return entry.preset ? getProviderPreset(entry.preset)?.surface : undefined;\n}\n\n/**\n * The entry's endpoint: its literal or transport-derived URL, else its\n * preset's literal, in the canonical spelling for its surface\n * (`normalizeEntryBaseUrl`: an `anthropic-messages` endpoint is its host root,\n * so `https://api.anthropic.com/v1` reads as `https://api.anthropic.com`).\n * Transport templates that still carry `{param}` placeholders never come\n * back — `resolveEntryBaseUrl` withholds those, and a preset's template is not\n * a URL.\n *\n * Every adapter reads the endpoint here and only re-spells it for a client\n * that wants something else ({@link versionedAnthropicBaseUrl}).\n */\nexport function entryBaseUrl(entry: AIProviderLlmEntry): string | undefined {\n const resolved =\n resolveEntryBaseUrl(entry) ??\n (entry.preset ? getProviderPreset(entry.preset)?.base_url : undefined);\n return normalizeEntryBaseUrl(resolved, entrySurface(entry));\n}\n\n/**\n * An `anthropic-messages` endpoint spelled for a client that appends only\n * `/messages` — `@ai-sdk/anthropic` (OpenCode) and Continue — rather than\n * `/v1/messages` like the Claude CLI, the Anthropic SDK and Goose. `baseUrl`\n * must already be canonical ({@link entryBaseUrl}); every other surface passes\n * through unchanged.\n */\nexport function versionedAnthropicBaseUrl(\n baseUrl: string,\n surface: AIProviderSurface | undefined,\n): string {\n if (surface !== \"anthropic-messages\") return baseUrl;\n // Append to the path, not the string: a query or fragment stays at the end.\n try {\n const url = new URL(baseUrl);\n url.pathname = `${url.pathname.replace(/\\/+$/, \"\")}/v1`;\n return url.toString();\n } catch {\n return `${baseUrl}/v1`;\n }\n}\n\n/**\n * True when a `credentials-n` harness already knows this endpoint under its\n * own catalog name — the entry names a preset and did not move it somewhere\n * else. Both sides are compared canonically, so `https://api.anthropic.com/v1`\n * is still the `anthropic` preset's endpoint.\n *\n * The one rule both halves of §2.3 read: it decides the name the env half\n * puts on the command line ({@link harnessProviderName}) *and* whether the\n * file half has to describe the endpoint at all. Reading it twice is what\n * keeps `-m <name>/<model>` and the generated provider file talking about the\n * same thing.\n */\nexport function isStockCatalogEndpoint(entry: AIProviderLlmEntry): boolean {\n const preset = entry.preset ? getProviderPreset(entry.preset) : undefined;\n if (!preset) return false;\n return entryBaseUrl(entry) === normalizeEntryBaseUrl(preset.base_url, entrySurface(entry));\n}\n\n/**\n * The provider name to give a `credentials-n` harness (`-m <name>/<model>`,\n * `GOOSE_PROVIDER`).\n *\n * A stock catalog endpoint is named by its preset, because that is the name\n * OpenCode's models.dev list and Goose's built-in provider table already use —\n * `prod-claude: {preset: anthropic}` is still Anthropic to them. An entry with\n * an endpoint of its own is named by its registry id: no built-in table knows\n * it, so the id is what its generated provider file is keyed by (the file half\n * of §2.3).\n */\nexport function harnessProviderName(providerId: string, entry: AIProviderLlmEntry): string {\n const preset = entry.preset ? getProviderPreset(entry.preset) : undefined;\n if (!preset || !isStockCatalogEndpoint(entry)) return providerId;\n return preset.id;\n}\n\n/**\n * Enabled `llm`/`embed` entries, in registry order. Also the set the file\n * adapters render (`opencode-config.ts`, `goose-custom-providers.ts`,\n * `continue-config-yaml.ts`): the env half and the file half must agree on\n * which entries exist before they can agree on what to call them.\n */\nexport function selectableEntries(\n registry: MergedAIProviderRegistry,\n): Array<[string, AIProviderLlmEntry]> {\n return registryEntries(registry).filter(\n (pair): pair is [string, AIProviderLlmEntry] =>\n (pair[1].kind === \"llm\" || pair[1].kind === \"embed\") && isEntryEnabled(pair[1]),\n );\n}\n\n/**\n * The provider-side model ids an entry declares, as `[logicalId, providerId]`\n * pairs in declaration order: every `model_map` entry, plus every\n * `capabilities` key the map does not rename.\n */\nexport function entryModelIds(entry: AIProviderLlmEntry): Array<[string, string]> {\n const logicalIds = [\n ...Object.keys(entry.model_map ?? {}),\n ...Object.keys(entry.capabilities ?? {}).filter((id) => !(id in (entry.model_map ?? {}))),\n ];\n return logicalIds.map((id) => [id, entry.model_map?.[id] ?? id]);\n}\n\nfunction describeBinding(\n providerId: string,\n entry: AIProviderLlmEntry,\n modelId: string | undefined,\n providerModelId: string | undefined,\n warnings: string[],\n): RegistryModelBinding {\n const surface = entrySurface(entry);\n const baseUrl = entryBaseUrl(entry);\n return {\n providerId,\n entry,\n ...(modelId === undefined ? {} : { modelId }),\n ...(providerModelId === undefined ? {} : { providerModelId }),\n ...(surface ? { surface } : {}),\n ...(baseUrl ? { baseUrl } : {}),\n harnessProviderId: harnessProviderName(providerId, entry),\n warnings,\n };\n}\n\n/**\n * Resolve the session's endpoint + model.\n *\n * With no selector the first entry in registry order wins and the harness\n * keeps its own default model — exactly what an absent `model` meant before\n * the registry existed. Returns `undefined` when no entry can serve a model\n * (an empty, fully-disabled or voice-only registry).\n */\nexport function resolveRegistryBinding(\n session: EnvHarnessSession,\n): RegistryModelBinding | undefined {\n const entries = selectableEntries(session.registry);\n if (entries.length === 0) return undefined;\n\n const selector = session.modelRef?.trim();\n if (!selector) {\n const [providerId, entry] = entries[0];\n return describeBinding(providerId, entry, undefined, undefined, []);\n }\n\n // A selector that is exactly an entry id names the endpoint and nothing\n // else: the harness keeps its own default model. `parseModelRef` would read\n // it as a bare *model* id and fall back to registry order.\n const named = entries.find(([id]) => id === selector);\n if (named) return describeBinding(named[0], named[1], undefined, undefined, []);\n\n const resolved = parseModelRef(selector, session.registry, session.roles);\n if (!resolved) return undefined;\n const match = entries.find(([id]) => id === resolved.providerId);\n if (!match) return undefined;\n return describeBinding(\n match[0],\n match[1],\n resolved.modelId,\n resolved.providerModelId,\n resolved.warnings,\n );\n}\n\n/**\n * Every credential a `credentials-n` harness may use: one variable per\n * enabled registry entry. OpenCode, Goose and Continue have always received\n * *all* of them, not just the selected endpoint's, because they route across\n * providers inside a single session.\n */\nexport function credentialsForEveryProvider(session: EnvHarnessSession): Record<string, string> {\n return registryCredentialEnv(session.registry, { env: session.lookupEnv });\n}\n\n/**\n * Throw when the bound entry speaks a wire surface this harness cannot.\n *\n * The message names the offending surface and lists the ones the harness does\n * speak (`BUILTIN_HARNESS_CATALOG[harnessId].surfaces`). An entry that declares\n * no surface and names no preset is not judged — there is nothing to compare.\n */\nexport function assertHarnessSpeaksSurface(\n harnessId: string,\n productName: string,\n binding: RegistryModelBinding,\n): void {\n const supported = BUILTIN_HARNESS_CATALOG[harnessId]?.surfaces;\n if (!supported || supported.length === 0) return;\n const surface = binding.surface;\n if (!surface || supported.includes(surface)) return;\n throw new Error(\n `${productName} cannot speak the '${surface}' surface of AI provider entry ` +\n `'${binding.providerId}'. ${productName} speaks: ${supported.join(\", \")}. ` +\n `Point this session's model at an entry with one of those surfaces, ` +\n `or run it on a harness that speaks '${surface}'.`,\n );\n}\n\n/**\n * The models a `credentials-n` harness can be pointed at, straight from the\n * registry: every enabled entry's mapped ids, namespaced the way the harness\n * takes them (`-m <provider>/<model>`).\n *\n * These harnesses have no model-list endpoint of their own — OpenCode reads\n * models.dev, Goose and Continue read their config — so the registry is the\n * only list that describes *this* session's reachable models, and it needs no\n * network call to produce.\n */\nexport function registryModelEntries(session: EnvHarnessSession): ModelEntry[] {\n const out: ModelEntry[] = [];\n const seen = new Set<string>();\n for (const [providerId, entry] of selectableEntries(session.registry)) {\n const harnessId = harnessProviderName(providerId, entry);\n const label = entry.label ?? providerId;\n for (const [logicalId, providerModelId] of entryModelIds(entry)) {\n const id = `${harnessId}/${providerModelId}`;\n if (seen.has(id)) continue;\n seen.add(id);\n out.push({ id, name: `${label} ${logicalId}` });\n }\n }\n return out;\n}\n\n/**\n * Resolve the binding and enforce the surface — what a `single`-plurality\n * harness does at start.\n *\n * The registry is authoritative: pointing the harness at an entry it cannot\n * speak throws rather than silently running somewhere else. `undefined` when\n * the session configured no endpoint at all, which leaves the harness on its\n * own native auth.\n */\nexport function bindSingleProviderEntry(\n harnessId: string,\n productName: string,\n session: EnvHarnessSession,\n): RegistryModelBinding | undefined {\n const binding = resolveRegistryBinding(session);\n if (!binding) return undefined;\n assertHarnessSpeaksSurface(harnessId, productName, binding);\n return binding;\n}\n\n/**\n * The `<provider>/<model>` selector a `credentials-n` harness takes on its\n * command line (`opencode -m`). `undefined` when no model was selected — the\n * harness then uses its own default rather than being handed a bare provider.\n */\nexport function harnessModelSelector(binding: RegistryModelBinding): string | undefined {\n if (!binding.providerModelId) return undefined;\n return `${binding.harnessProviderId}/${binding.providerModelId}`;\n}\n\n/**\n * Continue's model selection is a **role binding**, not a flag: `cn` has no\n * `--model` option (only `--config <slug>`), and its `config.yaml` binds each\n * model to roles (`chat`, `edit`, `apply`, …). This is the binding for the\n * role a headless `cn -p` turn runs as, and the shape its generated\n * `config.yaml` is rendered from.\n *\n * `apiKeyEnv` is a variable *name*: the secret travels in the child\n * environment, never in a rendered config.\n */\nexport interface ContinueRoleBinding {\n /** Continue role this model serves. A headless prompt is a `chat` turn. */\n role: \"chat\";\n /** Registry id of the entry. */\n providerId: string;\n /** Provider name Continue knows the endpoint by. */\n provider: string;\n /** Provider-side model id. */\n model?: string;\n /** Endpoint, when the entry states one, spelled the way Continue's `apiBase` wants it. */\n apiBase?: string;\n /** Env var holding the credential — the name, never the value. */\n apiKeyEnv: string;\n}\n\n/**\n * Map the session's chosen endpoint onto the Continue role a headless turn\n * runs as. `undefined` when the session configured no endpoint — `cn` then\n * runs against whatever its own `config.yaml` / Hub login provides.\n */\nexport function continueRoleBinding(session: EnvHarnessSession): ContinueRoleBinding | undefined {\n const binding = resolveRegistryBinding(session);\n if (!binding) return undefined;\n return {\n role: \"chat\",\n providerId: binding.providerId,\n provider: binding.harnessProviderId,\n ...(binding.providerModelId ? { model: binding.providerModelId } : {}),\n ...(binding.baseUrl\n ? { apiBase: versionedAnthropicBaseUrl(binding.baseUrl, binding.surface) }\n : {}),\n apiKeyEnv: providerCredentialEnvName(binding.providerId),\n };\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { listHarnesses } from './chunk-
|
|
2
|
-
import { softDepName } from './chunk-
|
|
3
|
-
import { SKAILE_YAML_DEFAULT, resolveSkWorkspaceConfig } from './chunk-
|
|
1
|
+
import { listHarnesses } from './chunk-QJQQNBVT.js';
|
|
2
|
+
import { softDepName } from './chunk-TGB4E5Z6.js';
|
|
3
|
+
import { SKAILE_YAML_DEFAULT, resolveSkWorkspaceConfig } from './chunk-6WQGJF65.js';
|
|
4
4
|
import { SUPPORTED_HARNESSES } from './chunk-VTETQCR6.js';
|
|
5
5
|
import { existsSync, readdirSync, readFileSync } from 'fs';
|
|
6
6
|
import { homedir } from 'os';
|
|
@@ -133,6 +133,14 @@ function warnPlaceholderBodies(bodies, descriptions) {
|
|
|
133
133
|
function logInfo(msg) {
|
|
134
134
|
console.log(` ${pc.dim("\xB7")} ${msg}`);
|
|
135
135
|
}
|
|
136
|
+
var activeCommandPath;
|
|
137
|
+
function setActiveCommand(cmd) {
|
|
138
|
+
const names = [];
|
|
139
|
+
for (let c = cmd; c && c.parent; c = c.parent) {
|
|
140
|
+
names.unshift(c.name());
|
|
141
|
+
}
|
|
142
|
+
activeCommandPath = names.length > 0 ? names.join(" ") : void 0;
|
|
143
|
+
}
|
|
136
144
|
function nearestParentProject(dir) {
|
|
137
145
|
for (let up = path.dirname(dir); up !== dir; dir = up, up = path.dirname(dir)) {
|
|
138
146
|
if (existsSync(path.join(up, SKAILE_YAML_DEFAULT))) return up;
|
|
@@ -144,7 +152,7 @@ function logNoProject(projectDir) {
|
|
|
144
152
|
logErr(`No ${S.cmd("skaile.yaml")} found. Run ${S.cmd("skaile init")} to create one.`);
|
|
145
153
|
const parent = nearestParentProject(dir);
|
|
146
154
|
if (parent) {
|
|
147
|
-
const command = process.argv.slice(2).find((a) => !a.startsWith("-")) ?? "<command>";
|
|
155
|
+
const command = activeCommandPath ?? process.argv.slice(2).find((a) => !a.startsWith("-")) ?? "<command>";
|
|
148
156
|
logErr(
|
|
149
157
|
`${S.cmd(parent)} holds a ${S.cmd("skaile.yaml")}: run from there or put the option after the command name: ${S.cmd(`skaile ${command} --project-dir ${parent}`)}.`
|
|
150
158
|
);
|
|
@@ -277,6 +285,6 @@ function warnFilesOnlyDelegates(projectDir, target) {
|
|
|
277
285
|
);
|
|
278
286
|
}
|
|
279
287
|
|
|
280
|
-
export { KIND_COL_WIDTH, S, TARGET_DEFAULT_HINT, bareSoftDepName, colorRef, deferredWarnings, driverAliasOption, fitWidth, foldDriverFlag, formatRelativeTime, formatSoftDepAddPreview, formatSoftDepHint, formatSoftDepRemovePreview, formatSoftDepSection, friendlyHarnessError, harnessErrorNotes, kindColor, kindColorPad, logErr, logInfo, logNoProject, logOk, logWarn, logWarnErr, parseHarnessFilter, reportLegacyOmpCopies, requireProjectConfig, unknownHarnessMessage, unknownHarnessTargetMessage, warnFilesOnlyDelegates, warnPlaceholderBodies, warnStaleHarnessCopies };
|
|
281
|
-
//# sourceMappingURL=chunk-
|
|
282
|
-
//# sourceMappingURL=chunk-
|
|
288
|
+
export { KIND_COL_WIDTH, S, TARGET_DEFAULT_HINT, bareSoftDepName, colorRef, deferredWarnings, driverAliasOption, fitWidth, foldDriverFlag, formatRelativeTime, formatSoftDepAddPreview, formatSoftDepHint, formatSoftDepRemovePreview, formatSoftDepSection, friendlyHarnessError, harnessErrorNotes, kindColor, kindColorPad, logErr, logInfo, logNoProject, logOk, logWarn, logWarnErr, parseHarnessFilter, reportLegacyOmpCopies, requireProjectConfig, setActiveCommand, unknownHarnessMessage, unknownHarnessTargetMessage, warnFilesOnlyDelegates, warnPlaceholderBodies, warnStaleHarnessCopies };
|
|
289
|
+
//# sourceMappingURL=chunk-76WSWPOB.js.map
|
|
290
|
+
//# sourceMappingURL=chunk-76WSWPOB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../cli/src/harness-error.ts","../cli/src/helpers.ts"],"names":[],"mappings":";;;;;;;;;;AAWO,SAAS,sBAAsB,OAAA,EAAqC;AACzE,EAAA,MAAM,QAAQ,aAAA,EAAc,CAAE,IAAI,CAAC,CAAA,KAAM,EAAE,EAAE,CAAA;AAC7C,EAAA,IAAI,KAAA,CAAM,QAAA,CAAS,OAAO,CAAA,EAAG,OAAO,MAAA;AACpC,EAAA,OACE,CAAA,wBAAA,EAA2B,OAAO,CAAA,cAAA,EAAiB,KAAA,CAAM,IAAA,CAAK,IAAI,CAAC,CAAA,EAAA,EAChE,eAAe,CAAA,OAAA,EAAU,mBAAA,CAAoB,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA,CAAA;AAE9D;AAGA,IAAM,eAAA,GAAkB,+CAAA;AAWjB,SAAS,2BAAA,CACd,OAAA,EACA,KAAA,GAA2B,EAAC,EACpB;AACR,EAAA,MAAM,OAAA,GAAU,CAAC,GAAG,mBAAA,EAAqB,GAAG,KAAK,CAAA;AACjD,EAAA,MAAM,aAAa,aAAA,EAAc,CAAE,IAAI,CAAC,CAAA,KAAM,EAAE,EAAE,CAAA;AAClD,EAAA,OACE,CAAA,wBAAA,EAA2B,OAAO,CAAA,cAAA,EAAiB,OAAA,CAAQ,IAAA,CAAK,IAAI,CAAC,CAAA,yCAAA,EAC3B,UAAA,CAAW,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA,CAAA;AAEnE;AA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AS;AACxB,EAAA,MAAM,GAAA,GAAM,IAAA,CAAK,IAAA,CAAK,UAAA,EAAY,UAAU,eAAe,CAAA;AAC3D,EAAA,IAAI,KAAA;AACJ,EAAA,IAAI;AACF,IAAA,KAAA,GAAQ,WAAA,CAAY,GAAG,CAAA,CAAE,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,QAAA,CAAS,KAAK,CAAC,CAAA;AAAA,EAC1D,CAAA,CAAA,MAAQ;AACN,IAAA;AAAA,EACF;AACA,EAAA,MAAM,SAAA,GAAY,KAAA,CACf,MAAA,CAAO,CAAC,CAAA,KAAM;AACb,IAAA,IAAI;AACF,MAAA,OAAO,YAAA,CAAa,KAAK,IAAA,CAAK,GAAA,EAAK,CAAC,CAAA,EAAG,MAAM,CAAA,CAAE,QAAA,CAAS,gBAAgB,CAAA;AAAA,IAC1E,CAAA,CAAA,MAAQ;AACN,MAAA,OAAO,KAAA;AAAA,IACT;AAAA,EACF,CAAC,CAAA,CACA,GAAA,CAAI,CAAC,CAAA,KAAM,CAAA,CAAE,OAAA,CAAQ,OAAA,EAAS,EAAE,CAAC,CAAA,CACjC,IAAA,EAAK;AACR,EAAA,IAAI,SAAA,CAAU,WAAW,CAAA,EAAG;AAC5B,EAAA,OAAA;AAAA,IACE,CAAA,uCAAA,EAA0C,SAAA,CAAU,IAAA,CAAK,IAAI,CAAC,CAAA,wFAAA;AAAA,GAChE;AACF","file":"chunk-7QG2WRSN.js","sourcesContent":["import { listHarnesses } from \"@skaile/workspaces/bridge\";\nimport { SUPPORTED_HARNESSES } from \"@skaile/workspaces/core\";\nimport { Option } from \"commander\";\n\n/**\n * The refusal for a harness name nothing registers, or `undefined` when it is known. One check\n * for `run` (also with `--dry-run`, so the plan never names a harness the real run refuses),\n * `repl` and `config set harness` (p1022). Load the project's plugins first: a plugin's harness\n * counts. The line names the other command group's names too (p1753), see\n * {@link unknownHarnessTargetMessage}.\n */\nexport function unknownHarnessMessage(harness: string): string | undefined {\n const known = listHarnesses().map((d) => d.id);\n if (known.includes(harness)) return undefined;\n return (\n `Unknown agent harness: \"${harness}\". Available: ${known.join(\", \")}. ` +\n `${DEPLOY_COMMANDS} take: ${SUPPORTED_HARNESSES.join(\", \")}.`\n );\n}\n\n/** The commands that write harness files, so they take the harness targets only. */\nconst DEPLOY_COMMANDS = \"harness set, init --harness and add --harness\";\n\n/**\n * The refusal for a name that is no harness target, for the commands that deploy files\n * (`harness set`, `init --harness`, `add --harness`, `integration --harness`). Same wording as\n * {@link unknownHarnessMessage}: the list is the targets, and the line names the commands that\n * run a session and take every registered harness (p1753).\n *\n * @param harness - The name the user typed.\n * @param extra - Further names the command takes, such as `all`.\n */\nexport function unknownHarnessTargetMessage(\n harness: string,\n extra: readonly string[] = [],\n): string {\n const targets = [...SUPPORTED_HARNESSES, ...extra];\n const registered = listHarnesses().map((d) => d.id);\n return (\n `Unknown agent harness: \"${harness}\". Available: ${targets.join(\", \")}. ` +\n `run, repl and config set harness take: ${registered.join(\", \")}.`\n );\n}\n\nlet warnedDriverFlag = false;\n\n/** Print the `--driver` deprecation line to stderr, once per process. */\nexport function warnDriverFlagDeprecated(): void {\n if (warnedDriverFlag) return;\n warnedDriverFlag = true;\n console.error(\"--driver is deprecated; use --harness\");\n}\n\n/**\n * The hidden `--driver <name>` option every command with `--harness <name>` keeps for one\n * major release: an alias that sets the same value (`--harness` wins when both are given).\n */\nexport function driverAliasOption(): Option {\n return new Option(\"--driver <name>\", \"Deprecated alias of --harness\").hideHelp();\n}\n\n/**\n * Fold a parsed `--driver` alias into `harness`: when `--driver` was given, print the\n * deprecation line once and use its value unless `--harness` (or `fallback`, when neither\n * flag was given) already decided. Returns `opts` with `harness` set and `driver` removed.\n */\nexport function foldDriverFlag<T extends { harness?: string; driver?: string }>(\n opts: T,\n fallback?: string,\n): Omit<T, \"driver\"> & { harness?: string } {\n const { driver, ...rest } = opts;\n if (driver !== undefined) warnDriverFlagDeprecated();\n return { ...rest, harness: rest.harness ?? driver ?? fallback };\n}\n\n/**\n * Turn a harness-start/prompt failure into a friendly, actionable message when the\n * cause is a missing/unusable agent binary; otherwise return `null` so the caller\n * surfaces the raw error unchanged.\n *\n * The bridge classifies these as `category: \"config\"` and carries a `hint`, but the\n * shape reaching the CLI varies: omp's `start()` rejects with the raw spawn error\n * (`code === \"ENOENT\"`), while the subprocess CLI harnesses reject with the classified\n * `AgentError` attached under `.detail`. Duck-type across all of them.\n */\nexport function friendlyHarnessError(err: unknown): string | null {\n const e = err as\n | {\n code?: string;\n syscall?: string;\n message?: string;\n category?: string;\n hint?: string;\n detail?: { category?: string; hint?: string };\n }\n | null\n | undefined;\n if (!e) return null;\n\n // A missing binary is a *spawn* ENOENT (`syscall: \"spawn <bin>\"` / \"spawn … ENOENT\");\n // a bare ENOENT from connector/mount setup is a different failure, not the harness.\n const isSpawnEnoent =\n e.code === \"ENOENT\" &&\n (e.syscall?.startsWith(\"spawn\") === true || /^spawn .*ENOENT/.test(e.message ?? \"\"));\n const isConfig = e.category === \"config\" || e.detail?.category === \"config\";\n if (!isSpawnEnoent && !isConfig) return null;\n\n const hint = e.hint ?? e.detail?.hint;\n const base = hint ?? \"The configured agent binary is not installed or not on your PATH.\";\n return `${base}\\nTry a different harness with \\`--harness claude-sdk\\`.`;\n}\n\n/**\n * Lines that follow the single `✗` line of a failed turn: the classifier's hint\n * (or, for a rejected credential, a pointer at the key), and where the full\n * records are. The JSON records themselves are not printed on the terminal:\n * they live in the project's log database. The pointer names the session whose records\n * the failure left (`logSessionId`); a failure before any session started has none and\n * gets no pointer.\n */\nexport function harnessErrorNotes(err: unknown): string[] {\n const e = err as\n | {\n category?: string;\n hint?: string;\n logSessionId?: string;\n detail?: { category?: string; hint?: string };\n }\n | null\n | undefined;\n const notes: string[] = [];\n const category = e?.category ?? e?.detail?.category;\n const hint = e?.hint ?? e?.detail?.hint;\n if (hint && category !== \"config\") notes.push(hint);\n else if (category === \"auth\") notes.push(\"Check your API key or login.\");\n if (e?.logSessionId) {\n notes.push(`Full records: .skaile/logs.db (skaile session logs ${e.logSessionId}).`);\n }\n return notes;\n}\n","import { existsSync, readdirSync, readFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport path from \"node:path\";\nimport { softDepName } from \"@skaile/workspaces/asset-manager\";\nimport {\n type HarnessName,\n resolveSkWorkspaceConfig,\n SKAILE_YAML_DEFAULT,\n SUPPORTED_HARNESSES,\n} from \"@skaile/workspaces/core\";\nimport pc from \"picocolors\";\nimport { unknownHarnessTargetMessage } from \"./harness-error.ts\";\n\n/**\n * Terminal styling helpers used across all CLI commands.\n *\n * @docLink cli/dev-guide#helpers\n */\nexport const S = {\n brand: (s: string) => pc.cyan(pc.bold(s)),\n cmd: (s: string) => pc.cyan(s),\n heading: (s: string) => pc.bold(s),\n bold: (s: string) => pc.bold(s),\n dim: (s: string) => pc.dim(s),\n ok: (s: string) => pc.green(s),\n warn: (s: string) => pc.yellow(s),\n err: (s: string) => pc.red(s),\n label: (s: string) => pc.dim(s),\n rule: (w = 40) => pc.dim(\"─\".repeat(w)),\n};\n\nconst KIND_COLORS: Record<string, (s: string) => string> = {\n skill: pc.blue,\n agent: pc.magenta,\n prompt: pc.yellow,\n flow: pc.green,\n preset: pc.cyan,\n contract: pc.red,\n connector: pc.green,\n knowledge: pc.cyan,\n persona: pc.cyan,\n ruleset: pc.cyan,\n \"mcp-server\": pc.magenta,\n};\n\n/**\n * Fit a plain (ANSI-free) string into exactly `width` columns: truncate with a\n * trailing `…` when too long, pad with spaces when too short. Keeps fixed-width\n * columns from overflowing the row when a value (e.g. an asset name) is wider\n * than its budget.\n */\nexport function fitWidth(s: string, width: number): string {\n if (width <= 0) return \"\";\n if (s.length > width) return width === 1 ? \"…\" : `${s.slice(0, width - 1)}…`;\n return s.padEnd(width);\n}\n\n/** Color-code an asset kind string. */\nexport function kindColor(kind: string): string {\n const colorFn = KIND_COLORS[kind] ?? pc.dim;\n return colorFn(kind);\n}\n\n/**\n * Widest kind label (`mcp-server`); the default kind-column width fits it so\n * long kinds don't shove the rest of the row out of alignment.\n */\nexport const KIND_COL_WIDTH = 10;\n\n/**\n * Shared `--target` help suffix: with no flag, the manager deploys into the\n * harness the project is configured for (the harness `skaile config show`\n * resolves), and only then falls back to `claude-code`.\n */\nexport const TARGET_DEFAULT_HINT = \"default: the project's configured harness, else claude-code\";\n\n/**\n * Color-code an asset kind string fit to exactly `width` columns — pads short\n * kinds, truncates over-long ones (via {@link fitWidth}) so the column can never\n * overflow and break row alignment.\n */\nexport function kindColorPad(kind: string, width = KIND_COL_WIDTH): string {\n const colorFn = KIND_COLORS[kind] ?? pc.dim;\n return colorFn(fitWidth(kind, width));\n}\n\n/** Color-code a \"kind:name\" reference string. */\nexport function colorRef(ref: string): string {\n const colonIdx = ref.indexOf(\":\");\n if (colonIdx === -1) return ref;\n const kind = ref.slice(0, colonIdx);\n const rest = ref.slice(colonIdx);\n return `${kindColor(kind)}${rest}`;\n}\n\n/**\n * Print a success line prefixed with a green check mark.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logOk(msg: string) {\n console.log(` ${pc.green(\"✓\")} ${msg}`);\n}\n/**\n * Print an error line prefixed with a red cross to stderr.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logErr(msg: string) {\n console.error(` ${pc.red(\"✗\")} ${msg}`);\n}\n/**\n * Print a warning line prefixed with a yellow exclamation mark.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logWarn(msg: string) {\n console.log(` ${pc.yellow(\"!\")} ${msg}`);\n}\n/**\n * Like {@link logWarn}, on stderr: a warning about the run itself (an asset scan that stopped\n * early) that must not land in the output a script reads from stdout.\n *\n * @param msg - Message to display.\n */\nexport function logWarnErr(msg: string) {\n console.error(` ${pc.yellow(\"!\")} ${msg}`);\n}\n/**\n * One `!` line per deployed library asset whose body or description is still the untouched\n * `library create` scaffold: `validate` and the publish plan fail both, so `add`, `install` and\n * `update` name every placeholder they fail (p926).\n *\n * @param bodies - Canonical refs the asset manager reported as placeholder bodies.\n * @param descriptions - Canonical refs the asset manager reported as placeholder descriptions.\n */\nexport function warnPlaceholderBodies(\n bodies: readonly string[] | undefined,\n descriptions?: readonly string[],\n) {\n const refs = [...new Set([...(bodies ?? []), ...(descriptions ?? [])])];\n for (const ref of refs) {\n const parts = [\n ...(descriptions?.includes(ref) ? [\"description\"] : []),\n ...(bodies?.includes(ref) ? [\"body\"] : []),\n ];\n const both = parts.length > 1;\n logWarn(\n `${ref} ${parts.join(\" and \")} ${both ? \"are\" : \"is\"} still the scaffold placeholder; write ${both ? \"them\" : \"it\"} (\\`skaile validate\\` fails ${both ? \"them\" : \"it\"})`,\n );\n }\n}\n/**\n * Print an info line prefixed with a dim dot.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logInfo(msg: string) {\n console.log(` ${pc.dim(\"·\")} ${msg}`);\n}\n\n/** The nearest parent directory of `dir` that holds a `skaile.yaml`, or `undefined`. */\nfunction nearestParentProject(dir: string): string | undefined {\n for (let up = path.dirname(dir); up !== dir; dir = up, up = path.dirname(dir)) {\n if (existsSync(path.join(up, SKAILE_YAML_DEFAULT))) return up;\n }\n return undefined;\n}\n\n/**\n * Print the `No skaile.yaml found` line for `projectDir`, plus a second line naming the nearest\n * parent directory that holds a `skaile.yaml`, when there is one: skaile does not search parent\n * directories. The line shows `--project-dir` after the command name (`skaile list --project-dir\n * /x`), the only place the option is accepted (p1656).\n */\nexport function logNoProject(projectDir: string): void {\n const dir = path.resolve(projectDir);\n logErr(`No ${S.cmd(\"skaile.yaml\")} found. Run ${S.cmd(\"skaile init\")} to create one.`);\n const parent = nearestParentProject(dir);\n if (parent) {\n const command = process.argv.slice(2).find((a) => !a.startsWith(\"-\")) ?? \"<command>\";\n logErr(\n `${S.cmd(parent)} holds a ${S.cmd(\"skaile.yaml\")}: run from there or put the option after the command name: ${S.cmd(`skaile ${command} --project-dir ${parent}`)}.`,\n );\n }\n}\n\n/**\n * Stop a project command that has no usable project: print one `✗` line and exit 1, before\n * the command deploys, undeploys, locks or clones anything. Two causes: no `skaile.yaml` in\n * `projectDir` (`No skaile.yaml found`), or a `skaile.yaml` — project, app or user scope —\n * that does not parse (`<file> — parse error: …`, a duplicate key included). Without this a\n * broken file would read as \"nothing declared\" and `install` would undeploy every asset.\n *\n * Library-level commands (`library …`, `search`, `init`) have no project and do not call it.\n */\nexport function requireProjectConfig(\n projectDir: string,\n opts: { allowMissing?: boolean } = {},\n): void {\n const dir = path.resolve(projectDir);\n if (!existsSync(path.join(dir, SKAILE_YAML_DEFAULT))) {\n if (opts.allowMissing) return;\n logNoProject(dir);\n process.exit(1);\n }\n try {\n resolveSkWorkspaceConfig(dir);\n } catch (err) {\n logErr(err instanceof Error ? err.message : String(err));\n process.exit(1);\n }\n}\n\n/**\n * Hold warnings raised while a spinner animates and print them once it stops:\n * on a TTY a line written mid-spin is overwritten by the next frame. Pass\n * `push` as `AssetManager`'s `onLibraryCollision`, call `flush()` after\n * `spinner.stop(...)`. Warnings pushed after `flush()` print immediately.\n */\nexport function deferredWarnings(): { push: (msg: string) => void; flush: () => void } {\n const held: string[] = [];\n let live = false;\n return {\n push: (msg) => {\n if (live) logWarn(msg);\n else held.push(msg);\n },\n flush: () => {\n for (const msg of held.splice(0)) logWarn(msg);\n live = true;\n },\n };\n}\n\n/** Max stale copies of one harness named inline by {@link warnStaleHarnessCopies}. */\nconst STALE_COPY_LIST_MAX = 5;\n\n/**\n * Print one warning per harness whose project dir (`.claude/`, `.omp/`, `.codex/`) still holds\n * copies of tracked assets although the project deploys to another harness: after `skaile\n * harness set`, or when a project moved off the old default. Those copies are orphans: `remove`\n * / `clean` / `list` only look in the active harness dir. Nothing is deleted. Silent when there\n * are none.\n */\nexport function warnStaleHarnessCopies(am: {\n projectDir: string;\n harness: string;\n listStaleHarnessCopies(): Array<{ harness: HarnessName; path: string }>;\n}): void {\n let stale: Array<{ harness: HarnessName; path: string }>;\n try {\n stale = am.listStaleHarnessCopies();\n } catch {\n return; // advisory only — never fail the command\n }\n for (const harness of SUPPORTED_HARNESSES) {\n const rel = stale\n .filter((s) => s.harness === harness)\n .map((s) => path.relative(am.projectDir, s.path));\n if (rel.length === 0) continue;\n const dir = `${rel[0]?.split(path.sep)[0] ?? harness}/`;\n const shown = rel.slice(0, STALE_COPY_LIST_MAX).join(\", \");\n const more =\n rel.length > STALE_COPY_LIST_MAX ? `, +${rel.length - STALE_COPY_LIST_MAX} more` : \"\";\n logWarn(\n `Stale ${S.cmd(dir)} copies no longer managed (deploying to ${am.harness}): ${shown}${more}. ` +\n `Delete them once ${S.cmd(\"skaile install\")} has deployed to ${am.harness}, or pass ${S.cmd(`--target ${harness}`)} to keep using ${dir}.`,\n );\n }\n}\n\n/**\n * Bare asset name of a canonical soft-dep target ref (`@pub/name@ver` → `name`),\n * for compact rendering in `info` / `tree` / `why`. Delegates to the asset-manager\n * parser (the soft-dep read surface) so the two never diverge.\n */\nexport function bareSoftDepName(ref: string): string {\n return softDepName(ref);\n}\n\n/**\n * The report-only soft-dep hint line shared by the `add` no-TTY branch and the\n * `install` surface, so the two user-facing wordings can't drift. Appends a\n * runnable `skaile add` suffix only when the target has a parseable ref.\n */\nexport function formatSoftDepHint(edge: { from: string; to: string; toRef?: string }): string {\n const suffix = edge.toRef ? ` — run \\`skaile add ${edge.toRef}\\` to include it.` : \"\";\n return `${bareSoftDepName(edge.from)} references ${bareSoftDepName(edge.to)} (soft dependency)${suffix}`;\n}\n\n/**\n * Build the \"Soft dependencies (inferred)\" section for `skaile info`. Returns one\n * header line plus one line per soft-dep target, each marked `(soft)` to read\n * differently from a typed `requires`. Empty array when there are no soft deps,\n * so the caller prints nothing.\n */\nexport function formatSoftDepSection(targets: string[]): string[] {\n if (targets.length === 0) return [];\n const out = [` ${S.label(\"Soft dependencies (inferred)\")}:`];\n for (const t of targets) out.push(` ${S.dim(\"·\")} ${t} ${S.dim(\"(soft)\")}`);\n return out;\n}\n\n/**\n * Footer line previewing the soft deps that *adding* the highlighted asset would\n * reference (manage TUI). \"references\" + \"not auto-added\" makes clear the pull is\n * report-only. Empty string when there are no targets, so the caller clears.\n */\nexport function formatSoftDepAddPreview(name: string, targets: string[]): string {\n if (targets.length === 0) return \"\";\n return S.dim(`${name} references ${targets.join(\", \")} (soft dep, not auto-added)`);\n}\n\n/**\n * Footer line previewing the soft deps that *removing* the highlighted asset\n * would orphan (manage TUI) — symmetric with {@link formatSoftDepAddPreview}.\n * Empty string when nothing would be orphaned, so the caller clears.\n */\nexport function formatSoftDepRemovePreview(name: string, targets: string[]): string {\n if (targets.length === 0) return \"\";\n return S.dim(`removing ${name} would orphan ${targets.join(\", \")} (soft dep)`);\n}\n\n/** Format a Date as a human-readable relative time string (e.g. \"5m ago\"). */\nexport function formatRelativeTime(date: Date): string {\n const diff = Date.now() - date.getTime();\n const seconds = Math.floor(diff / 1000);\n if (seconds < 60) return \"just now\";\n const minutes = Math.floor(seconds / 60);\n if (minutes < 60) return `${minutes}m ago`;\n const hours = Math.floor(minutes / 60);\n if (hours < 24) return `${hours}h ago`;\n const days = Math.floor(hours / 24);\n return `${days}d ago`;\n}\n\n/** Name the old `~/.omp/<dir>` copies a global deploy replaced (omp reads `~/.omp/agent/<dir>`). */\nexport function reportLegacyOmpCopies(removed: string[], kept: string[] = []): void {\n for (const p of removed) {\n logInfo(\n S.dim(`removed the old omp copy ${p.replace(homedir(), \"~\")} (omp reads ~/.omp/agent)`),\n );\n }\n for (const p of kept) {\n logWarn(\n `${p.replace(homedir(), \"~\")} is an old omp location and skaile did not write this copy, so it was kept: delete it if you do not need it`,\n );\n }\n}\n\n/**\n * Parse a `--harness a,b` value into validated {@link HarnessName}s, exiting on\n * an unknown id. Returns `undefined` when the flag is absent (the caller then\n * resolves the full global harness set).\n */\nexport function parseHarnessFilter(raw: string | undefined): HarnessName[] | undefined {\n if (!raw) return undefined;\n const ids = raw\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n const out: HarnessName[] = [];\n for (const id of ids) {\n if (!(SUPPORTED_HARNESSES as string[]).includes(id)) {\n logErr(unknownHarnessTargetMessage(id));\n process.exit(1);\n }\n out.push(id as HarnessName);\n }\n return out.length > 0 ? out : undefined;\n}\n\n/** The sentence the agent renderer puts into a delegate sub-agent's file (`asset-manager` fragments). */\nconst SUB_AGENT_MARKER = \"You are a sub-agent:\";\n\n/**\n * One line when a Codex project holds delegate sub-agents. Codex does not load\n * `.codex/agents/*.toml` as spawnable agents (its `spawn_agent` has no `agent_type`), so the\n * delegate exists only as a file there and the orchestrator cannot call it (p428). A delegate is\n * found by the sentence the renderer writes into its file. Silent for every other harness.\n */\nexport function warnFilesOnlyDelegates(projectDir: string, target: string): void {\n if (target !== \"codex\") return;\n const dir = path.join(projectDir, \".codex\", \"skaile-agents\");\n let names: string[];\n try {\n names = readdirSync(dir).filter((f) => f.endsWith(\".md\"));\n } catch {\n return;\n }\n const delegates = names\n .filter((f) => {\n try {\n return readFileSync(path.join(dir, f), \"utf8\").includes(SUB_AGENT_MARKER);\n } catch {\n return false;\n }\n })\n .map((f) => f.replace(/\\.md$/, \"\"))\n .sort();\n if (delegates.length === 0) return;\n logWarn(\n `codex: delegate agents are files only (${delegates.join(\", \")}): Codex does not load .codex/agents as sub-agents, so the orchestrator cannot call them`,\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../cli/src/harness-error.ts","../cli/src/helpers.ts"],"names":[],"mappings":";;;;;;;;;;AAWO,SAAS,sBAAsB,OAAA,EAAqC;AACzE,EAAA,MAAM,QAAQ,aAAA,EAAc,CAAE,IAAI,CAAC,CAAA,KAAM,EAAE,EAAE,CAAA;AAC7C,EAAA,IAAI,KAAA,CAAM,QAAA,CAAS,OAAO,CAAA,EAAG,OAAO,MAAA;AACpC,EAAA,OACE,CAAA,wBAAA,EAA2B,OAAO,CAAA,cAAA,EAAiB,KAAA,CAAM,IAAA,CAAK,IAAI,CAAC,CAAA,EAAA,EAChE,eAAe,CAAA,OAAA,EAAU,m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CAAO,CAAC,CAAA,KAAM;AACb,IAAA,IAAI;AACF,MAAA,OAAO,YAAA,CAAa,KAAK,IAAA,CAAK,GAAA,EAAK,CAAC,CAAA,EAAG,MAAM,CAAA,CAAE,QAAA,CAAS,gBAAgB,CAAA;AAAA,IAC1E,CAAA,CAAA,MAAQ;AACN,MAAA,OAAO,KAAA;AAAA,IACT;AAAA,EACF,CAAC,CAAA,CACA,GAAA,CAAI,CAAC,CAAA,KAAM,CAAA,CAAE,OAAA,CAAQ,OAAA,EAAS,EAAE,CAAC,CAAA,CACjC,IAAA,EAAK;AACR,EAAA,IAAI,SAAA,CAAU,WAAW,CAAA,EAAG;AAC5B,EAAA,OAAA;AAAA,IACE,CAAA,uCAAA,EAA0C,SAAA,CAAU,IAAA,CAAK,IAAI,CAAC,CAAA,wFAAA;AAAA,GAChE;AACF","file":"chunk-76WSWPOB.js","sourcesContent":["import { listHarnesses } from \"@skaile/workspaces/bridge\";\nimport { SUPPORTED_HARNESSES } from \"@skaile/workspaces/core\";\nimport { Option } from \"commander\";\n\n/**\n * The refusal for a harness name nothing registers, or `undefined` when it is known. One check\n * for `run` (also with `--dry-run`, so the plan never names a harness the real run refuses),\n * `repl` and `config set harness` (p1022). Load the project's plugins first: a plugin's harness\n * counts. The line names the other command group's names too (p1753), see\n * {@link unknownHarnessTargetMessage}.\n */\nexport function unknownHarnessMessage(harness: string): string | undefined {\n const known = listHarnesses().map((d) => d.id);\n if (known.includes(harness)) return undefined;\n return (\n `Unknown agent harness: \"${harness}\". Available: ${known.join(\", \")}. ` +\n `${DEPLOY_COMMANDS} take: ${SUPPORTED_HARNESSES.join(\", \")}.`\n );\n}\n\n/** The commands that write harness files, so they take the harness targets only. */\nconst DEPLOY_COMMANDS = \"harness set, init --harness and add --harness\";\n\n/**\n * The refusal for a name that is no harness target, for the commands that deploy files\n * (`harness set`, `init --harness`, `add --harness`, `integration --harness`). Same wording as\n * {@link unknownHarnessMessage}: the list is the targets, and the line names the commands that\n * run a session and take every registered harness (p1753).\n *\n * @param harness - The name the user typed.\n * @param extra - Further names the command takes, such as `all`.\n */\nexport function unknownHarnessTargetMessage(\n harness: string,\n extra: readonly string[] = [],\n): string {\n const targets = [...SUPPORTED_HARNESSES, ...extra];\n const registered = listHarnesses().map((d) => d.id);\n return (\n `Unknown agent harness: \"${harness}\". Available: ${targets.join(\", \")}. ` +\n `run, repl and config set harness take: ${registered.join(\", \")}.`\n );\n}\n\nlet warnedDriverFlag = false;\n\n/** Print the `--driver` deprecation line to stderr, once per process. */\nexport function warnDriverFlagDeprecated(): void {\n if (warnedDriverFlag) return;\n warnedDriverFlag = true;\n console.error(\"--driver is deprecated; use --harness\");\n}\n\n/**\n * The hidden `--driver <name>` option every command with `--harness <name>` keeps for one\n * major release: an alias that sets the same value (`--harness` wins when both are given).\n */\nexport function driverAliasOption(): Option {\n return new Option(\"--driver <name>\", \"Deprecated alias of --harness\").hideHelp();\n}\n\n/**\n * Fold a parsed `--driver` alias into `harness`: when `--driver` was given, print the\n * deprecation line once and use its value unless `--harness` (or `fallback`, when neither\n * flag was given) already decided. Returns `opts` with `harness` set and `driver` removed.\n */\nexport function foldDriverFlag<T extends { harness?: string; driver?: string }>(\n opts: T,\n fallback?: string,\n): Omit<T, \"driver\"> & { harness?: string } {\n const { driver, ...rest } = opts;\n if (driver !== undefined) warnDriverFlagDeprecated();\n return { ...rest, harness: rest.harness ?? driver ?? fallback };\n}\n\n/**\n * Turn a harness-start/prompt failure into a friendly, actionable message when the\n * cause is a missing/unusable agent binary; otherwise return `null` so the caller\n * surfaces the raw error unchanged.\n *\n * The bridge classifies these as `category: \"config\"` and carries a `hint`, but the\n * shape reaching the CLI varies: omp's `start()` rejects with the raw spawn error\n * (`code === \"ENOENT\"`), while the subprocess CLI harnesses reject with the classified\n * `AgentError` attached under `.detail`. Duck-type across all of them.\n */\nexport function friendlyHarnessError(err: unknown): string | null {\n const e = err as\n | {\n code?: string;\n syscall?: string;\n message?: string;\n category?: string;\n hint?: string;\n detail?: { category?: string; hint?: string };\n }\n | null\n | undefined;\n if (!e) return null;\n\n // A missing binary is a *spawn* ENOENT (`syscall: \"spawn <bin>\"` / \"spawn … ENOENT\");\n // a bare ENOENT from connector/mount setup is a different failure, not the harness.\n const isSpawnEnoent =\n e.code === \"ENOENT\" &&\n (e.syscall?.startsWith(\"spawn\") === true || /^spawn .*ENOENT/.test(e.message ?? \"\"));\n const isConfig = e.category === \"config\" || e.detail?.category === \"config\";\n if (!isSpawnEnoent && !isConfig) return null;\n\n const hint = e.hint ?? e.detail?.hint;\n const base = hint ?? \"The configured agent binary is not installed or not on your PATH.\";\n return `${base}\\nTry a different harness with \\`--harness claude-sdk\\`.`;\n}\n\n/**\n * Lines that follow the single `✗` line of a failed turn: the classifier's hint\n * (or, for a rejected credential, a pointer at the key), and where the full\n * records are. The JSON records themselves are not printed on the terminal:\n * they live in the project's log database. The pointer names the session whose records\n * the failure left (`logSessionId`); a failure before any session started has none and\n * gets no pointer.\n */\nexport function harnessErrorNotes(err: unknown): string[] {\n const e = err as\n | {\n category?: string;\n hint?: string;\n logSessionId?: string;\n detail?: { category?: string; hint?: string };\n }\n | null\n | undefined;\n const notes: string[] = [];\n const category = e?.category ?? e?.detail?.category;\n const hint = e?.hint ?? e?.detail?.hint;\n if (hint && category !== \"config\") notes.push(hint);\n else if (category === \"auth\") notes.push(\"Check your API key or login.\");\n if (e?.logSessionId) {\n notes.push(`Full records: .skaile/logs.db (skaile session logs ${e.logSessionId}).`);\n }\n return notes;\n}\n","import { existsSync, readdirSync, readFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport path from \"node:path\";\nimport { softDepName } from \"@skaile/workspaces/asset-manager\";\nimport {\n type HarnessName,\n resolveSkWorkspaceConfig,\n SKAILE_YAML_DEFAULT,\n SUPPORTED_HARNESSES,\n} from \"@skaile/workspaces/core\";\nimport pc from \"picocolors\";\nimport { unknownHarnessTargetMessage } from \"./harness-error.ts\";\n\n/**\n * Terminal styling helpers used across all CLI commands.\n *\n * @docLink cli/dev-guide#helpers\n */\nexport const S = {\n brand: (s: string) => pc.cyan(pc.bold(s)),\n cmd: (s: string) => pc.cyan(s),\n heading: (s: string) => pc.bold(s),\n bold: (s: string) => pc.bold(s),\n dim: (s: string) => pc.dim(s),\n ok: (s: string) => pc.green(s),\n warn: (s: string) => pc.yellow(s),\n err: (s: string) => pc.red(s),\n label: (s: string) => pc.dim(s),\n rule: (w = 40) => pc.dim(\"─\".repeat(w)),\n};\n\nconst KIND_COLORS: Record<string, (s: string) => string> = {\n skill: pc.blue,\n agent: pc.magenta,\n prompt: pc.yellow,\n flow: pc.green,\n preset: pc.cyan,\n contract: pc.red,\n connector: pc.green,\n knowledge: pc.cyan,\n persona: pc.cyan,\n ruleset: pc.cyan,\n \"mcp-server\": pc.magenta,\n};\n\n/**\n * Fit a plain (ANSI-free) string into exactly `width` columns: truncate with a\n * trailing `…` when too long, pad with spaces when too short. Keeps fixed-width\n * columns from overflowing the row when a value (e.g. an asset name) is wider\n * than its budget.\n */\nexport function fitWidth(s: string, width: number): string {\n if (width <= 0) return \"\";\n if (s.length > width) return width === 1 ? \"…\" : `${s.slice(0, width - 1)}…`;\n return s.padEnd(width);\n}\n\n/** Color-code an asset kind string. */\nexport function kindColor(kind: string): string {\n const colorFn = KIND_COLORS[kind] ?? pc.dim;\n return colorFn(kind);\n}\n\n/**\n * Widest kind label (`mcp-server`); the default kind-column width fits it so\n * long kinds don't shove the rest of the row out of alignment.\n */\nexport const KIND_COL_WIDTH = 10;\n\n/**\n * Shared `--target` help suffix: with no flag, the manager deploys into the\n * harness the project is configured for (the harness `skaile config show`\n * resolves), and only then falls back to `claude-code`.\n */\nexport const TARGET_DEFAULT_HINT = \"default: the project's configured harness, else claude-code\";\n\n/**\n * Color-code an asset kind string fit to exactly `width` columns — pads short\n * kinds, truncates over-long ones (via {@link fitWidth}) so the column can never\n * overflow and break row alignment.\n */\nexport function kindColorPad(kind: string, width = KIND_COL_WIDTH): string {\n const colorFn = KIND_COLORS[kind] ?? pc.dim;\n return colorFn(fitWidth(kind, width));\n}\n\n/** Color-code a \"kind:name\" reference string. */\nexport function colorRef(ref: string): string {\n const colonIdx = ref.indexOf(\":\");\n if (colonIdx === -1) return ref;\n const kind = ref.slice(0, colonIdx);\n const rest = ref.slice(colonIdx);\n return `${kindColor(kind)}${rest}`;\n}\n\n/**\n * Print a success line prefixed with a green check mark.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logOk(msg: string) {\n console.log(` ${pc.green(\"✓\")} ${msg}`);\n}\n/**\n * Print an error line prefixed with a red cross to stderr.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logErr(msg: string) {\n console.error(` ${pc.red(\"✗\")} ${msg}`);\n}\n/**\n * Print a warning line prefixed with a yellow exclamation mark.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logWarn(msg: string) {\n console.log(` ${pc.yellow(\"!\")} ${msg}`);\n}\n/**\n * Like {@link logWarn}, on stderr: a warning about the run itself (an asset scan that stopped\n * early) that must not land in the output a script reads from stdout.\n *\n * @param msg - Message to display.\n */\nexport function logWarnErr(msg: string) {\n console.error(` ${pc.yellow(\"!\")} ${msg}`);\n}\n/**\n * One `!` line per deployed library asset whose body or description is still the untouched\n * `library create` scaffold: `validate` and the publish plan fail both, so `add`, `install` and\n * `update` name every placeholder they fail (p926).\n *\n * @param bodies - Canonical refs the asset manager reported as placeholder bodies.\n * @param descriptions - Canonical refs the asset manager reported as placeholder descriptions.\n */\nexport function warnPlaceholderBodies(\n bodies: readonly string[] | undefined,\n descriptions?: readonly string[],\n) {\n const refs = [...new Set([...(bodies ?? []), ...(descriptions ?? [])])];\n for (const ref of refs) {\n const parts = [\n ...(descriptions?.includes(ref) ? [\"description\"] : []),\n ...(bodies?.includes(ref) ? [\"body\"] : []),\n ];\n const both = parts.length > 1;\n logWarn(\n `${ref} ${parts.join(\" and \")} ${both ? \"are\" : \"is\"} still the scaffold placeholder; write ${both ? \"them\" : \"it\"} (\\`skaile validate\\` fails ${both ? \"them\" : \"it\"})`,\n );\n }\n}\n/**\n * Print an info line prefixed with a dim dot.\n *\n * @param msg - Message to display.\n * @docLink cli/dev-guide#helpers\n */\nexport function logInfo(msg: string) {\n console.log(` ${pc.dim(\"·\")} ${msg}`);\n}\n\n/** Full command path of the command being run (`harness set`), set before its action runs. */\nlet activeCommandPath: string | undefined;\n\n/**\n * Record the command that is about to run, as the path of subcommand names from the root\n * (`harness set`), so advice that repeats the command shows the whole path (p1656).\n */\nexport function setActiveCommand(cmd: { name(): string; parent: unknown }): void {\n const names: string[] = [];\n for (\n let c: { name(): string; parent: unknown } | null = cmd;\n c && c.parent;\n c = c.parent as { name(): string; parent: unknown } | null\n ) {\n names.unshift(c.name());\n }\n activeCommandPath = names.length > 0 ? names.join(\" \") : undefined;\n}\n\n/** The nearest parent directory of `dir` that holds a `skaile.yaml`, or `undefined`. */\nfunction nearestParentProject(dir: string): string | undefined {\n for (let up = path.dirname(dir); up !== dir; dir = up, up = path.dirname(dir)) {\n if (existsSync(path.join(up, SKAILE_YAML_DEFAULT))) return up;\n }\n return undefined;\n}\n\n/**\n * Print the `No skaile.yaml found` line for `projectDir`, plus a second line naming the nearest\n * parent directory that holds a `skaile.yaml`, when there is one: skaile does not search parent\n * directories. The line shows `--project-dir` after the full command path (`skaile harness set\n * --project-dir /x`), the only place the option is accepted (p1656).\n */\nexport function logNoProject(projectDir: string): void {\n const dir = path.resolve(projectDir);\n logErr(`No ${S.cmd(\"skaile.yaml\")} found. Run ${S.cmd(\"skaile init\")} to create one.`);\n const parent = nearestParentProject(dir);\n if (parent) {\n const command =\n activeCommandPath ?? process.argv.slice(2).find((a) => !a.startsWith(\"-\")) ?? \"<command>\";\n logErr(\n `${S.cmd(parent)} holds a ${S.cmd(\"skaile.yaml\")}: run from there or put the option after the command name: ${S.cmd(`skaile ${command} --project-dir ${parent}`)}.`,\n );\n }\n}\n\n/**\n * Stop a project command that has no usable project: print one `✗` line and exit 1, before\n * the command deploys, undeploys, locks or clones anything. Two causes: no `skaile.yaml` in\n * `projectDir` (`No skaile.yaml found`), or a `skaile.yaml` — project, app or user scope —\n * that does not parse (`<file> — parse error: …`, a duplicate key included). Without this a\n * broken file would read as \"nothing declared\" and `install` would undeploy every asset.\n *\n * Library-level commands (`library …`, `search`, `init`) have no project and do not call it.\n */\nexport function requireProjectConfig(\n projectDir: string,\n opts: { allowMissing?: boolean } = {},\n): void {\n const dir = path.resolve(projectDir);\n if (!existsSync(path.join(dir, SKAILE_YAML_DEFAULT))) {\n if (opts.allowMissing) return;\n logNoProject(dir);\n process.exit(1);\n }\n try {\n resolveSkWorkspaceConfig(dir);\n } catch (err) {\n logErr(err instanceof Error ? err.message : String(err));\n process.exit(1);\n }\n}\n\n/**\n * Hold warnings raised while a spinner animates and print them once it stops:\n * on a TTY a line written mid-spin is overwritten by the next frame. Pass\n * `push` as `AssetManager`'s `onLibraryCollision`, call `flush()` after\n * `spinner.stop(...)`. Warnings pushed after `flush()` print immediately.\n */\nexport function deferredWarnings(): { push: (msg: string) => void; flush: () => void } {\n const held: string[] = [];\n let live = false;\n return {\n push: (msg) => {\n if (live) logWarn(msg);\n else held.push(msg);\n },\n flush: () => {\n for (const msg of held.splice(0)) logWarn(msg);\n live = true;\n },\n };\n}\n\n/** Max stale copies of one harness named inline by {@link warnStaleHarnessCopies}. */\nconst STALE_COPY_LIST_MAX = 5;\n\n/**\n * Print one warning per harness whose project dir (`.claude/`, `.omp/`, `.codex/`) still holds\n * copies of tracked assets although the project deploys to another harness: after `skaile\n * harness set`, or when a project moved off the old default. Those copies are orphans: `remove`\n * / `clean` / `list` only look in the active harness dir. Nothing is deleted. Silent when there\n * are none.\n */\nexport function warnStaleHarnessCopies(am: {\n projectDir: string;\n harness: string;\n listStaleHarnessCopies(): Array<{ harness: HarnessName; path: string }>;\n}): void {\n let stale: Array<{ harness: HarnessName; path: string }>;\n try {\n stale = am.listStaleHarnessCopies();\n } catch {\n return; // advisory only — never fail the command\n }\n for (const harness of SUPPORTED_HARNESSES) {\n const rel = stale\n .filter((s) => s.harness === harness)\n .map((s) => path.relative(am.projectDir, s.path));\n if (rel.length === 0) continue;\n const dir = `${rel[0]?.split(path.sep)[0] ?? harness}/`;\n const shown = rel.slice(0, STALE_COPY_LIST_MAX).join(\", \");\n const more =\n rel.length > STALE_COPY_LIST_MAX ? `, +${rel.length - STALE_COPY_LIST_MAX} more` : \"\";\n logWarn(\n `Stale ${S.cmd(dir)} copies no longer managed (deploying to ${am.harness}): ${shown}${more}. ` +\n `Delete them once ${S.cmd(\"skaile install\")} has deployed to ${am.harness}, or pass ${S.cmd(`--target ${harness}`)} to keep using ${dir}.`,\n );\n }\n}\n\n/**\n * Bare asset name of a canonical soft-dep target ref (`@pub/name@ver` → `name`),\n * for compact rendering in `info` / `tree` / `why`. Delegates to the asset-manager\n * parser (the soft-dep read surface) so the two never diverge.\n */\nexport function bareSoftDepName(ref: string): string {\n return softDepName(ref);\n}\n\n/**\n * The report-only soft-dep hint line shared by the `add` no-TTY branch and the\n * `install` surface, so the two user-facing wordings can't drift. Appends a\n * runnable `skaile add` suffix only when the target has a parseable ref.\n */\nexport function formatSoftDepHint(edge: { from: string; to: string; toRef?: string }): string {\n const suffix = edge.toRef ? ` — run \\`skaile add ${edge.toRef}\\` to include it.` : \"\";\n return `${bareSoftDepName(edge.from)} references ${bareSoftDepName(edge.to)} (soft dependency)${suffix}`;\n}\n\n/**\n * Build the \"Soft dependencies (inferred)\" section for `skaile info`. Returns one\n * header line plus one line per soft-dep target, each marked `(soft)` to read\n * differently from a typed `requires`. Empty array when there are no soft deps,\n * so the caller prints nothing.\n */\nexport function formatSoftDepSection(targets: string[]): string[] {\n if (targets.length === 0) return [];\n const out = [` ${S.label(\"Soft dependencies (inferred)\")}:`];\n for (const t of targets) out.push(` ${S.dim(\"·\")} ${t} ${S.dim(\"(soft)\")}`);\n return out;\n}\n\n/**\n * Footer line previewing the soft deps that *adding* the highlighted asset would\n * reference (manage TUI). \"references\" + \"not auto-added\" makes clear the pull is\n * report-only. Empty string when there are no targets, so the caller clears.\n */\nexport function formatSoftDepAddPreview(name: string, targets: string[]): string {\n if (targets.length === 0) return \"\";\n return S.dim(`${name} references ${targets.join(\", \")} (soft dep, not auto-added)`);\n}\n\n/**\n * Footer line previewing the soft deps that *removing* the highlighted asset\n * would orphan (manage TUI) — symmetric with {@link formatSoftDepAddPreview}.\n * Empty string when nothing would be orphaned, so the caller clears.\n */\nexport function formatSoftDepRemovePreview(name: string, targets: string[]): string {\n if (targets.length === 0) return \"\";\n return S.dim(`removing ${name} would orphan ${targets.join(\", \")} (soft dep)`);\n}\n\n/** Format a Date as a human-readable relative time string (e.g. \"5m ago\"). */\nexport function formatRelativeTime(date: Date): string {\n const diff = Date.now() - date.getTime();\n const seconds = Math.floor(diff / 1000);\n if (seconds < 60) return \"just now\";\n const minutes = Math.floor(seconds / 60);\n if (minutes < 60) return `${minutes}m ago`;\n const hours = Math.floor(minutes / 60);\n if (hours < 24) return `${hours}h ago`;\n const days = Math.floor(hours / 24);\n return `${days}d ago`;\n}\n\n/** Name the old `~/.omp/<dir>` copies a global deploy replaced (omp reads `~/.omp/agent/<dir>`). */\nexport function reportLegacyOmpCopies(removed: string[], kept: string[] = []): void {\n for (const p of removed) {\n logInfo(\n S.dim(`removed the old omp copy ${p.replace(homedir(), \"~\")} (omp reads ~/.omp/agent)`),\n );\n }\n for (const p of kept) {\n logWarn(\n `${p.replace(homedir(), \"~\")} is an old omp location and skaile did not write this copy, so it was kept: delete it if you do not need it`,\n );\n }\n}\n\n/**\n * Parse a `--harness a,b` value into validated {@link HarnessName}s, exiting on\n * an unknown id. Returns `undefined` when the flag is absent (the caller then\n * resolves the full global harness set).\n */\nexport function parseHarnessFilter(raw: string | undefined): HarnessName[] | undefined {\n if (!raw) return undefined;\n const ids = raw\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n const out: HarnessName[] = [];\n for (const id of ids) {\n if (!(SUPPORTED_HARNESSES as string[]).includes(id)) {\n logErr(unknownHarnessTargetMessage(id));\n process.exit(1);\n }\n out.push(id as HarnessName);\n }\n return out.length > 0 ? out : undefined;\n}\n\n/** The sentence the agent renderer puts into a delegate sub-agent's file (`asset-manager` fragments). */\nconst SUB_AGENT_MARKER = \"You are a sub-agent:\";\n\n/**\n * One line when a Codex project holds delegate sub-agents. Codex does not load\n * `.codex/agents/*.toml` as spawnable agents (its `spawn_agent` has no `agent_type`), so the\n * delegate exists only as a file there and the orchestrator cannot call it (p428). A delegate is\n * found by the sentence the renderer writes into its file. Silent for every other harness.\n */\nexport function warnFilesOnlyDelegates(projectDir: string, target: string): void {\n if (target !== \"codex\") return;\n const dir = path.join(projectDir, \".codex\", \"skaile-agents\");\n let names: string[];\n try {\n names = readdirSync(dir).filter((f) => f.endsWith(\".md\"));\n } catch {\n return;\n }\n const delegates = names\n .filter((f) => {\n try {\n return readFileSync(path.join(dir, f), \"utf8\").includes(SUB_AGENT_MARKER);\n } catch {\n return false;\n }\n })\n .map((f) => f.replace(/\\.md$/, \"\"))\n .sort();\n if (delegates.length === 0) return;\n logWarn(\n `codex: delegate agents are files only (${delegates.join(\", \")}): Codex does not load .codex/agents as sub-agents, so the orchestrator cannot call them`,\n );\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { factoryAssetRoots, resolveWorkspacesPackageRoot } from './chunk-
|
|
1
|
+
import { factoryAssetRoots, resolveWorkspacesPackageRoot } from './chunk-3ENE6ZOF.js';
|
|
2
2
|
import { deployedBase } from './chunk-5KRMNUL4.js';
|
|
3
3
|
import { DEFAULT_HARNESS_ID } from './chunk-C5HFK34M.js';
|
|
4
|
-
import { valueShapeError, parseSourceEntries, resolveSkWorkspaceConfig } from './chunk-
|
|
4
|
+
import { ConfigParseError, valueShapeError, parseSourceEntries, resolveSkWorkspaceConfig } from './chunk-6WQGJF65.js';
|
|
5
5
|
import { globalSkaileDir } from './chunk-L5VSIPQD.js';
|
|
6
6
|
import { harnessNameForHarnessId, SUPPORTED_HARNESSES } from './chunk-VTETQCR6.js';
|
|
7
|
-
import { sha256Hex, compositeSha256, orderedAsset, ASSET_KEY_ORDER } from './chunk-
|
|
8
|
-
import { yamlQuotingHint } from './chunk-
|
|
7
|
+
import { sha256Hex, compositeSha256, orderedAsset, ASSET_KEY_ORDER } from './chunk-U6S5CXKB.js';
|
|
8
|
+
import { yamlQuotingHint } from './chunk-VV2DJT4I.js';
|
|
9
9
|
import { parseAssetRefLoose } from './chunk-IZQOO6MN.js';
|
|
10
10
|
import { validateRegistry, mergeRegistries, validateMergedRegistry } from './chunk-RXGPFAMN.js';
|
|
11
11
|
import fs, { existsSync, readFileSync, writeFileSync, mkdirSync, cpSync, readdirSync, realpathSync } from 'fs';
|
|
@@ -73,14 +73,17 @@ function factoryBundleVersion() {
|
|
|
73
73
|
function isFactoryMemorySource(source) {
|
|
74
74
|
return source !== void 0 && repoUrlKey(source.url) === FACTORY_URL_KEY && source.commit === FACTORY_MEMORY_COMMIT;
|
|
75
75
|
}
|
|
76
|
-
function lockToDisk(lock) {
|
|
76
|
+
function lockToDisk(lock, prevAssets) {
|
|
77
77
|
const version = factoryBundleVersion();
|
|
78
|
+
const prev = prevAssets && typeof prevAssets === "object" ? prevAssets : {};
|
|
78
79
|
let anyFactory = false;
|
|
79
80
|
const assets = {};
|
|
80
81
|
for (const [key, entry] of Object.entries(lock.assets)) {
|
|
81
82
|
if (isFactoryMemorySource(entry.source)) {
|
|
82
83
|
anyFactory = true;
|
|
83
|
-
|
|
84
|
+
const before = prev[key];
|
|
85
|
+
const keep = before?.source?.url === LOCK_FACTORY_URL && typeof before.source.commit === "string" && before.source.commit !== "" && before.sha256 === entry.sha256 ? before.source.commit : version;
|
|
86
|
+
assets[key] = { ...entry, source: { url: LOCK_FACTORY_URL, commit: keep } };
|
|
84
87
|
} else {
|
|
85
88
|
assets[key] = entry;
|
|
86
89
|
}
|
|
@@ -163,14 +166,17 @@ function parseLockYaml(text) {
|
|
|
163
166
|
return doc.toJS();
|
|
164
167
|
}
|
|
165
168
|
function writeLock(lockPath, data) {
|
|
166
|
-
|
|
169
|
+
let onDisk = null;
|
|
167
170
|
if (existsSync(lockPath)) {
|
|
168
171
|
try {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
onDisk = parseLockYaml(readFileSync(lockPath, "utf8"));
|
|
173
|
+
} catch {
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const next = stringifyLock(lockToDisk(data, onDisk?.assets));
|
|
177
|
+
if (onDisk && typeof onDisk === "object" && typeof onDisk.locked_at === "string") {
|
|
178
|
+
try {
|
|
179
|
+
if (stringifyLock({ ...onDisk, locked_at: data.locked_at }) === next) return false;
|
|
174
180
|
} catch {
|
|
175
181
|
}
|
|
176
182
|
}
|
|
@@ -1203,14 +1209,18 @@ var WorkspaceYamlEditor = class _WorkspaceYamlEditor {
|
|
|
1203
1209
|
if (first) {
|
|
1204
1210
|
const reason = (first.message.split("\n")[0] ?? "").replace(/:$/, "");
|
|
1205
1211
|
const hint = yamlQuotingHint(reason, raw);
|
|
1206
|
-
throw new
|
|
1212
|
+
throw new ConfigParseError(
|
|
1213
|
+
`${basename(filePath)} \u2014 parse error: ${reason}${hint ? `.${hint}` : ""}`
|
|
1214
|
+
);
|
|
1207
1215
|
}
|
|
1208
1216
|
const label = basename(filePath);
|
|
1209
1217
|
if (doc.contents !== null && !isMap(doc.contents)) {
|
|
1210
|
-
throw new
|
|
1218
|
+
throw new ConfigParseError(
|
|
1219
|
+
`${label} \u2014 parse error: skaile.yaml must be a mapping at the top level.`
|
|
1220
|
+
);
|
|
1211
1221
|
}
|
|
1212
1222
|
const wrongShape = valueShapeError(doc.toJS() ?? {});
|
|
1213
|
-
if (wrongShape) throw new
|
|
1223
|
+
if (wrongShape) throw new ConfigParseError(`${label} \u2014 parse error: ${wrongShape.message}`);
|
|
1214
1224
|
return new _WorkspaceYamlEditor(filePath, doc);
|
|
1215
1225
|
}
|
|
1216
1226
|
/** Create a new empty document (for use when no file exists yet). */
|
|
@@ -1569,5 +1579,5 @@ var WorkspaceYamlEditor = class _WorkspaceYamlEditor {
|
|
|
1569
1579
|
};
|
|
1570
1580
|
|
|
1571
1581
|
export { AGENT_PROMPT_SECTION_ORDER, FACTORY_SOURCE_URL, GLOBAL_INSTALL_DIR_NAME, LOCK_FACTORY_URL, LOCK_SCHEMA_VERSION, ManifestYamlEditor, PROVIDERS_FILENAME, SETTINGS_DEFAULTS, WorkspaceYamlEditor, aiResourceRoots, applyPatch, assertLockHashes, buildAgentPromptSections, buildLibraryLockEntries, buildLockFile, capMemoryContent, checkAgentSkillConformance, computeHash, connectProbe, defaultLibraryDir, detectPackageManager, extractForPatch, findProjectPackageDir, generatePatch, globalInstallDir, globalSettingsPath, harnessSdkMissingError, holdsWildcard, installCommand, installCommandFor, listPatches, listenWithProbe, loadHarnessSdk, loadHarnessSdkSubpath, loadProviderRegistry, loadProviderRegistryFile, loadSettings, mapLegacyFields, maskApiKey, mergeLockFile, migrateSettings, needsWildcardProbe, portIsHeld, probeHosts, projectAssetRoots, projectSettingsPath, readLock, readPatch, readPluginsLockSlice, renderMemorySection, resolveConfiguredHarnessName, resolveLibraryDir, resolveSettings, resolveSettingsWithSources, resyncLockSources, savePatch, saveProviderRegistryFile, saveSettings, sdkLookupPlaces, skaileInstallDir, userProviderRegistryPath, verifyLock, verifyLockEntry, walkForSettings, workspaceProviderRegistryPath, writeLock, writePluginsLockSlice };
|
|
1572
|
-
//# sourceMappingURL=chunk-
|
|
1573
|
-
//# sourceMappingURL=chunk-
|
|
1582
|
+
//# sourceMappingURL=chunk-ABVWUM2E.js.map
|
|
1583
|
+
//# sourceMappingURL=chunk-ABVWUM2E.js.map
|