@skaile/workspaces 0.34.0 → 0.36.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 +38 -0
- package/dist/{asset-feeds-6R2C2NHB.js → asset-feeds-PCLTE2W5.js} +20 -12
- package/dist/asset-feeds-PCLTE2W5.js.map +1 -0
- package/dist/asset-manager/index.js +8 -8
- package/dist/asset-manager/installer.js +7 -7
- package/dist/bridge/drivers/claude-sdk.js +9 -5
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +2 -2
- package/dist/bridge/drivers/continue.js +3 -3
- package/dist/bridge/drivers/echo.js +1 -1
- package/dist/bridge/drivers/gemini.js +4 -4
- package/dist/bridge/drivers/goose.js +3 -3
- package/dist/bridge/drivers/omp.js +2 -2
- package/dist/bridge/drivers/opencode.js +3 -3
- package/dist/bridge/drivers/qwen.js +4 -4
- package/dist/bridge/index.js +3 -3
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/error-classifier.d.ts +22 -0
- package/dist/bridge/src/error-classifier.d.ts.map +1 -1
- package/dist/bridge/src/index.d.ts +1 -1
- package/dist/bridge/src/index.d.ts.map +1 -1
- package/dist/bridge/src/types.d.ts +1 -1
- package/dist/bridge/src/types.d.ts.map +1 -1
- package/dist/{chunk-DVIIYYD5.js → chunk-2Q6OY3SU.js} +3 -3
- package/dist/{chunk-DVIIYYD5.js.map → chunk-2Q6OY3SU.js.map} +1 -1
- package/dist/{chunk-TV2OU2EZ.js → chunk-4ZACMAT3.js} +4 -4
- package/dist/{chunk-TV2OU2EZ.js.map → chunk-4ZACMAT3.js.map} +1 -1
- package/dist/{chunk-E5VRPYUX.js → chunk-56YT6CWS.js} +5 -5
- package/dist/{chunk-E5VRPYUX.js.map → chunk-56YT6CWS.js.map} +1 -1
- package/dist/{chunk-2VM62DX7.js → chunk-5DPQ766L.js} +4 -4
- package/dist/{chunk-2VM62DX7.js.map → chunk-5DPQ766L.js.map} +1 -1
- package/dist/{chunk-NSVAJWWQ.js → chunk-5IXCNMMU.js} +4 -4
- package/dist/{chunk-NSVAJWWQ.js.map → chunk-5IXCNMMU.js.map} +1 -1
- package/dist/{chunk-LFDZYCEO.js → chunk-BM7XANVN.js} +2 -2
- package/dist/chunk-BM7XANVN.js.map +1 -0
- package/dist/{chunk-W6TLIJG3.js → chunk-EOCKR5TN.js} +3 -3
- package/dist/{chunk-W6TLIJG3.js.map → chunk-EOCKR5TN.js.map} +1 -1
- package/dist/{chunk-4RSCLQYX.js → chunk-FDLVPYSN.js} +257 -107
- package/dist/chunk-FDLVPYSN.js.map +1 -0
- package/dist/{chunk-NGJ6E344.js → chunk-GAH4YRCI.js} +20 -3
- package/dist/chunk-GAH4YRCI.js.map +1 -0
- package/dist/{chunk-FM2BJYX4.js → chunk-I3TERDTR.js} +2 -2
- package/dist/{chunk-FM2BJYX4.js.map → chunk-I3TERDTR.js.map} +1 -1
- package/dist/{chunk-WQRDLR3K.js → chunk-JNH6TTIO.js} +29 -7
- package/dist/{chunk-WQRDLR3K.js.map → chunk-JNH6TTIO.js.map} +1 -1
- package/dist/{chunk-CIFTUSBV.js → chunk-KM6DCR7A.js} +2 -2
- package/dist/{chunk-CIFTUSBV.js.map → chunk-KM6DCR7A.js.map} +1 -1
- package/dist/{chunk-N74UQJPN.js → chunk-KYC6JH75.js} +3 -3
- package/dist/{chunk-N74UQJPN.js.map → chunk-KYC6JH75.js.map} +1 -1
- package/dist/{chunk-JLSK6HR4.js → chunk-LY5O73Q2.js} +5 -5
- package/dist/{chunk-JLSK6HR4.js.map → chunk-LY5O73Q2.js.map} +1 -1
- package/dist/{chunk-4AGIEU7V.js → chunk-MAPRKFBD.js} +3 -3
- package/dist/{chunk-4AGIEU7V.js.map → chunk-MAPRKFBD.js.map} +1 -1
- package/dist/{chunk-UQ5JY2GQ.js → chunk-MCQ4TJ3P.js} +22 -10
- package/dist/chunk-MCQ4TJ3P.js.map +1 -0
- package/dist/{chunk-5JAQVXPV.js → chunk-O2OHGE4S.js} +4 -4
- package/dist/{chunk-5JAQVXPV.js.map → chunk-O2OHGE4S.js.map} +1 -1
- package/dist/{chunk-7MANNJ3U.js → chunk-O4PANZI2.js} +5 -5
- package/dist/{chunk-7MANNJ3U.js.map → chunk-O4PANZI2.js.map} +1 -1
- package/dist/{chunk-H5YXL4KI.js → chunk-SAXDHVJZ.js} +3 -3
- package/dist/{chunk-H5YXL4KI.js.map → chunk-SAXDHVJZ.js.map} +1 -1
- package/dist/{chunk-67AXL4OK.js → chunk-U3TV7SRR.js} +4 -4
- package/dist/{chunk-67AXL4OK.js.map → chunk-U3TV7SRR.js.map} +1 -1
- package/dist/{chunk-PWXN2KHV.js → chunk-UAYAK7N4.js} +5 -5
- package/dist/{chunk-PWXN2KHV.js.map → chunk-UAYAK7N4.js.map} +1 -1
- package/dist/{chunk-DHN6VW4B.js → chunk-WEQN6EWW.js} +4 -4
- package/dist/{chunk-DHN6VW4B.js.map → chunk-WEQN6EWW.js.map} +1 -1
- package/dist/{chunk-VSLSRDQZ.js → chunk-XOBPOVFT.js} +3 -3
- package/dist/{chunk-VSLSRDQZ.js.map → chunk-XOBPOVFT.js.map} +1 -1
- package/dist/{chunk-QLHOORR7.js → chunk-YPRW2ROJ.js} +2 -2
- package/dist/{chunk-QLHOORR7.js.map → chunk-YPRW2ROJ.js.map} +1 -1
- package/dist/{chunk-BKE2E5AC.js → chunk-ZE5WYJVU.js} +7 -7
- package/dist/{chunk-BKE2E5AC.js.map → chunk-ZE5WYJVU.js.map} +1 -1
- package/dist/cli/index.js +199 -104
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/asset-feeds.d.ts +8 -1
- package/dist/cli/src/asset-feeds.d.ts.map +1 -1
- package/dist/cli/src/commands/manage.d.ts +33 -22
- package/dist/cli/src/commands/manage.d.ts.map +1 -1
- package/dist/connectors/config.js +7 -7
- package/dist/connectors/index.js +8 -8
- package/dist/connectors/src/fleet-health-gate.d.ts.map +1 -1
- package/dist/connectors/src/mount-placeholder.d.ts +8 -0
- package/dist/connectors/src/mount-placeholder.d.ts.map +1 -1
- package/dist/connectors/src/secrets.d.ts +14 -14
- package/dist/connectors/src/secrets.d.ts.map +1 -1
- package/dist/core/index.js +6 -6
- package/dist/core/manifest.js +2 -2
- package/dist/core/models.js +1 -1
- package/dist/core/publish-manifest.js +2 -2
- package/dist/core/runtime-assets.js +5 -5
- package/dist/core/src/index.d.ts +1 -1
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/models.d.ts +28 -0
- package/dist/core/src/models.d.ts.map +1 -1
- package/dist/core/workspace-config.js +4 -4
- package/dist/deploy/index.js +6 -6
- package/dist/discovery/index.js +4 -4
- package/dist/{ensure-sources-GYEQ65ET.js → ensure-sources-HMMEQEZC.js} +11 -11
- package/dist/{ensure-sources-GYEQ65ET.js.map → ensure-sources-HMMEQEZC.js.map} +1 -1
- package/dist/factory-assets/connectors/deploy.js +8 -8
- package/dist/factory-assets/connectors/devserver.js +8 -8
- package/dist/factory-assets/connectors/flow/adapter.js +8 -8
- package/dist/factory-assets/connectors/flow/engine.js +6 -6
- package/dist/factory-assets/connectors/flow/run-flow.js +9 -9
- package/dist/factory-assets/connectors/flow.js +8 -8
- package/dist/factory-assets/connectors/git.js +8 -8
- package/dist/factory-assets/connectors/gmail.js +8 -8
- package/dist/factory-assets/connectors/googledrive.js +8 -8
- package/dist/factory-assets/connectors/local.js +8 -8
- package/dist/factory-assets/connectors/mattermost.js +8 -8
- package/dist/factory-assets/connectors/memory.js +8 -8
- package/dist/factory-assets/connectors/minio.js +8 -8
- package/dist/factory-assets/connectors/postgres.js +8 -8
- package/dist/factory-assets/connectors/s3.js +8 -8
- package/dist/factory-assets/connectors/sharepoint.js +8 -8
- package/dist/factory-assets/connectors/sqlite.js +8 -8
- package/dist/factory-assets/connectors/static-server.js +8 -8
- package/dist/factory-assets/connectors/tunnel.js +8 -8
- package/dist/factory-assets/connectors/webdav.js +8 -8
- package/dist/factory-assets/connectors/xstate-store.js +8 -8
- package/dist/factory-assets/connectors/xstate.js +8 -8
- package/dist/{flows-TJUVSMRR.js → flows-O7OXGFIY.js} +3 -3
- package/dist/{flows-TJUVSMRR.js.map → flows-O7OXGFIY.js.map} +1 -1
- package/dist/library/index.js +9 -9
- package/dist/library/install.js +7 -7
- package/dist/open-library-5WWTBHQD.js +23 -0
- package/dist/{open-library-GPZUB7N3.js.map → open-library-5WWTBHQD.js.map} +1 -1
- package/dist/paths-UC3ZHLKC.js +15 -0
- package/dist/{paths-R6WA7PKV.js.map → paths-UC3ZHLKC.js.map} +1 -1
- package/dist/{plugin-store-TF7GECYJ.js → plugin-store-R2WLXRT3.js} +8 -8
- package/dist/{plugin-store-TF7GECYJ.js.map → plugin-store-R2WLXRT3.js.map} +1 -1
- package/dist/runner/index.js +13 -13
- package/dist/runner/src/external-mcp.d.ts +24 -1
- package/dist/runner/src/external-mcp.d.ts.map +1 -1
- package/dist/runner/src/mcp-runtime-handlers.d.ts +42 -0
- package/dist/runner/src/mcp-runtime-handlers.d.ts.map +1 -0
- package/dist/runner/src/resources.d.ts +12 -0
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/runner-capabilities.d.ts +33 -0
- package/dist/runner/src/runner-capabilities.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts +18 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts +8 -0
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/runner/src/session-resource-handlers.d.ts +5 -1
- package/dist/runner/src/session-resource-handlers.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +8 -8
- package/dist/sdk/bridge.js +3 -3
- package/dist/sdk/core.js +6 -6
- package/dist/sdk/flow.js +6 -6
- package/dist/sdk/index.js +13 -13
- package/dist/sdk/runner.js +13 -13
- package/dist/{setup-YKL43RQJ.js → setup-QQ3SNNWP.js} +11 -11
- package/dist/{setup-YKL43RQJ.js.map → setup-QQ3SNNWP.js.map} +1 -1
- package/dist/store-client-4GKV4LOD.js +15 -0
- package/dist/{store-client-H7MHTZVU.js.map → store-client-4GKV4LOD.js.map} +1 -1
- package/dist/tui/index.js +13 -13
- package/dist/types/src/events.d.ts +22 -4
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +1 -1
- package/dist/workspace-plugin/adapters/omp.js +3 -3
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/asset-feeds-6R2C2NHB.js.map +0 -1
- package/dist/chunk-4RSCLQYX.js.map +0 -1
- package/dist/chunk-LFDZYCEO.js.map +0 -1
- package/dist/chunk-NGJ6E344.js.map +0 -1
- package/dist/chunk-UQ5JY2GQ.js.map +0 -1
- package/dist/open-library-GPZUB7N3.js +0 -23
- package/dist/paths-R6WA7PKV.js +0 -15
- package/dist/store-client-H7MHTZVU.js +0 -15
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { XStateConnector, createConnector18 as createConnector } from '../../chunk-
|
|
1
|
+
export { XStateConnector, createConnector18 as createConnector } from '../../chunk-JNH6TTIO.js';
|
|
2
2
|
import '../../chunk-OVRSNIKJ.js';
|
|
3
|
-
import '../../chunk-
|
|
3
|
+
import '../../chunk-MCQ4TJ3P.js';
|
|
4
4
|
import '../../chunk-XT6AZWK3.js';
|
|
5
5
|
import '../../chunk-6E6PKKAD.js';
|
|
6
6
|
import '../../chunk-X46FY45B.js';
|
|
7
7
|
import '../../chunk-DEYYRFQU.js';
|
|
8
8
|
import '../../chunk-IFGTRL2I.js';
|
|
9
|
-
import '../../chunk-
|
|
10
|
-
import '../../chunk-
|
|
11
|
-
import '../../chunk-
|
|
12
|
-
import '../../chunk-
|
|
13
|
-
import '../../chunk-
|
|
14
|
-
import '../../chunk-
|
|
9
|
+
import '../../chunk-2Q6OY3SU.js';
|
|
10
|
+
import '../../chunk-5DPQ766L.js';
|
|
11
|
+
import '../../chunk-56YT6CWS.js';
|
|
12
|
+
import '../../chunk-SAXDHVJZ.js';
|
|
13
|
+
import '../../chunk-MAPRKFBD.js';
|
|
14
|
+
import '../../chunk-BM7XANVN.js';
|
|
15
15
|
import '../../chunk-XGCXFX7X.js';
|
|
16
16
|
import '../../chunk-O4JH3KUE.js';
|
|
17
17
|
import '../../chunk-K5GBV4SA.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { flowFindFlowForSession, flowGetSession, flowList, flowListSessions, flowShow } from './chunk-
|
|
1
|
+
export { flowFindFlowForSession, flowGetSession, flowList, flowListSessions, flowShow } from './chunk-I3TERDTR.js';
|
|
2
2
|
import './chunk-XCBG2KDC.js';
|
|
3
3
|
import './chunk-R6O6YWU7.js';
|
|
4
4
|
import './chunk-X5YPJV4N.js';
|
|
5
5
|
import './chunk-NSBPE2FW.js';
|
|
6
|
-
//# sourceMappingURL=flows-
|
|
7
|
-
//# sourceMappingURL=flows-
|
|
6
|
+
//# sourceMappingURL=flows-O7OXGFIY.js.map
|
|
7
|
+
//# sourceMappingURL=flows-O7OXGFIY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"flows-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"flows-O7OXGFIY.js"}
|
package/dist/library/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { AssignmentNotFoundError, CatalogCache, CatalogConfigSchema, CatalogHttpError, DuplicateAssignmentError, DuplicateLibraryNameError, GitSyncDriver, InstanceHasConsumersError, InstanceNotFoundError, InterpolationError, KNOWN_ASSET_KINDS, KnowledgeManifestSchema, LIBRARY_BACKENDS, LIBRARY_OWNERSHIPS, LIBRARY_STRUCTURES, LOCAL_CATALOG_URL, LibraryConfigSchema, LibraryError, LibraryInstanceRefSchema, LibraryManager, LibrarySectionSchema, LibrarySyncError, LocalCatalogSource, LocalIndex, LocalSyncDriver, LockAssignmentSchema, LockFileSchema, OfflineError, OperationNotPermittedError, PIN_POLICIES, PinPolicySchema, PresetAppliedSchema, PresetExpandedSchema, RemoteCatalogSource, RequiresEdgeSchema, RestCatalogSource, SidecarGit, SkaileConfigSchema, SourceNotFoundError, TarballHashMismatchError, UserLibraryNotFoundError, WorkspaceConfigV2Schema, applyNonStructuralUpgrade, applyPreset, applyPresetFromData, classifyRef, createEmptyLockFile, deriveSlug, detectChanges, detectNestedPresetRefs, detectWorkspaceVersion, evaluateUpgrade, extractLibraryInstanceId, extractReferencedKeys, filterKey, getConfigDefaults, getDefaultValue, getSidecarRoot, getStoreManifestsDir, getStoreRoot, hasInterpolationTokens, interpolate, isLocalCatalogUrl, isSecretPlaceholder, knowledgeKindProvider, listSidecarSlugsOnDisk, loadLockFile, loadWorkspaceV2, migrateSidecarsToStoreIfNeeded, migrateWorkspaceConfig, parsePreset, parsePresetYaml, parseWorkspaceV2, projectConfigPath, queryInstancePickerChoices, resolveAllItems, resolveConfig, resolveIndexPath, resolveItem, resolveLibraryDir, resolvePin, resolveSidecarPaths, saveConfig, saveLockFile, saveWorkspaceV2, sha256Hex, skaileHomeDir, storeSecrets, trpcGetUrl, userConfigPath, validateAllPlaceholders, validateKnowledge, validateNestingDepth, validatePlaceholder, writeManifestIfMissing } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
export { installFromManifest } from '../chunk-
|
|
1
|
+
export { AssignmentNotFoundError, CatalogCache, CatalogConfigSchema, CatalogHttpError, DuplicateAssignmentError, DuplicateLibraryNameError, GitSyncDriver, InstanceHasConsumersError, InstanceNotFoundError, InterpolationError, KNOWN_ASSET_KINDS, KnowledgeManifestSchema, LIBRARY_BACKENDS, LIBRARY_OWNERSHIPS, LIBRARY_STRUCTURES, LOCAL_CATALOG_URL, LibraryConfigSchema, LibraryError, LibraryInstanceRefSchema, LibraryManager, LibrarySectionSchema, LibrarySyncError, LocalCatalogSource, LocalIndex, LocalSyncDriver, LockAssignmentSchema, LockFileSchema, OfflineError, OperationNotPermittedError, PIN_POLICIES, PinPolicySchema, PresetAppliedSchema, PresetExpandedSchema, RemoteCatalogSource, RequiresEdgeSchema, RestCatalogSource, SidecarGit, SkaileConfigSchema, SourceNotFoundError, TarballHashMismatchError, UserLibraryNotFoundError, WorkspaceConfigV2Schema, applyNonStructuralUpgrade, applyPreset, applyPresetFromData, classifyRef, createEmptyLockFile, deriveSlug, detectChanges, detectNestedPresetRefs, detectWorkspaceVersion, evaluateUpgrade, extractLibraryInstanceId, extractReferencedKeys, filterKey, getConfigDefaults, getDefaultValue, getSidecarRoot, getStoreManifestsDir, getStoreRoot, hasInterpolationTokens, interpolate, isLocalCatalogUrl, isSecretPlaceholder, knowledgeKindProvider, listSidecarSlugsOnDisk, loadLockFile, loadWorkspaceV2, migrateSidecarsToStoreIfNeeded, migrateWorkspaceConfig, parsePreset, parsePresetYaml, parseWorkspaceV2, projectConfigPath, queryInstancePickerChoices, resolveAllItems, resolveConfig, resolveIndexPath, resolveItem, resolveLibraryDir, resolvePin, resolveSidecarPaths, saveConfig, saveLockFile, saveWorkspaceV2, sha256Hex, skaileHomeDir, storeSecrets, trpcGetUrl, userConfigPath, validateAllPlaceholders, validateKnowledge, validateNestingDepth, validatePlaceholder, writeManifestIfMissing } from '../chunk-UAYAK7N4.js';
|
|
2
|
+
import '../chunk-O4PANZI2.js';
|
|
3
|
+
export { installFromManifest } from '../chunk-KYC6JH75.js';
|
|
4
4
|
export { GITHUB_PAT_ENV, fetchAssetFilesFromGitHub } from '../chunk-R7FOF242.js';
|
|
5
5
|
import '../chunk-ZDKJHQY2.js';
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-
|
|
9
|
-
import '../chunk-
|
|
10
|
-
import '../chunk-
|
|
11
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-2Q6OY3SU.js';
|
|
7
|
+
import '../chunk-5DPQ766L.js';
|
|
8
|
+
import '../chunk-56YT6CWS.js';
|
|
9
|
+
import '../chunk-SAXDHVJZ.js';
|
|
10
|
+
import '../chunk-MAPRKFBD.js';
|
|
11
|
+
import '../chunk-BM7XANVN.js';
|
|
12
12
|
import '../chunk-XGCXFX7X.js';
|
|
13
13
|
import '../chunk-O4JH3KUE.js';
|
|
14
14
|
import '../chunk-K5GBV4SA.js';
|
package/dist/library/install.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { installFromManifest, longestCommonDirPrefix } from '../chunk-
|
|
1
|
+
export { installFromManifest, longestCommonDirPrefix } from '../chunk-KYC6JH75.js';
|
|
2
2
|
export { GITHUB_PAT_ENV, fetchAssetFilesFromGitHub } from '../chunk-R7FOF242.js';
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-2Q6OY3SU.js';
|
|
4
|
+
import '../chunk-5DPQ766L.js';
|
|
5
|
+
import '../chunk-56YT6CWS.js';
|
|
6
|
+
import '../chunk-SAXDHVJZ.js';
|
|
7
|
+
import '../chunk-MAPRKFBD.js';
|
|
8
|
+
import '../chunk-BM7XANVN.js';
|
|
9
9
|
import '../chunk-XGCXFX7X.js';
|
|
10
10
|
import '../chunk-O4JH3KUE.js';
|
|
11
11
|
import '../chunk-K5GBV4SA.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { openCatalogSource, openLibrary, openLibraryManager, resolveCatalogSource } from './chunk-O2OHGE4S.js';
|
|
2
|
+
import './chunk-GYPA2Q7F.js';
|
|
3
|
+
import './chunk-UAYAK7N4.js';
|
|
4
|
+
import './chunk-O4PANZI2.js';
|
|
5
|
+
import './chunk-KYC6JH75.js';
|
|
6
|
+
import './chunk-R7FOF242.js';
|
|
7
|
+
import './chunk-ZDKJHQY2.js';
|
|
8
|
+
import './chunk-X46FY45B.js';
|
|
9
|
+
import './chunk-2Q6OY3SU.js';
|
|
10
|
+
import './chunk-5DPQ766L.js';
|
|
11
|
+
import './chunk-56YT6CWS.js';
|
|
12
|
+
import './chunk-SAXDHVJZ.js';
|
|
13
|
+
import './chunk-MAPRKFBD.js';
|
|
14
|
+
import './chunk-BM7XANVN.js';
|
|
15
|
+
import './chunk-XGCXFX7X.js';
|
|
16
|
+
import './chunk-O4JH3KUE.js';
|
|
17
|
+
import './chunk-K5GBV4SA.js';
|
|
18
|
+
import './chunk-ZAP2BDHG.js';
|
|
19
|
+
import './chunk-JB35MVBN.js';
|
|
20
|
+
import './chunk-HRKB2ATT.js';
|
|
21
|
+
import './chunk-NSBPE2FW.js';
|
|
22
|
+
//# sourceMappingURL=open-library-5WWTBHQD.js.map
|
|
23
|
+
//# sourceMappingURL=open-library-5WWTBHQD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"open-library-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"open-library-5WWTBHQD.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { AI_RESOURCES, MONOREPO_ROOT, aiResourceRoots } from './chunk-EOCKR5TN.js';
|
|
2
|
+
import './chunk-2Q6OY3SU.js';
|
|
3
|
+
import './chunk-5DPQ766L.js';
|
|
4
|
+
import './chunk-56YT6CWS.js';
|
|
5
|
+
import './chunk-SAXDHVJZ.js';
|
|
6
|
+
import './chunk-MAPRKFBD.js';
|
|
7
|
+
import './chunk-BM7XANVN.js';
|
|
8
|
+
import './chunk-XGCXFX7X.js';
|
|
9
|
+
import './chunk-O4JH3KUE.js';
|
|
10
|
+
import './chunk-K5GBV4SA.js';
|
|
11
|
+
import './chunk-ZAP2BDHG.js';
|
|
12
|
+
import './chunk-JB35MVBN.js';
|
|
13
|
+
import './chunk-NSBPE2FW.js';
|
|
14
|
+
//# sourceMappingURL=paths-UC3ZHLKC.js.map
|
|
15
|
+
//# sourceMappingURL=paths-UC3ZHLKC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"paths-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"paths-UC3ZHLKC.js"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { pluginRegistry } from './chunk-6E6PKKAD.js';
|
|
2
|
-
import { readPluginsLockSlice } from './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
2
|
+
import { readPluginsLockSlice } from './chunk-2Q6OY3SU.js';
|
|
3
|
+
import './chunk-5DPQ766L.js';
|
|
4
|
+
import './chunk-56YT6CWS.js';
|
|
5
|
+
import './chunk-SAXDHVJZ.js';
|
|
6
|
+
import './chunk-MAPRKFBD.js';
|
|
7
|
+
import './chunk-BM7XANVN.js';
|
|
8
8
|
import './chunk-XGCXFX7X.js';
|
|
9
9
|
import './chunk-O4JH3KUE.js';
|
|
10
10
|
import './chunk-K5GBV4SA.js';
|
|
@@ -138,5 +138,5 @@ async function ensurePluginsLoaded(projectDir, plugins, registry = pluginRegistr
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
export { ensurePluginsLoaded, loadPlugins, reconcilePlugins, specName };
|
|
141
|
-
//# sourceMappingURL=plugin-store-
|
|
142
|
-
//# sourceMappingURL=plugin-store-
|
|
141
|
+
//# sourceMappingURL=plugin-store-R2WLXRT3.js.map
|
|
142
|
+
//# sourceMappingURL=plugin-store-R2WLXRT3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../cli/src/plugin-store/paths.ts","../cli/src/plugin-store/spec.ts","../cli/src/plugin-store/load.ts","../cli/src/plugin-store/reconcile.ts","../cli/src/plugin-store/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAUO,SAAS,WAAW,UAAA,EAA4B;AACrD,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AAA,EAAS,KAAA,EAAO,MAAA,EAAQ,YAAA,EAAa;AAAA,IAChD;AAAA,EACF;AAEA,EAAA,gBAAA,CAAiB,YAAY,OAAO,CAAA;AAEpC,EAAA,MAAM,OAAA,GAAU,KAAK,UAAA,IAAc,cAAA;AACnC,EAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,UAAA,CAAW,UAAU,CAAC,CAAA;AACnD,EAAA,IAAI,CAAC,OAAO,EAAA,EAAI;AACd,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA;AAAA,EAA2B,MAAA,CAAO,MAAM,CAAA,CAAE,CAAA;AAAA,EAC5D;AAEA,EAAA,aAAA,CAAc,UAAU,QAAQ,CAAA;AAChC,EAAA,OAAO,EAAE,OAAA,EAAS,IAAA,EAAM,MAAA,EAAQ,YAAA,EAAa;AAC/C;;;ACxFA,eAAsB,oBACpB,UAAA,EACA,OAAA,EACA,WAA2B,cAAA,EAC3B,IAAA,GAA6B,EAAC,EACT;AACrB,EAAA,IAAI,CAAC,OAAA,IAAW,OAAA,CAAQ,MAAA,KAAW,CAAA,EAAG;AACpC,IAAA,OAAO,EAAE,MAAA,EAAQ,EAAC,EAAG,MAAA,EAAQ,EAAC,EAAE;AAAA,EAClC;AACA,EAAA,MAAM,gBAAA,CAAiB,UAAA,EAAY,OAAA,EAAS,IAAI,CAAA;AAChD,EAAA,OAAO,WAAA,CAAY,YAAY,OAAA,EAAS,QAAA,EAAU,EAAE,GAAA,EAAK,IAAA,CAAK,KAAK,CAAA;AACrE","file":"plugin-store-TF7GECYJ.js","sourcesContent":["/**\n * Pure path helpers for the project-local plugin store.\n *\n * The store is a self-contained npm workspace owned by the CLI under\n * `<projectDir>/.skaile/plugins/`. Nothing here touches the filesystem.\n */\n\nimport { join } from \"node:path\";\n\n/** `<projectDir>/.skaile/plugins` — the store root. */\nexport function pluginsDir(projectDir: string): string {\n return join(projectDir, \".skaile\", \"plugins\");\n}\n\n/** `<store>/package.json` — generated, never user-edited. */\nexport function pluginsPkgJson(projectDir: string): string {\n return join(pluginsDir(projectDir), \"package.json\");\n}\n\n/** `<store>/node_modules` — where reconciled plugin packages land. */\nexport function nodeModulesDir(projectDir: string): string {\n return join(pluginsDir(projectDir), \"node_modules\");\n}\n\n/** `<store>/.reconcile-hash` — SHA of plugins-list + lock slice; skip reinstall when unchanged. */\nexport function reconcileHashFile(projectDir: string): string {\n return join(pluginsDir(projectDir), \".reconcile-hash\");\n}\n\n/**\n * Absolute path to a plugin package's entry directory under the store's\n * `node_modules`. Dynamic `import()` against this absolute path works inside\n * compiled binaries via `pathToFileURL`.\n */\nexport function resolvePluginEntry(projectDir: string, pkgName: string): string {\n return join(nodeModulesDir(projectDir), pkgName);\n}\n","/**\n * Parse npm package specifiers from the `plugins:` list into name + range.\n *\n * The leading `@` of a scope is NOT a separator: only the last `@` at a\n * non-zero index splits the package name from its semver range.\n * \"@skaile/provider-fly@^0.1.0\" → { name: \"@skaile/provider-fly\", range: \"^0.1.0\" }\n * \"@skaile/connector-redis\" → { name: \"@skaile/connector-redis\", range: \"*\" }\n * \"lodash@^4\" → { name: \"lodash\", range: \"^4\" }\n */\n\n/** A parsed plugin specifier: package name plus a semver range (`\"*\"` when omitted). */\nexport interface PluginSpec {\n name: string;\n range: string;\n}\n\n/**\n * Parse a single plugin specifier into `{ name, range }`.\n *\n * @param spec - An npm specifier, e.g. `\"@skaile/provider-fly@^0.1.0\"` or `\"lodash\"`.\n * @returns The package name and semver range (range defaults to `\"*\"`).\n * @throws Error when the specifier is empty.\n */\nexport function parseSpec(spec: string): PluginSpec {\n const trimmed = spec.trim();\n if (!trimmed) throw new Error(\"parseSpec: empty specifier\");\n\n // Find the version-separating `@` — the last one that is not the scope `@`\n // at index 0. A bare `@scope/name` has its only `@` at index 0 (no range).\n const at = trimmed.lastIndexOf(\"@\");\n if (at <= 0) {\n return { name: trimmed, range: \"*\" };\n }\n const name = trimmed.slice(0, at);\n const range = trimmed.slice(at + 1);\n return { name, range: range.length > 0 ? range : \"*\" };\n}\n\n/** Convenience: just the package name of a specifier. */\nexport function specName(spec: string): string {\n return parseSpec(spec).name;\n}\n","/**\n * Runtime plugin loader: dynamic-import each reconciled plugin and let it\n * self-register into the `pluginRegistry`.\n *\n * Each plugin specifier resolves to an absolute path under the store's\n * `node_modules`; we import it via a `file://` URL so the import works inside\n * `bun --compile` binaries (which bundle only the literal-string switches, but\n * can still execute a `file://` import against the unpacked store on disk).\n * Failures are caught per-plugin so one broken plugin never aborts the rest.\n */\n\nimport { pathToFileURL } from \"node:url\";\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { resolvePluginEntry } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/** Options for {@link loadPlugins}. */\nexport interface LoadOptions {\n log?: Logger;\n}\n\n/** Result of a load pass: which specs registered and which failed. */\nexport interface LoadResult {\n loaded: string[];\n failed: { spec: string; error: string }[];\n}\n\n/** The self-registration entrypoint a plugin module is expected to export. */\ntype PluginModule = { register?: (registry: PluginRegistry) => void };\n\n/**\n * Load and register each plugin in `plugins` into `registry`.\n *\n * @param projectDir - Project root holding `.skaile/plugins/node_modules`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param registry - Registry to register into. Defaults to the process-wide `pluginRegistry`.\n * @param opts - Optional logger.\n * @returns Loaded specs + per-plugin failures (never throws).\n */\nexport async function loadPlugins(\n projectDir: string,\n plugins: string[],\n registry: PluginRegistry = pluginRegistry,\n opts: LoadOptions = {},\n): Promise<LoadResult> {\n const loaded: string[] = [];\n const failed: { spec: string; error: string }[] = [];\n\n for (const spec of plugins) {\n try {\n const { name } = parseSpec(spec);\n const entry = resolvePluginEntry(projectDir, name);\n const mod = (await import(pathToFileURL(entry).href)) as PluginModule;\n if (typeof mod.register !== \"function\") {\n throw new Error(`plugin \"${name}\" does not export a register() function`);\n }\n mod.register(registry);\n loaded.push(spec);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n failed.push({ spec, error: `failed to load plugin \"${spec}\": ${message}` });\n opts.log?.warn(`plugin load failed: ${spec}`, { error: message });\n }\n }\n\n return { loaded, failed };\n}\n","/**\n * Reconcile the project-local plugin store (`<projectDir>/.skaile/plugins/`).\n *\n * The reconciler is hash-skipped: it computes a SHA-256 over the sorted plugin\n * list plus the lock file's `plugins` slice and compares it to the stored\n * `.reconcile-hash`. On a match it returns with zero further I/O; otherwise it\n * regenerates the store's `package.json` and runs `bun install` against it.\n *\n * The install step is injectable (`InstallFn`) so tests stay hermetic — they\n * pass a fake installer that records calls and writes a stub `node_modules`.\n */\n\nimport { createHash } from \"node:crypto\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { readPluginsLockSlice } from \"@skaile/workspaces/core\";\nimport { pluginsDir, pluginsPkgJson, reconcileHashFile } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/**\n * Installs the store's dependencies. Returns `ok: false` (never throws) on a\n * failed install so the reconciler can surface the captured `output`.\n */\nexport type InstallFn = (pluginsDir: string) => Promise<{ ok: boolean; output: string }>;\n\n/** Options for {@link reconcilePlugins}. */\nexport interface ReconcileOptions {\n /** Injectable installer. Defaults to a real `bun install` of the store. */\n runInstall?: InstallFn;\n /**\n * Lock slice to fold into the reconcile-hash. Defaults to\n * `readPluginsLockSlice(projectDir)` so a lock edit invalidates the hash.\n */\n lockSlice?: unknown;\n}\n\n/** Result of a reconcile pass. */\nexport interface ReconcileResult {\n changed: boolean;\n reason: \"no-plugins\" | \"up-to-date\" | \"reconciled\";\n}\n\n/**\n * The default real installer: `bun install` inside the store directory.\n * Frozen on subsequent runs (a `bun.lock`/`bun.lockb` already exists), and\n * non-frozen on the first run so a lock can be generated.\n */\nexport const defaultInstall: InstallFn = async (dir) => {\n const { portableSpawn } = await import(\"@skaile/workspaces/core\");\n const hasLock =\n existsSync(`${dir}/bun.lock`) ||\n existsSync(`${dir}/bun.lockb`) ||\n existsSync(`${dir}/package-lock.json`);\n const args = hasLock ? [\"bun\", \"install\", \"--frozen-lockfile\"] : [\"bun\", \"install\"];\n const proc = portableSpawn(args, { cwd: dir });\n const chunks: string[] = [];\n const decoder = new TextDecoder();\n const pump = async (stream: ReadableStream<Uint8Array>) => {\n const reader = stream.getReader();\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n if (value) chunks.push(decoder.decode(value, { stream: true }));\n }\n };\n await Promise.all([pump(proc.stdout), pump(proc.stderr)]);\n const code = await proc.exited;\n return { ok: code === 0, output: chunks.join(\"\") };\n};\n\n/** Generate the store's `package.json` from the plugin specs. */\nfunction writePackageJson(projectDir: string, plugins: string[]): void {\n const dependencies: Record<string, string> = {};\n for (const spec of plugins) {\n const { name, range } = parseSpec(spec);\n dependencies[name] = range;\n }\n const pkg = {\n name: \"skaile-project-plugins\",\n private: true,\n dependencies,\n };\n mkdirSync(pluginsDir(projectDir), { recursive: true });\n writeFileSync(pluginsPkgJson(projectDir), `${JSON.stringify(pkg, null, 2)}\\n`);\n}\n\n/**\n * Reconcile the plugin store for a project.\n *\n * @param projectDir - Project root containing `skaile.yaml` / `skaile.lock.yaml`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param opts - Optional injectable installer + lock slice override.\n * @returns Whether the store changed and why.\n */\nexport async function reconcilePlugins(\n projectDir: string,\n plugins: string[],\n opts: ReconcileOptions = {},\n): Promise<ReconcileResult> {\n if (plugins.length === 0) {\n return { changed: false, reason: \"no-plugins\" };\n }\n\n const lockSlice = opts.lockSlice ?? readPluginsLockSlice(projectDir);\n const wantHash = createHash(\"sha256\")\n .update(JSON.stringify({ plugins: [...plugins].sort(), lock: lockSlice }))\n .digest(\"hex\");\n\n const hashFile = reconcileHashFile(projectDir);\n if (existsSync(hashFile)) {\n const have = readFileSync(hashFile, \"utf8\").trim();\n if (have === wantHash) {\n return { changed: false, reason: \"up-to-date\" };\n }\n }\n\n writePackageJson(projectDir, plugins);\n\n const install = opts.runInstall ?? defaultInstall;\n const result = await install(pluginsDir(projectDir));\n if (!result.ok) {\n throw new Error(`plugin install failed:\\n${result.output}`);\n }\n\n writeFileSync(hashFile, wantHash);\n return { changed: true, reason: \"reconciled\" };\n}\n","/**\n * The project-local plugin store: reconcile (`<projectDir>/.skaile/plugins/`)\n * then load the reconciled plugins into the `pluginRegistry`.\n *\n * `ensurePluginsLoaded` is the single entrypoint commands wire in. It is a\n * guarded no-op when `plugins` is empty/undefined — zero overhead for the\n * common case where no project declares `plugins:` in `skaile.yaml`.\n */\n\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { type LoadResult, loadPlugins } from \"./load.js\";\nimport { type ReconcileOptions, reconcilePlugins } from \"./reconcile.js\";\n\nexport type { LoadResult } from \"./load.js\";\nexport { loadPlugins } from \"./load.js\";\nexport type { ReconcileOptions } from \"./reconcile.js\";\nexport { reconcilePlugins } from \"./reconcile.js\";\nexport { specName } from \"./spec.js\";\n\n/** Options for {@link ensurePluginsLoaded}. */\nexport interface EnsurePluginsOptions extends ReconcileOptions {\n log?: Logger;\n}\n\n/**\n * Reconcile the plugin store then load each plugin into `registry`.\n *\n * No-op (returns immediately) when `plugins` is empty/undefined, so the common\n * no-plugins path costs nothing.\n *\n * @param projectDir - Project root.\n * @param plugins - The `skaile.yaml` `plugins:` list (may be undefined).\n * @param registry - Registry to register into. Defaults to `pluginRegistry`.\n * @param opts - Injectable installer / lock slice + optional logger.\n * @returns The load result, or an empty result when there are no plugins.\n */\nexport async function ensurePluginsLoaded(\n projectDir: string,\n plugins: string[] | undefined,\n registry: PluginRegistry = pluginRegistry,\n opts: EnsurePluginsOptions = {},\n): Promise<LoadResult> {\n if (!plugins || plugins.length === 0) {\n return { loaded: [], failed: [] };\n }\n await reconcilePlugins(projectDir, plugins, opts);\n return loadPlugins(projectDir, plugins, registry, { log: opts.log });\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../cli/src/plugin-store/paths.ts","../cli/src/plugin-store/spec.ts","../cli/src/plugin-store/load.ts","../cli/src/plugin-store/reconcile.ts","../cli/src/plugin-store/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAUO,SAAS,WAAW,UAAA,EAA4B;AACrD,EAAA,OAAO,IAAA,CAAK,UAAA,EAAY,SAAA,EAAW,SAAS,CAAA;AAC9C;AAGO,SAAS,eAAe,UAAA,EAA4B;AACzD,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG,cAAc,CAAA;AACpD;AAGO,SAAS,eAAe,UAAA,EAA4B;AACzD,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG,cAAc,CAAA;AACpD;AAGO,SAAS,kBAAkB,UAAA,EAA4B;AAC5D,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG,iBAAiB,CAAA;AACvD;AAOO,SAAS,kBAAA,CAAmB,YAAoB,OAAA,EAAyB;AAC9E,EAAA,OAAO,IAAA,CAAK,cAAA,CAAe,UAAU,CAAA,EAAG,OAAO,CAAA;AACjD;;;ACbO,SAAS,UAAU,IAAA,EAA0B;AAClD,EAAA,MAAM,OAAA,GAAU,KAAK,IAAA,EAAK;AAC1B,EAAA,IAAI,CAAC,OAAA,EAAS,MAAM,IAAI,MAAM,4BAA4B,CAAA;AAI1D,EAAA,MAAM,EAAA,GAAK,OAAA,CAAQ,WAAA,CAAY,GAAG,CAAA;AAClC,EAAA,IAAI,MAAM,CAAA,EAAG;AACX,IAAA,OAAO,EAAE,IAAA,EAAM,OAAA,EAAS,KAAA,EAAO,GAAA,EAAI;AAAA,EACrC;AACA,EAAA,MAAM,IAAA,GAAO,OAAA,CAAQ,KAAA,CAAM,CAAA,EAAG,EAAE,CAAA;AAChC,EAAA,MAAM,KAAA,GAAQ,OAAA,CAAQ,KAAA,CAAM,EAAA,GAAK,CAAC,CAAA;AAClC,EAAA,OAAO,EA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C,EAAA,IAAI,UAAA,CAAW,QAAQ,CAAA,EAAG;AACxB,IAAA,MAAM,IAAA,GAAO,YAAA,CAAa,QAAA,EAAU,MAAM,EAAE,IAAA,EAAK;AACjD,IAAA,IAAI,SAAS,QAAA,EAAU;AACrB,MAAA,OAAO,EAAE,OAAA,EAAS,KAAA,EAAO,MAAA,EAAQ,YAAA,EAAa;AAAA,IAChD;AAAA,EACF;AAEA,EAAA,gBAAA,CAAiB,YAAY,OAAO,CAAA;AAEpC,EAAA,MAAM,OAAA,GAAU,KAAK,UAAA,IAAc,cAAA;AACnC,EAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,UAAA,CAAW,UAAU,CAAC,CAAA;AACnD,EAAA,IAAI,CAAC,OAAO,EAAA,EAAI;AACd,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA;AAAA,EAA2B,MAAA,CAAO,MAAM,CAAA,CAAE,CAAA;AAAA,EAC5D;AAEA,EAAA,aAAA,CAAc,UAAU,QAAQ,CAAA;AAChC,EAAA,OAAO,EAAE,OAAA,EAAS,IAAA,EAAM,MAAA,EAAQ,YAAA,EAAa;AAC/C;;;ACxFA,eAAsB,oBACpB,UAAA,EACA,OAAA,EACA,WAA2B,cAAA,EAC3B,IAAA,GAA6B,EAAC,EACT;AACrB,EAAA,IAAI,CAAC,OAAA,IAAW,OAAA,CAAQ,MAAA,KAAW,CAAA,EAAG;AACpC,IAAA,OAAO,EAAE,MAAA,EAAQ,EAAC,EAAG,MAAA,EAAQ,EAAC,EAAE;AAAA,EAClC;AACA,EAAA,MAAM,gBAAA,CAAiB,UAAA,EAAY,OAAA,EAAS,IAAI,CAAA;AAChD,EAAA,OAAO,WAAA,CAAY,YAAY,OAAA,EAAS,QAAA,EAAU,EAAE,GAAA,EAAK,IAAA,CAAK,KAAK,CAAA;AACrE","file":"plugin-store-R2WLXRT3.js","sourcesContent":["/**\n * Pure path helpers for the project-local plugin store.\n *\n * The store is a self-contained npm workspace owned by the CLI under\n * `<projectDir>/.skaile/plugins/`. Nothing here touches the filesystem.\n */\n\nimport { join } from \"node:path\";\n\n/** `<projectDir>/.skaile/plugins` — the store root. */\nexport function pluginsDir(projectDir: string): string {\n return join(projectDir, \".skaile\", \"plugins\");\n}\n\n/** `<store>/package.json` — generated, never user-edited. */\nexport function pluginsPkgJson(projectDir: string): string {\n return join(pluginsDir(projectDir), \"package.json\");\n}\n\n/** `<store>/node_modules` — where reconciled plugin packages land. */\nexport function nodeModulesDir(projectDir: string): string {\n return join(pluginsDir(projectDir), \"node_modules\");\n}\n\n/** `<store>/.reconcile-hash` — SHA of plugins-list + lock slice; skip reinstall when unchanged. */\nexport function reconcileHashFile(projectDir: string): string {\n return join(pluginsDir(projectDir), \".reconcile-hash\");\n}\n\n/**\n * Absolute path to a plugin package's entry directory under the store's\n * `node_modules`. Dynamic `import()` against this absolute path works inside\n * compiled binaries via `pathToFileURL`.\n */\nexport function resolvePluginEntry(projectDir: string, pkgName: string): string {\n return join(nodeModulesDir(projectDir), pkgName);\n}\n","/**\n * Parse npm package specifiers from the `plugins:` list into name + range.\n *\n * The leading `@` of a scope is NOT a separator: only the last `@` at a\n * non-zero index splits the package name from its semver range.\n * \"@skaile/provider-fly@^0.1.0\" → { name: \"@skaile/provider-fly\", range: \"^0.1.0\" }\n * \"@skaile/connector-redis\" → { name: \"@skaile/connector-redis\", range: \"*\" }\n * \"lodash@^4\" → { name: \"lodash\", range: \"^4\" }\n */\n\n/** A parsed plugin specifier: package name plus a semver range (`\"*\"` when omitted). */\nexport interface PluginSpec {\n name: string;\n range: string;\n}\n\n/**\n * Parse a single plugin specifier into `{ name, range }`.\n *\n * @param spec - An npm specifier, e.g. `\"@skaile/provider-fly@^0.1.0\"` or `\"lodash\"`.\n * @returns The package name and semver range (range defaults to `\"*\"`).\n * @throws Error when the specifier is empty.\n */\nexport function parseSpec(spec: string): PluginSpec {\n const trimmed = spec.trim();\n if (!trimmed) throw new Error(\"parseSpec: empty specifier\");\n\n // Find the version-separating `@` — the last one that is not the scope `@`\n // at index 0. A bare `@scope/name` has its only `@` at index 0 (no range).\n const at = trimmed.lastIndexOf(\"@\");\n if (at <= 0) {\n return { name: trimmed, range: \"*\" };\n }\n const name = trimmed.slice(0, at);\n const range = trimmed.slice(at + 1);\n return { name, range: range.length > 0 ? range : \"*\" };\n}\n\n/** Convenience: just the package name of a specifier. */\nexport function specName(spec: string): string {\n return parseSpec(spec).name;\n}\n","/**\n * Runtime plugin loader: dynamic-import each reconciled plugin and let it\n * self-register into the `pluginRegistry`.\n *\n * Each plugin specifier resolves to an absolute path under the store's\n * `node_modules`; we import it via a `file://` URL so the import works inside\n * `bun --compile` binaries (which bundle only the literal-string switches, but\n * can still execute a `file://` import against the unpacked store on disk).\n * Failures are caught per-plugin so one broken plugin never aborts the rest.\n */\n\nimport { pathToFileURL } from \"node:url\";\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { resolvePluginEntry } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/** Options for {@link loadPlugins}. */\nexport interface LoadOptions {\n log?: Logger;\n}\n\n/** Result of a load pass: which specs registered and which failed. */\nexport interface LoadResult {\n loaded: string[];\n failed: { spec: string; error: string }[];\n}\n\n/** The self-registration entrypoint a plugin module is expected to export. */\ntype PluginModule = { register?: (registry: PluginRegistry) => void };\n\n/**\n * Load and register each plugin in `plugins` into `registry`.\n *\n * @param projectDir - Project root holding `.skaile/plugins/node_modules`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param registry - Registry to register into. Defaults to the process-wide `pluginRegistry`.\n * @param opts - Optional logger.\n * @returns Loaded specs + per-plugin failures (never throws).\n */\nexport async function loadPlugins(\n projectDir: string,\n plugins: string[],\n registry: PluginRegistry = pluginRegistry,\n opts: LoadOptions = {},\n): Promise<LoadResult> {\n const loaded: string[] = [];\n const failed: { spec: string; error: string }[] = [];\n\n for (const spec of plugins) {\n try {\n const { name } = parseSpec(spec);\n const entry = resolvePluginEntry(projectDir, name);\n const mod = (await import(pathToFileURL(entry).href)) as PluginModule;\n if (typeof mod.register !== \"function\") {\n throw new Error(`plugin \"${name}\" does not export a register() function`);\n }\n mod.register(registry);\n loaded.push(spec);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n failed.push({ spec, error: `failed to load plugin \"${spec}\": ${message}` });\n opts.log?.warn(`plugin load failed: ${spec}`, { error: message });\n }\n }\n\n return { loaded, failed };\n}\n","/**\n * Reconcile the project-local plugin store (`<projectDir>/.skaile/plugins/`).\n *\n * The reconciler is hash-skipped: it computes a SHA-256 over the sorted plugin\n * list plus the lock file's `plugins` slice and compares it to the stored\n * `.reconcile-hash`. On a match it returns with zero further I/O; otherwise it\n * regenerates the store's `package.json` and runs `bun install` against it.\n *\n * The install step is injectable (`InstallFn`) so tests stay hermetic — they\n * pass a fake installer that records calls and writes a stub `node_modules`.\n */\n\nimport { createHash } from \"node:crypto\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { readPluginsLockSlice } from \"@skaile/workspaces/core\";\nimport { pluginsDir, pluginsPkgJson, reconcileHashFile } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/**\n * Installs the store's dependencies. Returns `ok: false` (never throws) on a\n * failed install so the reconciler can surface the captured `output`.\n */\nexport type InstallFn = (pluginsDir: string) => Promise<{ ok: boolean; output: string }>;\n\n/** Options for {@link reconcilePlugins}. */\nexport interface ReconcileOptions {\n /** Injectable installer. Defaults to a real `bun install` of the store. */\n runInstall?: InstallFn;\n /**\n * Lock slice to fold into the reconcile-hash. Defaults to\n * `readPluginsLockSlice(projectDir)` so a lock edit invalidates the hash.\n */\n lockSlice?: unknown;\n}\n\n/** Result of a reconcile pass. */\nexport interface ReconcileResult {\n changed: boolean;\n reason: \"no-plugins\" | \"up-to-date\" | \"reconciled\";\n}\n\n/**\n * The default real installer: `bun install` inside the store directory.\n * Frozen on subsequent runs (a `bun.lock`/`bun.lockb` already exists), and\n * non-frozen on the first run so a lock can be generated.\n */\nexport const defaultInstall: InstallFn = async (dir) => {\n const { portableSpawn } = await import(\"@skaile/workspaces/core\");\n const hasLock =\n existsSync(`${dir}/bun.lock`) ||\n existsSync(`${dir}/bun.lockb`) ||\n existsSync(`${dir}/package-lock.json`);\n const args = hasLock ? [\"bun\", \"install\", \"--frozen-lockfile\"] : [\"bun\", \"install\"];\n const proc = portableSpawn(args, { cwd: dir });\n const chunks: string[] = [];\n const decoder = new TextDecoder();\n const pump = async (stream: ReadableStream<Uint8Array>) => {\n const reader = stream.getReader();\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n if (value) chunks.push(decoder.decode(value, { stream: true }));\n }\n };\n await Promise.all([pump(proc.stdout), pump(proc.stderr)]);\n const code = await proc.exited;\n return { ok: code === 0, output: chunks.join(\"\") };\n};\n\n/** Generate the store's `package.json` from the plugin specs. */\nfunction writePackageJson(projectDir: string, plugins: string[]): void {\n const dependencies: Record<string, string> = {};\n for (const spec of plugins) {\n const { name, range } = parseSpec(spec);\n dependencies[name] = range;\n }\n const pkg = {\n name: \"skaile-project-plugins\",\n private: true,\n dependencies,\n };\n mkdirSync(pluginsDir(projectDir), { recursive: true });\n writeFileSync(pluginsPkgJson(projectDir), `${JSON.stringify(pkg, null, 2)}\\n`);\n}\n\n/**\n * Reconcile the plugin store for a project.\n *\n * @param projectDir - Project root containing `skaile.yaml` / `skaile.lock.yaml`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param opts - Optional injectable installer + lock slice override.\n * @returns Whether the store changed and why.\n */\nexport async function reconcilePlugins(\n projectDir: string,\n plugins: string[],\n opts: ReconcileOptions = {},\n): Promise<ReconcileResult> {\n if (plugins.length === 0) {\n return { changed: false, reason: \"no-plugins\" };\n }\n\n const lockSlice = opts.lockSlice ?? readPluginsLockSlice(projectDir);\n const wantHash = createHash(\"sha256\")\n .update(JSON.stringify({ plugins: [...plugins].sort(), lock: lockSlice }))\n .digest(\"hex\");\n\n const hashFile = reconcileHashFile(projectDir);\n if (existsSync(hashFile)) {\n const have = readFileSync(hashFile, \"utf8\").trim();\n if (have === wantHash) {\n return { changed: false, reason: \"up-to-date\" };\n }\n }\n\n writePackageJson(projectDir, plugins);\n\n const install = opts.runInstall ?? defaultInstall;\n const result = await install(pluginsDir(projectDir));\n if (!result.ok) {\n throw new Error(`plugin install failed:\\n${result.output}`);\n }\n\n writeFileSync(hashFile, wantHash);\n return { changed: true, reason: \"reconciled\" };\n}\n","/**\n * The project-local plugin store: reconcile (`<projectDir>/.skaile/plugins/`)\n * then load the reconciled plugins into the `pluginRegistry`.\n *\n * `ensurePluginsLoaded` is the single entrypoint commands wire in. It is a\n * guarded no-op when `plugins` is empty/undefined — zero overhead for the\n * common case where no project declares `plugins:` in `skaile.yaml`.\n */\n\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { type LoadResult, loadPlugins } from \"./load.js\";\nimport { type ReconcileOptions, reconcilePlugins } from \"./reconcile.js\";\n\nexport type { LoadResult } from \"./load.js\";\nexport { loadPlugins } from \"./load.js\";\nexport type { ReconcileOptions } from \"./reconcile.js\";\nexport { reconcilePlugins } from \"./reconcile.js\";\nexport { specName } from \"./spec.js\";\n\n/** Options for {@link ensurePluginsLoaded}. */\nexport interface EnsurePluginsOptions extends ReconcileOptions {\n log?: Logger;\n}\n\n/**\n * Reconcile the plugin store then load each plugin into `registry`.\n *\n * No-op (returns immediately) when `plugins` is empty/undefined, so the common\n * no-plugins path costs nothing.\n *\n * @param projectDir - Project root.\n * @param plugins - The `skaile.yaml` `plugins:` list (may be undefined).\n * @param registry - Registry to register into. Defaults to `pluginRegistry`.\n * @param opts - Injectable installer / lock slice + optional logger.\n * @returns The load result, or an empty result when there are no plugins.\n */\nexport async function ensurePluginsLoaded(\n projectDir: string,\n plugins: string[] | undefined,\n registry: PluginRegistry = pluginRegistry,\n opts: EnsurePluginsOptions = {},\n): Promise<LoadResult> {\n if (!plugins || plugins.length === 0) {\n return { loaded: [], failed: [] };\n }\n await reconcilePlugins(projectDir, plugins, opts);\n return loadPlugins(projectDir, plugins, registry, { log: opts.log });\n}\n"]}
|
package/dist/runner/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CapabilityRegistry, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, MarkdownStreamer, PreInitRingSink, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildContextSection, buildEnvironmentSection, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureGitConfigInclude, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, touchSession, writeClaudeCodeCredentialsFile } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CapabilityRegistry, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, MarkdownStreamer, PreInitRingSink, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, builtinCapabilities, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, createAgentSession, createSessionStimulusBus, defineCapability, deleteSession, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureGitConfigInclude, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, installPreInitRingSink, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadSession, loadSessionById, mcpAuthSecretKey, newSession, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveMixin, runAgentChat, saveSession, setCurrentSession, startAgentServer, touchSession, writeClaudeCodeCredentialsFile } from '../chunk-FDLVPYSN.js';
|
|
2
|
+
import '../chunk-YPRW2ROJ.js';
|
|
3
3
|
import '../chunk-X5YPJV4N.js';
|
|
4
4
|
import '../chunk-O7SG5PC2.js';
|
|
5
5
|
import '../chunk-7QBNJTTQ.js';
|
|
@@ -8,26 +8,26 @@ import '../chunk-WQ7DE5UC.js';
|
|
|
8
8
|
import '../chunk-32NA4TVC.js';
|
|
9
9
|
export { assembleSystemPrompt, buildCapabilitiesPromptSection, buildLinkedPeersPromptSection } from '../chunk-W3UDISS2.js';
|
|
10
10
|
import '../chunk-TDSRLMDB.js';
|
|
11
|
-
import '../chunk-
|
|
11
|
+
import '../chunk-5IXCNMMU.js';
|
|
12
12
|
import '../chunk-RRVQAE5D.js';
|
|
13
13
|
import '../chunk-BMQKMOQY.js';
|
|
14
|
-
import '../chunk-
|
|
15
|
-
import '../chunk-
|
|
14
|
+
import '../chunk-GAH4YRCI.js';
|
|
15
|
+
import '../chunk-KM6DCR7A.js';
|
|
16
16
|
import '../chunk-LV2HPH3C.js';
|
|
17
|
-
import '../chunk-
|
|
17
|
+
import '../chunk-JNH6TTIO.js';
|
|
18
18
|
import '../chunk-OVRSNIKJ.js';
|
|
19
|
-
import '../chunk-
|
|
19
|
+
import '../chunk-MCQ4TJ3P.js';
|
|
20
20
|
import '../chunk-XT6AZWK3.js';
|
|
21
21
|
import '../chunk-6E6PKKAD.js';
|
|
22
22
|
import '../chunk-X46FY45B.js';
|
|
23
23
|
import '../chunk-DEYYRFQU.js';
|
|
24
24
|
import '../chunk-IFGTRL2I.js';
|
|
25
|
-
export { globalSettingsPath, loadSettings, mapLegacyFields, projectSettingsPath, resolveSettings, saveSettings } from '../chunk-
|
|
26
|
-
import '../chunk-
|
|
27
|
-
import '../chunk-
|
|
28
|
-
import '../chunk-
|
|
29
|
-
import '../chunk-
|
|
30
|
-
import '../chunk-
|
|
25
|
+
export { globalSettingsPath, loadSettings, mapLegacyFields, projectSettingsPath, resolveSettings, saveSettings } from '../chunk-2Q6OY3SU.js';
|
|
26
|
+
import '../chunk-5DPQ766L.js';
|
|
27
|
+
import '../chunk-56YT6CWS.js';
|
|
28
|
+
import '../chunk-SAXDHVJZ.js';
|
|
29
|
+
import '../chunk-MAPRKFBD.js';
|
|
30
|
+
import '../chunk-BM7XANVN.js';
|
|
31
31
|
import '../chunk-XGCXFX7X.js';
|
|
32
32
|
export { DRIVER_TARGETS, SUPPORTED_DRIVER_TARGETS } from '../chunk-O4JH3KUE.js';
|
|
33
33
|
export { DRIVER_DEFAULTS, resolveDriverPaths } from '../chunk-K5GBV4SA.js';
|
|
@@ -116,7 +116,30 @@ export declare class ExternalMcpManager {
|
|
|
116
116
|
* logged and skipped so a single bad server never blocks the session.
|
|
117
117
|
*/
|
|
118
118
|
start(declarations: McpServerDeclaration[]): Promise<void>;
|
|
119
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Connect one MCP server and register its tools into the capability registry.
|
|
121
|
+
* Returns the server id and the registered tool capability names.
|
|
122
|
+
* Throws if the id is already registered or if connect/listTools fails.
|
|
123
|
+
*/
|
|
124
|
+
addServer(decl: McpServerDeclaration): Promise<{
|
|
125
|
+
id: string;
|
|
126
|
+
toolNames: string[];
|
|
127
|
+
}>;
|
|
128
|
+
/**
|
|
129
|
+
* Deregister a running MCP server's tools and close its client.
|
|
130
|
+
* No-op when the id is not found.
|
|
131
|
+
*
|
|
132
|
+
* Drains any in-flight reauth first: a doReauthAndReconnect resolving after
|
|
133
|
+
* splice would swap server.client to a freshly-connected client that nothing
|
|
134
|
+
* then closes, leaking the transport/subprocess.
|
|
135
|
+
*/
|
|
136
|
+
removeServer(id: string): Promise<void>;
|
|
137
|
+
/** Summary of every currently-connected MCP server. */
|
|
138
|
+
listServers(): Array<{
|
|
139
|
+
id: string;
|
|
140
|
+
transport: "stdio" | "sse" | "http";
|
|
141
|
+
toolCount: number;
|
|
142
|
+
}>;
|
|
120
143
|
/**
|
|
121
144
|
* Connect, re-minting once on an initial-connect 401: the provisioned bearer
|
|
122
145
|
* may already be stale by the time the server is reached. Only retries for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-mcp.d.ts","sourceRoot":"","sources":["../../../runner/src/external-mcp.ts"],"names":[],"mappings":"AAmCA,OAAO,EAA6B,KAAK,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAanE;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CAC1C;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,OAAO,EAAE,kBAAkB,GAAG,SAAS,GACtC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOxB;AAaD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GACjB,oBAAoB,EAAE,CA8CxB;AA2GD,gEAAgE;AAChE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CA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,SAAS,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IA2CzF;;;;;;;OAOG;IACG,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkB7C,uDAAuD;IACvD,WAAW,IAAI,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAQ5F;;;;OAIG;YACW,iBAAiB;IAc/B;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;YAOZ,oBAAoB;IAgClC;;;;;;;OAOG;IACH,OAAO,CAAC,mBAAmB;IAwD3B;;;;;;;;OAQG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAiB/B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wires the `runner.add_mcp_server` capability to the live session's
|
|
3
|
+
* `ExternalMcpManager` + `PreMintedSecretProvider`. Free of `serve.ts`
|
|
4
|
+
* imports — the dependency direction stays acyclic. The caller passes getters
|
|
5
|
+
* because `serve.ts` lazily constructs the manager and secrets provider.
|
|
6
|
+
*
|
|
7
|
+
* @category Runtime
|
|
8
|
+
* @since 3.6.0
|
|
9
|
+
*/
|
|
10
|
+
import type { McpServerDeclaration } from "@skaile/workspaces/core";
|
|
11
|
+
import type { PreMintedSecretProvider } from "@skaile/workspaces/connectors";
|
|
12
|
+
import type { ExternalMcpManager } from "./external-mcp.js";
|
|
13
|
+
export interface McpRuntimeHandlerDeps {
|
|
14
|
+
/** Returns `null` during the brief session-recreate gap; guard before use. */
|
|
15
|
+
getOrCreateMcpManager: () => ExternalMcpManager | null;
|
|
16
|
+
/** `null` when the session has no pre-minted secret store yet (CLI mode). */
|
|
17
|
+
getPreMintedSecrets: () => PreMintedSecretProvider | null;
|
|
18
|
+
/** True when the active driver picks up newly-registered capabilities without a session restart. */
|
|
19
|
+
driverPicksUpToolsLive: () => boolean;
|
|
20
|
+
emitResourcesAvailable: () => void;
|
|
21
|
+
log: (msg: string) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface McpRuntimeHandlers {
|
|
24
|
+
addMcpServer?: (input: {
|
|
25
|
+
declaration: McpServerDeclaration;
|
|
26
|
+
preMintedToken?: {
|
|
27
|
+
token: string;
|
|
28
|
+
expiresAt?: string | null;
|
|
29
|
+
};
|
|
30
|
+
}) => Promise<{
|
|
31
|
+
ok: true;
|
|
32
|
+
id: string;
|
|
33
|
+
live: boolean;
|
|
34
|
+
toolCount: number;
|
|
35
|
+
} | {
|
|
36
|
+
ok: false;
|
|
37
|
+
code: string;
|
|
38
|
+
message: string;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
export declare function buildMcpRuntimeHandlers(deps: McpRuntimeHandlerDeps): McpRuntimeHandlers;
|
|
42
|
+
//# sourceMappingURL=mcp-runtime-handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-runtime-handlers.d.ts","sourceRoot":"","sources":["../../../runner/src/mcp-runtime-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,MAAM,WAAW,qBAAqB;IACpC,8EAA8E;IAC9E,qBAAqB,EAAE,MAAM,kBAAkB,GAAG,IAAI,CAAC;IACvD,6EAA6E;IAC7E,mBAAmB,EAAE,MAAM,uBAAuB,GAAG,IAAI,CAAC;IAC1D,oGAAoG;IACpG,sBAAsB,EAAE,MAAM,OAAO,CAAC;IACtC,sBAAsB,EAAE,MAAM,IAAI,CAAC;IACnC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE;QACrB,WAAW,EAAE,oBAAoB,CAAC;QAClC,cAAc,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC;KAC/D,KAAK,OAAO,CACT;QAAE,EAAE,EAAE,IAAI,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAC1D;QAAE,EAAE,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAC/C,CAAC;CACH;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,qBAAqB,GAAG,kBAAkB,CAqCvF"}
|
|
@@ -11,6 +11,7 @@ import { type ConnectorChangeEvent, type PreMintedSecretProvider, type SyncStatu
|
|
|
11
11
|
import { type RuntimeAssetsResult } from "@skaile/workspaces/core";
|
|
12
12
|
import type { ConnectorStatusEvent } from "@skaile/workspaces/types";
|
|
13
13
|
import type { CapabilityRegistry } from "./capability-registry.js";
|
|
14
|
+
import { ExternalMcpManager } from "./external-mcp.js";
|
|
14
15
|
/**
|
|
15
16
|
* Result of {@link buildAgentResources}.
|
|
16
17
|
*
|
|
@@ -41,6 +42,15 @@ export interface AgentResourcesResult {
|
|
|
41
42
|
* block session startup.
|
|
42
43
|
*/
|
|
43
44
|
startWatching: () => void;
|
|
45
|
+
/**
|
|
46
|
+
* Lazily construct (once) and return the session's external MCP manager —
|
|
47
|
+
* the live target for `runner.add_mcp_server`. Reassigns the same local that
|
|
48
|
+
* `dispose()` reads, so a runtime-created manager is torn down on teardown.
|
|
49
|
+
* Serve mode only (requires a capability registry); throws otherwise.
|
|
50
|
+
*/
|
|
51
|
+
getOrCreateExternalMcpManager: () => ExternalMcpManager;
|
|
52
|
+
/** The external MCP manager if constructed (boot or lazy), else null. */
|
|
53
|
+
getExternalMcpManager: () => ExternalMcpManager | null;
|
|
44
54
|
}
|
|
45
55
|
/**
|
|
46
56
|
* Callback hooks for filesystem and connector lifecycle events.
|
|
@@ -112,4 +122,6 @@ export declare function buildAgentResources(projectDir: string, driverType: stri
|
|
|
112
122
|
model?: string;
|
|
113
123
|
sessionId?: string;
|
|
114
124
|
}, tokenMediator?: TokenMediator, preMintedSecrets?: PreMintedSecretProvider, deferFilesystemMounts?: boolean, capabilityRegistry?: CapabilityRegistry): Promise<AgentResourcesResult>;
|
|
125
|
+
/** `MCP__<sanitized id>__AUTH` — cross-repo contract: must mirror the platform's bearer-provisioning key. */
|
|
126
|
+
export declare function mcpAuthSecretKey(id: string): string;
|
|
115
127
|
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../runner/src/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAGL,KAAK,oBAAoB,EAMzB,KAAK,uBAAuB,
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../runner/src/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAGL,KAAK,oBAAoB,EAMzB,KAAK,uBAAuB,EAI5B,KAAK,iBAAiB,EACtB,KAAK,aAAa,EACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,KAAK,mBAAmB,EAEzB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EACL,kBAAkB,EAKnB,MAAM,mB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E;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,EACvE,aAAa,CAAC,EAAE,aAAa,EAC7B,gBAAgB,CAAC,EAAE,uBAAuB,EAC1C,qBAAqB,CAAC,EAAE,OAAO,EAC/B,kBAAkB,CAAC,EAAE,kBAAkB,GACtC,OAAO,CAAC,oBAAoB,CAAC,CAiN/B;AAuLD,6GAA6G;AAC7G,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEnD"}
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
* @category Runtime
|
|
24
24
|
* @since 3.0.0
|
|
25
25
|
*/
|
|
26
|
+
import type { McpServerDeclaration } from "@skaile/workspaces/core";
|
|
26
27
|
import type { CredentialMint } from "@skaile/workspaces/types";
|
|
28
|
+
import * as z from "zod";
|
|
27
29
|
import { type DefinedCapability } from "./define-capability.js";
|
|
28
30
|
/**
|
|
29
31
|
* Per-session handlers that runner-side capabilities delegate into. The
|
|
@@ -130,7 +132,38 @@ export interface RunnerCapabilityHandlers {
|
|
|
130
132
|
}) => Promise<{
|
|
131
133
|
ok: true;
|
|
132
134
|
}>;
|
|
135
|
+
/**
|
|
136
|
+
* Live-attach a remote MCP server to the running session. Stages the
|
|
137
|
+
* pre-minted bearer then delegates to `ExternalMcpManager.addServer`.
|
|
138
|
+
*/
|
|
139
|
+
addMcpServer?: (input: {
|
|
140
|
+
declaration: McpServerDeclaration;
|
|
141
|
+
preMintedToken?: {
|
|
142
|
+
token: string;
|
|
143
|
+
expiresAt?: string | null;
|
|
144
|
+
};
|
|
145
|
+
}) => Promise<{
|
|
146
|
+
ok: true;
|
|
147
|
+
id: string;
|
|
148
|
+
live: boolean;
|
|
149
|
+
toolCount: number;
|
|
150
|
+
} | {
|
|
151
|
+
ok: false;
|
|
152
|
+
code: string;
|
|
153
|
+
message: string;
|
|
154
|
+
}>;
|
|
133
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* Wire-contract input schema for `runner.add_mcp_server`. Exported so the
|
|
158
|
+
* wire-contract fixture can assert the shape without importing the handler.
|
|
159
|
+
*/
|
|
160
|
+
export declare const addMcpServerInputSchema: z.ZodObject<{
|
|
161
|
+
declaration: z.ZodUnknown;
|
|
162
|
+
preMintedToken: z.ZodOptional<z.ZodObject<{
|
|
163
|
+
token: z.ZodString;
|
|
164
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
165
|
+
}, z.core.$strip>>;
|
|
166
|
+
}, z.core.$strict>;
|
|
134
167
|
/**
|
|
135
168
|
* Build the seven `runner.*` capabilities. Caller registers each with
|
|
136
169
|
* `capabilityRegistry.register(cap, "agent")`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner-capabilities.d.ts","sourceRoot":"","sources":["../../../runner/src/runner-capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;
|
|
1
|
+
{"version":3,"file":"runner-capabilities.d.ts","sourceRoot":"","sources":["../../../runner/src/runner-capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAY,MAAM,0BAA0B,CAAC;AACzE,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,KAAK,iBAAiB,EAAoB,MAAM,wBAAwB,CAAC;AAElF;;;;;;;;GAQG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;QACjB,WAAW,EAAE,OAAO,CAAC;QACrB,cAAc,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,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up sequence. serve.ts retains: EventNormalizer, lazy start (driverStarted flag),
|
|
31
31
|
* transport setup, and lifecycle command handling.
|
|
32
32
|
*/
|
|
33
|
-
import
|
|
33
|
+
import { ConnectorManager } from "@skaile/workspaces/connectors";
|
|
34
|
+
import type { AgentEvent, ConnectorsAvailableEvent, ServerTransport } from "@skaile/workspaces/types";
|
|
34
35
|
import { CLAUDE_CODE_CREDENTIALS_KEY, extractClaudeAiOauthExpiresAt, writeClaudeCodeCredentialsFile } from "./serve-credentials.js";
|
|
35
36
|
import { type AgentSession } from "./session-builder.js";
|
|
36
37
|
/**
|
|
@@ -50,6 +51,22 @@ import { type AgentSession } from "./session-builder.js";
|
|
|
50
51
|
* @since 2026-05
|
|
51
52
|
*/
|
|
52
53
|
export declare function emitSystemPromptComposed(agentSession: AgentSession, sendEvent: (e: AgentEvent) => void): void;
|
|
54
|
+
/** Minimal view of `ExternalMcpManager` needed to render the wire payload. */
|
|
55
|
+
export type McpServerLister = {
|
|
56
|
+
listServers(): Array<{
|
|
57
|
+
id: string;
|
|
58
|
+
transport: "stdio" | "sse" | "http";
|
|
59
|
+
toolCount: number;
|
|
60
|
+
}>;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Build the `resources_available` wire payload: connector/mount split plus the
|
|
64
|
+
* live MCP server list. Every MCP server is stamped with `live` — whether the
|
|
65
|
+
* active driver already sees its tools without a session restart.
|
|
66
|
+
*
|
|
67
|
+
* Exported for unit testing.
|
|
68
|
+
*/
|
|
69
|
+
export declare function buildResourcesAvailablePayload(manager: ConnectorManager | null, mcpManager: McpServerLister | null, driverLive: boolean): ConnectorsAvailableEvent;
|
|
53
70
|
/**
|
|
54
71
|
* Phase 4.8 — Claude Code subscription credentials provisioning.
|
|
55
72
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../runner/src/serve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;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IACd,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sEAAsE;IACtE,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA84ExE"}
|
|
@@ -200,6 +200,14 @@ export interface AgentSession {
|
|
|
200
200
|
dispose: () => Promise<void>;
|
|
201
201
|
/** Start filesystem and connector watchers. Call after transport is listening. */
|
|
202
202
|
startWatching: () => void;
|
|
203
|
+
/**
|
|
204
|
+
* Lazily construct (once) and return the session's external MCP manager —
|
|
205
|
+
* the live target for `runner.add_mcp_server`. Serve mode only; throws when
|
|
206
|
+
* no capability registry was supplied (CLI/flow).
|
|
207
|
+
*/
|
|
208
|
+
getOrCreateExternalMcpManager: () => import("./external-mcp.js").ExternalMcpManager;
|
|
209
|
+
/** The external MCP manager if constructed (boot or lazy), else null. */
|
|
210
|
+
getExternalMcpManager: () => import("./external-mcp.js").ExternalMcpManager | null;
|
|
203
211
|
/** Telemetry provider for this session (noop if not configured). */
|
|
204
212
|
telemetry?: TelemetryProvider;
|
|
205
213
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-builder.d.ts","sourceRoot":"","sources":["../../../runner/src/session-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEpF,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,KAAK,mBAAmB,EAA2B,MAAM,4BAA4B,CAAC;AAK/F,OAAO,EAAuB,KAAK,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAElF,YAAY,EAAE,sBAAsB,EAAE,CAAC;AAMvC;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CA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AM,OAAO,mBAAmB,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACnF,oEAAoE;IACpE,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B;;;;;;;;;OASG;IACH,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;CAC7C;AAMD;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CAuL1F"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @category Runtime
|
|
9
9
|
* @since 3.1.0
|
|
10
10
|
*/
|
|
11
|
-
import type { ConnectorManager, PreMintedSecretProvider } from "@skaile/workspaces/connectors";
|
|
11
|
+
import type { ConnectorManager, PreMintedCredential, PreMintedSecretProvider } from "@skaile/workspaces/connectors";
|
|
12
12
|
import type { RunnerCapabilityHandlers } from "./runner-capabilities.js";
|
|
13
13
|
export interface SessionResourceHandlerDeps {
|
|
14
14
|
/** The live unified connector manager, or null before the session is built. */
|
|
@@ -19,5 +19,9 @@ export interface SessionResourceHandlerDeps {
|
|
|
19
19
|
emitResourcesAvailable: () => void;
|
|
20
20
|
log: (msg: string) => void;
|
|
21
21
|
}
|
|
22
|
+
export declare function toPreMinted(token: {
|
|
23
|
+
token: string;
|
|
24
|
+
expiresAt?: string | null;
|
|
25
|
+
}): PreMintedCredential;
|
|
22
26
|
export declare function buildSessionResourceHandlers(deps: SessionResourceHandlerDeps): Pick<RunnerCapabilityHandlers, "addConnector" | "addMount" | "removeResource" | "updateCredential">;
|
|
23
27
|
//# sourceMappingURL=session-resource-handlers.d.ts.map
|