@sentry/junior 0.239.0 → 0.240.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 (60) hide show
  1. package/dist/{admin-Cc-iA6z9.js → admin-D6fRPRgC.js} +1 -1
  2. package/dist/{agent-hooks-DzfA5m3R.js → agent-hooks-JFbgedMZ.js} +116 -10
  3. package/dist/{agent-runner--1wC26S6.js → agent-runner-0IjJxsL1.js} +60 -121
  4. package/dist/api/schema.js +2 -2
  5. package/dist/api.d.ts +1 -1
  6. package/dist/api.js +21 -20
  7. package/dist/{app-FB2hmHpZ.d.ts → app-MEd7wbF0.d.ts} +1 -1
  8. package/dist/app.d.ts +1 -1
  9. package/dist/app.js +24 -23
  10. package/dist/{automation-CrQGQ2MT.js → automation-B5_c8hEb.js} +2 -253
  11. package/dist/{briefs-DGc2Thua.js → briefs-BGWTp-nz.js} +2 -2
  12. package/dist/cadence-D00SCzT1.js +256 -0
  13. package/dist/{catalog-runtime-DpB_hG_I.js → catalog-runtime-DdigNl7s.js} +1 -1
  14. package/dist/{checkpoint-CN7yMfSo.js → checkpoint-C1ZnSz7r.js} +15 -11
  15. package/dist/cli/chat.js +12 -12
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/main.js +2 -2
  18. package/dist/cli/plugins.js +4 -4
  19. package/dist/cli/snapshot-create.js +3 -3
  20. package/dist/cli/upgrade.d.ts +1 -1
  21. package/dist/cli/upgrade.js +3 -3
  22. package/dist/{client-DNf-sJmM.js → client-Cn73E7br.js} +2 -2
  23. package/dist/{config-B8QN-04U.js → config-B0S86yw9.js} +2 -2
  24. package/dist/{conversation-privacy-CrYizZM3.js → conversation-privacy-BKlX7D_R.js} +1 -1
  25. package/dist/{credential-sync-BG_Yvja8.js → credential-sync-DeNQm7st.js} +14 -14
  26. package/dist/{db-CWZP77Ex.d.ts → db-Ca9Nt5ci.d.ts} +1 -1
  27. package/dist/{executor-BQV1Zc1z.js → executor-BQ-A5nov.js} +2 -2
  28. package/dist/{images-C_0iwPsW.js → images-C7OKd6uy.js} +2 -2
  29. package/dist/instrumentation.js +2 -2
  30. package/dist/{job-queue-D82gksYM.js → job-queue-DgXLqoeB.js} +1 -1
  31. package/dist/{logging-Crg0e1jb.js → logging-BSNF167N.js} +1 -1
  32. package/dist/nitro.d.ts +1 -1
  33. package/dist/nitro.js +3 -3
  34. package/dist/{oauth-authorization-Bdu39G-H.js → oauth-authorization-BM7g61od.js} +1 -1
  35. package/dist/{oauth-callback-server-eJfI6skP.js → oauth-callback-server-Dw-BwI6x.js} +2 -2
  36. package/dist/{pending-auth-DauOaies.js → pending-auth-Chn_EA1_.js} +2 -2
  37. package/dist/{profile-XzHSfIah.js → profile-3t9H_IwL.js} +4 -4
  38. package/dist/{registry-BJME30oR.js → registry-DLZlAhdP.js} +1 -1
  39. package/dist/{resolve-ZKXfsZuZ.js → resolve-9_cIPQsq.js} +2 -2
  40. package/dist/{runner-DkHL8vRA.js → runner-C_eUbFyp.js} +9 -9
  41. package/dist/{sandbox-egress-signals-BEQsK7ym.js → sandbox-egress-signals-C1ycxTNA.js} +1 -1
  42. package/dist/{schema-CxWAN2zq.js → schema-C4XwHTY4.js} +1 -1
  43. package/dist/{skills-CMl248J3.js → skills-Dqgjr_Tl.js} +2 -2
  44. package/dist/{spawn-DrvZYrTQ.js → spawn-BfEr3t7b.js} +2 -2
  45. package/dist/{store-BxxbxBlm.d.ts → store-DoewL5mG.d.ts} +0 -7
  46. package/dist/{task-queue-BMzTARMo.js → task-queue-CuFZDOXn.js} +3 -3
  47. package/dist/{task-runner-CXTpWSmw.js → task-runner-c7gwV8dj.js} +10 -10
  48. package/dist/{thread-state-BM1sLptE.js → thread-state-exTu-G1w.js} +6 -6
  49. package/dist/{turn-failure-response-ISrbka5I.js → turn-failure-response-DFp99ziF.js} +8 -8
  50. package/dist/{turn-lifecycle-f7TPxQsc.js → turn-lifecycle-C4TjuOzG.js} +1 -1
  51. package/dist/{turn-session-routing-BcAD7onh.js → turn-session-routing-Vpg8jUD1.js} +1 -1
  52. package/dist/{validation-Bo6BHmig.js → validation-D2lULEG9.js} +1 -1
  53. package/dist/{version-Cv__n5ue.js → version-BjBMCc2o.js} +1 -1
  54. package/dist/version.js +1 -1
  55. package/dist/{viewer-EftpWXcF.js → viewer-XE3nFqKM.js} +9 -11
  56. package/dist/{web-authorization-BLDXKk2u.js → web-authorization-8E8IrWOj.js} +6 -6
  57. package/dist/{web-input-DSa6geKr.js → web-input-DF4GGJrf.js} +24 -41
  58. package/dist/{work-WOk5DovU.js → work-Dt_JjfbX.js} +7 -7
  59. package/dist/{worker-B7rtMFzw.js → worker-BrbnLmD3.js} +5 -5
  60. package/package.json +5 -5
