@skaile/workspaces 0.41.6 → 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 +71 -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-2XFTGANB.js → chunk-4MO456BV.js} +5 -5
- package/dist/{chunk-2XFTGANB.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-HZXOCRLD.js → chunk-VGAHSWDE.js} +78 -39
- 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 -1
- 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/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-HZXOCRLD.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,21 +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
|
-
function
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
const bytesRead = readSync(fd, buf, 0, 8192, 0);
|
|
2408
|
-
closeSync(fd);
|
|
2409
|
-
for (let i = 0; i < bytesRead; i++) {
|
|
2410
|
-
if (buf[i] === 0) return true;
|
|
2411
|
-
}
|
|
2412
|
-
return false;
|
|
2413
|
-
} catch {
|
|
2414
|
-
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;
|
|
2415
2438
|
}
|
|
2439
|
+
return false;
|
|
2440
|
+
}
|
|
2441
|
+
function getAuthoritativeSize(state) {
|
|
2442
|
+
const provider = state;
|
|
2443
|
+
return typeof provider?.authoritativeSize === "function" ? (relPath) => provider.authoritativeSize(relPath) : void 0;
|
|
2416
2444
|
}
|
|
2417
|
-
function handleMountResourceRequest(command, manager, emit) {
|
|
2445
|
+
async function handleMountResourceRequest(command, manager, emit) {
|
|
2418
2446
|
const { requestId, connectorId: mountId, operation, path: reqPath, options, content } = command;
|
|
2419
2447
|
try {
|
|
2420
2448
|
const entry = manager.get(mountId);
|
|
@@ -2458,16 +2486,24 @@ function handleMountResourceRequest(command, manager, emit) {
|
|
|
2458
2486
|
}
|
|
2459
2487
|
case "read": {
|
|
2460
2488
|
const contentType = getMimeType(basename(targetPath));
|
|
2461
|
-
|
|
2462
|
-
|
|
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)) {
|
|
2463
2499
|
data = {
|
|
2464
|
-
data:
|
|
2500
|
+
data: bytes.toString("base64"),
|
|
2465
2501
|
contentType,
|
|
2466
2502
|
encoding: "binary"
|
|
2467
2503
|
};
|
|
2468
2504
|
} else {
|
|
2469
2505
|
data = {
|
|
2470
|
-
data:
|
|
2506
|
+
data: bytes.toString("utf-8"),
|
|
2471
2507
|
contentType,
|
|
2472
2508
|
encoding: "utf-8"
|
|
2473
2509
|
};
|
|
@@ -3284,7 +3320,10 @@ function buildMcpRuntimeHandlers(deps) {
|
|
|
3284
3320
|
};
|
|
3285
3321
|
}
|
|
3286
3322
|
function parseFleetHealthBody(body) {
|
|
3287
|
-
|
|
3323
|
+
const trimmed = body.trim().toLowerCase();
|
|
3324
|
+
if (trimmed === "healthy") return "healthy";
|
|
3325
|
+
if (trimmed === "degraded") return "degraded";
|
|
3326
|
+
return "error";
|
|
3288
3327
|
}
|
|
3289
3328
|
async function dispatchFleetHealthFlag(dir, fileName, manager, log) {
|
|
3290
3329
|
if (!manager) return;
|
|
@@ -5033,7 +5072,7 @@ async function startAgentServer(opts) {
|
|
|
5033
5072
|
async function handleResourceRequestCommand(cmd) {
|
|
5034
5073
|
if (!await awaitSessionReadyOrFail()) return;
|
|
5035
5074
|
if (resourceManager?.has(cmd.connectorId)) {
|
|
5036
|
-
handleMountResourceRequest(cmd, resourceManager, sendEvent);
|
|
5075
|
+
await handleMountResourceRequest(cmd, resourceManager, sendEvent);
|
|
5037
5076
|
return;
|
|
5038
5077
|
}
|
|
5039
5078
|
if (!resourceManager) {
|
|
@@ -5547,5 +5586,5 @@ function touchSession(state) {
|
|
|
5547
5586
|
}
|
|
5548
5587
|
|
|
5549
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 };
|
|
5550
|
-
//# sourceMappingURL=chunk-
|
|
5551
|
-
//# sourceMappingURL=chunk-
|
|
5589
|
+
//# sourceMappingURL=chunk-VGAHSWDE.js.map
|
|
5590
|
+
//# sourceMappingURL=chunk-VGAHSWDE.js.map
|