@sentry/junior 0.206.0 → 0.207.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 (64) hide show
  1. package/dist/{agent-C9yuiZUF.js → agent-CmQlX68D.js} +375 -346
  2. package/dist/{agent-hooks-DNjlz2A-.js → agent-hooks-BBX9p6aG.js} +101 -96
  3. package/dist/{agent-runner-E67lFrDG.js → agent-runner-CQD4HKK2.js} +9 -9
  4. package/dist/api/schema.d.ts +39 -39
  5. package/dist/api/schema.js +2 -2
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +154 -154
  8. package/dist/{app-AxGmJHwK.d.ts → app-DfNrn_gS.d.ts} +2 -2
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +185 -183
  11. package/dist/{auth-pause-state-MVZ6xvEK.js → auth-pause-state-uv8on6cT.js} +7 -7
  12. package/dist/{briefs-CvJFQvhJ.js → briefs-BXEmjD9D.js} +3 -3
  13. package/dist/{catalog-runtime-TBR8n4e1.js → catalog-runtime-1BZEOR8J.js} +1 -1
  14. package/dist/{checkpoint-BY47jJCB.js → checkpoint-B-JO5F3c.js} +8 -8
  15. package/dist/cli/chat.js +13 -13
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/main.js +1 -1
  18. package/dist/cli/plugins.js +3 -3
  19. package/dist/cli/snapshot-create.js +3 -3
  20. package/dist/cli/upgrade.d.ts +1 -1
  21. package/dist/cli/upgrade.js +3 -3
  22. package/dist/{client-ceE7NtvC.js → client-Bp297GA0.js} +4 -4
  23. package/dist/{config-CIE83sR2.js → config-G2gv97R1.js} +4 -4
  24. package/dist/{context-B45_WqVX.js → context-Bplcgypl.js} +13 -13
  25. package/dist/{conversation-privacy-Auyq26XQ.js → conversation-privacy-BUfel19D.js} +1 -1
  26. package/dist/{credential-sync-BO33aNQd.js → credential-sync-D04NWqMR.js} +21 -21
  27. package/dist/{db-BeyXKJOI.d.ts → db-D74z7BZH.d.ts} +1 -1
  28. package/dist/{execution-stats-SiS2FLcv.js → execution-stats-Ds4bSvam.js} +77 -77
  29. package/dist/{executor-BfbYPW63.js → executor-BZu1Ta06.js} +12 -12
  30. package/dist/instrumentation.js +2 -2
  31. package/dist/{job-queue-CyTc24Es.js → job-queue-rnAPfUhP.js} +1 -1
  32. package/dist/{logging-D37bayDc.js → logging-Dx0S5k2z.js} +1 -1
  33. package/dist/nitro.d.ts +1 -1
  34. package/dist/nitro.js +3 -3
  35. package/dist/{oauth-callback-server-BtfOeHTZ.js → oauth-callback-server-xGpwURIj.js} +2 -2
  36. package/dist/{pending-auth-BPUzcs7n.js → pending-auth-DIZ4iZjS.js} +2 -2
  37. package/dist/{profile-CSixooTi.js → profile-d-fKypxo.js} +4 -4
  38. package/dist/{prompt-3gqNY1Ka.js → prompt-x-0ZtTyb.js} +14 -14
  39. package/dist/{registry-DiR0-xRg.js → registry-CWKdLCTG.js} +2 -2
  40. package/dist/{resolve-Bn5q__9b.js → resolve-BhRB1s2A.js} +2 -2
  41. package/dist/{runner-DFx3dIJH.js → runner-DNml3owD.js} +10 -10
  42. package/dist/{sandbox-egress-signals-bwvjihxA.js → sandbox-egress-signals-DUIl3-gW.js} +1 -1
  43. package/dist/{schema-8GXFfclK.js → schema-CwTeb-BF.js} +39 -39
  44. package/dist/{skills-BhM5qyCF.js → skills-D9WesdJJ.js} +2 -2
  45. package/dist/{spawn-Dk0PqdH6.js → spawn-Eh_3-s0M.js} +2 -2
  46. package/dist/{stats-DKRP4rsY.js → stats-CFlUGqVA.js} +292 -268
  47. package/dist/{store-C5qxF2ac.d.ts → store-Det8MQ9g.d.ts} +1 -1
  48. package/dist/{task-queue-CdpTvu4R.js → task-queue-D8I1_5wP.js} +3 -3
  49. package/dist/{task-runner-alpjVSxQ.js → task-runner-DO79gdho.js} +15 -15
  50. package/dist/{thread-state-CRK7aA41.js → thread-state-DD6BA4xz.js} +5 -5
  51. package/dist/{turn-execution-XtyzIHog.js → turn-execution-BSIHxmQJ.js} +3 -3
  52. package/dist/{turn-lifecycle-VbwZLfBv.js → turn-lifecycle-DSBK4Ars.js} +1 -1
  53. package/dist/{usage-D4A48Bdl.js → usage-WRXkNOHp.js} +2 -2
  54. package/dist/{validation-jn_46o4U.js → validation-BbHZ4r4S.js} +1 -1
  55. package/dist/{version-DcfJxB4z.js → version-C71UcRWw.js} +1 -1
  56. package/dist/version.js +1 -1
  57. package/dist/{web-authorization-CsfLSfEs.js → web-authorization-C73gJV7l.js} +1 -1
  58. package/dist/{web-input-BPp_sc7t.js → web-input-Ce1FcNIM.js} +8 -8
  59. package/dist/{work-Di-ubSGg.js → work-BEzDU_2x.js} +9 -9
  60. package/dist/{worker-Cu_D5Mr8.js → worker-MK2ubOv-.js} +5 -5
  61. package/migrations/0041_automation_outcomes_backfill.sql +27 -0
  62. package/migrations/meta/0041_snapshot.json +3516 -0
  63. package/migrations/meta/_journal.json +7 -0
  64. package/package.json +5 -5
