@sentry/junior 0.270.0 → 0.271.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 (69) hide show
  1. package/dist/{actor-CP9K2Idu.js → actor-B4DYygOB.js} +1 -1
  2. package/dist/{adapter-BQNTKVTF.js → adapter-Bqbtr1RV.js} +1 -1
  3. package/dist/{admin-CKVEoXa4.js → admin-CWBjzyN0.js} +1 -1
  4. package/dist/{agent-runner-MSQSMFkq.js → agent-runner-BiHsH8O_.js} +36 -29
  5. package/dist/api/schema.d.ts +1 -1
  6. package/dist/api/schema.js +2 -2
  7. package/dist/api.d.ts +1 -1
  8. package/dist/api.js +34 -32
  9. package/dist/{app-Bz8t4P8p.d.ts → app-C81xfpNa.d.ts} +8 -2
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +72 -31
  12. package/dist/{interruption-marker-CdblrIQK.js → assistant-reply-DgtX9DaJ.js} +2 -8
  13. package/dist/{briefs-DNFzFFVx.js → briefs-0FeSJHQ3.js} +2 -2
  14. package/dist/{catalog-runtime-Bdym_wKy.js → catalog-runtime-Bw9kjGVu.js} +1 -1
  15. package/dist/cli/chat.js +14 -14
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/main.js +3 -3
  18. package/dist/cli/plugins.js +4 -4
  19. package/dist/cli/snapshot-create.js +4 -4
  20. package/dist/cli/upgrade.d.ts +1 -1
  21. package/dist/cli/upgrade.js +3 -3
  22. package/dist/{client-B2MjENki.js → client-B0jlQSgO.js} +2 -2
  23. package/dist/{config-Dm3pWRqY.js → config-DrAeD8sr.js} +2 -2
  24. package/dist/{connections-0BBhiD-p.js → connections-BzN2K0G9.js} +10 -10
  25. package/dist/{conversation-privacy-C1pJ89rs.js → conversation-privacy-D1NhUxyo.js} +1 -1
  26. package/dist/{credential-sync-BRiWYs6_.js → credential-sync-DpNWl4yy.js} +15 -15
  27. package/dist/{credentialed-BeBaJMZ_.js → credentialed-mh7HBqey.js} +31 -24
  28. package/dist/{db-BYOuu6v2.d.ts → db-DSabI7jJ.d.ts} +1 -1
  29. package/dist/{executor-BB6eJkD4.js → executor-C2cRw0hZ.js} +7 -2
  30. package/dist/instrumentation.js +2 -2
  31. package/dist/{job-queue-DiaXoSDg.js → job-queue-CEeLYkSj.js} +2 -2
  32. package/dist/{list-BTDRxkOg.js → list-DjJJ5K0x.js} +26 -26
  33. package/dist/{logging-C6EdT6PP.js → logging-DuwXUuIY.js} +1 -1
  34. package/dist/{message-DsjiWRVg.js → message-CRe3WBKc.js} +4 -4
  35. package/dist/nitro.d.ts +1 -1
  36. package/dist/nitro.js +3 -3
  37. package/dist/{oauth-callback-server-CjFFVGqa.js → oauth-callback-server-oM5TJt34.js} +2 -2
  38. package/dist/{registry-CndmkP2P.js → registry-BPtbAVFo.js} +2 -2
  39. package/dist/{reporting-window-DRCi1Ls_.js → reporting-window-DgHgwQB3.js} +6 -1
  40. package/dist/{resolve-BkAA1wH7.js → resolve-D44G1jJm.js} +3 -3
  41. package/dist/{result-9TJTpuYP.js → result-CvP8c5bb.js} +9 -9
  42. package/dist/{runner-BmKLSyJm.js → runner-FIGIKvk2.js} +10 -10
  43. package/dist/{sandbox-egress-signals-CjLaogMo.js → sandbox-egress-signals-C_JzucwP.js} +1 -1
  44. package/dist/{schema-DNLJ_MzW.js → schema-DKZgO-xf.js} +10 -5
  45. package/dist/{schema-WayPSHFu.d.ts → schema-DPCvePop.d.ts} +13 -2
  46. package/dist/{service-account-DlhYl-Mu.js → service-account-1mJGRAvx.js} +3 -3
  47. package/dist/{service-account-D6e9cVmH.js → service-account-CHO3YXpt.js} +3 -3
  48. package/dist/{session-stop-MZRgYqYH.js → session-stop-DuUB1rwQ.js} +41 -139
  49. package/dist/{skills-BggTR_ue.js → skills-DHK7L9Eo.js} +2 -2
  50. package/dist/{spawn-DmtlcAT_.js → spawn-CKl_ySIq.js} +2 -2
  51. package/dist/{store-BeWGgaMA.js → store-BF2XEeQz.js} +3 -3
  52. package/dist/{store-Byarin7b.js → store-Di0E4EvU.js} +3 -3
  53. package/dist/{task-queue-Dt1_ZoI_.js → task-queue-CC7IFtbT.js} +3 -3
  54. package/dist/{task-runner-DyKqAPpm.js → task-runner-DKZtMFwa.js} +7 -7
  55. package/dist/{thread-state-BHBLMvgb.js → thread-state-BQ1T3eeF.js} +5 -5
  56. package/dist/{turn-failure-response-DWXy_0oJ.js → turn-failure-response-B5eSFoHn.js} +14 -9
  57. package/dist/{turn-lifecycle-AiXkVqCB.js → turn-lifecycle-CTLEIEOn.js} +1 -1
  58. package/dist/{turn-session-routing-B9KLBhaT.js → turn-session-routing-BFVp8TbU.js} +11 -11
  59. package/dist/{validation-BW60Vtx_.js → validation-Cjo-3yt3.js} +1 -1
  60. package/dist/{version-CivPYmkH.js → version-D30MBLLw.js} +1 -1
  61. package/dist/version.js +1 -1
  62. package/dist/{viewer-BTgAfdUg.js → viewer-D3jhuP66.js} +4 -4
  63. package/dist/{work-Bjm52fHo.js → work-CL9QwQcl.js} +10 -10
  64. package/dist/{worker-CMbgtHLu.js → worker-S2P7IJDI.js} +6 -6
  65. package/migrations/0071_review_item_turn.sql +1 -0
  66. package/migrations/AGENTS.md +3 -12
  67. package/migrations/meta/0071_snapshot.json +4003 -0
  68. package/migrations/meta/_journal.json +7 -0
  69. package/package.json +4 -4
