@skaile/workspaces 0.41.5 → 0.42.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 +85 -0
- package/dist/{asset-feeds-FKD5AB2R.js → asset-feeds-UPJJGR3O.js} +8 -8
- package/dist/{asset-feeds-FKD5AB2R.js.map → asset-feeds-UPJJGR3O.js.map} +1 -1
- package/dist/asset-manager/index.js +6 -6
- package/dist/asset-manager/installer.js +5 -5
- package/dist/bridge/drivers/claude-sdk.js +112 -7
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +1 -1
- package/dist/bridge/drivers/continue.js +2 -2
- package/dist/bridge/drivers/echo.js +1 -1
- package/dist/bridge/drivers/gemini.js +3 -3
- package/dist/bridge/drivers/goose.js +2 -2
- package/dist/bridge/drivers/omp.js +1 -1
- package/dist/bridge/drivers/opencode.js +2 -2
- package/dist/bridge/drivers/qwen.js +3 -3
- package/dist/bridge/index.js +2 -2
- package/dist/bridge/src/drivers/claude-sdk.d.ts +6 -0
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/drivers/sanitize-assistant-text.d.ts +53 -0
- package/dist/bridge/src/drivers/sanitize-assistant-text.d.ts.map +1 -0
- package/dist/{chunk-J4RF5ABK.js → chunk-2BEDUMTA.js} +3 -3
- package/dist/{chunk-J4RF5ABK.js.map → chunk-2BEDUMTA.js.map} +1 -1
- package/dist/{chunk-IODU6UDT.js → chunk-2MVQ7UAT.js} +2 -2
- package/dist/{chunk-IODU6UDT.js.map → chunk-2MVQ7UAT.js.map} +1 -1
- package/dist/{chunk-5VJVSYXX.js → chunk-3HUUP3JC.js} +41 -3
- package/dist/chunk-3HUUP3JC.js.map +1 -0
- package/dist/{chunk-SBGHNXJD.js → chunk-3K2CYDBT.js} +17 -7
- package/dist/chunk-3K2CYDBT.js.map +1 -0
- package/dist/{chunk-ACB3AOII.js → chunk-4MO456BV.js} +5 -5
- package/dist/{chunk-ACB3AOII.js.map → chunk-4MO456BV.js.map} +1 -1
- package/dist/{chunk-5IXCNMMU.js → chunk-5C3QJSOD.js} +3 -3
- package/dist/{chunk-5IXCNMMU.js.map → chunk-5C3QJSOD.js.map} +1 -1
- package/dist/{chunk-B5PEERRZ.js → chunk-6IDBWPK2.js} +7 -4
- package/dist/chunk-6IDBWPK2.js.map +1 -0
- package/dist/{chunk-TNYWP6EQ.js → chunk-7I4IBYHE.js} +6 -6
- package/dist/{chunk-TNYWP6EQ.js.map → chunk-7I4IBYHE.js.map} +1 -1
- package/dist/{chunk-3KX5W3ZU.js → chunk-7WLJW457.js} +4 -4
- package/dist/{chunk-3KX5W3ZU.js.map → chunk-7WLJW457.js.map} +1 -1
- package/dist/{chunk-ZJ27BHIH.js → chunk-BXYMGZCI.js} +3 -3
- package/dist/{chunk-ZJ27BHIH.js.map → chunk-BXYMGZCI.js.map} +1 -1
- package/dist/{chunk-2JCUYKUN.js → chunk-G6FJZG4C.js} +2 -2
- package/dist/{chunk-2JCUYKUN.js.map → chunk-G6FJZG4C.js.map} +1 -1
- package/dist/{chunk-NQDJQ7WB.js → chunk-GJI6FZ56.js} +8 -4
- package/dist/chunk-GJI6FZ56.js.map +1 -0
- package/dist/{chunk-JAOXG3LL.js → chunk-HVCZLD5Z.js} +4 -4
- package/dist/{chunk-JAOXG3LL.js.map → chunk-HVCZLD5Z.js.map} +1 -1
- package/dist/{chunk-MO2VGW6U.js → chunk-K5TROTFK.js} +3 -3
- package/dist/{chunk-MO2VGW6U.js.map → chunk-K5TROTFK.js.map} +1 -1
- package/dist/{chunk-MVXXAXDW.js → chunk-KYQNWFJV.js} +3 -3
- package/dist/{chunk-MVXXAXDW.js.map → chunk-KYQNWFJV.js.map} +1 -1
- package/dist/{chunk-KM6DCR7A.js → chunk-OCAQH66V.js} +2 -2
- package/dist/{chunk-KM6DCR7A.js.map → chunk-OCAQH66V.js.map} +1 -1
- package/dist/{chunk-X4FCLBI7.js → chunk-R4H6EJW5.js} +7 -5
- package/dist/chunk-R4H6EJW5.js.map +1 -0
- package/dist/{chunk-U3TV7SRR.js → chunk-RSK6FDMV.js} +3 -3
- package/dist/{chunk-U3TV7SRR.js.map → chunk-RSK6FDMV.js.map} +1 -1
- package/dist/{chunk-TB342H55.js → chunk-SURALYSM.js} +4 -4
- package/dist/{chunk-TB342H55.js.map → chunk-SURALYSM.js.map} +1 -1
- package/dist/{chunk-2ZI2FFFN.js → chunk-U3RYXSI4.js} +188 -76
- package/dist/chunk-U3RYXSI4.js.map +1 -0
- package/dist/{chunk-JILPU5VI.js → chunk-VGAHSWDE.js} +98 -50
- package/dist/chunk-VGAHSWDE.js.map +1 -0
- package/dist/{chunk-4NZD7423.js → chunk-WJ3RP2FS.js} +3 -3
- package/dist/{chunk-4NZD7423.js.map → chunk-WJ3RP2FS.js.map} +1 -1
- package/dist/{chunk-4ZACMAT3.js → chunk-Z3GAAIJK.js} +4 -4
- package/dist/{chunk-4ZACMAT3.js.map → chunk-Z3GAAIJK.js.map} +1 -1
- package/dist/cli/index.js +34 -34
- package/dist/connectors/config.js +5 -5
- package/dist/connectors/index.js +7 -7
- package/dist/connectors/rclone.js +1 -1
- package/dist/connectors/src/connector-manager.d.ts +13 -0
- package/dist/connectors/src/connector-manager.d.ts.map +1 -1
- package/dist/connectors/src/connector-types.d.ts +26 -0
- package/dist/connectors/src/connector-types.d.ts.map +1 -1
- package/dist/connectors/src/fleet-health-gate.d.ts +53 -36
- package/dist/connectors/src/fleet-health-gate.d.ts.map +1 -1
- package/dist/connectors/src/fleet-utils.d.ts +11 -2
- package/dist/connectors/src/fleet-utils.d.ts.map +1 -1
- package/dist/connectors/src/index.d.ts +3 -3
- package/dist/connectors/src/index.d.ts.map +1 -1
- package/dist/connectors/src/materialized-connectors.d.ts.map +1 -1
- package/dist/connectors/src/mount-placeholder.d.ts +19 -0
- package/dist/connectors/src/mount-placeholder.d.ts.map +1 -1
- package/dist/connectors/src/rclone-process-manager.d.ts +36 -2
- package/dist/connectors/src/rclone-process-manager.d.ts.map +1 -1
- package/dist/core/index.js +4 -4
- package/dist/core/manifest.js +1 -1
- package/dist/core/runtime-assets.js +3 -3
- package/dist/core/src/index.d.ts +1 -1
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/manifest.d.ts +11 -0
- package/dist/core/src/manifest.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +2 -0
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/workspace-config.js +2 -2
- package/dist/deploy/index.js +4 -4
- package/dist/discovery/index.js +2 -2
- package/dist/{ensure-sources-EWK7EXKN.js → ensure-sources-TZHDV3BF.js} +8 -8
- package/dist/{ensure-sources-EWK7EXKN.js.map → ensure-sources-TZHDV3BF.js.map} +1 -1
- package/dist/factory-assets/connectors/deploy.js +7 -7
- package/dist/factory-assets/connectors/devserver.js +7 -7
- package/dist/factory-assets/connectors/flow/adapter.js +7 -7
- package/dist/factory-assets/connectors/flow/engine.js +4 -4
- package/dist/factory-assets/connectors/flow/run-flow.js +8 -8
- package/dist/factory-assets/connectors/flow.js +7 -7
- package/dist/factory-assets/connectors/git.js +7 -7
- package/dist/factory-assets/connectors/gmail.js +7 -7
- package/dist/factory-assets/connectors/googledrive/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/googledrive.js +7 -7
- package/dist/factory-assets/connectors/local.js +7 -7
- package/dist/factory-assets/connectors/mattermost.js +7 -7
- package/dist/factory-assets/connectors/memory.js +7 -7
- package/dist/factory-assets/connectors/minio.js +7 -7
- package/dist/factory-assets/connectors/postgres.js +7 -7
- package/dist/factory-assets/connectors/s3.js +7 -7
- package/dist/factory-assets/connectors/sharepoint/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/sharepoint.js +7 -7
- package/dist/factory-assets/connectors/sqlite.js +7 -7
- package/dist/factory-assets/connectors/static-server.js +7 -7
- package/dist/factory-assets/connectors/tunnel.js +7 -7
- package/dist/factory-assets/connectors/webdav/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/webdav.js +7 -7
- package/dist/factory-assets/connectors/xstate-store.js +7 -7
- package/dist/factory-assets/connectors/xstate.js +7 -7
- package/dist/{flows-3MBK2PDN.js → flows-KTBCZ5GQ.js} +3 -3
- package/dist/{flows-3MBK2PDN.js.map → flows-KTBCZ5GQ.js.map} +1 -1
- package/dist/library/index.js +6 -6
- package/dist/library/install.js +4 -4
- package/dist/{open-library-QSIPFN5N.js → open-library-EV7UCOFU.js} +9 -9
- package/dist/{open-library-QSIPFN5N.js.map → open-library-EV7UCOFU.js.map} +1 -1
- package/dist/{paths-KNLBYALO.js → paths-7H5CSBLQ.js} +7 -7
- package/dist/{paths-KNLBYALO.js.map → paths-7H5CSBLQ.js.map} +1 -1
- package/dist/{plugin-store-CL6CTREE.js → plugin-store-LGLN2QUX.js} +6 -6
- package/dist/{plugin-store-CL6CTREE.js.map → plugin-store-LGLN2QUX.js.map} +1 -1
- package/dist/runner/index.js +11 -11
- package/dist/runner/src/fleet-health-flag-dispatcher.d.ts +3 -2
- package/dist/runner/src/fleet-health-flag-dispatcher.d.ts.map +1 -1
- package/dist/runner/src/mcp-prompt.d.ts +8 -0
- package/dist/runner/src/mcp-prompt.d.ts.map +1 -0
- package/dist/runner/src/resource-handler.d.ts +1 -7
- package/dist/runner/src/resource-handler.d.ts.map +1 -1
- package/dist/runner/src/resources.d.ts +6 -0
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts +8 -2
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +6 -6
- package/dist/sdk/bridge.js +2 -2
- package/dist/sdk/core.js +4 -4
- package/dist/sdk/flow.js +4 -4
- package/dist/sdk/index.js +11 -11
- package/dist/sdk/runner.js +11 -11
- package/dist/sdk/session.js +1 -1
- package/dist/session/index.js +1 -1
- package/dist/session/src/dispatcher.d.ts +8 -0
- package/dist/session/src/dispatcher.d.ts.map +1 -1
- package/dist/{setup-345XOCH3.js → setup-EVNPECSY.js} +8 -8
- package/dist/{setup-345XOCH3.js.map → setup-EVNPECSY.js.map} +1 -1
- package/dist/{store-client-W3HKRE46.js → store-client-4XN7IB3R.js} +7 -7
- package/dist/{store-client-W3HKRE46.js.map → store-client-4XN7IB3R.js.map} +1 -1
- package/dist/tui/index.js +11 -11
- package/dist/types/src/events.d.ts +1 -1
- package/dist/types/src/events.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/chunk-2ZI2FFFN.js.map +0 -1
- package/dist/chunk-5VJVSYXX.js.map +0 -1
- package/dist/chunk-B5PEERRZ.js.map +0 -1
- package/dist/chunk-JILPU5VI.js.map +0 -1
- package/dist/chunk-NQDJQ7WB.js.map +0 -1
- package/dist/chunk-SBGHNXJD.js.map +0 -1
- package/dist/chunk-X4FCLBI7.js.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { WorkspacePlugin } from './chunk-
|
|
1
|
+
import { WorkspacePlugin } from './chunk-2MVQ7UAT.js';
|
|
2
2
|
import { WebSocketServerTransport } from './chunk-WQ7DE5UC.js';
|
|
3
3
|
import { assembleSystemPrompt, buildCapabilitiesPromptSection } from './chunk-W3UDISS2.js';
|
|
4
4
|
import { PROTOCOL_VERSION } from './chunk-TDSRLMDB.js';
|
|
5
|
-
import { EventNormalizer } from './chunk-
|
|
5
|
+
import { EventNormalizer } from './chunk-5C3QJSOD.js';
|
|
6
6
|
import { classifyClaudeSdkError } from './chunk-GAH4YRCI.js';
|
|
7
|
-
import { createDriver } from './chunk-
|
|
7
|
+
import { createDriver } from './chunk-OCAQH66V.js';
|
|
8
8
|
import { deployCatalogEntry, undeployCatalogEntry } from './chunk-LV2HPH3C.js';
|
|
9
|
-
import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, ConnectorStartupError, buildSdkConnectorTools } from './chunk-
|
|
10
|
-
import { loadConnectorDeclarations, SecretProviderChain, PreMintedSecretProvider, InMemorySecretProvider, deriveSingleMaterializedConnectorDeclaration } from './chunk-
|
|
9
|
+
import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, ConnectorStartupError, buildSdkConnectorTools } from './chunk-U3RYXSI4.js';
|
|
10
|
+
import { loadConnectorDeclarations, SecretProviderChain, PreMintedSecretProvider, InMemorySecretProvider, deriveSingleMaterializedConnectorDeclaration } from './chunk-R4H6EJW5.js';
|
|
11
11
|
import { renderStimulusPrompt, buildOrchestratorPrompt } from './chunk-DEYYRFQU.js';
|
|
12
|
-
import { resolveSettings, resolveApiKey, providerEnvKey } from './chunk-
|
|
13
|
-
import { resolveRuntimeAssets } from './chunk-
|
|
14
|
-
import { resolveSkWorkspaceConfig, resolveAgentDir, stageMaterializedSkills, loadMcpServerDeclarations, COMPACTION_DEFAULTS, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration } from './chunk-
|
|
12
|
+
import { resolveSettings, resolveApiKey, providerEnvKey } from './chunk-KYQNWFJV.js';
|
|
13
|
+
import { resolveRuntimeAssets } from './chunk-HVCZLD5Z.js';
|
|
14
|
+
import { resolveSkWorkspaceConfig, resolveAgentDir, stageMaterializedSkills, loadMcpServerDeclarations, COMPACTION_DEFAULTS, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration } from './chunk-GJI6FZ56.js';
|
|
15
15
|
import { parseAssetRef } from './chunk-GEEW6SY2.js';
|
|
16
16
|
import { resolveDriverPaths } from './chunk-K5GBV4SA.js';
|
|
17
17
|
import { getLogStore, resolveLogStoreConfig, createLogStoreFromConfig, OnLogBridgeSink, WsLogSink, registerLogStore, resetLogStore, createLogger } from './chunk-JB35MVBN.js';
|
|
@@ -19,7 +19,7 @@ import { __require } from './chunk-NSBPE2FW.js';
|
|
|
19
19
|
import pc from 'picocolors';
|
|
20
20
|
import { Marked } from 'marked';
|
|
21
21
|
import { markedTerminal } from 'marked-terminal';
|
|
22
|
-
import { readdirSync, existsSync, readFileSync, statSync, rmSync, unlinkSync, mkdirSync, writeFileSync, watch, chmodSync
|
|
22
|
+
import { readdirSync, existsSync, readFileSync, statSync, rmSync, unlinkSync, mkdirSync, writeFileSync, watch, chmodSync } from 'fs';
|
|
23
23
|
import path4, { join, resolve, relative, sep, isAbsolute, dirname, basename } from 'path';
|
|
24
24
|
import { homedir } from 'os';
|
|
25
25
|
import * as z5 from 'zod';
|
|
@@ -1286,6 +1286,21 @@ var ExternalMcpManager = class {
|
|
|
1286
1286
|
}
|
|
1287
1287
|
};
|
|
1288
1288
|
|
|
1289
|
+
// runner/src/mcp-prompt.ts
|
|
1290
|
+
function buildMcpPromptSection(declarations) {
|
|
1291
|
+
const withGuidance = declarations.filter(
|
|
1292
|
+
(d) => !!d.instructions && d.instructions.trim().length > 0
|
|
1293
|
+
);
|
|
1294
|
+
if (withGuidance.length === 0) return "";
|
|
1295
|
+
const lines = ["## MCP server guidance", ""];
|
|
1296
|
+
for (const d of withGuidance) {
|
|
1297
|
+
lines.push(`Guidance for \`${d.id}\`:`);
|
|
1298
|
+
lines.push(d.instructions.trim());
|
|
1299
|
+
lines.push("");
|
|
1300
|
+
}
|
|
1301
|
+
return lines.join("\n").trimEnd();
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1289
1304
|
// runner/src/resources.ts
|
|
1290
1305
|
async function buildAgentResources(projectDir, driverType, _onLog, watch, secretProvider, sessionMeta, tokenMediator, preMintedSecrets, deferFilesystemMounts, capabilityRegistry) {
|
|
1291
1306
|
const resLog = createLogger({
|
|
@@ -1305,7 +1320,8 @@ async function buildAgentResources(projectDir, driverType, _onLog, watch, secret
|
|
|
1305
1320
|
getOrCreateExternalMcpManager: () => {
|
|
1306
1321
|
throw new Error("external MCP manager unavailable \u2014 no capability registry (CLI/flow mode)");
|
|
1307
1322
|
},
|
|
1308
|
-
getExternalMcpManager: () => null
|
|
1323
|
+
getExternalMcpManager: () => null,
|
|
1324
|
+
mcpPromptSection: ""
|
|
1309
1325
|
};
|
|
1310
1326
|
try {
|
|
1311
1327
|
registerBuiltinConnectors();
|
|
@@ -1333,6 +1349,7 @@ async function buildAgentResources(projectDir, driverType, _onLog, watch, secret
|
|
|
1333
1349
|
let mcpServers;
|
|
1334
1350
|
let workspacePluginToShutdown = null;
|
|
1335
1351
|
let externalMcpManager = null;
|
|
1352
|
+
let externalMcpDeclarations;
|
|
1336
1353
|
const mcpSecretChain = preMintedSecrets ? new SecretProviderChain(
|
|
1337
1354
|
[preMintedSecrets, secretProvider].filter(
|
|
1338
1355
|
Boolean
|
|
@@ -1364,16 +1381,24 @@ async function buildAgentResources(projectDir, driverType, _onLog, watch, secret
|
|
|
1364
1381
|
workspacePluginToShutdown = inProcess.workspacePluginToShutdown;
|
|
1365
1382
|
}
|
|
1366
1383
|
if (capabilityRegistry) {
|
|
1384
|
+
externalMcpDeclarations = resolveExternalMcpDeclarations(
|
|
1385
|
+
projectDir,
|
|
1386
|
+
sessionMeta?.sessionId
|
|
1387
|
+
);
|
|
1367
1388
|
externalMcpManager = await startExternalMcpServers(
|
|
1368
1389
|
capabilityRegistry,
|
|
1369
|
-
|
|
1390
|
+
externalMcpDeclarations,
|
|
1370
1391
|
mcpSecretChain,
|
|
1371
1392
|
sessionMeta
|
|
1372
1393
|
);
|
|
1373
1394
|
} else if (driverType === "claude-sdk") {
|
|
1395
|
+
externalMcpDeclarations = resolveExternalMcpDeclarations(
|
|
1396
|
+
projectDir,
|
|
1397
|
+
sessionMeta?.sessionId
|
|
1398
|
+
);
|
|
1374
1399
|
mcpServers = wireExternalMcpServersForSdk(
|
|
1375
1400
|
mcpServers,
|
|
1376
|
-
|
|
1401
|
+
externalMcpDeclarations,
|
|
1377
1402
|
secretProvider,
|
|
1378
1403
|
sessionMeta
|
|
1379
1404
|
);
|
|
@@ -1415,6 +1440,7 @@ async function buildAgentResources(projectDir, driverType, _onLog, watch, secret
|
|
|
1415
1440
|
} catch {
|
|
1416
1441
|
}
|
|
1417
1442
|
};
|
|
1443
|
+
const mcpPromptSection = buildMcpPromptSection(externalMcpDeclarations ?? []);
|
|
1418
1444
|
return {
|
|
1419
1445
|
resourceManager,
|
|
1420
1446
|
resourcePromptSection,
|
|
@@ -1423,7 +1449,8 @@ async function buildAgentResources(projectDir, driverType, _onLog, watch, secret
|
|
|
1423
1449
|
dispose,
|
|
1424
1450
|
startWatching,
|
|
1425
1451
|
getOrCreateExternalMcpManager,
|
|
1426
|
-
getExternalMcpManager: () => externalMcpManager
|
|
1452
|
+
getExternalMcpManager: () => externalMcpManager,
|
|
1453
|
+
mcpPromptSection
|
|
1427
1454
|
};
|
|
1428
1455
|
} catch {
|
|
1429
1456
|
return noopResult;
|
|
@@ -1505,8 +1532,7 @@ async function buildInProcessMcpServers(resourceManager, projectDir, driverType,
|
|
|
1505
1532
|
}
|
|
1506
1533
|
return { mcpServers, workspacePluginToShutdown: workspacePlugin };
|
|
1507
1534
|
}
|
|
1508
|
-
async function startExternalMcpServers(capabilityRegistry,
|
|
1509
|
-
const resolvedDecls = resolveExternalMcpDeclarations(projectDir, sessionMeta?.sessionId);
|
|
1535
|
+
async function startExternalMcpServers(capabilityRegistry, resolvedDecls, secretProvider, sessionMeta) {
|
|
1510
1536
|
if (resolvedDecls.length === 0) return null;
|
|
1511
1537
|
const mgr = createExternalMcpManager(capabilityRegistry, secretProvider, sessionMeta);
|
|
1512
1538
|
await mgr.start(resolvedDecls);
|
|
@@ -1550,13 +1576,12 @@ function buildMcpReauthorizer(capabilityRegistry, secretProvider, sessionId) {
|
|
|
1550
1576
|
return true;
|
|
1551
1577
|
};
|
|
1552
1578
|
}
|
|
1553
|
-
function wireExternalMcpServersForSdk(mcpServers,
|
|
1579
|
+
function wireExternalMcpServersForSdk(mcpServers, resolvedDecls, secretProvider, sessionMeta) {
|
|
1554
1580
|
const mcpLog = createLogger({
|
|
1555
1581
|
kind: "mcp",
|
|
1556
1582
|
subkind: "wiring",
|
|
1557
1583
|
instance: sessionMeta?.sessionId ?? "no-session"
|
|
1558
1584
|
});
|
|
1559
|
-
const resolvedDecls = resolveExternalMcpDeclarations(projectDir, sessionMeta?.sessionId);
|
|
1560
1585
|
for (const decl of resolvedDecls) {
|
|
1561
1586
|
const serverConfig = toSdkMcpServerConfig(
|
|
1562
1587
|
decl,
|
|
@@ -1643,7 +1668,8 @@ async function createAgentSession(config) {
|
|
|
1643
1668
|
dispose,
|
|
1644
1669
|
startWatching,
|
|
1645
1670
|
getOrCreateExternalMcpManager,
|
|
1646
|
-
getExternalMcpManager
|
|
1671
|
+
getExternalMcpManager,
|
|
1672
|
+
mcpPromptSection
|
|
1647
1673
|
} = await buildAgentResources(
|
|
1648
1674
|
projectDir,
|
|
1649
1675
|
driverType,
|
|
@@ -1682,6 +1708,7 @@ async function createAgentSession(config) {
|
|
|
1682
1708
|
userPromptSection,
|
|
1683
1709
|
environmentSection,
|
|
1684
1710
|
resourcePromptSection,
|
|
1711
|
+
mcpPromptSection,
|
|
1685
1712
|
promptExtensions,
|
|
1686
1713
|
compositionBlocks,
|
|
1687
1714
|
additionalSections
|
|
@@ -1691,6 +1718,7 @@ async function createAgentSession(config) {
|
|
|
1691
1718
|
userPromptSection,
|
|
1692
1719
|
environmentSection,
|
|
1693
1720
|
resourcePromptSection,
|
|
1721
|
+
mcpPromptSection,
|
|
1694
1722
|
...promptExtensions.map((e) => e.value),
|
|
1695
1723
|
...compositionBlocks.map((b) => b.content),
|
|
1696
1724
|
...additionalSections
|
|
@@ -1776,6 +1804,7 @@ function buildSystemPromptSections(parts) {
|
|
|
1776
1804
|
userPromptSection,
|
|
1777
1805
|
environmentSection,
|
|
1778
1806
|
resourcePromptSection,
|
|
1807
|
+
mcpPromptSection,
|
|
1779
1808
|
promptExtensions,
|
|
1780
1809
|
compositionBlocks,
|
|
1781
1810
|
additionalSections
|
|
@@ -1787,6 +1816,8 @@ function buildSystemPromptSections(parts) {
|
|
|
1787
1816
|
systemPromptSections.push({ label: "environment", value: environmentSection });
|
|
1788
1817
|
if (resourcePromptSection)
|
|
1789
1818
|
systemPromptSections.push({ label: "resources", value: resourcePromptSection });
|
|
1819
|
+
if (mcpPromptSection)
|
|
1820
|
+
systemPromptSections.push({ label: "mcp-guidance", value: mcpPromptSection });
|
|
1790
1821
|
for (const ext of promptExtensions) {
|
|
1791
1822
|
systemPromptSections.push({
|
|
1792
1823
|
label: "prompt-extensions",
|
|
@@ -2400,27 +2431,18 @@ async function handleResourceRequest(command, manager, emit) {
|
|
|
2400
2431
|
function getMimeType(filename) {
|
|
2401
2432
|
return mime.getType(filename) ?? "application/octet-stream";
|
|
2402
2433
|
}
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
return m ? content.slice(0, m.index + m[0].length) : content;
|
|
2408
|
-
}
|
|
2409
|
-
function isBinaryFile(filePath) {
|
|
2410
|
-
try {
|
|
2411
|
-
const fd = openSync(filePath, "r");
|
|
2412
|
-
const buf = Buffer.alloc(8192);
|
|
2413
|
-
const bytesRead = readSync(fd, buf, 0, 8192, 0);
|
|
2414
|
-
closeSync(fd);
|
|
2415
|
-
for (let i = 0; i < bytesRead; i++) {
|
|
2416
|
-
if (buf[i] === 0) return true;
|
|
2417
|
-
}
|
|
2418
|
-
return false;
|
|
2419
|
-
} catch {
|
|
2420
|
-
return false;
|
|
2434
|
+
function isBinaryBuffer(buf) {
|
|
2435
|
+
const limit = Math.min(buf.length, 8192);
|
|
2436
|
+
for (let i = 0; i < limit; i++) {
|
|
2437
|
+
if (buf[i] === 0) return true;
|
|
2421
2438
|
}
|
|
2439
|
+
return false;
|
|
2422
2440
|
}
|
|
2423
|
-
function
|
|
2441
|
+
function getAuthoritativeSize(state) {
|
|
2442
|
+
const provider = state;
|
|
2443
|
+
return typeof provider?.authoritativeSize === "function" ? (relPath) => provider.authoritativeSize(relPath) : void 0;
|
|
2444
|
+
}
|
|
2445
|
+
async function handleMountResourceRequest(command, manager, emit) {
|
|
2424
2446
|
const { requestId, connectorId: mountId, operation, path: reqPath, options, content } = command;
|
|
2425
2447
|
try {
|
|
2426
2448
|
const entry = manager.get(mountId);
|
|
@@ -2464,16 +2486,24 @@ function handleMountResourceRequest(command, manager, emit) {
|
|
|
2464
2486
|
}
|
|
2465
2487
|
case "read": {
|
|
2466
2488
|
const contentType = getMimeType(basename(targetPath));
|
|
2467
|
-
|
|
2468
|
-
|
|
2489
|
+
const buf = readFileSync(targetPath);
|
|
2490
|
+
let bytes = buf;
|
|
2491
|
+
const sizeFn = getAuthoritativeSize(entry.handle.state);
|
|
2492
|
+
if (sizeFn) {
|
|
2493
|
+
const authSize = await sizeFn(reqPath ?? "");
|
|
2494
|
+
if (authSize !== null && authSize >= 0 && authSize < buf.length) {
|
|
2495
|
+
bytes = buf.subarray(0, authSize);
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
if (isBinaryBuffer(bytes)) {
|
|
2469
2499
|
data = {
|
|
2470
|
-
data:
|
|
2500
|
+
data: bytes.toString("base64"),
|
|
2471
2501
|
contentType,
|
|
2472
2502
|
encoding: "binary"
|
|
2473
2503
|
};
|
|
2474
2504
|
} else {
|
|
2475
2505
|
data = {
|
|
2476
|
-
data:
|
|
2506
|
+
data: bytes.toString("utf-8"),
|
|
2477
2507
|
contentType,
|
|
2478
2508
|
encoding: "utf-8"
|
|
2479
2509
|
};
|
|
@@ -3290,7 +3320,10 @@ function buildMcpRuntimeHandlers(deps) {
|
|
|
3290
3320
|
};
|
|
3291
3321
|
}
|
|
3292
3322
|
function parseFleetHealthBody(body) {
|
|
3293
|
-
|
|
3323
|
+
const trimmed = body.trim().toLowerCase();
|
|
3324
|
+
if (trimmed === "healthy") return "healthy";
|
|
3325
|
+
if (trimmed === "degraded") return "degraded";
|
|
3326
|
+
return "error";
|
|
3294
3327
|
}
|
|
3295
3328
|
async function dispatchFleetHealthFlag(dir, fileName, manager, log) {
|
|
3296
3329
|
if (!manager) return;
|
|
@@ -3782,9 +3815,12 @@ function splitConnectorsForWire(manager) {
|
|
|
3782
3815
|
}
|
|
3783
3816
|
return { mounts, connectors };
|
|
3784
3817
|
}
|
|
3785
|
-
function buildResourcesAvailablePayload(manager, mcpManager, driverLive) {
|
|
3818
|
+
function buildResourcesAvailablePayload(manager, mcpManager, driverLive, bakedServerIds) {
|
|
3786
3819
|
const { mounts, connectors } = splitConnectorsForWire(manager);
|
|
3787
|
-
const mcp_servers = (mcpManager?.listServers() ?? []).map((s) => ({
|
|
3820
|
+
const mcp_servers = (mcpManager?.listServers() ?? []).map((s) => ({
|
|
3821
|
+
...s,
|
|
3822
|
+
live: driverLive || (bakedServerIds?.has(s.id) ?? false)
|
|
3823
|
+
}));
|
|
3788
3824
|
return { type: "resources_available", mounts, connectors, mcp_servers };
|
|
3789
3825
|
}
|
|
3790
3826
|
function findAiAssetsRoot(startDir) {
|
|
@@ -4128,6 +4164,11 @@ async function startAgentServer(opts) {
|
|
|
4128
4164
|
} catch {
|
|
4129
4165
|
}
|
|
4130
4166
|
}
|
|
4167
|
+
let bakedMcpServerIds = /* @__PURE__ */ new Set();
|
|
4168
|
+
const captureBakedMcpServers = () => {
|
|
4169
|
+
const servers = agentSession?.getExternalMcpManager()?.listServers() ?? [];
|
|
4170
|
+
bakedMcpServerIds = new Set(servers.map((s) => s.id));
|
|
4171
|
+
};
|
|
4131
4172
|
if (secretsMode === "provisioned") {
|
|
4132
4173
|
log("[serve] secrets mode: provisioned \u2014 waiting for provision_secrets command");
|
|
4133
4174
|
} else {
|
|
@@ -4136,6 +4177,7 @@ async function startAgentServer(opts) {
|
|
|
4136
4177
|
emitSystemPromptComposed(agentSession, sendEvent);
|
|
4137
4178
|
registerSessionComposition(agentSession);
|
|
4138
4179
|
resolveSessionReady();
|
|
4180
|
+
captureBakedMcpServers();
|
|
4139
4181
|
}
|
|
4140
4182
|
let resourceManager = secretsMode === "env" ? agentSession.resourceManager : null;
|
|
4141
4183
|
if (secretsMode === "env") {
|
|
@@ -4392,6 +4434,7 @@ async function startAgentServer(opts) {
|
|
|
4392
4434
|
normalizer.reset();
|
|
4393
4435
|
driverStarted = false;
|
|
4394
4436
|
rebuildCompactionOrchestrator();
|
|
4437
|
+
captureBakedMcpServers();
|
|
4395
4438
|
}
|
|
4396
4439
|
driver.config.mcpServers = { "skaile-connectors": server };
|
|
4397
4440
|
log(`[serve] rebuilt MCP connector tools for flow ${connectorId}`);
|
|
@@ -4568,9 +4611,11 @@ async function startAgentServer(opts) {
|
|
|
4568
4611
|
buildResourcesAvailablePayload(
|
|
4569
4612
|
resourceManager,
|
|
4570
4613
|
agentSession?.getExternalMcpManager(),
|
|
4571
|
-
driverPicksUpToolsLive()
|
|
4614
|
+
driverPicksUpToolsLive(),
|
|
4615
|
+
bakedMcpServerIds
|
|
4572
4616
|
)
|
|
4573
4617
|
);
|
|
4618
|
+
captureBakedMcpServers();
|
|
4574
4619
|
emitResourcesAvailable();
|
|
4575
4620
|
agentSession.startWatching();
|
|
4576
4621
|
capabilityRegistry.setRemoteInvoker(remoteCapabilityInvoker);
|
|
@@ -4634,6 +4679,7 @@ async function startAgentServer(opts) {
|
|
|
4634
4679
|
normalizer.reset();
|
|
4635
4680
|
driverStarted = false;
|
|
4636
4681
|
rebuildCompactionOrchestrator();
|
|
4682
|
+
captureBakedMcpServers();
|
|
4637
4683
|
}
|
|
4638
4684
|
async function applyInitSharedState(sharedState) {
|
|
4639
4685
|
if (!ensureResourceManagerForSharedState()) {
|
|
@@ -4822,6 +4868,7 @@ async function startAgentServer(opts) {
|
|
|
4822
4868
|
normalizer.reset();
|
|
4823
4869
|
driverStarted = false;
|
|
4824
4870
|
rebuildCompactionOrchestrator();
|
|
4871
|
+
captureBakedMcpServers();
|
|
4825
4872
|
sendEvent({
|
|
4826
4873
|
type: "skills_changed",
|
|
4827
4874
|
skills: catalogActions.map((a) => ({
|
|
@@ -5025,7 +5072,7 @@ async function startAgentServer(opts) {
|
|
|
5025
5072
|
async function handleResourceRequestCommand(cmd) {
|
|
5026
5073
|
if (!await awaitSessionReadyOrFail()) return;
|
|
5027
5074
|
if (resourceManager?.has(cmd.connectorId)) {
|
|
5028
|
-
handleMountResourceRequest(cmd, resourceManager, sendEvent);
|
|
5075
|
+
await handleMountResourceRequest(cmd, resourceManager, sendEvent);
|
|
5029
5076
|
return;
|
|
5030
5077
|
}
|
|
5031
5078
|
if (!resourceManager) {
|
|
@@ -5349,7 +5396,8 @@ async function startAgentServer(opts) {
|
|
|
5349
5396
|
const payload = buildResourcesAvailablePayload(
|
|
5350
5397
|
resourceManager,
|
|
5351
5398
|
agentSession?.getExternalMcpManager() ?? null,
|
|
5352
|
-
driverLive
|
|
5399
|
+
driverLive,
|
|
5400
|
+
bakedMcpServerIds
|
|
5353
5401
|
);
|
|
5354
5402
|
log(
|
|
5355
5403
|
`[serve] emitting resources_available: ${payload.mounts.length} mount(s), ${payload.connectors.length} connector(s)`
|
|
@@ -5537,6 +5585,6 @@ function touchSession(state) {
|
|
|
5537
5585
|
return { ...state, updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
5538
5586
|
}
|
|
5539
5587
|
|
|
5540
|
-
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,
|
|
5541
|
-
//# sourceMappingURL=chunk-
|
|
5542
|
-
//# sourceMappingURL=chunk-
|
|
5588
|
+
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 };
|
|
5589
|
+
//# sourceMappingURL=chunk-VGAHSWDE.js.map
|
|
5590
|
+
//# sourceMappingURL=chunk-VGAHSWDE.js.map
|