@@ -1,9 +1,9 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { F as normalizeIdentityEmail } from "./logging-Crg0e1jb.js";
3
- import { i as getChatConfig } from "./config-B8QN-04U.js";
2
+ import { F as normalizeIdentityEmail } from "./logging-BSNF167N.js";
3
+ import { i as getChatConfig } from "./config-B0S86yw9.js";
4
4
  import { d as parseSlackTeamId, o as parseActorUserId, u as parseSlackChannelReferenceId } from "./actor-BTtLaeWy.js";
5
5
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
6
- import { D as juniorConversations, E as conversationReadColumns, O as juniorIdentities, S as juniorConversationAnnotations, b as juniorConversationEvents, g as juniorConversationBindings, h as juniorConversationParticipants, k as juniorUsers, t as createJuniorSqlExecutor, v as CONVERSATION_METRICS, y as juniorConversationMetrics } from "./executor-BQV1Zc1z.js";
6
+ import { D as juniorConversations, E as conversationReadColumns, O as juniorIdentities, S as juniorConversationAnnotations, b as juniorConversationEvents, g as juniorConversationBindings, h as juniorConversationParticipants, k as juniorUsers, t as createJuniorSqlExecutor, v as CONVERSATION_METRICS, y as juniorConversationMetrics } from "./executor-BQ-A5nov.js";
7
7
  import { c as newConversationEventSchema, l as encodeHistoryPayload, m as usageSchema, o as decodeStoredConversationEvent, r as conversationEventDataSchema, s as historyReplacementSchema } from "./history-BLTUgFYO.js";
8
8
  import { randomUUID } from "node:crypto";
9
9
  import { and, asc, desc, eq, gt, gte, inArray, isNull, lt, lte, ne, or, sql } from "drizzle-orm";