@@ -1,16 +1,16 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { Cr as isAssistantMessage, Dr as normalizeToolNameFromResult, Er as isToolResultMessage, Tr as isToolResultError, dt as CORE_EVENT_NAMESPACE, ht as eventGuidance, mt as eventCatalogEntry } from "./turn-session-routing-B9KLBhaT.js";
3
- import { n as botConfig } from "./config-Dm3pWRqY.js";
4
- import { h as logWarn, m as logInfo, p as logException } from "./logging-C6EdT6PP.js";
5
- import { C as getSqlExecutor, j as SYSTEM_IDENTITY_ID, x as getConversationStore } from "./viewer-BTgAfdUg.js";
2
+ import { Cr as isAssistantMessage, Dr as normalizeToolNameFromResult, Er as isToolResultMessage, Tr as isToolResultError, dt as CORE_EVENT_NAMESPACE, ht as eventGuidance, mt as eventCatalogEntry } from "./turn-session-routing-BFVp8TbU.js";
3
+ import { n as botConfig } from "./config-DrAeD8sr.js";
4
+ import { h as logWarn, m as logInfo, p as logException } from "./logging-DuwXUuIY.js";
5
+ import { C as getSqlExecutor, j as SYSTEM_IDENTITY_ID, x as getConversationStore } from "./viewer-D3jhuP66.js";
6
6
  import { s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
7
- import "./executor-BB6eJkD4.js";
8
- import { h as credentialSubjectSchema } from "./registry-CndmkP2P.js";
9
- import { Et as postSlackMessage, Hn as ToolInputError, In as JUNIOR_THREAD_STATE_TTL_MS, Ln as getDashboardConversationLink, Rn as getDashboardObjectIconLink, Sn as verifyTimerWatchCredentialSubject, gt as normalizeSlackReplyMarkdown, ht as formatSlackLink, l as getPluginSlackConversationLink, mt as escapeSlackMrkdwnText, p as getPlugins, vr as buildSentryConversationUrl } from "./credentialed-BeBaJMZ_.js";
10
- import { r as getStateAdapter } from "./adapter-BQNTKVTF.js";
7
+ import "./executor-C2cRw0hZ.js";
8
+ import { h as credentialSubjectSchema } from "./registry-BPtbAVFo.js";
9
+ import { Et as postSlackMessage, Hn as ToolInputError, In as JUNIOR_THREAD_STATE_TTL_MS, Ln as getDashboardConversationLink, Rn as getDashboardObjectIconLink, Sn as verifyTimerWatchCredentialSubject, gt as normalizeSlackReplyMarkdown, ht as formatSlackLink, l as getPluginSlackConversationLink, mt as escapeSlackMrkdwnText, p as getPlugins, vr as buildSentryConversationUrl } from "./credentialed-mh7HBqey.js";
10
+ import { r as getStateAdapter } from "./adapter-Bqbtr1RV.js";
11
11
  import { r as EVENT_AUTHOR_ID } from "./prompt-BPSdXYXV.js";
12
- import { i as sanitizeAssistantText, t as getInterruptionMarker } from "./interruption-marker-CdblrIQK.js";
13
- import { r as appendAndEnqueueInboundMessage } from "./store-BeWGgaMA.js";
12
+ import { r as sanitizeAssistantText } from "./assistant-reply-DgtX9DaJ.js";
13
+ import { r as appendAndEnqueueInboundMessage } from "./store-BF2XEeQz.js";
14
14
  import { z } from "zod";
15
15
  import { eq, inArray } from "drizzle-orm";
16
16
  import { eventMatchFieldsSchema, objectFactFields, objectPresentation, objectTypeSchema } from "@sentry/junior-plugin-api";
@@ -501,44 +501,7 @@ function buildSlackReplyBlocks(text, footer) {
501
501
  return blocks.length ? blocks : void 0;
502
502
  }
503
503
  // src/chat/slack/output.ts
504
- const MAX_INLINE_CHARS = 2200;
505
- const MAX_INLINE_LINES = 45;
506
- const CONTINUED_MARKER = "\n\n[Continued below]";
507
- function countSlackLines(text) {
508
- if (!text) return 0;
509
- return text.split("\n").length;
510
- }
511
- function fitsInlineBudget(text, maxChars = MAX_INLINE_CHARS, maxLines = MAX_INLINE_LINES) {
512
- return text.length <= maxChars && countSlackLines(text) <= maxLines;
513
- }
514
- function findSplitIndex(text, maxChars) {
515
- if (text.length <= maxChars) return text.length;
516
- const bounded = text.slice(0, maxChars);
517
- const newlineIndex = bounded.lastIndexOf("\n");
518
- if (newlineIndex > 0) return newlineIndex;
519
- const spaceIndex = bounded.lastIndexOf(" ");
520
- if (spaceIndex > 0) return spaceIndex;
521
- return maxChars;
522
- }
523
- function splitByLineBudget(text, maxLines) {
524
- if (maxLines <= 0) return "";
525
- const lines = text.split("\n");
526
- if (lines.length <= maxLines) return text;
527
- return lines.slice(0, maxLines).join("\n");
528
- }
529
- function reserveInlineBudgetForSuffix(suffix, maxChars = MAX_INLINE_CHARS, maxLines = MAX_INLINE_LINES) {
530
- return {
531
- maxChars: Math.max(1, maxChars - suffix.length),
532
- maxLines: Math.max(1, maxLines - Math.max(0, countSlackLines(suffix) - 1))
533
- };
534
- }
535
- function forceSplitBudget(text, budget) {
536
- const lineCount = countSlackLines(text);
537
- return {
538
- maxChars: text.length <= budget.maxChars ? Math.max(1, text.length - 1) : budget.maxChars,
539
- maxLines: lineCount <= budget.maxLines ? Math.max(1, lineCount - 1) : budget.maxLines
540
- };
541
- }
504
+ const MAX_INLINE_CHARS = 4e3;
542
505
  function getFenceContinuation(text) {
543
506
  let open;
544
507
  for (const line of text.split("\n")) {
@@ -560,113 +523,52 @@ function getFenceContinuation(text) {
560
523
  reopenPrefix: `${open.openerLine}\n`
561
524
  };
562
525
  }
563
- function appendSlackSuffix(text, marker) {
564
- return `${text}${getFenceContinuation(text)?.closeSuffix ?? ""}${marker}`;
565
- }
566
- function stripTrailingContinuationMarker(text) {
567
- return text.endsWith(CONTINUED_MARKER) ? text.slice(0, -19) : text;
526
+ function findSplitIndex(text, maxChars) {
527
+ const bounded = text.slice(0, maxChars);
528
+ const newlineIndex = bounded.lastIndexOf("\n");
529
+ if (newlineIndex > 0) return newlineIndex;
530
+ const spaceIndex = bounded.lastIndexOf(" ");
531
+ if (spaceIndex > 0) return spaceIndex;
532
+ return maxChars;
568
533
  }
569
- function takeSlackContinuationChunk(text, budget) {
570
- let { prefix, rest } = takeSlackInlinePrefix(text, budget);
571
- if (!rest) ({prefix, rest} = takeSlackInlinePrefix(text, forceSplitBudget(text, budget)));
572
- let carryover = rest ? getFenceContinuation(prefix) : null;
573
- if (!carryover) return {
574
- prefix,
575
- rest
576
- };
577
- const carryoverBudget = reserveInlineBudgetForSuffix(`${carryover.closeSuffix}${CONTINUED_MARKER}`);
578
- ({prefix, rest} = takeSlackInlinePrefix(text, carryoverBudget));
579
- if (!rest) ({prefix, rest} = takeSlackInlinePrefix(text, forceSplitBudget(text, carryoverBudget)));
580
- carryover = rest ? getFenceContinuation(prefix) : null;
581
- if (!carryover) return {
582
- prefix,
583
- rest
584
- };
534
+ function takePrefix(text, maxChars) {
535
+ const prefix = text.slice(0, findSplitIndex(text, maxChars)).trimEnd() || text.slice(0, maxChars);
585
536
  return {
586
537
  prefix,
587
- rest: `${carryover.reopenPrefix}${rest}`
538
+ rest: text.slice(prefix.length).trimStart()
588
539
  };
589
540
  }
590
- /** Return the first continuation-safe chunk plus any remaining text. */
591
- function takeSlackContinuationPrefix(text, options) {
592
- const budget = {
593
- maxChars: options?.maxChars ?? getSlackContinuationBudget().maxChars,
594
- maxLines: options?.maxLines ?? getSlackContinuationBudget().maxLines
595
- };
596
- const { prefix, rest } = (() => {
597
- if (options?.forceSplit) return takeSlackContinuationChunk(text, budget);
598
- const initial = takeSlackInlinePrefix(text, budget);
599
- return initial.rest ? takeSlackContinuationChunk(text, budget) : initial;
600
- })();
601
- return {
602
- prefix,
603
- renderedPrefix: rest ? appendSlackSuffix(prefix, CONTINUED_MARKER) : prefix,
541
+ /** Take one post that fits the budget, closing a code fence it leaves open. */
542
+ function takeChunk(text) {
543
+ let { prefix, rest } = takePrefix(text, MAX_INLINE_CHARS);
544
+ let carryover = getFenceContinuation(prefix);
545
+ if (!carryover) return {
546
+ chunk: prefix,
604
547
  rest
605
548
  };
606
- }
607
- /**
608
- * Take the largest Slack-safe inline prefix from `text` under the configured
609
- * character and line budgets. Returns the consumed prefix plus remaining text.
610
- */
611
- function takeSlackInlinePrefix(text, options) {
612
- const maxChars = options?.maxChars ?? MAX_INLINE_CHARS;
613
- const maxLines = options?.maxLines ?? MAX_INLINE_LINES;
614
- const normalized = text.replace(/\r\n?/g, "\n");
615
- if (!normalized) return {
616
- prefix: "",
617
- rest: ""
618
- };
619
- if (fitsInlineBudget(normalized, maxChars, maxLines)) return {
620
- prefix: normalized,
621
- rest: ""
622
- };
623
- const lineBounded = splitByLineBudget(normalized, maxLines);
624
- const cutIndex = findSplitIndex(lineBounded, maxChars);
625
- const prefix = lineBounded.slice(0, cutIndex).trimEnd();
626
- if (prefix) return {
627
- prefix,
628
- rest: normalized.slice(prefix.length).trimStart()
549
+ ({prefix, rest} = takePrefix(text, MAX_INLINE_CHARS - carryover.closeSuffix.length));
550
+ carryover = getFenceContinuation(prefix);
551
+ if (!carryover || !rest) return {
552
+ chunk: prefix,
553
+ rest
629
554
  };
630
- const hardPrefix = normalized.slice(0, Math.max(1, maxChars)).trimEnd();
631
555
  return {
632
- prefix: hardPrefix || normalized.slice(0, Math.max(1, maxChars)),
633
- rest: normalized.slice(hardPrefix.length || Math.max(1, maxChars)).trimStart()
556
+ chunk: `${prefix}${carryover.closeSuffix}`,
557
+ rest: `${carryover.reopenPrefix}${rest}`
634
558
  };
635
559
  }
636
- /**
637
- * Split a normalized Slack reply into multiple inline-safe thread messages.
638
- *
639
- * Replies split across more than two messages receive explicit continuation
640
- * markers on non-final chunks. When
641
- * `interrupted` is true, the final chunk receives an interruption marker.
642
- */
643
- function splitSlackReplyText(text, options) {
644
- const normalized = normalizeSlackReplyMarkdown(text);
645
- if (!normalized) return [];
560
+ /** Split a normalized Slack reply into thread posts that fit Slack limits. */
561
+ function splitSlackReplyText(text) {
646
562
  const chunks = [];
647
- const continuationBudget = reserveInlineBudgetForSuffix(CONTINUED_MARKER);
648
- let remaining = normalized;
649
- while (remaining) {
650
- if (options?.interrupted ? fitsInlineBudget(appendSlackSuffix(remaining, getInterruptionMarker())) : fitsInlineBudget(remaining)) {
651
- chunks.push(options?.interrupted ? appendSlackSuffix(remaining, getInterruptionMarker()) : remaining);
652
- break;
653
- }
654
- const { renderedPrefix, rest } = takeSlackContinuationPrefix(remaining, {
655
- ...continuationBudget,
656
- forceSplit: true
657
- });
658
- chunks.push(renderedPrefix);
563
+ let remaining = normalizeSlackReplyMarkdown(text);
564
+ while (remaining.length > MAX_INLINE_CHARS) {
565
+ const { chunk, rest } = takeChunk(remaining);
566
+ chunks.push(chunk);
659
567
  remaining = rest;
660
568
  }
661
- if (chunks.length === 2) chunks[0] = stripTrailingContinuationMarker(chunks[0] ?? "");
569
+ if (remaining) chunks.push(remaining);
662
570
  return chunks;
663
571
  }
664
- /**
665
- * Reserve enough inline budget for a continuation suffix on the current chunk.
666
- */
667
- function getSlackContinuationBudget() {
668
- return reserveInlineBudgetForSuffix(CONTINUED_MARKER);
669
- }
670
572
  // src/chat/slack/reply.ts
671
573
  /**
672
574
  * Resolve where a Turn posts in Slack.
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { h as logWarn } from "./logging-C6EdT6PP.js";
2
+ import { h as logWarn } from "./logging-DuwXUuIY.js";
3
3
  import { s as skillRoots } from "./package-discovery-DJBompdd.js";
4
- import { n as pluginCatalogRuntime } from "./catalog-runtime-Bdym_wKy.js";
4
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Bw9kjGVu.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-nwUcYXjP.js";
2
- import { At as actorFromRun, jt as toolInvocationDestination } from "./agent-runner-MSQSMFkq.js";
3
- import { n as createAndEnqueueAgentInvocation } from "./work-Bjm52fHo.js";
2
+ import { Mt as toolInvocationDestination, jt as actorFromRun } from "./agent-runner-BiHsH8O_.js";
3
+ import { n as createAndEnqueueAgentInvocation } from "./work-CL9QwQcl.js";
4
4
  // 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,6 +1,6 @@
1
- import { $n as recordAttemptFailure$1, Bn as clearExpiredConversationLease$1, Fn as appendInboundMessage, Gn as getConversation$1, Hn as completeConversationWork$1, In as beginConversationResume$1, Kn as getConversationWorkState$1, Ln as cancelHumanFacingPendingMessages$1, Nn as ackMessages$1, Pn as appendExclusiveInboundMessage, Qn as markConversationWorkEnqueued$1, Rn as checkInConversationWork$1, Un as deadLetterAttempt$1, Vn as completeConversationStop$1, Wn as drainConversationMailbox$1, Zn as listActiveConversationIds$1, ar as startConversationWork$1, er as recordConversationRetry$1, ir as requestConversationWork$1, nr as removeActiveConversation$1, or as steerWebPendingMessages$1, rr as requestAnotherSlice$1, sr as stopConversationWork$1, tr as releaseConversationWork$1, zn as clearConsumedConversationWake$1 } from "./turn-session-routing-B9KLBhaT.js";
2
- import { x as getConversationStore } from "./viewer-BTgAfdUg.js";
3
- import "./job-queue-DiaXoSDg.js";
1
+ import { $n as recordAttemptFailure$1, Bn as clearExpiredConversationLease$1, Fn as appendInboundMessage, Gn as getConversation$1, Hn as completeConversationWork$1, In as beginConversationResume$1, Kn as getConversationWorkState$1, Ln as cancelHumanFacingPendingMessages$1, Nn as ackMessages$1, Pn as appendExclusiveInboundMessage, Qn as markConversationWorkEnqueued$1, Rn as checkInConversationWork$1, Un as deadLetterAttempt$1, Vn as completeConversationStop$1, Wn as drainConversationMailbox$1, Zn as listActiveConversationIds$1, ar as startConversationWork$1, er as recordConversationRetry$1, ir as requestConversationWork$1, nr as removeActiveConversation$1, or as steerWebPendingMessages$1, rr as requestAnotherSlice$1, sr as stopConversationWork$1, tr as releaseConversationWork$1, zn as clearConsumedConversationWake$1 } from "./turn-session-routing-BFVp8TbU.js";
2
+ import { x as getConversationStore } from "./viewer-D3jhuP66.js";
3
+ import "./job-queue-CEeLYkSj.js";
4
4
  // src/chat/task-execution/store.ts
5
5
  function metadataStore(options) {
6
6
  return options.conversationStore ?? getConversationStore();
@@ -1,8 +1,8 @@
1
1
  import { c as modelProfileSchema, u as TURN_REASONING_LEVELS } from "./model-profile-B998sjVd.js";
2
- import { C as getSqlExecutor, x as getConversationStore } from "./viewer-BTgAfdUg.js";
2
+ import { C as getSqlExecutor, x as getConversationStore } from "./viewer-D3jhuP66.js";
3
3
  import { a as juniorAgentInvocations, i as juniorAgentBindings, n as AGENT_INVOCATION_PARENT_MAILBOX_STATUSES, t as AGENT_INVOCATION_MAILBOX_STATUSES } from "./agent-invocations-C1RNOCs8.js";
4
- import "./executor-BB6eJkD4.js";
5
- import { p as credentialContextSchema } from "./registry-CndmkP2P.js";
4
+ import "./executor-C2cRw0hZ.js";
5
+ import { p as credentialContextSchema } from "./registry-BPtbAVFo.js";
6
6
  import { z } from "zod";
7
7
  import { createHash } from "node:crypto";
8
8
  import { and, asc, count, countDistinct, desc, eq, inArray, lt, ne, or, sql } from "drizzle-orm";
@@ -1,5 +1,5 @@
1
- import { h as logWarn } from "./logging-C6EdT6PP.js";
2
- import { c as QUEUE_SIGNATURE_MAX_AGE_MS, d as getQueueProvider, l as signQueueMessage, p as runWithTurnRequestDeadline, u as verifyQueueMessage } from "./job-queue-DiaXoSDg.js";
1
+ import { h as logWarn } from "./logging-DuwXUuIY.js";
2
+ import { c as QUEUE_SIGNATURE_MAX_AGE_MS, d as getQueueProvider, l as signQueueMessage, p as runWithTurnRequestDeadline, u as verifyQueueMessage } from "./job-queue-CEeLYkSj.js";
3
3
  import { z } from "zod";
4
4
  import { createHash } from "node:crypto";
5
5
  // src/chat/queue/callback.ts
@@ -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-DyKqAPpm.js").then((n) => n.r);
113
+ const { processPluginTask } = await import("./task-runner-DKZtMFwa.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-nwUcYXjP.js";
2
- import { Dr as normalizeToolNameFromResult, Er as isToolResultMessage, Gt as hydrateConversationMessages, On as getTurnRecord, Sr as instructionTextForProjection, Tr as isToolResultError, kr as stripRuntimeTurnContext, t as resolveConversationRouting, u as getDispatchRecord, vr as getPiMessageRole } from "./turn-session-routing-B9KLBhaT.js";
3
- import { m as parseSlackMessageTs } from "./actor-CP9K2Idu.js";
4
- import { S as getDb, i as readActorIdentity, x as getConversationStore } from "./viewer-BTgAfdUg.js";
2
+ import { Dr as normalizeToolNameFromResult, Er as isToolResultMessage, Gt as hydrateConversationMessages, On as getTurnRecord, Sr as instructionTextForProjection, Tr as isToolResultError, kr as stripRuntimeTurnContext, t as resolveConversationRouting, u as getDispatchRecord, vr as getPiMessageRole } from "./turn-session-routing-BFVp8TbU.js";
3
+ import { h as parseSlackMessageTs } from "./actor-B4DYygOB.js";
4
+ import { S as getDb, i as readActorIdentity, x as getConversationStore } from "./viewer-D3jhuP66.js";
5
5
  import { _ as sameActorIdentity } from "./media-U6Tuz6Mi.js";
6
- import { ar as createPluginLogger, g as coreTaskRegistrations, hr as createPluginConversationEvents, ir as createPluginModel, jr as createPluginCache, nr as createPluginState, p as getPlugins, rr as createPluginEmbedder } from "./credentialed-BeBaJMZ_.js";
7
- import { r as getStateAdapter } from "./adapter-BQNTKVTF.js";
8
- import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-BHBLMvgb.js";
9
- import { i as pluginTaskParamsSchema, r as pluginTaskId, s as sendVercelPluginTask } from "./task-queue-Dt1_ZoI_.js";
6
+ import { ar as createPluginLogger, g as coreTaskRegistrations, hr as createPluginConversationEvents, ir as createPluginModel, jr as createPluginCache, nr as createPluginState, p as getPlugins, rr as createPluginEmbedder } from "./credentialed-mh7HBqey.js";
7
+ import { r as getStateAdapter } from "./adapter-Bqbtr1RV.js";
8
+ import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-BQ1T3eeF.js";
9
+ import { i as pluginTaskParamsSchema, r as pluginTaskId, s as sendVercelPluginTask } from "./task-queue-CC7IFtbT.js";
10
10
  import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
11
11
  // src/chat/plugins/task-runner.ts
12
12
  /**
@@ -1,8 +1,8 @@
1
- import { Kr as createDurableLocationConfigurationService, Kt as persistConversationMessages } from "./turn-session-routing-B9KLBhaT.js";
2
- import { B as isRecord, H as toOptionalString, V as toOptionalNumber } from "./logging-C6EdT6PP.js";
3
- import { S as getDb } from "./viewer-BTgAfdUg.js";
4
- import { In as JUNIOR_THREAD_STATE_TTL_MS } from "./credentialed-BeBaJMZ_.js";
5
- import { r as getStateAdapter } from "./adapter-BQNTKVTF.js";
1
+ import { Kr as createDurableLocationConfigurationService, Kt as persistConversationMessages } from "./turn-session-routing-BFVp8TbU.js";
2
+ import { B as isRecord, H as toOptionalString, V as toOptionalNumber } from "./logging-DuwXUuIY.js";
3
+ import { S as getDb } from "./viewer-D3jhuP66.js";
4
+ import { In as JUNIOR_THREAD_STATE_TTL_MS } from "./credentialed-mh7HBqey.js";
5
+ import { r as getStateAdapter } from "./adapter-Bqbtr1RV.js";
6
6
  // src/chat/state/conversation.ts
7
7
  function defaultConversationState() {
8
8
  return {
@@ -1,13 +1,12 @@
1
- import { Fr as buildDeterministicTurnId, Gt as hydrateConversationMessages, an as markConversationMessage, yn as clearPendingAuth } from "./turn-session-routing-B9KLBhaT.js";
2
- import { _ as getProviderErrorAttributes, g as findProviderError, m as ProviderError, v as getProviderErrorUserMessage } from "./client-B2MjENki.js";
3
- import { B as isRecord, t as buildTurnFailureResponse } from "./logging-C6EdT6PP.js";
4
- import { m as parseSlackMessageTs } from "./actor-CP9K2Idu.js";
5
- import { S as getDb, y as getConversationEventStore } from "./viewer-BTgAfdUg.js";
6
- import { Er as listConversationAnnotations } from "./credentialed-BeBaJMZ_.js";
1
+ import { Fr as buildDeterministicTurnId, Gt as hydrateConversationMessages, an as markConversationMessage, yn as clearPendingAuth } from "./turn-session-routing-BFVp8TbU.js";
2
+ import { _ as getProviderErrorAttributes, g as findProviderError, m as ProviderError, v as getProviderErrorUserMessage } from "./client-B0jlQSgO.js";
3
+ import { B as isRecord, t as buildTurnFailureResponse } from "./logging-DuwXUuIY.js";
4
+ import { h as parseSlackMessageTs } from "./actor-B4DYygOB.js";
5
+ import { S as getDb, y as getConversationEventStore } from "./viewer-D3jhuP66.js";
6
+ import { Er as listConversationAnnotations } from "./credentialed-mh7HBqey.js";
7
7
  import { B as removedCardSchema, V as resolveMessageCards, z as readMessageCardRefs } from "./conversation-AhOVzN_k.js";
8
- import { D as parseAgentInvocationResultMessageId, J as markTurnClosed, Y as markTurnCompleted, c as getAgentInvocation, m as getAgentInvocationTurnId } from "./store-Byarin7b.js";
9
- import { t as getInterruptionMarker } from "./interruption-marker-CdblrIQK.js";
10
- import { a as persistThreadStateById, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-BHBLMvgb.js";
8
+ import { D as parseAgentInvocationResultMessageId, J as markTurnClosed, Y as markTurnCompleted, c as getAgentInvocation, m as getAgentInvocationTurnId } from "./store-Di0E4EvU.js";
9
+ import { a as persistThreadStateById, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-BQ1T3eeF.js";
11
10
  // src/chat/conversations/pending-cards.ts
12
11
  /**
13
12
  * Add the cards that tool results selected since the last visible assistant
@@ -140,6 +139,12 @@ async function persistAuthPauseTurnState(args) {
140
139
  });
141
140
  await persistThreadStateById(args.threadStateId, { conversation });
142
141
  }
142
+ // src/chat/interruption-marker.ts
143
+ const INTERRUPTED_MARKER = "\n\n[Response interrupted before completion]";
144
+ /** Return the marker added when a visible reply ended mid-execution. */
145
+ function getInterruptionMarker() {
146
+ return INTERRUPTED_MARKER;
147
+ }
143
148
  // src/chat/services/turn-failure-response.ts
144
149
  /** Require captured turn failures to carry a real Sentry event reference. */
145
150
  function requireTurnFailureEventId(eventId, eventName) {
@@ -1,4 +1,4 @@
1
- import { y as getConversationEventStore } from "./viewer-BTgAfdUg.js";
1
+ import { y as getConversationEventStore } from "./viewer-D3jhuP66.js";
2
2
  // src/chat/conversations/turn-lifecycle.ts
3
3
  /** Persist correlated turn lifecycle facts with retry-safe terminal exclusion. */
4
4
  var ConversationTurnLifecycleService = class {
@@ -1,16 +1,16 @@
1
- import { a as completeText, f as unwrapCurrentInstruction, p as escapeXml, s as resolveGatewayModel, y as isProviderRetryError } from "./client-B2MjENki.js";
2
- import { i as getChatConfig, n as botConfig } from "./config-Dm3pWRqY.js";
3
- import { B as isRecord, E as withSpan, H as toOptionalString, V as toOptionalNumber, _ as runBestEffort, b as setSpanAttributes, h as logWarn, o as getActiveTraceContext, p as logException, t as buildTurnFailureResponse } from "./logging-C6EdT6PP.js";
4
- import { c as parseStoredSlackActor, l as toStoredSlackActor, m as parseSlackMessageTs } from "./actor-CP9K2Idu.js";
5
- import { A as startLocationThread, C as getSqlExecutor, G as agentTurnTotalTokens, M as resolveActorIdentityId, Q as sameDestination, S as getDb, T as withConversationEventLock, U as addAgentTurnUsage, V as bindProviderConversation, W as agentTurnCostUsd, X as parseDestination, w as createSqlConversationEventStore, x as getConversationStore, y as getConversationEventStore } from "./viewer-BTgAfdUg.js";
1
+ import { a as completeText, f as unwrapCurrentInstruction, p as escapeXml, s as resolveGatewayModel, y as isProviderRetryError } from "./client-B0jlQSgO.js";
2
+ import { i as getChatConfig, n as botConfig } from "./config-DrAeD8sr.js";
3
+ import { B as isRecord, E as withSpan, H as toOptionalString, V as toOptionalNumber, _ as runBestEffort, b as setSpanAttributes, h as logWarn, o as getActiveTraceContext, p as logException, t as buildTurnFailureResponse } from "./logging-DuwXUuIY.js";
4
+ import { c as parseStoredSlackActor, h as parseSlackMessageTs, l as toStoredSlackActor } from "./actor-B4DYygOB.js";
5
+ import { A as startLocationThread, C as getSqlExecutor, G as agentTurnTotalTokens, M as resolveActorIdentityId, Q as sameDestination, S as getDb, T as withConversationEventLock, U as addAgentTurnUsage, V as bindProviderConversation, W as agentTurnCostUsd, X as parseDestination, w as createSqlConversationEventStore, x as getConversationStore, y as getConversationEventStore } from "./viewer-D3jhuP66.js";
6
6
  import { d as juniorDestinations, s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
7
- import { d as juniorAutomations, l as juniorAutomationRuns, p as juniorLocationConfigurations, u as juniorAutomationVersions } from "./executor-BB6eJkD4.js";
7
+ import { d as juniorAutomations, l as juniorAutomationRuns, p as juniorLocationConfigurations, u as juniorAutomationVersions } from "./executor-C2cRw0hZ.js";
8
8
  import { a as agentHistoryItemSchema, g as instructionProvenanceFor, h as instructionActors, m as contextProvenance } from "./media-U6Tuz6Mi.js";
9
- import { f as credentialContextForActor, h as credentialSubjectSchema } from "./registry-CndmkP2P.js";
10
- import { n as pluginCatalogRuntime } from "./catalog-runtime-Bdym_wKy.js";
11
- import { Bn as getDashboardTaskLink, Ct as openSlackDirectMessage, Et as postSlackMessage, Fr as authenticationUnlinkedEvent, Gt as parseSandboxEgressAuthRequiredSignal, Hn as ToolInputError, In as JUNIOR_THREAD_STATE_TTL_MS, Mr as JUNIOR_NATIVE_EVENT_NAMESPACE, Nn as sleep$1, Nr as agentsInstructionsUpdatedEvent, Pr as authenticationLinkedEvent, Yt as resolveSandboxEgressProviderForHost, ar as createPluginLogger, ht as formatSlackLink, jr as createPluginCache, mt as escapeSlackMrkdwnText, p as getPlugins, pt as startOAuthFlow, t as executeCredentialedEgressRequest, ut as formatProviderLabel } from "./credentialed-BeBaJMZ_.js";
9
+ import { f as credentialContextForActor, h as credentialSubjectSchema } from "./registry-BPtbAVFo.js";
10
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Bw9kjGVu.js";
11
+ import { Bn as getDashboardTaskLink, Ct as openSlackDirectMessage, Et as postSlackMessage, Fr as authenticationUnlinkedEvent, Gt as parseSandboxEgressAuthRequiredSignal, Hn as ToolInputError, In as JUNIOR_THREAD_STATE_TTL_MS, Mr as JUNIOR_NATIVE_EVENT_NAMESPACE, Nn as sleep$1, Nr as agentsInstructionsUpdatedEvent, Pr as authenticationLinkedEvent, Yt as resolveSandboxEgressProviderForHost, ar as createPluginLogger, ht as formatSlackLink, jr as createPluginCache, mt as escapeSlackMrkdwnText, p as getPlugins, pt as startOAuthFlow, t as executeCredentialedEgressRequest, ut as formatProviderLabel } from "./credentialed-mh7HBqey.js";
12
12
  import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
13
- import { n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-BQNTKVTF.js";
13
+ import { n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-Bqbtr1RV.js";
14
14
  import { L as messageCardRef } from "./conversation-AhOVzN_k.js";
15
15
  import { O as eventAutomationSchema, S as automationVersionSchema, j as scheduledAutomationSchema } from "./automation-Dwh_xcqM.js";
16
16
  import { isDeepStrictEqual } from "node:util";
@@ -6030,7 +6030,7 @@ function slackSourceForDestination(args) {
6030
6030
  * Reads parent Conversations when this Conversation has no Destination.
6031
6031
  */
6032
6032
  async function resolveConversationRouting(args) {
6033
- const conversationStore = args.conversationStore ?? (await import("./viewer-BTgAfdUg.js").then((n) => n.v)).getConversationStore();
6033
+ const conversationStore = args.conversationStore ?? (await import("./viewer-D3jhuP66.js").then((n) => n.v)).getConversationStore();
6034
6034
  const chain = await loadConversationChain(args.conversationId, conversationStore);
6035
6035
  let destination;
6036
6036
  let source;
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { n as pluginCatalogRuntime } from "./catalog-runtime-Bdym_wKy.js";
2
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Bw9kjGVu.js";
3
3
  import { isDeepStrictEqual } from "node:util";
4
4
  // src/chat/plugins/validation.ts
5
5
  var validation_exports = /* @__PURE__ */ __exportAll({
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.270.0";
2
+ var version = "0.271.0";
3
3
  // src/version.ts
4
4
  /** Installed Junior package version, or `unknown` when package metadata is unavailable. */
5
5
  const JUNIOR_VERSION = typeof version === "string" && version.trim() ? version : "unknown";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export { t as JUNIOR_VERSION } from "./version-CivPYmkH.js";
1
+ export { t as JUNIOR_VERSION } from "./version-D30MBLLw.js";
@@ -1,9 +1,9 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { i as getChatConfig } from "./config-Dm3pWRqY.js";
3
- import { L as GOOGLE_IDENTITY_PROVIDER, h as logWarn, z as normalizeIdentityEmail } from "./logging-C6EdT6PP.js";
4
- import { a as isSlackUserId, d as parseSlackChannelReferenceId, f as parseSlackTeamId, s as parseActorUserId } from "./actor-CP9K2Idu.js";
2
+ import { i as getChatConfig } from "./config-DrAeD8sr.js";
3
+ import { L as GOOGLE_IDENTITY_PROVIDER, h as logWarn, z as normalizeIdentityEmail } from "./logging-DuwXUuIY.js";
4
+ import { a as isSlackUserId, d as parseSlackChannelReferenceId, f as parseSlackTeamId, s as parseActorUserId } from "./actor-B4DYygOB.js";
5
5
  import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, o as conversationReadColumns, s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
6
- import { _ as CONVERSATION_METRICS, h as juniorConversationBindings, m as juniorConversationParticipants, t as createJuniorSqlExecutor, v as juniorConversationMetrics, x as juniorConversationAnnotations, y as juniorConversationEvents } from "./executor-BB6eJkD4.js";
6
+ import { _ as CONVERSATION_METRICS, h as juniorConversationBindings, m as juniorConversationParticipants, t as createJuniorSqlExecutor, v as juniorConversationMetrics, x as juniorConversationAnnotations, y as juniorConversationEvents } from "./executor-C2cRw0hZ.js";
7
7
  import { d as newConversationEventSchema, f as encodeHistoryPayload, l as decodeStoredConversationEvent, n as detectImageMediaType, o as conversationEventDataSchema, u as historyReplacementSchema, v as usageSchema } from "./media-U6Tuz6Mi.js";
8
8
  import { a as withLock } from "./locks-D-0h111u.js";
9
9
  import { createHash, randomUUID } from "node:crypto";
@@ -1,14 +1,14 @@
1
- import { Dn as failTurnRecord, Nt as openConversationProjection, On as getTurnRecord, Tn as abandonTurnRecord, dn as PluginCredentialFailureError, hn as AuthorizationFlowDisabledError, mr as isTurnExecutionLimitExceededError, wn as saveTurnCheckpoint, yr as getTerminalAssistantMessages } from "./turn-session-routing-B9KLBhaT.js";
2
- import { n as botConfig } from "./config-Dm3pWRqY.js";
3
- import { j as SYSTEM_IDENTITY_ID, x as getConversationStore, y as getConversationEventStore } from "./viewer-BTgAfdUg.js";
1
+ import { Dn as failTurnRecord, Nt as openConversationProjection, On as getTurnRecord, Tn as abandonTurnRecord, dn as PluginCredentialFailureError, hn as AuthorizationFlowDisabledError, mr as isTurnExecutionLimitExceededError, wn as saveTurnCheckpoint, yr as getTerminalAssistantMessages } from "./turn-session-routing-BFVp8TbU.js";
2
+ import { n as botConfig } from "./config-DrAeD8sr.js";
3
+ import { j as SYSTEM_IDENTITY_ID, x as getConversationStore, y as getConversationEventStore } from "./viewer-D3jhuP66.js";
4
4
  import { _ as sameActorIdentity, p as agentInstructionProvenance } from "./media-U6Tuz6Mi.js";
5
- import { Et as withoutSavedSteeringMessages, Mt as readBlockedReport, Tt as buildSteeringPiMessage, _t as recordSubagentEnded, ht as stopChildAgentsOf, vt as recordSubagentStarted } from "./agent-runner-MSQSMFkq.js";
6
- import { E as markAgentInvocationSteered, H as TurnInputCommitLostError, K as isTurnInputCommitLostError, L as agentTypeInstructions, O as reportReplacedAgentInvocation, R as agentTypeStartsWithParentHistory, S as markAgentInvocationMailboxAppended, T as markAgentInvocationRunning, W as getConversationTurnBoundaryError, _ as getLatestAgentInvocationForConversation, c as getAgentInvocation, f as getAgentInvocationMessageId, m as getAgentInvocationTurnId, n as completeAgentInvocation, r as createAgentInvocation, s as getActiveAgentInvocationForConversation, w as markAgentInvocationPaused, y as isTerminalAgentInvocation } from "./store-Byarin7b.js";
7
- import { r as getAssistantReplyText } from "./interruption-marker-CdblrIQK.js";
8
- import { C as maybePostAutomatedTurnLimitNotice, D as recordFinishedTurnForAutomatedLimit, O as resetAutomatedTurnLimit } from "./session-stop-MZRgYqYH.js";
9
- import { r as appendAndEnqueueInboundMessage } from "./store-BeWGgaMA.js";
10
- import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-AiXkVqCB.js";
11
- import { a as persistThreadStateById, n as getPersistedSandboxState, r as getPersistedThreadState } from "./thread-state-BHBLMvgb.js";
5
+ import { Dt as withoutSavedSteeringMessages, Et as buildSteeringPiMessage, Nt as readBlockedReport, gt as stopChildAgentsOf, vt as recordSubagentEnded, yt as recordSubagentStarted } from "./agent-runner-BiHsH8O_.js";
6
+ import { E as markAgentInvocationSteered, H as TurnInputCommitLostError, K as isTurnInputCommitLostError, L as agentTypeInstructions, O as reportReplacedAgentInvocation, R as agentTypeStartsWithParentHistory, S as markAgentInvocationMailboxAppended, T as markAgentInvocationRunning, W as getConversationTurnBoundaryError, _ as getLatestAgentInvocationForConversation, c as getAgentInvocation, f as getAgentInvocationMessageId, m as getAgentInvocationTurnId, n as completeAgentInvocation, r as createAgentInvocation, s as getActiveAgentInvocationForConversation, w as markAgentInvocationPaused, y as isTerminalAgentInvocation } from "./store-Di0E4EvU.js";
7
+ import { n as getAssistantReplyText } from "./assistant-reply-DgtX9DaJ.js";
8
+ import { C as maybePostAutomatedTurnLimitNotice, D as recordFinishedTurnForAutomatedLimit, O as resetAutomatedTurnLimit } from "./session-stop-DuUB1rwQ.js";
9
+ import { r as appendAndEnqueueInboundMessage } from "./store-BF2XEeQz.js";
10
+ import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-CTLEIEOn.js";
11
+ import { a as persistThreadStateById, n as getPersistedSandboxState, r as getPersistedThreadState } from "./thread-state-BQ1T3eeF.js";
12
12
  import { isDeepStrictEqual } from "node:util";
13
13
  import { z } from "zod";
14
14
  // src/chat/runtime/turn-execution.ts
@@ -1,10 +1,10 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { Xn as isInvalidConversationRecordError, Yn as isFinalAttempt, qn as hasConversationStop } from "./turn-session-routing-B9KLBhaT.js";
3
- import { y as isProviderRetryError } from "./client-B2MjENki.js";
4
- import { i as getChatConfig } from "./config-Dm3pWRqY.js";
5
- import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-C6EdT6PP.js";
6
- import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-DiaXoSDg.js";
7
- import { C as requestAnotherSlice, T as startConversationWork, b as recordConversationRetry, d as countPendingConversationMessages, f as deadLetterAttempt, g as getConversationWorkState, i as beginConversationResume, l as completeConversationStop, m as ensureConversationWake, o as checkInConversationWork, p as drainConversationMailbox, s as clearConsumedConversationWake, t as ackMessages, u as completeConversationWork, x as releaseConversationWork, y as recordAttemptFailure } from "./store-BeWGgaMA.js";
2
+ import { Xn as isInvalidConversationRecordError, Yn as isFinalAttempt, qn as hasConversationStop } from "./turn-session-routing-BFVp8TbU.js";
3
+ import { y as isProviderRetryError } from "./client-B0jlQSgO.js";
4
+ import { i as getChatConfig } from "./config-DrAeD8sr.js";
5
+ import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-DuwXUuIY.js";
6
+ import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-CEeLYkSj.js";
7
+ import { C as requestAnotherSlice, T as startConversationWork, b as recordConversationRetry, d as countPendingConversationMessages, f as deadLetterAttempt, g as getConversationWorkState, i as beginConversationResume, l as completeConversationStop, m as ensureConversationWake, o as checkInConversationWork, p as drainConversationMailbox, s as clearConsumedConversationWake, t as ackMessages, u as completeConversationWork, x as releaseConversationWork, y as recordAttemptFailure } from "./store-BF2XEeQz.js";
8
8
  // src/chat/task-execution/attempt-selection.ts
9
9
  function selectContiguousTurnBatch(messages) {
10
10
  const first = messages[0];
@@ -0,0 +1 @@
1
+ ALTER TABLE "junior_review_items" ADD COLUMN "added_by_turn_id" text;
@@ -1,17 +1,8 @@
1
1
  # SQL Migrations
2
2
 
3
- `src/db/schema.ts` is the Drizzle schema entry point. This directory is the
4
- append-only history that brings an existing database to that schema.
5
- `src/chat/conversations/sql/migrations.ts` owns loading, locking, and the
6
- bridge-version guard.
7
-
8
- ## Rules
9
-
10
3
  - Never edit, rename, reorder, or delete an applied migration or its
11
4
  metadata. Add a new migration to correct it.
12
- - Change the table under `src/db/schema/`, then run
13
- `pnpm --filter @sentry/junior db:generate --name <name>`. Commit the SQL,
14
- `meta/_journal.json`, and the snapshot together.
15
5
  - Put fixed row transformations in the migration that needs them.
16
- - A schema without the core Drizzle journal must first upgrade through
17
- `@sentry/junior@0.107.1`. Do not remove that guard.
6
+ - Keep the guard in `src/chat/conversations/sql/migrations.ts` that makes a
7
+ schema without the core Drizzle journal upgrade through
8
+ `@sentry/junior@0.107.1` first.