@sentry/junior 0.182.0 → 0.183.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-hooks-3S25UIHO.js → agent-hooks-SNRBZYAU.js} +11 -11
- package/dist/api/code/overview.d.ts +35 -0
- package/dist/api/code/routes.d.ts +4 -0
- package/dist/api/schema/code.d.ts +75 -0
- package/dist/api/schema.d.ts +2 -0
- package/dist/api/schema.js +9 -1
- package/dist/api.js +258 -134
- package/dist/app.js +71 -48
- package/dist/{catalog-runtime-ESLMBQBV.js → catalog-runtime-3I3JOIIH.js} +4 -4
- package/dist/chat/agent-invocations/store.d.ts +4 -2
- package/dist/chat/agent-invocations/work.d.ts +1 -3
- package/dist/chat/app/factory.d.ts +3 -3
- package/dist/chat/app/services.d.ts +3 -3
- package/dist/chat/code/publisher.d.ts +3 -0
- package/dist/chat/code/store.d.ts +9 -0
- package/dist/chat/event-tasks/store.d.ts +10 -0
- package/dist/chat/ingress/slack-webhook.d.ts +1 -1
- package/dist/chat/plugins/agent-hooks.d.ts +5 -0
- package/dist/chat/{runtime/slack-runtime.d.ts → providers/slack/runtime.d.ts} +2 -2
- package/dist/chat/{runtime/reply-executor.d.ts → providers/slack/turn.d.ts} +10 -9
- package/dist/chat/resource-events/store.d.ts +12 -0
- package/dist/chat/runtime/turn-execution.d.ts +30 -0
- package/dist/chat/slack/dispatch-turn.d.ts +12 -14
- package/dist/chat/task-execution/slack-work.d.ts +1 -1
- package/dist/{chunk-SXOZIG5X.js → chunk-24OJZ5OU.js} +6 -6
- package/dist/{chunk-SVFSYQMT.js → chunk-2ADFGSUS.js} +1 -1
- package/dist/{chunk-GGYA5NPN.js → chunk-2EPYYVJC.js} +8 -8
- package/dist/{chunk-KGMHUDVF.js → chunk-35PM4YY5.js} +6 -6
- package/dist/{chunk-3ENUMZNG.js → chunk-37IQ6DGU.js} +3 -3
- package/dist/{chunk-3THPTNN6.js → chunk-3HJ4F4L7.js} +4 -4
- package/dist/{chunk-3NFHI2NA.js → chunk-3L7CWDQQ.js} +1 -1
- package/dist/{chunk-CVBIM4Z3.js → chunk-4WGFWHWP.js} +1 -1
- package/dist/{chunk-YHL2L2ZZ.js → chunk-56XONJPF.js} +1 -1
- package/dist/{chunk-44BQ3TSK.js → chunk-6UXDTPEN.js} +233 -173
- package/dist/{chunk-2CEOXDG2.js → chunk-AHMWPFIW.js} +174 -6
- package/dist/{chunk-6TSWXBTQ.js → chunk-AX3UDIMA.js} +3 -3
- package/dist/{chunk-S35OZMSL.js → chunk-AYW7J6K4.js} +13 -13
- package/dist/{chunk-WOIALVN2.js → chunk-E3OBGRHN.js} +1 -1
- package/dist/{chunk-4DZ62L36.js → chunk-EENQGEIP.js} +1 -1
- package/dist/{chunk-UUMBHORH.js → chunk-FJMTMGBC.js} +1 -1
- package/dist/{chunk-Z7ALSQS3.js → chunk-G2B2XZQW.js} +1 -1
- package/dist/{chunk-TEFNHMO2.js → chunk-HUK5XIZL.js} +4 -4
- package/dist/{chunk-LT4QYGKM.js → chunk-IO6KFXYE.js} +160 -97
- package/dist/{chunk-JIOKUIAS.js → chunk-KTXOGLNE.js} +2 -2
- package/dist/{chunk-LHQK5XCU.js → chunk-LMNMMESF.js} +2 -2
- package/dist/{chunk-UQP54CXZ.js → chunk-LZBPGX5A.js} +1 -1
- package/dist/{chunk-PQES5LB5.js → chunk-PLZT45VC.js} +5 -5
- package/dist/{chunk-V5UZCCNW.js → chunk-QI5JW5AG.js} +6 -6
- package/dist/{chunk-A7THOQ6N.js → chunk-QZV76CM4.js} +21 -21
- package/dist/{chunk-LB4FWMCV.js → chunk-R767Y7QV.js} +183 -155
- package/dist/{chunk-MJISSOWB.js → chunk-SQHFVIMZ.js} +1 -1
- package/dist/{chunk-BDDWVY32.js → chunk-T5MTGX2E.js} +19 -19
- package/dist/{chunk-DZR3L74W.js → chunk-V64JCZUV.js} +3 -3
- package/dist/{chunk-VHMAFMHB.js → chunk-VOV3SCM3.js} +1 -1
- package/dist/{chunk-BZD4ADQH.js → chunk-W46NIB5H.js} +1 -1
- package/dist/{chunk-QHALFHZA.js → chunk-W5JMPEBO.js} +9 -9
- package/dist/{chunk-D6OHGAIO.js → chunk-WOKJRLM2.js} +5 -5
- package/dist/chunk-WVIA7V3M.js +975 -0
- package/dist/{chunk-UKIHNBBD.js → chunk-X52ESOBP.js} +3 -3
- package/dist/cli/chat.js +33 -35
- package/dist/cli/check.js +5 -5
- package/dist/cli/plugins.js +12 -12
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +6 -6
- package/dist/db/schema/code.d.ts +367 -0
- package/dist/db/schema.d.ts +367 -1
- package/dist/{db-NYIWZ4L5.js → db-K2VMNLHQ.js} +6 -6
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +6 -6
- package/dist/{oauth-callback-server-A2YTPVVX.js → oauth-callback-server-DZZMTKSS.js} +25 -25
- package/dist/{runner-VKAEU52J.js → runner-IIAKWDXI.js} +18 -18
- package/dist/{skills-52GMXUTY.js → skills-EXIQ7BP5.js} +5 -5
- package/dist/spawn-ZR6OOEAN.js +37 -0
- package/dist/task-runner-C52HYCVD.js +32 -0
- package/dist/{validation-VD2YQX2W.js → validation-XUGIWBJF.js} +5 -5
- package/dist/version.js +1 -1
- package/dist/{work-ZWBTGEQP.js → work-G4RLJ634.js} +18 -18
- package/dist/worker-R2JEHK67.js +22 -0
- package/migrations/0036_complex_rage.sql +32 -0
- package/migrations/meta/0036_snapshot.json +3186 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +6 -6
- package/dist/chunk-CZYNWPWD.js +0 -930
- package/dist/spawn-GSS4EBLR.js +0 -37
- package/dist/task-runner-DUGDWF5O.js +0 -32
- package/dist/worker-XUWD5WS7.js +0 -22
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getPersistedSandboxState,
|
|
6
6
|
getPersistedThreadState,
|
|
7
7
|
persistThreadStateById
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PLZT45VC.js";
|
|
9
9
|
import {
|
|
10
10
|
AgentInvocationBusyError,
|
|
11
11
|
AgentInvocationLimitError,
|
|
@@ -14,36 +14,78 @@ import {
|
|
|
14
14
|
agentBindingSchema,
|
|
15
15
|
agentInvocationSchema,
|
|
16
16
|
createAgentInvocationSchema
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-35PM4YY5.js";
|
|
18
18
|
import {
|
|
19
19
|
appendAndEnqueueInboundMessage
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-HUK5XIZL.js";
|
|
21
21
|
import {
|
|
22
22
|
TurnInputCommitLostError,
|
|
23
23
|
getAssistantReplyText,
|
|
24
24
|
getConversationTurnBoundaryError,
|
|
25
25
|
isTurnInputCommitLostError
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-56XONJPF.js";
|
|
27
27
|
import {
|
|
28
28
|
failTurnRecord,
|
|
29
29
|
getTerminalAssistantMessages,
|
|
30
30
|
getTurnRecord,
|
|
31
31
|
openConversationProjection,
|
|
32
32
|
saveTurnCheckpoint
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-24OJZ5OU.js";
|
|
34
34
|
import {
|
|
35
35
|
getConversationEventStore,
|
|
36
36
|
getConversationStore,
|
|
37
37
|
getSqlExecutor
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-AX3UDIMA.js";
|
|
39
39
|
import {
|
|
40
40
|
juniorAgentBindings,
|
|
41
41
|
juniorAgentInvocations
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-6UXDTPEN.js";
|
|
43
43
|
|
|
44
44
|
// src/chat/agent-invocations/work.ts
|
|
45
45
|
import { z } from "zod";
|
|
46
46
|
|
|
47
|
+
// src/chat/runtime/turn-execution.ts
|
|
48
|
+
var AgentRunError = class extends Error {
|
|
49
|
+
constructor(cause) {
|
|
50
|
+
super(cause instanceof Error ? cause.message : "Agent Run failed", {
|
|
51
|
+
cause
|
|
52
|
+
});
|
|
53
|
+
this.name = "AgentRunError";
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
async function executeTurn(agentRunner, run, saveResult) {
|
|
57
|
+
let outcome;
|
|
58
|
+
try {
|
|
59
|
+
outcome = await agentRunner.run(run);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
throw new AgentRunError(error);
|
|
62
|
+
}
|
|
63
|
+
if (outcome.status !== "completed") {
|
|
64
|
+
return outcome;
|
|
65
|
+
}
|
|
66
|
+
const saved = await saveResult(outcome.result);
|
|
67
|
+
const lifecycle = new ConversationTurnLifecycleService(
|
|
68
|
+
getConversationEventStore()
|
|
69
|
+
);
|
|
70
|
+
const common = {
|
|
71
|
+
conversationId: run.conversationId,
|
|
72
|
+
createdAtMs: saved.finishedAtMs ?? Date.now(),
|
|
73
|
+
turnId: run.turnId
|
|
74
|
+
};
|
|
75
|
+
if (saved.outcome === "failed") {
|
|
76
|
+
await lifecycle.fail({
|
|
77
|
+
...common,
|
|
78
|
+
failureCode: saved.failureCode
|
|
79
|
+
});
|
|
80
|
+
} else {
|
|
81
|
+
await lifecycle.complete({
|
|
82
|
+
...common,
|
|
83
|
+
outcome: saved.outcome
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return { status: "completed" };
|
|
87
|
+
}
|
|
88
|
+
|
|
47
89
|
// src/chat/agent-invocations/store.ts
|
|
48
90
|
import { createHash } from "crypto";
|
|
49
91
|
import { and, asc, count, eq, inArray } from "drizzle-orm";
|
|
@@ -441,7 +483,54 @@ function isInvocationInputCommitLost(error) {
|
|
|
441
483
|
const cause = getConversationTurnBoundaryError(error)?.cause ?? error;
|
|
442
484
|
return isTurnInputCommitLostError(cause);
|
|
443
485
|
}
|
|
444
|
-
function
|
|
486
|
+
async function saveAgentInvocationResult(args) {
|
|
487
|
+
const failed = args.result.diagnostics.outcome !== "success";
|
|
488
|
+
await persistThreadStateById(args.invocation.childConversationId, {
|
|
489
|
+
sandboxRef: args.result.sandboxRef ?? args.sandboxRef
|
|
490
|
+
});
|
|
491
|
+
if (args.result.piMessages?.length) {
|
|
492
|
+
await saveTurnCheckpoint({
|
|
493
|
+
mode: "completed",
|
|
494
|
+
conversationId: args.invocation.childConversationId,
|
|
495
|
+
turnId: args.turnId,
|
|
496
|
+
durationMs: args.result.diagnostics.durationMs,
|
|
497
|
+
usage: args.result.diagnostics.usage,
|
|
498
|
+
destination: args.invocation.destination,
|
|
499
|
+
destinationVisibility: args.invocation.destinationVisibility,
|
|
500
|
+
...failed ? {
|
|
501
|
+
errorMessage: args.result.diagnostics.errorMessage ?? "Agent invocation failed"
|
|
502
|
+
} : void 0,
|
|
503
|
+
messages: args.result.piMessages,
|
|
504
|
+
actor: args.invocation.actor,
|
|
505
|
+
source: args.invocation.source,
|
|
506
|
+
surface: "internal"
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
const terminal = await completeAgentInvocation({
|
|
510
|
+
invocationId: args.invocation.invocationId,
|
|
511
|
+
...failed ? {
|
|
512
|
+
errorMessage: args.result.diagnostics.errorMessage ?? "Agent invocation failed",
|
|
513
|
+
status: "failed"
|
|
514
|
+
} : {
|
|
515
|
+
result: args.result.text,
|
|
516
|
+
status: "completed"
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
if (!terminal || !isTerminalAgentInvocation(terminal)) {
|
|
520
|
+
throw new Error(
|
|
521
|
+
`Agent invocation did not finish for ${args.invocation.invocationId}`
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
return terminal.status === "completed" ? {
|
|
525
|
+
finishedAtMs: terminal.terminalAtMs,
|
|
526
|
+
outcome: terminal.result.trim() ? "success" : "no_reply"
|
|
527
|
+
} : {
|
|
528
|
+
finishedAtMs: terminal.terminalAtMs,
|
|
529
|
+
failureCode: "model_execution_failed",
|
|
530
|
+
outcome: "failed"
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
function createAgentInvocationWorker(agentRunner) {
|
|
445
534
|
return async (context, invocationId) => {
|
|
446
535
|
let invocation = await getAgentInvocation(invocationId);
|
|
447
536
|
if (!invocation) {
|
|
@@ -512,81 +601,94 @@ function createAgentInvocationWorker(options) {
|
|
|
512
601
|
if (!context.attempt.isFinalAttempt) {
|
|
513
602
|
throw error;
|
|
514
603
|
}
|
|
515
|
-
const
|
|
604
|
+
const terminal = await completeAgentInvocation({
|
|
516
605
|
invocationId: invocation.invocationId,
|
|
517
606
|
errorMessage: error instanceof Error ? error.message : "Agent invocation failed",
|
|
518
607
|
status: "failed"
|
|
519
608
|
});
|
|
520
|
-
if (
|
|
521
|
-
await persistTerminalLifecycle(
|
|
609
|
+
if (terminal) {
|
|
610
|
+
await persistTerminalLifecycle(terminal);
|
|
522
611
|
}
|
|
523
612
|
await acknowledge();
|
|
524
613
|
return { status: "completed" };
|
|
525
614
|
}
|
|
526
615
|
let outcome;
|
|
527
616
|
try {
|
|
528
|
-
outcome = await
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
sandboxRef
|
|
559
|
-
|
|
617
|
+
outcome = await executeTurn(
|
|
618
|
+
agentRunner,
|
|
619
|
+
{
|
|
620
|
+
conversationId: invocation.childConversationId,
|
|
621
|
+
turnId,
|
|
622
|
+
runId: invocation.invocationId,
|
|
623
|
+
instruction: {
|
|
624
|
+
text: invocation.input
|
|
625
|
+
},
|
|
626
|
+
history,
|
|
627
|
+
actor: invocation.actor,
|
|
628
|
+
credentialContext: invocation.credentialContext,
|
|
629
|
+
destination: invocation.destination,
|
|
630
|
+
destinationVisibility: invocation.destinationVisibility,
|
|
631
|
+
publishExternally: context.publishExternally,
|
|
632
|
+
source: invocation.source,
|
|
633
|
+
surface: "internal",
|
|
634
|
+
// TODO(#881, #883): Child runs may still need a path to force
|
|
635
|
+
// interactive auth when a delegated tool requires credentials the
|
|
636
|
+
// parent already has authority to request. Today background children
|
|
637
|
+
// hard-fail instead of pausing for an OAuth link.
|
|
638
|
+
disabledFeatures: ["handoff", "interactive-auth", "subagents"],
|
|
639
|
+
reasoning: invocation.reasoningLevel,
|
|
640
|
+
state: {
|
|
641
|
+
sandboxRef
|
|
642
|
+
},
|
|
643
|
+
durability: {
|
|
644
|
+
onInputCommitted: acknowledge,
|
|
645
|
+
shouldYield: context.shouldYield,
|
|
646
|
+
onSandboxRefChanged: async (nextSandboxRef) => {
|
|
647
|
+
sandboxRef = nextSandboxRef;
|
|
648
|
+
await persistThreadStateById(invocation.childConversationId, {
|
|
649
|
+
sandboxRef
|
|
650
|
+
});
|
|
651
|
+
}
|
|
560
652
|
}
|
|
561
|
-
}
|
|
562
|
-
|
|
653
|
+
},
|
|
654
|
+
async (result) => await saveAgentInvocationResult({
|
|
655
|
+
invocation,
|
|
656
|
+
result,
|
|
657
|
+
sandboxRef,
|
|
658
|
+
turnId
|
|
659
|
+
})
|
|
660
|
+
);
|
|
563
661
|
} catch (error) {
|
|
564
|
-
if (
|
|
662
|
+
if (!(error instanceof AgentRunError)) {
|
|
663
|
+
throw error;
|
|
664
|
+
}
|
|
665
|
+
const runError = error.cause;
|
|
666
|
+
if (isInvocationInputCommitLost(runError)) {
|
|
565
667
|
return { status: "lost_lease" };
|
|
566
668
|
}
|
|
567
|
-
const blocking = blockingInvocationError(
|
|
669
|
+
const blocking = blockingInvocationError(runError);
|
|
568
670
|
if (blocking) {
|
|
569
|
-
const
|
|
671
|
+
const terminal2 = await completeAgentInvocation({
|
|
570
672
|
invocationId: invocation.invocationId,
|
|
571
673
|
errorMessage: blocking.message,
|
|
572
674
|
status: "blocked"
|
|
573
675
|
});
|
|
574
|
-
if (
|
|
575
|
-
await persistTerminalLifecycle(
|
|
676
|
+
if (terminal2) {
|
|
677
|
+
await persistTerminalLifecycle(terminal2);
|
|
576
678
|
}
|
|
577
679
|
await acknowledge();
|
|
578
680
|
return { status: "completed" };
|
|
579
681
|
}
|
|
580
682
|
if (!context.attempt.isFinalAttempt) {
|
|
581
|
-
throw
|
|
683
|
+
throw runError;
|
|
582
684
|
}
|
|
583
|
-
const
|
|
685
|
+
const terminal = await completeAgentInvocation({
|
|
584
686
|
invocationId: invocation.invocationId,
|
|
585
|
-
errorMessage:
|
|
687
|
+
errorMessage: runError instanceof Error ? runError.message : "Agent invocation failed",
|
|
586
688
|
status: "failed"
|
|
587
689
|
});
|
|
588
|
-
if (
|
|
589
|
-
await persistTerminalLifecycle(
|
|
690
|
+
if (terminal) {
|
|
691
|
+
await persistTerminalLifecycle(terminal);
|
|
590
692
|
}
|
|
591
693
|
await acknowledge();
|
|
592
694
|
return { status: "completed" };
|
|
@@ -596,56 +698,17 @@ function createAgentInvocationWorker(options) {
|
|
|
596
698
|
return { status: "yielded" };
|
|
597
699
|
}
|
|
598
700
|
if (outcome.status === "awaiting_auth") {
|
|
599
|
-
const
|
|
701
|
+
const terminal = await completeAgentInvocation({
|
|
600
702
|
invocationId: invocation.invocationId,
|
|
601
703
|
errorMessage: `Agent invocation requires ${outcome.providerDisplayName} authorization`,
|
|
602
704
|
status: "blocked"
|
|
603
705
|
});
|
|
604
|
-
if (
|
|
605
|
-
await persistTerminalLifecycle(
|
|
706
|
+
if (terminal) {
|
|
707
|
+
await persistTerminalLifecycle(terminal);
|
|
606
708
|
}
|
|
607
709
|
await acknowledge();
|
|
608
710
|
return { status: "completed" };
|
|
609
711
|
}
|
|
610
|
-
const result = outcome.result;
|
|
611
|
-
const failed = result.diagnostics.outcome !== "success";
|
|
612
|
-
await persistThreadStateById(invocation.childConversationId, {
|
|
613
|
-
sandboxRef: result.sandboxRef ?? sandboxRef
|
|
614
|
-
});
|
|
615
|
-
if (result.piMessages?.length) {
|
|
616
|
-
await saveTurnCheckpoint({
|
|
617
|
-
mode: "completed",
|
|
618
|
-
conversationId: invocation.childConversationId,
|
|
619
|
-
turnId,
|
|
620
|
-
durationMs: result.diagnostics.durationMs,
|
|
621
|
-
usage: result.diagnostics.usage,
|
|
622
|
-
destination: invocation.destination,
|
|
623
|
-
destinationVisibility: invocation.destinationVisibility,
|
|
624
|
-
...failed ? {
|
|
625
|
-
errorMessage: result.diagnostics.errorMessage ?? "Agent invocation failed"
|
|
626
|
-
} : void 0,
|
|
627
|
-
messages: result.piMessages,
|
|
628
|
-
actor: invocation.actor,
|
|
629
|
-
source: invocation.source,
|
|
630
|
-
surface: "internal"
|
|
631
|
-
});
|
|
632
|
-
}
|
|
633
|
-
const terminal = await completeAgentInvocation({
|
|
634
|
-
invocationId: invocation.invocationId,
|
|
635
|
-
...failed ? {
|
|
636
|
-
errorMessage: result.diagnostics.errorMessage ?? "Agent invocation failed",
|
|
637
|
-
status: "failed"
|
|
638
|
-
} : {
|
|
639
|
-
result: result.text,
|
|
640
|
-
status: "completed"
|
|
641
|
-
}
|
|
642
|
-
});
|
|
643
|
-
if (!terminal) {
|
|
644
|
-
throw new Error(
|
|
645
|
-
`Agent invocation disappeared during completion for ${invocation.invocationId}`
|
|
646
|
-
);
|
|
647
|
-
}
|
|
648
|
-
await persistTerminalLifecycle(terminal);
|
|
649
712
|
await acknowledge();
|
|
650
713
|
return { status: "completed" };
|
|
651
714
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pluginCatalogRuntime
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-E3OBGRHN.js";
|
|
4
4
|
import {
|
|
5
5
|
skillRoots
|
|
6
6
|
} from "./chunk-TXKUKMVO.js";
|
|
7
7
|
import {
|
|
8
8
|
logWarn
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LZBPGX5A.js";
|
|
10
10
|
|
|
11
11
|
// src/chat/skills.ts
|
|
12
12
|
import fs from "fs/promises";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
toCanonicalInputMessage,
|
|
4
4
|
toCanonicalOutputMessage,
|
|
5
5
|
toGenAiMessagesTraceAttributes
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2ADFGSUS.js";
|
|
7
7
|
import {
|
|
8
8
|
extractGenAiUsageAttributes,
|
|
9
9
|
logException,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
normalizeGenAiFinishReason,
|
|
12
12
|
serializeGenAiAttribute,
|
|
13
13
|
withSpan
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LZBPGX5A.js";
|
|
15
15
|
|
|
16
16
|
// src/chat/services/provider-error.ts
|
|
17
17
|
var ProviderError = class extends Error {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
persistConversationMessages
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-24OJZ5OU.js";
|
|
4
4
|
import {
|
|
5
5
|
JUNIOR_THREAD_STATE_TTL_MS
|
|
6
6
|
} from "./chunk-3Y47VMHV.js";
|
|
7
7
|
import {
|
|
8
8
|
getDb
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AX3UDIMA.js";
|
|
10
10
|
import {
|
|
11
11
|
juniorLocationConfigurations
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6UXDTPEN.js";
|
|
13
13
|
import {
|
|
14
14
|
getStateAdapter
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-G2B2XZQW.js";
|
|
16
16
|
import {
|
|
17
17
|
juniorDestinations
|
|
18
18
|
} from "./chunk-VFUK3X5B.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
isRecord,
|
|
21
21
|
toOptionalNumber,
|
|
22
22
|
toOptionalString
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-LZBPGX5A.js";
|
|
24
24
|
|
|
25
25
|
// src/chat/state/conversation.ts
|
|
26
26
|
function defaultConversationState() {
|
|
@@ -5,19 +5,19 @@ import {
|
|
|
5
5
|
isDmChannel,
|
|
6
6
|
normalizeSlackConversationId,
|
|
7
7
|
withSlackRetries
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-AHMWPFIW.js";
|
|
9
9
|
import {
|
|
10
10
|
parseDestination
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-AX3UDIMA.js";
|
|
12
12
|
import {
|
|
13
13
|
getStateAdapter
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-G2B2XZQW.js";
|
|
15
15
|
import {
|
|
16
16
|
normalizeSlackEmojiName
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-LMNMMESF.js";
|
|
18
18
|
import {
|
|
19
19
|
pluginCatalogRuntime
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-E3OBGRHN.js";
|
|
21
21
|
import {
|
|
22
22
|
parseSlackMessageTs,
|
|
23
23
|
parseSlackUserId
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
isRecord,
|
|
27
27
|
logInfo,
|
|
28
28
|
logWarn
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-LZBPGX5A.js";
|
|
30
30
|
|
|
31
31
|
// src/chat/slack/outbound.ts
|
|
32
32
|
var MAX_SLACK_MESSAGE_TEXT_CHARS = 4e4;
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
PluginCredentialFailureError,
|
|
8
8
|
agentNameSchema,
|
|
9
9
|
createPluginAuthOrchestration
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-35PM4YY5.js";
|
|
11
11
|
import {
|
|
12
12
|
parseSandboxEgressAuthRequiredSignal,
|
|
13
13
|
parseSandboxEgressPermissionDeniedSignal,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
searchSlackUsers,
|
|
39
39
|
selectPluginGrant,
|
|
40
40
|
toMcpProviderError
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-2EPYYVJC.js";
|
|
42
42
|
import {
|
|
43
43
|
RetryableDeliveryError,
|
|
44
44
|
actorFromRun,
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
getSlackMessagePermalink,
|
|
55
55
|
resolveBaseUrl,
|
|
56
56
|
uploadFilesToConversation
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-QI5JW5AG.js";
|
|
58
58
|
import {
|
|
59
59
|
SCHEDULED_TASK_SYSTEM_ACTOR,
|
|
60
60
|
compactEventTask,
|
|
@@ -90,13 +90,13 @@ import {
|
|
|
90
90
|
saveScheduledTask,
|
|
91
91
|
storeAttachments,
|
|
92
92
|
writableEventTask
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-R767Y7QV.js";
|
|
94
94
|
import {
|
|
95
95
|
parseSlackThreadId
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-SQHFVIMZ.js";
|
|
97
97
|
import {
|
|
98
98
|
appendAndEnqueueInboundMessage
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-HUK5XIZL.js";
|
|
100
100
|
import {
|
|
101
101
|
CooperativeTurnYieldError,
|
|
102
102
|
NO_REPLY_MARKER,
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
isTurnInputCommitLostError,
|
|
112
112
|
isTurnInputDeferredError,
|
|
113
113
|
sanitizeAssistantText
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-56XONJPF.js";
|
|
115
115
|
import {
|
|
116
116
|
AGENTS_REMOVAL_NOTICE,
|
|
117
117
|
AGENTS_REPLACEMENT_NOTICE,
|
|
@@ -170,7 +170,7 @@ import {
|
|
|
170
170
|
stripRuntimeTurnContext,
|
|
171
171
|
trimTrailingAssistantMessages,
|
|
172
172
|
truncateText
|
|
173
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-24OJZ5OU.js";
|
|
174
174
|
import {
|
|
175
175
|
bindSandboxFileSystem,
|
|
176
176
|
createSandboxSession,
|
|
@@ -181,7 +181,7 @@ import {
|
|
|
181
181
|
resolve,
|
|
182
182
|
setSnapshotSpanAttributes,
|
|
183
183
|
stopSession
|
|
184
|
-
} from "./chunk-
|
|
184
|
+
} from "./chunk-37IQ6DGU.js";
|
|
185
185
|
import {
|
|
186
186
|
privateTraceResultAttributes
|
|
187
187
|
} from "./chunk-UIE3R5XU.js";
|
|
@@ -194,7 +194,7 @@ import {
|
|
|
194
194
|
} from "./chunk-DKIJ2RP5.js";
|
|
195
195
|
import {
|
|
196
196
|
getTurnRequestDeadline
|
|
197
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-FJMTMGBC.js";
|
|
198
198
|
import {
|
|
199
199
|
RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS,
|
|
200
200
|
RESOURCE_SUBSCRIPTION_MAX_TTL_MS,
|
|
@@ -244,7 +244,7 @@ import {
|
|
|
244
244
|
updateWorkspace,
|
|
245
245
|
withSlackRetries,
|
|
246
246
|
workspaceRepoCheckoutPath
|
|
247
|
-
} from "./chunk-
|
|
247
|
+
} from "./chunk-AHMWPFIW.js";
|
|
248
248
|
import {
|
|
249
249
|
KNOWN_CONVERSATION_EVENT_TYPES,
|
|
250
250
|
contextProvenance,
|
|
@@ -258,12 +258,12 @@ import {
|
|
|
258
258
|
instructionProvenanceFor,
|
|
259
259
|
requireSlackDestination,
|
|
260
260
|
sameActorIdentity
|
|
261
|
-
} from "./chunk-
|
|
261
|
+
} from "./chunk-AX3UDIMA.js";
|
|
262
262
|
import {
|
|
263
263
|
juniorArtifacts,
|
|
264
264
|
juniorIdentities,
|
|
265
265
|
juniorSchedulerRuns
|
|
266
|
-
} from "./chunk-
|
|
266
|
+
} from "./chunk-6UXDTPEN.js";
|
|
267
267
|
import {
|
|
268
268
|
SANDBOX_DATA_ROOT,
|
|
269
269
|
SANDBOX_REPOS_ROOT,
|
|
@@ -290,12 +290,12 @@ import {
|
|
|
290
290
|
sleep,
|
|
291
291
|
throwSandboxOperationError,
|
|
292
292
|
wrapSandboxSetupError
|
|
293
|
-
} from "./chunk-
|
|
293
|
+
} from "./chunk-X52ESOBP.js";
|
|
294
294
|
import {
|
|
295
295
|
fenceLock,
|
|
296
296
|
getStateAdapter,
|
|
297
297
|
withLock
|
|
298
|
-
} from "./chunk-
|
|
298
|
+
} from "./chunk-G2B2XZQW.js";
|
|
299
299
|
import {
|
|
300
300
|
ACTIVE_TURN_COMPACTION_SUMMARY_PREFIX,
|
|
301
301
|
COMPACTION_SUMMARY_PREFIX,
|
|
@@ -326,7 +326,7 @@ import {
|
|
|
326
326
|
resolveGatewayCredential,
|
|
327
327
|
resolveGatewayModel,
|
|
328
328
|
unwrapCurrentInstruction
|
|
329
|
-
} from "./chunk-
|
|
329
|
+
} from "./chunk-LMNMMESF.js";
|
|
330
330
|
import {
|
|
331
331
|
canExposeConversationPayload,
|
|
332
332
|
resolveConversationPrivacy,
|
|
@@ -336,16 +336,16 @@ import {
|
|
|
336
336
|
toGenAiMessagesTraceAttributes,
|
|
337
337
|
toGenAiPayloadMetadata,
|
|
338
338
|
toGenAiPayloadTraceAttributes
|
|
339
|
-
} from "./chunk-
|
|
339
|
+
} from "./chunk-2ADFGSUS.js";
|
|
340
340
|
import {
|
|
341
341
|
discoverSkills,
|
|
342
342
|
findSkillByName,
|
|
343
343
|
loadSkillsByName,
|
|
344
344
|
parseSkillInvocation
|
|
345
|
-
} from "./chunk-
|
|
345
|
+
} from "./chunk-KTXOGLNE.js";
|
|
346
346
|
import {
|
|
347
347
|
pluginCatalogRuntime
|
|
348
|
-
} from "./chunk-
|
|
348
|
+
} from "./chunk-E3OBGRHN.js";
|
|
349
349
|
import {
|
|
350
350
|
CredentialUnavailableError,
|
|
351
351
|
OAuthProviderError,
|
|
@@ -353,7 +353,7 @@ import {
|
|
|
353
353
|
getOAuthProviderErrorAttributes,
|
|
354
354
|
resolveAuthTokenPlaceholder,
|
|
355
355
|
resolvePluginCommandEnv
|
|
356
|
-
} from "./chunk-
|
|
356
|
+
} from "./chunk-EENQGEIP.js";
|
|
357
357
|
import {
|
|
358
358
|
credentialContextForActor,
|
|
359
359
|
credentialUserSubjectId
|
|
@@ -393,7 +393,7 @@ import {
|
|
|
393
393
|
summarizeMessageText,
|
|
394
394
|
withLogContext,
|
|
395
395
|
withSpan
|
|
396
|
-
} from "./chunk-
|
|
396
|
+
} from "./chunk-LZBPGX5A.js";
|
|
397
397
|
import {
|
|
398
398
|
startInactiveSpan,
|
|
399
399
|
withActiveSpan
|