@sentry/junior 0.245.0 → 0.246.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.
Files changed (53) hide show
  1. package/dist/{admin-BEbNsG87.js → admin-Bh-MYw-j.js} +1 -1
  2. package/dist/{agent-hooks-Caa0Qh_Q.js → agent-hooks-DpklSWZg.js} +8 -8
  3. package/dist/{agent-runner-BEuPFbbv.js → agent-runner-DSKpHjHW.js} +419 -160
  4. package/dist/api/schema.d.ts +23 -1
  5. package/dist/api/schema.js +2 -2
  6. package/dist/api.js +77 -19
  7. package/dist/app.js +30 -64
  8. package/dist/{briefs-DFAh_jTW.js → briefs-cZ5vWqP_.js} +2 -2
  9. package/dist/{catalog-runtime-wmq_fqff.js → catalog-runtime-CTaQXYqS.js} +1 -1
  10. package/dist/cli/chat.js +17 -13
  11. package/dist/cli/check.js +3 -3
  12. package/dist/cli/main.js +2 -2
  13. package/dist/cli/plugins.js +4 -4
  14. package/dist/cli/snapshot-create.js +3 -3
  15. package/dist/cli/upgrade.js +3 -3
  16. package/dist/{client-Bn9SRFCi.js → client--xtsAxKP.js} +2 -2
  17. package/dist/{config-_XAINZMN.js → config-BK53Ip5C.js} +2 -2
  18. package/dist/{conversation-privacy-BN5SGxsF.js → conversation-privacy-BDBFw6Ws.js} +1 -1
  19. package/dist/{credential-sync-BvaUm6HQ.js → credential-sync-BiuhC9Ds.js} +14 -14
  20. package/dist/{executor-CFIqoCNJ.js → executor-bmmuRY-w.js} +2 -2
  21. package/dist/{images-Ci43I3ek.js → images-DZliDtSH.js} +2 -2
  22. package/dist/instrumentation.js +2 -2
  23. package/dist/{job-queue-CGicV7x6.js → job-queue-Cz3M7gg4.js} +1 -1
  24. package/dist/{logging-Bs3dV81s.js → logging-DVtMYOdD.js} +1 -1
  25. package/dist/message-BSN-Ma5f.js +317 -0
  26. package/dist/nitro.js +3 -3
  27. package/dist/{oauth-authorization-COzWmMjO.js → oauth-authorization-By_MVRDC.js} +1 -1
  28. package/dist/{oauth-callback-server-17c9_39v.js → oauth-callback-server-BrUo6w1e.js} +2 -2
  29. package/dist/{pending-auth-Bnhg7Q9k.js → pending-auth-BuQLZ6dK.js} +2 -2
  30. package/dist/{profile-BA471c-l.js → profile-BevMNSlr.js} +4 -4
  31. package/dist/{registry-BYNOFO6e.js → registry-C2rSEio1.js} +1 -1
  32. package/dist/{resolve-rpz8No2i.js → resolve-qPhrznTf.js} +2 -2
  33. package/dist/{runner-C8DRk9X6.js → runner-CNh5eMWx.js} +9 -9
  34. package/dist/{sandbox-egress-signals-B8hurjFt.js → sandbox-egress-signals-BnDEKu8d.js} +1 -1
  35. package/dist/{schema-WRgR9EL6.js → schema-BWMRg8JS.js} +21 -1
  36. package/dist/{skills-C4yrD2NR.js → skills-C6zJbudq.js} +2 -2
  37. package/dist/{spawn-CdAaTXrY.js → spawn-C3efZSx3.js} +2 -2
  38. package/dist/{task-queue-BBxHzlIB.js → task-queue-BX4vG6uA.js} +3 -3
  39. package/dist/{task-runner-BqFapTjs.js → task-runner-T51kll0U.js} +10 -10
  40. package/dist/{tasks-Ddd7OAkp.js → tasks-B9OIjl2K.js} +8 -8
  41. package/dist/{thread-state-DqErwbA8.js → thread-state-AGZtVyXp.js} +6 -6
  42. package/dist/{turn-failure-response-DtL1-fOl.js → turn-failure-response-DJ8KU2bo.js} +8 -8
  43. package/dist/{turn-lifecycle-B5pzyD6W.js → turn-lifecycle-DZJkJ95q.js} +1 -1
  44. package/dist/{turn-session-routing-D6pTU5uF.js → turn-session-routing-mRqLbMZW.js} +1 -1
  45. package/dist/{validation-BAzlyNIc.js → validation-Dg0Ihxzo.js} +1 -1
  46. package/dist/{version-CiXDH3oe.js → version-Deub4try.js} +1 -1
  47. package/dist/version.js +1 -1
  48. package/dist/{viewer-wCn8xneI.js → viewer-D5hbx6TE.js} +3 -3
  49. package/dist/{web-authorization-d5MtGpfG.js → web-authorization-DCxixz5S.js} +6 -6
  50. package/dist/{web-input-BZTiCtvP.js → web-input-0sorYVLh.js} +62 -198
  51. package/dist/{work-4QPqTd5_.js → work-rm2X7jj4.js} +13 -6
  52. package/dist/{worker-mc62tybz.js → worker-bnGsAOP3.js} +5 -5
  53. package/package.json +5 -5
