veryfront 0.1.639 → 0.1.641
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/esm/deno.js +1 -1
- package/esm/src/agent/runtime/chat-stream-handler.d.ts +1 -0
- package/esm/src/agent/runtime/chat-stream-handler.d.ts.map +1 -1
- package/esm/src/agent/runtime/chat-stream-handler.js +30 -42
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +25 -4
- package/esm/src/internal-agents/ag-ui-sse.d.ts.map +1 -1
- package/esm/src/internal-agents/ag-ui-sse.js +7 -7
- package/esm/src/platform/adapters/runtime/deno/adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/deno/adapter.js +3 -3
- package/esm/src/platform/compat/http/deno-server.d.ts.map +1 -1
- package/esm/src/platform/compat/http/deno-server.js +2 -2
- package/esm/src/platform/compat/http/native-response.d.ts +15 -0
- package/esm/src/platform/compat/http/native-response.d.ts.map +1 -1
- package/esm/src/platform/compat/http/native-response.js +16 -4
- package/esm/src/platform/compat/http/websocket.d.ts.map +1 -1
- package/esm/src/platform/compat/http/websocket.js +2 -1
- package/esm/src/rendering/orchestrator/html-project-css.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/html-project-css.js +5 -3
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/workflow/executor/workflow-executor.d.ts +4 -0
- package/esm/src/workflow/executor/workflow-executor.d.ts.map +1 -1
- package/esm/src/workflow/executor/workflow-executor.js +15 -5
- package/package.json +1 -1
package/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-stream-handler.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/chat-stream-handler.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAqB,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAqBtF,MAAM,WAAW,iBAAiB;IAChC,E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B;AAwLD,wBAAgB,iBAAiB,IAAI,eAAe,CAQnD;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,mBAAmB,EAC3B,KAAK,EAAE,eAAe,EACtB,UAAU,EAAE,+BAA+B,EAC3C,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,SAAS,CAAC,EAAE,mBAAmB,EAC/B,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"chat-stream-handler.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/chat-stream-handler.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAqB,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAqBtF,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC1C,WAAW,EAAE,mBAAmB,EAAE,CAAC;IACnC,KAAK,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CAChF;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,KAAK,IAAI,CAAC;IACX,yBAAyB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAwLD,wBAAgB,iBAAiB,IAAI,eAAe,CAQnD;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,mBAAmB,EAC3B,KAAK,EAAE,eAAe,EACtB,UAAU,EAAE,+BAA+B,EAC3C,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,SAAS,CAAC,EAAE,mBAAmB,EAC/B,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,IAAI,CAAC,CA4lBf"}
|
|
@@ -185,6 +185,8 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
185
185
|
let activeReasoningId = null;
|
|
186
186
|
let shouldStopForCommittedLocalToolCall = false;
|
|
187
187
|
let hasActiveLocalToolInput = false;
|
|
188
|
+
const providerExecutedToolNames = new Set(callbacks?.providerExecutedToolNames ?? []);
|
|
189
|
+
const resolveProviderExecuted = (toolName, providerExecuted) => providerExecuted ?? (providerExecutedToolNames.has(toolName) ? true : undefined);
|
|
188
190
|
const normalizeReasoningId = (part) => typeof part.id === "string" && part.id.length > 0 ? part.id : "reasoning";
|
|
189
191
|
const openTextSegment = () => {
|
|
190
192
|
if (textOpen) {
|
|
@@ -290,6 +292,7 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
290
292
|
};
|
|
291
293
|
const ensureToolLifecycle = (part) => {
|
|
292
294
|
const dynamic = part.dynamic ?? isDynamicTool(part.toolName);
|
|
295
|
+
const providerExecuted = resolveProviderExecuted(part.toolName, part.providerExecuted);
|
|
293
296
|
const existing = state.toolCalls.get(part.toolCallId);
|
|
294
297
|
if (!existing) {
|
|
295
298
|
const normalizedInput = parseToolInputObject(part.input);
|
|
@@ -298,9 +301,7 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
298
301
|
name: part.toolName,
|
|
299
302
|
arguments: normalizeToolInputString(part.input),
|
|
300
303
|
inputAvailable: true,
|
|
301
|
-
...(
|
|
302
|
-
? { providerExecuted: part.providerExecuted }
|
|
303
|
-
: {}),
|
|
304
|
+
...(providerExecuted !== undefined ? { providerExecuted } : {}),
|
|
304
305
|
...(dynamic ? { dynamic: true } : {}),
|
|
305
306
|
inputAnnounced: true,
|
|
306
307
|
});
|
|
@@ -315,9 +316,7 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
315
316
|
toolCallId: part.toolCallId,
|
|
316
317
|
toolName: part.toolName,
|
|
317
318
|
input: normalizedInput,
|
|
318
|
-
...(
|
|
319
|
-
? { providerExecuted: part.providerExecuted }
|
|
320
|
-
: {}),
|
|
319
|
+
...(providerExecuted !== undefined ? { providerExecuted } : {}),
|
|
321
320
|
...(dynamic ? { dynamic: true } : {}),
|
|
322
321
|
});
|
|
323
322
|
return;
|
|
@@ -331,8 +330,8 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
331
330
|
const resolvedInput = parseToolInputObject(resolvedArguments);
|
|
332
331
|
existing.arguments = resolvedArguments;
|
|
333
332
|
existing.inputAvailable = true;
|
|
334
|
-
if (
|
|
335
|
-
existing.providerExecuted =
|
|
333
|
+
if (providerExecuted !== undefined) {
|
|
334
|
+
existing.providerExecuted = providerExecuted;
|
|
336
335
|
}
|
|
337
336
|
if (dynamic) {
|
|
338
337
|
existing.dynamic = true;
|
|
@@ -429,14 +428,15 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
429
428
|
closeTextSegment();
|
|
430
429
|
closeReasoningSegment();
|
|
431
430
|
shouldStopForCommittedLocalToolCall = false;
|
|
432
|
-
hasActiveLocalToolInput = true;
|
|
433
431
|
const toolId = typedPart.id;
|
|
432
|
+
const providerExecuted = resolveProviderExecuted(typedPart.toolName, typedPart.providerExecuted);
|
|
433
|
+
hasActiveLocalToolInput = providerExecuted !== true;
|
|
434
434
|
state.toolCalls.set(toolId, {
|
|
435
435
|
id: toolId,
|
|
436
436
|
name: typedPart.toolName,
|
|
437
437
|
arguments: "",
|
|
438
438
|
inputAvailable: false,
|
|
439
|
-
providerExecuted
|
|
439
|
+
providerExecuted,
|
|
440
440
|
dynamic: typedPart.dynamic,
|
|
441
441
|
inputDeltas: [],
|
|
442
442
|
inputAnnounced: false,
|
|
@@ -488,6 +488,7 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
488
488
|
if (!toolId) {
|
|
489
489
|
break;
|
|
490
490
|
}
|
|
491
|
+
const providerExecuted = resolveProviderExecuted(typedPart.toolName, typedPart.providerExecuted);
|
|
491
492
|
hasActiveLocalToolInput = false;
|
|
492
493
|
const inputStr = normalizeToolInputString(typedPart.input);
|
|
493
494
|
const previous = state.toolCalls.get(toolId);
|
|
@@ -500,7 +501,7 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
500
501
|
name: typedPart.toolName,
|
|
501
502
|
arguments: resolvedArguments,
|
|
502
503
|
inputAvailable: true,
|
|
503
|
-
providerExecuted
|
|
504
|
+
providerExecuted,
|
|
504
505
|
dynamic,
|
|
505
506
|
});
|
|
506
507
|
if (!wasInputAvailable) {
|
|
@@ -509,13 +510,11 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
509
510
|
toolCallId: toolId,
|
|
510
511
|
toolName: typedPart.toolName,
|
|
511
512
|
input: parseToolInputObject(resolvedArguments),
|
|
512
|
-
...(
|
|
513
|
-
? { providerExecuted: typedPart.providerExecuted }
|
|
514
|
-
: {}),
|
|
513
|
+
...(providerExecuted !== undefined ? { providerExecuted } : {}),
|
|
515
514
|
...(dynamic ? { dynamic: true } : {}),
|
|
516
515
|
});
|
|
517
516
|
}
|
|
518
|
-
if (
|
|
517
|
+
if (providerExecuted !== true) {
|
|
519
518
|
shouldStopForCommittedLocalToolCall = true;
|
|
520
519
|
}
|
|
521
520
|
break;
|
|
@@ -525,6 +524,7 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
525
524
|
closeReasoningSegment();
|
|
526
525
|
// tool-call fires when the full tool call is available
|
|
527
526
|
const toolId = typedPart.toolCallId;
|
|
527
|
+
const providerExecuted = resolveProviderExecuted(typedPart.toolName, typedPart.providerExecuted);
|
|
528
528
|
hasActiveLocalToolInput = false;
|
|
529
529
|
const inputStr = normalizeToolInputString(typedPart.input);
|
|
530
530
|
const previous = state.toolCalls.get(toolId);
|
|
@@ -538,7 +538,7 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
538
538
|
inputDeltas: previous?.inputDeltas ?? [],
|
|
539
539
|
inputAnnounced: previous?.inputAnnounced ?? false,
|
|
540
540
|
inputAvailable: true,
|
|
541
|
-
providerExecuted
|
|
541
|
+
providerExecuted,
|
|
542
542
|
dynamic: typedPart.dynamic,
|
|
543
543
|
};
|
|
544
544
|
state.toolCalls.set(toolId, toolCall);
|
|
@@ -551,13 +551,11 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
551
551
|
toolCallId: toolId,
|
|
552
552
|
toolName: typedPart.toolName,
|
|
553
553
|
input: inputObj,
|
|
554
|
-
...(
|
|
555
|
-
? { providerExecuted: typedPart.providerExecuted }
|
|
556
|
-
: {}),
|
|
554
|
+
...(providerExecuted !== undefined ? { providerExecuted } : {}),
|
|
557
555
|
...(dynamic ? { dynamic: true } : {}),
|
|
558
556
|
});
|
|
559
557
|
}
|
|
560
|
-
if (
|
|
558
|
+
if (providerExecuted !== true) {
|
|
561
559
|
shouldStopForCommittedLocalToolCall = true;
|
|
562
560
|
}
|
|
563
561
|
break;
|
|
@@ -565,18 +563,19 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
565
563
|
case "tool-result": {
|
|
566
564
|
closeTextSegment();
|
|
567
565
|
closeReasoningSegment();
|
|
566
|
+
const providerExecuted = resolveProviderExecuted(typedPart.toolName, typedPart.providerExecuted);
|
|
568
567
|
ensureToolLifecycle({
|
|
569
568
|
toolCallId: typedPart.toolCallId,
|
|
570
569
|
toolName: typedPart.toolName,
|
|
571
570
|
input: typedPart.input,
|
|
572
|
-
providerExecuted
|
|
571
|
+
providerExecuted,
|
|
573
572
|
dynamic: typedPart.dynamic,
|
|
574
573
|
});
|
|
575
574
|
const isError = typedPart.isError === true;
|
|
576
575
|
logProviderToolPart("tool-result", {
|
|
577
576
|
toolCallId: typedPart.toolCallId,
|
|
578
577
|
toolName: typedPart.toolName,
|
|
579
|
-
providerExecuted
|
|
578
|
+
providerExecuted,
|
|
580
579
|
dynamic: typedPart.dynamic,
|
|
581
580
|
output: typedPart.output,
|
|
582
581
|
input: typedPart.input,
|
|
@@ -588,18 +587,14 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
588
587
|
toolCallId: typedPart.toolCallId,
|
|
589
588
|
toolName: typedPart.toolName,
|
|
590
589
|
error: typedPart.output,
|
|
591
|
-
...(
|
|
592
|
-
? { providerExecuted: typedPart.providerExecuted }
|
|
593
|
-
: {}),
|
|
590
|
+
...(providerExecuted !== undefined ? { providerExecuted } : {}),
|
|
594
591
|
...(typedPart.dynamic ? { dynamic: true } : {}),
|
|
595
592
|
});
|
|
596
593
|
sendSSE(controller, encoder, {
|
|
597
594
|
type: "tool-output-error",
|
|
598
595
|
toolCallId: typedPart.toolCallId,
|
|
599
596
|
errorText: stringifyToolError(typedPart.output),
|
|
600
|
-
...(
|
|
601
|
-
? { providerExecuted: typedPart.providerExecuted }
|
|
602
|
-
: {}),
|
|
597
|
+
...(providerExecuted !== undefined ? { providerExecuted } : {}),
|
|
603
598
|
...(typedPart.dynamic ? { dynamic: true } : {}),
|
|
604
599
|
});
|
|
605
600
|
break;
|
|
@@ -608,9 +603,7 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
608
603
|
toolCallId: typedPart.toolCallId,
|
|
609
604
|
toolName: typedPart.toolName,
|
|
610
605
|
output: typedPart.output,
|
|
611
|
-
...(
|
|
612
|
-
? { providerExecuted: typedPart.providerExecuted }
|
|
613
|
-
: {}),
|
|
606
|
+
...(providerExecuted !== undefined ? { providerExecuted } : {}),
|
|
614
607
|
...(typedPart.dynamic ? { dynamic: true } : {}),
|
|
615
608
|
...(typedPart.preliminary !== undefined ? { preliminary: typedPart.preliminary } : {}),
|
|
616
609
|
});
|
|
@@ -618,9 +611,7 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
618
611
|
type: "tool-output-available",
|
|
619
612
|
toolCallId: typedPart.toolCallId,
|
|
620
613
|
output: typedPart.output,
|
|
621
|
-
...(
|
|
622
|
-
? { providerExecuted: typedPart.providerExecuted }
|
|
623
|
-
: {}),
|
|
614
|
+
...(providerExecuted !== undefined ? { providerExecuted } : {}),
|
|
624
615
|
...(typedPart.dynamic ? { dynamic: true } : {}),
|
|
625
616
|
...(typedPart.preliminary !== undefined ? { preliminary: typedPart.preliminary } : {}),
|
|
626
617
|
});
|
|
@@ -629,17 +620,18 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
629
620
|
case "tool-error": {
|
|
630
621
|
closeTextSegment();
|
|
631
622
|
closeReasoningSegment();
|
|
623
|
+
const providerExecuted = resolveProviderExecuted(typedPart.toolName, typedPart.providerExecuted);
|
|
632
624
|
ensureToolLifecycle({
|
|
633
625
|
toolCallId: typedPart.toolCallId,
|
|
634
626
|
toolName: typedPart.toolName,
|
|
635
627
|
input: typedPart.input,
|
|
636
|
-
providerExecuted
|
|
628
|
+
providerExecuted,
|
|
637
629
|
dynamic: typedPart.dynamic,
|
|
638
630
|
});
|
|
639
631
|
logProviderToolPart("tool-error", {
|
|
640
632
|
toolCallId: typedPart.toolCallId,
|
|
641
633
|
toolName: typedPart.toolName,
|
|
642
|
-
providerExecuted
|
|
634
|
+
providerExecuted,
|
|
643
635
|
dynamic: typedPart.dynamic,
|
|
644
636
|
error: typedPart.error,
|
|
645
637
|
input: typedPart.input,
|
|
@@ -648,18 +640,14 @@ export function processStream(result, state, controller, encoder, textPartId, ca
|
|
|
648
640
|
toolCallId: typedPart.toolCallId,
|
|
649
641
|
toolName: typedPart.toolName,
|
|
650
642
|
error: typedPart.error,
|
|
651
|
-
...(
|
|
652
|
-
? { providerExecuted: typedPart.providerExecuted }
|
|
653
|
-
: {}),
|
|
643
|
+
...(providerExecuted !== undefined ? { providerExecuted } : {}),
|
|
654
644
|
...(typedPart.dynamic ? { dynamic: true } : {}),
|
|
655
645
|
});
|
|
656
646
|
sendSSE(controller, encoder, {
|
|
657
647
|
type: "tool-output-error",
|
|
658
648
|
toolCallId: typedPart.toolCallId,
|
|
659
649
|
errorText: stringifyToolError(typedPart.error),
|
|
660
|
-
...(
|
|
661
|
-
? { providerExecuted: typedPart.providerExecuted }
|
|
662
|
-
: {}),
|
|
650
|
+
...(providerExecuted !== undefined ? { providerExecuted } : {}),
|
|
663
651
|
...(typedPart.dynamic ? { dynamic: true } : {}),
|
|
664
652
|
});
|
|
665
653
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAGlB,KAAK,OAAO,EACZ,KAAK,WAAW,EAEh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C;KACd,CAAC;IAIF;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAGnC"}
|
|
@@ -98,6 +98,20 @@ function createToolErrorMessage(toolCallId, toolName, error) {
|
|
|
98
98
|
timestamp: Date.now(),
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
+
function getProviderExecutedToolNames(runtimeTools) {
|
|
102
|
+
if (!runtimeTools) {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
return Object.entries(runtimeTools).flatMap(([toolName, definition]) => {
|
|
106
|
+
if (definition &&
|
|
107
|
+
typeof definition === "object" &&
|
|
108
|
+
"type" in definition &&
|
|
109
|
+
definition.type === "provider") {
|
|
110
|
+
return [toolName];
|
|
111
|
+
}
|
|
112
|
+
return [];
|
|
113
|
+
});
|
|
114
|
+
}
|
|
101
115
|
export function collectFinalStreamToolResults(state) {
|
|
102
116
|
const finalToolResults = new Map();
|
|
103
117
|
for (const toolResult of state.toolResults) {
|
|
@@ -829,14 +843,15 @@ export class AgentRuntime {
|
|
|
829
843
|
tools = filterToolsForSkill(tools, activeSkillPolicy);
|
|
830
844
|
}
|
|
831
845
|
const modelSystemPrompt = appendCurrentRunToolStateToSystemPrompt(currentSystemPrompt, currentRunToolState);
|
|
846
|
+
const runtimeTools = convertToolsToRuntimeTools(tools, {
|
|
847
|
+
model: effectiveModel,
|
|
848
|
+
allowedToolNames: allowedRemoteToolNames,
|
|
849
|
+
});
|
|
832
850
|
const result = streamText({
|
|
833
851
|
model: languageModel,
|
|
834
852
|
system: modelSystemPrompt,
|
|
835
853
|
messages: convertToTextGenerationRuntimeMessages(currentMessages),
|
|
836
|
-
tools:
|
|
837
|
-
model: effectiveModel,
|
|
838
|
-
allowedToolNames: allowedRemoteToolNames,
|
|
839
|
-
}),
|
|
854
|
+
tools: runtimeTools,
|
|
840
855
|
experimental_repairToolCall: repairToolCall,
|
|
841
856
|
maxOutputTokens: this.resolveMaxOutputTokens(effectiveModel, maxOutputTokensOverride),
|
|
842
857
|
temperature: DEFAULT_TEMPERATURE,
|
|
@@ -848,6 +863,7 @@ export class AgentRuntime {
|
|
|
848
863
|
await processStream(result, state, controller, encoder, textPartId, {
|
|
849
864
|
onChunk: callbacks?.onChunk,
|
|
850
865
|
onUsage: (usage) => accumulateUsage(totalUsage, usage),
|
|
866
|
+
providerExecutedToolNames: getProviderExecutedToolNames(runtimeTools),
|
|
851
867
|
}, abortSignal);
|
|
852
868
|
throwIfAborted(abortSignal);
|
|
853
869
|
finalFinishReason = state.finishReason ?? finalFinishReason;
|
|
@@ -992,6 +1008,11 @@ export class AgentRuntime {
|
|
|
992
1008
|
toolCalls.push(toolCall);
|
|
993
1009
|
continue;
|
|
994
1010
|
}
|
|
1011
|
+
if (tc.providerExecuted === true) {
|
|
1012
|
+
toolCall.status = "completed";
|
|
1013
|
+
toolCalls.push(toolCall);
|
|
1014
|
+
continue;
|
|
1015
|
+
}
|
|
995
1016
|
if (capturedInput.parseError) {
|
|
996
1017
|
logger.warn("Invalid streamed tool arguments", {
|
|
997
1018
|
toolCallId: tc.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ag-ui-sse.d.ts","sourceRoot":"","sources":["../../../src/src/internal-agents/ag-ui-sse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,8BAA8B,EAC9B,sBAAsB,EACvB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAEL,yBAAyB,EAE1B,MAAM,mCAAmC,CAAC;AAM3C,KAAK,gBAAgB,GAAG,sBAAsB,CAAC;AAC/C,MAAM,MAAM,mBAAmB,GAAG,8BAA8B,CAAC;AACjE,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAC3D,MAAM,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAEtD,wBAAgB,0BAA0B,IAAI,oBAAoB,CAEjE;
|
|
1
|
+
{"version":3,"file":"ag-ui-sse.d.ts","sourceRoot":"","sources":["../../../src/src/internal-agents/ag-ui-sse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,8BAA8B,EAC9B,sBAAsB,EACvB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAEL,yBAAyB,EAE1B,MAAM,mCAAmC,CAAC;AAM3C,KAAK,gBAAgB,GAAG,sBAAsB,CAAC;AAC/C,MAAM,MAAM,mBAAmB,GAAG,8BAA8B,CAAC;AACjE,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAC3D,MAAM,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAEtD,wBAAgB,0BAA0B,IAAI,oBAAoB,CAEjE;AAmFD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,CAK3F;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG;IACjD,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB,CAMA;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,oBAAoB,EAC3B,KAAK,EAAE,gBAAgB,GACtB,eAAe,EAAE,CAEnB;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,oBAAoB,EAC3B,QAAQ,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,GACxD,eAAe,EAAE,CAEnB"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { parseDataStreamSseEvents } from "../agent/streaming/data-stream.js";
|
|
2
2
|
import { createAgUiBrowserEncoderState, finalizeAgUiBrowserEvents, mapRuntimeStreamEventToAgUiBrowserEvents, } from "../agent/ag-ui/browser-encoder.js";
|
|
3
|
-
import {
|
|
3
|
+
import { resolveSchemaValidator } from "../schemas/define.js";
|
|
4
4
|
const encoder = new TextEncoder();
|
|
5
5
|
export function createStreamTransformState() {
|
|
6
6
|
return createAgUiBrowserEncoderState();
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
function buildAgUiEventPayloadSchemas() {
|
|
9
|
+
const v = resolveSchemaValidator();
|
|
9
10
|
const schemas = {
|
|
10
11
|
RunStarted: v.object({
|
|
11
12
|
runId: v.string().min(1),
|
|
@@ -51,15 +52,14 @@ const getAgUiEventPayloadSchemas = defineSchema((v) => {
|
|
|
51
52
|
}),
|
|
52
53
|
}),
|
|
53
54
|
};
|
|
54
|
-
// Return a record schema that validates to any - we only use this for per-key lookups
|
|
55
55
|
return schemas;
|
|
56
|
-
}
|
|
57
|
-
//
|
|
56
|
+
}
|
|
57
|
+
// Lazily build and memoize the per-event payload schema map. Built on first use
|
|
58
|
+
// so the SchemaValidator extension is resolved only once it is needed.
|
|
58
59
|
let _agUiEventPayloadSchemas = null;
|
|
59
60
|
function resolveAgUiEventPayloadSchemas() {
|
|
60
61
|
if (!_agUiEventPayloadSchemas) {
|
|
61
|
-
|
|
62
|
-
_agUiEventPayloadSchemas = getAgUiEventPayloadSchemas();
|
|
62
|
+
_agUiEventPayloadSchemas = buildAgUiEventPayloadSchemas();
|
|
63
63
|
}
|
|
64
64
|
return _agUiEventPayloadSchemas;
|
|
65
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/runtime/deno/adapter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,QAAQ,EACR,kBAAkB,EAElB,QAAQ,EACR,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,MAAM,EACN,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,gBAAgB,EACjB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/runtime/deno/adapter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,QAAQ,EACR,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C,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAGnC;AAED,cAAM,iBAAkB,YAAW,aAAa;IAC9C,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB;CAYrD;AAED,cAAM,gBAAiB,YAAW,YAAY;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE;IAejE,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAanC;AAwBD,qBAAa,WAAY,YAAW,cAAc;IAChD,QAAQ,CAAC,EAAE,EAAG,MAAM,CAAU;IAC9B,QAAQ,CAAC,IAAI,UAAU;IACvB,QAAQ,CAAC,EAAE,wBAA+B;IAC1C,QAAQ,CAAC,GAAG,yBAAgC;IAC5C,QAAQ,CAAC,MAAM,oBAA2B;IAC1C,QAAQ,CAAC,KAAK,mBAA0B;IAExC,QAAQ,CAAC,YAAY;;;;;;;;;;MAUnB;IAEF,OAAO,CAAC,YAAY,CAA2B;IAE/C,KAAK,CACH,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,EAC3D,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,MAAM,CAAC;IA4DZ,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAGhC;AAED,eAAO,MAAM,WAAW,aAAoB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { serverLogger } from "../../../../utils/index.js";
|
|
|
5
5
|
import { env as getEnvObject, getEnv, getEnvOverlayStorage, setEnv, } from "../../../compat/process.js";
|
|
6
6
|
import { createFileWatcher, createWatcherIterator, enqueueWatchEvent, } from "../shared/watcher-queue.js";
|
|
7
7
|
import { stopManagedServer } from "../shared/server-lifecycle.js";
|
|
8
|
-
import { getNativeResponse, toNativeResponse } from "../../../compat/http/native-response.js";
|
|
8
|
+
import { getNativeDeno, getNativeResponse, toNativeResponse, } from "../../../compat/http/native-response.js";
|
|
9
9
|
const logger = serverLogger.component("deno");
|
|
10
10
|
/** Default server port. Defined locally to keep adapters module isolated. */
|
|
11
11
|
const DEFAULT_PORT = 3000;
|
|
@@ -215,7 +215,7 @@ class DenoServerAdapter {
|
|
|
215
215
|
upgradeWebSocket(request) {
|
|
216
216
|
// Access native Deno via `self` to bypass dnt shim transform.
|
|
217
217
|
// dnt rewrites `globalThis.Deno` to @deno/shim-deno, which lacks upgradeWebSocket.
|
|
218
|
-
const nativeDeno =
|
|
218
|
+
const nativeDeno = getNativeDeno();
|
|
219
219
|
if (typeof nativeDeno?.upgradeWebSocket !== "function") {
|
|
220
220
|
throw NOT_SUPPORTED.create({
|
|
221
221
|
detail: "DenoServerAdapter.upgradeWebSocket() can only be used in Deno runtime",
|
|
@@ -317,7 +317,7 @@ export class DenoAdapter {
|
|
|
317
317
|
// Access native Deno.serve via `self` to bypass dnt shim transform.
|
|
318
318
|
// dnt rewrites both `Deno.*` and `globalThis.*` to use @deno/shim-deno which lacks .serve.
|
|
319
319
|
// `self` is not shimmed by dnt and equals `globalThis` in Deno.
|
|
320
|
-
const nativeDeno =
|
|
320
|
+
const nativeDeno = getNativeDeno();
|
|
321
321
|
// Access native Response via `self` to bypass dnt shim transform.
|
|
322
322
|
// In npm packages, dnt replaces Response with undici's polyfill,
|
|
323
323
|
// but Deno.serve requires native Response instances.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deno-server.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/http/deno-server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deno-server.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/http/deno-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAIpE,qBAAa,cAAe,YAAW,UAAU;IAC/C,OAAO,CAAC,eAAe,CAAC,CAAkB;IAEpC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgCxE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAIvB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LOCALHOST } from "../constants.js";
|
|
2
|
-
import { getNativeResponse, toNativeResponse } from "./native-response.js";
|
|
2
|
+
import { getNativeDeno, getNativeResponse, toNativeResponse } from "./native-response.js";
|
|
3
3
|
export class DenoHttpServer {
|
|
4
4
|
abortController;
|
|
5
5
|
async serve(handler, options = {}) {
|
|
@@ -8,7 +8,7 @@ export class DenoHttpServer {
|
|
|
8
8
|
const serveSignal = signal ?? this.abortController.signal;
|
|
9
9
|
onListen?.({ hostname, port });
|
|
10
10
|
// Access native Deno.serve via `self` to bypass dnt shim transform.
|
|
11
|
-
const nativeDeno =
|
|
11
|
+
const nativeDeno = getNativeDeno();
|
|
12
12
|
// Access native Response via `self` to bypass dnt shim transform.
|
|
13
13
|
// In npm packages, dnt replaces Response with undici's polyfill,
|
|
14
14
|
// but Deno.serve requires native Response instances.
|
|
@@ -16,7 +16,22 @@
|
|
|
16
16
|
* The native `Response` constructor, accessed via `self` to bypass the dnt
|
|
17
17
|
* shim transform (dnt rewrites bare `Response` to undici's polyfill).
|
|
18
18
|
*/
|
|
19
|
+
import * as dntShim from "../../../../_dnt.shims.js";
|
|
19
20
|
export declare function getNativeResponse(): typeof Response;
|
|
21
|
+
/**
|
|
22
|
+
* The native `Deno` namespace, accessed via `self` to bypass the dnt shim
|
|
23
|
+
* transform.
|
|
24
|
+
*
|
|
25
|
+
* In npm packages, dnt rewrites both `Deno.*` and `globalThis.Deno` to use
|
|
26
|
+
* `@deno/shim-deno`, which lacks native APIs such as `Deno.serve` and
|
|
27
|
+
* `Deno.upgradeWebSocket`. `self` is not shimmed by dnt and equals
|
|
28
|
+
* `globalThis` in Deno, so it yields the genuine native namespace.
|
|
29
|
+
*
|
|
30
|
+
* Returns `undefined` when no native `Deno` is present (e.g. Node without the
|
|
31
|
+
* shim), allowing callers to guard. Callers that have already established the
|
|
32
|
+
* Deno runtime can use a non-null assertion on the result.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getNativeDeno(): typeof dntShim.Deno | undefined;
|
|
20
35
|
/**
|
|
21
36
|
* Re-wrap a (possibly polyfilled) `Response` as a native `Response` so it can be
|
|
22
37
|
* returned from `Deno.serve`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-response.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/http/native-response.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,QAAQ,CAEnD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,OAAO,QAAQ,GAC9B,QAAQ,CAYV"}
|
|
1
|
+
{"version":3,"file":"native-response.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/http/native-response.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,OAAO,KAAK,OAAO,MAAM,2BAA2B,CAAC;AAErD,wBAAgB,iBAAiB,IAAI,OAAO,QAAQ,CAEnD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,IAAI,OAAO,OAAO,CAAC,IAAI,GAAG,SAAS,CAE/D;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,OAAO,QAAQ,GAC9B,QAAQ,CAYV"}
|
|
@@ -12,13 +12,25 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @module platform/compat/http/native-response
|
|
14
14
|
*/
|
|
15
|
-
/**
|
|
16
|
-
* The native `Response` constructor, accessed via `self` to bypass the dnt
|
|
17
|
-
* shim transform (dnt rewrites bare `Response` to undici's polyfill).
|
|
18
|
-
*/
|
|
19
15
|
export function getNativeResponse() {
|
|
20
16
|
return self.Response;
|
|
21
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* The native `Deno` namespace, accessed via `self` to bypass the dnt shim
|
|
20
|
+
* transform.
|
|
21
|
+
*
|
|
22
|
+
* In npm packages, dnt rewrites both `Deno.*` and `globalThis.Deno` to use
|
|
23
|
+
* `@deno/shim-deno`, which lacks native APIs such as `Deno.serve` and
|
|
24
|
+
* `Deno.upgradeWebSocket`. `self` is not shimmed by dnt and equals
|
|
25
|
+
* `globalThis` in Deno, so it yields the genuine native namespace.
|
|
26
|
+
*
|
|
27
|
+
* Returns `undefined` when no native `Deno` is present (e.g. Node without the
|
|
28
|
+
* shim), allowing callers to guard. Callers that have already established the
|
|
29
|
+
* Deno runtime can use a non-null assertion on the result.
|
|
30
|
+
*/
|
|
31
|
+
export function getNativeDeno() {
|
|
32
|
+
return self["Deno"];
|
|
33
|
+
}
|
|
22
34
|
/**
|
|
23
35
|
* Re-wrap a (possibly polyfilled) `Response` as a native `Response` so it can be
|
|
24
36
|
* returned from `Deno.serve`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/http/websocket.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/http/websocket.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAIlF,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,uBAAuB,GAChC,sBAAsB,CASxB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAE5D"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isDeno } from "../runtime.js";
|
|
2
|
+
import { getNativeDeno } from "./native-response.js";
|
|
2
3
|
import { NOT_SUPPORTED } from "../../../errors/index.js";
|
|
3
4
|
export function upgradeWebSocket(request, options) {
|
|
4
5
|
if (!isDeno) {
|
|
@@ -15,7 +16,7 @@ export function isWebSocketUpgrade(request) {
|
|
|
15
16
|
function upgradeWebSocketDeno(request, options) {
|
|
16
17
|
// Access native Deno via `self` to bypass dnt shim transform.
|
|
17
18
|
// dnt rewrites `globalThis.Deno` to @deno/shim-deno, which lacks upgradeWebSocket.
|
|
18
|
-
const nativeDeno =
|
|
19
|
+
const nativeDeno = getNativeDeno();
|
|
19
20
|
if (typeof nativeDeno?.upgradeWebSocket !== "function") {
|
|
20
21
|
throw NOT_SUPPORTED.create({
|
|
21
22
|
detail: "Deno.upgradeWebSocket() is not available in this runtime.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-project-css.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/html-project-css.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,gDAAgD,CAAC;AAClG,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"html-project-css.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/html-project-css.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAA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AAgB,EAAE,SAAS,GAAG,MAAM,CAAC,EAClD,IAAI,GAAE,IAAI,CAAC,cAAc,EAAE,4BAA4B,CAAM,GAC5D,MAAM,GAAG,SAAS,CAiBpB;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,qBAAqB,EAC9B,WAAW,EAAE,qBAAqB,EAClC,IAAI,GAAE,IAAI,CAAC,cAAc,EAAE,eAAe,CAAM,GAC/C,OAAO,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAkBvC;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,qBAAqB,EAC9B,WAAW,EAAE,qBAAqB,EAClC,IAAI,GAAE,IAAI,CACR,cAAc,EACd,yBAAyB,GAAG,0BAA0B,GAAG,kCAAkC,CACvF,GACL,IAAI,CAyCN;AAED,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,qBAAqB,EAC9B,gBAAgB,CAAC,EAAE,MAAM,EACzB,IAAI,GAAE,IAAI,CACR,cAAc,EACd,yBAAyB,GAAG,0BAA0B,GAAG,oBAAoB,CACzE,GACL,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CA+CtB"}
|
|
@@ -6,11 +6,13 @@ import { rendererLogger } from "../../utils/index.js";
|
|
|
6
6
|
import { extractRelativePath } from "../../utils/route-path-utils.js";
|
|
7
7
|
import { getRouteCandidates } from "./css-candidate-manifest.js";
|
|
8
8
|
const logger = rendererLogger.component("html-project-css");
|
|
9
|
+
function hasUnderlyingAdapter(fs) {
|
|
10
|
+
return typeof fs.getUnderlyingAdapter === "function";
|
|
11
|
+
}
|
|
9
12
|
function getUnderlyingFsAdapter(adapter) {
|
|
10
|
-
|
|
11
|
-
if (typeof wrappedFs.getUnderlyingAdapter !== "function")
|
|
13
|
+
if (!hasUnderlyingAdapter(adapter.fs))
|
|
12
14
|
return undefined;
|
|
13
|
-
return
|
|
15
|
+
return adapter.fs.getUnderlyingAdapter();
|
|
14
16
|
}
|
|
15
17
|
export function buildRouteManifestKey(pagePath, projectDir) {
|
|
16
18
|
const relativePagePath = extractRelativePath(pagePath, projectDir);
|
|
@@ -115,6 +115,10 @@ export declare class WorkflowExecutor {
|
|
|
115
115
|
* Mark run as waiting
|
|
116
116
|
*/
|
|
117
117
|
private pauseRun;
|
|
118
|
+
/**
|
|
119
|
+
* Remove execution-only metadata before exposing or persisting workflow context.
|
|
120
|
+
*/
|
|
121
|
+
private toPublicContext;
|
|
118
122
|
/**
|
|
119
123
|
* Determine workflow output from context
|
|
120
124
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-executor.d.ts","sourceRoot":"","sources":["../../../../src/src/workflow/executor/workflow-executor.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAKV,kBAAkB,EAElB,WAAW,EACX,cAAc,EACf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAM5E,OAAO,EAAuC,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAElG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAOpD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,8BAA8B;IAC9B,OAAO,EAAE,eAAe,CAAC;IACzB,kCAAkC;IAClC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,kCAAkC;IAClC,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oCAAoC;IACpC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,CAAC;IACrC,uCAAuC;I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BAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS;IAIjE;;OAEG;IACG,KAAK,CAAC,MAAM,EAAE,OAAO,EACzB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3B,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAqDnC;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqCnE;;;;;OAKG;IACG,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuHxE;;OAEG;IACH,OAAO,CAAC,YAAY;IAcpB;;OAEG;IACH,OAAO,CAAC,aAAa;IAmDrB;;;;;OAKG;YACW,kBAAkB;IAmBhC;;OAEG;YACW,WAAW;
|
|
1
|
+
{"version":3,"file":"workflow-executor.d.ts","sourceRoot":"","sources":["../../../../src/src/workflow/executor/workflow-executor.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAKV,kBAAkB,EAElB,WAAW,EACX,cAAc,EACf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAM5E,OAAO,EAAuC,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAElG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAOpD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,8BAA8B;IAC9B,OAAO,EAAE,eAAe,CAAC;IACzB,kCAAkC;IAClC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,kCAAkC;IAClC,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,2BAA2B;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AEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,cAAc,GAAG,cAAc,EAAE,CAAC;QAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAO3B"}
|
|
@@ -363,11 +363,12 @@ export class WorkflowExecutor {
|
|
|
363
363
|
* Mark run as completed
|
|
364
364
|
*/
|
|
365
365
|
async completeRun(runId, context, nodeStates) {
|
|
366
|
-
const
|
|
366
|
+
const publicContext = this.toPublicContext(context);
|
|
367
|
+
const output = this.determineOutput(publicContext);
|
|
367
368
|
await this.config.backend.updateRun(runId, {
|
|
368
369
|
status: "completed",
|
|
369
370
|
output,
|
|
370
|
-
context,
|
|
371
|
+
context: publicContext,
|
|
371
372
|
nodeStates,
|
|
372
373
|
completedAt: new Date(),
|
|
373
374
|
});
|
|
@@ -377,9 +378,10 @@ export class WorkflowExecutor {
|
|
|
377
378
|
* Mark run as failed
|
|
378
379
|
*/
|
|
379
380
|
async failRun(runId, error, context, nodeStates) {
|
|
381
|
+
const publicContext = this.toPublicContext(context);
|
|
380
382
|
await this.config.backend.updateRun(runId, {
|
|
381
383
|
status: "failed",
|
|
382
|
-
context,
|
|
384
|
+
context: publicContext,
|
|
383
385
|
nodeStates,
|
|
384
386
|
error: {
|
|
385
387
|
message: error.message,
|
|
@@ -392,18 +394,26 @@ export class WorkflowExecutor {
|
|
|
392
394
|
* Mark run as waiting
|
|
393
395
|
*/
|
|
394
396
|
async pauseRun(runId, waitingNode, context, nodeStates) {
|
|
397
|
+
const publicContext = this.toPublicContext(context);
|
|
395
398
|
await this.config.backend.updateRun(runId, {
|
|
396
399
|
status: "waiting",
|
|
397
400
|
currentNodes: [waitingNode],
|
|
398
|
-
context,
|
|
401
|
+
context: publicContext,
|
|
399
402
|
nodeStates,
|
|
400
403
|
});
|
|
401
404
|
}
|
|
405
|
+
/**
|
|
406
|
+
* Remove execution-only metadata before exposing or persisting workflow context.
|
|
407
|
+
*/
|
|
408
|
+
toPublicContext(context) {
|
|
409
|
+
const { _tenant: _tenant, ...publicContext } = context;
|
|
410
|
+
return publicContext;
|
|
411
|
+
}
|
|
402
412
|
/**
|
|
403
413
|
* Determine workflow output from context
|
|
404
414
|
*/
|
|
405
415
|
determineOutput(context) {
|
|
406
|
-
const { input: _input, ...rest } = context;
|
|
416
|
+
const { input: _input, _tenant: _tenant, ...rest } = context;
|
|
407
417
|
return rest;
|
|
408
418
|
}
|
|
409
419
|
/**
|