@@ -413,10 +413,6 @@ function parseSessionSource(value) {
413
413
  async function getConversationIdByProviderConversation(executor, args) {
414
414
  return (await executor.db().select({ conversationId: juniorConversationBindings.conversationId }).from(juniorConversationBindings).where(and(eq(juniorConversationBindings.provider, args.provider), eq(juniorConversationBindings.providerTenantId, args.providerTenantId), eq(juniorConversationBindings.providerDestinationId, args.providerDestinationId), eq(juniorConversationBindings.providerConversationId, args.providerConversationId))).limit(1))[0]?.conversationId;
415
415
  }
416
- /** Return the first provider conversation bound in one destination. */
417
- async function getFirstProviderConversationId(executor, args) {
418
- return (await executor.db().select({ providerConversationId: juniorConversationBindings.providerConversationId }).from(juniorConversationBindings).where(and(eq(juniorConversationBindings.conversationId, args.conversationId), eq(juniorConversationBindings.provider, args.provider), eq(juniorConversationBindings.providerTenantId, args.providerTenantId), eq(juniorConversationBindings.providerDestinationId, args.providerDestinationId))).orderBy(asc(juniorConversationBindings.createdAt), asc(juniorConversationBindings.providerConversationId)).limit(1))[0]?.providerConversationId;
419
- }
420
416
  /** Bind provider coordinates to a durable conversation in the caller's SQL scope. */
421
417
  async function bindProviderConversation(executor, args) {
422
418
  if (((await executor.db().insert(juniorConversationBindings).values({
@@ -566,6 +562,11 @@ function visibilityFromLocationRow(row) {
566
562
  if (!row) return;
567
563
  if (row.visibility === "public" || row.visibility === "private") return row.visibility;
568
564
  }
565
+ /** Store a channel-level Location's first bound post as its thread. */
566
+ async function startLocationThread(executor, binding) {
567
+ const location = juniorConversations.location;
568
+ await executor.db().update(juniorConversations).set({ location: sql`${location} || jsonb_build_object('threadTs', ${binding.providerConversationId}::text)` }).where(and(eq(juniorConversations.conversationId, binding.conversationId), sql`${location}->>'provider' = ${binding.provider}`, sql`${location}->>'teamId' = ${binding.providerTenantId}`, sql`${location}->>'channelId' = ${binding.providerDestinationId}`, isNull(sql`${location}->>'threadTs'`)));
569
+ }
569
570
  //#endregion
570
571
  //#region src/chat/conversations/sql/store.ts
571
572
  const CONVERSATION_MUTATION_LOCK_PREFIX = "junior_conversation";
@@ -718,9 +719,6 @@ var SqlStore = class {
718
719
  async getConversationIdByProviderConversation(args) {
719
720
  return await getConversationIdByProviderConversation(this.executor, args);
720
721
  }
721
- async getFirstProviderConversationId(args) {
722
- return await getFirstProviderConversationId(this.executor, args);
723
- }
724
722
  async bindProviderConversation(args) {
725
723
  await bindProviderConversation(this.executor, args);
726
724
  }
@@ -1633,4 +1631,4 @@ async function readActorIdentity(actor) {
1633
1631
  return await readActorIdentityFromSql(getDb(), actor);
1634
1632
  }
1635
1633
  //#endregion
1636
- export { upsertLinkedIdentity as A, agentTurnUsageSchema as C, readUserTimezone as D, deleteProviderIdentityForSlackUser as E, parseDestination as M, requireSlackDestination as N, saveUserTimezone as O, sameDestination as P, agentTurnTotalTokens as S, resolveRootConversationId as T, locationFromRow as _, setUserAdminFromSql as a, addAgentTurnUsage as b, getConversationEventStore as c, getDb as d, getSqlExecutor as f, withConversationMutationLock as g, createSqlStore as h, resolveViewerUser as i, createSlackDestination as j, upsertIdentity as k, getConversationMessageSearchStore as l, withConversationEventLock as m, listAdminUsersFromSql as n, updateViewerDisplayName as o, createSqlConversationEventStore as p, readActorIdentity as r, db_exports as s, findUserByEmail as t, getConversationStore as u, bindProviderConversation as v, hasAgentTurnUsage as w, agentTurnCostUsd as x, parseSessionSource as y };
1634
+ export { upsertIdentity as A, agentTurnTotalTokens as C, deleteProviderIdentityForSlackUser as D, resolveRootConversationId as E, sameDestination as F, createSlackDestination as M, parseDestination as N, readUserTimezone as O, requireSlackDestination as P, agentTurnCostUsd as S, hasAgentTurnUsage as T, locationFromRow as _, setUserAdminFromSql as a, parseSessionSource as b, getConversationEventStore as c, getDb as d, getSqlExecutor as f, withConversationMutationLock as g, createSqlStore as h, resolveViewerUser as i, upsertLinkedIdentity as j, saveUserTimezone as k, getConversationMessageSearchStore as l, withConversationEventLock as m, listAdminUsersFromSql as n, updateViewerDisplayName as o, createSqlConversationEventStore as p, readActorIdentity as r, db_exports as s, findUserByEmail as t, getConversationStore as u, startLocationThread as v, agentTurnUsageSchema as w, addAgentTurnUsage as x, bindProviderConversation as y };
@@ -1,9 +1,9 @@
1
- import { Bt as ensureConversationWake, Xt as requestConversationWork } from "./agent-runner--1wC26S6.js";
2
- import { c as getConversationEventStore } from "./viewer-EftpWXcF.js";
3
- import { n as loadTurnCheckpoint, o as failTurnRecord, s as getTurnRecord } from "./checkpoint-CN7yMfSo.js";
4
- import { w as getStateAdapter } from "./profile-XzHSfIah.js";
5
- import { a as getVercelConversationWorkQueue } from "./job-queue-D82gksYM.js";
6
- import { n as resolveTurnSessionRouting } from "./turn-session-routing-BcAD7onh.js";
1
+ import { Yt as requestConversationWork, zt as ensureConversationWake } from "./agent-runner-0IjJxsL1.js";
2
+ import { c as getConversationEventStore } from "./viewer-XE3nFqKM.js";
3
+ import { n as loadTurnCheckpoint, o as failTurnRecord, s as getTurnRecord } from "./checkpoint-C1ZnSz7r.js";
4
+ import { w as getStateAdapter } from "./profile-3t9H_IwL.js";
5
+ import { a as getVercelConversationWorkQueue } from "./job-queue-DgXLqoeB.js";
6
+ import { n as resolveTurnSessionRouting } from "./turn-session-routing-Vpg8jUD1.js";
7
7
  import { z } from "zod";
8
8
  import { randomUUID } from "node:crypto";
9
9
  //#region src/chat/task-execution/authorized-turn.ts
@@ -1,34 +1,34 @@
1
- import { $ as eventAutomationBelongsToUser, A as resolveSlackChannelIdFromMessage, B as parseScheduledAutomationRow, C as renderBlockText, Cn as normalizeSlackReplyMarkdown, Ct as timerWatchCredentialSubject, D as storeAttachment, Dn as addReactionToMessage, En as truncateStatusText, Et as pluginEventCatalog, F as lookupSlackUser, G as withScheduledAutomationLock, Ht as getConversationWorkState, J as eventAutomationTriggerAvailable, Ln as AuthorizationFlowDisabledError, M as getConversationInfo, Mn as createUserTokenStore, N as listThreadReplies, Nn as buildSteeringPiMessage, O as parseSlackThreadId, On as postSlackMessage, Ot as appendAndEnqueueExclusiveInboundMessage, Pn as RetryableDeliveryError, Q as deleteEventAutomation, Rn as shouldEmitDevAgentTrace, S as renderAttachmentText, Sn as formatSlackLink, St as isEventMailboxMetadata, U as saveScheduledAutomationInLock, V as readScheduledAutomation, Y as effectiveTaskOutcomes, a as buildAuthPauseResponse, h as latestProgressStatus, j as resolveSlackChannelIdFromThreadId, k as readSlackRawMessageContext, kn as removeReactionFromMessage, kt as appendAndEnqueueInboundMessage, lt as sameDefinitionValue, m as PluginCredentialFailureError, n as executeAgentRun, nt as listDeletedEventAutomationsCreatedBy, on as maybePostAutomatedTurnLimitNotice, ot as automationDefinition, r as createContextCompactor, rt as parseEventAutomationRow, sn as recordFinishedTurnForAutomatedLimit, st as listAutomationVersions, t as createAgentRunner, tt as getEventAutomation, wn as normalizeSlackStatusText, wt as getEventCatalog, xn as escapeSlackMrkdwnText, xt as EVENT_WAIT_MS } from "./agent-runner--1wC26S6.js";
2
- import { f as escapeXml, i as completeText, r as completeObject, v as isProviderRetryError } from "./client-DNf-sJmM.js";
3
- import { C as withLogContext, I as isRecord, L as toOptionalNumber, R as toOptionalString, _ as setSentryUser, b as setTags, d as logException, f as logInfo, n as createChatSdkLogger, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, u as logError, v as setSpanAttributes, w as withSpan } from "./logging-Crg0e1jb.js";
4
- import { c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName } from "./config-B8QN-04U.js";
1
+ import { A as resolveSlackChannelIdFromMessage, B as readScheduledAutomation, C as renderBlockText, Cn as normalizeSlackStatusText, Ct as getEventCatalog, D as storeAttachment, Dn as postSlackMessage, Dt as appendAndEnqueueExclusiveInboundMessage, En as addReactionToMessage, H as saveScheduledAutomationInLock, In as AuthorizationFlowDisabledError, J as effectiveTaskOutcomes, Ln as shouldEmitDevAgentTrace, M as getConversationInfo, Mn as buildSteeringPiMessage, N as listThreadReplies, Nn as RetryableDeliveryError, O as parseSlackThreadId, On as removeReactionFromMessage, Ot as appendAndEnqueueInboundMessage, Q as eventAutomationBelongsToUser, S as renderAttachmentText, Sn as normalizeSlackReplyMarkdown, St as timerWatchCredentialSubject, Tn as truncateStatusText, Tt as pluginEventCatalog, Vt as getConversationWorkState, W as withScheduledAutomationLock, Z as deleteEventAutomation, a as buildAuthPauseResponse, an as maybePostAutomatedTurnLimitNotice, at as automationDefinition, bn as escapeSlackMrkdwnText, bt as EVENT_WAIT_MS, ct as sameDefinitionValue, et as getEventAutomation, h as latestProgressStatus, j as resolveSlackChannelIdFromThreadId, jn as createUserTokenStore, k as readSlackRawMessageContext, m as PluginCredentialFailureError, n as executeAgentRun, nt as parseEventAutomationRow, on as recordFinishedTurnForAutomatedLimit, ot as listAutomationVersions, q as eventAutomationTriggerAvailable, r as createContextCompactor, t as createAgentRunner, tt as listDeletedEventAutomationsCreatedBy, xn as formatSlackLink, xt as isEventMailboxMetadata, z as parseScheduledAutomationRow } from "./agent-runner-0IjJxsL1.js";
2
+ import { f as escapeXml, i as completeText, r as completeObject, v as isProviderRetryError } from "./client-Cn73E7br.js";
3
+ import { C as withLogContext, I as isRecord, L as toOptionalNumber, R as toOptionalString, _ as setSentryUser, b as setTags, d as logException, f as logInfo, n as createChatSdkLogger, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, u as logError, v as setSpanAttributes, w as withSpan } from "./logging-BSNF167N.js";
4
+ import { c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName } from "./config-B0S86yw9.js";
5
5
  import { o as modelIdForProfile, r as defaultModelId } from "./model-profile-BwU8mqwD.js";
6
6
  import { a as isUserActor, g as parseSlackMessageTs, i as isActorUserId, l as parseSlackChannelId, n as createSlackActor, o as parseActorUserId, r as createSlackResumeActor, t as createActor } from "./actor-BTtLaeWy.js";
7
- import { N as requireSlackDestination, c as getConversationEventStore, d as getDb, f as getSqlExecutor, j as createSlackDestination, u as getConversationStore } from "./viewer-EftpWXcF.js";
7
+ import { M as createSlackDestination, P as requireSlackDestination, c as getConversationEventStore, d as getDb, f as getSqlExecutor, u as getConversationStore } from "./viewer-XE3nFqKM.js";
8
8
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
9
- import { O as juniorIdentities, c as juniorAutomationExecutions, k as juniorUsers, o as juniorSchedulerTasks, u as juniorEventAutomations } from "./executor-BQV1Zc1z.js";
9
+ import { O as juniorIdentities, c as juniorAutomationExecutions, k as juniorUsers, o as juniorSchedulerTasks, u as juniorEventAutomations } from "./executor-BQ-A5nov.js";
10
10
  import { f as instructionProvenanceFor } from "./history-BLTUgFYO.js";
11
- import { d as credentialContextForActor } from "./registry-BJME30oR.js";
12
- import { $ as resolveConversationTitle, A as commitAcceptedReply, G as recordSubscribedReplyRoute, N as loadConversationProjection, O as trimTrailingAssistantMessages, P as loadProjection, Q as persistConversationMessageSummaries, V as recordAuthorizationCompleted, X as persistConversationMessages, Y as hydrateConversationMessages, a as completeTurnRecord, at as createConversationMemoryService, c as listTurnSummaries, ct as isHumanConversationMessage, dt as recordDeliveredAssistantMessage, ft as turnHasReply, i as abandonTurnRecord, it as buildConversationContext, j as commitMessages, l as recordTurnSummary, lt as markConversationMessage, n as loadTurnCheckpoint, o as failTurnRecord, ot as estimateConversationContextTokens, p as buildTurnErrorResponse, pt as upsertConversationMessage, r as saveTurnCheckpoint, rt as appendThreadContextMessages, s as getTurnRecord, st as getConversationMessageSlackTs, tt as fallbackShortTitle, u as persistWithRetry, ut as normalizeConversationText } from "./checkpoint-CN7yMfSo.js";
13
- import { Ft as getSlackFileId, Lt as readAttachmentVisionSummary, Pt as buildSentryConversationUrl, Rt as recordSlackAttachment, at as getSlackClient, ct as normalizeSlackConversationId, et as verifyTimerWatchCredentialSubject, ht as getDashboardObjectIconLink, it as getHeaderString, lt as runWithSlackInstallationToken, mt as getDashboardConversationLink, nt as downloadPrivateSlackFile, o as getPluginSlackConversationLink, pt as JUNIOR_THREAD_STATE_TTL_MS, st as isDmChannel, tt as SlackActionError, z as cancelSubscriptions } from "./agent-hooks-DzfA5m3R.js";
11
+ import { d as credentialContextForActor } from "./registry-DLZlAhdP.js";
12
+ import { $ as resolveConversationTitle, A as commitAcceptedReply, G as recordSubscribedReplyRoute, N as loadConversationProjection, O as trimTrailingAssistantMessages, P as loadProjection, Q as persistConversationMessageSummaries, V as recordAuthorizationCompleted, X as persistConversationMessages, Y as hydrateConversationMessages, a as completeTurnRecord, at as createConversationMemoryService, c as listTurnSummaries, ct as isHumanConversationMessage, dt as recordDeliveredAssistantMessage, ft as turnHasReply, i as abandonTurnRecord, it as buildConversationContext, j as commitMessages, l as recordTurnSummary, lt as markConversationMessage, n as loadTurnCheckpoint, o as failTurnRecord, ot as estimateConversationContextTokens, p as buildTurnErrorResponse, pt as upsertConversationMessage, r as saveTurnCheckpoint, rt as appendThreadContextMessages, s as getTurnRecord, st as getConversationMessageSlackTs, tt as fallbackShortTitle, u as persistWithRetry, ut as normalizeConversationText } from "./checkpoint-C1ZnSz7r.js";
13
+ import { Ft as getSlackFileId, Kt as lookupSlackUser, Lt as readAttachmentVisionSummary, Pt as buildSentryConversationUrl, Rt as recordSlackAttachment, at as getSlackClient, ct as normalizeSlackConversationId, et as verifyTimerWatchCredentialSubject, ht as getDashboardObjectIconLink, it as getHeaderString, lt as runWithSlackInstallationToken, mt as getDashboardConversationLink, nt as downloadPrivateSlackFile, o as getPluginSlackConversationLink, pt as JUNIOR_THREAD_STATE_TTL_MS, st as isDmChannel, tt as SlackActionError, z as cancelSubscriptions } from "./agent-hooks-JFbgedMZ.js";
14
14
  import { F as isVisionImageMediaType, N as readMessageAttachments } from "./conversation-DwD-vquD.js";
15
- import { E as acquireActiveLock, O as withLock, T as MUTATION_LOCK_TTL_MS, w as getStateAdapter } from "./profile-XzHSfIah.js";
16
- import { a as wasPendingAuthStopped, c as getThreadStopDecision, l as buildDeterministicAssistantMessageId, o as decideSubscribedThreadReply, r as clearPendingAuth, s as getSubscribedReplyPreflightDecision, u as buildDeterministicTurnId } from "./pending-auth-DauOaies.js";
17
- import { _ as markTurnFailed, c as CooperativeTurnYieldError, d as getConversationTurnBoundaryError, f as isCooperativeTurnYieldError, g as markTurnCompleted, h as markTurnClosed, l as TurnInputCommitLostError, m as isTurnInputDeferredError, p as isTurnInputCommitLostError, r as getAssistantReplyText, s as ConversationTurnBoundaryError, u as TurnInputDeferredError, v as startActiveTurn } from "./oauth-authorization-Bdu39G-H.js";
15
+ import { E as acquireActiveLock, O as withLock, T as MUTATION_LOCK_TTL_MS, w as getStateAdapter } from "./profile-3t9H_IwL.js";
16
+ import { a as wasPendingAuthStopped, c as getThreadStopDecision, l as buildDeterministicAssistantMessageId, o as decideSubscribedThreadReply, r as clearPendingAuth, s as getSubscribedReplyPreflightDecision, u as buildDeterministicTurnId } from "./pending-auth-Chn_EA1_.js";
17
+ import { _ as markTurnFailed, c as CooperativeTurnYieldError, d as getConversationTurnBoundaryError, f as isCooperativeTurnYieldError, g as markTurnCompleted, h as markTurnClosed, l as TurnInputCommitLostError, m as isTurnInputDeferredError, p as isTurnInputCommitLostError, r as getAssistantReplyText, s as ConversationTurnBoundaryError, u as TurnInputDeferredError, v as startActiveTurn } from "./oauth-authorization-BM7g61od.js";
18
18
  import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-CMU-B4FA.js";
19
- import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-D82gksYM.js";
20
- import { l as automationListQuerySchema } from "./automation-CrQGQ2MT.js";
19
+ import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-DgXLqoeB.js";
20
+ import { l as automationListQuerySchema } from "./automation-B5_c8hEb.js";
21
21
  import { r as isExperimentalFeatureEnabled } from "./experimental-Qn9rKLgx.js";
22
22
  import { c as sumUtcHoursIntoSixHours, m as healthReportSchema, t as webMessageId } from "./web-message-id-xPI_EFSC.js";
23
- import { C as readAutomationExecutionStatusDays, D as readAutomationRuns, E as readAutomationExecutions, S as readAutomationExecutionHours, T as readAutomationExecutionSummaries, _ as markDispatchFailed, a as confirmDispatchMailboxAppend, b as readAutomationExecutionByConversationId, c as getDispatchInputMessageId, f as isTerminalDispatchStatus, g as markDispatchCompleted, h as markDispatchBlocked, i as claimDispatchMailboxAppend, l as getDispatchRecord, m as markDispatchAwaitingResume, n as scheduleSessionCompletedPluginTasks, s as getDispatchConversationId, t as processPluginTask, u as getDispatchTurnId, v as markDispatchRunning, w as readAutomationExecutionStatusHours, x as readAutomationExecutionDays, y as emptyAutomationRunWindows } from "./task-runner-CXTpWSmw.js";
24
- import { i as resolveAgentInvocationId, o as AgentRunError, s as executeTurn, t as createAgentInvocationWorker } from "./work-WOk5DovU.js";
25
- import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-f7TPxQsc.js";
26
- import { a as persistThreadState, c as configValueSchema, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-BM1sLptE.js";
27
- import { a as getPausedTurnRequest, c as getTurnAuthorization, i as createPausedTurns, n as deleteWebAuthorization, s as wakePausedTurn, t as createWebAuthorization } from "./web-authorization-BLDXKk2u.js";
28
- import { n as resolveTurnSessionRouting } from "./turn-session-routing-BcAD7onh.js";
29
- import { t as bindSpawnAgent } from "./spawn-DrvZYrTQ.js";
30
- import { a as persistAuthPauseTurnState, c as getTurnUserSlackMessageTs, d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, n as getAgentTurnDiagnosticsAttributes, o as getTurnUserMessage, r as requireTurnFailureEventId, s as getTurnUserReplyAttachmentContext, t as finalizeFailedTurnReplyWithEvent, u as getInterruptionMarker } from "./turn-failure-response-ISrbka5I.js";
31
- import { r as storeInputImages } from "./images-C_0iwPsW.js";
23
+ import { C as readAutomationExecutionStatusDays, D as readAutomationRuns, E as readAutomationExecutions, S as readAutomationExecutionHours, T as readAutomationExecutionSummaries, _ as markDispatchFailed, a as confirmDispatchMailboxAppend, b as readAutomationExecutionByConversationId, c as getDispatchInputMessageId, f as isTerminalDispatchStatus, g as markDispatchCompleted, h as markDispatchBlocked, i as claimDispatchMailboxAppend, l as getDispatchRecord, m as markDispatchAwaitingResume, n as scheduleSessionCompletedPluginTasks, s as getDispatchConversationId, t as processPluginTask, u as getDispatchTurnId, v as markDispatchRunning, w as readAutomationExecutionStatusHours, x as readAutomationExecutionDays, y as emptyAutomationRunWindows } from "./task-runner-c7gwV8dj.js";
24
+ import { i as resolveAgentInvocationId, o as AgentRunError, s as executeTurn, t as createAgentInvocationWorker } from "./work-Dt_JjfbX.js";
25
+ import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-C4TjuOzG.js";
26
+ import { a as persistThreadState, c as configValueSchema, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-exTu-G1w.js";
27
+ import { a as getPausedTurnRequest, c as getTurnAuthorization, i as createPausedTurns, n as deleteWebAuthorization, s as wakePausedTurn, t as createWebAuthorization } from "./web-authorization-8E8IrWOj.js";
28
+ import { n as resolveTurnSessionRouting } from "./turn-session-routing-Vpg8jUD1.js";
29
+ import { t as bindSpawnAgent } from "./spawn-BfEr3t7b.js";
30
+ import { a as persistAuthPauseTurnState, c as getTurnUserSlackMessageTs, d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, n as getAgentTurnDiagnosticsAttributes, o as getTurnUserMessage, r as requireTurnFailureEventId, s as getTurnUserReplyAttachmentContext, t as finalizeFailedTurnReplyWithEvent, u as getInterruptionMarker } from "./turn-failure-response-DFp99ziF.js";
31
+ import { r as storeInputImages } from "./images-C7OKd6uy.js";
32
32
  import { z } from "zod";
33
33
  import { createHash } from "node:crypto";
34
34
  import { and, asc, count, desc, eq, exists, inArray, ne, or, sql } from "drizzle-orm";
@@ -6675,23 +6675,6 @@ function captureConversationTurnFailure(args) {
6675
6675
  });
6676
6676
  return typeof eventId === "string" ? eventId : void 0;
6677
6677
  }
6678
- /**
6679
- * Reply in the thread started by a channel-level Conversation's first Message.
6680
- * Automation runs post at the channel top level, so their Watches need this.
6681
- */
6682
- async function resolveStartedThreadLocation(conversationId, location) {
6683
- if (location?.provider !== "slack" || location.threadTs) return location;
6684
- const threadTs = await getConversationStore().getFirstProviderConversationId({
6685
- conversationId,
6686
- provider: "slack",
6687
- providerDestinationId: location.channelId,
6688
- providerTenantId: location.teamId
6689
- });
6690
- return threadTs ? {
6691
- ...location,
6692
- threadTs
6693
- } : location;
6694
- }
6695
6678
  /** Return the saved timer creator subject when it is still valid here. */
6696
6679
  function resumedTimerWatchCredentialSubject(conversationId, subject) {
6697
6680
  if (subject?.binding.type !== "timer-watch") return void 0;
@@ -6816,7 +6799,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage) {
6816
6799
  visibility: storedConversation?.visibility
6817
6800
  });
6818
6801
  const webActor = actor.platform === "web" ? actor : void 0;
6819
- const conversationLocation = await resolveStartedThreadLocation(context.conversationId, storedConversation?.location);
6802
+ const conversationLocation = storedConversation?.location;
6820
6803
  const deliverToProvider = Boolean(conversationLocation) && (source.kind === "event" || savedMessageIsEvent);
6821
6804
  const surface = deliverToProvider ? "slack" : "api";
6822
6805
  return await withLogContext({
@@ -1,11 +1,11 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { Ln as AuthorizationFlowDisabledError, _t as AgentInvocationLimitError, gt as AgentInvocationBusyError, ht as createAgentInvocationSchema, kt as appendAndEnqueueInboundMessage, m as PluginCredentialFailureError, mt as agentInvocationSchema, pt as agentBindingSchema } from "./agent-runner--1wC26S6.js";
3
- import { c as getConversationEventStore, f as getSqlExecutor, u as getConversationStore } from "./viewer-EftpWXcF.js";
4
- import { m as juniorAgentInvocations, p as juniorAgentBindings } from "./executor-BQV1Zc1z.js";
5
- import { L as openConversationProjection, _ as getTerminalAssistantMessages, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord } from "./checkpoint-CN7yMfSo.js";
6
- import { d as getConversationTurnBoundaryError, l as TurnInputCommitLostError, p as isTurnInputCommitLostError, r as getAssistantReplyText } from "./oauth-authorization-Bdu39G-H.js";
7
- import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-f7TPxQsc.js";
8
- import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-BM1sLptE.js";
2
+ import { In as AuthorizationFlowDisabledError, Ot as appendAndEnqueueInboundMessage, ft as agentBindingSchema, gt as AgentInvocationLimitError, ht as AgentInvocationBusyError, m as PluginCredentialFailureError, mt as createAgentInvocationSchema, pt as agentInvocationSchema } from "./agent-runner-0IjJxsL1.js";
3
+ import { c as getConversationEventStore, f as getSqlExecutor, u as getConversationStore } from "./viewer-XE3nFqKM.js";
4
+ import { m as juniorAgentInvocations, p as juniorAgentBindings } from "./executor-BQ-A5nov.js";
5
+ import { L as openConversationProjection, _ as getTerminalAssistantMessages, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord } from "./checkpoint-C1ZnSz7r.js";
6
+ import { d as getConversationTurnBoundaryError, l as TurnInputCommitLostError, p as isTurnInputCommitLostError, r as getAssistantReplyText } from "./oauth-authorization-BM7g61od.js";
7
+ import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-C4TjuOzG.js";
8
+ import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-exTu-G1w.js";
9
9
  import { z } from "zod";
10
10
  import { createHash } from "node:crypto";
11
11
  import { and, asc, count, eq, inArray } from "drizzle-orm";
@@ -1,9 +1,9 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { At as beginConversationResume, Bt as ensureConversationWake, Dt as ackMessages, Ft as completeConversationStop, Gt as recordAttemptFailure, Ht as getConversationWorkState, It as completeConversationWork, Kt as recordConversationRetry, Lt as countPendingConversationMessages, Mt as checkInConversationWork, Nt as clearConsumedConversationWake, Rt as deadLetterAttempt, Yt as requestAnotherSlice, Zt as startConversationWork, in as isInvalidConversationRecordError, qt as releaseConversationWork, rn as isFinalAttempt, tn as hasConversationStop, zt as drainConversationMailbox } from "./agent-runner--1wC26S6.js";
3
- import { v as isProviderRetryError } from "./client-DNf-sJmM.js";
4
- import { C as withLogContext, d as logException, f as logInfo, p as logWarn } from "./logging-Crg0e1jb.js";
5
- import { i as getChatConfig } from "./config-B8QN-04U.js";
6
- import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-D82gksYM.js";
2
+ import { Et as ackMessages, Ft as completeConversationWork, Gt as recordConversationRetry, It as countPendingConversationMessages, Jt as requestAnotherSlice, Kt as releaseConversationWork, Lt as deadLetterAttempt, Mt as clearConsumedConversationWake, Pt as completeConversationStop, Rt as drainConversationMailbox, Vt as getConversationWorkState, Wt as recordAttemptFailure, Xt as startConversationWork, en as hasConversationStop, jt as checkInConversationWork, kt as beginConversationResume, nn as isFinalAttempt, rn as isInvalidConversationRecordError, zt as ensureConversationWake } from "./agent-runner-0IjJxsL1.js";
3
+ import { v as isProviderRetryError } from "./client-Cn73E7br.js";
4
+ import { C as withLogContext, d as logException, f as logInfo, p as logWarn } from "./logging-BSNF167N.js";
5
+ import { i as getChatConfig } from "./config-B0S86yw9.js";
6
+ import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-DgXLqoeB.js";
7
7
  //#region src/chat/task-execution/worker.ts
8
8
  var worker_exports = /* @__PURE__ */ __exportAll({
9
9
  CONVERSATION_WORK_DEFER_DELAY_MS: () => CONVERSATION_WORK_DEFER_DELAY_MS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior",
3
- "version": "0.239.0",
3
+ "version": "0.240.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -61,7 +61,7 @@
61
61
  "@earendil-works/pi-ai": "0.85.1",
62
62
  "@hono/zod-validator": "^0.9.0",
63
63
  "@logtape/logtape": "^2.1.1",
64
- "@modelcontextprotocol/sdk": "1.29.0",
64
+ "@modelcontextprotocol/sdk": "1.31.0",
65
65
  "@neondatabase/serverless": "^1.1.0",
66
66
  "@opentelemetry/api": "1.9.1",
67
67
  "@opentelemetry/core": "2.9.0",
@@ -87,7 +87,7 @@
87
87
  "pg": "^8.16.3",
88
88
  "yaml": "^2.9.0",
89
89
  "zod": "^4.5.4",
90
- "@sentry/junior-plugin-api": "0.239.0"
90
+ "@sentry/junior-plugin-api": "0.240.0"
91
91
  },
92
92
  "devDependencies": {
93
93
  "@emnapi/core": "^1.10.0",
@@ -106,9 +106,9 @@
106
106
  "typescript": "^6.0.3",
107
107
  "vercel": "^54.4.0",
108
108
  "vitest": "^4.1.7",
109
- "@sentry/junior-memory": "0.239.0",
109
+ "@sentry/junior-github": "0.240.0",
110
110
  "@sentry/junior-testing": "0.0.0",
111
- "@sentry/junior-github": "0.239.0"
111
+ "@sentry/junior-memory": "0.240.0"
112
112
  },
113
113
  "scripts": {
114
114
  "build": "tsdown",