@@ -1,19 +1,19 @@
1
- import { _ as resolvePluginOAuthAccount, d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, fn as formatProviderLabel, gn as createUserTokenStore, mn as resolveBaseUrl, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, pn as parseOAuthStatePayload, s as deleteMcpAuthSession, ut as getMcpProviderErrorAttributes, x as lookupSlackUserProfile } from "./agent-runner-BEuPFbbv.js";
2
- import { f as escapeXml } from "./client-Bn9SRFCi.js";
3
- import { d as logException, h as runBestEffort, p as logWarn } from "./logging-Bs3dV81s.js";
4
- import { a as getRuntimeMetadata, n as botConfig } from "./config-_XAINZMN.js";
1
+ import { Sn as createUserTokenStore, _ as resolvePluginOAuthAccount, bn as resolveBaseUrl, d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, gt as getMcpProviderErrorAttributes, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, s as deleteMcpAuthSession, vn as formatProviderLabel, x as lookupSlackUserProfile, yn as parseOAuthStatePayload } from "./agent-runner-DSKpHjHW.js";
2
+ import { f as escapeXml } from "./client--xtsAxKP.js";
3
+ import { d as logException, h as runBestEffort, p as logWarn } from "./logging-DVtMYOdD.js";
4
+ import { a as getRuntimeMetadata, n as botConfig } from "./config-BK53Ip5C.js";
5
5
  import { f as parseSlackUserId } from "./actor-BTtLaeWy.js";
6
- import { A as upsertIdentity, f as getSqlExecutor, j as upsertLinkedIdentity } from "./viewer-wCn8xneI.js";
6
+ import { A as upsertIdentity, f as getSqlExecutor, j as upsertLinkedIdentity } from "./viewer-D5hbx6TE.js";
7
7
  import { i as homeDir } from "./package-discovery-BVvSnQBB.js";
8
- import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-BYNOFO6e.js";
9
- import { n as pluginCatalogRuntime } from "./catalog-runtime-wmq_fqff.js";
10
- import { t as discoverSkills } from "./skills-C4yrD2NR.js";
11
- import { Nt as recordAuthenticationLinked, Pt as recordAuthorizationCompleted, Q as getTurnRecord, V as postSlackMessage } from "./tasks-Ddd7OAkp.js";
12
- import { zt as getSlackClient } from "./agent-hooks-Caa0Qh_Q.js";
13
- import { E as acquireActiveLock, w as getStateAdapter } from "./profile-BA471c-l.js";
14
- import { i as getConversationPendingAuth } from "./pending-auth-Bnhg7Q9k.js";
15
- import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-DqErwbA8.js";
16
- import { n as deleteWebAuthorization, o as wakeAuthorizedTurn, s as wakePausedTurn } from "./web-authorization-d5MtGpfG.js";
8
+ import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-C2rSEio1.js";
9
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-CTaQXYqS.js";
10
+ import { t as discoverSkills } from "./skills-C6zJbudq.js";
11
+ import { Nt as recordAuthenticationLinked, Pt as recordAuthorizationCompleted, Q as getTurnRecord, V as postSlackMessage } from "./tasks-B9OIjl2K.js";
12
+ import { zt as getSlackClient } from "./agent-hooks-DpklSWZg.js";
13
+ import { E as acquireActiveLock, w as getStateAdapter } from "./profile-BevMNSlr.js";
14
+ import { i as getConversationPendingAuth } from "./pending-auth-BuQLZ6dK.js";
15
+ import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-AGZtVyXp.js";
16
+ import { n as deleteWebAuthorization, o as wakeAuthorizedTurn, s as wakePausedTurn } from "./web-authorization-DCxixz5S.js";
17
17
  import { n as relayLocalOAuthCallback } from "./oauth-relay-CdCnu80W.js";
18
18
  import path from "node:path";
19
19
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
- import { d as logException } from "./logging-Bs3dV81s.js";
1
+ import { d as logException } from "./logging-DVtMYOdD.js";
2
2
  import { g as startSpanManual } from "./sentry-CgWZM_kV.js";
3
- import "./config-_XAINZMN.js";
3
+ import "./config-BK53Ip5C.js";
4
4
  import { a as juniorAgentInvocations, c as juniorIdentities, d as juniorDestinations, f as timestamptz, i as juniorAgentBindings, l as juniorUsers, s as juniorConversations } from "./agent-invocations-BO6ddZax.js";
5
5
  import { AsyncLocalStorage } from "node:async_hooks";
6
6
  import { sql } from "drizzle-orm";
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { D as storeAttachment, T as readLiveAttachment } from "./agent-runner-BEuPFbbv.js";
3
- import { f as getSqlExecutor } from "./viewer-wCn8xneI.js";
2
+ import { D as storeAttachment, T as readLiveAttachment } from "./agent-runner-DSKpHjHW.js";
3
+ import { f as getSqlExecutor } from "./viewer-D5hbx6TE.js";
4
4
  import "./conversation-CvBG57Io.js";
5
5
  //#region src/chat/attachments/images.ts
