@sentry/junior 0.288.0 → 0.290.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 (76) hide show
  1. package/dist/{adapter-Cikcqdty.js → adapter-CHMVy-j0.js} +1 -1
  2. package/dist/{admin-BcSxHuTB.js → admin-C45Ap5Tn.js} +2 -2
  3. package/dist/{agent-runner-9MXyWUL8.js → agent-runner-CZjf6MOQ.js} +343 -103
  4. package/dist/api/schema.d.ts +2 -2
  5. package/dist/api/schema.js +6 -7
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +281 -254
  8. package/dist/{app-BUklJVBe.d.ts → app-BB1j2krL.d.ts} +2 -4
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +92 -64
  11. package/dist/assistant-reply-BtIV0hq6.js +58 -0
  12. package/dist/{automation-DDXwHQs5.js → automation-DWbjJltM.js} +1 -1
  13. package/dist/{background-compaction-queue-CjllSPir.js → background-compaction-queue-2gKhjRD3.js} +4 -4
  14. package/dist/{briefs-DW9iuolG.js → briefs-BGke_Cz5.js} +3 -4
  15. package/dist/{catalog-runtime-B3gfH58M.js → catalog-runtime-BSOlVfXi.js} +1 -1
  16. package/dist/cli/chat.js +14 -14
  17. package/dist/cli/check.js +3 -3
  18. package/dist/cli/main.js +3 -3
  19. package/dist/cli/plugins.js +4 -4
  20. package/dist/cli/snapshot-create.js +4 -4
  21. package/dist/cli/upgrade.d.ts +1 -1
  22. package/dist/cli/upgrade.js +4 -4
  23. package/dist/{config-CLJcyYEF.js → config-DHDub41t.js} +4 -41
  24. package/dist/{connections-BtdJftow.js → connections-BAb0fedk.js} +7 -129
  25. package/dist/{conversation-DhoqHtQ7.js → conversation-CwC8K3RZ.js} +8 -8
  26. package/dist/{conversation-pending-messages-DHV0S4uF.js → conversation-pending-messages-B0cuLReP.js} +1 -1
  27. package/dist/{conversation-privacy-BPirIVlX.js → conversation-privacy-QRdLPH-9.js} +1 -1
  28. package/dist/{credential-sync-Co8Q2xRW.js → credential-sync-YIMGiRk7.js} +13 -13
  29. package/dist/{db-Co7DTYYh.js → db-DBHig2sI.js} +56 -31
  30. package/dist/{db-zIs8-Ba3.d.ts → db-DCSmv9tz.d.ts} +6 -2
  31. package/dist/{executor-m0kIN71Q.js → executor-DKrtH0k_.js} +62 -13
  32. package/dist/instrumentation.js +2 -2
  33. package/dist/{logging-DbD-dErY.js → logging-f24cZPEj.js} +2 -2
  34. package/dist/{history-IjdmO_r6.js → media-BepyEUNm.js} +85 -1
  35. package/dist/{message-DKTdTYm-.js → message-BbBOajiX.js} +9 -9
  36. package/dist/nitro.d.ts +1 -1
  37. package/dist/nitro.js +2 -2
  38. package/dist/{oauth-callback-server-CpbepSbp.js → oauth-callback-server-rHJYjFoz.js} +2 -2
  39. package/dist/{projection-BViECfYu.js → projection-D-9aVaHj.js} +153 -119
  40. package/dist/{prompt-KT6MaDHN.js → prompt-C7SZhNDy.js} +183 -3
  41. package/dist/{registry-D-Acyjhh.js → registry-CwA-kSjW.js} +1 -1
  42. package/dist/{resolve-gkT2R66z.js → resolve-B5WJgt9k.js} +3 -3
  43. package/dist/{result-DHmCFEt8.js → result-B2sCVIwl.js} +16 -10
  44. package/dist/{runner-DBKjGjH-.js → runner-CZq7wyIh.js} +8 -8
  45. package/dist/{sandbox-egress-signals-9n8hqx29.js → sandbox-egress-signals-C4d6Pa9a.js} +1 -1
  46. package/dist/{schema-DxicIQbc.js → schema-Bptz19Ja.js} +14 -9
  47. package/dist/{schema-B_6aOcx5.d.ts → schema-DQaFSkZZ.d.ts} +13 -5
  48. package/dist/{service-account-CDlC9ssy.js → service-account-B6OJtplS.js} +3 -3
  49. package/dist/{service-account-Bi0HsY6w.js → service-account-BC73M8rj.js} +3 -3
  50. package/dist/{session-stop-BWOsuo8p.js → session-stop-1cku9Vm3.js} +41 -30
  51. package/dist/{skills-DO5K68Rq.js → skills-BFopj5ID.js} +2 -2
  52. package/dist/{spawn-BBqZDcPa.js → spawn-B-1JlJwH.js} +5 -5
  53. package/dist/{stop-WC97cmHz.js → stop-CJweYiOH.js} +123 -213
  54. package/dist/{store-ByR1Lr7e.js → store-CK869JpC.js} +3 -3
  55. package/dist/{task-runner-B-Ewf8TX.js → task-runner-XmXL9E-k.js} +13 -17
  56. package/dist/{turn-failure-response-CpdPoZSl.js → turn-failure-response-hhpek6Fn.js} +8 -8
  57. package/dist/{validation-B4sbIoES.js → validation-DHQjCRFx.js} +1 -1
  58. package/dist/{version-D6lpuAgL.js → version-DQgCf4FE.js} +1 -1
  59. package/dist/version.js +1 -1
  60. package/dist/{viewer-CeP27tC3.js → viewer-DG97nzP4.js} +4 -4
  61. package/dist/{warmup-P_GJCL1c.js → warmup-C00-jOoN.js} +272 -78
  62. package/dist/{work-DI7x1Slm.js → work-Ch3EWO6u.js} +14 -14
  63. package/dist/{worker-CYPTOT4j.js → worker-B8kyM1fB.js} +6 -30
  64. package/migrations/0091_conversation_participant_unsubscribed_index.sql +20 -0
  65. package/migrations/0092_turn_metric_actor.sql +12 -0
  66. package/migrations/0093_participant_root_actor_backfill.sql +18 -0
  67. package/migrations/0094_conversation_delivery_paused_at.sql +1 -0
  68. package/migrations/meta/0091_snapshot.json +4410 -0
  69. package/migrations/meta/0092_snapshot.json +4446 -0
  70. package/migrations/meta/0093_snapshot.json +4446 -0
  71. package/migrations/meta/0094_snapshot.json +4452 -0
  72. package/migrations/meta/_journal.json +28 -0
  73. package/package.json +5 -5
  74. package/dist/assistant-reply-mj47jMRV.js +0 -65
  75. package/dist/core-model-BTt5E5b0.js +0 -182
  76. package/dist/media-BAHvgkok.js +0 -85
