stitchkit 0.60.1 → 0.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-runtime/compaction.d.ts.map +1 -1
- package/dist/agent-runtime/coordinator.d.ts +17 -2
- package/dist/agent-runtime/coordinator.d.ts.map +1 -1
- package/dist/agent-runtime/events.d.ts +16 -0
- package/dist/agent-runtime/events.d.ts.map +1 -1
- package/dist/agent-runtime/history.d.ts +39 -1
- package/dist/agent-runtime/history.d.ts.map +1 -1
- package/dist/agent-runtime/observability.d.ts +2 -0
- package/dist/agent-runtime/observability.d.ts.map +1 -1
- package/dist/agent-runtime/prompt.d.ts +1 -1
- package/dist/agent-runtime/prompt.d.ts.map +1 -1
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-internals.d.ts +47 -0
- package/dist/agent-runtime/runtime-internals.d.ts.map +1 -1
- package/dist/agent-runtime/runtime.d.ts +1 -0
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/schemas.d.ts +9 -0
- package/dist/agent-runtime/schemas.d.ts.map +1 -1
- package/dist/agent-runtime/store-driver.d.ts +11 -0
- package/dist/agent-runtime/store-driver.d.ts.map +1 -1
- package/dist/agent-runtime/store.d.ts +27 -0
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/agent-runtime/terminal-commit.d.ts +3 -3
- package/dist/agent-runtime/terminal-commit.d.ts.map +1 -1
- package/dist/agent-runtime/terminal-status.d.ts +13 -0
- package/dist/agent-runtime/terminal-status.d.ts.map +1 -1
- package/dist/agent-runtime.js +251 -82
- package/dist/application/kernel.d.ts +23 -0
- package/dist/application/kernel.d.ts.map +1 -1
- package/dist/application/server-resource.d.ts.map +1 -1
- package/dist/application.d.ts +1 -1
- package/dist/application.d.ts.map +1 -1
- package/dist/application.js +11 -6
- package/dist/browser/socket-io.d.ts +47 -0
- package/dist/browser/socket-io.d.ts.map +1 -1
- package/dist/browser/stream.d.ts +23 -0
- package/dist/browser/stream.d.ts.map +1 -1
- package/dist/contract/index.js +1 -1
- package/dist/{index-t8xrqc9g.js → index-413xk7ga.js} +1 -1
- package/dist/{index-vtjgx3vv.js → index-58vkx74h.js} +3 -0
- package/dist/{index-82e74yfx.js → index-eabpd4tb.js} +56 -7
- package/dist/{index-2cgbdckv.js → index-s1tywej8.js} +88 -19
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +213 -17
- package/dist/internal/optional-peer.d.ts +14 -0
- package/dist/internal/optional-peer.d.ts.map +1 -0
- package/dist/node.js +1 -1
- package/dist/realtime/contract.d.ts +7 -1
- package/dist/realtime/contract.d.ts.map +1 -1
- package/dist/realtime/index.d.ts +2 -1
- package/dist/realtime/index.d.ts.map +1 -1
- package/dist/realtime/rejected-frame.d.ts +86 -0
- package/dist/realtime/rejected-frame.d.ts.map +1 -0
- package/dist/realtime/request.d.ts +24 -0
- package/dist/realtime/request.d.ts.map +1 -1
- package/dist/realtime/socket.d.ts.map +1 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +196 -3
- package/dist/server/socket-io.d.ts.map +1 -1
- package/dist/server/stream.d.ts.map +1 -1
- package/dist/server/streaming-route.d.ts +130 -0
- package/dist/server/streaming-route.d.ts.map +1 -0
- package/dist/testing.js +2 -2
- package/llms-full.txt +630 -31
- package/package.json +2 -2
package/dist/agent-runtime.js
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
AgentToolResultPartSchema,
|
|
30
30
|
AgentUsageSchema,
|
|
31
31
|
AgentUsageValueSchema
|
|
32
|
-
} from "./index-
|
|
32
|
+
} from "./index-58vkx74h.js";
|
|
33
33
|
import"./index-6djpbnda.js";
|
|
34
34
|
import"./index-cby4ar3v.js";
|
|
35
35
|
import {
|
|
@@ -45,14 +45,28 @@ import {
|
|
|
45
45
|
import"./index-smpbdg6k.js";
|
|
46
46
|
import"./index-xxye8j3k.js";
|
|
47
47
|
|
|
48
|
+
// src/agent-runtime/terminal-status.ts
|
|
49
|
+
function isSpeakableAssistantStatus(status) {
|
|
50
|
+
return status === "completed" || status === "interrupted" || status === "committed";
|
|
51
|
+
}
|
|
52
|
+
function assistantStatus(reason) {
|
|
53
|
+
if (reason === "success" || reason === "policy_stop")
|
|
54
|
+
return "completed";
|
|
55
|
+
if (reason === "superseded")
|
|
56
|
+
return "superseded";
|
|
57
|
+
if (reason === "interrupted" || reason === "cancelled" || reason === "shutdown") {
|
|
58
|
+
return "interrupted";
|
|
59
|
+
}
|
|
60
|
+
return "failed";
|
|
61
|
+
}
|
|
62
|
+
|
|
48
63
|
// src/agent-runtime/compaction.ts
|
|
49
64
|
function providerValidTurn(messages) {
|
|
50
65
|
if (messages[0]?.role !== "user")
|
|
51
66
|
return false;
|
|
52
67
|
const assistant = messages.find((message) => message.role === "assistant");
|
|
53
|
-
if (!assistant || assistant.status
|
|
68
|
+
if (!assistant || !isSpeakableAssistantStatus(assistant.status))
|
|
54
69
|
return false;
|
|
55
|
-
}
|
|
56
70
|
const calls = new Set(assistant.parts.filter((part) => part.type === "tool-call").map((part) => part.callId));
|
|
57
71
|
const results = new Set(assistant.parts.filter((part) => part.type === "tool-result").map((part) => part.callId));
|
|
58
72
|
return [...calls].every((callId) => results.has(callId)) && [...results].every((callId) => calls.has(callId));
|
|
@@ -226,6 +240,8 @@ function createAgentSessionCoordinator() {
|
|
|
226
240
|
};
|
|
227
241
|
if (input.policy === "interrupt")
|
|
228
242
|
lane.active?.controller.abort("user-interrupt");
|
|
243
|
+
if (input.policy === "supersede")
|
|
244
|
+
lane.active?.controller.abort("supersede");
|
|
229
245
|
lane.queue.push(pending);
|
|
230
246
|
startNext(input.key, lane);
|
|
231
247
|
return { accepted: accepted.promise, result: result.promise };
|
|
@@ -428,11 +444,34 @@ function textContent(parts) {
|
|
|
428
444
|
return parts.filter((part) => part.type === "text").map((part) => part.text).join(`
|
|
429
445
|
`);
|
|
430
446
|
}
|
|
447
|
+
function unrepresented(parts, rendered) {
|
|
448
|
+
const missing = new Set;
|
|
449
|
+
for (const part of parts) {
|
|
450
|
+
if (!rendered.has(part.type))
|
|
451
|
+
missing.add(part.type);
|
|
452
|
+
}
|
|
453
|
+
return [...missing];
|
|
454
|
+
}
|
|
455
|
+
function decide(message, action, reason, rendered) {
|
|
456
|
+
if (action === "omitted" || !rendered)
|
|
457
|
+
return { messageId: message.id, action, reason };
|
|
458
|
+
const omittedParts = unrepresented(message.parts, rendered);
|
|
459
|
+
return {
|
|
460
|
+
messageId: message.id,
|
|
461
|
+
action,
|
|
462
|
+
reason,
|
|
463
|
+
...omittedParts.length > 0 && { omittedParts }
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
var INTERRUPTION_NOTE = "[interrupted: this turn was cut off before it finished]";
|
|
431
467
|
async function userMessage(message, options) {
|
|
468
|
+
const rendered = new Set;
|
|
432
469
|
const text = textContent(message.parts);
|
|
433
470
|
const content = [];
|
|
434
|
-
if (text)
|
|
471
|
+
if (text) {
|
|
435
472
|
content.push({ type: "text", text });
|
|
473
|
+
rendered.add("text");
|
|
474
|
+
}
|
|
436
475
|
for (const part of message.parts) {
|
|
437
476
|
if (part.type !== "file")
|
|
438
477
|
continue;
|
|
@@ -443,6 +482,7 @@ async function userMessage(message, options) {
|
|
|
443
482
|
mediaType: part.mediaType,
|
|
444
483
|
...part.filename && { filename: part.filename }
|
|
445
484
|
});
|
|
485
|
+
rendered.add("file");
|
|
446
486
|
continue;
|
|
447
487
|
}
|
|
448
488
|
const fallback = options.unresolvedFile ?? "omit";
|
|
@@ -455,24 +495,29 @@ async function userMessage(message, options) {
|
|
|
455
495
|
type: "text",
|
|
456
496
|
text: described ? `[attachment: ${described}]` : "[attachment]"
|
|
457
497
|
});
|
|
498
|
+
rendered.add("file");
|
|
458
499
|
}
|
|
459
500
|
}
|
|
460
501
|
if (content.length === 0)
|
|
461
|
-
return;
|
|
462
|
-
return modelMessageSchema.parse({ role: "user", content });
|
|
502
|
+
return { rendered };
|
|
503
|
+
return { message: modelMessageSchema.parse({ role: "user", content }), rendered };
|
|
463
504
|
}
|
|
464
|
-
function assistantMessages(message) {
|
|
505
|
+
function assistantMessages(message, interrupted) {
|
|
506
|
+
const rendered = new Set;
|
|
465
507
|
const assistantContent = [];
|
|
466
508
|
const toolContent = [];
|
|
467
509
|
for (const part of message.parts) {
|
|
468
|
-
if (part.type === "text")
|
|
510
|
+
if (part.type === "text") {
|
|
469
511
|
assistantContent.push({ type: "text", text: part.text });
|
|
512
|
+
rendered.add("text");
|
|
513
|
+
}
|
|
470
514
|
if (part.type === "reasoning") {
|
|
471
515
|
assistantContent.push({
|
|
472
516
|
type: "reasoning",
|
|
473
517
|
text: part.text,
|
|
474
518
|
...part.provider && { providerOptions: providerOptions(part.provider) }
|
|
475
519
|
});
|
|
520
|
+
rendered.add("reasoning");
|
|
476
521
|
}
|
|
477
522
|
if (part.type === "tool-call") {
|
|
478
523
|
assistantContent.push({
|
|
@@ -482,6 +527,7 @@ function assistantMessages(message) {
|
|
|
482
527
|
input: part.input,
|
|
483
528
|
...part.provider && { providerOptions: providerOptions(part.provider) }
|
|
484
529
|
});
|
|
530
|
+
rendered.add("tool-call");
|
|
485
531
|
}
|
|
486
532
|
if (part.type === "tool-result") {
|
|
487
533
|
const output = part.outcome === "success" ? { type: "json", value: part.output ?? null } : { type: "error-json", value: part.output ?? { message: part.outcome } };
|
|
@@ -491,8 +537,13 @@ function assistantMessages(message) {
|
|
|
491
537
|
toolName: part.toolName,
|
|
492
538
|
output
|
|
493
539
|
});
|
|
540
|
+
rendered.add("tool-result");
|
|
494
541
|
}
|
|
495
542
|
}
|
|
543
|
+
if (interrupted && (assistantContent.length > 0 || toolContent.length > 0)) {
|
|
544
|
+
assistantContent.push({ type: "text", text: INTERRUPTION_NOTE });
|
|
545
|
+
rendered.add("control");
|
|
546
|
+
}
|
|
496
547
|
const messages = [];
|
|
497
548
|
if (assistantContent.length > 0) {
|
|
498
549
|
messages.push(modelMessageSchema.parse({ role: "assistant", content: assistantContent }));
|
|
@@ -500,7 +551,22 @@ function assistantMessages(message) {
|
|
|
500
551
|
if (toolContent.length > 0) {
|
|
501
552
|
messages.push(modelMessageSchema.parse({ role: "tool", content: toolContent }));
|
|
502
553
|
}
|
|
503
|
-
return messages;
|
|
554
|
+
return { messages, rendered };
|
|
555
|
+
}
|
|
556
|
+
function interruptedSystemNote(message) {
|
|
557
|
+
const rendered = new Set;
|
|
558
|
+
const text = textContent(message.parts);
|
|
559
|
+
if (!text)
|
|
560
|
+
return { rendered };
|
|
561
|
+
rendered.add("text");
|
|
562
|
+
rendered.add("control");
|
|
563
|
+
return {
|
|
564
|
+
message: modelMessageSchema.parse({
|
|
565
|
+
role: "system",
|
|
566
|
+
content: `[interrupted] partial response: ${text}`
|
|
567
|
+
}),
|
|
568
|
+
rendered
|
|
569
|
+
};
|
|
504
570
|
}
|
|
505
571
|
function completeToolChronology(message) {
|
|
506
572
|
const calls = new Set(message.parts.filter((part) => part.type === "tool-call").map((part) => part.callId));
|
|
@@ -510,20 +576,25 @@ function completeToolChronology(message) {
|
|
|
510
576
|
async function projectAgentHistoryDetailed(messages, options = {}) {
|
|
511
577
|
const projected = [];
|
|
512
578
|
const decisions = [];
|
|
579
|
+
const interruptedRule = options.interruptedAssistant ?? "assistant-marked";
|
|
513
580
|
let observedUser = false;
|
|
514
581
|
for (const message of messages) {
|
|
582
|
+
if (message.status === "superseded") {
|
|
583
|
+
decisions.push(decide(message, "omitted", "superseded"));
|
|
584
|
+
continue;
|
|
585
|
+
}
|
|
515
586
|
if (message.status === "streaming" || message.status === "failed") {
|
|
516
|
-
decisions.push(
|
|
587
|
+
decisions.push(decide(message, "omitted", "draft-or-failed"));
|
|
517
588
|
continue;
|
|
518
589
|
}
|
|
519
590
|
if (message.role === "user") {
|
|
520
591
|
const user = await userMessage(message, options);
|
|
521
592
|
observedUser = true;
|
|
522
|
-
if (user) {
|
|
523
|
-
projected.push(user);
|
|
524
|
-
decisions.push(
|
|
593
|
+
if (user.message) {
|
|
594
|
+
projected.push(user.message);
|
|
595
|
+
decisions.push(decide(message, "projected", "projected", user.rendered));
|
|
525
596
|
} else {
|
|
526
|
-
decisions.push(
|
|
597
|
+
decisions.push(decide(message, "omitted", "empty"));
|
|
527
598
|
}
|
|
528
599
|
continue;
|
|
529
600
|
}
|
|
@@ -531,9 +602,9 @@ async function projectAgentHistoryDetailed(messages, options = {}) {
|
|
|
531
602
|
const content = textContent(message.parts);
|
|
532
603
|
if (content) {
|
|
533
604
|
projected.push(modelMessageSchema.parse({ role: "system", content }));
|
|
534
|
-
decisions.push(
|
|
605
|
+
decisions.push(decide(message, "projected", "projected", new Set(["text"])));
|
|
535
606
|
} else {
|
|
536
|
-
decisions.push(
|
|
607
|
+
decisions.push(decide(message, "omitted", "empty"));
|
|
537
608
|
}
|
|
538
609
|
continue;
|
|
539
610
|
}
|
|
@@ -541,31 +612,34 @@ async function projectAgentHistoryDetailed(messages, options = {}) {
|
|
|
541
612
|
if (options.leadingAssistant === "error") {
|
|
542
613
|
throw new Error(`Assistant message ${message.id} precedes the first user message`);
|
|
543
614
|
}
|
|
544
|
-
decisions.push(
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
615
|
+
decisions.push(decide(message, "omitted", "leading-assistant"));
|
|
616
|
+
continue;
|
|
617
|
+
}
|
|
618
|
+
const interrupted = message.status === "interrupted";
|
|
619
|
+
if (interrupted && interruptedRule === "omit") {
|
|
620
|
+
decisions.push(decide(message, "omitted", "interrupted"));
|
|
621
|
+
continue;
|
|
622
|
+
}
|
|
623
|
+
if (interrupted && interruptedRule === "system-note") {
|
|
624
|
+
const note = interruptedSystemNote(message);
|
|
625
|
+
if (note.message) {
|
|
626
|
+
projected.push(note.message);
|
|
627
|
+
decisions.push(decide(message, "projected", "projected", note.rendered));
|
|
628
|
+
} else {
|
|
629
|
+
decisions.push(decide(message, "omitted", "empty"));
|
|
630
|
+
}
|
|
549
631
|
continue;
|
|
550
632
|
}
|
|
551
633
|
if (!completeToolChronology(message)) {
|
|
552
634
|
if (options.incompleteToolTurn === "error") {
|
|
553
635
|
throw new Error(`Assistant message ${message.id} has incomplete tool chronology`);
|
|
554
636
|
}
|
|
555
|
-
decisions.push(
|
|
556
|
-
messageId: message.id,
|
|
557
|
-
action: "omitted",
|
|
558
|
-
reason: "incomplete-tool-turn"
|
|
559
|
-
});
|
|
637
|
+
decisions.push(decide(message, "omitted", "incomplete-tool-turn"));
|
|
560
638
|
continue;
|
|
561
639
|
}
|
|
562
|
-
const assistant = assistantMessages(message);
|
|
563
|
-
projected.push(...assistant);
|
|
564
|
-
decisions.push(
|
|
565
|
-
messageId: message.id,
|
|
566
|
-
action: assistant.length > 0 ? "projected" : "omitted",
|
|
567
|
-
reason: assistant.length > 0 ? "projected" : "empty"
|
|
568
|
-
});
|
|
640
|
+
const assistant = assistantMessages(message, interrupted);
|
|
641
|
+
projected.push(...assistant.messages);
|
|
642
|
+
decisions.push(assistant.messages.length > 0 ? decide(message, "projected", "projected", assistant.rendered) : decide(message, "omitted", "empty"));
|
|
569
643
|
}
|
|
570
644
|
return { messages: projected, decisions };
|
|
571
645
|
}
|
|
@@ -786,20 +860,21 @@ async function selectAgentHistory(options) {
|
|
|
786
860
|
if (!Number.isSafeInteger(keepRecentTurns) || keepRecentTurns < 0) {
|
|
787
861
|
throw new TypeError("keepRecentTurns must be a non-negative safe integer");
|
|
788
862
|
}
|
|
863
|
+
const spoken = options.messages.filter((message) => message.status !== "superseded");
|
|
789
864
|
const counts = new Map;
|
|
790
865
|
let total = 0;
|
|
791
866
|
let estimated = false;
|
|
792
|
-
for (const message of
|
|
867
|
+
for (const message of spoken) {
|
|
793
868
|
const count = AgentTokenCountSchema.parse(await options.estimateMessage(message));
|
|
794
869
|
counts.set(message.id, count);
|
|
795
870
|
const value = knownValue(count);
|
|
796
871
|
if (value === undefined) {
|
|
797
872
|
return {
|
|
798
|
-
messages: [...
|
|
873
|
+
messages: [...spoken],
|
|
799
874
|
decisions: options.messages.map((candidate) => ({
|
|
800
875
|
messageId: candidate.id,
|
|
801
|
-
action: "kept",
|
|
802
|
-
reason: "token-count-unavailable",
|
|
876
|
+
action: candidate.status === "superseded" ? "removed" : "kept",
|
|
877
|
+
reason: candidate.status === "superseded" ? "superseded" : "token-count-unavailable",
|
|
803
878
|
tokens: counts.get(candidate.id) ?? { provenance: "unavailable" }
|
|
804
879
|
})),
|
|
805
880
|
totalTokens: { provenance: "unavailable" },
|
|
@@ -810,7 +885,7 @@ async function selectAgentHistory(options) {
|
|
|
810
885
|
if (count.provenance === "estimated")
|
|
811
886
|
estimated = true;
|
|
812
887
|
}
|
|
813
|
-
const turns = budgetTurns(
|
|
888
|
+
const turns = budgetTurns(spoken);
|
|
814
889
|
const completeIndexes = turns.map((turn, index) => ({ turn, index })).filter(({ turn }) => turn.complete && !turn.protectedSystem).map(({ index }) => index);
|
|
815
890
|
const protectedRecent = new Set(completeIndexes.slice(-keepRecentTurns));
|
|
816
891
|
const removed = new Set;
|
|
@@ -823,8 +898,16 @@ async function selectAgentHistory(options) {
|
|
|
823
898
|
total -= knownValue(counts.get(message.id) ?? { provenance: "unavailable" }) ?? 0;
|
|
824
899
|
}
|
|
825
900
|
}
|
|
826
|
-
const messages =
|
|
901
|
+
const messages = spoken.filter((message) => !removed.has(message.id));
|
|
827
902
|
const decisions = options.messages.map((message) => {
|
|
903
|
+
if (message.status === "superseded") {
|
|
904
|
+
return {
|
|
905
|
+
messageId: message.id,
|
|
906
|
+
action: "removed",
|
|
907
|
+
reason: "superseded",
|
|
908
|
+
tokens: { provenance: "unavailable" }
|
|
909
|
+
};
|
|
910
|
+
}
|
|
828
911
|
const turnIndex = turns.findIndex((turn2) => turn2.messages.some((item) => item.id === message.id));
|
|
829
912
|
const turn = turns[turnIndex];
|
|
830
913
|
let reason = "within-budget";
|
|
@@ -980,16 +1063,6 @@ import { stepCountIs, streamText } from "ai";
|
|
|
980
1063
|
// src/agent-runtime/runtime-internals.ts
|
|
981
1064
|
import { z as z5 } from "zod";
|
|
982
1065
|
|
|
983
|
-
// src/agent-runtime/terminal-status.ts
|
|
984
|
-
function assistantStatus(reason) {
|
|
985
|
-
if (reason === "success" || reason === "policy_stop")
|
|
986
|
-
return "completed";
|
|
987
|
-
if (reason === "interrupted" || reason === "cancelled" || reason === "shutdown") {
|
|
988
|
-
return "interrupted";
|
|
989
|
-
}
|
|
990
|
-
return "failed";
|
|
991
|
-
}
|
|
992
|
-
|
|
993
1066
|
// src/agent-runtime/terminal-commit.ts
|
|
994
1067
|
class AgentRuntimeConflictError extends Error {
|
|
995
1068
|
constructor(operation) {
|
|
@@ -1020,6 +1093,7 @@ function canonicalTerminal(snapshot, runId, retainedAssistant) {
|
|
|
1020
1093
|
};
|
|
1021
1094
|
}
|
|
1022
1095
|
function interruptedCandidate(candidate, run, now) {
|
|
1096
|
+
const reason = candidate.reason === "superseded" ? "superseded" : "interrupted";
|
|
1023
1097
|
const hasInterruptControl = candidate.assistant.parts.some((part) => part.type === "control" && part.reason === "run-interrupted");
|
|
1024
1098
|
const parts = hasInterruptControl ? candidate.assistant.parts : [
|
|
1025
1099
|
...candidate.assistant.parts,
|
|
@@ -1029,11 +1103,11 @@ function interruptedCandidate(candidate, run, now) {
|
|
|
1029
1103
|
run,
|
|
1030
1104
|
assistant: AgentMessageSchema.parse({
|
|
1031
1105
|
...candidate.assistant,
|
|
1032
|
-
status:
|
|
1106
|
+
status: assistantStatus(reason),
|
|
1033
1107
|
parts,
|
|
1034
1108
|
updatedAt: now().toISOString()
|
|
1035
1109
|
}),
|
|
1036
|
-
reason
|
|
1110
|
+
reason
|
|
1037
1111
|
};
|
|
1038
1112
|
}
|
|
1039
1113
|
function canRetryTerminal(current, previous, runtimeEpoch) {
|
|
@@ -1112,8 +1186,80 @@ function abortTerminalReason(signal) {
|
|
|
1112
1186
|
return "shutdown";
|
|
1113
1187
|
if (signal.reason === "timeout")
|
|
1114
1188
|
return "timeout";
|
|
1189
|
+
if (signal.reason === "supersede")
|
|
1190
|
+
return "superseded";
|
|
1115
1191
|
return "interrupted";
|
|
1116
1192
|
}
|
|
1193
|
+
function addUsage(total, step) {
|
|
1194
|
+
const sum = (left, right) => {
|
|
1195
|
+
if (left?.value === undefined && right?.value === undefined) {
|
|
1196
|
+
return { provenance: "unavailable" };
|
|
1197
|
+
}
|
|
1198
|
+
if (left?.value === undefined)
|
|
1199
|
+
return { ...right, provenance: "computed" };
|
|
1200
|
+
if (right?.value === undefined)
|
|
1201
|
+
return { ...left, provenance: "computed" };
|
|
1202
|
+
return { value: left.value + right.value, provenance: "computed" };
|
|
1203
|
+
};
|
|
1204
|
+
const sumCost = (left, right) => {
|
|
1205
|
+
if (left?.value === undefined || right?.value === undefined) {
|
|
1206
|
+
return { provenance: "unavailable" };
|
|
1207
|
+
}
|
|
1208
|
+
if (left.currency !== right.currency)
|
|
1209
|
+
return { provenance: "unavailable" };
|
|
1210
|
+
return {
|
|
1211
|
+
value: left.value + right.value,
|
|
1212
|
+
...left.currency && { currency: left.currency },
|
|
1213
|
+
provenance: "computed"
|
|
1214
|
+
};
|
|
1215
|
+
};
|
|
1216
|
+
if (!total)
|
|
1217
|
+
return step;
|
|
1218
|
+
const cost = sumCost(total.cost, step.cost);
|
|
1219
|
+
return {
|
|
1220
|
+
inputTokens: sum(total.inputTokens, step.inputTokens),
|
|
1221
|
+
outputTokens: sum(total.outputTokens, step.outputTokens),
|
|
1222
|
+
reasoningTokens: sum(total.reasoningTokens, step.reasoningTokens),
|
|
1223
|
+
cacheReadTokens: sum(total.cacheReadTokens, step.cacheReadTokens),
|
|
1224
|
+
cacheWriteTokens: sum(total.cacheWriteTokens, step.cacheWriteTokens),
|
|
1225
|
+
...cost && { cost }
|
|
1226
|
+
};
|
|
1227
|
+
}
|
|
1228
|
+
function mergeRunTotals(sdkTotal, accumulated) {
|
|
1229
|
+
const pick = (total, ours) => total?.value !== undefined ? { value: total.value, provenance: "computed" } : ours ?? { provenance: "unavailable" };
|
|
1230
|
+
return {
|
|
1231
|
+
inputTokens: pick(sdkTotal.inputTokens, accumulated?.inputTokens),
|
|
1232
|
+
outputTokens: pick(sdkTotal.outputTokens, accumulated?.outputTokens),
|
|
1233
|
+
reasoningTokens: pick(sdkTotal.reasoningTokens, accumulated?.reasoningTokens),
|
|
1234
|
+
cacheReadTokens: pick(sdkTotal.cacheReadTokens, accumulated?.cacheReadTokens),
|
|
1235
|
+
cacheWriteTokens: pick(sdkTotal.cacheWriteTokens, accumulated?.cacheWriteTokens),
|
|
1236
|
+
cost: accumulated?.cost ?? { provenance: "unavailable" }
|
|
1237
|
+
};
|
|
1238
|
+
}
|
|
1239
|
+
function statedUsage(usage) {
|
|
1240
|
+
const stated = (value) => value ?? { provenance: "unavailable" };
|
|
1241
|
+
if (!usage)
|
|
1242
|
+
return unknownUsage();
|
|
1243
|
+
return {
|
|
1244
|
+
inputTokens: stated(usage.inputTokens),
|
|
1245
|
+
outputTokens: stated(usage.outputTokens),
|
|
1246
|
+
reasoningTokens: stated(usage.reasoningTokens),
|
|
1247
|
+
cacheReadTokens: stated(usage.cacheReadTokens),
|
|
1248
|
+
cacheWriteTokens: stated(usage.cacheWriteTokens),
|
|
1249
|
+
cost: stated(usage.cost)
|
|
1250
|
+
};
|
|
1251
|
+
}
|
|
1252
|
+
function unknownUsage() {
|
|
1253
|
+
const nothing = { provenance: "unavailable" };
|
|
1254
|
+
return {
|
|
1255
|
+
inputTokens: nothing,
|
|
1256
|
+
outputTokens: nothing,
|
|
1257
|
+
reasoningTokens: nothing,
|
|
1258
|
+
cacheReadTokens: nothing,
|
|
1259
|
+
cacheWriteTokens: nothing,
|
|
1260
|
+
cost: nothing
|
|
1261
|
+
};
|
|
1262
|
+
}
|
|
1117
1263
|
function normalizeSdkUsage(value) {
|
|
1118
1264
|
const reported = (tokens) => tokens === undefined ? { provenance: "unavailable" } : { value: tokens, provenance: "provider-reported" };
|
|
1119
1265
|
return {
|
|
@@ -1342,6 +1488,9 @@ function createRunExecutor(dependencies) {
|
|
|
1342
1488
|
...config.history?.resolveFile && { resolveFile: config.history.resolveFile },
|
|
1343
1489
|
...config.history?.unresolvedFile && {
|
|
1344
1490
|
unresolvedFile: config.history.unresolvedFile
|
|
1491
|
+
},
|
|
1492
|
+
...config.history?.interruptedAssistant && {
|
|
1493
|
+
interruptedAssistant: config.history.interruptedAssistant
|
|
1345
1494
|
}
|
|
1346
1495
|
}));
|
|
1347
1496
|
const maxStepCondition = stepCountIs(maxSteps);
|
|
@@ -1585,7 +1734,7 @@ function createRunExecutor(dependencies) {
|
|
|
1585
1734
|
usage: part.usage,
|
|
1586
1735
|
providerMetadata: part.providerMetadata
|
|
1587
1736
|
}) ?? normalizeSdkUsage(part.usage);
|
|
1588
|
-
usage = stepUsage;
|
|
1737
|
+
usage = addUsage(usage, stepUsage);
|
|
1589
1738
|
config.observe?.emit({
|
|
1590
1739
|
schemaVersion: 1,
|
|
1591
1740
|
eventId: generateId(),
|
|
@@ -1606,8 +1755,7 @@ function createRunExecutor(dependencies) {
|
|
|
1606
1755
|
terminalReason = "policy_stop";
|
|
1607
1756
|
}
|
|
1608
1757
|
if (part.type === "finish") {
|
|
1609
|
-
|
|
1610
|
-
usage = { ...aggregate, ...usage?.cost && { cost: usage.cost } };
|
|
1758
|
+
usage = mergeRunTotals(normalizeSdkUsage(part.totalUsage), usage);
|
|
1611
1759
|
}
|
|
1612
1760
|
if (eventCount % checkpointEveryEvents === 0)
|
|
1613
1761
|
await checkpoint();
|
|
@@ -1643,47 +1791,66 @@ function createRunExecutor(dependencies) {
|
|
|
1643
1791
|
parts,
|
|
1644
1792
|
updatedAt: now().toISOString()
|
|
1645
1793
|
});
|
|
1646
|
-
const
|
|
1647
|
-
|
|
1648
|
-
runtimeEpoch,
|
|
1649
|
-
candidate: {
|
|
1650
|
-
run,
|
|
1651
|
-
assistant,
|
|
1652
|
-
reason: terminalReason,
|
|
1653
|
-
...terminalPolicyName && { policyName: terminalPolicyName }
|
|
1654
|
-
},
|
|
1655
|
-
now
|
|
1656
|
-
});
|
|
1657
|
-
snapshot = terminal.snapshot;
|
|
1658
|
-
run = terminal.run;
|
|
1659
|
-
assistant = terminal.assistant;
|
|
1660
|
-
terminalReason = terminal.reason;
|
|
1661
|
-
terminalPolicyName = terminal.policyName;
|
|
1662
|
-
const terminalMetrics = terminal.committedByCaller ? {
|
|
1663
|
-
partial: false,
|
|
1664
|
-
durationMs: performance.now() - runStartedAt,
|
|
1665
|
-
...usage && { usage },
|
|
1666
|
-
...firstOutputAt !== undefined && { ttftMs: firstOutputAt - runStartedAt }
|
|
1667
|
-
} : undefined;
|
|
1668
|
-
if (terminalMetrics) {
|
|
1794
|
+
const spent = statedUsage(usage);
|
|
1795
|
+
const emitSpend = (report) => {
|
|
1669
1796
|
config.observe?.emit({
|
|
1670
1797
|
schemaVersion: 1,
|
|
1671
|
-
eventId:
|
|
1798
|
+
eventId: report.eventId,
|
|
1672
1799
|
type: "run-terminal",
|
|
1673
1800
|
conversationId: run.conversationId,
|
|
1674
1801
|
runId: run.id,
|
|
1675
1802
|
traceId: trace?.traceId ?? generateId(),
|
|
1676
1803
|
spanId: trace?.spanId ?? generateId(),
|
|
1677
1804
|
...trace?.parentSpanId && { parentSpanId: trace.parentSpanId },
|
|
1678
|
-
state:
|
|
1679
|
-
terminalReason,
|
|
1805
|
+
state: report.state,
|
|
1806
|
+
terminalReason: report.reason,
|
|
1680
1807
|
...selectedModel && { modelId: selectedModel.descriptor.modelId },
|
|
1681
|
-
durationMs:
|
|
1682
|
-
|
|
1808
|
+
durationMs: performance.now() - runStartedAt,
|
|
1809
|
+
usage: spent,
|
|
1683
1810
|
...internalCause !== undefined && { internalCause },
|
|
1684
1811
|
...firstOutputAt !== undefined && { ttftMs: firstOutputAt - runStartedAt },
|
|
1685
1812
|
emittedAt: now().toISOString()
|
|
1686
1813
|
});
|
|
1814
|
+
};
|
|
1815
|
+
const unsettledEventId = (version) => agentDurableEventId("terminal", `${run.id}:${runtimeEpoch}`, version);
|
|
1816
|
+
let terminal;
|
|
1817
|
+
try {
|
|
1818
|
+
terminal = await commitAgentRunTerminal({
|
|
1819
|
+
store: config.store,
|
|
1820
|
+
runtimeEpoch,
|
|
1821
|
+
candidate: {
|
|
1822
|
+
run,
|
|
1823
|
+
assistant,
|
|
1824
|
+
reason: terminalReason,
|
|
1825
|
+
...terminalPolicyName && { policyName: terminalPolicyName }
|
|
1826
|
+
},
|
|
1827
|
+
now
|
|
1828
|
+
});
|
|
1829
|
+
} catch (error) {
|
|
1830
|
+
emitSpend({
|
|
1831
|
+
eventId: unsettledEventId(snapshot.version),
|
|
1832
|
+
state: run.state,
|
|
1833
|
+
reason: terminalReason
|
|
1834
|
+
});
|
|
1835
|
+
throw error;
|
|
1836
|
+
}
|
|
1837
|
+
snapshot = terminal.snapshot;
|
|
1838
|
+
run = terminal.run;
|
|
1839
|
+
assistant = terminal.assistant;
|
|
1840
|
+
terminalReason = terminal.reason;
|
|
1841
|
+
terminalPolicyName = terminal.policyName;
|
|
1842
|
+
const terminalMetrics = terminal.committedByCaller ? {
|
|
1843
|
+
partial: false,
|
|
1844
|
+
durationMs: performance.now() - runStartedAt,
|
|
1845
|
+
usage: spent,
|
|
1846
|
+
...firstOutputAt !== undefined && { ttftMs: firstOutputAt - runStartedAt }
|
|
1847
|
+
} : undefined;
|
|
1848
|
+
emitSpend({
|
|
1849
|
+
eventId: terminal.committedByCaller ? agentDurableEventId("terminal", run.id, snapshot.version) : unsettledEventId(snapshot.version),
|
|
1850
|
+
state: run.state,
|
|
1851
|
+
reason: terminalReason
|
|
1852
|
+
});
|
|
1853
|
+
if (terminalMetrics) {
|
|
1687
1854
|
await publish({
|
|
1688
1855
|
type: "terminal",
|
|
1689
1856
|
eventId: agentDurableEventId("terminal", run.id, snapshot.version),
|
|
@@ -2430,6 +2597,8 @@ function terminalState(reason) {
|
|
|
2430
2597
|
return "completed";
|
|
2431
2598
|
if (reason === "interrupted")
|
|
2432
2599
|
return "interrupted";
|
|
2600
|
+
if (reason === "superseded")
|
|
2601
|
+
return "superseded";
|
|
2433
2602
|
if (reason === "cancelled" || reason === "shutdown" || reason === "timeout") {
|
|
2434
2603
|
return "cancelled";
|
|
2435
2604
|
}
|
|
@@ -25,9 +25,32 @@ export declare const ApplicationShutdownOptionsSchema: z.ZodObject<{
|
|
|
25
25
|
signal: z.ZodOptional<z.ZodCustom<AbortSignal, AbortSignal>>;
|
|
26
26
|
}, z.core.$strip>;
|
|
27
27
|
export type ApplicationShutdownOptions = z.input<typeof ApplicationShutdownOptionsSchema>;
|
|
28
|
+
/**
|
|
29
|
+
* The budget this application spends on stopping — and the one thing a failed
|
|
30
|
+
* startup's rollback had no way to know.
|
|
31
|
+
*
|
|
32
|
+
* A rollback happens inside `start()`, so there is no call for a caller to pass
|
|
33
|
+
* options to. The budget therefore has to be declared where the application is,
|
|
34
|
+
* and once it is declared there it is also the sensible default for
|
|
35
|
+
* `shutdown()` with no options: one number for "how long this application may
|
|
36
|
+
* take to stop", not two that can disagree.
|
|
37
|
+
*
|
|
38
|
+
* `signal` is deliberately absent. A budget is a property of the application; a
|
|
39
|
+
* signal belongs to the one call that carries it.
|
|
40
|
+
*/
|
|
41
|
+
export declare const ApplicationShutdownBudgetSchema: z.ZodObject<{
|
|
42
|
+
gracePeriodMs: z.ZodDefault<z.ZodNumber>;
|
|
43
|
+
forceTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export type ApplicationShutdownBudget = z.input<typeof ApplicationShutdownBudgetSchema>;
|
|
28
46
|
export interface ApplicationConfig {
|
|
29
47
|
readonly id: string;
|
|
30
48
|
readonly resources?: readonly ManagedResource[];
|
|
49
|
+
/**
|
|
50
|
+
* How long stopping may take — for `shutdown()` called with no options, and
|
|
51
|
+
* for the rollback of a failed `start()`, which has no other way to be told.
|
|
52
|
+
*/
|
|
53
|
+
readonly shutdown?: ApplicationShutdownBudget;
|
|
31
54
|
readonly onSnapshot?: (snapshot: ApplicationSnapshot) => void | Promise<void>;
|
|
32
55
|
/**
|
|
33
56
|
* Observe why a phase failed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../src/application/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,OAAO,KAAK,EACV,eAAe,EAGhB,MAAM,YAAY,CAAC;AACpB,OAAO,EAIL,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAE9B,KAAK,mBAAmB,EAGzB,MAAM,WAAW,CAAC;AAEnB,6EAA6E;AAC7E,MAAM,MAAM,wBAAwB,GAAG,2BAA2B,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../src/application/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,OAAO,KAAK,EACV,eAAe,EAGhB,MAAM,YAAY,CAAC;AACpB,OAAO,EAIL,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAE9B,KAAK,mBAAmB,EAGzB,MAAM,WAAW,CAAC;AAEnB,6EAA6E;AAC7E,MAAM,MAAM,wBAAwB,GAAG,2BAA2B,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AA8DvF,wEAAwE;AACxE,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,wBAAwB,CAAC;IACzC,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,eAAO,MAA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;IACnC,SAAS,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACzE,QAAQ,CAAC,OAAO,CAAC,EAAE,0BAA0B,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACpF;AAED;;;;;;;;;GASG;AACH,qBAAa,yBAA0B,SAAQ,QAAQ,CAAC,2BAA2B,CAAC;IAClF,cAGC;CACF;AA2BD,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,CAgzB9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-resource.d.ts","sourceRoot":"","sources":["../../src/application/server-resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAkB,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAEzE,MAAM,WAAW,2BAA2B,CAAC,QAAQ;IACnD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvF,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,uFAAuF;AACvF,wBAAgB,qBAAqB,CAAC,QAAQ,EAC5C,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC,GAC5C,eAAe,
|
|
1
|
+
{"version":3,"file":"server-resource.d.ts","sourceRoot":"","sources":["../../src/application/server-resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAkB,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAEzE,MAAM,WAAW,2BAA2B,CAAC,QAAQ;IACnD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvF,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,uFAAuF;AACvF,wBAAgB,qBAAqB,CAAC,QAAQ,EAC5C,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC,GAC5C,eAAe,CAmGjB"}
|
package/dist/application.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { type ActivityId, ActivityIdSchema, type ActivityLiveState, ActivityLiveStateSchema, type ActivityProjection, type ActivityProjectionConfig, type ActivityProjectionSubscriberError, type ActivitySnapshot, ActivitySnapshotSchema, type ActivityStageId, ActivityStageIdSchema, type ActivityStageSnapshot, ActivityStageSnapshotSchema, type ActivityToken, ActivityTokenBrand, type ActivityTransition, createActivityProjection, } from './application/activity';
|
|
2
2
|
export { type ApplicationEventSink, type ApplicationEventSinkConfig, type ApplicationLifecycleEvent, ApplicationLifecycleEventSchema, applicationLifecycleEvent, createApplicationEventSink, } from './application/events';
|
|
3
3
|
export { type ApplicationHealthHandlerOptions, ApplicationHealthHandlerOptionsSchema, type ApplicationOperationalHandlers, type ApplicationOperationalHandlersOptions, ApplicationOperationalHandlersOptionsSchema, createApplicationHealthHandler, createApplicationOperationalHandlers, } from './application/health';
|
|
4
|
-
export { type ApplicationAdmission, ApplicationAdmissionError, type ApplicationConfig, type ApplicationHandle, type ApplicationOperationLease, type ApplicationResourceFailure, type ApplicationResourcePhase, type ApplicationShutdownOptions, ApplicationShutdownOptionsSchema, createApplication, } from './application/kernel';
|
|
4
|
+
export { type ApplicationAdmission, ApplicationAdmissionError, type ApplicationConfig, type ApplicationHandle, type ApplicationOperationLease, type ApplicationResourceFailure, type ApplicationResourcePhase, type ApplicationShutdownBudget, ApplicationShutdownBudgetSchema, type ApplicationShutdownOptions, ApplicationShutdownOptionsSchema, createApplication, } from './application/kernel';
|
|
5
5
|
export { type ApplicationSnapshotSink, type ApplicationSnapshotSinkConfig, type ApplicationSnapshotSinkError, type ApplicationSnapshotSinkStatus, ApplicationSnapshotSinkStatusSchema, createApplicationSnapshotSink, type RevisionedApplicationSnapshot, } from './application/latest-sink';
|
|
6
6
|
export { defineManagedResource, type ManagedResource, type ManagedResourceContext, type ManagedResourceStartResult, } from './application/resource';
|
|
7
7
|
export { createManagedSchedule, type ManagedSchedule, type ManagedScheduleClock, type ManagedScheduleConfig, type ManagedScheduleDescriptor, ManagedScheduleDescriptorSchema, type ManagedScheduleErrorPolicy, ManagedScheduleErrorPolicySchema, type ManagedScheduleOverlap, ManagedScheduleOverlapSchema, type ManagedScheduleRunContext, type ManagedScheduleStatus, ManagedScheduleStatusSchema, type ManagedScheduleTimer, } from './application/schedule';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,KAAK,eAAe,EACpB,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,KAAK,aAAa,EAClB,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK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AC1B,KAAK,2BAA2B,EAChC,iCAAiC,EACjC,KAAK,yBAAyB,EAC9B,+BAA+B,EAC/B,KAAK,mBAAmB,EACxB,yBAAyB,EACzB,KAAK,2BAA2B,EAChC,iCAAiC,EACjC,KAAK,uBAAuB,EAC5B,6BAA6B,EAC7B,KAAK,oBAAoB,EACzB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,2BAA2B,EAChC,qBAAqB,GACtB,MAAM,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,KAAK,eAAe,EACpB,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,KAAK,aAAa,EAClB,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,+BAA+B,EAC/B,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,+BAA+B,EACpC,qCAAqC,EACrC,KAAK,8BAA8B,EACnC,KAAK,qCAAqC,EAC1C,2CAA2C,EAC3C,8BAA8B,EAC9B,oCAAoC,GACrC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,oBAAoB,EACzB,yBAAyB,EACzB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,+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