@@ -59,7 +59,7 @@ type Usage = z.output<typeof usageSchema>;
59
59
  type AgentTurnUsage = Usage;
60
60
  //#endregion
61
61
  //#region src/chat/conversations/store.d.ts
62
- type ConversationSource = "api" | "internal" | "local" | "plugin" | "resource_event" | "scheduler" | "slack" | "web";
62
+ type ConversationSource = "api" | "internal" | "local" | "plugin" | "event" | "scheduler" | "slack" | "web";
63
63
  type ConversationStatus = "paused" | "failed" | "idle" | "pending" | "running";
64
64
  interface ConversationExecution {
65
65
  lastCheckpointAtMs?: number;
@@ -1,6 +1,6 @@
1
- import { f as logWarn } from "./logging-D37bayDc.js";
1
+ import { f as logWarn } from "./logging-Dx0S5k2z.js";
2
2
  import { a as signQueueMessage, i as QUEUE_SIGNATURE_MAX_AGE_MS, o as verifyQueueMessage, s as createVercelQueueClient } from "./vercel-queue-DIkVcfK4.js";
3
- import { o as runWithTurnRequestDeadline } from "./job-queue-CyTc24Es.js";
3
+ import { o as runWithTurnRequestDeadline } from "./job-queue-rnAPfUhP.js";
4
4
  import { z } from "zod";
5
5
  import { createHash } from "node:crypto";
6
6
  import { handleCallback, registerDevConsumer } from "@vercel/queue";
@@ -110,7 +110,7 @@ function pluginTaskCallback() {
110
110
  maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
111
111
  onRejected: logPluginTaskQueueMessageRejected,
112
112
  run: async (message) => {
113
- const { processPluginTask } = await import("./task-runner-alpjVSxQ.js").then((n) => n.r);
113
+ const { processPluginTask } = await import("./task-runner-DO79gdho.js").then((n) => n.r);
114
114
  await processPluginTask(message);
115
115
  },
116
116
  topic: PLUGIN_TASK_QUEUE_TOPIC,
@@ -1,12 +1,12 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { _ as parseSlackMessageTs, r as credentialSubjectSchema } from "./context-B45_WqVX.js";
3
- import { Ft as getConversationStore, It as getDb, Q as readActorIdentity, _t as createPluginState, bt as createPluginLogger, p as coreTaskRegistrations, pt as JUNIOR_THREAD_STATE_TTL_MS, u as getPlugins, vt as createPluginEmbedder, xt as createPluginConversationEvents, yt as createPluginModel } from "./agent-hooks-DNjlz2A-.js";
2
+ import { _ as parseSlackMessageTs, r as credentialSubjectSchema } from "./context-Bplcgypl.js";
3
+ import { Ft as getConversationStore, It as getDb, Q as readActorIdentity, _t as createPluginState, bt as createPluginLogger, p as coreTaskRegistrations, pt as JUNIOR_THREAD_STATE_TTL_MS, u as getPlugins, vt as createPluginEmbedder, xt as createPluginConversationEvents, yt as createPluginModel } from "./agent-hooks-BBX9p6aG.js";
4
4
  import { K as sameActorIdentity } from "./conversation-AA4R1VUn.js";
5
- import { Dt as isToolResultError, Ot as isToolResultMessage, Q as hydrateConversationMessages, bt as getPiMessageRole, jt as stripRuntimeTurnContext, kt as normalizeToolNameFromResult, s as getTurnRecord, wt as instructionTextForProjection } from "./checkpoint-BY47jJCB.js";
6
- import { w as getStateAdapter } from "./profile-CSixooTi.js";
7
- import { u as recordTaskExecution } from "./execution-stats-SiS2FLcv.js";
8
- import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-CRK7aA41.js";
9
- import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-CdpTvu4R.js";
5
+ import { Dt as isToolResultError, Ot as isToolResultMessage, Q as hydrateConversationMessages, bt as getPiMessageRole, jt as stripRuntimeTurnContext, kt as normalizeToolNameFromResult, s as getTurnRecord, wt as instructionTextForProjection } from "./checkpoint-B-JO5F3c.js";
6
+ import { w as getStateAdapter } from "./profile-d-fKypxo.js";
7
+ import { u as recordAutomationExecution } from "./execution-stats-Ds4bSvam.js";
8
+ import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-DD6BA4xz.js";
9
+ import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-D8I1_5wP.js";
10
10
  import { z } from "zod";
11
11
  import { createHash } from "node:crypto";
12
12
  import { destinationSchema, destinationVisibilitySchema, isSlackDestination, pluginRunContextSchema, replyAttributionSchema, sourceSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
@@ -233,14 +233,14 @@ async function markDispatchAwaitingResume(id) {
233
233
  status: "awaiting_resume"
234
234
  });
235
235
  }
236
- async function recordEventTaskExecution(previous, next, status) {
236
+ async function recordEventAutomationExecution(previous, next, status) {
237
237
  if (!next || next.status !== status || previous?.status === status) return;
238
238
  if (next.plugin !== "junior") return;
239
- const eventTaskId = next.metadata?.eventTaskId;
240
- if (!eventTaskId) return;
239
+ const eventAutomationId = next.metadata?.eventAutomationId;
240
+ if (!eventAutomationId) return;
241
241
  const conversationId = getDispatchConversationId(next);
242
242
  const conversation = await getConversationStore().get({ conversationId });
243
- await recordTaskExecution("event", eventTaskId, {
243
+ await recordAutomationExecution("event", eventAutomationId, {
244
244
  ...conversation ? { conversationId } : void 0,
245
245
  executionId: next.id,
246
246
  nowMs: next.updatedAtMs,
@@ -256,7 +256,7 @@ async function markDispatchBlocked(id, errorMessage, resultMessageTs) {
256
256
  ...resultMessageTs ? { resultMessageTs } : void 0,
257
257
  status: "blocked"
258
258
  });
259
- await recordEventTaskExecution(previous, next, "blocked");
259
+ await recordEventAutomationExecution(previous, next, "blocked");
260
260
  return next;
261
261
  }
262
262
  /** Project a completed turn and its accepted Slack message to the plugin API. */
@@ -268,7 +268,7 @@ async function markDispatchCompleted(id, resultMessageTs) {
268
268
  ...resultMessageTs ? { resultMessageTs } : void 0,
269
269
  status: "completed"
270
270
  });
271
- await recordEventTaskExecution(previous, next, "completed");
271
+ await recordEventAutomationExecution(previous, next, "completed");
272
272
  return next;
273
273
  }
274
274
  /** Project a terminal conversation turn failure to the plugin API. */
@@ -280,7 +280,7 @@ async function markDispatchFailed(id, errorMessage, resultMessageTs) {
280
280
  ...resultMessageTs ? { resultMessageTs } : void 0,
281
281
  status: "failed"
282
282
  });
283
- await recordEventTaskExecution(previous, next, "failed");
283
+ await recordEventAutomationExecution(previous, next, "failed");
284
284
  return next;
285
285
  }
286
286
  /** Remove a dispatch after its durable mailbox append has succeeded. */
@@ -345,7 +345,7 @@ function slackSourceForDestination(args) {
345
345
  * Reads parent Conversations when this Conversation has no Destination.
346
346
  */
347
347
  async function resolveConversationRouting(args) {
348
- const conversationStore = args.conversationStore ?? (await import("./agent-hooks-DNjlz2A-.js").then((n) => n.Mt)).getConversationStore();
348
+ const conversationStore = args.conversationStore ?? (await import("./agent-hooks-BBX9p6aG.js").then((n) => n.Mt)).getConversationStore();
349
349
  const chain = await loadConversationChain(args.conversationId, conversationStore);
350
350
  let destination;
351
351
  let source;
@@ -1,9 +1,9 @@
1
- import { F as isRecord, I as toOptionalNumber, L as toOptionalString } from "./logging-D37bayDc.js";
2
- import { It as getDb, pt as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-DNjlz2A-.js";
1
+ import { F as isRecord, I as toOptionalNumber, L as toOptionalString } from "./logging-Dx0S5k2z.js";
2
+ import { It as getDb, pt as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-BBX9p6aG.js";
3
3
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
4
- import { u as juniorLocationConfigurations } from "./executor-BfbYPW63.js";
5
- import { $ as persistConversationMessages } from "./checkpoint-BY47jJCB.js";
6
- import { w as getStateAdapter } from "./profile-CSixooTi.js";
4
+ import { u as juniorLocationConfigurations } from "./executor-BZu1Ta06.js";
5
+ import { $ as persistConversationMessages } from "./checkpoint-B-JO5F3c.js";
6
+ import { w as getStateAdapter } from "./profile-d-fKypxo.js";
7
7
  import { z } from "zod";
8
8
  import { randomUUID } from "node:crypto";
9
9
  import { and, eq, sql } from "drizzle-orm";
@@ -1,6 +1,6 @@
1
- import { Nt as getConversationEventStore } from "./agent-hooks-DNjlz2A-.js";
2
- import { n as runAgentWithTimeout } from "./agent-runner-E67lFrDG.js";
3
- import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-VbwZLfBv.js";
1
+ import { Nt as getConversationEventStore } from "./agent-hooks-BBX9p6aG.js";
2
+ import { n as runAgentWithTimeout } from "./agent-runner-CQD4HKK2.js";
3
+ import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-DSBK4Ars.js";
4
4
  //#region src/chat/runtime/turn-execution.ts
5
5
  /** An error thrown while the agent advances a Run. */
6
6
  var AgentRunError = class extends Error {
@@ -1,4 +1,4 @@
1
- import { Nt as getConversationEventStore } from "./agent-hooks-DNjlz2A-.js";
1
+ import { Nt as getConversationEventStore } from "./agent-hooks-BBX9p6aG.js";
2
2
  //#region src/chat/conversations/turn-lifecycle.ts
3
3
  /** Persist correlated turn lifecycle facts with retry-safe terminal exclusion. */
4
4
  var ConversationTurnLifecycleService = class {
@@ -1,5 +1,5 @@
1
- import { f as logWarn } from "./logging-D37bayDc.js";
2
- import { n as botConfig } from "./config-CIE83sR2.js";
1
+ import { f as logWarn } from "./logging-Dx0S5k2z.js";
2
+ import { n as botConfig } from "./config-G2gv97R1.js";
3
3
  import { P as usageSchema } from "./conversation-AA4R1VUn.js";
4
4
  const TITLE_PROMPTS = {
5
5
  conversation: [
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { n as pluginCatalogRuntime } from "./catalog-runtime-TBR8n4e1.js";
2
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-1BZEOR8J.js";
3
3
  import { isDeepStrictEqual } from "node:util";
4
4
  //#region src/chat/plugins/validation.ts
5
5
  var validation_exports = /* @__PURE__ */ __exportAll({
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.206.0";
2
+ var version = "0.207.0";
3
3
  //#endregion
4
4
  //#region src/version.ts
5
5
  /** Installed Junior package version, or `unknown` when package metadata is unavailable. */
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as JUNIOR_VERSION } from "./version-DcfJxB4z.js";
1
+ import { t as JUNIOR_VERSION } from "./version-C71UcRWw.js";
2
2
  export { JUNIOR_VERSION };
@@ -1,4 +1,4 @@
1
- import { w as getStateAdapter } from "./profile-CSixooTi.js";
1
+ import { w as getStateAdapter } from "./profile-d-fKypxo.js";
2
2
  import { randomUUID } from "node:crypto";
3
3
  //#region src/chat/conversations/web-authorization.ts
4
4
  const WEB_AUTHORIZATION_PREFIX = "junior:web_authorization:v1";
@@ -1,11 +1,11 @@
1
- import { f as logWarn } from "./logging-D37bayDc.js";
2
- import { t as canExposeConversationPayload } from "./conversation-privacy-Auyq26XQ.js";
3
- import { s as getSlackBotToken } from "./config-CIE83sR2.js";
4
- import "./context-B45_WqVX.js";
5
- import { Ft as getConversationStore, It as getDb, K as normalizeSlackConversationId } from "./agent-hooks-DNjlz2A-.js";
1
+ import { f as logWarn } from "./logging-Dx0S5k2z.js";
2
+ import { t as canExposeConversationPayload } from "./conversation-privacy-BUfel19D.js";
3
+ import { s as getSlackBotToken } from "./config-G2gv97R1.js";
4
+ import "./context-Bplcgypl.js";
5
+ import { Ft as getConversationStore, It as getDb, K as normalizeSlackConversationId } from "./agent-hooks-BBX9p6aG.js";
6
6
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
7
- import { E as juniorUsers, T as juniorIdentities, m as juniorConversationParticipants, w as juniorConversations } from "./executor-BfbYPW63.js";
8
- import { Kt as buildDeterministicTurnId, c as parseSlackThreadId, ft as appendAndEnqueueExclusiveInboundMessage, pt as appendAndEnqueueInboundMessage } from "./stats-DKRP4rsY.js";
7
+ import { E as juniorUsers, T as juniorIdentities, m as juniorConversationParticipants, w as juniorConversations } from "./executor-BZu1Ta06.js";
8
+ import { Kt as buildDeterministicTurnId, c as parseSlackThreadId, ft as appendAndEnqueueExclusiveInboundMessage, pt as appendAndEnqueueInboundMessage } from "./stats-CFlUGqVA.js";
9
9
  import { t as healthReportSchema } from "./reporting-schema-DosTN__Q.js";
10
10
  import { z } from "zod";
11
11
  import { createHash } from "node:crypto";
@@ -227,7 +227,7 @@ function requireLocalDestination(conversationId) {
227
227
  * Keep a stored Destination, or create the temporary local Destination.
228
228
  *
229
229
  * TODO(dcramer): Delete this module after Conversation and AgentRun use
230
- * Location, and web and resource-event Turns no longer need a local
230
+ * Location, and web and event Turns no longer need a local
231
231
  * Destination.
232
232
  */
233
233
  function resolveConversationDestination(args) {
@@ -1,13 +1,13 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { A as createAgentInvocationSchema, M as AgentInvocationLimitError, O as agentBindingSchema, Q as AuthorizationFlowDisabledError, f as PluginCredentialFailureError, j as AgentInvocationBusyError, k as agentInvocationSchema } from "./agent-C9yuiZUF.js";
3
- import { Ft as getConversationStore, Lt as getSqlExecutor, Nt as getConversationEventStore } from "./agent-hooks-DNjlz2A-.js";
4
- import { f as juniorAgentBindings, p as juniorAgentInvocations } from "./executor-BfbYPW63.js";
5
- import { B as openConversationProjection, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord, xt as getTerminalAssistantMessages } from "./checkpoint-BY47jJCB.js";
6
- import { pt as appendAndEnqueueInboundMessage } from "./stats-DKRP4rsY.js";
7
- import { _ as isTurnInputCommitLostError, h as getConversationTurnBoundaryError, p as TurnInputCommitLostError, s as getAssistantReplyText } from "./pending-auth-BPUzcs7n.js";
8
- import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-VbwZLfBv.js";
9
- import { n as executeTurn, t as AgentRunError } from "./turn-execution-XtyzIHog.js";
10
- import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-CRK7aA41.js";
2
+ import { A as createAgentInvocationSchema, M as AgentInvocationLimitError, O as agentBindingSchema, Q as AuthorizationFlowDisabledError, f as PluginCredentialFailureError, j as AgentInvocationBusyError, k as agentInvocationSchema } from "./agent-CmQlX68D.js";
3
+ import { Ft as getConversationStore, Lt as getSqlExecutor, Nt as getConversationEventStore } from "./agent-hooks-BBX9p6aG.js";
4
+ import { f as juniorAgentBindings, p as juniorAgentInvocations } from "./executor-BZu1Ta06.js";
5
+ import { B as openConversationProjection, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord, xt as getTerminalAssistantMessages } from "./checkpoint-B-JO5F3c.js";
6
+ import { pt as appendAndEnqueueInboundMessage } from "./stats-CFlUGqVA.js";
7
+ import { _ as isTurnInputCommitLostError, h as getConversationTurnBoundaryError, p as TurnInputCommitLostError, s as getAssistantReplyText } from "./pending-auth-DIZ4iZjS.js";
8
+ import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-DSBK4Ars.js";
9
+ import { n as executeTurn, t as AgentRunError } from "./turn-execution-BSIHxmQJ.js";
10
+ import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-DD6BA4xz.js";
11
11
  import { z } from "zod";
12
12
  import { createHash } from "node:crypto";
13
13
  import { and, asc, count, eq, inArray } from "drizzle-orm";
@@ -1,10 +1,10 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { b as isProviderRetryError } from "./client-ceE7NtvC.js";
3
- import { S as withLogContext, d as logInfo, f as logWarn, u as logException } from "./logging-D37bayDc.js";
4
- import { a as getChatConfig } from "./config-CIE83sR2.js";
5
- import { At as recordConversationRetry, Bt as isFinalAttempt, Ct as drainConversationMailbox, Et as getConversationWorkState, Ft as startConversationWork, Nt as requestAnotherSlice, St as deadLetterAttempt, Vt as isInvalidConversationRecordError, _t as clearConsumedConversationWake, bt as completeConversationWork, dt as ackMessages, gt as checkInConversationWork, jt as releaseConversationWork, kt as recordAttemptFailure, mt as beginConversationResume, wt as ensureConversationWake, xt as countPendingConversationMessages, yt as completeConversationStop } from "./stats-DKRP4rsY.js";
2
+ import { b as isProviderRetryError } from "./client-Bp297GA0.js";
3
+ import { S as withLogContext, d as logInfo, f as logWarn, u as logException } from "./logging-Dx0S5k2z.js";
4
+ import { a as getChatConfig } from "./config-G2gv97R1.js";
5
+ import { At as recordConversationRetry, Bt as isFinalAttempt, Ct as drainConversationMailbox, Et as getConversationWorkState, Ft as startConversationWork, Nt as requestAnotherSlice, St as deadLetterAttempt, Vt as isInvalidConversationRecordError, _t as clearConsumedConversationWake, bt as completeConversationWork, dt as ackMessages, gt as checkInConversationWork, jt as releaseConversationWork, kt as recordAttemptFailure, mt as beginConversationResume, wt as ensureConversationWake, xt as countPendingConversationMessages, yt as completeConversationStop } from "./stats-CFlUGqVA.js";
6
6
  import { c as ConversationQueueMessageRejectedError } from "./vercel-queue-DIkVcfK4.js";
7
- import { a as getTurnRequestDeadline } from "./job-queue-CyTc24Es.js";
7
+ import { a as getTurnRequestDeadline } from "./job-queue-rnAPfUhP.js";
8
8
  //#region src/chat/task-execution/worker.ts
9
9
  var worker_exports = /* @__PURE__ */ __exportAll({
10
10
  CONVERSATION_WORK_DEFER_DELAY_MS: () => CONVERSATION_WORK_DEFER_DELAY_MS,
@@ -0,0 +1,27 @@
1
+ UPDATE "junior_scheduler_tasks"
2
+ SET "record" = jsonb_set(
3
+ "record",
4
+ '{outcomes}',
5
+ jsonb_build_array(
6
+ jsonb_build_object(
7
+ 'action', 'send_message',
8
+ 'destination', "record"->'destination'
9
+ )
10
+ ),
11
+ true
12
+ )
13
+ WHERE NOT "record" ? 'outcomes';
14
+ --> statement-breakpoint
15
+ UPDATE "junior_event_tasks"
16
+ SET "task_json" = jsonb_set(
17
+ "task_json",
18
+ '{outcomes}',
19
+ jsonb_build_array(
20
+ jsonb_build_object(
21
+ 'action', 'send_message',
22
+ 'destination', "task_json"->'destination'
23
+ )
24
+ ),
25
+ true
26
+ )
27
+ WHERE NOT "task_json" ? 'outcomes';