@cuylabs/agent-core 5.6.1 → 5.7.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-T33MQXUP.js → chunk-4HB2AAGM.js} +1 -0
- package/dist/{chunk-JUIL2NJC.js → chunk-C4ZVWRS5.js} +1 -1
- package/dist/{chunk-GHVW7L4P.js → chunk-D24LUJUN.js} +1 -1
- package/dist/{chunk-SJCAIWLZ.js → chunk-DDYPN2JE.js} +312 -5
- package/dist/{chunk-3ABZ5MIT.js → chunk-DWM3E5GI.js} +2 -2
- package/dist/{chunk-NICU5N2S.js → chunk-MSRJADIB.js} +2 -2
- package/dist/dispatch/index.js +2 -2
- package/dist/execution/index.js +4 -4
- package/dist/execution/turn/index.js +4 -4
- package/dist/index.js +69 -67
- package/dist/inference/index.js +3 -3
- package/dist/middleware/index.js +2 -2
- package/dist/safety/index.js +1 -1
- package/dist/safety/risk.d.ts.map +1 -1
- package/dist/skill/index.js +1 -1
- package/dist/subagents/index.d.ts +1 -1
- package/dist/subagents/index.d.ts.map +1 -1
- package/dist/subagents/index.js +5 -3
- package/dist/subagents/inspection.d.ts +11 -0
- package/dist/subagents/inspection.d.ts.map +1 -0
- package/dist/subagents/results.d.ts +26 -0
- package/dist/subagents/results.d.ts.map +1 -1
- package/dist/subagents/tool-factories.d.ts +2 -1
- package/dist/subagents/tool-factories.d.ts.map +1 -1
- package/dist/subagents/tools.d.ts +2 -2
- package/dist/subagents/tools.d.ts.map +1 -1
- package/dist/tool/index.js +2 -2
- package/package.json +1 -1
- package/dist/{chunk-ZETYNQ35.js → chunk-LPWOYMS2.js} +3 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Profiles
|
|
3
|
-
} from "./chunk-TPZ37IWI.js";
|
|
4
1
|
import {
|
|
5
2
|
createLocalDispatchRuntime
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LPWOYMS2.js";
|
|
7
4
|
import {
|
|
8
5
|
Tool
|
|
9
6
|
} from "./chunk-MJML3A2F.js";
|
|
7
|
+
import {
|
|
8
|
+
Profiles
|
|
9
|
+
} from "./chunk-TPZ37IWI.js";
|
|
10
10
|
|
|
11
11
|
// src/subagents/types.ts
|
|
12
12
|
var DEFAULT_SUBAGENT_CONCURRENCY = 6;
|
|
@@ -25,6 +25,24 @@ function formatToolCallsLine(result) {
|
|
|
25
25
|
return result.toolCalls.length > 0 ? `
|
|
26
26
|
Tool calls: ${result.toolCalls.map((tool) => tool.name).join(", ")}` : "";
|
|
27
27
|
}
|
|
28
|
+
function formatCounter(counter) {
|
|
29
|
+
const entries = Object.entries(counter).sort(
|
|
30
|
+
([a], [b]) => a.localeCompare(b)
|
|
31
|
+
);
|
|
32
|
+
if (entries.length === 0) {
|
|
33
|
+
return "none";
|
|
34
|
+
}
|
|
35
|
+
return entries.map(([name, count]) => `${name} ${count}`).join(", ");
|
|
36
|
+
}
|
|
37
|
+
function formatActiveTools(tools) {
|
|
38
|
+
if (tools.length === 0) {
|
|
39
|
+
return "none";
|
|
40
|
+
}
|
|
41
|
+
return tools.slice(0, 3).map((tool) => {
|
|
42
|
+
const details = tool.inputSummary ? ` (${tool.inputSummary})` : "";
|
|
43
|
+
return `${tool.toolName} since ${tool.startedAt}${details}`;
|
|
44
|
+
}).join("; ");
|
|
45
|
+
}
|
|
28
46
|
function formatInvalidAgentTypeResult(roleName, validNames) {
|
|
29
47
|
return {
|
|
30
48
|
title: "Invalid role",
|
|
@@ -91,6 +109,55 @@ function formatWaitResult(agentId, roleName, result) {
|
|
|
91
109
|
}
|
|
92
110
|
};
|
|
93
111
|
}
|
|
112
|
+
function formatInspectMissingAgentResult(id) {
|
|
113
|
+
return {
|
|
114
|
+
title: "Unknown subagent ID",
|
|
115
|
+
output: `No tracked subagent or durable progress events were found for "${id}".`,
|
|
116
|
+
metadata: { id, missing: true }
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function formatInspectAgentResult(result) {
|
|
120
|
+
const lines = [
|
|
121
|
+
`Subagent "${result.id}" is ${result.status}.`,
|
|
122
|
+
"",
|
|
123
|
+
`Title: ${result.title ?? "unknown"}`,
|
|
124
|
+
`Role: ${result.role ?? "unknown"}`,
|
|
125
|
+
...result.sessionId ? [`Session: ${result.sessionId}`] : [],
|
|
126
|
+
...result.createdAt ? [`Started: ${result.createdAt}`] : [],
|
|
127
|
+
...result.updatedAt ? [`Last update: ${result.updatedAt}`] : [],
|
|
128
|
+
...result.latestStatus ? [`Latest status: ${result.latestStatus}`] : [],
|
|
129
|
+
`Progress events: ${result.eventCount}`,
|
|
130
|
+
"",
|
|
131
|
+
"Tool progress:",
|
|
132
|
+
`- Started: ${formatCounter(result.startedToolCounts)}`,
|
|
133
|
+
`- Completed: ${formatCounter(result.completedToolCounts)}`,
|
|
134
|
+
`- Active: ${formatActiveTools(result.activeTools)}`,
|
|
135
|
+
...result.error ? ["", `Error: ${result.error}`] : [],
|
|
136
|
+
...result.hasResult ? [
|
|
137
|
+
"",
|
|
138
|
+
`Result: available via wait_agent (${result.resultLength ?? 0} chars).`,
|
|
139
|
+
...result.resultPreview ? ["", "Result preview:", result.resultPreview] : []
|
|
140
|
+
] : result.status === "completed" ? ["", "Result: completed, but full result metadata is unavailable."] : ["", "Result: not available yet."],
|
|
141
|
+
...result.recentActivity.length > 0 ? [
|
|
142
|
+
"",
|
|
143
|
+
"Recent activity:",
|
|
144
|
+
...result.recentActivity.map((line) => `- ${line}`)
|
|
145
|
+
] : []
|
|
146
|
+
];
|
|
147
|
+
return {
|
|
148
|
+
title: "Subagent progress",
|
|
149
|
+
output: lines.join("\n"),
|
|
150
|
+
metadata: {
|
|
151
|
+
id: result.id,
|
|
152
|
+
status: result.status,
|
|
153
|
+
role: result.role,
|
|
154
|
+
sessionId: result.sessionId,
|
|
155
|
+
eventCount: result.eventCount,
|
|
156
|
+
hasResult: result.hasResult,
|
|
157
|
+
resultLength: result.resultLength
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
94
161
|
function formatWaitTimeoutResult(timeoutMs, runningIds) {
|
|
95
162
|
return {
|
|
96
163
|
title: "Wait timed out",
|
|
@@ -138,10 +205,217 @@ function formatCancelledAgentResult(id, roleName) {
|
|
|
138
205
|
};
|
|
139
206
|
}
|
|
140
207
|
|
|
208
|
+
// src/subagents/inspection.ts
|
|
209
|
+
var DEFAULT_INSPECT_AGENT_RECENT_EVENTS = 5;
|
|
210
|
+
var MAX_INSPECT_AGENT_RECENT_EVENTS = 20;
|
|
211
|
+
var MAX_INSPECT_AGENT_PREVIEW_CHARS = 1200;
|
|
212
|
+
var MAX_INSPECT_AGENT_INPUT_FIELDS = 4;
|
|
213
|
+
var MAX_INSPECT_AGENT_INPUT_VALUE_CHARS = 140;
|
|
214
|
+
var SENSITIVE_INPUT_KEY = /authorization|api[_-]?key|client[_-]?secret|password|secret|token/i;
|
|
215
|
+
function normalizeInspectRecentEvents(value) {
|
|
216
|
+
if (value === void 0 || !Number.isFinite(value) || value <= 0) {
|
|
217
|
+
return DEFAULT_INSPECT_AGENT_RECENT_EVENTS;
|
|
218
|
+
}
|
|
219
|
+
return Math.min(Math.floor(value), MAX_INSPECT_AGENT_RECENT_EVENTS);
|
|
220
|
+
}
|
|
221
|
+
function innerDispatchEvent(record) {
|
|
222
|
+
return record.event.type === "subagent-event" ? record.event.event : record.event;
|
|
223
|
+
}
|
|
224
|
+
function incrementCounter(counter, key) {
|
|
225
|
+
counter[key] = (counter[key] ?? 0) + 1;
|
|
226
|
+
}
|
|
227
|
+
function truncateInline(value, max = MAX_INSPECT_AGENT_INPUT_VALUE_CHARS) {
|
|
228
|
+
const normalized = value.replace(/\s+/g, " ").trim();
|
|
229
|
+
return normalized.length <= max ? normalized : `${normalized.slice(0, Math.max(0, max - 3)).trimEnd()}...`;
|
|
230
|
+
}
|
|
231
|
+
function formatInputValue(key, value) {
|
|
232
|
+
if (SENSITIVE_INPUT_KEY.test(key)) {
|
|
233
|
+
return "[redacted]";
|
|
234
|
+
}
|
|
235
|
+
if (typeof value === "string") {
|
|
236
|
+
return truncateInline(value);
|
|
237
|
+
}
|
|
238
|
+
if (typeof value === "number" || typeof value === "boolean" || value === null) {
|
|
239
|
+
return String(value);
|
|
240
|
+
}
|
|
241
|
+
try {
|
|
242
|
+
return truncateInline(JSON.stringify(redactInput(value)));
|
|
243
|
+
} catch {
|
|
244
|
+
return "[unserializable]";
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
function redactInput(value) {
|
|
248
|
+
if (Array.isArray(value)) {
|
|
249
|
+
return value.slice(0, 10).map((item) => redactInput(item));
|
|
250
|
+
}
|
|
251
|
+
if (!value || typeof value !== "object") {
|
|
252
|
+
return value;
|
|
253
|
+
}
|
|
254
|
+
return Object.fromEntries(
|
|
255
|
+
Object.entries(value).map(([key, nested]) => [
|
|
256
|
+
key,
|
|
257
|
+
SENSITIVE_INPUT_KEY.test(key) ? "[redacted]" : redactInput(nested)
|
|
258
|
+
])
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
function formatInputSummary(input) {
|
|
262
|
+
if (!input || typeof input !== "object" || Array.isArray(input)) {
|
|
263
|
+
return void 0;
|
|
264
|
+
}
|
|
265
|
+
const parts = Object.entries(input).filter(([, value]) => value !== void 0).slice(0, MAX_INSPECT_AGENT_INPUT_FIELDS).map(([key, value]) => `${key}: ${formatInputValue(key, value)}`);
|
|
266
|
+
return parts.length > 0 ? parts.join(", ") : void 0;
|
|
267
|
+
}
|
|
268
|
+
function formatTimestamp(value) {
|
|
269
|
+
const date = new Date(value);
|
|
270
|
+
if (Number.isNaN(date.getTime())) {
|
|
271
|
+
return value;
|
|
272
|
+
}
|
|
273
|
+
return date.toISOString().slice(11, 19);
|
|
274
|
+
}
|
|
275
|
+
function formatUnknownError(error) {
|
|
276
|
+
if (error instanceof Error) {
|
|
277
|
+
return truncateInline(error.message);
|
|
278
|
+
}
|
|
279
|
+
if (error && typeof error === "object" && "message" in error) {
|
|
280
|
+
const message = error.message;
|
|
281
|
+
if (typeof message === "string") {
|
|
282
|
+
return truncateInline(message);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return truncateInline(String(error));
|
|
286
|
+
}
|
|
287
|
+
function activityLine(record) {
|
|
288
|
+
const event = innerDispatchEvent(record);
|
|
289
|
+
const timestamp = formatTimestamp(record.createdAt);
|
|
290
|
+
switch (event.type) {
|
|
291
|
+
case "subagent-start":
|
|
292
|
+
return `${timestamp} subagent started`;
|
|
293
|
+
case "status":
|
|
294
|
+
return `${timestamp} status: ${event.status}`;
|
|
295
|
+
case "tool-start": {
|
|
296
|
+
const inputSummary = formatInputSummary(event.input);
|
|
297
|
+
return `${timestamp} started ${event.toolName}${inputSummary ? ` (${inputSummary})` : ""}`;
|
|
298
|
+
}
|
|
299
|
+
case "tool-result":
|
|
300
|
+
return `${timestamp} completed ${event.toolName}`;
|
|
301
|
+
case "tool-error":
|
|
302
|
+
return `${timestamp} ${event.toolName} failed: ${truncateInline(
|
|
303
|
+
event.error
|
|
304
|
+
)}`;
|
|
305
|
+
case "approval-request":
|
|
306
|
+
return `${timestamp} waiting for approval`;
|
|
307
|
+
case "approval-resolved":
|
|
308
|
+
return `${timestamp} approval ${event.action}`;
|
|
309
|
+
case "human-input-request":
|
|
310
|
+
return `${timestamp} waiting for input`;
|
|
311
|
+
case "human-input-resolved":
|
|
312
|
+
return `${timestamp} input received`;
|
|
313
|
+
case "subagent-complete":
|
|
314
|
+
return `${timestamp} subagent completed`;
|
|
315
|
+
case "subagent-error":
|
|
316
|
+
return `${timestamp} subagent ${event.status}: ${truncateInline(
|
|
317
|
+
event.error
|
|
318
|
+
)}`;
|
|
319
|
+
case "error":
|
|
320
|
+
return `${timestamp} error: ${formatUnknownError(event.error)}`;
|
|
321
|
+
default:
|
|
322
|
+
return void 0;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
function selectRecentActivity(records, recentLimit) {
|
|
326
|
+
const activity = [];
|
|
327
|
+
let previousStatus;
|
|
328
|
+
for (const record of records) {
|
|
329
|
+
const event = innerDispatchEvent(record);
|
|
330
|
+
if (event.type === "status") {
|
|
331
|
+
if (event.status === previousStatus) {
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
previousStatus = event.status;
|
|
335
|
+
}
|
|
336
|
+
const line = activityLine(record);
|
|
337
|
+
if (line) {
|
|
338
|
+
activity.push(line);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return activity.slice(-recentLimit);
|
|
342
|
+
}
|
|
343
|
+
function summarizeEvents(records, recentLimit) {
|
|
344
|
+
const activeTools = /* @__PURE__ */ new Map();
|
|
345
|
+
const startedToolCounts = {};
|
|
346
|
+
const completedToolCounts = {};
|
|
347
|
+
let latestStatus;
|
|
348
|
+
for (const record of records) {
|
|
349
|
+
const event = innerDispatchEvent(record);
|
|
350
|
+
if (event.type === "status") {
|
|
351
|
+
latestStatus = event.status;
|
|
352
|
+
}
|
|
353
|
+
if (event.type === "tool-start") {
|
|
354
|
+
incrementCounter(startedToolCounts, event.toolName);
|
|
355
|
+
activeTools.set(event.toolCallId, {
|
|
356
|
+
inputSummary: formatInputSummary(event.input),
|
|
357
|
+
sequence: record.sequence,
|
|
358
|
+
startedAt: record.createdAt,
|
|
359
|
+
toolCallId: event.toolCallId,
|
|
360
|
+
toolName: event.toolName
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
if (event.type === "tool-result") {
|
|
364
|
+
incrementCounter(completedToolCounts, event.toolName);
|
|
365
|
+
activeTools.delete(event.toolCallId);
|
|
366
|
+
}
|
|
367
|
+
if (event.type === "tool-error") {
|
|
368
|
+
activeTools.delete(event.toolCallId);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return {
|
|
372
|
+
activeTools: [...activeTools.values()].sort((a, b) => b.sequence - a.sequence).map(({ sequence: _sequence, ...tool }) => tool),
|
|
373
|
+
completedToolCounts,
|
|
374
|
+
...latestStatus ? { latestStatus } : {},
|
|
375
|
+
recentActivity: selectRecentActivity(records, recentLimit),
|
|
376
|
+
startedToolCounts
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
function resultPreview(record) {
|
|
380
|
+
const response = record?.result?.response;
|
|
381
|
+
if (!response) {
|
|
382
|
+
return {};
|
|
383
|
+
}
|
|
384
|
+
return {
|
|
385
|
+
resultLength: response.length,
|
|
386
|
+
resultPreview: response.length <= MAX_INSPECT_AGENT_PREVIEW_CHARS ? response : `${response.slice(0, MAX_INSPECT_AGENT_PREVIEW_CHARS - 3).trimEnd()}...`
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
async function inspectDispatch(options) {
|
|
390
|
+
const [record, events] = await Promise.all([
|
|
391
|
+
options.runtime.check(options.id),
|
|
392
|
+
options.runtime.listEvents?.({ dispatchId: options.id }) ?? []
|
|
393
|
+
]);
|
|
394
|
+
if (!record && events.length === 0) {
|
|
395
|
+
return formatInspectMissingAgentResult(options.id);
|
|
396
|
+
}
|
|
397
|
+
const sortedEvents = [...events].sort((a, b) => a.sequence - b.sequence);
|
|
398
|
+
return formatInspectAgentResult({
|
|
399
|
+
id: options.id,
|
|
400
|
+
status: record?.status ?? "unknown",
|
|
401
|
+
role: record?.targetType ?? sortedEvents[0]?.targetType,
|
|
402
|
+
title: record?.title ?? sortedEvents[0]?.title,
|
|
403
|
+
sessionId: record?.sessionId ?? sortedEvents[0]?.childSessionId,
|
|
404
|
+
createdAt: record?.createdAt ?? sortedEvents[0]?.createdAt,
|
|
405
|
+
updatedAt: record?.updatedAt ?? sortedEvents.at(-1)?.createdAt,
|
|
406
|
+
error: record?.error,
|
|
407
|
+
eventCount: sortedEvents.length,
|
|
408
|
+
...summarizeEvents(sortedEvents, options.recentEvents),
|
|
409
|
+
...resultPreview(record),
|
|
410
|
+
hasResult: Boolean(record?.result)
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
|
|
141
414
|
// src/subagents/tool-factories.ts
|
|
142
415
|
var SUBAGENT_TOOL_IDS = [
|
|
143
416
|
"invoke_agent",
|
|
144
417
|
"wait_agent",
|
|
418
|
+
"inspect_agent",
|
|
145
419
|
"close_agent"
|
|
146
420
|
];
|
|
147
421
|
var DEFAULT_WAIT_AGENT_TIMEOUT_MS = 6e4;
|
|
@@ -321,6 +595,33 @@ function createWaitAgentTool(runtime) {
|
|
|
321
595
|
}
|
|
322
596
|
});
|
|
323
597
|
}
|
|
598
|
+
function createInspectAgentTool(runtime) {
|
|
599
|
+
return Tool.define("inspect_agent", {
|
|
600
|
+
description: "Inspect a running or completed subagent without blocking for the full result. Use this for progress checks, current status, recent activity, and tool progress. If the subagent is complete and you need the full result, call wait_agent.",
|
|
601
|
+
capabilities: {
|
|
602
|
+
parallelSafe: true,
|
|
603
|
+
readOnly: true,
|
|
604
|
+
riskLevel: "safe"
|
|
605
|
+
},
|
|
606
|
+
parameters: z.object({
|
|
607
|
+
id: z.string().describe("Subagent ID returned by invoke_agent."),
|
|
608
|
+
recent_events: z.number().optional().describe(
|
|
609
|
+
`Recent activity rows to include (default ${DEFAULT_INSPECT_AGENT_RECENT_EVENTS}, max ${MAX_INSPECT_AGENT_RECENT_EVENTS}).`
|
|
610
|
+
)
|
|
611
|
+
}),
|
|
612
|
+
execute: async (params) => {
|
|
613
|
+
try {
|
|
614
|
+
return await inspectDispatch({
|
|
615
|
+
runtime,
|
|
616
|
+
id: params.id,
|
|
617
|
+
recentEvents: normalizeInspectRecentEvents(params.recent_events)
|
|
618
|
+
});
|
|
619
|
+
} catch (error) {
|
|
620
|
+
return formatWaitErrorResult(error);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
}
|
|
324
625
|
function createCloseAgentTool(runtime) {
|
|
325
626
|
return Tool.define("close_agent", {
|
|
326
627
|
description: "Cancel a running subagent. Use when the result is no longer needed or the subagent is taking too long.",
|
|
@@ -363,6 +664,7 @@ function createSubAgentTools(parent, options) {
|
|
|
363
664
|
if (options.async) {
|
|
364
665
|
tools2.push(
|
|
365
666
|
createWaitAgentTool(childRuntime),
|
|
667
|
+
createInspectAgentTool(childRuntime),
|
|
366
668
|
createCloseAgentTool(childRuntime)
|
|
367
669
|
);
|
|
368
670
|
}
|
|
@@ -373,7 +675,11 @@ function createSubAgentTools(parent, options) {
|
|
|
373
675
|
createInvokeAgentTool(runtime, options.roles, options)
|
|
374
676
|
];
|
|
375
677
|
if (options.async) {
|
|
376
|
-
tools.push(
|
|
678
|
+
tools.push(
|
|
679
|
+
createWaitAgentTool(runtime),
|
|
680
|
+
createInspectAgentTool(runtime),
|
|
681
|
+
createCloseAgentTool(runtime)
|
|
682
|
+
);
|
|
377
683
|
}
|
|
378
684
|
return tools;
|
|
379
685
|
}
|
|
@@ -879,6 +1185,7 @@ export {
|
|
|
879
1185
|
SUBAGENT_TOOL_IDS,
|
|
880
1186
|
createInvokeAgentTool,
|
|
881
1187
|
createWaitAgentTool,
|
|
1188
|
+
createInspectAgentTool,
|
|
882
1189
|
createCloseAgentTool,
|
|
883
1190
|
createSubAgentTools,
|
|
884
1191
|
LOCAL_SUBAGENT_BACKEND,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-STDJYXYK.js";
|
|
5
5
|
import {
|
|
6
6
|
executeAgentToolCall
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-C4ZVWRS5.js";
|
|
8
8
|
import {
|
|
9
9
|
snapshotScope
|
|
10
10
|
} from "./chunk-AHDCR7SX.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-CNM6OROH.js";
|
|
18
18
|
import {
|
|
19
19
|
formatApprovalDeniedReason
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-4HB2AAGM.js";
|
|
21
21
|
|
|
22
22
|
// src/inference/toolset.ts
|
|
23
23
|
import {
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
Inference,
|
|
11
11
|
buildModelCallContext
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DWM3E5GI.js";
|
|
13
13
|
import {
|
|
14
14
|
LLMError
|
|
15
15
|
} from "./chunk-STDJYXYK.js";
|
|
16
16
|
import {
|
|
17
17
|
executeAgentToolCall
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-C4ZVWRS5.js";
|
|
19
19
|
import {
|
|
20
20
|
streamWithinScope
|
|
21
21
|
} from "./chunk-AHDCR7SX.js";
|
package/dist/dispatch/index.js
CHANGED
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
DISPATCH_STATES,
|
|
17
17
|
createDispatchTools,
|
|
18
18
|
createLocalDispatchRuntime
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-EDKZOPUV.js";
|
|
19
|
+
} from "../chunk-LPWOYMS2.js";
|
|
21
20
|
import "../chunk-SZ2XBPTW.js";
|
|
22
21
|
import "../chunk-MJML3A2F.js";
|
|
22
|
+
import "../chunk-EDKZOPUV.js";
|
|
23
23
|
import "../chunk-CGP6UNCQ.js";
|
|
24
24
|
export {
|
|
25
25
|
DEFAULT_DISPATCH_TOOL_IDS,
|
package/dist/execution/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
processStepStream,
|
|
15
15
|
runModelStep,
|
|
16
16
|
runToolBatch
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-MSRJADIB.js";
|
|
18
18
|
import {
|
|
19
19
|
applyAgentWorkflowCommitResult,
|
|
20
20
|
applyAgentWorkflowContextCompactionResult,
|
|
@@ -46,9 +46,9 @@ import "../chunk-DYZGHHDB.js";
|
|
|
46
46
|
import "../chunk-CGP6UNCQ.js";
|
|
47
47
|
import {
|
|
48
48
|
convertAgentMessagesToModelMessages
|
|
49
|
-
} from "../chunk-
|
|
49
|
+
} from "../chunk-DWM3E5GI.js";
|
|
50
50
|
import "../chunk-STDJYXYK.js";
|
|
51
|
-
import "../chunk-
|
|
51
|
+
import "../chunk-C4ZVWRS5.js";
|
|
52
52
|
import {
|
|
53
53
|
currentScope,
|
|
54
54
|
restoreScope,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
import "../chunk-W6LWIMIX.js";
|
|
59
59
|
import "../chunk-CNM6OROH.js";
|
|
60
60
|
import "../chunk-I6PKJ7XQ.js";
|
|
61
|
-
import "../chunk-
|
|
61
|
+
import "../chunk-4HB2AAGM.js";
|
|
62
62
|
import "../chunk-FII65CN7.js";
|
|
63
63
|
import "../chunk-S6AKEPAX.js";
|
|
64
64
|
export {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
processStepStream,
|
|
12
12
|
runModelStep,
|
|
13
13
|
runToolBatch
|
|
14
|
-
} from "../../chunk-
|
|
14
|
+
} from "../../chunk-MSRJADIB.js";
|
|
15
15
|
import {
|
|
16
16
|
AgentTurnStateConflictError,
|
|
17
17
|
advanceAgentTurnState,
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
} from "../../chunk-E66PKKDL.js";
|
|
23
23
|
import "../../chunk-DYZGHHDB.js";
|
|
24
24
|
import "../../chunk-CGP6UNCQ.js";
|
|
25
|
-
import "../../chunk-
|
|
25
|
+
import "../../chunk-DWM3E5GI.js";
|
|
26
26
|
import "../../chunk-STDJYXYK.js";
|
|
27
|
-
import "../../chunk-
|
|
27
|
+
import "../../chunk-C4ZVWRS5.js";
|
|
28
28
|
import "../../chunk-AHDCR7SX.js";
|
|
29
29
|
import "../../chunk-W6LWIMIX.js";
|
|
30
30
|
import "../../chunk-CNM6OROH.js";
|
|
31
31
|
import "../../chunk-I6PKJ7XQ.js";
|
|
32
|
-
import "../../chunk-
|
|
32
|
+
import "../../chunk-4HB2AAGM.js";
|
|
33
33
|
import "../../chunk-FII65CN7.js";
|
|
34
34
|
import "../../chunk-S6AKEPAX.js";
|
|
35
35
|
export {
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
clearInstalledSubAgents,
|
|
13
13
|
configureSubAgents,
|
|
14
14
|
createCloseAgentTool,
|
|
15
|
+
createInspectAgentTool,
|
|
15
16
|
createInvokeAgentTool,
|
|
16
17
|
createSubAgentTools,
|
|
17
18
|
createWaitAgentTool,
|
|
@@ -39,7 +40,7 @@ import {
|
|
|
39
40
|
parseSubAgentRoleFrontmatter,
|
|
40
41
|
parseSubAgentToolSpec,
|
|
41
42
|
toSubAgentRole
|
|
42
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-DDYPN2JE.js";
|
|
43
44
|
import {
|
|
44
45
|
InMemoryMailboxStore,
|
|
45
46
|
InMemoryTaskBoardStore,
|
|
@@ -70,12 +71,38 @@ import {
|
|
|
70
71
|
localHost
|
|
71
72
|
} from "./chunk-X4VN4GIJ.js";
|
|
72
73
|
import {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
InMemoryDispatchEventStore,
|
|
75
|
+
createCompositeDispatchTaskExecutor,
|
|
76
|
+
createDispatchExternalTaskControl,
|
|
77
|
+
createDispatchTaskExecutor,
|
|
78
|
+
createRuntimeDispatchExecutor,
|
|
79
|
+
createRuntimeDispatchTargets,
|
|
80
|
+
ensureNonEmpty,
|
|
81
|
+
mergeInspection
|
|
82
|
+
} from "./chunk-2BRLPF3Z.js";
|
|
83
|
+
import {
|
|
84
|
+
DEFAULT_DISPATCH_TOOL_IDS,
|
|
85
|
+
DEFAULT_LOCAL_DISPATCH_CONCURRENCY,
|
|
86
|
+
DEFAULT_LOCAL_DISPATCH_DEPTH,
|
|
87
|
+
DEFAULT_LOCAL_DISPATCH_TITLE_PREFIX,
|
|
88
|
+
DISPATCH_STATES,
|
|
89
|
+
createDispatchTools,
|
|
90
|
+
createLocalDispatchRuntime,
|
|
91
|
+
createSubAgentRunSession,
|
|
92
|
+
ensureSessionLoaded,
|
|
93
|
+
getVisibleSessionMessages,
|
|
94
|
+
repairOrphanedToolCalls
|
|
95
|
+
} from "./chunk-LPWOYMS2.js";
|
|
96
|
+
import {
|
|
97
|
+
sleep
|
|
98
|
+
} from "./chunk-SZ2XBPTW.js";
|
|
99
|
+
import {
|
|
100
|
+
MAX_BYTES,
|
|
101
|
+
MAX_LINES,
|
|
102
|
+
Tool,
|
|
103
|
+
normalizeToolReplayPolicy,
|
|
104
|
+
truncateOutput
|
|
105
|
+
} from "./chunk-MJML3A2F.js";
|
|
79
106
|
import {
|
|
80
107
|
MiddlewareRunner,
|
|
81
108
|
approvalMiddleware,
|
|
@@ -83,7 +110,7 @@ import {
|
|
|
83
110
|
isApprovalMiddleware,
|
|
84
111
|
otelMiddleware,
|
|
85
112
|
promptCacheMiddleware
|
|
86
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-D24LUJUN.js";
|
|
87
114
|
import {
|
|
88
115
|
LayeredSettings,
|
|
89
116
|
NullSettings,
|
|
@@ -161,6 +188,28 @@ import {
|
|
|
161
188
|
parseFrontmatter
|
|
162
189
|
} from "./chunk-F2ZKMUW7.js";
|
|
163
190
|
import "./chunk-VOUEJSW6.js";
|
|
191
|
+
import {
|
|
192
|
+
InMemorySessionStore,
|
|
193
|
+
LocalSessionTurnLock,
|
|
194
|
+
SESSION_FORMAT_VERSION,
|
|
195
|
+
SessionManager,
|
|
196
|
+
buildEntryPath,
|
|
197
|
+
buildMessagesFromEntries,
|
|
198
|
+
buildRecentMessagesFromEntries,
|
|
199
|
+
buildRecentMessagesFromEntryMap,
|
|
200
|
+
configureDefaultSessionManager,
|
|
201
|
+
createMessageEntry,
|
|
202
|
+
createMetadataEntry,
|
|
203
|
+
deserializeMessage,
|
|
204
|
+
extractSessionInfo,
|
|
205
|
+
generateEntryId,
|
|
206
|
+
getDefaultSessionManager,
|
|
207
|
+
getLeafId,
|
|
208
|
+
parseJSONL,
|
|
209
|
+
serializeMessage,
|
|
210
|
+
toJSONL,
|
|
211
|
+
toJSONLBatch
|
|
212
|
+
} from "./chunk-EDKZOPUV.js";
|
|
164
213
|
import {
|
|
165
214
|
assembleModelContext
|
|
166
215
|
} from "./chunk-TYQWH6XH.js";
|
|
@@ -188,7 +237,7 @@ import {
|
|
|
188
237
|
processStepStream,
|
|
189
238
|
runModelStep,
|
|
190
239
|
runToolBatch
|
|
191
|
-
} from "./chunk-
|
|
240
|
+
} from "./chunk-MSRJADIB.js";
|
|
192
241
|
import {
|
|
193
242
|
applyAgentWorkflowCommitResult,
|
|
194
243
|
applyAgentWorkflowContextCompactionResult,
|
|
@@ -248,61 +297,6 @@ import {
|
|
|
248
297
|
shouldFallbackOnSummaryFailure,
|
|
249
298
|
shouldPruneContext
|
|
250
299
|
} from "./chunk-DYZGHHDB.js";
|
|
251
|
-
import {
|
|
252
|
-
InMemoryDispatchEventStore,
|
|
253
|
-
createCompositeDispatchTaskExecutor,
|
|
254
|
-
createDispatchExternalTaskControl,
|
|
255
|
-
createDispatchTaskExecutor,
|
|
256
|
-
createRuntimeDispatchExecutor,
|
|
257
|
-
createRuntimeDispatchTargets,
|
|
258
|
-
ensureNonEmpty,
|
|
259
|
-
mergeInspection
|
|
260
|
-
} from "./chunk-2BRLPF3Z.js";
|
|
261
|
-
import {
|
|
262
|
-
DEFAULT_DISPATCH_TOOL_IDS,
|
|
263
|
-
DEFAULT_LOCAL_DISPATCH_CONCURRENCY,
|
|
264
|
-
DEFAULT_LOCAL_DISPATCH_DEPTH,
|
|
265
|
-
DEFAULT_LOCAL_DISPATCH_TITLE_PREFIX,
|
|
266
|
-
DISPATCH_STATES,
|
|
267
|
-
createDispatchTools,
|
|
268
|
-
createLocalDispatchRuntime,
|
|
269
|
-
createSubAgentRunSession,
|
|
270
|
-
ensureSessionLoaded,
|
|
271
|
-
getVisibleSessionMessages,
|
|
272
|
-
repairOrphanedToolCalls
|
|
273
|
-
} from "./chunk-ZETYNQ35.js";
|
|
274
|
-
import {
|
|
275
|
-
InMemorySessionStore,
|
|
276
|
-
LocalSessionTurnLock,
|
|
277
|
-
SESSION_FORMAT_VERSION,
|
|
278
|
-
SessionManager,
|
|
279
|
-
buildEntryPath,
|
|
280
|
-
buildMessagesFromEntries,
|
|
281
|
-
buildRecentMessagesFromEntries,
|
|
282
|
-
buildRecentMessagesFromEntryMap,
|
|
283
|
-
configureDefaultSessionManager,
|
|
284
|
-
createMessageEntry,
|
|
285
|
-
createMetadataEntry,
|
|
286
|
-
deserializeMessage,
|
|
287
|
-
extractSessionInfo,
|
|
288
|
-
generateEntryId,
|
|
289
|
-
getDefaultSessionManager,
|
|
290
|
-
getLeafId,
|
|
291
|
-
parseJSONL,
|
|
292
|
-
serializeMessage,
|
|
293
|
-
toJSONL,
|
|
294
|
-
toJSONLBatch
|
|
295
|
-
} from "./chunk-EDKZOPUV.js";
|
|
296
|
-
import {
|
|
297
|
-
sleep
|
|
298
|
-
} from "./chunk-SZ2XBPTW.js";
|
|
299
|
-
import {
|
|
300
|
-
MAX_BYTES,
|
|
301
|
-
MAX_LINES,
|
|
302
|
-
Tool,
|
|
303
|
-
normalizeToolReplayPolicy,
|
|
304
|
-
truncateOutput
|
|
305
|
-
} from "./chunk-MJML3A2F.js";
|
|
306
300
|
import {
|
|
307
301
|
AGENT_CONTEXT_FRAGMENT_CLOSE,
|
|
308
302
|
AGENT_CONTEXT_FRAGMENT_OPEN,
|
|
@@ -336,7 +330,7 @@ import {
|
|
|
336
330
|
streamOnce,
|
|
337
331
|
streamStep,
|
|
338
332
|
withRetry
|
|
339
|
-
} from "./chunk-
|
|
333
|
+
} from "./chunk-DWM3E5GI.js";
|
|
340
334
|
import {
|
|
341
335
|
LLMError,
|
|
342
336
|
getErrorCategory,
|
|
@@ -349,7 +343,7 @@ import {
|
|
|
349
343
|
executeAgentToolCall,
|
|
350
344
|
extractFilePathsFromArgs,
|
|
351
345
|
shouldCaptureBaseline
|
|
352
|
-
} from "./chunk-
|
|
346
|
+
} from "./chunk-C4ZVWRS5.js";
|
|
353
347
|
import {
|
|
354
348
|
currentScope,
|
|
355
349
|
restoreScope,
|
|
@@ -433,7 +427,7 @@ import {
|
|
|
433
427
|
normalizeRememberScopes,
|
|
434
428
|
selectRememberScope,
|
|
435
429
|
shouldCascadeApprovalDecision
|
|
436
|
-
} from "./chunk-
|
|
430
|
+
} from "./chunk-4HB2AAGM.js";
|
|
437
431
|
import {
|
|
438
432
|
describeApprovalOperation,
|
|
439
433
|
extractApprovalPatterns,
|
|
@@ -457,6 +451,13 @@ import {
|
|
|
457
451
|
createFileLogger,
|
|
458
452
|
silentLogger
|
|
459
453
|
} from "./chunk-S6AKEPAX.js";
|
|
454
|
+
import {
|
|
455
|
+
createMemoryMiddleware,
|
|
456
|
+
formatMemoryContextFragment,
|
|
457
|
+
normalizeMemoryRecords,
|
|
458
|
+
resolveAgentMemoryCaptureConfig,
|
|
459
|
+
resolveAgentMemoryConfig
|
|
460
|
+
} from "./chunk-DD7S7ZG4.js";
|
|
460
461
|
|
|
461
462
|
// src/tracking/turn-tracker/tracker.ts
|
|
462
463
|
import { spawn } from "child_process";
|
|
@@ -4426,6 +4427,7 @@ export {
|
|
|
4426
4427
|
createHumanInputTool,
|
|
4427
4428
|
createHumanInputToolWithController,
|
|
4428
4429
|
createHumanInputToolWithHandler,
|
|
4430
|
+
createInspectAgentTool,
|
|
4429
4431
|
createInteractiveApprovalPolicy,
|
|
4430
4432
|
createInvokeAgentTool,
|
|
4431
4433
|
createLocalDispatchRuntime,
|
package/dist/inference/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
streamOnce,
|
|
15
15
|
streamStep,
|
|
16
16
|
withRetry
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-DWM3E5GI.js";
|
|
18
18
|
import {
|
|
19
19
|
LLMError,
|
|
20
20
|
getErrorCategory,
|
|
@@ -23,12 +23,12 @@ import {
|
|
|
23
23
|
isRetryableCategory,
|
|
24
24
|
parseRetryDelay
|
|
25
25
|
} from "../chunk-STDJYXYK.js";
|
|
26
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-C4ZVWRS5.js";
|
|
27
27
|
import "../chunk-AHDCR7SX.js";
|
|
28
28
|
import "../chunk-W6LWIMIX.js";
|
|
29
29
|
import "../chunk-CNM6OROH.js";
|
|
30
30
|
import "../chunk-I6PKJ7XQ.js";
|
|
31
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-4HB2AAGM.js";
|
|
32
32
|
import "../chunk-FII65CN7.js";
|
|
33
33
|
import "../chunk-S6AKEPAX.js";
|
|
34
34
|
export {
|
package/dist/middleware/index.js
CHANGED
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
isApprovalMiddleware,
|
|
6
6
|
otelMiddleware,
|
|
7
7
|
promptCacheMiddleware
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-D24LUJUN.js";
|
|
9
9
|
import {
|
|
10
10
|
isBlockedModelCall
|
|
11
11
|
} from "../chunk-W6LWIMIX.js";
|
|
12
12
|
import "../chunk-I6PKJ7XQ.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-4HB2AAGM.js";
|
|
14
14
|
import "../chunk-FII65CN7.js";
|
|
15
15
|
import "../chunk-S6AKEPAX.js";
|
|
16
16
|
export {
|
package/dist/safety/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"risk.d.ts","sourceRoot":"","sources":["../../src/safety/risk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"risk.d.ts","sourceRoot":"","sources":["../../src/safety/risk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA2B5C;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC;AACvC,0DAA0D;AAC1D,YAAY,CAAC,EAAE,SAAS,GACvB,SAAS,CAWX"}
|
package/dist/skill/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
createSkillTool,
|
|
4
4
|
createSkillTools
|
|
5
5
|
} from "../chunk-ASXF5AC6.js";
|
|
6
|
+
import "../chunk-MJML3A2F.js";
|
|
6
7
|
import {
|
|
7
8
|
DEFAULT_EXTERNAL_DIRS,
|
|
8
9
|
DEFAULT_MAX_SCAN_DEPTH,
|
|
@@ -18,7 +19,6 @@ import {
|
|
|
18
19
|
loadSkillMetadata,
|
|
19
20
|
parseFrontmatter
|
|
20
21
|
} from "../chunk-F2ZKMUW7.js";
|
|
21
|
-
import "../chunk-MJML3A2F.js";
|
|
22
22
|
export {
|
|
23
23
|
DEFAULT_EXTERNAL_DIRS,
|
|
24
24
|
DEFAULT_MAX_SCAN_DEPTH,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { SubAgentCompletedResult, SubAgentConfig, SubAgentRole, SubAgentToolsOptions, } from "./types.js";
|
|
2
2
|
export { DEFAULT_SUBAGENT_CONCURRENCY, DEFAULT_SUBAGENT_DEPTH, DEFAULT_SUBAGENT_SESSION_PREFIX, } from "./types.js";
|
|
3
3
|
export { createSubAgentTools } from "./tools.js";
|
|
4
|
-
export { createCloseAgentTool, createInvokeAgentTool, createWaitAgentTool, SUBAGENT_TOOL_IDS, } from "./tool-factories.js";
|
|
4
|
+
export { createCloseAgentTool, createInspectAgentTool, createInvokeAgentTool, createWaitAgentTool, SUBAGENT_TOOL_IDS, } from "./tool-factories.js";
|
|
5
5
|
export { formatAsyncSpawnedResult, formatCancelledAgentResult, formatCloseAlreadyResolvedResult, formatCloseMissingAgentResult, formatInvalidAgentTypeResult, formatMissingAgentsResult, formatSpawnBlockedResult, formatSyncSubAgentErrorResult, formatSyncSubAgentResult, formatWaitErrorResult, formatWaitResult, formatWaitTimeoutResult, } from "./results.js";
|
|
6
6
|
export { clearInstalledSubAgents, configureSubAgents, getConfiguredSubAgents, getInstalledSubAgentBackend, installLocalSubAgents, installSubAgentTools, LOCAL_SUBAGENT_BACKEND, } from "./installation.js";
|
|
7
7
|
export * from "./roles/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/subagents/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,+BAA+B,GAChC,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,gCAAgC,EAChC,6BAA6B,EAC7B,4BAA4B,EAC5B,yBAAyB,EACzB,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/subagents/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,+BAA+B,GAChC,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,gCAAgC,EAChC,6BAA6B,EAC7B,4BAA4B,EAC5B,yBAAyB,EACzB,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
package/dist/subagents/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
clearInstalledSubAgents,
|
|
8
8
|
configureSubAgents,
|
|
9
9
|
createCloseAgentTool,
|
|
10
|
+
createInspectAgentTool,
|
|
10
11
|
createInvokeAgentTool,
|
|
11
12
|
createSubAgentTools,
|
|
12
13
|
createWaitAgentTool,
|
|
@@ -34,11 +35,11 @@ import {
|
|
|
34
35
|
parseSubAgentRoleFrontmatter,
|
|
35
36
|
parseSubAgentToolSpec,
|
|
36
37
|
toSubAgentRole
|
|
37
|
-
} from "../chunk-
|
|
38
|
+
} from "../chunk-DDYPN2JE.js";
|
|
39
|
+
import "../chunk-LPWOYMS2.js";
|
|
40
|
+
import "../chunk-MJML3A2F.js";
|
|
38
41
|
import "../chunk-TPZ37IWI.js";
|
|
39
|
-
import "../chunk-ZETYNQ35.js";
|
|
40
42
|
import "../chunk-EDKZOPUV.js";
|
|
41
|
-
import "../chunk-MJML3A2F.js";
|
|
42
43
|
import "../chunk-CGP6UNCQ.js";
|
|
43
44
|
export {
|
|
44
45
|
DEFAULT_SUBAGENT_CONCURRENCY,
|
|
@@ -49,6 +50,7 @@ export {
|
|
|
49
50
|
clearInstalledSubAgents,
|
|
50
51
|
configureSubAgents,
|
|
51
52
|
createCloseAgentTool,
|
|
53
|
+
createInspectAgentTool,
|
|
52
54
|
createInvokeAgentTool,
|
|
53
55
|
createSubAgentTools,
|
|
54
56
|
createWaitAgentTool,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DispatchRuntime } from "../dispatch/types.js";
|
|
2
|
+
import type { Tool } from "../tool/tool.js";
|
|
3
|
+
export declare const DEFAULT_INSPECT_AGENT_RECENT_EVENTS = 5;
|
|
4
|
+
export declare const MAX_INSPECT_AGENT_RECENT_EVENTS = 20;
|
|
5
|
+
export declare function normalizeInspectRecentEvents(value: number | undefined): number;
|
|
6
|
+
export declare function inspectDispatch(options: {
|
|
7
|
+
runtime: DispatchRuntime;
|
|
8
|
+
id: string;
|
|
9
|
+
recentEvents: number;
|
|
10
|
+
}): Promise<Tool.ExecuteResult>;
|
|
11
|
+
//# sourceMappingURL=inspection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspection.d.ts","sourceRoot":"","sources":["../../src/subagents/inspection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAM5C,eAAO,MAAM,mCAAmC,IAAI,CAAC;AACrD,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAQlD,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,MAAM,CAMR;AAuPD,wBAAsB,eAAe,CAAC,OAAO,EAAE;IAC7C,OAAO,EAAE,eAAe,CAAC;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAyB9B"}
|
|
@@ -1,11 +1,37 @@
|
|
|
1
1
|
import type { Tool } from "../tool/tool.js";
|
|
2
2
|
import type { SubAgentCompletedResult } from "./types.js";
|
|
3
|
+
export interface SubAgentInspectionResult {
|
|
4
|
+
id: string;
|
|
5
|
+
status: string;
|
|
6
|
+
role?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
sessionId?: string;
|
|
9
|
+
createdAt?: string;
|
|
10
|
+
updatedAt?: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
latestStatus?: string;
|
|
13
|
+
eventCount: number;
|
|
14
|
+
startedToolCounts: Record<string, number>;
|
|
15
|
+
completedToolCounts: Record<string, number>;
|
|
16
|
+
activeTools: Array<{
|
|
17
|
+
inputSummary?: string;
|
|
18
|
+
startedAt: string;
|
|
19
|
+
toolCallId: string;
|
|
20
|
+
toolName: string;
|
|
21
|
+
}>;
|
|
22
|
+
recentActivity: string[];
|
|
23
|
+
hasResult: boolean;
|
|
24
|
+
resultLength?: number;
|
|
25
|
+
resultPreview?: string;
|
|
26
|
+
}
|
|
3
27
|
export declare function formatInvalidAgentTypeResult(roleName: string, validNames: string[]): Tool.ExecuteResult;
|
|
4
28
|
export declare function formatSpawnBlockedResult(message: string): Tool.ExecuteResult;
|
|
5
29
|
export declare function formatSyncSubAgentResult(roleName: string, result: SubAgentCompletedResult): Tool.ExecuteResult;
|
|
6
30
|
export declare function formatSyncSubAgentErrorResult(roleName: string, error: unknown): Tool.ExecuteResult;
|
|
7
31
|
export declare function formatAsyncSpawnedResult(agentId: string, roleName: string, sessionId?: string): Tool.ExecuteResult;
|
|
8
32
|
export declare function formatWaitResult(agentId: string, roleName: string, result: SubAgentCompletedResult): Tool.ExecuteResult;
|
|
33
|
+
export declare function formatInspectMissingAgentResult(id: string): Tool.ExecuteResult;
|
|
34
|
+
export declare function formatInspectAgentResult(result: SubAgentInspectionResult): Tool.ExecuteResult;
|
|
9
35
|
export declare function formatWaitTimeoutResult(timeoutMs: number, runningIds: string[]): Tool.ExecuteResult;
|
|
10
36
|
export declare function formatWaitErrorResult(error: unknown): Tool.ExecuteResult;
|
|
11
37
|
export declare function formatMissingAgentsResult(ids: string[]): Tool.ExecuteResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../../src/subagents/results.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../../src/subagents/results.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,WAAW,EAAE,KAAK,CAAC;QACjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IACH,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAwCD,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAAE,GACnB,IAAI,CAAC,aAAa,CAQpB;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC,aAAa,CAM5E;AAED,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,uBAAuB,GAC9B,IAAI,CAAC,aAAa,CAepB;AAED,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,GACb,IAAI,CAAC,aAAa,CASpB;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,GACjB,IAAI,CAAC,aAAa,CAWpB;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,uBAAuB,GAC9B,IAAI,CAAC,aAAa,CAgBpB;AAED,wBAAgB,+BAA+B,CAC7C,EAAE,EAAE,MAAM,GACT,IAAI,CAAC,aAAa,CAMpB;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,wBAAwB,GAC/B,IAAI,CAAC,aAAa,CAkDpB;AAED,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAAE,GACnB,IAAI,CAAC,aAAa,CAWpB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC,aAAa,CAMxE;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAM3E;AAED,wBAAgB,6BAA6B,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC,aAAa,CAM5E;AAED,wBAAgB,gCAAgC,CAC9C,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,GACZ,IAAI,CAAC,aAAa,CAMpB;AAED,wBAAgB,0BAA0B,CACxC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,GACf,IAAI,CAAC,aAAa,CAMpB"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { DispatchRuntime } from "../dispatch/types.js";
|
|
2
2
|
import { Tool } from "../tool/tool.js";
|
|
3
3
|
import type { SubAgentRole } from "./types.js";
|
|
4
|
-
export declare const SUBAGENT_TOOL_IDS: readonly ["invoke_agent", "wait_agent", "close_agent"];
|
|
4
|
+
export declare const SUBAGENT_TOOL_IDS: readonly ["invoke_agent", "wait_agent", "inspect_agent", "close_agent"];
|
|
5
5
|
export declare function createInvokeAgentTool(runtime: DispatchRuntime, roles: readonly SubAgentRole[], options?: {
|
|
6
6
|
async?: boolean;
|
|
7
7
|
sessionTitlePrefix?: string;
|
|
8
8
|
}): Tool.AnyInfo;
|
|
9
9
|
export declare function createWaitAgentTool(runtime: DispatchRuntime): Tool.AnyInfo;
|
|
10
|
+
export declare function createInspectAgentTool(runtime: DispatchRuntime): Tool.AnyInfo;
|
|
10
11
|
export declare function createCloseAgentTool(runtime: DispatchRuntime): Tool.AnyInfo;
|
|
11
12
|
//# sourceMappingURL=tool-factories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-factories.d.ts","sourceRoot":"","sources":["../../src/subagents/tool-factories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,EAA2B,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-factories.d.ts","sourceRoot":"","sources":["../../src/subagents/tool-factories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,EAA2B,YAAY,EAAE,MAAM,YAAY,CAAC;AAuBxE,eAAO,MAAM,iBAAiB,yEAKpB,CAAC;AAuGX,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,SAAS,YAAY,EAAE,EAC9B,OAAO,CAAC,EAAE;IACR,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,GACA,IAAI,CAAC,OAAO,CAyEd;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC,OAAO,CAsD1E;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC,OAAO,CAgC7E;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC,OAAO,CAuB3E"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Subagent tools.
|
|
3
3
|
*
|
|
4
|
-
* Provides `invoke_agent`, `wait_agent`, and `close_agent`
|
|
5
|
-
* local in-process dispatch runtime.
|
|
4
|
+
* Provides `invoke_agent`, `wait_agent`, `inspect_agent`, and `close_agent`
|
|
5
|
+
* backed by the local in-process dispatch runtime.
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/subagents/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/subagents/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAUvD,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,KAAK,EACb,OAAO,EAAE,oBAAoB,GAC5B,IAAI,CAAC,OAAO,EAAE,CA0ChB"}
|
package/dist/tool/index.js
CHANGED
|
@@ -17,9 +17,9 @@ import {
|
|
|
17
17
|
} from "../chunk-MJML3A2F.js";
|
|
18
18
|
import {
|
|
19
19
|
executeAgentToolCall
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-C4ZVWRS5.js";
|
|
21
21
|
import "../chunk-AHDCR7SX.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-4HB2AAGM.js";
|
|
23
23
|
import {
|
|
24
24
|
getRequiredToolHost,
|
|
25
25
|
resolveCapability
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tool
|
|
3
|
+
} from "./chunk-MJML3A2F.js";
|
|
1
4
|
import {
|
|
2
5
|
buildEntryPath,
|
|
3
6
|
deserializeMessage
|
|
4
7
|
} from "./chunk-EDKZOPUV.js";
|
|
5
|
-
import {
|
|
6
|
-
Tool
|
|
7
|
-
} from "./chunk-MJML3A2F.js";
|
|
8
8
|
|
|
9
9
|
// src/agent/session.ts
|
|
10
10
|
async function ensureSessionLoaded(options) {
|