@cuylabs/agent-core 0.10.0 → 0.12.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/dist/{chunk-CMYN2RCB.js → chunk-33UIM3QS.js} +13 -7
- package/dist/{chunk-SPILYYDF.js → chunk-BERMUFZA.js} +22 -5
- package/dist/{chunk-TOTDGK3P.js → chunk-CSR75JVC.js} +4 -5
- package/dist/{chunk-ICZ66572.js → chunk-CZ5XOVDV.js} +40 -9
- package/dist/{chunk-2O4MCSQS.js → chunk-FYC33XFI.js} +31 -10
- package/dist/{chunk-WBPOZ7CL.js → chunk-JNN3RUIL.js} +86 -36
- package/dist/{chunk-SSFBF3US.js → chunk-JPBFAQNS.js} +7 -12
- package/dist/{chunk-5FMSGQVX.js → chunk-JZRLCTSD.js} +8 -2
- package/dist/{chunk-V4RFNEET.js → chunk-MLTJHUVG.js} +34 -16
- package/dist/{chunk-QAL3OMI3.js → chunk-MO3N6M32.js} +4 -1
- package/dist/{chunk-5NVVNXPQ.js → chunk-QEE5CBPM.js} +5 -2
- package/dist/{chunk-MXAP4UG6.js → chunk-QJV5XPPS.js} +238 -86
- package/dist/{chunk-T4UIX5D7.js → chunk-S6AKEPAX.js} +9 -3
- package/dist/{chunk-N3VX7FEE.js → chunk-STDJYXYK.js} +1 -4
- package/dist/{chunk-6HZBHFOL.js → chunk-TPZ37IWI.js} +10 -1
- package/dist/{chunk-NDZWXCBZ.js → chunk-TZ4VA4VX.js} +33 -11
- package/dist/{chunk-GFTW23FV.js → chunk-UECLINZM.js} +4 -2
- package/dist/chunk-US7S4FYW.js +610 -0
- package/dist/{chunk-RN6WZEUF.js → chunk-WI5JFEAI.js} +71 -36
- package/dist/dispatch/index.d.ts +5 -3
- package/dist/dispatch/index.js +3 -3
- package/dist/execution/index.d.ts +6 -4
- package/dist/execution/index.js +7 -7
- package/dist/index.d.ts +8 -5
- package/dist/index.js +117 -114
- package/dist/inference/errors/index.js +1 -1
- package/dist/inference/index.d.ts +6 -4
- package/dist/inference/index.js +6 -6
- package/dist/{instance-BqV2D5pc.d.ts → instance-CP24g3Le.d.ts} +2 -2
- package/dist/logger/index.js +1 -1
- package/dist/mcp/index.d.ts +116 -3
- package/dist/mcp/index.js +6 -2
- package/dist/middleware/index.d.ts +5 -3
- package/dist/middleware/index.js +3 -3
- package/dist/{model-messages-B4nK9D1-.d.ts → model-messages-B_MCHyiX.d.ts} +1 -1
- package/dist/models/index.js +2 -2
- package/dist/models/reasoning/index.js +2 -2
- package/dist/plugin/index.d.ts +4 -2
- package/dist/plugin/index.js +1 -1
- package/dist/profiles/index.d.ts +4 -2
- package/dist/profiles/index.js +1 -1
- package/dist/prompt/index.d.ts +5 -3
- package/dist/prompt/index.js +2 -2
- package/dist/safety/index.d.ts +5 -3
- package/dist/safety/index.js +1 -1
- package/dist/skill/index.d.ts +5 -3
- package/dist/skill/index.js +2 -2
- package/dist/storage/index.d.ts +5 -3
- package/dist/storage/index.js +1 -1
- package/dist/subagents/index.d.ts +4 -2
- package/dist/subagents/index.js +4 -4
- package/dist/team/index.d.ts +5 -3
- package/dist/team/index.js +1 -1
- package/dist/tool/index.d.ts +5 -3
- package/dist/tool/index.js +2 -2
- package/dist/{types-Bj_J8u_W.d.ts → types-DMjoFKKv.d.ts} +55 -7
- package/package.json +1 -6
- package/dist/chunk-ROTGCYDW.js +0 -221
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
parseSubAgentRoleFrontmatter,
|
|
35
35
|
parseSubAgentToolSpec,
|
|
36
36
|
toSubAgentRole
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-FYC33XFI.js";
|
|
38
38
|
import {
|
|
39
39
|
InMemoryMailboxStore,
|
|
40
40
|
InMemoryTaskBoardStore,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
formatCoordinatorTaskNotifications,
|
|
54
54
|
formatCoordinatorWorkerReports,
|
|
55
55
|
teamPermissionPolicy
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-QJV5XPPS.js";
|
|
57
57
|
import {
|
|
58
58
|
ToolRegistry,
|
|
59
59
|
createToolSearchTool,
|
|
@@ -79,7 +79,7 @@ import {
|
|
|
79
79
|
resetFrameworkAliases,
|
|
80
80
|
resetPluginLoader,
|
|
81
81
|
resolveFrameworkAliases
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-MO3N6M32.js";
|
|
83
83
|
import {
|
|
84
84
|
applyProfile,
|
|
85
85
|
createProfile,
|
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
quick,
|
|
96
96
|
review,
|
|
97
97
|
watch
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-TPZ37IWI.js";
|
|
99
99
|
import {
|
|
100
100
|
DEFAULT_INSTRUCTION_PATTERNS,
|
|
101
101
|
DEFAULT_MAX_DEPTH,
|
|
@@ -117,13 +117,13 @@ import {
|
|
|
117
117
|
getTemplate,
|
|
118
118
|
loadGlobalInstructions,
|
|
119
119
|
summarizeEnvironment
|
|
120
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-UECLINZM.js";
|
|
121
121
|
import "./chunk-VOUEJSW6.js";
|
|
122
122
|
import {
|
|
123
123
|
createSkillResourceTool,
|
|
124
124
|
createSkillTool,
|
|
125
125
|
createSkillTools
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-CSR75JVC.js";
|
|
127
127
|
import {
|
|
128
128
|
DEFAULT_EXTERNAL_DIRS,
|
|
129
129
|
DEFAULT_MAX_SCAN_DEPTH,
|
|
@@ -138,7 +138,7 @@ import {
|
|
|
138
138
|
loadSkillContent,
|
|
139
139
|
loadSkillMetadata,
|
|
140
140
|
parseFrontmatter
|
|
141
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-BERMUFZA.js";
|
|
142
142
|
import {
|
|
143
143
|
createCompositeDispatchTaskExecutor,
|
|
144
144
|
createDispatchExternalTaskControl,
|
|
@@ -147,7 +147,7 @@ import {
|
|
|
147
147
|
createRuntimeDispatchTargets,
|
|
148
148
|
ensureNonEmpty,
|
|
149
149
|
mergeInspection
|
|
150
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-JZRLCTSD.js";
|
|
151
151
|
import {
|
|
152
152
|
DEFAULT_DISPATCH_TOOL_IDS,
|
|
153
153
|
DEFAULT_LOCAL_DISPATCH_CONCURRENCY,
|
|
@@ -160,7 +160,7 @@ import {
|
|
|
160
160
|
ensureSessionLoaded,
|
|
161
161
|
getVisibleSessionMessages,
|
|
162
162
|
repairOrphanedToolCalls
|
|
163
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-JPBFAQNS.js";
|
|
164
164
|
import {
|
|
165
165
|
sleep
|
|
166
166
|
} from "./chunk-SZ2XBPTW.js";
|
|
@@ -195,7 +195,7 @@ import {
|
|
|
195
195
|
serializeMessage,
|
|
196
196
|
toJSONL,
|
|
197
197
|
toJSONLBatch
|
|
198
|
-
} from "./chunk-
|
|
198
|
+
} from "./chunk-CZ5XOVDV.js";
|
|
199
199
|
import {
|
|
200
200
|
createEventBus
|
|
201
201
|
} from "./chunk-2TTOLHBT.js";
|
|
@@ -239,7 +239,7 @@ import {
|
|
|
239
239
|
runToolBatch,
|
|
240
240
|
snapshotAgentWorkflowMessage,
|
|
241
241
|
snapshotAgentWorkflowMessages
|
|
242
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-JNN3RUIL.js";
|
|
243
243
|
import {
|
|
244
244
|
DEFAULT_RETRY_CONFIG,
|
|
245
245
|
Inference,
|
|
@@ -254,7 +254,7 @@ import {
|
|
|
254
254
|
streamOnce,
|
|
255
255
|
streamStep,
|
|
256
256
|
withRetry
|
|
257
|
-
} from "./chunk-
|
|
257
|
+
} from "./chunk-33UIM3QS.js";
|
|
258
258
|
import {
|
|
259
259
|
PRUNE_PROTECTED_TOOLS,
|
|
260
260
|
accumulateUsage,
|
|
@@ -266,7 +266,7 @@ import {
|
|
|
266
266
|
snapshotScope,
|
|
267
267
|
streamWithinScope,
|
|
268
268
|
withinScope
|
|
269
|
-
} from "./chunk-
|
|
269
|
+
} from "./chunk-QEE5CBPM.js";
|
|
270
270
|
import {
|
|
271
271
|
LLMError,
|
|
272
272
|
getErrorCategory,
|
|
@@ -274,7 +274,7 @@ import {
|
|
|
274
274
|
isRetryable,
|
|
275
275
|
isRetryableCategory,
|
|
276
276
|
parseRetryDelay
|
|
277
|
-
} from "./chunk-
|
|
277
|
+
} from "./chunk-STDJYXYK.js";
|
|
278
278
|
import {
|
|
279
279
|
CacheCapabilitySource,
|
|
280
280
|
CapabilityCache,
|
|
@@ -305,14 +305,16 @@ import {
|
|
|
305
305
|
shouldIncludeReasoningSummary,
|
|
306
306
|
supportsReasoning,
|
|
307
307
|
supportsReasoningSync
|
|
308
|
-
} from "./chunk-
|
|
308
|
+
} from "./chunk-WI5JFEAI.js";
|
|
309
309
|
import "./chunk-SPBFQXOT.js";
|
|
310
310
|
import {
|
|
311
|
+
ClientCredentialsProvider,
|
|
311
312
|
createMCPManager,
|
|
312
313
|
httpServer,
|
|
314
|
+
serviceAccountServer,
|
|
313
315
|
sseServer,
|
|
314
316
|
stdioServer
|
|
315
|
-
} from "./chunk-
|
|
317
|
+
} from "./chunk-US7S4FYW.js";
|
|
316
318
|
import {
|
|
317
319
|
MiddlewareRunner,
|
|
318
320
|
approvalMiddleware,
|
|
@@ -320,7 +322,7 @@ import {
|
|
|
320
322
|
isApprovalMiddleware,
|
|
321
323
|
otelMiddleware,
|
|
322
324
|
promptCacheMiddleware
|
|
323
|
-
} from "./chunk-
|
|
325
|
+
} from "./chunk-TZ4VA4VX.js";
|
|
324
326
|
import {
|
|
325
327
|
DEFAULT_AGENT_NAME,
|
|
326
328
|
DEFAULT_MAX_STEPS,
|
|
@@ -372,7 +374,7 @@ import {
|
|
|
372
374
|
normalizeRememberScopes,
|
|
373
375
|
selectRememberScope,
|
|
374
376
|
shouldCascadeApprovalDecision
|
|
375
|
-
} from "./chunk-
|
|
377
|
+
} from "./chunk-MLTJHUVG.js";
|
|
376
378
|
import {
|
|
377
379
|
describeApprovalOperation,
|
|
378
380
|
extractApprovalPatterns,
|
|
@@ -385,7 +387,7 @@ import {
|
|
|
385
387
|
createConsoleLogger,
|
|
386
388
|
createFileLogger,
|
|
387
389
|
silentLogger
|
|
388
|
-
} from "./chunk-
|
|
390
|
+
} from "./chunk-S6AKEPAX.js";
|
|
389
391
|
|
|
390
392
|
// src/tracking/turn-tracker/tracker.ts
|
|
391
393
|
import { spawn } from "child_process";
|
|
@@ -788,9 +790,7 @@ var InterventionController = class {
|
|
|
788
790
|
*/
|
|
789
791
|
intervene(message) {
|
|
790
792
|
const id = crypto.randomUUID();
|
|
791
|
-
this.immediate.push(
|
|
792
|
-
Object.freeze({ id, message, createdAt: /* @__PURE__ */ new Date() })
|
|
793
|
-
);
|
|
793
|
+
this.immediate.push(Object.freeze({ id, message, createdAt: /* @__PURE__ */ new Date() }));
|
|
794
794
|
return id;
|
|
795
795
|
}
|
|
796
796
|
/**
|
|
@@ -1166,7 +1166,10 @@ async function* runChatLoop(deps) {
|
|
|
1166
1166
|
applyCommitBatch,
|
|
1167
1167
|
rememberedDoomLoopTools
|
|
1168
1168
|
});
|
|
1169
|
-
accumulatedUsage = accumulateUsage(
|
|
1169
|
+
accumulatedUsage = accumulateUsage(
|
|
1170
|
+
accumulatedUsage,
|
|
1171
|
+
stepResult.usage
|
|
1172
|
+
);
|
|
1170
1173
|
if (stepResult.error) {
|
|
1171
1174
|
chatError = stepResult.error;
|
|
1172
1175
|
return;
|
|
@@ -1184,10 +1187,16 @@ async function* runChatLoop(deps) {
|
|
|
1184
1187
|
`Maximum steps (${config.maxSteps}) reached before the turn produced a final response`
|
|
1185
1188
|
);
|
|
1186
1189
|
chatError = maxStepsError;
|
|
1187
|
-
const statusEvent = {
|
|
1190
|
+
const statusEvent = {
|
|
1191
|
+
type: "status",
|
|
1192
|
+
status: "error"
|
|
1193
|
+
};
|
|
1188
1194
|
middlewareRunner.emitEvent(statusEvent);
|
|
1189
1195
|
yield statusEvent;
|
|
1190
|
-
const errorEvent = {
|
|
1196
|
+
const errorEvent = {
|
|
1197
|
+
type: "error",
|
|
1198
|
+
error: maxStepsError
|
|
1199
|
+
};
|
|
1191
1200
|
middlewareRunner.emitEvent(errorEvent);
|
|
1192
1201
|
yield errorEvent;
|
|
1193
1202
|
return;
|
|
@@ -1274,14 +1283,18 @@ async function* runChatLoop(deps) {
|
|
|
1274
1283
|
setIsStreaming(false);
|
|
1275
1284
|
interventionCtrl.onApplied = prevOnApplied;
|
|
1276
1285
|
if (middlewareRunner.hasMiddleware) {
|
|
1277
|
-
await middlewareRunner.runChatEnd(
|
|
1278
|
-
usage: chatUsage,
|
|
1279
|
-
error: chatError,
|
|
1280
|
-
output: chatOutput
|
|
1281
|
-
}, {
|
|
1286
|
+
await middlewareRunner.runChatEnd(
|
|
1282
1287
|
sessionId,
|
|
1283
|
-
|
|
1284
|
-
|
|
1288
|
+
{
|
|
1289
|
+
usage: chatUsage,
|
|
1290
|
+
error: chatError,
|
|
1291
|
+
output: chatOutput
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
sessionId,
|
|
1295
|
+
turnId
|
|
1296
|
+
}
|
|
1297
|
+
);
|
|
1285
1298
|
}
|
|
1286
1299
|
}
|
|
1287
1300
|
})()
|
|
@@ -1528,33 +1541,35 @@ function createHumanInputController(config = {}) {
|
|
|
1528
1541
|
createdAt: requestPayload.timestamp,
|
|
1529
1542
|
updatedAt: requestPayload.timestamp
|
|
1530
1543
|
};
|
|
1531
|
-
const responsePromise = new Promise(
|
|
1532
|
-
|
|
1533
|
-
const
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
record,
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1544
|
+
const responsePromise = new Promise(
|
|
1545
|
+
(resolve2, reject) => {
|
|
1546
|
+
const timeoutId = setTimeout(() => {
|
|
1547
|
+
const current2 = pending.get(record.id);
|
|
1548
|
+
if (!current2) {
|
|
1549
|
+
return;
|
|
1550
|
+
}
|
|
1551
|
+
pending.delete(record.id);
|
|
1552
|
+
current2.record = {
|
|
1553
|
+
...current2.record,
|
|
1554
|
+
status: "timed-out",
|
|
1555
|
+
updatedAt: Date.now()
|
|
1556
|
+
};
|
|
1557
|
+
void emitHumanInputEvent(
|
|
1558
|
+
{ emitEvent: current2.emitEvent },
|
|
1559
|
+
{ type: "status", status: "processing" }
|
|
1560
|
+
);
|
|
1561
|
+
reject(new HumanInputTimeoutError(timeout));
|
|
1562
|
+
}, timeout);
|
|
1563
|
+
pending.set(record.id, {
|
|
1564
|
+
record,
|
|
1565
|
+
resolve: resolve2,
|
|
1566
|
+
reject,
|
|
1567
|
+
ready: Promise.resolve(),
|
|
1568
|
+
timeoutId,
|
|
1569
|
+
emitEvent: context.emitEvent
|
|
1570
|
+
});
|
|
1571
|
+
}
|
|
1572
|
+
);
|
|
1558
1573
|
const current = pending.get(record.id);
|
|
1559
1574
|
if (current) {
|
|
1560
1575
|
current.ready = (async () => {
|
|
@@ -1761,12 +1776,16 @@ function createHumanInputToolWithController(controller, options = {}) {
|
|
|
1761
1776
|
if (!activeController) {
|
|
1762
1777
|
throw new HumanInputUnavailableError();
|
|
1763
1778
|
}
|
|
1764
|
-
response = await activeController.request(
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1779
|
+
response = await activeController.request(
|
|
1780
|
+
ctx.sessionID,
|
|
1781
|
+
{
|
|
1782
|
+
...params,
|
|
1783
|
+
toolCallId: typeof ctx.extra?.toolCallId === "string" ? ctx.extra.toolCallId : ctx.messageID
|
|
1784
|
+
},
|
|
1785
|
+
{
|
|
1786
|
+
emitEvent: ctx.emitEvent
|
|
1787
|
+
}
|
|
1788
|
+
);
|
|
1770
1789
|
} catch (error) {
|
|
1771
1790
|
if (error instanceof HumanInputUnavailableError) {
|
|
1772
1791
|
throw error;
|
|
@@ -1908,7 +1927,10 @@ function resolveAgentContextLimits(contextWindow, compactionConfig = {}) {
|
|
|
1908
1927
|
Math.max(1024, Math.round(contextWindow * 0.25)),
|
|
1909
1928
|
Math.max(512, proportionalReserve)
|
|
1910
1929
|
);
|
|
1911
|
-
const usableWindow = Math.max(
|
|
1930
|
+
const usableWindow = Math.max(
|
|
1931
|
+
512,
|
|
1932
|
+
getUsableTokenLimit({ contextWindow, reserveTokens })
|
|
1933
|
+
);
|
|
1912
1934
|
const requestedProtected = compactionConfig.protectedTokens ?? DEFAULT_CONTEXT_LIMITS.protectedTokens;
|
|
1913
1935
|
const requestedPruneMinimum = compactionConfig.pruneMinimum ?? DEFAULT_CONTEXT_LIMITS.pruneMinimum;
|
|
1914
1936
|
return {
|
|
@@ -1946,10 +1968,7 @@ function createMiddlewareSetup(input, config) {
|
|
|
1946
1968
|
agentName,
|
|
1947
1969
|
serviceName: input.tracing.serviceName ?? agentName
|
|
1948
1970
|
});
|
|
1949
|
-
effectiveMiddleware = [
|
|
1950
|
-
telemetryResult.middleware,
|
|
1951
|
-
...effectiveMiddleware
|
|
1952
|
-
];
|
|
1971
|
+
effectiveMiddleware = [telemetryResult.middleware, ...effectiveMiddleware];
|
|
1953
1972
|
telemetrySettings = telemetryResult.telemetry;
|
|
1954
1973
|
tracingShutdown = telemetryResult.shutdown;
|
|
1955
1974
|
}
|
|
@@ -2262,11 +2281,14 @@ var Agent = class _Agent {
|
|
|
2262
2281
|
* Lazy initialization - only connects on first use
|
|
2263
2282
|
*/
|
|
2264
2283
|
async ensureMCPConnected() {
|
|
2265
|
-
const nextState = await ensureMcpTools(
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2284
|
+
const nextState = await ensureMcpTools(
|
|
2285
|
+
{
|
|
2286
|
+
manager: this.mcpManager,
|
|
2287
|
+
connected: this.mcpConnected,
|
|
2288
|
+
cachedTools: this.mcpToolsCache
|
|
2289
|
+
},
|
|
2290
|
+
this._logger
|
|
2291
|
+
);
|
|
2270
2292
|
this.mcpConnected = nextState.connected;
|
|
2271
2293
|
this.mcpToolsCache = nextState.cachedTools;
|
|
2272
2294
|
return nextState.cachedTools ?? {};
|
|
@@ -2474,9 +2496,7 @@ var Agent = class _Agent {
|
|
|
2474
2496
|
* ```
|
|
2475
2497
|
*/
|
|
2476
2498
|
getContextStats() {
|
|
2477
|
-
return this.contextManager.getStats(
|
|
2478
|
-
this.sessions.getMessages()
|
|
2479
|
-
);
|
|
2499
|
+
return this.contextManager.getStats(this.sessions.getMessages());
|
|
2480
2500
|
}
|
|
2481
2501
|
/**
|
|
2482
2502
|
* Manually trigger context compaction.
|
|
@@ -2700,10 +2720,7 @@ var Agent = class _Agent {
|
|
|
2700
2720
|
if (inferred) {
|
|
2701
2721
|
this.contextManager.setLimits({
|
|
2702
2722
|
contextWindow: inferred,
|
|
2703
|
-
...resolveAgentContextLimits(
|
|
2704
|
-
inferred,
|
|
2705
|
-
this.config.compaction
|
|
2706
|
-
)
|
|
2723
|
+
...resolveAgentContextLimits(inferred, this.config.compaction)
|
|
2707
2724
|
});
|
|
2708
2725
|
}
|
|
2709
2726
|
}
|
|
@@ -3035,8 +3052,7 @@ function createEventPrinter(options = {}) {
|
|
|
3035
3052
|
);
|
|
3036
3053
|
break;
|
|
3037
3054
|
case "tool-result":
|
|
3038
|
-
if (tools)
|
|
3039
|
-
stderr.write(` \u2713 ${String(event.result).slice(0, 200)}
|
|
3055
|
+
if (tools) stderr.write(` \u2713 ${String(event.result).slice(0, 200)}
|
|
3040
3056
|
`);
|
|
3041
3057
|
break;
|
|
3042
3058
|
case "tool-error":
|
|
@@ -3052,18 +3068,15 @@ function createEventPrinter(options = {}) {
|
|
|
3052
3068
|
);
|
|
3053
3069
|
break;
|
|
3054
3070
|
case "approval-resolved":
|
|
3055
|
-
if (safety)
|
|
3056
|
-
stderr.write(`\u{1F6C2} Approval ${event.id} \u2192 ${event.action}
|
|
3071
|
+
if (safety) stderr.write(`\u{1F6C2} Approval ${event.id} \u2192 ${event.action}
|
|
3057
3072
|
`);
|
|
3058
3073
|
break;
|
|
3059
3074
|
case "intervention-applied":
|
|
3060
|
-
if (safety)
|
|
3061
|
-
stderr.write(`\u270B Intervention \u2192 ${event.message}
|
|
3075
|
+
if (safety) stderr.write(`\u270B Intervention \u2192 ${event.message}
|
|
3062
3076
|
`);
|
|
3063
3077
|
break;
|
|
3064
3078
|
case "follow-up-queued":
|
|
3065
|
-
if (safety)
|
|
3066
|
-
stderr.write(`\u{1F4CC} Follow-up queued \u2192 ${event.message}
|
|
3079
|
+
if (safety) stderr.write(`\u{1F4CC} Follow-up queued \u2192 ${event.message}
|
|
3067
3080
|
`);
|
|
3068
3081
|
break;
|
|
3069
3082
|
// ── Safety ────────────────────────────────────────────────────
|
|
@@ -3090,13 +3103,11 @@ function createEventPrinter(options = {}) {
|
|
|
3090
3103
|
break;
|
|
3091
3104
|
// ── Computer use ──────────────────────────────────────────────
|
|
3092
3105
|
case "computer-call":
|
|
3093
|
-
if (tools)
|
|
3094
|
-
stderr.write(`\u{1F5A5}\uFE0F Computer action \u2192 ${event.callId}
|
|
3106
|
+
if (tools) stderr.write(`\u{1F5A5}\uFE0F Computer action \u2192 ${event.callId}
|
|
3095
3107
|
`);
|
|
3096
3108
|
break;
|
|
3097
3109
|
case "computer-result":
|
|
3098
|
-
if (tools)
|
|
3099
|
-
stderr.write(`\u{1F5A5}\uFE0F Computer result \u2192 ${event.callId}
|
|
3110
|
+
if (tools) stderr.write(`\u{1F5A5}\uFE0F Computer result \u2192 ${event.callId}
|
|
3100
3111
|
`);
|
|
3101
3112
|
break;
|
|
3102
3113
|
// ── Human input ───────────────────────────────────────────────
|
|
@@ -3112,10 +3123,8 @@ function createEventPrinter(options = {}) {
|
|
|
3112
3123
|
// host handles display
|
|
3113
3124
|
// ── Error & retry ─────────────────────────────────────────────
|
|
3114
3125
|
case "retry":
|
|
3115
|
-
stderr.write(
|
|
3116
|
-
|
|
3117
|
-
`
|
|
3118
|
-
);
|
|
3126
|
+
stderr.write(`\u{1F501} Retry ${event.attempt} in ${event.delayMs}ms
|
|
3127
|
+
`);
|
|
3119
3128
|
break;
|
|
3120
3129
|
case "error":
|
|
3121
3130
|
stderr.write(`\u274C ${event.error.message}
|
|
@@ -3124,10 +3133,8 @@ function createEventPrinter(options = {}) {
|
|
|
3124
3133
|
// ── Completion ────────────────────────────────────────────────
|
|
3125
3134
|
case "complete":
|
|
3126
3135
|
if (completion)
|
|
3127
|
-
stderr.write(
|
|
3128
|
-
|
|
3129
|
-
`
|
|
3130
|
-
);
|
|
3136
|
+
stderr.write(`\u2705 Done \u2014 ${event.usage?.totalTokens ?? "?"} tokens
|
|
3137
|
+
`);
|
|
3131
3138
|
break;
|
|
3132
3139
|
// ── Team events ───────────────────────────────────────────────
|
|
3133
3140
|
default:
|
|
@@ -3145,22 +3152,16 @@ function printTeamEvent(out, event) {
|
|
|
3145
3152
|
`);
|
|
3146
3153
|
break;
|
|
3147
3154
|
case "team-member-registered":
|
|
3148
|
-
out.write(
|
|
3149
|
-
|
|
3150
|
-
`
|
|
3151
|
-
);
|
|
3155
|
+
out.write(` \u{1F464} ${event.member.id} (${event.member.role})
|
|
3156
|
+
`);
|
|
3152
3157
|
break;
|
|
3153
3158
|
case "team-task-completed":
|
|
3154
|
-
out.write(
|
|
3155
|
-
|
|
3156
|
-
`
|
|
3157
|
-
);
|
|
3159
|
+
out.write(` \u2705 Task ${event.taskId} completed
|
|
3160
|
+
`);
|
|
3158
3161
|
break;
|
|
3159
3162
|
case "team-task-failed":
|
|
3160
|
-
out.write(
|
|
3161
|
-
|
|
3162
|
-
`
|
|
3163
|
-
);
|
|
3163
|
+
out.write(` \u274C Task ${event.taskId} failed
|
|
3164
|
+
`);
|
|
3164
3165
|
break;
|
|
3165
3166
|
case "team-stopped":
|
|
3166
3167
|
out.write(`\u{1F3C1} Team stopped
|
|
@@ -3217,6 +3218,7 @@ export {
|
|
|
3217
3218
|
ApprovalTimeoutError,
|
|
3218
3219
|
CacheCapabilitySource,
|
|
3219
3220
|
CapabilityCache,
|
|
3221
|
+
ClientCredentialsProvider,
|
|
3220
3222
|
ContextManager,
|
|
3221
3223
|
ContextOverflowError,
|
|
3222
3224
|
DEFAULT_AGENT_NAME,
|
|
@@ -3535,6 +3537,7 @@ export {
|
|
|
3535
3537
|
sandboxDefaultsProvider,
|
|
3536
3538
|
selectRememberScope,
|
|
3537
3539
|
serializeMessage,
|
|
3540
|
+
serviceAccountServer,
|
|
3538
3541
|
shouldCaptureBaseline,
|
|
3539
3542
|
shouldCascadeApprovalDecision,
|
|
3540
3543
|
shouldIncludeReasoningSummary,
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { T as Tool, a as TurnTrackerContext, H as HumanInputController, b as MiddlewareRunner, A as AgentEvent, c as ToolExecutionMode, I as InferenceStreamInput, d as ModelCallContext, e as AnyInferenceResult } from '../instance-
|
|
2
|
-
export { D as DEFAULT_MAX_OUTPUT_TOKENS, f as DEFAULT_RETRY_CONFIG, g as InferenceCustomResult, h as InferenceStepInfo, i as InferenceStreamResult, R as RetryConfig, j as RetryHandlerOptions, k as RetryState, l as calculateDelay, m as createRetryHandler, n as createRetryState, s as shouldRetry, o as sleep, w as withRetry } from '../instance-
|
|
1
|
+
import { T as Tool, a as TurnTrackerContext, H as HumanInputController, b as MiddlewareRunner, A as AgentEvent, c as ToolExecutionMode, I as InferenceStreamInput, d as ModelCallContext, e as AnyInferenceResult } from '../instance-CP24g3Le.js';
|
|
2
|
+
export { D as DEFAULT_MAX_OUTPUT_TOKENS, f as DEFAULT_RETRY_CONFIG, g as InferenceCustomResult, h as InferenceStepInfo, i as InferenceStreamResult, R as RetryConfig, j as RetryHandlerOptions, k as RetryState, l as calculateDelay, m as createRetryHandler, n as createRetryState, s as shouldRetry, o as sleep, w as withRetry } from '../instance-CP24g3Le.js';
|
|
3
3
|
import { ToolSet } from 'ai';
|
|
4
4
|
import { T as ToolHost } from '../types-C_LCeYNg.js';
|
|
5
|
-
export { c as convertAgentMessagesToModelMessages } from '../model-messages-
|
|
5
|
+
export { c as convertAgentMessagesToModelMessages } from '../model-messages-B_MCHyiX.js';
|
|
6
6
|
export { E as ErrorCategory, L as LLMError, a as LLMErrorOptions, R as ResponseHeaders } from '../llm-error-D93FNNLY.js';
|
|
7
7
|
export { getErrorCategory, getRetryDelay, isRetryable, isRetryableCategory, parseRetryDelay } from './errors/index.js';
|
|
8
8
|
import '../types-RSCv7nQ4.js';
|
|
9
9
|
import 'zod';
|
|
10
10
|
import '../types-CQaXbRsS.js';
|
|
11
|
-
import '../types-
|
|
11
|
+
import '../types-DMjoFKKv.js';
|
|
12
|
+
import '@modelcontextprotocol/sdk/client/auth.js';
|
|
13
|
+
import '@modelcontextprotocol/sdk/types.js';
|
|
12
14
|
import '@ai-sdk/provider-utils';
|
|
13
15
|
import '../sandbox/index.js';
|
|
14
16
|
|
package/dist/inference/index.js
CHANGED
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
streamOnce,
|
|
14
14
|
streamStep,
|
|
15
15
|
withRetry
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
16
|
+
} from "../chunk-33UIM3QS.js";
|
|
17
|
+
import "../chunk-QEE5CBPM.js";
|
|
18
18
|
import {
|
|
19
19
|
LLMError,
|
|
20
20
|
getErrorCategory,
|
|
@@ -22,15 +22,15 @@ import {
|
|
|
22
22
|
isRetryable,
|
|
23
23
|
isRetryableCategory,
|
|
24
24
|
parseRetryDelay
|
|
25
|
-
} from "../chunk-
|
|
26
|
-
import "../chunk-
|
|
25
|
+
} from "../chunk-STDJYXYK.js";
|
|
26
|
+
import "../chunk-WI5JFEAI.js";
|
|
27
27
|
import {
|
|
28
28
|
DEFAULT_MAX_TOKENS
|
|
29
29
|
} from "../chunk-CJI7PVS2.js";
|
|
30
30
|
import "../chunk-I6PKJ7XQ.js";
|
|
31
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-MLTJHUVG.js";
|
|
32
32
|
import "../chunk-FII65CN7.js";
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-S6AKEPAX.js";
|
|
34
34
|
export {
|
|
35
35
|
DEFAULT_MAX_TOKENS as DEFAULT_MAX_OUTPUT_TOKENS,
|
|
36
36
|
DEFAULT_RETRY_CONFIG,
|
|
@@ -4,7 +4,7 @@ import { LanguageModel, ModelMessage, TelemetrySettings, SystemModelMessage, Str
|
|
|
4
4
|
import { L as Logger } from './types-RSCv7nQ4.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { R as ReasoningLevel } from './types-CQaXbRsS.js';
|
|
7
|
-
import { a as MCPManager } from './types-
|
|
7
|
+
import { a as MCPManager } from './types-DMjoFKKv.js';
|
|
8
8
|
import { ProviderOptions } from '@ai-sdk/provider-utils';
|
|
9
9
|
import { SandboxSession } from './sandbox/index.js';
|
|
10
10
|
import { L as LLMError } from './llm-error-D93FNNLY.js';
|
|
@@ -1615,7 +1615,7 @@ declare namespace Tool {
|
|
|
1615
1615
|
toolCallId: string;
|
|
1616
1616
|
input: InferSchemaOutput<TParams>;
|
|
1617
1617
|
output: unknown;
|
|
1618
|
-
}) =>
|
|
1618
|
+
}) => unknown | Promise<unknown>;
|
|
1619
1619
|
}
|
|
1620
1620
|
/**
|
|
1621
1621
|
* Result of tool execution.
|