@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.
- package/dist/{actor-CP9K2Idu.js → actor-B4DYygOB.js} +1 -1
- package/dist/{adapter-BQNTKVTF.js → adapter-Bqbtr1RV.js} +1 -1
- package/dist/{admin-CKVEoXa4.js → admin-CWBjzyN0.js} +1 -1
- package/dist/{agent-runner-MSQSMFkq.js → agent-runner-BiHsH8O_.js} +36 -29
- package/dist/api/schema.d.ts +1 -1
- package/dist/api/schema.js +2 -2
- package/dist/api.d.ts +1 -1
- package/dist/api.js +34 -32
- package/dist/{app-Bz8t4P8p.d.ts → app-C81xfpNa.d.ts} +8 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +72 -31
- package/dist/{interruption-marker-CdblrIQK.js → assistant-reply-DgtX9DaJ.js} +2 -8
- package/dist/{briefs-DNFzFFVx.js → briefs-0FeSJHQ3.js} +2 -2
- package/dist/{catalog-runtime-Bdym_wKy.js → catalog-runtime-Bw9kjGVu.js} +1 -1
- package/dist/cli/chat.js +14 -14
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-B2MjENki.js → client-B0jlQSgO.js} +2 -2
- package/dist/{config-Dm3pWRqY.js → config-DrAeD8sr.js} +2 -2
- package/dist/{connections-0BBhiD-p.js → connections-BzN2K0G9.js} +10 -10
- package/dist/{conversation-privacy-C1pJ89rs.js → conversation-privacy-D1NhUxyo.js} +1 -1
- package/dist/{credential-sync-BRiWYs6_.js → credential-sync-DpNWl4yy.js} +15 -15
- package/dist/{credentialed-BeBaJMZ_.js → credentialed-mh7HBqey.js} +31 -24
- package/dist/{db-BYOuu6v2.d.ts → db-DSabI7jJ.d.ts} +1 -1
- package/dist/{executor-BB6eJkD4.js → executor-C2cRw0hZ.js} +7 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-DiaXoSDg.js → job-queue-CEeLYkSj.js} +2 -2
- package/dist/{list-BTDRxkOg.js → list-DjJJ5K0x.js} +26 -26
- package/dist/{logging-C6EdT6PP.js → logging-DuwXUuIY.js} +1 -1
- package/dist/{message-DsjiWRVg.js → message-CRe3WBKc.js} +4 -4
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-CjFFVGqa.js → oauth-callback-server-oM5TJt34.js} +2 -2
- package/dist/{registry-CndmkP2P.js → registry-BPtbAVFo.js} +2 -2
- package/dist/{reporting-window-DRCi1Ls_.js → reporting-window-DgHgwQB3.js} +6 -1
- package/dist/{resolve-BkAA1wH7.js → resolve-D44G1jJm.js} +3 -3
- package/dist/{result-9TJTpuYP.js → result-CvP8c5bb.js} +9 -9
- package/dist/{runner-BmKLSyJm.js → runner-FIGIKvk2.js} +10 -10
- package/dist/{sandbox-egress-signals-CjLaogMo.js → sandbox-egress-signals-C_JzucwP.js} +1 -1
- package/dist/{schema-DNLJ_MzW.js → schema-DKZgO-xf.js} +10 -5
- package/dist/{schema-WayPSHFu.d.ts → schema-DPCvePop.d.ts} +13 -2
- package/dist/{service-account-DlhYl-Mu.js → service-account-1mJGRAvx.js} +3 -3
- package/dist/{service-account-D6e9cVmH.js → service-account-CHO3YXpt.js} +3 -3
- package/dist/{session-stop-MZRgYqYH.js → session-stop-DuUB1rwQ.js} +41 -139
- package/dist/{skills-BggTR_ue.js → skills-DHK7L9Eo.js} +2 -2
- package/dist/{spawn-DmtlcAT_.js → spawn-CKl_ySIq.js} +2 -2
- package/dist/{store-BeWGgaMA.js → store-BF2XEeQz.js} +3 -3
- package/dist/{store-Byarin7b.js → store-Di0E4EvU.js} +3 -3
- package/dist/{task-queue-Dt1_ZoI_.js → task-queue-CC7IFtbT.js} +3 -3
- package/dist/{task-runner-DyKqAPpm.js → task-runner-DKZtMFwa.js} +7 -7
- package/dist/{thread-state-BHBLMvgb.js → thread-state-BQ1T3eeF.js} +5 -5
- package/dist/{turn-failure-response-DWXy_0oJ.js → turn-failure-response-B5eSFoHn.js} +14 -9
- package/dist/{turn-lifecycle-AiXkVqCB.js → turn-lifecycle-CTLEIEOn.js} +1 -1
- package/dist/{turn-session-routing-B9KLBhaT.js → turn-session-routing-BFVp8TbU.js} +11 -11
- package/dist/{validation-BW60Vtx_.js → validation-Cjo-3yt3.js} +1 -1
- package/dist/{version-CivPYmkH.js → version-D30MBLLw.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-BTgAfdUg.js → viewer-D3jhuP66.js} +4 -4
- package/dist/{work-Bjm52fHo.js → work-CL9QwQcl.js} +10 -10
- package/dist/{worker-CMbgtHLu.js → worker-S2P7IJDI.js} +6 -6
- package/migrations/0071_review_item_turn.sql +1 -0
- package/migrations/AGENTS.md +3 -12
- package/migrations/meta/0071_snapshot.json +4003 -0
- package/migrations/meta/_journal.json +7 -0
- 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-
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
4
|
-
import { h as logWarn, m as logInfo, p as logException } from "./logging-
|
|
5
|
-
import { C as getSqlExecutor, j as SYSTEM_IDENTITY_ID, x as getConversationStore } from "./viewer-
|
|
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-
|
|
8
|
-
import { h as credentialSubjectSchema } from "./registry-
|
|
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-
|
|
10
|
-
import { r as getStateAdapter } from "./adapter-
|
|
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 {
|
|
13
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
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 =
|
|
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
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
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
|
|
570
|
-
|
|
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:
|
|
538
|
+
rest: text.slice(prefix.length).trimStart()
|
|
588
539
|
};
|
|
589
540
|
}
|
|
590
|
-
/**
|
|
591
|
-
function
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
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
|
-
|
|
609
|
-
|
|
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
|
-
|
|
633
|
-
rest:
|
|
556
|
+
chunk: `${prefix}${carryover.closeSuffix}`,
|
|
557
|
+
rest: `${carryover.reopenPrefix}${rest}`
|
|
634
558
|
};
|
|
635
559
|
}
|
|
636
|
-
/**
|
|
637
|
-
|
|
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
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
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 (
|
|
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-
|
|
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-
|
|
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 {
|
|
3
|
-
import { n as createAndEnqueueAgentInvocation } from "./work-
|
|
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-
|
|
2
|
-
import { x as getConversationStore } from "./viewer-
|
|
3
|
-
import "./job-queue-
|
|
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-
|
|
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-
|
|
5
|
-
import { p as credentialContextSchema } from "./registry-
|
|
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-
|
|
2
|
-
import { c as QUEUE_SIGNATURE_MAX_AGE_MS, d as getQueueProvider, l as signQueueMessage, p as runWithTurnRequestDeadline, u as verifyQueueMessage } from "./job-queue-
|
|
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-
|
|
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-
|
|
3
|
-
import {
|
|
4
|
-
import { S as getDb, i as readActorIdentity, x as getConversationStore } from "./viewer-
|
|
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-
|
|
7
|
-
import { r as getStateAdapter } from "./adapter-
|
|
8
|
-
import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-
|
|
9
|
-
import { i as pluginTaskParamsSchema, r as pluginTaskId, s as sendVercelPluginTask } from "./task-queue-
|
|
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-
|
|
2
|
-
import { B as isRecord, H as toOptionalString, V as toOptionalNumber } from "./logging-
|
|
3
|
-
import { S as getDb } from "./viewer-
|
|
4
|
-
import { In as JUNIOR_THREAD_STATE_TTL_MS } from "./credentialed-
|
|
5
|
-
import { r as getStateAdapter } from "./adapter-
|
|
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-
|
|
2
|
-
import { _ as getProviderErrorAttributes, g as findProviderError, m as ProviderError, v as getProviderErrorUserMessage } from "./client-
|
|
3
|
-
import { B as isRecord, t as buildTurnFailureResponse } from "./logging-
|
|
4
|
-
import {
|
|
5
|
-
import { S as getDb, y as getConversationEventStore } from "./viewer-
|
|
6
|
-
import { Er as listConversationAnnotations } from "./credentialed-
|
|
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-
|
|
9
|
-
import {
|
|
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-
|
|
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-
|
|
2
|
-
import { i as getChatConfig, n as botConfig } from "./config-
|
|
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-
|
|
4
|
-
import { c as parseStoredSlackActor,
|
|
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-
|
|
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-
|
|
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-
|
|
10
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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.
|
|
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-
|
|
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-
|
|
3
|
-
import { L as GOOGLE_IDENTITY_PROVIDER, h as logWarn, z as normalizeIdentityEmail } from "./logging-
|
|
4
|
-
import { a as isSlackUserId, d as parseSlackChannelReferenceId, f as parseSlackTeamId, s as parseActorUserId } from "./actor-
|
|
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-
|
|
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-
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { j as SYSTEM_IDENTITY_ID, x as getConversationStore, y as getConversationEventStore } from "./viewer-
|
|
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 {
|
|
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-
|
|
7
|
-
import {
|
|
8
|
-
import { C as maybePostAutomatedTurnLimitNotice, D as recordFinishedTurnForAutomatedLimit, O as resetAutomatedTurnLimit } from "./session-stop-
|
|
9
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
10
|
-
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
11
|
-
import { a as persistThreadStateById, n as getPersistedSandboxState, r as getPersistedThreadState } from "./thread-state-
|
|
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-
|
|
3
|
-
import { y as isProviderRetryError } from "./client-
|
|
4
|
-
import { i as getChatConfig } from "./config-
|
|
5
|
-
import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-
|
|
6
|
-
import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-
|
|
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-
|
|
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;
|
package/migrations/AGENTS.md
CHANGED
|
@@ -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
|
-
-
|
|
17
|
-
|
|
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.
|