@@ -1,13 +1,13 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-DbD-dErY.js";
3
- import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-BPirIVlX.js";
2
+ import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-f24cZPEj.js";
3
+ import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-QRdLPH-9.js";
4
4
  import { AwsClient } from "aws4fetch";
5
5
  import { del, get, put } from "@vercel/blob";
6
6
  import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
7
7
  import { stream as streamAnthropic, streamSimple as streamSimpleAnthropic } from "@earendil-works/pi-ai/api/anthropic-messages";
8
8
  import { createGatewayProvider } from "@ai-sdk/gateway";
9
9
  import { getVercelOidcToken } from "@vercel/oidc";
10
- import { Experimental_DecisionRefusalError, NoObjectGeneratedError, embedMany, experimental_decide, generateObject, rerank, transcribe } from "ai";
10
+ import { Experimental_DecisionRefusalError, NoObjectGeneratedError, embedMany, experimental_decide, generateObject, rerank } from "ai";
11
11
  import { createHash } from "node:crypto";
12
12
  import * as z from "zod";
13
13
  // src/chat/optional-string.ts
@@ -978,7 +978,6 @@ const GEN_AI_OPERATION_CHAT = "chat";
978
978
  const GEN_AI_OPERATION_EMBEDDINGS = "embeddings";
979
979
  const GEN_AI_OPERATION_RERANK = "rerank";
980
980
  const GEN_AI_OPERATION_DECIDE = "decide";
981
- const GEN_AI_OPERATION_TRANSCRIPTION = "transcription";
982
981
  const EMBEDDING_INPUT_COST_USD_PER_MILLION_TOKENS = {
983
982
  "cohere/embed-v4.0": .12,
984
983
  "google/gemini-embedding-001": .15,
@@ -1363,39 +1362,6 @@ async function rerankTexts(params) {
1363
1362
  throw providerError;
1364
1363
  }
1365
1364
  }
1366
- /** Transcribe one recorded audio clip through AI Gateway. */
1367
- async function transcribeAudio(params) {
1368
- const credential = await resolveGatewayCredential();
1369
- const provider = createGatewayProvider({ apiKey: credential.token });
1370
- try {
1371
- return await withSpan(`${GEN_AI_OPERATION_TRANSCRIPTION} ${params.modelId}`, "gen_ai.transcription", { modelId: params.modelId }, async (setSpanAttributes) => {
1372
- const result = await transcribe({
1373
- model: provider.transcriptionModel(params.modelId),
1374
- audio: params.audio,
1375
- ...params.signal !== void 0 ? { abortSignal: params.signal } : void 0
1376
- });
1377
- if (result.durationInSeconds !== void 0) setSpanAttributes({ "app.transcription.audio_seconds": result.durationInSeconds });
1378
- return { text: result.text };
1379
- }, {
1380
- "gen_ai.provider.name": GEN_AI_PROVIDER_NAME,
1381
- "gen_ai.operation.name": GEN_AI_OPERATION_TRANSCRIPTION,
1382
- "gen_ai.request.model": params.modelId,
1383
- "server.address": GEN_AI_SERVER_ADDRESS,
1384
- "server.port": 443,
1385
- "gen_ai.provider.auth_mode": credential.mode,
1386
- "app.transcription.audio_bytes": params.audio.byteLength
1387
- });
1388
- } catch (error) {
1389
- const providerError = createProviderError(error, { modelId: params.modelId });
1390
- logException(providerError, "ai.transcription.failed", {
1391
- ...getProviderErrorAttributes(providerError),
1392
- "gen_ai.provider.name": GEN_AI_PROVIDER_NAME,
1393
- "gen_ai.operation.name": GEN_AI_OPERATION_TRANSCRIPTION,
1394
- "gen_ai.request.model": params.modelId
1395
- });
1396
- throw providerError;
1397
- }
1398
- }
1399
1365
  // src/chat/slack/emoji.ts
1400
1366
  const SLACK_EMOJI_NAME_RE = /^(?:[a-z0-9_+-]+)(?:::(?:skin-tone-[2-6]))?$/;