6
6
  var images_exports = /* @__PURE__ */ __exportAll({
@@ -1,6 +1,6 @@
1
- import { N as getDeploymentServiceVersion, P as getDeploymentTelemetryAttributes } from "./logging-Bs3dV81s.js";
1
+ import { N as getDeploymentServiceVersion, P as getDeploymentTelemetryAttributes } from "./logging-DVtMYOdD.js";
2
2
  import { _ as vercelAIIntegration, a as getClient, b as withStreamedSpan, c as init, o as getGlobalScope } from "./sentry-CgWZM_kV.js";
3
- import { n as getCurrentConversationPrivacy } from "./conversation-privacy-BN5SGxsF.js";
3
+ import { n as getCurrentConversationPrivacy } from "./conversation-privacy-BDBFw6Ws.js";
4
4
  import { t as consumePrivateTraceResultMarker } from "./private-trace-result-BLvBjy_e.js";
5
5
  //#region src/chat/sentry-payload-filter.ts
6
6
  const PAYLOAD_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
@@ -1,4 +1,4 @@
1
- import { i as getChatConfig } from "./config-_XAINZMN.js";
1
+ import { i as getChatConfig } from "./config-BK53Ip5C.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  import { z } from "zod";
4
4
  import { createHash, createHmac, timingSafeEqual } from "node:crypto";
@@ -1,5 +1,5 @@
1
1
  import { d as setTag, f as setUser, h as startSpan, i as getActiveSpan, l as logger, n as captureMessage, p as spanToJSON, s as getTraceData, t as captureException, y as withScope } from "./sentry-CgWZM_kV.js";
2
- import { t as JUNIOR_VERSION } from "./version-CiXDH3oe.js";
2
+ import { t as JUNIOR_VERSION } from "./version-Deub4try.js";
3
3
  import path from "node:path";
4
4
  import { styleText } from "node:util";
5
5
  import { ConfigError, configureSync, getConfig, getLogger } from "@logtape/logtape";
@@ -0,0 +1,317 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
+ import { $ as getAgentInvocationIdForMessage, At as appendAndEnqueueInboundMessage, En as toolInvocationDestination, J as createAgentInvocationForMessage, Q as getAgentInvocation, Tn as actorFromRun, X as findChildAgentConversationId, Y as createAgentInvocationFromLatest, Z as getActiveAgentInvocationForConversation, at as getLatestAgentInvocationForConversation, bt as isEventMailboxMetadata, et as getAgentInvocationIdForResult, ht as PARENT_AGENT_TARGET, mt as AgentMessageTargetError, nt as getAgentInvocationResultMessageId, ot as isTerminalAgentInvocation, ut as markAgentInvocationParentMailboxAppended, yt as EVENT_WAIT_MS } from "./agent-runner-DSKpHjHW.js";
3
+ import { r as enqueueAgentInvocation } from "./work-rm2X7jj4.js";
4
+ //#region src/chat/agent-invocations/result.ts
5
+ const AGENT_INVOCATION_EVENT_NAMESPACE = "junior";
6
+ const AGENT_INVOCATION_EVENT_TYPE_PREFIX = "agent_invocation.";
7
+ const AGENT_INVOCATION_RESULT_MAX_LENGTH = 12e3;
8
+ /** Event type of a message that a child agent sends to its parent. */
9
+ const AGENT_MESSAGE_EVENT_TYPE = "agent.message";
10
+ /**
11
+ * Return the Inbound message author id for results sent by one Actor.
12
+ * `selectContiguousTurnBatch` in `task-execution/worker.ts` puts messages in
13
+ * one attempt only when their author ids and sources match. Mid-Turn drains
14
+ * take only `interrupt` messages, and results are `defer`. So results never
15
+ * share a Turn and its credentials with another Actor or with watch Events.
16
+ * Keep this id unique per Actor if either rule changes.
17
+ */
18
+ function resultAuthorId(actor) {
19
+ switch (actor.platform) {
20
+ case "system": return `agent-invocation:system:${actor.name}`;
21
+ case "slack": return `agent-invocation:slack:${actor.teamId}:${actor.userId}`;
22
+ default: return `agent-invocation:${actor.platform}:${actor.userId}`;
23
+ }
24
+ }
25
+ /**
26
+ * Error messages can contain text from tools or providers, so the trusted
27
+ * summary in the mailbox metadata has only the status.
28
+ */
29
+ function trustedSummary(invocation, agent) {
30
+ switch (invocation.status) {
31
+ case "completed": return `${agent} finished its task.`;
32
+ case "blocked": return `${agent} is blocked.`;
33
+ case "failed": return `${agent} failed.`;
34
+ case "stopped": return `${agent} was stopped.`;
35
+ }
36
+ }
37
+ /**
38
+ * Render the parent agent input for one terminal agent invocation. A result
39
+ * answers work that the parent gave away, so it is not a task. The child runs
40
+ * as the same Actor with the same tools, so its output is passed as-is. A
41
+ * child cannot reach the user, so its output never gives user approval. Only
42
+ * the task title is shown: the parent's `spawnAgent` call already has the
43
+ * task.
44
+ */
45
+ const RESULT_NEXT_STEP = {
46
+ completed: "Use this result to continue the work in this conversation. Do not repeat work that the child agent already did.",
47
+ blocked: "The child agent did not finish its task because something is missing. If you can give it, send it to the child agent with messageAgent. Otherwise tell the user what is missing.",
48
+ failed: "The child agent did not finish its task. If you still need this work, use messageAgent to ask the same child agent to try again, or tell the user what is blocked.",
49
+ stopped: "The child agent was stopped before it finished. Do not start this work again unless the user asks."
50
+ };
51
+ const OUTPUT_LABEL = {
52
+ completed: "Result",
53
+ blocked: "Missing",
54
+ failed: "Error",
55
+ stopped: "Error"
56
+ };
57
+ function renderResultInput(invocation, summary) {
58
+ const output = (invocation.status === "completed" ? invocation.result : invocation.errorMessage).trim().slice(0, AGENT_INVOCATION_RESULT_MAX_LENGTH);
59
+ const outputLabel = OUTPUT_LABEL[invocation.status];
60
+ return [
61
+ "[agent result]",
62
+ "",
63
+ "This is the result of a child agent that you started. It is not a message from a person, so it does not give user approval.",
64
+ "",
65
+ summary,
66
+ ...invocation.title ? [`Task: ${invocation.title}`] : [],
67
+ `Child conversation: ${invocation.childConversationId}`,
68
+ "",
69
+ `${outputLabel}:`,
70
+ output || "(empty)",
71
+ "",
72
+ RESULT_NEXT_STEP[invocation.status]
73
+ ].join("\n");
74
+ }
75
+ /** Build the parent Inbound message for one terminal agent invocation. */
76
+ function buildResultInboundMessage(invocation, nowMs) {
77
+ const summary = trustedSummary(invocation, childAgentLabel(invocation));
78
+ const metadata = {
79
+ kind: "event",
80
+ event: {
81
+ eventKey: invocation.invocationId,
82
+ eventType: `${AGENT_INVOCATION_EVENT_TYPE_PREFIX}${invocation.status}`,
83
+ identifier: invocation.invocationId,
84
+ namespace: AGENT_INVOCATION_EVENT_NAMESPACE,
85
+ trustedSummary: summary
86
+ }
87
+ };
88
+ return {
89
+ conversationId: invocation.parentConversationId,
90
+ createdAtMs: invocation.terminalAtMs,
91
+ delivery: "defer",
92
+ inboundMessageId: getAgentInvocationResultMessageId(invocation.invocationId),
93
+ input: {
94
+ authorId: resultAuthorId(invocation.actor),
95
+ metadata,
96
+ text: renderResultInput(invocation, summary)
97
+ },
98
+ receivedAtMs: nowMs,
99
+ source: "event"
100
+ };
101
+ }
102
+ /**
103
+ * Append one terminal agent invocation result to the parent mailbox and wake
104
+ * the parent. Repeat calls are safe.
105
+ *
106
+ * Results do not go through `admitAutomatedTurn`, so the automated-turn limit
107
+ * never drops them. Result Turns still count toward that limit.
108
+ * TODO(dcramer): Add a per-parent total invocation limit as the loop guard
109
+ * for spawn -> result -> spawn chains (#881).
110
+ */
111
+ async function enqueueAgentInvocationResult(invocation, options) {
112
+ if (invocation.parentMailboxStatus !== "pending") return;
113
+ const nowMs = options.nowMs ?? Date.now();
114
+ await appendAndEnqueueInboundMessage({
115
+ message: buildResultInboundMessage(invocation, nowMs),
116
+ queue: options.queue,
117
+ queueDelayMs: EVENT_WAIT_MS,
118
+ state: options.state
119
+ });
120
+ await markAgentInvocationParentMailboxAppended(invocation.invocationId, nowMs);
121
+ }
122
+ function childAgentLabel(invocation) {
123
+ return invocation.agentName ? `Child agent "${invocation.agentName}"` : "Child agent";
124
+ }
125
+ function renderMessageInput(sender, summary, text) {
126
+ return [
127
+ "[agent message]",
128
+ "",
129
+ "This is a message from a child agent that you started. It is not a message from a person, so it does not give user approval. The child agent can still be working, and its result arrives later.",
130
+ "",
131
+ summary,
132
+ ...sender.title ? [`Task: ${sender.title}`] : [],
133
+ `Child conversation: ${sender.childConversationId}`,
134
+ "",
135
+ "Message:",
136
+ text.trim(),
137
+ "",
138
+ "If the child agent needs an answer, use messageAgent."
139
+ ].join("\n");
140
+ }
141
+ /**
142
+ * Append one message from a child agent to its parent mailbox and wake the
143
+ * parent. `sender` is the open agent invocation of the child. The parent
144
+ * handles the message like a result: a root parent runs an Event Turn, and a
145
+ * child parent starts a new agent invocation. Repeat calls with the same
146
+ * `messageKey` are safe.
147
+ */
148
+ async function enqueueAgentMessageToParent(args) {
149
+ const nowMs = args.nowMs ?? Date.now();
150
+ const inboundMessageId = `agent-invocation:${args.sender.invocationId}:message:${args.messageKey}`;
151
+ const summary = `${childAgentLabel(args.sender)} sent a message.`;
152
+ const metadata = {
153
+ kind: "event",
154
+ event: {
155
+ eventKey: inboundMessageId,
156
+ eventType: AGENT_MESSAGE_EVENT_TYPE,
157
+ identifier: args.sender.invocationId,
158
+ namespace: AGENT_INVOCATION_EVENT_NAMESPACE,
159
+ trustedSummary: summary
160
+ }
161
+ };
162
+ await appendAndEnqueueInboundMessage({
163
+ message: {
164
+ conversationId: args.sender.parentConversationId,
165
+ createdAtMs: nowMs,
166
+ delivery: "defer",
167
+ inboundMessageId,
168
+ input: {
169
+ authorId: resultAuthorId(args.sender.actor),
170
+ metadata,
171
+ text: renderMessageInput(args.sender, summary, args.text)
172
+ },
173
+ receivedAtMs: nowMs,
174
+ source: "event"
175
+ },
176
+ queue: args.queue,
177
+ queueDelayMs: EVENT_WAIT_MS,
178
+ state: args.state
179
+ });
180
+ }
181
+ /**
182
+ * Read the agent invocation that one result or message Event refers to: the
183
+ * finished child work for a result, or the open sender work for a message.
184
+ */
185
+ function childAgentInput(message) {
186
+ const metadata = message.input.metadata;
187
+ if (!isEventMailboxMetadata(metadata) || metadata.event.namespace !== AGENT_INVOCATION_EVENT_NAMESPACE) return;
188
+ if (metadata.event.eventType === AGENT_MESSAGE_EVENT_TYPE) return {
189
+ invocationId: metadata.event.identifier,
190
+ kind: "message"
191
+ };
192
+ return metadata.event.eventType.startsWith(AGENT_INVOCATION_EVENT_TYPE_PREFIX) ? {
193
+ invocationId: metadata.event.identifier,
194
+ kind: "result"
195
+ } : void 0;
196
+ }
197
+ /**
198
+ * Read the agent invocation of one result or message and check that it
199
+ * belongs to a child of the Conversation that received it.
200
+ */
201
+ async function getChildAgentInputInvocation(message, input) {
202
+ const invocation = await getAgentInvocation(input.invocationId);
203
+ if (!invocation || input.kind === "result" && !isTerminalAgentInvocation(invocation) || invocation.parentConversationId !== message.conversationId) throw new Error(`Agent invocation ${input.kind} ${input.invocationId} does not belong to ${message.conversationId}`);
204
+ return invocation;
205
+ }
206
+ /**
207
+ * Give agent invocation results and messages that reach a child Conversation
208
+ * to that child. A child Conversation has no Location, so it cannot run an
209
+ * Event Turn. Each result or message starts a new agent invocation on the
210
+ * child instead, and that invocation reports to the child's parent. Returns
211
+ * undefined for work that is not a result or message for a child
212
+ * Conversation.
213
+ */
214
+ async function startAgentInvocationsForChildResults(context, options) {
215
+ const messages = context.attempt.messages;
216
+ const inputs = messages.map(childAgentInput);
217
+ if (messages.length === 0 || inputs.some((input) => !input)) return;
218
+ const latest = await getLatestAgentInvocationForConversation(context.conversationId);
219
+ if (!latest) return;
220
+ if (latest.status === "stopped" || isTerminalAgentInvocation(latest) && latest.parentMailboxStatus === "skipped") {
221
+ await context.attempt.ack();
222
+ return { status: "completed" };
223
+ }
224
+ for (const [index, message] of messages.entries()) {
225
+ const input = inputs[index];
226
+ const source = await getChildAgentInputInvocation(message, input);
227
+ if (input.kind === "result" && isTerminalAgentInvocation(source) && source.parentMailboxStatus === "skipped") continue;
228
+ const invocation = await createAgentInvocationFromLatest({
229
+ input: message.input.text.trim(),
230
+ invocationId: input.kind === "result" ? getAgentInvocationIdForResult(source.invocationId) : getAgentInvocationIdForMessage(message.inboundMessageId),
231
+ latest
232
+ });
233
+ await enqueueAgentInvocation(invocation, options);
234
+ }
235
+ await context.attempt.ack();
236
+ return { status: "completed" };
237
+ }
238
+ /**
239
+ * Run each agent invocation result or message as the Actor that triggered the
240
+ * child, user or system. This is on purpose: the result continues that
241
+ * Actor's work. The Actor comes from SQL, not from mailbox metadata, so the
242
+ * parent Turn has the same authority it had at spawn time.
243
+ *
244
+ * TODO(dcramer): Pass the delegated credential subject of a system Actor, such
245
+ * as a timer watch Turn, when system Turns can spawn children that need it.
246
+ */
247
+ async function withAgentInvocationResultActors(work) {
248
+ if (work.kind !== "mailbox") return work;
249
+ return {
250
+ kind: "mailbox",
251
+ batch: await Promise.all(work.batch.map(async (entry) => {
252
+ const input = childAgentInput(entry.message);
253
+ if (!input) return entry;
254
+ const invocation = await getChildAgentInputInvocation(entry.message, input);
255
+ return {
256
+ ...entry,
257
+ actor: invocation.actor
258
+ };
259
+ }))
260
+ };
261
+ }
262
+ //#endregion
263
+ //#region src/chat/agent-invocations/message.ts
264
+ var message_exports = /* @__PURE__ */ __exportAll({ bindMessageAgent: () => bindMessageAgent });
265
+ /**
266
+ * Bind a Run's Actor and credentials to messages for its parent and child
267
+ * agents. A message to a child continues that child. A message to the parent
268
+ * wakes the parent like a result.
269
+ */
270
+ function bindMessageAgent(run, options) {
271
+ const actor = actorFromRun(run);
272
+ if (!actor) return;
273
+ return async (input, call) => {
274
+ call.signal?.throwIfAborted();
275
+ const queue = typeof options.queue === "function" ? options.queue() : options.queue;
276
+ if (input.to === "parent") {
277
+ const sender = await getActiveAgentInvocationForConversation(run.conversationId);
278
+ if (!sender) throw new AgentMessageTargetError("This conversation has no parent agent");
279
+ await enqueueAgentMessageToParent({
280
+ messageKey: `${run.turnId}:${call.toolCallId}`,
281
+ queue,
282
+ sender,
283
+ state: options.state,
284
+ text: input.text
285
+ });
286
+ return {
287
+ conversationId: sender.parentConversationId,
288
+ delivery: "queued"
289
+ };
290
+ }
291
+ const childConversationId = await findChildAgentConversationId({
292
+ parentConversationId: run.conversationId,
293
+ target: input.to
294
+ });
295
+ if (!childConversationId) throw new AgentMessageTargetError(`"${input.to}" is not "${PARENT_AGENT_TARGET}" or a child agent of this conversation`);
296
+ const { invocation, queued } = await createAgentInvocationForMessage({
297
+ actor,
298
+ childConversationId,
299
+ ...run.credentialContext ? { credentialContext: run.credentialContext } : void 0,
300
+ destination: toolInvocationDestination(run),
301
+ idempotencyKey: `${run.turnId}:${call.toolCallId}`,
302
+ input: input.text,
303
+ parentConversationId: run.conversationId,
304
+ parentToolCallId: call.toolCallId
305
+ });
306
+ await enqueueAgentInvocation(invocation, {
307
+ ...options,
308
+ queue
309
+ });
310
+ return {
311
+ conversationId: childConversationId,
312
+ delivery: queued ? "queued" : "started"
313
+ };
314
+ };
315
+ }
316
+ //#endregion
317
+ export { withAgentInvocationResultActors as a, startAgentInvocationsForChildResults as i, message_exports as n, enqueueAgentInvocationResult as r, bindMessageAgent as t };
package/dist/nitro.js CHANGED
@@ -1,8 +1,8 @@
1
- import { A as JUNIOR_RETENTION_ROUTE, D as JUNIOR_HEARTBEAT_ROUTE, E as JUNIOR_HEARTBEAT_CRON_SCHEDULE, O as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, j as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, k as JUNIOR_RETENTION_CRON_SCHEDULE } from "./logging-Bs3dV81s.js";
1
+ import { A as JUNIOR_RETENTION_ROUTE, D as JUNIOR_HEARTBEAT_ROUTE, E as JUNIOR_HEARTBEAT_CRON_SCHEDULE, O as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, j as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, k as JUNIOR_RETENTION_CRON_SCHEDULE } from "./logging-DVtMYOdD.js";
2
2
  import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-BVvSnQBB.js";
3
- import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-CGicV7x6.js";
3
+ import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-Cz3M7gg4.js";
4
4
  import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-egKWjgue.js";
5
- import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-BBxHzlIB.js";
5
+ import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-BX4vG6uA.js";
6
6
  import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-CVvEUSMH.js";
7
7
  import path from "node:path";
8
8
  import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
@@ -1,4 +1,4 @@
1
- import { ot as extractAssistantText } from "./tasks-Ddd7OAkp.js";
1
+ import { ot as extractAssistantText } from "./tasks-B9OIjl2K.js";
2
2
  //#region src/chat/runtime/turn.ts
3
3
  /** Classified Slack turn failure carrying the owning Sentry capture outward. */
4
4
  var ConversationTurnBoundaryError = class extends Error {
@@ -1,5 +1,5 @@
1
- import { gn as createUserTokenStore } from "./agent-runner-BEuPFbbv.js";
2
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-BvaUm6HQ.js";
1
+ import { Sn as createUserTokenStore } from "./agent-runner-DSKpHjHW.js";
2
+ import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-BiuhC9Ds.js";
3
3
  import { createServer } from "node:http";
4
4
  //#region src/chat/local/oauth-callback-server.ts
5
5
  const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
@@ -1,5 +1,5 @@
1
- import { v as isProviderRetryError } from "./client-Bn9SRFCi.js";
2
- import { Y as abandonTurnRecord, sn as estimateTextTokens } from "./tasks-Ddd7OAkp.js";
1
+ import { v as isProviderRetryError } from "./client--xtsAxKP.js";
2
+ import { Y as abandonTurnRecord, sn as estimateTextTokens } from "./tasks-B9OIjl2K.js";
3
3
  import { r as isExperimentalFeatureEnabled } from "./experimental-Qn9rKLgx.js";
4
4
  import { z } from "zod";
5
5
  //#region src/chat/state/turn-id.ts
@@ -1,7 +1,7 @@
1
- import { S as toOptionalTrimmed } from "./client-Bn9SRFCi.js";
2
- import { v as setSpanAttributes, y as setSpanStatus } from "./logging-Bs3dV81s.js";
3
- import { i as getChatConfig } from "./config-_XAINZMN.js";
4
- import { n as pluginCatalogRuntime } from "./catalog-runtime-wmq_fqff.js";
1
+ import { S as toOptionalTrimmed } from "./client--xtsAxKP.js";
2
+ import { v as setSpanAttributes, y as setSpanStatus } from "./logging-DVtMYOdD.js";
3
+ import { i as getChatConfig } from "./config-BK53Ip5C.js";
4
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-CTaQXYqS.js";
5
5
  import { createHash } from "node:crypto";
6
6
  import { createMemoryState } from "@chat-adapter/state-memory";
7
7
  import { createRedisState } from "@chat-adapter/state-redis";
@@ -1,4 +1,4 @@
1
- import { f as logInfo, p as logWarn, v as setSpanAttributes } from "./logging-Bs3dV81s.js";
1
+ import { f as logInfo, p as logWarn, v as setSpanAttributes } from "./logging-DVtMYOdD.js";
2
2
  import { o as parseActorUserId } from "./actor-BTtLaeWy.js";
3
3
  import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-BVvSnQBB.js";
4
4
  import path from "node:path";
@@ -1,5 +1,5 @@
1
- import { v as setSpanAttributes, w as withSpan } from "./logging-Bs3dV81s.js";
2
- import { N as SANDBOX_WORKSPACE_ROOT, k as sleep, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-BA471c-l.js";
1
+ import { v as setSpanAttributes, w as withSpan } from "./logging-DVtMYOdD.js";
2
+ import { N as SANDBOX_WORKSPACE_ROOT, k as sleep, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-BevMNSlr.js";
3
3
  import { z } from "zod";
4
4
  import { FileSystem, Sandbox } from "@vercel/sandbox";
5
5
  //#region src/chat/sandbox/resources.ts
@@ -1,13 +1,13 @@
1
- import { C as withLogContext, b as setTags, d as logException } from "./logging-Bs3dV81s.js";
2
- import { c as getConversationEventStore, u as getConversationStore } from "./viewer-wCn8xneI.js";
3
- import { d as credentialContextForActor } from "./registry-BYNOFO6e.js";
4
- import { Dt as loadProjection, Ht as hydrateConversationMessages, J as saveTurnCheckpoint, Pt as recordAuthorizationCompleted, St as commitAcceptedReply, Ut as persistConversationMessages, Zt as buildConversationContext, in as recordDeliveredAssistantMessage, nn as markConversationMessage, on as upsertConversationMessage, rn as normalizeConversationText, tt as persistWithRetry } from "./tasks-Ddd7OAkp.js";
1
+ import { C as withLogContext, b as setTags, d as logException } from "./logging-DVtMYOdD.js";
2
+ import { c as getConversationEventStore, u as getConversationStore } from "./viewer-D5hbx6TE.js";
3
+ import { d as credentialContextForActor } from "./registry-C2rSEio1.js";
4
+ import { Dt as loadProjection, Ht as hydrateConversationMessages, J as saveTurnCheckpoint, Pt as recordAuthorizationCompleted, St as commitAcceptedReply, Ut as persistConversationMessages, Zt as buildConversationContext, in as recordDeliveredAssistantMessage, nn as markConversationMessage, on as upsertConversationMessage, rn as normalizeConversationText, tt as persistWithRetry } from "./tasks-B9OIjl2K.js";
5
5
  import { W as messageCardText } from "./conversation-CvBG57Io.js";
6
- import { _ as markTurnFailed, r as getAssistantReplyText, t as authorizationId, v as startActiveTurn } from "./oauth-authorization-COzWmMjO.js";
7
- import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-BqFapTjs.js";
8
- import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-B5pzyD6W.js";
9
- import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-DqErwbA8.js";
10
- import { d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent } from "./turn-failure-response-DtL1-fOl.js";
6
+ import { _ as markTurnFailed, r as getAssistantReplyText, t as authorizationId, v as startActiveTurn } from "./oauth-authorization-By_MVRDC.js";
7
+ import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-T51kll0U.js";
8
+ import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-DZJkJ95q.js";
9
+ import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-AGZtVyXp.js";
10
+ import { d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent } from "./turn-failure-response-DJ8KU2bo.js";
11
11
  import { randomUUID } from "node:crypto";
12
12
  import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
13
13
  //#region src/chat/local/runner.ts
@@ -1,4 +1,4 @@
1
- import { dn as sandboxEgressSignalsResponseSchema } from "./agent-runner-BEuPFbbv.js";
1
+ import { _n as sandboxEgressSignalsResponseSchema } from "./agent-runner-DSKpHjHW.js";
2
2
  //#region src/chat/local/sandbox-egress-signals.ts
3
3
  const SANDBOX_EGRESS_SIGNALS_PATH = "/api/internal/sandbox-egress/signals";
4
4
  const LOCAL_DEV_SERVER_TIMEOUT_MS = 1e3;
@@ -8,6 +8,26 @@ import { codeChangeStateSchema } from "@sentry/junior-plugin-api";
8
8
  /** Stable error body returned by Junior-owned REST endpoints. */
9
9
  const apiErrorSchema = z.object({ error: z.string().min(1) }).strict();
10
10
  //#endregion
11
+ //#region src/api/schema/conversation-stop.ts
12
+ /** One queued web message from the viewer that a stop removed. */
13
+ const stoppedConversationMessageSchema = z.object({
14
+ inboundMessageId: z.string().min(1),
15
+ text: z.string().min(1)
16
+ }).strict();
17
+ /**
18
+ * Result of stopping the active Turn.
19
+ *
20
+ * `stoppedInboundMessageIds` lists every queued human message the stop
21
+ * removes. `stoppedMessages` holds only the viewer's own web text, so the
22
+ * dashboard can return it to the composer.
23
+ */
24
+ const stopConversationTurnResponseSchema = z.object({
25
+ conversationId: z.string().min(1),
26
+ status: z.enum(["no_work", "requested"]),
27
+ stoppedInboundMessageIds: z.array(z.string().min(1)),
28
+ stoppedMessages: z.array(stoppedConversationMessageSchema)
29
+ }).strict();
30
+ //#endregion
11
31
  //#region src/api/schema/child-agent.ts
12
32
  /**
13
33
  * One direct child agent of a Conversation, from agent invocation records.
@@ -379,4 +399,4 @@ const statsReportSchema = z.object({
379
399
  windowStart: z.string()
380
400
  }).strict();
381
401
  //#endregion
382
- export { codeChangeSummarySchema as A, locationParamsSchema as C, dailyConversationActivitySchema as D, activitySixHours as E, codeRepositorySummarySchema as F, conversationChildAgentSchema as I, conversationChildAgentsReportSchema as L, codePersonReportSchema as M, codeRepositoryParamsSchema as N, codeActivityDaySchema as O, codeRepositoryReportSchema as P, apiErrorSchema as R, locationDirectoryReportSchema as S, activityHours as T, actorProfileReportSchema as _, workspaceBodySchema as a, locationActivityDayReportSchema as b, workspaceRepoSchema as c, createdPersonalTokenSchema as d, personalTokenListSchema as f, actorDirectoryReportSchema as g, revokePersonalTokenResponseSchema as h, deleteWorkspaceResponseSchema as i, codeOverviewReportSchema as j, codeChangeSummaryReportSchema as k, workspaceSchema as l, personalTokenParamsSchema as m, statsReportSchema as n, workspaceListSchema as o, personalTokenMetadataSchema as p, baselineSnapshotSchema as r, workspaceParamsSchema as s, statSchema as t, createPersonalTokenBodySchema as u, personParamsSchema as v, activityDays as w, locationDetailReportSchema as x, personalSpendReportSchema as y };
402
+ export { codeChangeSummarySchema as A, locationParamsSchema as C, dailyConversationActivitySchema as D, activitySixHours as E, codeRepositorySummarySchema as F, conversationChildAgentSchema as I, conversationChildAgentsReportSchema as L, codePersonReportSchema as M, codeRepositoryParamsSchema as N, codeActivityDaySchema as O, codeRepositoryReportSchema as P, stopConversationTurnResponseSchema as R, locationDirectoryReportSchema as S, activityHours as T, actorProfileReportSchema as _, workspaceBodySchema as a, locationActivityDayReportSchema as b, workspaceRepoSchema as c, createdPersonalTokenSchema as d, personalTokenListSchema as f, actorDirectoryReportSchema as g, revokePersonalTokenResponseSchema as h, deleteWorkspaceResponseSchema as i, codeOverviewReportSchema as j, codeChangeSummaryReportSchema as k, workspaceSchema as l, personalTokenParamsSchema as m, statsReportSchema as n, workspaceListSchema as o, personalTokenMetadataSchema as p, baselineSnapshotSchema as r, workspaceParamsSchema as s, statSchema as t, createPersonalTokenBodySchema as u, personParamsSchema as v, activityDays as w, locationDetailReportSchema as x, personalSpendReportSchema as y, apiErrorSchema as z };
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { p as logWarn } from "./logging-Bs3dV81s.js";
2
+ import { p as logWarn } from "./logging-DVtMYOdD.js";
3
3
  import { s as skillRoots } from "./package-discovery-BVvSnQBB.js";
4
- import { n as pluginCatalogRuntime } from "./catalog-runtime-wmq_fqff.js";
4
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-CTaQXYqS.js";
5
5
  import path from "node:path";
6
6
  import { z } from "zod";
7
7
  import fs from "node:fs/promises";
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { bn as toolInvocationDestination, yn as actorFromRun } from "./agent-runner-BEuPFbbv.js";
3
- import { n as createAndEnqueueAgentInvocation } from "./work-4QPqTd5_.js";
2
+ import { En as toolInvocationDestination, Tn as actorFromRun } from "./agent-runner-DSKpHjHW.js";
3
+ import { n as createAndEnqueueAgentInvocation } from "./work-rm2X7jj4.js";
4
4
  //#region src/chat/agent-invocations/spawn.ts
5
5
  var spawn_exports = /* @__PURE__ */ __exportAll({ bindSpawnAgent: () => bindSpawnAgent });
6
6
  /** Bind a Run's Actor and credentials to new Agent invocations. */
@@ -1,5 +1,5 @@
1
- import { p as logWarn } from "./logging-Bs3dV81s.js";
2
- import { c as QUEUE_SIGNATURE_MAX_AGE_MS, d as createVercelQueueClient, l as signQueueMessage, p as runWithTurnRequestDeadline, u as verifyQueueMessage } from "./job-queue-CGicV7x6.js";
1
+ import { p as logWarn } from "./logging-DVtMYOdD.js";
2
+ import { c as QUEUE_SIGNATURE_MAX_AGE_MS, d as createVercelQueueClient, l as signQueueMessage, p as runWithTurnRequestDeadline, u as verifyQueueMessage } from "./job-queue-Cz3M7gg4.js";
3
3
  import { z } from "zod";
4
4
  import { createHash } from "node:crypto";
5
5
  import { handleCallback, registerDevConsumer } from "@vercel/queue";
@@ -115,7 +115,7 @@ function pluginTaskCallback() {
115
115
  maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
116
116
  onRejected: logPluginTaskQueueMessageRejected,
117
117
  run: async (message) => {
118
- const { processPluginTask } = await import("./task-runner-BqFapTjs.js").then((n) => n.r);
118
+ const { processPluginTask } = await import("./task-runner-T51kll0U.js").then((n) => n.r);
119
119
  await processPluginTask(message);
120
120
  },
121
121
  topic: PLUGIN_TASK_QUEUE_TOPIC,
@@ -1,17 +1,17 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { h as runBestEffort, p as logWarn } from "./logging-Bs3dV81s.js";
2
+ import { h as runBestEffort, p as logWarn } from "./logging-DVtMYOdD.js";
3
3
  import { g as parseSlackMessageTs } from "./actor-BTtLaeWy.js";
4
- import { C as agentTurnTotalTokens, S as agentTurnCostUsd, d as getDb, r as readActorIdentity, u as getConversationStore } from "./viewer-wCn8xneI.js";
4
+ import { C as agentTurnTotalTokens, S as agentTurnCostUsd, d as getDb, r as readActorIdentity, u as getConversationStore } from "./viewer-D5hbx6TE.js";
5
5
  import { s as juniorConversations } from "./agent-invocations-BO6ddZax.js";
6
- import { c as juniorAutomationExecutions } from "./executor-CFIqoCNJ.js";
6
+ import { c as juniorAutomationExecutions } from "./executor-bmmuRY-w.js";
7
7
  import { p as sameActorIdentity } from "./history-Nte1oVed.js";
8
- import { p as credentialSubjectSchema } from "./registry-BYNOFO6e.js";
9
- import { Ht as hydrateConversationMessages, Jt as fallbackShortTitle, M as formatSlackLink, Q as getTurnRecord, V as postSlackMessage, a as readScheduledAutomation, dt as instructionTextForProjection, g as getEventAutomation, gt as normalizeToolNameFromResult, ht as isToolResultMessage, j as escapeSlackMrkdwnText, mt as isToolResultError, st as getPiMessageRole, u as blockEventAutomation, vt as stripRuntimeTurnContext, z as openSlackDirectMessage } from "./tasks-Ddd7OAkp.js";
10
- import { ct as createPluginModel, it as getDashboardTaskLink, lt as createPluginLogger, ot as createPluginState, p as coreTaskRegistrations, st as createPluginEmbedder, tt as JUNIOR_THREAD_STATE_TTL_MS, u as getPlugins, yt as createPluginConversationEvents } from "./agent-hooks-Caa0Qh_Q.js";
11
- import { w as getStateAdapter } from "./profile-BA471c-l.js";
12
- import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-DqErwbA8.js";
13
- import { t as resolveConversationRouting } from "./turn-session-routing-D6pTU5uF.js";
14
- import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-BBxHzlIB.js";
8
+ import { p as credentialSubjectSchema } from "./registry-C2rSEio1.js";
9
+ import { Ht as hydrateConversationMessages, Jt as fallbackShortTitle, M as formatSlackLink, Q as getTurnRecord, V as postSlackMessage, a as readScheduledAutomation, dt as instructionTextForProjection, g as getEventAutomation, gt as normalizeToolNameFromResult, ht as isToolResultMessage, j as escapeSlackMrkdwnText, mt as isToolResultError, st as getPiMessageRole, u as blockEventAutomation, vt as stripRuntimeTurnContext, z as openSlackDirectMessage } from "./tasks-B9OIjl2K.js";
10
+ import { ct as createPluginModel, it as getDashboardTaskLink, lt as createPluginLogger, ot as createPluginState, p as coreTaskRegistrations, st as createPluginEmbedder, tt as JUNIOR_THREAD_STATE_TTL_MS, u as getPlugins, yt as createPluginConversationEvents } from "./agent-hooks-DpklSWZg.js";
11
+ import { w as getStateAdapter } from "./profile-BevMNSlr.js";
12
+ import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-AGZtVyXp.js";
13
+ import { t as resolveConversationRouting } from "./turn-session-routing-mRqLbMZW.js";
14
+ import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-BX4vG6uA.js";
15
15
  import { z } from "zod";
16
16
  import { createHash } from "node:crypto";
17
17
  import { and, asc, count, desc, eq, gte, inArray, lte, max, or, sql } from "drizzle-orm";