@cuylabs/agent-core 3.1.0 → 3.2.1
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-CGUASKOH.js → chunk-2BQI4M6X.js} +4 -2
- package/dist/{chunk-QVQKQZUN.js → chunk-BJC46FIF.js} +1 -1
- package/dist/{chunk-P2SPTUH5.js → chunk-FY6UGSFM.js} +2 -2
- package/dist/{chunk-BMLWNXIP.js → chunk-H3GRHFFG.js} +81 -1
- package/dist/{chunk-Y7SMKIJT.js → chunk-HSUPTXNV.js} +1 -1
- package/dist/{chunk-ZKEC7MFQ.js → chunk-MWPU2EVV.js} +1 -1
- package/dist/{chunk-MLTJHUVG.js → chunk-T33MQXUP.js} +32 -7
- package/dist/{chunk-WR6KIGJQ.js → chunk-Y3TRGGUG.js} +2 -2
- package/dist/dispatch/index.d.ts +2 -2
- package/dist/dispatch/index.js +2 -2
- package/dist/execution/index.d.ts +3 -3
- package/dist/execution/index.js +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +24 -15
- package/dist/inference/index.d.ts +3 -3
- package/dist/inference/index.js +3 -3
- package/dist/{instance-7RluLpIT.d.ts → instance-DV_xLU65.d.ts} +75 -32
- package/dist/middleware/index.d.ts +2 -2
- package/dist/middleware/index.js +2 -2
- package/dist/{model-messages-CvIEjaIJ.d.ts → model-messages-D19TVt7a.d.ts} +1 -1
- package/dist/plugin/index.d.ts +1 -1
- package/dist/profiles/index.d.ts +1 -1
- package/dist/prompt/index.d.ts +2 -2
- package/dist/safety/index.d.ts +2 -2
- package/dist/safety/index.js +1 -1
- package/dist/skill/index.d.ts +2 -2
- package/dist/storage/index.d.ts +17 -3
- package/dist/storage/index.js +5 -1
- package/dist/subagents/index.d.ts +1 -1
- package/dist/subagents/index.js +3 -3
- package/dist/team/index.d.ts +2 -2
- package/dist/tool/index.d.ts +2 -2
- package/dist/tool/index.js +2 -2
- package/dist/turn-tools/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
createApprovalCorrection,
|
|
12
12
|
createApprovalHandler,
|
|
13
13
|
formatApprovalDeniedReason
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-T33MQXUP.js";
|
|
15
15
|
import {
|
|
16
16
|
silentLogger
|
|
17
17
|
} from "./chunk-S6AKEPAX.js";
|
|
@@ -291,7 +291,9 @@ function approvalMiddleware(config = {}) {
|
|
|
291
291
|
args,
|
|
292
292
|
config.customRisks,
|
|
293
293
|
ctx.toolCapabilities,
|
|
294
|
-
ctx.permissionPatterns
|
|
294
|
+
ctx.permissionPatterns,
|
|
295
|
+
[],
|
|
296
|
+
ctx.emitEvent ? { emitEvent: ctx.emitEvent } : {}
|
|
295
297
|
);
|
|
296
298
|
return { action: "allow" };
|
|
297
299
|
} catch (err) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Inference,
|
|
3
3
|
buildModelCallContext
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Y3TRGGUG.js";
|
|
5
5
|
import {
|
|
6
6
|
currentScope,
|
|
7
7
|
executeAgentToolCall,
|
|
8
8
|
snapshotScope,
|
|
9
9
|
streamWithinScope,
|
|
10
10
|
withinScope
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MWPU2EVV.js";
|
|
12
12
|
import {
|
|
13
13
|
LLMError
|
|
14
14
|
} from "./chunk-STDJYXYK.js";
|
|
@@ -230,6 +230,62 @@ ${entry.summary}`,
|
|
|
230
230
|
}
|
|
231
231
|
return messages;
|
|
232
232
|
}
|
|
233
|
+
function buildRecentMessagesFromEntries(entries, options = {}) {
|
|
234
|
+
const targetLeaf = options.leafId ?? getLeafId(entries);
|
|
235
|
+
if (!targetLeaf) {
|
|
236
|
+
return [];
|
|
237
|
+
}
|
|
238
|
+
const byId = /* @__PURE__ */ new Map();
|
|
239
|
+
for (const entry of entries) {
|
|
240
|
+
if (entry.type !== "header") {
|
|
241
|
+
byId.set(entry.id, entry);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return buildRecentMessagesFromEntryMap(byId, targetLeaf, options);
|
|
245
|
+
}
|
|
246
|
+
function buildRecentMessagesFromEntryMap(entriesById, leafId, options = {}) {
|
|
247
|
+
const limit = normalizeRecentMessagesLimit(options.limit);
|
|
248
|
+
if (limit === 0 || !leafId) {
|
|
249
|
+
return [];
|
|
250
|
+
}
|
|
251
|
+
const roles = options.roles ? new Set(options.roles) : void 0;
|
|
252
|
+
const recent = [];
|
|
253
|
+
let currentId = leafId;
|
|
254
|
+
while (currentId && recent.length < limit) {
|
|
255
|
+
const entry = entriesById.get(currentId);
|
|
256
|
+
if (!entry) {
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
if (entry.type === "message") {
|
|
260
|
+
const message = deserializeMessage(entry.message);
|
|
261
|
+
if (!roles || roles.has(message.role)) {
|
|
262
|
+
recent.push(message);
|
|
263
|
+
}
|
|
264
|
+
} else if (entry.type === "compaction") {
|
|
265
|
+
recent.push({
|
|
266
|
+
id: entry.id,
|
|
267
|
+
role: "system",
|
|
268
|
+
content: `## Previous Conversation Summary
|
|
269
|
+
|
|
270
|
+
${entry.summary}`,
|
|
271
|
+
createdAt: new Date(entry.timestamp)
|
|
272
|
+
});
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
currentId = entry.parentId;
|
|
276
|
+
}
|
|
277
|
+
recent.reverse();
|
|
278
|
+
return recent;
|
|
279
|
+
}
|
|
280
|
+
function normalizeRecentMessagesLimit(limit) {
|
|
281
|
+
if (limit === void 0) {
|
|
282
|
+
return Number.MAX_SAFE_INTEGER;
|
|
283
|
+
}
|
|
284
|
+
if (!Number.isFinite(limit) || limit < 0) {
|
|
285
|
+
throw new Error("limit must be a non-negative finite number");
|
|
286
|
+
}
|
|
287
|
+
return Math.floor(limit);
|
|
288
|
+
}
|
|
233
289
|
|
|
234
290
|
// src/storage/memory.ts
|
|
235
291
|
var MemoryStorage = class {
|
|
@@ -627,6 +683,7 @@ var SessionManager = class {
|
|
|
627
683
|
currentLeafId = null;
|
|
628
684
|
entriesCache = [];
|
|
629
685
|
idsCache = /* @__PURE__ */ new Set();
|
|
686
|
+
entriesByIdCache = /* @__PURE__ */ new Map();
|
|
630
687
|
constructor(storage) {
|
|
631
688
|
this.storage = storage ?? new MemoryStorage();
|
|
632
689
|
}
|
|
@@ -646,6 +703,7 @@ var SessionManager = class {
|
|
|
646
703
|
this.currentLeafId = null;
|
|
647
704
|
this.entriesCache = [header];
|
|
648
705
|
this.idsCache.clear();
|
|
706
|
+
this.entriesByIdCache.clear();
|
|
649
707
|
return id;
|
|
650
708
|
}
|
|
651
709
|
async load(sessionId) {
|
|
@@ -657,9 +715,12 @@ var SessionManager = class {
|
|
|
657
715
|
this.entriesCache = entries;
|
|
658
716
|
this.currentLeafId = getLeafId(entries);
|
|
659
717
|
this.idsCache.clear();
|
|
718
|
+
this.entriesByIdCache.clear();
|
|
660
719
|
for (const entry of entries) {
|
|
661
720
|
if (entry.type !== "header") {
|
|
662
|
-
|
|
721
|
+
const sessionEntry = entry;
|
|
722
|
+
this.idsCache.add(sessionEntry.id);
|
|
723
|
+
this.entriesByIdCache.set(sessionEntry.id, sessionEntry);
|
|
663
724
|
}
|
|
664
725
|
}
|
|
665
726
|
}
|
|
@@ -681,6 +742,7 @@ var SessionManager = class {
|
|
|
681
742
|
await this.storage.append(this.currentSessionId, entry);
|
|
682
743
|
this.entriesCache.push(entry);
|
|
683
744
|
this.idsCache.add(entry.id);
|
|
745
|
+
this.entriesByIdCache.set(entry.id, entry);
|
|
684
746
|
this.currentLeafId = entry.id;
|
|
685
747
|
return entry.id;
|
|
686
748
|
}
|
|
@@ -697,6 +759,7 @@ var SessionManager = class {
|
|
|
697
759
|
const entry = createMessageEntry(message, parentId, this.idsCache);
|
|
698
760
|
entries.push(entry);
|
|
699
761
|
this.idsCache.add(entry.id);
|
|
762
|
+
this.entriesByIdCache.set(entry.id, entry);
|
|
700
763
|
parentId = entry.id;
|
|
701
764
|
}
|
|
702
765
|
await this.storage.appendBatch(this.currentSessionId, entries);
|
|
@@ -710,6 +773,13 @@ var SessionManager = class {
|
|
|
710
773
|
leafId ?? this.currentLeafId ?? void 0
|
|
711
774
|
);
|
|
712
775
|
}
|
|
776
|
+
getRecentMessages(options = {}) {
|
|
777
|
+
return buildRecentMessagesFromEntryMap(
|
|
778
|
+
this.entriesByIdCache,
|
|
779
|
+
options.leafId ?? this.currentLeafId ?? void 0,
|
|
780
|
+
options
|
|
781
|
+
);
|
|
782
|
+
}
|
|
713
783
|
async addCompaction(options) {
|
|
714
784
|
if (!this.currentSessionId) {
|
|
715
785
|
throw new Error("No session loaded");
|
|
@@ -724,6 +794,7 @@ var SessionManager = class {
|
|
|
724
794
|
await this.storage.append(this.currentSessionId, entry);
|
|
725
795
|
this.entriesCache.push(entry);
|
|
726
796
|
this.idsCache.add(entry.id);
|
|
797
|
+
this.entriesByIdCache.set(entry.id, entry);
|
|
727
798
|
this.currentLeafId = entry.id;
|
|
728
799
|
return entry.id;
|
|
729
800
|
}
|
|
@@ -758,6 +829,10 @@ var SessionManager = class {
|
|
|
758
829
|
...messageEntries
|
|
759
830
|
]);
|
|
760
831
|
this.entriesCache.push(compactionEntry, ...messageEntries);
|
|
832
|
+
this.entriesByIdCache.set(compactionEntry.id, compactionEntry);
|
|
833
|
+
for (const entry of messageEntries) {
|
|
834
|
+
this.entriesByIdCache.set(entry.id, entry);
|
|
835
|
+
}
|
|
761
836
|
this.currentLeafId = messageEntries[messageEntries.length - 1]?.id ?? compactionEntry.id;
|
|
762
837
|
return compactionEntry.id;
|
|
763
838
|
}
|
|
@@ -779,6 +854,7 @@ var SessionManager = class {
|
|
|
779
854
|
await this.storage.append(this.currentSessionId, entry);
|
|
780
855
|
this.entriesCache.push(entry);
|
|
781
856
|
this.idsCache.add(entry.id);
|
|
857
|
+
this.entriesByIdCache.set(entry.id, entry);
|
|
782
858
|
this.currentLeafId = entry.id;
|
|
783
859
|
return entry.id;
|
|
784
860
|
}
|
|
@@ -800,6 +876,7 @@ var SessionManager = class {
|
|
|
800
876
|
await this.storage.append(this.currentSessionId, entry);
|
|
801
877
|
this.entriesCache.push(entry);
|
|
802
878
|
this.idsCache.add(entry.id);
|
|
879
|
+
this.entriesByIdCache.set(entry.id, entry);
|
|
803
880
|
this.currentLeafId = entry.id;
|
|
804
881
|
}
|
|
805
882
|
getContext() {
|
|
@@ -844,6 +921,7 @@ var SessionManager = class {
|
|
|
844
921
|
this.currentLeafId = null;
|
|
845
922
|
this.entriesCache = [];
|
|
846
923
|
this.idsCache.clear();
|
|
924
|
+
this.entriesByIdCache.clear();
|
|
847
925
|
}
|
|
848
926
|
return result;
|
|
849
927
|
}
|
|
@@ -882,6 +960,8 @@ export {
|
|
|
882
960
|
getLeafId,
|
|
883
961
|
buildEntryPath,
|
|
884
962
|
buildMessagesFromEntries,
|
|
963
|
+
buildRecentMessagesFromEntries,
|
|
964
|
+
buildRecentMessagesFromEntryMap,
|
|
885
965
|
MemoryStorage,
|
|
886
966
|
FileStorage,
|
|
887
967
|
LocalSessionTurnLock,
|
|
@@ -251,6 +251,9 @@ function normalizeApprovalDecision(value) {
|
|
|
251
251
|
}
|
|
252
252
|
return value;
|
|
253
253
|
}
|
|
254
|
+
async function emitApprovalEvent(context, event) {
|
|
255
|
+
await context.emitEvent?.(event);
|
|
256
|
+
}
|
|
254
257
|
function createApprovalHandler(config = {}) {
|
|
255
258
|
const {
|
|
256
259
|
defaultAction = "ask",
|
|
@@ -264,7 +267,7 @@ function createApprovalHandler(config = {}) {
|
|
|
264
267
|
const initialRuleCount = config.rules?.length ?? 0;
|
|
265
268
|
const rules = [...config.rules ?? []];
|
|
266
269
|
const activeRequests = /* @__PURE__ */ new Set();
|
|
267
|
-
async function request(sessionId, tool, args, customRisks, capabilities, patternExtractor, extraRules = []) {
|
|
270
|
+
async function request(sessionId, tool, args, customRisks, capabilities, patternExtractor, extraRules = [], eventContext = {}) {
|
|
268
271
|
const evaluation = evaluate(
|
|
269
272
|
sessionId,
|
|
270
273
|
tool,
|
|
@@ -298,7 +301,17 @@ function createApprovalHandler(config = {}) {
|
|
|
298
301
|
const ac = new AbortController();
|
|
299
302
|
activeRequests.add(ac);
|
|
300
303
|
let timeoutId;
|
|
304
|
+
let emittedRequest = false;
|
|
301
305
|
try {
|
|
306
|
+
await emitApprovalEvent(eventContext, {
|
|
307
|
+
type: "status",
|
|
308
|
+
status: "waiting-approval"
|
|
309
|
+
});
|
|
310
|
+
await emitApprovalEvent(eventContext, {
|
|
311
|
+
type: "approval-request",
|
|
312
|
+
request: evaluation.request
|
|
313
|
+
});
|
|
314
|
+
emittedRequest = true;
|
|
302
315
|
const resolution = normalizeApprovalDecision(
|
|
303
316
|
await Promise.race([
|
|
304
317
|
onRequest(evaluation.request),
|
|
@@ -317,19 +330,25 @@ function createApprovalHandler(config = {}) {
|
|
|
317
330
|
})
|
|
318
331
|
])
|
|
319
332
|
);
|
|
333
|
+
const selectedRememberScope = resolution.action === "remember" ? selectRememberScope(resolution, evaluation.request, rememberScope) : void 0;
|
|
334
|
+
await emitApprovalEvent(eventContext, {
|
|
335
|
+
type: "approval-resolved",
|
|
336
|
+
id: evaluation.request.id,
|
|
337
|
+
action: resolution.action,
|
|
338
|
+
...resolution.feedback ? { feedback: resolution.feedback } : {},
|
|
339
|
+
...selectedRememberScope ? { rememberScope: selectedRememberScope } : {}
|
|
340
|
+
});
|
|
320
341
|
switch (resolution.action) {
|
|
321
342
|
case "allow":
|
|
322
343
|
return;
|
|
323
344
|
case "deny":
|
|
324
345
|
throw new ApprovalDeniedError(tool, args, resolution.feedback);
|
|
325
346
|
case "remember": {
|
|
326
|
-
const scope = selectRememberScope(
|
|
327
|
-
resolution,
|
|
328
|
-
evaluation.request,
|
|
329
|
-
rememberScope
|
|
330
|
-
);
|
|
331
347
|
rules.push(
|
|
332
|
-
...createRememberedApprovalRules(
|
|
348
|
+
...createRememberedApprovalRules(
|
|
349
|
+
evaluation.request,
|
|
350
|
+
selectedRememberScope
|
|
351
|
+
)
|
|
333
352
|
);
|
|
334
353
|
return;
|
|
335
354
|
}
|
|
@@ -337,6 +356,12 @@ function createApprovalHandler(config = {}) {
|
|
|
337
356
|
} finally {
|
|
338
357
|
clearTimeout(timeoutId);
|
|
339
358
|
activeRequests.delete(ac);
|
|
359
|
+
if (emittedRequest) {
|
|
360
|
+
await emitApprovalEvent(eventContext, {
|
|
361
|
+
type: "status",
|
|
362
|
+
status: "processing"
|
|
363
|
+
});
|
|
364
|
+
}
|
|
340
365
|
}
|
|
341
366
|
}
|
|
342
367
|
function evaluate(sessionId, tool, args, customRisks, capabilities, patternExtractor, extraRules = []) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeAgentToolCall,
|
|
3
3
|
snapshotScope
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MWPU2EVV.js";
|
|
5
5
|
import {
|
|
6
6
|
LLMError,
|
|
7
7
|
isRetryable
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-CJI7PVS2.js";
|
|
18
18
|
import {
|
|
19
19
|
formatApprovalDeniedReason
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-T33MQXUP.js";
|
|
21
21
|
|
|
22
22
|
// src/inference/toolset.ts
|
|
23
23
|
import { tool, zodSchema } from "ai";
|
package/dist/dispatch/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { bx as LocalDispatchRuntimeOptions, aZ as DispatchRuntime, T as Tool, d7 as TaskExecutorInput, d6 as TaskExecutor, aW as DispatchRecord, b1 as DispatchTargetInspection, b0 as DispatchTarget, dp as TeamTask, bD as MemberRuntime, b3 as DispatchTargetStartResult, b4 as DispatchTargetSummary, bc as ExternalTaskControl } from '../instance-DV_xLU65.js';
|
|
2
|
+
export { aN as DEFAULT_DISPATCH_TOOL_IDS, aO as DEFAULT_LOCAL_DISPATCH_CONCURRENCY, aP as DEFAULT_LOCAL_DISPATCH_DEPTH, aQ as DEFAULT_LOCAL_DISPATCH_TITLE_PREFIX, aT as DISPATCH_STATES, aU as DispatchCheckOptions, aV as DispatchListOptions, aX as DispatchResult, aY as DispatchRole, a_ as DispatchStartInput, a$ as DispatchState, b2 as DispatchTargetStartInput, b5 as DispatchUsage } from '../instance-DV_xLU65.js';
|
|
3
3
|
import '../types-C_LCeYNg.js';
|
|
4
4
|
import 'ai';
|
|
5
5
|
import '../types-RSCv7nQ4.js';
|
package/dist/dispatch/index.js
CHANGED
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
DISPATCH_STATES,
|
|
16
16
|
createDispatchTools,
|
|
17
17
|
createLocalDispatchRuntime
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-HSUPTXNV.js";
|
|
19
19
|
import "../chunk-SZ2XBPTW.js";
|
|
20
20
|
import "../chunk-Q742PSH3.js";
|
|
21
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-H3GRHFFG.js";
|
|
22
22
|
export {
|
|
23
23
|
DEFAULT_DISPATCH_TOOL_IDS,
|
|
24
24
|
DEFAULT_LOCAL_DISPATCH_CONCURRENCY,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { e as AnyInferenceResult,
|
|
2
|
-
export { V as AgentTurnActiveToolCall, Y as AgentTurnBoundaryMetadata, Z as AgentTurnBoundarySnapshot, _ as AgentTurnCommitApplier, a0 as AgentTurnCommitOptions, a1 as AgentTurnEngine, a2 as AgentTurnEngineOptions, a3 as AgentTurnPhase, a4 as AgentTurnResolvedToolCall, a6 as AgentTurnStateAdvanceOptions, aa as AgentTurnStepRuntimeConfig,
|
|
1
|
+
import { e as AnyInferenceResult, cM as StepProcessingOptions, cN as StepProcessingOutput, a7 as AgentTurnStepCommitSnapshot, aK as CreateAgentTurnStepCommitBatchOptions, $ as AgentTurnCommitBatch, c6 as PrepareModelStepOptions, c7 as PreparedAgentModelStep, ck as RunModelStepOptions, A as AgentEvent, cl as RunToolBatchOptions, cm as RunToolBatchResult, aA as CommitOutputOptions, aB as CommitStepOptions, ds as TokenUsage, x as ScopeSnapshot, a5 as AgentTurnState, dz as ToolMetadata, a9 as AgentTurnStepCommitToolResult, a8 as AgentTurnStepCommitToolCall, M as Message, dG as UserMessage, aw as AssistantMessage, dy as ToolMessage, cX as SystemMessage } from '../instance-DV_xLU65.js';
|
|
2
|
+
export { V as AgentTurnActiveToolCall, Y as AgentTurnBoundaryMetadata, Z as AgentTurnBoundarySnapshot, _ as AgentTurnCommitApplier, a0 as AgentTurnCommitOptions, a1 as AgentTurnEngine, a2 as AgentTurnEngineOptions, a3 as AgentTurnPhase, a4 as AgentTurnResolvedToolCall, a6 as AgentTurnStateAdvanceOptions, aa as AgentTurnStepRuntimeConfig, aJ as CreateAgentTurnStateOptions, dJ as advanceAgentTurnState, dN as createAgentTurnEngine, dO as createAgentTurnState, dV as failAgentTurnState } from '../instance-DV_xLU65.js';
|
|
3
3
|
import { L as Logger } from '../types-RSCv7nQ4.js';
|
|
4
|
-
export { c as convertAgentMessagesToModelMessages } from '../model-messages-
|
|
4
|
+
export { c as convertAgentMessagesToModelMessages } from '../model-messages-D19TVt7a.js';
|
|
5
5
|
import '../types-C_LCeYNg.js';
|
|
6
6
|
import 'ai';
|
|
7
7
|
import 'zod';
|
package/dist/execution/index.js
CHANGED
|
@@ -31,16 +31,16 @@ import {
|
|
|
31
31
|
runToolBatch,
|
|
32
32
|
snapshotAgentWorkflowMessage,
|
|
33
33
|
snapshotAgentWorkflowMessages
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-FY6UGSFM.js";
|
|
35
35
|
import {
|
|
36
36
|
convertAgentMessagesToModelMessages
|
|
37
|
-
} from "../chunk-
|
|
38
|
-
import "../chunk-
|
|
37
|
+
} from "../chunk-Y3TRGGUG.js";
|
|
38
|
+
import "../chunk-MWPU2EVV.js";
|
|
39
39
|
import "../chunk-STDJYXYK.js";
|
|
40
40
|
import "../chunk-GJFP5L2V.js";
|
|
41
41
|
import "../chunk-CJI7PVS2.js";
|
|
42
42
|
import "../chunk-I6PKJ7XQ.js";
|
|
43
|
-
import "../chunk-
|
|
43
|
+
import "../chunk-T33MQXUP.js";
|
|
44
44
|
import "../chunk-FII65CN7.js";
|
|
45
45
|
import "../chunk-S6AKEPAX.js";
|
|
46
46
|
export {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HumanInputController, p as HumanInputConfig, T as Tool, M as Message, S as SessionManager, E as EffectiveAgentConfig, q as TurnChangeTracker, r as InterventionController, b as MiddlewareRunner, P as PromptBuilder, t as AgentTurnToolProvider, c as ToolExecutionMode, A as AgentEvent, u as StreamProvider, v as Scope, x as ScopeSnapshot, y as ScopeOptions, F as FileOperationMeta, z as AgentSignal, B as TypedHandler, U as Unsubscribe, W as WildcardHandler } from './instance-
|
|
2
|
-
export { C as Agent, G as AgentConfig, J as AgentDefaults, K as AgentDefaultsContext, L as AgentDefaultsProvider, N as AgentMiddleware, O as AgentModelHooks, Q as AgentStatus, V as AgentTurnActiveToolCall, X as AgentTurnBoundaryKind, Y as AgentTurnBoundaryMetadata, Z as AgentTurnBoundarySnapshot, _ as AgentTurnCommitApplier, $ as AgentTurnCommitBatch, a0 as AgentTurnCommitOptions, a1 as AgentTurnEngine, a2 as AgentTurnEngineOptions, a3 as AgentTurnPhase, a4 as AgentTurnResolvedToolCall, a5 as AgentTurnState, a6 as AgentTurnStateAdvanceOptions, a7 as AgentTurnStepCommitSnapshot, a8 as AgentTurnStepCommitToolCall, a9 as AgentTurnStepCommitToolResult, aa as AgentTurnStepRuntimeConfig, ab as AgentTurnToolContext, ac as AgentTurnToolProviderResult, e as AnyInferenceResult, ad as AppliedProfile, ae as ApprovalAction, af as ApprovalAgentMiddleware, ag as ApprovalCascadeMode, ah as ApprovalCascadePolicy, ai as ApprovalConfig, aj as ApprovalCorrection, ak as ApprovalDecision, al as ApprovalEvaluation, am as ApprovalEvent, an as
|
|
1
|
+
import { H as HumanInputController, p as HumanInputConfig, T as Tool, M as Message, S as SessionManager, E as EffectiveAgentConfig, q as TurnChangeTracker, r as InterventionController, b as MiddlewareRunner, P as PromptBuilder, t as AgentTurnToolProvider, c as ToolExecutionMode, A as AgentEvent, u as StreamProvider, v as Scope, x as ScopeSnapshot, y as ScopeOptions, F as FileOperationMeta, z as AgentSignal, B as TypedHandler, U as Unsubscribe, W as WildcardHandler } from './instance-DV_xLU65.js';
|
|
2
|
+
export { C as Agent, G as AgentConfig, J as AgentDefaults, K as AgentDefaultsContext, L as AgentDefaultsProvider, N as AgentMiddleware, O as AgentModelHooks, Q as AgentStatus, V as AgentTurnActiveToolCall, X as AgentTurnBoundaryKind, Y as AgentTurnBoundaryMetadata, Z as AgentTurnBoundarySnapshot, _ as AgentTurnCommitApplier, $ as AgentTurnCommitBatch, a0 as AgentTurnCommitOptions, a1 as AgentTurnEngine, a2 as AgentTurnEngineOptions, a3 as AgentTurnPhase, a4 as AgentTurnResolvedToolCall, a5 as AgentTurnState, a6 as AgentTurnStateAdvanceOptions, a7 as AgentTurnStepCommitSnapshot, a8 as AgentTurnStepCommitToolCall, a9 as AgentTurnStepCommitToolResult, aa as AgentTurnStepRuntimeConfig, ab as AgentTurnToolContext, ac as AgentTurnToolProviderResult, e as AnyInferenceResult, ad as AppliedProfile, ae as ApprovalAction, af as ApprovalAgentMiddleware, ag as ApprovalCascadeMode, ah as ApprovalCascadePolicy, ai as ApprovalConfig, aj as ApprovalCorrection, ak as ApprovalDecision, al as ApprovalEvaluation, am as ApprovalEvent, an as ApprovalEventContext, ao as ApprovalHandler, ap as ApprovalLifecycleEvent, aq as ApprovalMiddlewareConfig, ar as ApprovalRememberScope, as as ApprovalRequest, at as ApprovalResolution, au as ApprovalRule, av as ApprovalRuleContext, aw as AssistantMessage, ax as BlockedModelCall, ay as BranchEntry, az as ChatLifecycleContext, aA as CommitOutputOptions, aB as CommitStepOptions, aC as CompactionConfig, aD as CompactionEntry, aE as CompatibleSchema, aF as ConfigChangeEntry, aG as CoordinatorNotification, aH as CoordinatorNotificationKind, aI as CoordinatorRoundEvent, aJ as CreateAgentTurnStateOptions, aK as CreateAgentTurnStepCommitBatchOptions, aL as CreateSessionOptions, aM as DEFAULT_AGENT_NAME, aN as DEFAULT_DISPATCH_TOOL_IDS, aO as DEFAULT_LOCAL_DISPATCH_CONCURRENCY, aP as DEFAULT_LOCAL_DISPATCH_DEPTH, aQ as DEFAULT_LOCAL_DISPATCH_TITLE_PREFIX, D as DEFAULT_MAX_OUTPUT_TOKENS, aR as DEFAULT_MAX_STEPS, D as DEFAULT_MAX_TOKENS, f as DEFAULT_RETRY_CONFIG, aS as DEFAULT_SYSTEM_PROMPT, aT as DISPATCH_STATES, aU as DispatchCheckOptions, aV as DispatchListOptions, aW as DispatchRecord, aX as DispatchResult, aY as DispatchRole, aZ as DispatchRuntime, a_ as DispatchStartInput, a$ as DispatchState, b0 as DispatchTarget, b1 as DispatchTargetInspection, b2 as DispatchTargetStartInput, b3 as DispatchTargetStartResult, b4 as DispatchTargetSummary, b5 as DispatchUsage, b6 as DoomLoopAction, b7 as DoomLoopHandler, b8 as DoomLoopRequest, b9 as EnhancedTools, ba as EntryBase, bb as EnvironmentInfo, bc as ExternalTaskControl, bd as FileEntry, be as GuidancePayload, bf as HistoryAccessor, bg as HumanInputEventContext, bh as HumanInputOption, bi as HumanInputRequest, bj as HumanInputRequestKind, bk as HumanInputRequestListOptions, bl as HumanInputRequestRecord, bm as HumanInputRequestStatus, bn as HumanInputResponse, bo as HumanInputTimeoutError, bp as HumanInputToolArgs, bq as HumanInputUnavailableError, br as IdleNotificationPayload, bs as InMemoryMailboxStore, bt as InMemoryTaskBoardStore, bu as InferSchemaOutput, g as InferenceCustomResult, h as InferenceStepInfo, I as InferenceStreamInput, i as InferenceStreamResult, bv as InputCheckResult, bw as InstructionFile, bx as LocalDispatchRuntimeOptions, by as LocalSessionTurnLock, bz as Mailbox, bA as MailboxStore, bB as MailboxSubscriber, bC as MemberRegisteredEvent, bD as MemberRuntime, bE as MemberStats, bF as MemberStatus, bG as MemberStatusChangedEvent, bH as MessageBase, bI as MessageEntry, bJ as MessageError, bK as MessageInput, bL as MessageKind, bM as MessageListFilter, bN as MessagePayload, bO as MessageRole, bP as MessageSentEvent, bQ as MetadataEntry, d as ModelCallContext, bR as ModelCallInput, bS as ModelCallOutput, bT as ModelFamily, bU as NormalizedToolReplayPolicy, bV as NotificationPriority, bW as OnFollowUpQueued, bX as OnInterventionApplied, bY as OtelMiddlewareConfig, bZ as PRUNE_PROTECTED_TOOLS, b_ as PendingIntervention, b$ as PermissionForwardedEvent, c0 as PermissionHandler, c1 as PermissionRequestPayload, c2 as PermissionResolvedEvent, c3 as PermissionResponsePayload, c4 as PlanCreatedEvent, c5 as PlannedTask, c6 as PrepareModelStepOptions, c7 as PreparedAgentModelStep, c8 as PreparedExternalTask, c9 as Profile, ca as PromptBuildContext, cb as PromptConfig, cc as PromptSection, cd as QueueTaskInput, ce as RecentMessagesOptions, cf as ReleaseSessionTurnLock, cg as RemoteSkillEntry, ch as RemoteSkillIndex, R as RetryConfig, j as RetryHandlerOptions, k as RetryState, ci as RiskLevel, cj as RuleSource, ck as RunModelStepOptions, cl as RunToolBatchOptions, cm as RunToolBatchResult, cn as STORAGE_VERSION, co as SerializedMessage, cp as Session, cq as SessionContext, cr as SessionEntry, cs as SessionHeader, ct as SessionInfo, cu as SessionStorage, cv as SessionTurnLock, cw as SessionTurnLockAcquireOptions, cx as ShutdownRequestPayload, cy as ShutdownRequestedEvent, cz as ShutdownResolvedEvent, cA as ShutdownResponsePayload, cB as SkillConfig, cC as SkillContent, cD as SkillDiscoveryError, cE as SkillDiscoveryResult, cF as SkillMetadata, cG as SkillRegistry, cH as SkillResource, cI as SkillResourceType, cJ as SkillScope, cK as SkillSource, cL as SkillSourceType, cM as StepProcessingOptions, cN as StepProcessingOutput, cO as StepProcessingResult, cP as StreamChunk, cQ as StreamInput, cR as StreamProviderConfig, cS as StreamProviderFactory, cT as StreamProviderInput, cU as StreamProviderResult, cV as SynthesisCompleteEvent, cW as SynthesisResult, cX as SystemMessage, cY as TERMINAL_STATUSES, cZ as TaskAbortedEvent, c_ as TaskBoard, c$ as TaskBoardStore, d0 as TaskCompletedEvent, d1 as TaskCompletion, d2 as TaskConflictError, d3 as TaskCreateInput, d4 as TaskCreatedEvent, d5 as TaskDispatchMode, d6 as TaskExecutor, d7 as TaskExecutorInput, d8 as TaskFailedEvent, d9 as TaskListFilter, da as TaskResult, db as TaskStatus, dc as TaskTransition, dd as TaskTransitionEvent, de as TaskTransitionReason, df as TeamCoordinatorConfig, dg as TeamEvent, dh as TeamMember, di as TeamMessage, dj as TeamNotificationEvent, dk as TeamPlan, dl as TeamSnapshot, dm as TeamStartedEvent, dn as TeamStoppedEvent, dp as TeamTask, dq as TelemetryConfig, dr as TelemetryConfigResult, ds as TokenUsage, dt as ToolCallDecision, du as ToolCallOutput, dv as ToolCapabilities, dw as ToolContext, dx as ToolHostRequirements, dy as ToolMessage, dz as ToolMetadata, dA as ToolReplayMode, dB as ToolReplayPolicy, dC as ToolResult, dD as ToolSideEffectLevel, dE as TracingConfig, a as TurnTrackerContext, dF as UndoResult, dG as UserMessage, dH as WorkerReportPayload, dI as accumulateUsage, dJ as advanceAgentTurnState, dK as approvalMiddleware, dL as buildCoordinatorNotificationEvent, l as calculateDelay, dM as createAgent, dN as createAgentTurnEngine, dO as createAgentTurnState, dP as createApprovalHandler, dQ as createHumanInputController, dR as createPromptBuilder, m as createRetryHandler, n as createRetryState, dS as createSkillRegistry, dT as createTurnTracker, dU as emptySkillRegistry, dV as failAgentTurnState, dW as getRequiredToolHost, dX as isApprovalMiddleware, dY as isBlockedModelCall, dZ as isHumanInputController, d_ as requiresToolHost, d$ as resolveAgentDefaults, e0 as resolveCapability, e1 as sandboxDefaultsProvider, s as shouldRetry, w as withRetry } from './instance-DV_xLU65.js';
|
|
3
3
|
import { LanguageModel, ModelMessage, Tool as Tool$1, TelemetryOptions } from 'ai';
|
|
4
4
|
import { T as ToolHost } from './types-C_LCeYNg.js';
|
|
5
5
|
export { D as DirEntry, E as ExecOptions, a as ExecResult, F as FileStat } from './types-C_LCeYNg.js';
|
|
@@ -14,13 +14,13 @@ export { C as CapabilitySource, D as DEFAULT_RESOLVER_OPTIONS, I as InputModalit
|
|
|
14
14
|
export { H as HttpTransportConfig, M as MCPConfig, a as MCPManager, b as MCPPromptInfo, c as MCPResourceInfo, d as MCPResourceTemplateInfo, e as MCPServerConfig, f as MCPServerStatus, R as RemoteTransportConfig, S as SseTransportConfig, g as StdioTransportConfig } from './types-DMjoFKKv.js';
|
|
15
15
|
export { ClientCredentialsOptions, ClientCredentialsProvider, createMCPManager, httpServer, serviceAccountServer, sseServer, stdioServer } from './mcp/index.js';
|
|
16
16
|
export { AgentTaskChatAdapter, AgentTaskCheckpointReason, AgentTaskCheckpointStrategy, AgentTaskCheckpointStrategyInput, AgentTaskExecutionCheckpoint, AgentTaskExecutionContext, AgentTaskExecutionRun, AgentTaskExecutionSnapshot, AgentTaskObserver, AgentTaskPayload, AgentTaskResult, AgentTaskResumeSnapshot, AgentTaskRunner, AgentTaskRunnerOptions, AgentWorkflowAssistantMessageSnapshot, AgentWorkflowCommitResult, AgentWorkflowInputCommitPlan, AgentWorkflowInterventionSnapshot, AgentWorkflowMessageSnapshot, AgentWorkflowModelStepPlan, AgentWorkflowModelStepResult, AgentWorkflowOperationPlan, AgentWorkflowOutputCommitPlan, AgentWorkflowReplayDecision, AgentWorkflowStepCommitPlan, AgentWorkflowSystemMessageSnapshot, AgentWorkflowToolBatchPlan, AgentWorkflowToolBatchResult, AgentWorkflowToolCallPlan, AgentWorkflowToolCallResult, AgentWorkflowToolCallSnapshot, AgentWorkflowToolMessageSnapshot, AgentWorkflowTurnPhase, AgentWorkflowTurnState, AgentWorkflowUserMessageSnapshot, ContextOverflowError, CreateAgentWorkflowTurnStateOptions, DoomLoopError, applyAgentWorkflowCommitResult, applyAgentWorkflowModelStepResult, applyAgentWorkflowToolBatchResult, applyAgentWorkflowToolCallResult, applyWorkflowInterventions, cloneAgentWorkflowTurnState, commitOutput, commitStep, createAgentTaskRunner, createAgentTurnStepCommitBatch, createAgentWorkflowTurnState, defaultAgentTaskCheckpointStrategy, drainWorkflowInterventions, failAgentWorkflowTurnState, planNextAgentWorkflowOperation, prepareModelStep, processStepStream, queueWorkflowFollowUps, recordAgentWorkflowReplayDecision, restoreAgentWorkflowMessage, restoreAgentWorkflowMessages, runModelStep, runToolBatch, snapshotAgentWorkflowMessage, snapshotAgentWorkflowMessages } from './execution/index.js';
|
|
17
|
-
export { c as convertAgentMessagesToModelMessages } from './model-messages-
|
|
17
|
+
export { c as convertAgentMessagesToModelMessages } from './model-messages-D19TVt7a.js';
|
|
18
18
|
export { CacheTTL, PromptCacheConfig, createTelemetryConfig, otelMiddleware, promptCacheMiddleware } from './middleware/index.js';
|
|
19
19
|
export { DEFAULT_INSTRUCTION_PATTERNS, DEFAULT_MAX_DEPTH, DEFAULT_MAX_FILE_SIZE, PRIORITY_BASE, PRIORITY_CUSTOM, PRIORITY_ENVIRONMENT, PRIORITY_INSTRUCTIONS, PRIORITY_OVERRIDE, PRIORITY_SKILLS, detectModelFamily, discoverInstructions, formatEnvironment, formatInstructions, gatherEnvironment, getAvailableFamilies, getTemplate, loadGlobalInstructions, summarizeEnvironment } from './prompt/index.js';
|
|
20
20
|
export { Profiles, applyProfile, careful, code, createProfile, explore, filterTools, mergeProfiles, plan, quick, review, watch } from './profiles/index.js';
|
|
21
21
|
export { SandboxPreview, SandboxProvider, SandboxSession, SandboxSessionMetadata, SandboxSnapshotResult } from './sandbox/index.js';
|
|
22
22
|
export { Inference, buildModelCallContext, buildToolSet, stream, streamOnce, streamStep } from './inference/index.js';
|
|
23
|
-
export { FileStorage, FileStorageOptions, MemoryStorage, buildEntryPath, buildMessagesFromEntries, configureDefaultSessionManager, createMessageEntry, createMetadataEntry, deserializeMessage, extractSessionInfo, generateEntryId, getDataDir, getDefaultSessionManager, getGitRootHash, getLeafId, getProjectId, getProjectSessionsDir, getSessionsDir, parseJSONL, serializeMessage, toJSONL, toJSONLBatch } from './storage/index.js';
|
|
23
|
+
export { BuildRecentMessagesOptions, FileStorage, FileStorageOptions, MemoryStorage, buildEntryPath, buildMessagesFromEntries, buildRecentMessagesFromEntries, buildRecentMessagesFromEntryMap, configureDefaultSessionManager, createMessageEntry, createMetadataEntry, deserializeMessage, extractSessionInfo, generateEntryId, getDataDir, getDefaultSessionManager, getGitRootHash, getLeafId, getProjectId, getProjectSessionsDir, getSessionsDir, parseJSONL, serializeMessage, toJSONL, toJSONLBatch } from './storage/index.js';
|
|
24
24
|
export { ApprovalDeniedError, ApprovalPolicyPresetName, ApprovalPolicyPresetOptions, ApprovalRuleCondition, ApprovalTimeoutError, RiskTierApprovalPolicyOptions, ThresholdApprovalRuleOptions, TrustedSessionApprovalPolicyOptions, allApprovalConditions, anyApprovalConditions, approvalRequestsOverlap, buildApprovalRuleContext, createApprovalCorrection, createApprovalPolicyPreset, createConditionalApprovalRule, createDangerouslyAllowAllApprovalPolicy, createHeadlessDenyApprovalPolicy, createInteractiveApprovalPolicy, createRememberedApprovalRules, createRiskTierApprovalPolicy, createThresholdApprovalRule, createTrustedSessionApprovalPolicy, describeApprovalOperation, extractApprovalPatterns, formatApprovalDeniedReason, getToolRisk, matchApprovalArgValue, matchApprovalNumericArg, matchApprovalPattern, matchApprovalRisks, matchApprovalSessions, matchApprovalStringPrefixes, normalizeApprovalCascadePolicy, normalizeRememberScopes, selectRememberScope, shouldCascadeApprovalDecision } from './safety/index.js';
|
|
25
25
|
export { E as ErrorCategory, L as LLMError, a as LLMErrorOptions, R as ResponseHeaders } from './llm-error-D93FNNLY.js';
|
|
26
26
|
export { getErrorCategory, getRetryDelay, isRetryable, isRetryableCategory, parseRetryDelay } from './inference/errors/index.js';
|
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-BJC46FIF.js";
|
|
38
38
|
import {
|
|
39
39
|
InMemoryMailboxStore,
|
|
40
40
|
InMemoryTaskBoardStore,
|
|
@@ -161,7 +161,7 @@ import {
|
|
|
161
161
|
ensureSessionLoaded,
|
|
162
162
|
getVisibleSessionMessages,
|
|
163
163
|
repairOrphanedToolCalls
|
|
164
|
-
} from "./chunk-
|
|
164
|
+
} from "./chunk-HSUPTXNV.js";
|
|
165
165
|
import {
|
|
166
166
|
sleep
|
|
167
167
|
} from "./chunk-SZ2XBPTW.js";
|
|
@@ -180,6 +180,8 @@ import {
|
|
|
180
180
|
SessionManager,
|
|
181
181
|
buildEntryPath,
|
|
182
182
|
buildMessagesFromEntries,
|
|
183
|
+
buildRecentMessagesFromEntries,
|
|
184
|
+
buildRecentMessagesFromEntryMap,
|
|
183
185
|
configureDefaultSessionManager,
|
|
184
186
|
createMessageEntry,
|
|
185
187
|
createMetadataEntry,
|
|
@@ -197,7 +199,7 @@ import {
|
|
|
197
199
|
serializeMessage,
|
|
198
200
|
toJSONL,
|
|
199
201
|
toJSONLBatch
|
|
200
|
-
} from "./chunk-
|
|
202
|
+
} from "./chunk-H3GRHFFG.js";
|
|
201
203
|
import {
|
|
202
204
|
createEventBus
|
|
203
205
|
} from "./chunk-2TTOLHBT.js";
|
|
@@ -243,7 +245,7 @@ import {
|
|
|
243
245
|
runToolBatch,
|
|
244
246
|
snapshotAgentWorkflowMessage,
|
|
245
247
|
snapshotAgentWorkflowMessages
|
|
246
|
-
} from "./chunk-
|
|
248
|
+
} from "./chunk-FY6UGSFM.js";
|
|
247
249
|
import {
|
|
248
250
|
DEFAULT_RETRY_CONFIG,
|
|
249
251
|
Inference,
|
|
@@ -258,7 +260,7 @@ import {
|
|
|
258
260
|
streamOnce,
|
|
259
261
|
streamStep,
|
|
260
262
|
withRetry
|
|
261
|
-
} from "./chunk-
|
|
263
|
+
} from "./chunk-Y3TRGGUG.js";
|
|
262
264
|
import {
|
|
263
265
|
currentScope,
|
|
264
266
|
executeAgentToolCall,
|
|
@@ -268,7 +270,7 @@ import {
|
|
|
268
270
|
snapshotScope,
|
|
269
271
|
streamWithinScope,
|
|
270
272
|
withinScope
|
|
271
|
-
} from "./chunk-
|
|
273
|
+
} from "./chunk-MWPU2EVV.js";
|
|
272
274
|
import {
|
|
273
275
|
LLMError,
|
|
274
276
|
getErrorCategory,
|
|
@@ -324,7 +326,7 @@ import {
|
|
|
324
326
|
isApprovalMiddleware,
|
|
325
327
|
otelMiddleware,
|
|
326
328
|
promptCacheMiddleware
|
|
327
|
-
} from "./chunk-
|
|
329
|
+
} from "./chunk-2BQI4M6X.js";
|
|
328
330
|
import {
|
|
329
331
|
DEFAULT_AGENT_NAME,
|
|
330
332
|
DEFAULT_MAX_STEPS,
|
|
@@ -376,7 +378,7 @@ import {
|
|
|
376
378
|
normalizeRememberScopes,
|
|
377
379
|
selectRememberScope,
|
|
378
380
|
shouldCascadeApprovalDecision
|
|
379
|
-
} from "./chunk-
|
|
381
|
+
} from "./chunk-T33MQXUP.js";
|
|
380
382
|
import {
|
|
381
383
|
describeApprovalOperation,
|
|
382
384
|
extractApprovalPatterns,
|
|
@@ -1211,6 +1213,13 @@ async function* runChatLoop(deps) {
|
|
|
1211
1213
|
let chatOutput;
|
|
1212
1214
|
let chatEndError;
|
|
1213
1215
|
let rethrowError;
|
|
1216
|
+
const lifecycleContext = {
|
|
1217
|
+
sessionId,
|
|
1218
|
+
turnId,
|
|
1219
|
+
history: {
|
|
1220
|
+
getRecentMessages: (options) => sessions.getRecentMessages(options)
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1214
1223
|
try {
|
|
1215
1224
|
const isPlanMode = deps.toolExecutionMode === "plan";
|
|
1216
1225
|
const turnEngine = createAgentTurnEngine({
|
|
@@ -1233,10 +1242,11 @@ async function* runChatLoop(deps) {
|
|
|
1233
1242
|
setIsStreaming(true);
|
|
1234
1243
|
streamingStateStarted = true;
|
|
1235
1244
|
if (middlewareRunner.hasMiddleware) {
|
|
1236
|
-
await middlewareRunner.runChatStart(
|
|
1245
|
+
await middlewareRunner.runChatStart(
|
|
1237
1246
|
sessionId,
|
|
1238
|
-
|
|
1239
|
-
|
|
1247
|
+
message,
|
|
1248
|
+
lifecycleContext
|
|
1249
|
+
);
|
|
1240
1250
|
}
|
|
1241
1251
|
let step = 1;
|
|
1242
1252
|
let finalStepText = "";
|
|
@@ -1404,10 +1414,7 @@ async function* runChatLoop(deps) {
|
|
|
1404
1414
|
error: chatError,
|
|
1405
1415
|
output: chatOutput
|
|
1406
1416
|
},
|
|
1407
|
-
|
|
1408
|
-
sessionId,
|
|
1409
|
-
turnId
|
|
1410
|
-
}
|
|
1417
|
+
lifecycleContext
|
|
1411
1418
|
);
|
|
1412
1419
|
} catch (error) {
|
|
1413
1420
|
chatEndError = error;
|
|
@@ -3450,6 +3457,8 @@ export {
|
|
|
3450
3457
|
buildOpenRouterOptions,
|
|
3451
3458
|
buildReasoningOptions,
|
|
3452
3459
|
buildReasoningOptionsSync,
|
|
3460
|
+
buildRecentMessagesFromEntries,
|
|
3461
|
+
buildRecentMessagesFromEntryMap,
|
|
3453
3462
|
buildToolSet,
|
|
3454
3463
|
buildXAIOptions,
|
|
3455
3464
|
calculateDelay,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ToolSet } from 'ai';
|
|
2
|
-
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-
|
|
3
|
-
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-
|
|
2
|
+
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-DV_xLU65.js';
|
|
3
|
+
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-DV_xLU65.js';
|
|
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-D19TVt7a.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';
|
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-Y3TRGGUG.js";
|
|
17
|
+
import "../chunk-MWPU2EVV.js";
|
|
18
18
|
import {
|
|
19
19
|
LLMError,
|
|
20
20
|
getErrorCategory,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
DEFAULT_MAX_TOKENS
|
|
29
29
|
} from "../chunk-CJI7PVS2.js";
|
|
30
30
|
import "../chunk-I6PKJ7XQ.js";
|
|
31
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-T33MQXUP.js";
|
|
32
32
|
import "../chunk-FII65CN7.js";
|
|
33
33
|
import "../chunk-S6AKEPAX.js";
|
|
34
34
|
export {
|
|
@@ -275,6 +275,22 @@ interface ApprovalDecision {
|
|
|
275
275
|
* Callers may return either the simple string action or the structured object.
|
|
276
276
|
*/
|
|
277
277
|
type ApprovalResolution = ApprovalAction | ApprovalDecision;
|
|
278
|
+
type ApprovalLifecycleEvent = {
|
|
279
|
+
type: "status";
|
|
280
|
+
status: "waiting-approval" | "processing";
|
|
281
|
+
} | {
|
|
282
|
+
type: "approval-request";
|
|
283
|
+
request: ApprovalRequest;
|
|
284
|
+
} | {
|
|
285
|
+
type: "approval-resolved";
|
|
286
|
+
id: string;
|
|
287
|
+
action: ApprovalDecision["action"];
|
|
288
|
+
feedback?: string;
|
|
289
|
+
rememberScope?: ApprovalRememberScope;
|
|
290
|
+
};
|
|
291
|
+
interface ApprovalEventContext {
|
|
292
|
+
emitEvent?: (event: ApprovalLifecycleEvent) => void | Promise<void>;
|
|
293
|
+
}
|
|
278
294
|
/**
|
|
279
295
|
* Where a rule came from — used for debugging and selective clearing.
|
|
280
296
|
*
|
|
@@ -1241,6 +1257,47 @@ interface PromptConfig {
|
|
|
1241
1257
|
skills?: SkillConfig;
|
|
1242
1258
|
}
|
|
1243
1259
|
|
|
1260
|
+
/**
|
|
1261
|
+
* Options for creating a new session.
|
|
1262
|
+
*/
|
|
1263
|
+
interface CreateSessionOptions {
|
|
1264
|
+
/** Custom session ID (auto-generated if not provided) */
|
|
1265
|
+
id?: string;
|
|
1266
|
+
/** Working directory */
|
|
1267
|
+
cwd: string;
|
|
1268
|
+
/** Session title */
|
|
1269
|
+
title?: string;
|
|
1270
|
+
/** Parent session ID (if forking) */
|
|
1271
|
+
parentSessionId?: string;
|
|
1272
|
+
}
|
|
1273
|
+
/**
|
|
1274
|
+
* Session context for LLM calls.
|
|
1275
|
+
*/
|
|
1276
|
+
interface SessionContext {
|
|
1277
|
+
/** Messages for LLM context */
|
|
1278
|
+
messages: Message[];
|
|
1279
|
+
/** Current leaf entry ID */
|
|
1280
|
+
leafId: string | null;
|
|
1281
|
+
/** Session metadata */
|
|
1282
|
+
metadata: {
|
|
1283
|
+
id: string;
|
|
1284
|
+
cwd: string;
|
|
1285
|
+
title?: string;
|
|
1286
|
+
name?: string;
|
|
1287
|
+
};
|
|
1288
|
+
}
|
|
1289
|
+
/**
|
|
1290
|
+
* Options for reading a bounded slice of recent visible session messages.
|
|
1291
|
+
*/
|
|
1292
|
+
interface RecentMessagesOptions$1 {
|
|
1293
|
+
/** Maximum number of messages to return. Defaults to all visible messages. */
|
|
1294
|
+
limit?: number;
|
|
1295
|
+
/** Restrict returned messages to these roles. Defaults to all roles. */
|
|
1296
|
+
roles?: readonly MessageRole[];
|
|
1297
|
+
/** Optional leaf entry ID. Defaults to the manager's active leaf. */
|
|
1298
|
+
leafId?: string;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1244
1301
|
/**
|
|
1245
1302
|
* Stream types for @cuylabs/agent-core
|
|
1246
1303
|
*
|
|
@@ -1832,6 +1889,20 @@ interface ModelCallOutput {
|
|
|
1832
1889
|
interface ChatLifecycleContext {
|
|
1833
1890
|
sessionId: string;
|
|
1834
1891
|
turnId?: string;
|
|
1892
|
+
history?: HistoryAccessor;
|
|
1893
|
+
}
|
|
1894
|
+
/**
|
|
1895
|
+
* Options for reading a bounded slice of recent visible chat messages.
|
|
1896
|
+
*/
|
|
1897
|
+
type RecentMessagesOptions = Pick<RecentMessagesOptions$1, "limit" | "roles">;
|
|
1898
|
+
/**
|
|
1899
|
+
* Lazy chat-history accessor exposed to lifecycle middleware.
|
|
1900
|
+
*
|
|
1901
|
+
* The chat loop passes this accessor by reference; messages are only read and
|
|
1902
|
+
* deserialized if middleware calls it.
|
|
1903
|
+
*/
|
|
1904
|
+
interface HistoryAccessor {
|
|
1905
|
+
getRecentMessages(options?: RecentMessagesOptions): Message[];
|
|
1835
1906
|
}
|
|
1836
1907
|
/**
|
|
1837
1908
|
* Extended tool result returned by `afterToolCall` middleware.
|
|
@@ -3753,36 +3824,6 @@ declare class LocalSessionTurnLock implements SessionTurnLock {
|
|
|
3753
3824
|
clear(sessionId: string): void;
|
|
3754
3825
|
}
|
|
3755
3826
|
|
|
3756
|
-
/**
|
|
3757
|
-
* Options for creating a new session.
|
|
3758
|
-
*/
|
|
3759
|
-
interface CreateSessionOptions {
|
|
3760
|
-
/** Custom session ID (auto-generated if not provided) */
|
|
3761
|
-
id?: string;
|
|
3762
|
-
/** Working directory */
|
|
3763
|
-
cwd: string;
|
|
3764
|
-
/** Session title */
|
|
3765
|
-
title?: string;
|
|
3766
|
-
/** Parent session ID (if forking) */
|
|
3767
|
-
parentSessionId?: string;
|
|
3768
|
-
}
|
|
3769
|
-
/**
|
|
3770
|
-
* Session context for LLM calls.
|
|
3771
|
-
*/
|
|
3772
|
-
interface SessionContext {
|
|
3773
|
-
/** Messages for LLM context */
|
|
3774
|
-
messages: Message[];
|
|
3775
|
-
/** Current leaf entry ID */
|
|
3776
|
-
leafId: string | null;
|
|
3777
|
-
/** Session metadata */
|
|
3778
|
-
metadata: {
|
|
3779
|
-
id: string;
|
|
3780
|
-
cwd: string;
|
|
3781
|
-
title?: string;
|
|
3782
|
-
name?: string;
|
|
3783
|
-
};
|
|
3784
|
-
}
|
|
3785
|
-
|
|
3786
3827
|
/**
|
|
3787
3828
|
* Manages session lifecycle with tree-structured entries.
|
|
3788
3829
|
*/
|
|
@@ -3792,6 +3833,7 @@ declare class SessionManager {
|
|
|
3792
3833
|
private currentLeafId;
|
|
3793
3834
|
private entriesCache;
|
|
3794
3835
|
private idsCache;
|
|
3836
|
+
private entriesByIdCache;
|
|
3795
3837
|
constructor(storage?: SessionStorage);
|
|
3796
3838
|
create(options: CreateSessionOptions): Promise<string>;
|
|
3797
3839
|
load(sessionId: string): Promise<void>;
|
|
@@ -3800,6 +3842,7 @@ declare class SessionManager {
|
|
|
3800
3842
|
addMessage(message: Message): Promise<string>;
|
|
3801
3843
|
addMessages(messages: Message[]): Promise<string[]>;
|
|
3802
3844
|
getMessages(leafId?: string): Message[];
|
|
3845
|
+
getRecentMessages(options?: RecentMessagesOptions$1): Message[];
|
|
3803
3846
|
addCompaction(options: {
|
|
3804
3847
|
summary: string;
|
|
3805
3848
|
firstKeptEntryId: string;
|
|
@@ -4256,7 +4299,7 @@ declare class InterventionController {
|
|
|
4256
4299
|
*/
|
|
4257
4300
|
declare function createApprovalHandler(config?: ApprovalConfig): {
|
|
4258
4301
|
evaluate: (sessionId: string, tool: string, args: unknown, customRisks?: Record<string, RiskLevel>, capabilities?: ToolCapabilities, patternExtractor?: (input: unknown) => string[], extraRules?: ApprovalRule[]) => ApprovalEvaluation;
|
|
4259
|
-
request: (sessionId: string, tool: string, args: unknown, customRisks?: Record<string, RiskLevel>, capabilities?: ToolCapabilities, patternExtractor?: (input: unknown) => string[], extraRules?: ApprovalRule[]) => Promise<void>;
|
|
4302
|
+
request: (sessionId: string, tool: string, args: unknown, customRisks?: Record<string, RiskLevel>, capabilities?: ToolCapabilities, patternExtractor?: (input: unknown) => string[], extraRules?: ApprovalRule[], eventContext?: ApprovalEventContext) => Promise<void>;
|
|
4260
4303
|
cancelAll: (_reason?: string) => void;
|
|
4261
4304
|
addRule: (rule: ApprovalRule) => void;
|
|
4262
4305
|
getRules: () => readonly ApprovalRule[];
|
|
@@ -5902,4 +5945,4 @@ declare class Agent {
|
|
|
5902
5945
|
close(): Promise<void>;
|
|
5903
5946
|
}
|
|
5904
5947
|
|
|
5905
|
-
export { type AgentTurnCommitBatch as $, type AgentEvent as A, type TypedHandler as B, Agent as C, DEFAULT_MAX_TOKENS as D, type EffectiveAgentConfig as E, type FileOperationMeta as F, type AgentConfig as G, type HumanInputController as H, type InferenceStreamInput as I, type AgentDefaults as J, type AgentDefaultsContext as K, type AgentDefaultsProvider as L, type Message as M, type AgentMiddleware as N, type AgentModelHooks as O, PromptBuilder as P, type AgentStatus as Q, type RetryConfig as R, SessionManager as S, Tool as T, type Unsubscribe as U, type AgentTurnActiveToolCall as V, type WildcardHandler as W, type AgentTurnBoundaryKind as X, type AgentTurnBoundaryMetadata as Y, type AgentTurnBoundarySnapshot as Z, type AgentTurnCommitApplier as _, type TurnTrackerContext as a, type
|
|
5948
|
+
export { type AgentTurnCommitBatch as $, type AgentEvent as A, type TypedHandler as B, Agent as C, DEFAULT_MAX_TOKENS as D, type EffectiveAgentConfig as E, type FileOperationMeta as F, type AgentConfig as G, type HumanInputController as H, type InferenceStreamInput as I, type AgentDefaults as J, type AgentDefaultsContext as K, type AgentDefaultsProvider as L, type Message as M, type AgentMiddleware as N, type AgentModelHooks as O, PromptBuilder as P, type AgentStatus as Q, type RetryConfig as R, SessionManager as S, Tool as T, type Unsubscribe as U, type AgentTurnActiveToolCall as V, type WildcardHandler as W, type AgentTurnBoundaryKind as X, type AgentTurnBoundaryMetadata as Y, type AgentTurnBoundarySnapshot as Z, type AgentTurnCommitApplier as _, type TurnTrackerContext as a, type DispatchState as a$, type AgentTurnCommitOptions as a0, AgentTurnEngine as a1, type AgentTurnEngineOptions as a2, type AgentTurnPhase as a3, type AgentTurnResolvedToolCall as a4, type AgentTurnState as a5, type AgentTurnStateAdvanceOptions as a6, type AgentTurnStepCommitSnapshot as a7, type AgentTurnStepCommitToolCall as a8, type AgentTurnStepCommitToolResult as a9, type CommitOutputOptions as aA, type CommitStepOptions as aB, type CompactionConfig as aC, type CompactionEntry as aD, type CompatibleSchema as aE, type ConfigChangeEntry as aF, type CoordinatorNotification as aG, type CoordinatorNotificationKind as aH, type CoordinatorRoundEvent as aI, type CreateAgentTurnStateOptions as aJ, type CreateAgentTurnStepCommitBatchOptions as aK, type CreateSessionOptions as aL, DEFAULT_AGENT_NAME as aM, DEFAULT_DISPATCH_TOOL_IDS as aN, DEFAULT_LOCAL_DISPATCH_CONCURRENCY as aO, DEFAULT_LOCAL_DISPATCH_DEPTH as aP, DEFAULT_LOCAL_DISPATCH_TITLE_PREFIX as aQ, DEFAULT_MAX_STEPS as aR, DEFAULT_SYSTEM_PROMPT as aS, DISPATCH_STATES as aT, type DispatchCheckOptions as aU, type DispatchListOptions as aV, type DispatchRecord as aW, type DispatchResult as aX, type DispatchRole as aY, type DispatchRuntime as aZ, type DispatchStartInput as a_, type AgentTurnStepRuntimeConfig as aa, type AgentTurnToolContext as ab, type AgentTurnToolProviderResult as ac, type AppliedProfile as ad, type ApprovalAction as ae, type ApprovalAgentMiddleware as af, type ApprovalCascadeMode as ag, type ApprovalCascadePolicy as ah, type ApprovalConfig as ai, type ApprovalCorrection as aj, type ApprovalDecision as ak, type ApprovalEvaluation as al, type ApprovalEvent as am, type ApprovalEventContext as an, type ApprovalHandler as ao, type ApprovalLifecycleEvent as ap, type ApprovalMiddlewareConfig as aq, type ApprovalRememberScope as ar, type ApprovalRequest as as, type ApprovalResolution as at, type ApprovalRule as au, type ApprovalRuleContext as av, type AssistantMessage as aw, type BlockedModelCall as ax, type BranchEntry as ay, type ChatLifecycleContext as az, MiddlewareRunner as b, type PermissionForwardedEvent as b$, type DispatchTarget as b0, type DispatchTargetInspection as b1, type DispatchTargetStartInput as b2, type DispatchTargetStartResult as b3, type DispatchTargetSummary as b4, type DispatchUsage as b5, type DoomLoopAction as b6, type DoomLoopHandler as b7, type DoomLoopRequest as b8, type EnhancedTools as b9, type MailboxStore as bA, type MailboxSubscriber as bB, type MemberRegisteredEvent as bC, type MemberRuntime as bD, type MemberStats as bE, type MemberStatus as bF, type MemberStatusChangedEvent as bG, type MessageBase as bH, type MessageEntry as bI, type MessageError as bJ, type MessageInput as bK, type MessageKind as bL, type MessageListFilter as bM, type MessagePayload as bN, type MessageRole as bO, type MessageSentEvent as bP, type MetadataEntry as bQ, type ModelCallInput as bR, type ModelCallOutput as bS, type ModelFamily as bT, type NormalizedToolReplayPolicy as bU, type NotificationPriority as bV, type OnFollowUpQueued as bW, type OnInterventionApplied as bX, type OtelMiddlewareConfig as bY, PRUNE_PROTECTED_TOOLS as bZ, type PendingIntervention as b_, type EntryBase as ba, type EnvironmentInfo as bb, type ExternalTaskControl as bc, type FileEntry as bd, type GuidancePayload as be, type HistoryAccessor as bf, type HumanInputEventContext as bg, type HumanInputOption as bh, type HumanInputRequest as bi, type HumanInputRequestKind as bj, type HumanInputRequestListOptions as bk, type HumanInputRequestRecord as bl, type HumanInputRequestStatus as bm, type HumanInputResponse as bn, HumanInputTimeoutError as bo, type HumanInputToolArgs as bp, HumanInputUnavailableError as bq, type IdleNotificationPayload as br, InMemoryMailboxStore as bs, InMemoryTaskBoardStore as bt, type InferSchemaOutput as bu, type InputCheckResult as bv, type InstructionFile as bw, type LocalDispatchRuntimeOptions as bx, LocalSessionTurnLock as by, Mailbox as bz, type ToolExecutionMode as c, type TaskBoardStore as c$, type PermissionHandler as c0, type PermissionRequestPayload as c1, type PermissionResolvedEvent as c2, type PermissionResponsePayload as c3, type PlanCreatedEvent as c4, type PlannedTask as c5, type PrepareModelStepOptions as c6, type PreparedAgentModelStep as c7, type PreparedExternalTask as c8, type Profile as c9, type ShutdownResponsePayload as cA, type SkillConfig as cB, type SkillContent as cC, type SkillDiscoveryError as cD, type SkillDiscoveryResult as cE, type SkillMetadata as cF, SkillRegistry as cG, type SkillResource as cH, type SkillResourceType as cI, type SkillScope as cJ, type SkillSource as cK, type SkillSourceType as cL, type StepProcessingOptions as cM, type StepProcessingOutput as cN, type StepProcessingResult as cO, type StreamChunk as cP, type StreamInput as cQ, type StreamProviderConfig as cR, type StreamProviderFactory as cS, type StreamProviderInput as cT, type StreamProviderResult as cU, type SynthesisCompleteEvent as cV, type SynthesisResult as cW, type SystemMessage as cX, TERMINAL_STATUSES as cY, type TaskAbortedEvent as cZ, TaskBoard as c_, type PromptBuildContext as ca, type PromptConfig as cb, type PromptSection as cc, type QueueTaskInput as cd, type RecentMessagesOptions$1 as ce, type ReleaseSessionTurnLock as cf, type RemoteSkillEntry as cg, type RemoteSkillIndex as ch, type RiskLevel as ci, type RuleSource as cj, type RunModelStepOptions as ck, type RunToolBatchOptions as cl, type RunToolBatchResult as cm, STORAGE_VERSION as cn, type SerializedMessage as co, type Session as cp, type SessionContext as cq, type SessionEntry as cr, type SessionHeader as cs, type SessionInfo as ct, type SessionStorage as cu, type SessionTurnLock as cv, type SessionTurnLockAcquireOptions as cw, type ShutdownRequestPayload as cx, type ShutdownRequestedEvent as cy, type ShutdownResolvedEvent as cz, type ModelCallContext as d, resolveAgentDefaults as d$, type TaskCompletedEvent as d0, type TaskCompletion as d1, TaskConflictError as d2, type TaskCreateInput as d3, type TaskCreatedEvent as d4, type TaskDispatchMode as d5, type TaskExecutor as d6, type TaskExecutorInput as d7, type TaskFailedEvent as d8, type TaskListFilter as d9, type ToolReplayMode as dA, type ToolReplayPolicy as dB, type ToolResult as dC, type ToolSideEffectLevel as dD, type TracingConfig as dE, type UndoResult as dF, type UserMessage as dG, type WorkerReportPayload as dH, accumulateUsage as dI, advanceAgentTurnState as dJ, approvalMiddleware as dK, buildCoordinatorNotificationEvent as dL, createAgent as dM, createAgentTurnEngine as dN, createAgentTurnState as dO, createApprovalHandler as dP, createHumanInputController as dQ, createPromptBuilder as dR, createSkillRegistry as dS, createTurnTracker as dT, emptySkillRegistry as dU, failAgentTurnState as dV, getRequiredToolHost as dW, isApprovalMiddleware as dX, isBlockedModelCall as dY, isHumanInputController as dZ, requiresToolHost as d_, type TaskResult as da, type TaskStatus as db, type TaskTransition as dc, type TaskTransitionEvent as dd, type TaskTransitionReason as de, type TeamCoordinatorConfig as df, type TeamEvent as dg, type TeamMember as dh, type TeamMessage as di, type TeamNotificationEvent as dj, type TeamPlan as dk, type TeamSnapshot as dl, type TeamStartedEvent as dm, type TeamStoppedEvent as dn, type TeamTask as dp, type TelemetryConfig as dq, type TelemetryConfigResult as dr, type TokenUsage as ds, type ToolCallDecision as dt, type ToolCallOutput as du, type ToolCapabilities as dv, type ToolContext as dw, type ToolHostRequirements as dx, type ToolMessage as dy, type ToolMetadata as dz, type AnyInferenceResult as e, resolveCapability as e0, sandboxDefaultsProvider as e1, type CoordinatorCtx as e2, DEFAULT_RETRY_CONFIG as f, type InferenceCustomResult as g, type InferenceStepInfo as h, type InferenceStreamResult as i, type RetryHandlerOptions as j, type RetryState as k, calculateDelay as l, createRetryHandler as m, createRetryState as n, sleep as o, type HumanInputConfig as p, TurnChangeTracker as q, InterventionController as r, shouldRetry as s, type AgentTurnToolProvider as t, type StreamProvider as u, type Scope as v, withRetry as w, type ScopeSnapshot as x, type ScopeOptions as y, type AgentSignal as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { O as AgentModelHooks, af as ApprovalAgentMiddleware,
|
|
1
|
+
import { bY as OtelMiddlewareConfig, N as AgentMiddleware, dq as TelemetryConfig, dr as TelemetryConfigResult } from '../instance-DV_xLU65.js';
|
|
2
|
+
export { O as AgentModelHooks, af as ApprovalAgentMiddleware, aq as ApprovalMiddlewareConfig, ax as BlockedModelCall, az as ChatLifecycleContext, bf as HistoryAccessor, b as MiddlewareRunner, d as ModelCallContext, bR as ModelCallInput, bS as ModelCallOutput, dt as ToolCallDecision, du as ToolCallOutput, dK as approvalMiddleware, dX as isApprovalMiddleware, dY as isBlockedModelCall } from '../instance-DV_xLU65.js';
|
|
3
3
|
import '../types-C_LCeYNg.js';
|
|
4
4
|
import 'ai';
|
|
5
5
|
import '../types-RSCv7nQ4.js';
|
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-2BQI4M6X.js";
|
|
9
9
|
import {
|
|
10
10
|
isBlockedModelCall
|
|
11
11
|
} from "../chunk-CJI7PVS2.js";
|
|
12
12
|
import "../chunk-I6PKJ7XQ.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-T33MQXUP.js";
|
|
14
14
|
import "../chunk-FII65CN7.js";
|
|
15
15
|
import "../chunk-S6AKEPAX.js";
|
|
16
16
|
export {
|
package/dist/plugin/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as Tool, N as AgentMiddleware,
|
|
1
|
+
import { T as Tool, N as AgentMiddleware, cc as PromptSection } from '../instance-DV_xLU65.js';
|
|
2
2
|
import { ZodType } from 'zod';
|
|
3
3
|
import { Jiti } from 'jiti';
|
|
4
4
|
import '../types-C_LCeYNg.js';
|
package/dist/profiles/index.d.ts
CHANGED
package/dist/prompt/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { bT as ModelFamily, bb as EnvironmentInfo, bw as InstructionFile } from '../instance-DV_xLU65.js';
|
|
2
|
+
export { ca as PromptBuildContext, P as PromptBuilder, cb as PromptConfig, cc as PromptSection, cB as SkillConfig, dR as createPromptBuilder } from '../instance-DV_xLU65.js';
|
|
3
3
|
import { LanguageModel } from 'ai';
|
|
4
4
|
import '../types-C_LCeYNg.js';
|
|
5
5
|
import '../types-RSCv7nQ4.js';
|
package/dist/safety/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { ae as ApprovalAction, ag as ApprovalCascadeMode, aj as ApprovalCorrection, al as ApprovalEvaluation, an as ApprovalHandler,
|
|
1
|
+
import { ci as RiskLevel, au as ApprovalRule, as as ApprovalRequest, av as ApprovalRuleContext, cj as RuleSource, ah as ApprovalCascadePolicy, ar as ApprovalRememberScope, ak as ApprovalDecision, ai as ApprovalConfig } from '../instance-DV_xLU65.js';
|
|
2
|
+
export { ae as ApprovalAction, ag as ApprovalCascadeMode, aj as ApprovalCorrection, al as ApprovalEvaluation, an as ApprovalEventContext, ao as ApprovalHandler, ap as ApprovalLifecycleEvent, at as ApprovalResolution, dP as createApprovalHandler } from '../instance-DV_xLU65.js';
|
|
3
3
|
import '../types-C_LCeYNg.js';
|
|
4
4
|
import 'ai';
|
|
5
5
|
import '../types-RSCv7nQ4.js';
|
package/dist/safety/index.js
CHANGED
package/dist/skill/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { cJ as SkillScope, cK as SkillSource, cF as SkillMetadata, cI as SkillResourceType, cH as SkillResource, cC as SkillContent, cB as SkillConfig, cE as SkillDiscoveryResult, cG as SkillRegistry, T as Tool } from '../instance-DV_xLU65.js';
|
|
2
|
+
export { cg as RemoteSkillEntry, ch as RemoteSkillIndex, cD as SkillDiscoveryError, cL as SkillSourceType, dS as createSkillRegistry, dU as emptySkillRegistry } from '../instance-DV_xLU65.js';
|
|
3
3
|
import '../types-C_LCeYNg.js';
|
|
4
4
|
import 'ai';
|
|
5
5
|
import '../types-RSCv7nQ4.js';
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { bO as MessageRole, bd as FileEntry, cr as SessionEntry, M as Message, bI as MessageEntry, bQ as MetadataEntry, co as SerializedMessage, ct as SessionInfo, cu as SessionStorage, cs as SessionHeader, S as SessionManager } from '../instance-DV_xLU65.js';
|
|
2
|
+
export { ay as BranchEntry, aD as CompactionEntry, aF as ConfigChangeEntry, aL as CreateSessionOptions, ba as EntryBase, by as LocalSessionTurnLock, ce as RecentMessagesOptions, cf as ReleaseSessionTurnLock, cn as STORAGE_VERSION, cq as SessionContext, cv as SessionTurnLock, cw as SessionTurnLockAcquireOptions } from '../instance-DV_xLU65.js';
|
|
3
3
|
import { L as Logger } from '../types-RSCv7nQ4.js';
|
|
4
4
|
import '../types-C_LCeYNg.js';
|
|
5
5
|
import 'ai';
|
|
@@ -72,6 +72,20 @@ declare function buildEntryPath(entries: FileEntry[], targetId: string): Session
|
|
|
72
72
|
* Handles compaction summaries
|
|
73
73
|
*/
|
|
74
74
|
declare function buildMessagesFromEntries(entries: FileEntry[], leafId?: string): Message[];
|
|
75
|
+
interface BuildRecentMessagesOptions {
|
|
76
|
+
leafId?: string;
|
|
77
|
+
limit?: number;
|
|
78
|
+
roles?: readonly MessageRole[];
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Build the last N visible messages from a session path without materializing
|
|
82
|
+
* the full message list when only a bounded suffix is needed.
|
|
83
|
+
*/
|
|
84
|
+
declare function buildRecentMessagesFromEntries(entries: FileEntry[], options?: BuildRecentMessagesOptions): Message[];
|
|
85
|
+
/**
|
|
86
|
+
* Build the last N visible messages from an existing entry index.
|
|
87
|
+
*/
|
|
88
|
+
declare function buildRecentMessagesFromEntryMap(entriesById: ReadonlyMap<string, SessionEntry>, leafId: string | undefined, options?: Omit<BuildRecentMessagesOptions, "leafId">): Message[];
|
|
75
89
|
|
|
76
90
|
/**
|
|
77
91
|
* Memory Session Storage
|
|
@@ -174,4 +188,4 @@ declare function getDefaultSessionManager(): SessionManager;
|
|
|
174
188
|
*/
|
|
175
189
|
declare function configureDefaultSessionManager(storage: SessionStorage): SessionManager;
|
|
176
190
|
|
|
177
|
-
export { FileEntry, FileStorage, type FileStorageOptions, MemoryStorage, MessageEntry, MetadataEntry, SerializedMessage, SessionEntry, SessionHeader, SessionInfo, SessionManager, SessionStorage, buildEntryPath, buildMessagesFromEntries, configureDefaultSessionManager, createMessageEntry, createMetadataEntry, deserializeMessage, extractSessionInfo, generateEntryId, getDataDir, getDefaultSessionManager, getGitRootHash, getLeafId, getProjectId, getProjectSessionsDir, getSessionsDir, parseJSONL, serializeMessage, toJSONL, toJSONLBatch };
|
|
191
|
+
export { type BuildRecentMessagesOptions, FileEntry, FileStorage, type FileStorageOptions, MemoryStorage, MessageEntry, MetadataEntry, SerializedMessage, SessionEntry, SessionHeader, SessionInfo, SessionManager, SessionStorage, buildEntryPath, buildMessagesFromEntries, buildRecentMessagesFromEntries, buildRecentMessagesFromEntryMap, configureDefaultSessionManager, createMessageEntry, createMetadataEntry, deserializeMessage, extractSessionInfo, generateEntryId, getDataDir, getDefaultSessionManager, getGitRootHash, getLeafId, getProjectId, getProjectSessionsDir, getSessionsDir, parseJSONL, serializeMessage, toJSONL, toJSONLBatch };
|
package/dist/storage/index.js
CHANGED
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
SessionManager,
|
|
7
7
|
buildEntryPath,
|
|
8
8
|
buildMessagesFromEntries,
|
|
9
|
+
buildRecentMessagesFromEntries,
|
|
10
|
+
buildRecentMessagesFromEntryMap,
|
|
9
11
|
configureDefaultSessionManager,
|
|
10
12
|
createMessageEntry,
|
|
11
13
|
createMetadataEntry,
|
|
@@ -23,7 +25,7 @@ import {
|
|
|
23
25
|
serializeMessage,
|
|
24
26
|
toJSONL,
|
|
25
27
|
toJSONLBatch
|
|
26
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-H3GRHFFG.js";
|
|
27
29
|
export {
|
|
28
30
|
FileStorage,
|
|
29
31
|
LocalSessionTurnLock,
|
|
@@ -32,6 +34,8 @@ export {
|
|
|
32
34
|
SessionManager,
|
|
33
35
|
buildEntryPath,
|
|
34
36
|
buildMessagesFromEntries,
|
|
37
|
+
buildRecentMessagesFromEntries,
|
|
38
|
+
buildRecentMessagesFromEntryMap,
|
|
35
39
|
configureDefaultSessionManager,
|
|
36
40
|
createMessageEntry,
|
|
37
41
|
createMetadataEntry,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aY as DispatchRole, aX as DispatchResult, bx as LocalDispatchRuntimeOptions, C as Agent, T as Tool, aZ as DispatchRuntime, c9 as Profile } from '../instance-DV_xLU65.js';
|
|
2
2
|
import '../types-C_LCeYNg.js';
|
|
3
3
|
import 'ai';
|
|
4
4
|
import '../types-RSCv7nQ4.js';
|
package/dist/subagents/index.js
CHANGED
|
@@ -34,11 +34,11 @@ import {
|
|
|
34
34
|
parseSubAgentRoleFrontmatter,
|
|
35
35
|
parseSubAgentToolSpec,
|
|
36
36
|
toSubAgentRole
|
|
37
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-BJC46FIF.js";
|
|
38
38
|
import "../chunk-TPZ37IWI.js";
|
|
39
|
-
import "../chunk-
|
|
39
|
+
import "../chunk-HSUPTXNV.js";
|
|
40
40
|
import "../chunk-Q742PSH3.js";
|
|
41
|
-
import "../chunk-
|
|
41
|
+
import "../chunk-H3GRHFFG.js";
|
|
42
42
|
export {
|
|
43
43
|
DEFAULT_SUBAGENT_CONCURRENCY,
|
|
44
44
|
DEFAULT_SUBAGENT_DEPTH,
|
package/dist/team/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { aG as CoordinatorNotification, d1 as TaskCompletion, ds as TokenUsage, A as AgentEvent, e2 as CoordinatorCtx, C as Agent, bD as MemberRuntime, c_ as TaskBoard, bz as Mailbox, d5 as TaskDispatchMode, c0 as PermissionHandler, df as TeamCoordinatorConfig, d6 as TaskExecutor, dg as TeamEvent, dh as TeamMember, cd as QueueTaskInput, dp as TeamTask, di as TeamMessage, dk as TeamPlan, cW as SynthesisResult, dl as TeamSnapshot, d9 as TaskListFilter, bM as MessageListFilter, c8 as PreparedExternalTask, da as TaskResult, dc as TaskTransition, bE as MemberStats, bF as MemberStatus, N as AgentMiddleware, dt as ToolCallDecision } from '../instance-DV_xLU65.js';
|
|
2
|
+
export { aH as CoordinatorNotificationKind, aI as CoordinatorRoundEvent, bc as ExternalTaskControl, be as GuidancePayload, br as IdleNotificationPayload, bs as InMemoryMailboxStore, bt as InMemoryTaskBoardStore, bA as MailboxStore, bB as MailboxSubscriber, bC as MemberRegisteredEvent, bG as MemberStatusChangedEvent, bK as MessageInput, bL as MessageKind, bN as MessagePayload, bP as MessageSentEvent, bV as NotificationPriority, b$ as PermissionForwardedEvent, c1 as PermissionRequestPayload, c2 as PermissionResolvedEvent, c3 as PermissionResponsePayload, c4 as PlanCreatedEvent, c5 as PlannedTask, cx as ShutdownRequestPayload, cy as ShutdownRequestedEvent, cz as ShutdownResolvedEvent, cA as ShutdownResponsePayload, cV as SynthesisCompleteEvent, cY as TERMINAL_STATUSES, cZ as TaskAbortedEvent, c$ as TaskBoardStore, d0 as TaskCompletedEvent, d2 as TaskConflictError, d3 as TaskCreateInput, d4 as TaskCreatedEvent, d7 as TaskExecutorInput, d8 as TaskFailedEvent, db as TaskStatus, dd as TaskTransitionEvent, de as TaskTransitionReason, dj as TeamNotificationEvent, dm as TeamStartedEvent, dn as TeamStoppedEvent, dH as WorkerReportPayload, dL as buildCoordinatorNotificationEvent } from '../instance-DV_xLU65.js';
|
|
3
3
|
import { R as ReasoningLevel } from '../types-CQaXbRsS.js';
|
|
4
4
|
import '../types-C_LCeYNg.js';
|
|
5
5
|
import 'ai';
|
package/dist/tool/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { dB as ToolReplayPolicy, F as FileOperationMeta, bU as NormalizedToolReplayPolicy, T as Tool, H as HumanInputController, a as TurnTrackerContext, b as MiddlewareRunner, A as AgentEvent, dz as ToolMetadata, dv as ToolCapabilities } from '../instance-DV_xLU65.js';
|
|
2
|
+
export { aE as CompatibleSchema, bu as InferSchemaOutput, bv as InputCheckResult, dW as getRequiredToolHost, e0 as resolveCapability } from '../instance-DV_xLU65.js';
|
|
3
3
|
import { T as ToolHost } from '../types-C_LCeYNg.js';
|
|
4
4
|
export { D as DirEntry, E as ExecOptions, a as ExecResult, F as FileStat } from '../types-C_LCeYNg.js';
|
|
5
5
|
export { ToolHostProvider, ToolHostProviderSummary, ToolHostRegistry, defaultToolHostRegistry, localHost } from './host/index.js';
|
package/dist/tool/index.js
CHANGED
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
} from "../chunk-Q742PSH3.js";
|
|
18
18
|
import {
|
|
19
19
|
executeAgentToolCall
|
|
20
|
-
} from "../chunk-
|
|
21
|
-
import "../chunk-
|
|
20
|
+
} from "../chunk-MWPU2EVV.js";
|
|
21
|
+
import "../chunk-T33MQXUP.js";
|
|
22
22
|
import {
|
|
23
23
|
getRequiredToolHost,
|
|
24
24
|
resolveCapability
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'ai';
|
|
2
|
-
export { ab as AgentTurnToolContext, t as AgentTurnToolProvider, ac as AgentTurnToolProviderResult } from '../instance-
|
|
2
|
+
export { ab as AgentTurnToolContext, t as AgentTurnToolProvider, ac as AgentTurnToolProviderResult } from '../instance-DV_xLU65.js';
|
|
3
3
|
import '../types-C_LCeYNg.js';
|
|
4
4
|
import '../types-RSCv7nQ4.js';
|
|
5
5
|
import 'zod';
|