1401
1367
  function normalizeSlackEmojiName(value) {
@@ -1546,7 +1512,6 @@ const DEFAULT_DECISION_MODEL_ID = "typesafe-ai/jev";
1546
1512
  const DEFAULT_EMBEDDING_MODEL_ID = "openai/text-embedding-3-small";
1547
1513
  const DEFAULT_RERANKING_MODEL_ID = "voyage/rerank-2.5-lite";
1548
1514
  const DEFAULT_IMAGE_GENERATION_MODEL_ID = "openai/gpt-image-2";
1549
- const DEFAULT_TRANSCRIPTION_MODEL_ID = "spacexai/grok-stt";
1550
1515
  const DEFAULT_VISION_MODEL_ID = resolveGatewayModel("openai/gpt-5.6-sol").id;
1551
1516
  function validateGatewayModelId(raw) {
1552
1517
  const trimmed = toOptionalTrimmed(raw);
@@ -1584,7 +1549,6 @@ function readBotConfig(env, functionMaxDurationSeconds) {
1584
1549
  fastModelId,
1585
1550
  guardianModelId,
1586
1551
  imageGenerationModelId: toOptionalTrimmed(env.AI_IMAGE_MODEL) ?? DEFAULT_IMAGE_GENERATION_MODEL_ID,
1587
- transcriptionModelId: toOptionalTrimmed(env.AI_TRANSCRIPTION_MODEL) ?? DEFAULT_TRANSCRIPTION_MODEL_ID,
1588
1552
  embeddingModelId: validateEmbeddingModelId(env.AI_EMBEDDING_MODEL) ?? DEFAULT_EMBEDDING_MODEL_ID,
1589
1553
  rerankingModelId: toOptionalTrimmed(env.AI_RERANKING_MODEL) ?? DEFAULT_RERANKING_MODEL_ID,
1590
1554
  loadingMessages: parseLoadingMessages(env.JUNIOR_LOADING_MESSAGES),
@@ -1750,7 +1714,6 @@ function setBotModelConfig(config) {
1750
1714
  if (config.guardianModelId !== void 0) botConfig.guardianModelId = requireModelId("guardianModelId", config.guardianModelId, validateGatewayModelId);
1751
1715
  if (config.rerankingModelId !== void 0) botConfig.rerankingModelId = requireModelId("rerankingModelId", config.rerankingModelId, toOptionalTrimmed);
1752
1716
  if (config.imageGenerationModelId !== void 0) botConfig.imageGenerationModelId = requireModelId("imageGenerationModelId", config.imageGenerationModelId, validateEmbeddingModelId);
1753
- if (config.transcriptionModelId !== void 0) botConfig.transcriptionModelId = requireModelId("transcriptionModelId", config.transcriptionModelId, toOptionalTrimmed);
1754
1717
  if (config.visionModelId !== void 0) botConfig.visionModelId = requireModelId("visionModelId", config.visionModelId, validateGatewayModelId);
1755
1718
  if (config.webSearchModelId !== void 0) botConfig.webSearchModelId = requireModelId("webSearchModelId", config.webSearchModelId, validateGatewayModelId);
1756
1719
  }
@@ -1759,4 +1722,4 @@ function setSlackReactionConfig(overrides) {
1759
1722
  if (overrides.processingReactionEmoji !== void 0) chatConfig.slack.processingReactionEmoji = parseReactionEmoji("processingReactionEmoji", overrides.processingReactionEmoji, chatConfig.slack.processingReactionEmoji);
1760
1723
  if (overrides.completedReactionEmoji !== void 0) chatConfig.slack.completedReactionEmoji = parseReactionEmoji("completedReactionEmoji", overrides.completedReactionEmoji, chatConfig.slack.completedReactionEmoji);
1761
1724
  }
1762
- export { estimateRequestOverheadTokens as A, ProviderError as B, completeText as C, transcribeAudio as D, resolveGatewayModel as E, isCompactionSummaryText as F, isProviderRetryError as G, findProviderError as H, renderCurrentInstruction as I, getAttachmentStorage as J, getGatewayApiKey as K, unwrapCurrentInstruction as L, textCharsForTokens as M, COMPACTION_SUMMARY_PREFIX as N, requestPrefixAttributes as O, hasCompactedConversationContext as P, escapeXml as R, completeObject as S, rerankTexts as T, getProviderErrorAttributes as U, createProviderError as V, getProviderErrorUserMessage as W, toOptionalTrimmed as Y, toPiReasoningLevel as _, getRuntimeMetadata as a, GEN_AI_SERVER_ADDRESS as b, getSlackClientSecret as c, restoreRuntimeConfig as d, setBotModelConfig as f, TURN_REASONING_LEVELS as g, snapshotRuntimeConfig as h, getChatConfig as i, estimateTextTokens as j, estimateMessagesTokens as k, getSlackSigningSecret as l, setSlackReactionConfig as m, botConfig as n, getSlackBotToken as o, setRuntimeLimits as p, resolveGatewayCredential as q, config_exports as r, getSlackClientId as s, DEFAULT_SQL_STATEMENT_TIMEOUT_MS as t, resetRuntimeConfig as u, normalizeSlackEmojiName as v, embedTexts as w, completeDecision as x, GEN_AI_PROVIDER_NAME as y, escapeXmlText as z };
1725
+ export { estimateTextTokens as A, createProviderError as B, completeText as C, requestPrefixAttributes as D, resolveGatewayModel as E, renderCurrentInstruction as F, getGatewayApiKey as G, getProviderErrorAttributes as H, unwrapCurrentInstruction as I, toOptionalTrimmed as J, resolveGatewayCredential as K, escapeXml as L, COMPACTION_SUMMARY_PREFIX as M, hasCompactedConversationContext as N, estimateMessagesTokens as O, isCompactionSummaryText as P, escapeXmlText as R, completeObject as S, rerankTexts as T, getProviderErrorUserMessage as U, findProviderError as V, isProviderRetryError as W, toPiReasoningLevel as _, getRuntimeMetadata as a, GEN_AI_SERVER_ADDRESS as b, getSlackClientSecret as c, restoreRuntimeConfig as d, setBotModelConfig as f, TURN_REASONING_LEVELS as g, snapshotRuntimeConfig as h, getChatConfig as i, textCharsForTokens as j, estimateRequestOverheadTokens as k, getSlackSigningSecret as l, setSlackReactionConfig as m, botConfig as n, getSlackBotToken as o, setRuntimeLimits as p, getAttachmentStorage as q, config_exports as r, getSlackClientId as s, DEFAULT_SQL_STATEMENT_TIMEOUT_MS as t, resetRuntimeConfig as u, normalizeSlackEmojiName as v, embedTexts as w, completeDecision as x, GEN_AI_PROVIDER_NAME as y, ProviderError as z };
@@ -1,132 +1,10 @@
1
- import { Mi as startOAuthFlow, et as loadTurnCheckpoint, ot as failTurnRecord, st as getTurnRecord } from "./projection-BViECfYu.js";
2
- import { n as botConfig } from "./config-CLJcyYEF.js";
3
- import { A as deleteProviderIdentityForUser, a as getConversationStore, k as deleteProviderIdentityForSlackUser, r as getConversationEventStore, s as getSqlExecutor } from "./db-Co7DTYYh.js";
4
- import { u as hasRequiredOAuthScope } from "./registry-D-Acyjhh.js";
5
- import { n as pluginCatalogRuntime } from "./catalog-runtime-B3gfH58M.js";
6
- import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-9MXyWUL8.js";
7
- import { g as getVercelConversationWorkQueue } from "./background-compaction-queue-CjllSPir.js";
8
- import { S as requestConversationWork, m as ensureConversationWake } from "./store-ByR1Lr7e.js";
9
- import { mt as resolveTurnSessionRouting } from "./task-runner-B-Ewf8TX.js";
1
+ import { Fi as startOAuthFlow } from "./projection-D-9aVaHj.js";
2
+ import { n as botConfig } from "./config-DHDub41t.js";
3
+ import { A as deleteProviderIdentityForUser, k as deleteProviderIdentityForSlackUser, s as getSqlExecutor } from "./db-DBHig2sI.js";
4
+ import { u as hasRequiredOAuthScope } from "./registry-CwA-kSjW.js";
5
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BSOlVfXi.js";
6
+ import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-CZjf6MOQ.js";
10
7
  import { randomBytes } from "node:crypto";
11
- import * as z from "zod";
12
- // src/chat/task-execution/authorized-turn.ts
13
- /**
14
- * OAuth callbacks save readiness, not agent history. The conversation worker
15
- * consumes this event under its lease before it resumes the paused Turn.
16
- */
17
- const authorizationSchema = z.object({
18
- kind: z.enum(["mcp", "plugin"]),
19
- provider: z.string().min(1),
20
- actorId: z.string().min(1),
21
- authorizationId: z.string().min(1),
22
- authSessionId: z.string().optional(),
23
- scope: z.string().optional(),
24
- configuration: z.record(z.string(), z.unknown()).optional(),
25
- toolChannelId: z.string().optional()
26
- });
27
- function authorizationKey(turn) {
28
- return `turn:${turn.turnId}:authorization:${turn.version}`;
29
- }
30
- /** Save authorization for this parked boundary without changing model history. */
31
- async function recordTurnAuthorization(args) {
32
- const turn = await getTurnRecord(args.conversationId, args.turnId);
33
- if (!turn || turn.state !== "paused" || turn.resumeReason !== "auth") return;
34
- await getConversationEventStore().append(args.conversationId, [{
35
- idempotencyKey: authorizationKey(turn),
36
- createdAtMs: Date.now(),
37
- data: {
38
- type: "structured_event",
39
- namespace: "junior",
40
- name: "turn_authorized",
41
- version: 1,
42
- turnId: turn.turnId,
43
- content: authorizationSchema.parse(args)
44
- }
45
- }], { activity: "preserve" });
46
- return {
47
- conversationId: args.conversationId,
48
- destination: args.destination,
49
- turnId: turn.turnId,
50
- expectedVersion: turn.version
51
- };
52
- }
53
- /** Read authorization for the exact pause; a later auth pause needs its own callback. */
54
- async function getTurnAuthorization(turn) {
55
- const event = await getConversationEventStore().loadByIdempotencyKey(turn.conversationId, authorizationKey(turn));
56
- if (event?.data.type !== "structured_event") return void 0;
57
- return authorizationSchema.parse(event.data.content);
58
- }
59
- // src/chat/task-execution/turn-wake.ts
60
- /** Build the worker input for a paused turn. */
61
- async function getPausedTurnRequest(args) {
62
- const turn = (await loadTurnCheckpoint({
63
- conversationId: args.conversationId,
64
- turnId: args.turnId
65
- })).record;
66
- if (!turn || turn.state !== "paused" || turn.resumeReason !== "timeout" && turn.resumeReason !== "yield" && turn.resumeReason !== "retry" && !(turn.resumeReason === "auth" && await getTurnAuthorization(turn)) || turn.resumeReason === "timeout" && turn.sliceId < 2) return;
67
- let routing;
68
- try {
69
- routing = await resolveTurnSessionRouting({
70
- conversationId: args.conversationId,
71
- conversationStore: args.conversationStore
72
- });
73
- } catch (error) {
74
- await failTurnRecord({
75
- conversationId: args.conversationId,
76
- expectedVersion: turn.version,
77
- turnId: args.turnId,
78
- errorMessage: error instanceof Error ? error.message : String(error)
79
- });
80
- return;
81
- }
82
- return {
83
- conversationId: args.conversationId,
84
- destination: routing.destination,
85
- turnId: args.turnId,
86
- expectedVersion: turn.version,
87
- traceContext: turn.traceContext
88
- };
89
- }
90
- /** Wake the conversation worker for a paused turn. */
91
- async function wakePausedTurn(request, options = {}) {
92
- const nowMs = options.nowMs ?? Date.now();
93
- const conversation = await (options.conversationStore ?? getConversationStore()).get({ conversationId: request.conversationId });
94
- await requestConversationWork({
95
- conversationId: request.conversationId,
96
- destination: conversation && conversation.kind !== "root" ? void 0 : request.destination,
97
- nowMs,
98
- state: options.state
99
- });
100
- const queue = options.queue ?? getVercelConversationWorkQueue();
101
- await ensureConversationWake({
102
- conversationId: request.conversationId,
103
- idempotencyKey: [
104
- "agent-continue",
105
- request.conversationId,
106
- request.turnId,
107
- request.expectedVersion,
108
- nowMs
109
- ].join(":"),
110
- nowMs,
111
- queue,
112
- state: options.state
113
- });
114
- }
115
- /** Create paused Turn operations for one app. */
116
- function createPausedTurns(options = {}) {
117
- return {
118
- get: (args) => getPausedTurnRequest({
119
- ...args,
120
- conversationStore: options.conversationStore
121
- }),
122
- wake: (request) => wakePausedTurn(request, options)
123
- };
124
- }
125
- /** Record completed authorization and wake the sole execution owner. */
126
- async function wakeAuthorizedTurn(args, queue) {
127
- const request = await recordTurnAuthorization(args);
128
- if (request) await wakePausedTurn(request, { queue });
129
- }
130
8
  // src/handlers/oauth-html.ts
131
9
  /** Build pre-escaped callback HTML with the shared response security policy. */
132
10
  function htmlCallbackResponse(title, message, status, options = {}) {
@@ -367,4 +245,4 @@ async function disconnectConnection(userId, provider, userTokenStore) {
367
245
  if (tokens?.account) await deleteProviderIdentityForUser(getSqlExecutor(), userId, provider, tokens.account.id);
368
246
  await unlinkProvider(userId, provider, userTokenStore);
369
247
  }
370
- export { startConnection as a, createPausedTurns as c, wakePausedTurn as d, getTurnAuthorization as f, readConnectedOAuthTokens as i, getPausedTurnRequest as l, isConnectableProvider as n, unlinkProvider as o, listConnections as r, htmlCallbackResponse as s, disconnectConnection as t, wakeAuthorizedTurn as u };
248
+ export { startConnection as a, readConnectedOAuthTokens as i, isConnectableProvider as n, unlinkProvider as o, listConnections as r, htmlCallbackResponse as s, disconnectConnection as t };
@@ -1,5 +1,4 @@
1
- import { a as conversationTurnFailureReasonSchema, h as usageSchema, i as conversationTurnFailureCodeSchema } from "./history-IjdmO_r6.js";
2
- import { n as INPUT_IMAGE_TYPES } from "./media-BAHvgkok.js";
1
+ import { c as conversationTurnFailureCodeSchema, l as conversationTurnFailureReasonSchema, n as INPUT_IMAGE_TYPES, y as usageSchema } from "./media-BepyEUNm.js";
3
2
  import * as z from "zod";
4
3
  import { codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, objectFactFields, objectTypeSchema } from "@sentry/junior-plugin-api";
5
4
  // src/chat/briefs/schema.ts
@@ -136,15 +135,11 @@ function parseBriefInput(input) {
136
135
  /** Bound JSON image input below the hosting platform's request size limit. */
137
136
  const MAX_INPUT_IMAGE_BYTES = 3145728;
138
137
  const MAX_INPUT_IMAGES = 3;
139
- /** Base64 file bytes in a JSON request body, up to `maxBytes` once decoded. */
140
- function base64DataSchema(maxBytes) {
141
- return z.string().min(4).max(maxBytes * 4 / 3).regex(/^[A-Za-z0-9+/]*={0,2}$/).refine((data) => data.length % 4 === 0);
142
- }
143
138
  /** Image bytes accepted with a web message, never stored in its mailbox row. */
144
139
  const inputImageSchema = z.object({
145
140
  filename: z.string().trim().min(1).max(255),
146
141
  contentType: z.enum(INPUT_IMAGE_TYPES),
147
- data: base64DataSchema(MAX_INPUT_IMAGE_BYTES)
142
+ data: z.string().min(4).max(MAX_INPUT_IMAGE_BYTES * 4 / 3).regex(/^[A-Za-z0-9+/]*={0,2}$/).refine((data) => data.length % 4 === 0)
148
143
  }).strict();
149
144
  /** Safe attachment facts shared by mailbox input and transcript messages. */
150
145
  const messageAttachmentSchema = z.object({
@@ -897,6 +892,11 @@ const conversationDetailReportSchema = conversationSummaryReportSchema.extend({
897
892
  /** The viewer can move this dashboard conversation to a Slack thread. */
898
893
  canContinueInSlack: z.literal(true).optional(),
899
894
  /**
895
+ * Event Turn replies stay out of the Location. Set only for a root with
896
+ * a Location, when the viewer is a participant, who can change it.
897
+ */
898
+ deliveryPaused: z.boolean().optional(),
899
+ /**
900
900
  * The viewer gets this conversation in their active feed. Participants
901
901
  * only. False after an unsubscribe, until they mention Junior again.
902
902
  */
@@ -959,4 +959,4 @@ const conversationFeedSchema = z.object({
959
959
  source: z.literal("conversation_index"),
960
960
  generatedAt: z.string()
961
961
  }).strict();
962
- export { renameConversationBodySchema as A, resolveMessageCards as B, createConversationBodySchema as C, conversationChildAgentTotalsSchema as D, forkConversationResponseSchema as E, annotationCard as F, readMessageAttachments as G, MAX_INPUT_IMAGE_BYTES as H, messageCardRef as I, briefOutcomeStatusSchema as J, briefCodeChangeSchema as K, messageCardText as L, conversationReadPositionSchema as M, conversationReadReportSchema as N, CONVERSATION_TITLE_MAX_LENGTH as O, reviewItemChangeRecordSchema as P, parseStoredBrief as Q, readMessageCardRefs as R, conversationUsageSchema as S, forkConversationBodySchema as T, base64DataSchema as U, MAX_INPUT_IMAGES as V, messageAttachmentSchema as W, conversationBriefSchema as X, briefResourceLabel as Y, parseBriefInput as Z, conversationReportEventSchema as _, conversationActivityPreviewSchema as a, conversationSummaryReportSchema as b, conversationDetailQuerySchema as c, conversationEventPageSchema as d, conversationEventsQuerySchema as f, conversationReportEventDataSchema as g, conversationParamsSchema as h, actorIdentitySchema as i, renameConversationResponseSchema as j, conversationTitleSchema as k, conversationDetailReportSchema as l, conversationFeedSchema as m, CONVERSATION_VERSION_HEADER as n, conversationAttachmentParamsSchema as o, conversationFeedQuerySchema as p, briefLinkSchema as q, acceptedConversationMessageSchema as r, conversationAuxiliaryCostsSchema as s, CONVERSATION_DETAIL_VERSION_HEADER as t, conversationEventHistorySchema as u, conversationReportMessageEventSchema as v, createConversationMessageBodySchema as w, conversationSurfaceSchema as x, conversationReportStatusSchema as y, removedCardSchema as z };
962
+ export { renameConversationBodySchema as A, resolveMessageCards as B, createConversationBodySchema as C, conversationChildAgentTotalsSchema as D, forkConversationResponseSchema as E, annotationCard as F, briefCodeChangeSchema as G, MAX_INPUT_IMAGE_BYTES as H, messageCardRef as I, briefResourceLabel as J, briefLinkSchema as K, messageCardText as L, conversationReadPositionSchema as M, conversationReadReportSchema as N, CONVERSATION_TITLE_MAX_LENGTH as O, reviewItemChangeRecordSchema as P, readMessageCardRefs as R, conversationUsageSchema as S, forkConversationBodySchema as T, messageAttachmentSchema as U, MAX_INPUT_IMAGES as V, readMessageAttachments as W, parseBriefInput as X, conversationBriefSchema as Y, parseStoredBrief as Z, conversationReportEventSchema as _, conversationActivityPreviewSchema as a, conversationSummaryReportSchema as b, conversationDetailQuerySchema as c, conversationEventPageSchema as d, conversationEventsQuerySchema as f, conversationReportEventDataSchema as g, conversationParamsSchema as h, actorIdentitySchema as i, renameConversationResponseSchema as j, conversationTitleSchema as k, conversationDetailReportSchema as l, conversationFeedSchema as m, CONVERSATION_VERSION_HEADER as n, conversationAttachmentParamsSchema as o, conversationFeedQuerySchema as p, briefOutcomeStatusSchema as q, acceptedConversationMessageSchema as r, conversationAuxiliaryCostsSchema as s, CONVERSATION_DETAIL_VERSION_HEADER as t, conversationEventHistorySchema as u, conversationReportMessageEventSchema as v, createConversationMessageBodySchema as w, conversationSurfaceSchema as x, conversationReportStatusSchema as y, removedCardSchema as z };
@@ -1,4 +1,4 @@
1
- import { P as reviewItemChangeRecordSchema, W as messageAttachmentSchema, i as actorIdentitySchema, l as conversationDetailReportSchema } from "./conversation-DhoqHtQ7.js";
1
+ import { P as reviewItemChangeRecordSchema, U as messageAttachmentSchema, i as actorIdentitySchema, l as conversationDetailReportSchema } from "./conversation-CwC8K3RZ.js";
2
2
  import * as z from "zod";
3
3
  // src/reporting-schema.ts
4
4
  const healthReportSchema = z.object({
@@ -1,4 +1,4 @@
1
- import { h as logWarn } from "./logging-DbD-dErY.js";
1
+ import { h as logWarn } from "./logging-f24cZPEj.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  // src/chat/conversation-privacy.ts
4
4
  const SAFE_METADATA_KEY_LIMIT = 20;
@@ -1,19 +1,19 @@
1
- import { Ai as parseOAuthStatePayload, Dn as createUserTokenStore, Gi as postSlackMessage, Q as getConversationPendingAuth, d as recordAuthorizationCompleted, ji as resolveBaseUrl, jn as resolvePluginOAuthAccount, ki as formatProviderLabel, na as getSlackClient, st as getTurnRecord, u as recordAuthenticationLinked } from "./projection-BViECfYu.js";
2
- import { R as escapeXml, a as getRuntimeMetadata, n as botConfig } from "./config-CLJcyYEF.js";
3
- import { W as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-DbD-dErY.js";
1
+ import { An as resolvePluginOAuthAccount, En as createUserTokenStore, Ji as postSlackMessage, Mi as formatProviderLabel, Ni as parseOAuthStatePayload, Pi as resolveBaseUrl, Z as getConversationPendingAuth, aa as getSlackClient, d as recordAuthorizationCompleted, ot as getTurnRecord, u as recordAuthenticationLinked } from "./projection-D-9aVaHj.js";
2
+ import { L as escapeXml, a as getRuntimeMetadata, n as botConfig } from "./config-DHDub41t.js";
3
+ import { U as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-f24cZPEj.js";
4
4
  import { p as parseSlackUserId } from "./actor-6jsm_v96.js";
5
- import { D as resolveActorIdentityId, F as upsertLinkedIdentity, j as findUserByVerifiedEmails, s as getSqlExecutor } from "./db-Co7DTYYh.js";
5
+ import { D as resolveActorIdentityId, F as upsertLinkedIdentity, j as findUserByVerifiedEmails, s as getSqlExecutor } from "./db-DBHig2sI.js";
6
6
  import { i as homeDir } from "./package-discovery-DJhGdS4c.js";
7
- import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-D-Acyjhh.js";
8
- import { n as pluginCatalogRuntime } from "./catalog-runtime-B3gfH58M.js";
9
- import { t as discoverSkills } from "./skills-DO5K68Rq.js";
10
- import { Bt as deleteWebAuthorization, a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, y as lookupSlackUserProfile } from "./agent-runner-9MXyWUL8.js";
7
+ import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-CwA-kSjW.js";
8
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BSOlVfXi.js";
9
+ import { t as discoverSkills } from "./skills-BFopj5ID.js";
10
+ import { It as wakeAuthorizedTurn, Lt as wakePausedTurn, Yt as deleteWebAuthorization, a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, y as lookupSlackUserProfile } from "./agent-runner-CZjf6MOQ.js";
11
11
  import { r as acquireActiveLock } from "./locks-D-0h111u.js";
12
- import { o as readIdentityById } from "./viewer-CeP27tC3.js";
13
- import { r as getStateAdapter } from "./adapter-Cikcqdty.js";
14
- import { _t as getPersistedThreadState, bt as coerceThreadConversationState } from "./task-runner-B-Ewf8TX.js";
15
- import { _ as getMcpProviderErrorAttributes } from "./service-account-CDlC9ssy.js";
16
- import { d as wakePausedTurn, i as readConnectedOAuthTokens, s as htmlCallbackResponse, u as wakeAuthorizedTurn } from "./connections-BtdJftow.js";
12
+ import { o as readIdentityById } from "./viewer-DG97nzP4.js";
13
+ import { r as getStateAdapter } from "./adapter-CHMVy-j0.js";
14
+ import { ht as getPersistedThreadState, vt as coerceThreadConversationState } from "./task-runner-XmXL9E-k.js";
15
+ import { _ as getMcpProviderErrorAttributes } from "./service-account-B6OJtplS.js";
16
+ import { i as readConnectedOAuthTokens, s as htmlCallbackResponse } from "./connections-BAb0fedk.js";
17
17
  import { n as relayLocalOAuthCallback } from "./oauth-relay-D6xxVywK.js";
18
18
  import path from "node:path";
19
19
  import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
@@ -1,9 +1,9 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { i as getChatConfig } from "./config-CLJcyYEF.js";
3
- import { G as normalizeIdentityEmail, U as GOOGLE_IDENTITY_PROVIDER, h as logWarn } from "./logging-DbD-dErY.js";
2
+ import { i as getChatConfig } from "./config-DHDub41t.js";
3
+ import { H as GOOGLE_IDENTITY_PROVIDER, W as normalizeIdentityEmail, h as logWarn } from "./logging-f24cZPEj.js";
4
4
  import { a as isSlackUserId, d as parseSlackChannelReferenceId, f as parseSlackTeamId, s as parseActorUserId } from "./actor-6jsm_v96.js";
5
- import { A as juniorConversations, E as juniorConversationAnnotations, M as juniorUsers, N as juniorDestinations, S as juniorConversationMetrics, j as juniorIdentities, t as createJuniorSqlExecutor, v as juniorConversationParticipants, w as juniorConversationEvents, x as CONVERSATION_METRICS, y as juniorConversationBindings } from "./executor-m0kIN71Q.js";
6
- import { c as newConversationEventSchema, h as usageSchema, l as encodeHistoryPayload, o as decodeStoredConversationEvent, r as conversationEventDataSchema, s as historyReplacementSchema } from "./history-IjdmO_r6.js";
5
+ import { A as juniorConversations, E as juniorConversationAnnotations, M as juniorUsers, N as juniorDestinations, S as juniorConversationMetrics, j as juniorIdentities, t as createJuniorSqlExecutor, v as juniorConversationParticipants, w as juniorConversationEvents, x as CONVERSATION_METRICS, y as juniorConversationBindings } from "./executor-DKrtH0k_.js";
6
+ import { d as historyReplacementSchema, f as newConversationEventSchema, p as encodeHistoryPayload, s as conversationEventDataSchema, u as decodeStoredConversationEvent, y as usageSchema } from "./media-BepyEUNm.js";
7
7
  import { randomUUID } from "node:crypto";
8
8
  import { and, asc, desc, eq, gt, gte, inArray, isNull, lt, lte, ne, or, sql } from "drizzle-orm";
9
9
  import { destinationSchema, locationSchema, sourceSchema } from "@sentry/junior-plugin-api";
@@ -37,6 +37,32 @@ function sameDestination(left, right) {
37
37
  if (left.platform === "slack" && right.platform === "slack") return left.teamId === right.teamId && left.channelId === right.channelId;
38
38
  return false;
39
39
  }
40
+ // src/chat/conversations/sql/detail-version.ts
41
+ /** SQL that advances `detail_version` inside a `juniorConversations` set. */
42
+ const nextDetailVersion = sql`${juniorConversations.detailVersion} + 1`;
43
+ function bumpDetailVersion(db, conversationIds) {
44
+ return db.update(juniorConversations).set({ detailVersion: nextDetailVersion }).where(inArray(juniorConversations.conversationId, [...conversationIds]));
45
+ }
46
+ /**
47
+ * Return a CTE that marks the detail report of each Conversation as changed,
48
+ * in the same statement as the write that it covers:
49
+ * `db.with(conversationDetailTouch(db, ids)).insert(table)`.
50
+ * Postgres runs a data-modifying CTE even when the statement does not read it,
51
+ * and both changes commit together.
52
+ */
53
+ function conversationDetailTouch(db, conversationIds) {
54
+ return db.$with("conversation_detail_touch").as(bumpDetailVersion(db, conversationIds).returning({ conversationId: juniorConversations.conversationId }));
55
+ }
56
+ /**
57
+ * Mark the detail report of each Conversation as changed, for a write that
58
+ * cannot carry `conversationDetailTouch`. Call it after that write, in the same
59
+ * transaction when there is one. A bump before the write lets a detail read
60
+ * store old content under the new version.
61
+ */
62
+ async function touchConversationDetail(db, conversationIds) {
63
+ if (conversationIds.length === 0) return;
64
+ await bumpDetailVersion(db, conversationIds);
65
+ }
40
66
  // src/chat/conversations/sql/participants.ts
41
67
  /** Resolve the root conversation id that owns personal-feed membership. */
42
68
  async function resolveRootConversationId(executor, conversationId) {
@@ -75,6 +101,24 @@ async function recordConversationParticipant(executor, args) {
75
101
  });
76
102
  return true;
77
103
  }
104
+ /**
105
+ * Add a User as a Participant of each root that their Identity started,
106
+ * when that Identity gets its User after the roots exist. The root write
107
+ * adds a Participant only for an Identity that already has a User.
108
+ */
109
+ async function recordStartedConversationParticipants(executor, args) {
110
+ const roots = await executor.db().select({
111
+ conversationId: juniorConversations.conversationId,
112
+ lastActivityAt: juniorConversations.lastActivityAt
113
+ }).from(juniorConversations).where(and(eq(juniorConversations.actorIdentityId, args.identityId), isNull(juniorConversations.parentConversationId)));
114
+ if (roots.length === 0) return;
115
+ const added = await executor.db().insert(juniorConversationParticipants).values(roots.map((root) => ({
116
+ userId: args.userId,
117
+ rootConversationId: root.conversationId,
118
+ lastMessageAt: root.lastActivityAt
119
+ }))).onConflictDoNothing().returning({ rootConversationId: juniorConversationParticipants.rootConversationId });
120
+ await touchConversationDetail(executor.db(), added.map((row) => row.rootConversationId));
121
+ }
78
122
  // src/chat/usage.ts
79
123
  const agentTurnUsageSchema = usageSchema;
80
124
  const COMPONENT_USAGE_FIELDS = [
@@ -174,32 +218,6 @@ function addAgentTurnUsage(...usages) {
174
218
  };
175
219
  return hasAgentTurnUsage(result) ? result : void 0;
176
220
  }
177
- // src/chat/conversations/sql/detail-version.ts
178
- /** SQL that advances `detail_version` inside a `juniorConversations` set. */
179
- const nextDetailVersion = sql`${juniorConversations.detailVersion} + 1`;
180
- function bumpDetailVersion(db, conversationIds) {
181
- return db.update(juniorConversations).set({ detailVersion: nextDetailVersion }).where(inArray(juniorConversations.conversationId, [...conversationIds]));
182
- }
183
- /**
184
- * Return a CTE that marks the detail report of each Conversation as changed,
185
- * in the same statement as the write that it covers:
186
- * `db.with(conversationDetailTouch(db, ids)).insert(table)`.
187
- * Postgres runs a data-modifying CTE even when the statement does not read it,
188
- * and both changes commit together.
189
- */
190
- function conversationDetailTouch(db, conversationIds) {
191
- return db.$with("conversation_detail_touch").as(bumpDetailVersion(db, conversationIds).returning({ conversationId: juniorConversations.conversationId }));
192
- }
193
- /**
194
- * Mark the detail report of each Conversation as changed, for a write that
195
- * cannot carry `conversationDetailTouch`. Call it after that write, in the same
196
- * transaction when there is one. A bump before the write lets a detail read
197
- * store old content under the new version.
198
- */
199
- async function touchConversationDetail(db, conversationIds) {
200
- if (conversationIds.length === 0) return;
201
- await bumpDetailVersion(db, conversationIds);
202
- }
203
221
  // src/chat/conversations/metrics.ts
204
222
  function finite(value) {
205
223
  return value !== void 0 && Number.isFinite(value) && value >= 0 ? value : void 0;
@@ -262,6 +280,7 @@ async function replaceConversationMetrics(executor, args) {
262
280
  const values = CONVERSATION_METRICS.flatMap((metric) => {
263
281
  const value = metricValues[metric];
264
282
  return value === void 0 ? [] : [{
283
+ actorIdentityId: args.actorIdentityId ?? null,
265
284
  conversationId: args.conversationId,
266
285
  runId: args.runId,
267
286
  metric,
@@ -454,6 +473,10 @@ async function upsertIdentityRecord(executor, identity, linkedUserId, nowMs) {
454
473
  if (linkedUserId) throw new Error("Identity conflicts with linked user");
455
474
  throw new Error("Identity upsert returned no row");
456
475
  }
476
+ if (!existing?.userId && row.userId && identity.kind === "user") await recordStartedConversationParticipants(executor, {
477
+ identityId: row.id,
478
+ userId: row.userId
479
+ });
457
480
  return {
458
481
  id: row.id,
459
482
  ...row.userId ? { userId: row.userId } : void 0
@@ -935,6 +958,7 @@ function conversationFromRow(readRow) {
935
958
  ...row.title ? { title: row.title } : void 0,
936
959
  ...msFromDate(row.transcriptPurgedAt) !== void 0 ? { transcriptPurgedAtMs: msFromDate(row.transcriptPurgedAt) } : void 0,
937
960
  ...msFromDate(row.stoppedAt) !== void 0 ? { stoppedAtMs: msFromDate(row.stoppedAt) } : void 0,
961
+ ...msFromDate(row.deliveryPausedAt) !== void 0 ? { deliveryPausedAtMs: msFromDate(row.deliveryPausedAt) } : void 0,
938
962
  ...visibility ? { visibility } : void 0
939
963
  };
940
964
  }
@@ -1081,6 +1105,7 @@ var SqlStore = class {
1081
1105
  } });
1082
1106
  if (args.metrics && args.execution.runId) {
1083
1107
  await replaceConversationMetrics(this.executor, {
1108
+ actorIdentityId: args.actorIdentityId,
1084
1109
  conversationId: args.conversationId,
1085
1110
  runId: args.execution.runId,
1086
1111
  occurredAtMs: args.createdAtMs,
@@ -1913,4 +1938,4 @@ async function closeDb() {
1913
1938
  current = void 0;
1914
1939
  await previous?.db.close();
1915
1940
  }
1916
- export { deleteProviderIdentityForUser as A, conversationDetailTouch as B, setFirstConversationLocation as C, resolveActorIdentityId as D, findActorIdentityId as E, upsertLinkedIdentity as F, agentTurnTotalTokens as G, touchConversationDetail as H, bindProviderConversation as I, resolveRootConversationId as J, agentTurnUsageSchema as K, claimProviderConversation as L, readUserTimezone as M, recordGoogleSignIn as N, saveActorAvatar as O, saveUserTimezone as P, sameDestination as Q, getConversationIdByProviderConversation as R, locationFromRow as S, SYSTEM_IDENTITY_ID as T, addAgentTurnUsage as U, nextDetailVersion as V, agentTurnCostUsd as W, parseDestination as X, createSlackDestination as Y, requireSlackDestination as Z, setArchivedAt as _, getConversationStore as a, withConversationMutationLock as b, conversationIdsWithAnnotation as c, createSqlConversationEventStore as d, eventFromRow as f, readConversationTrees as g, conversationDescendants as h, getConversationMessageSearchStore as i, findUserByVerifiedEmails as j, deleteProviderIdentityForSlackUser as k, hasAnnotationKey as l, conversationAncestors as m, db_exports as n, getDb as o, withConversationEventLock as p, hasAgentTurnUsage as q, getConversationEventStore as r, getSqlExecutor as s, closeDb as t, treeHasAnnotationKey as u, loadConversationSlackTenantIds as v, startLocationThread as w, conversationKindFromRow as x, createSqlStore as y, parseSessionSource as z };
1941
+ export { sameDestination as $, deleteProviderIdentityForUser as A, addAgentTurnUsage as B, setFirstConversationLocation as C, resolveActorIdentityId as D, findActorIdentityId as E, upsertLinkedIdentity as F, resolveRootConversationId as G, agentTurnTotalTokens as H, bindProviderConversation as I, nextDetailVersion as J, rootConversationIsArchived as K, claimProviderConversation as L, readUserTimezone as M, recordGoogleSignIn as N, saveActorAvatar as O, saveUserTimezone as P, requireSlackDestination as Q, getConversationIdByProviderConversation as R, locationFromRow as S, SYSTEM_IDENTITY_ID as T, agentTurnUsageSchema as U, agentTurnCostUsd as V, hasAgentTurnUsage as W, createSlackDestination as X, touchConversationDetail as Y, parseDestination as Z, setArchivedAt as _, getConversationStore as a, withConversationMutationLock as b, conversationIdsWithAnnotation as c, createSqlConversationEventStore as d, eventFromRow as f, readConversationTrees as g, conversationDescendants as h, getConversationMessageSearchStore as i, findUserByVerifiedEmails as j, deleteProviderIdentityForSlackUser as k, hasAnnotationKey as l, conversationAncestors as m, db_exports as n, getDb as o, withConversationEventLock as p, conversationDetailTouch as q, getConversationEventStore as r, getSqlExecutor as s, closeDb as t, treeHasAnnotationKey as u, loadConversationSlackTenantIds as v, startLocationThread as w, conversationKindFromRow as x, createSqlStore as y, parseSessionSource as z };
@@ -1,10 +1,10 @@
1
- import "./schema-B_6aOcx5.js";
1
+ import "./schema-DQaFSkZZ.js";
2
2
  import * as z from "zod";
3
3
  import "drizzle-orm";
4
4
  import { Destination, Source, locationSchema } from "@sentry/junior-plugin-api";
5
5
  import "drizzle-orm/pg-core";
6
- import "@earendil-works/pi-ai";
7
6
  import "drizzle-orm/migrator";
7
+ import "@earendil-works/pi-ai";
8
8
  import "drizzle-orm/pg-core/session";
9
9
  type ConversationPrivacy = "public" | "private";
10
10
  /** Validated Location associated with a Conversation. */
@@ -124,6 +124,8 @@ interface Conversation {
124
124
  transcriptPurgedAtMs?: number;
125
125
  /** When a person stopped this Conversation. Unset when it is not stopped. */
126
126
  stoppedAtMs?: number;
127
+ /** Set while a root's Event Turn replies stay out of its Location. */
128
+ deliveryPausedAtMs?: number;
127
129
  /** Confirmed Conversation visibility. Undefined means no confirmation exists. */
128
130
  visibility?: ConversationPrivacy;
129
131
  }
@@ -217,6 +219,8 @@ interface ConversationStore {
217
219
  * Conversation metric fields cache totals for existing readers.
218
220
  */
219
221
  recordExecution(args: {
222
+ /** Identity of the Turn Actor. Its metric rows record it. */
223
+ actorIdentityId?: string;
220
224
  channelName?: string;
221
225
  conversationId: string;
222
226
  /** When this Run started. */