@sentry/junior 0.226.0 → 0.227.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 (57) hide show
  1. package/dist/{agent-hooks-FUetyyLe.js → agent-hooks-bEwEJhlg.js} +218 -11
  2. package/dist/{agent-runner-DEF7auSj.js → agent-runner-BGDSjciH.js} +114 -73
  3. package/dist/api/schema.d.ts +65 -6
  4. package/dist/api/schema.js +3 -3
  5. package/dist/api.js +52 -31
  6. package/dist/{app-TVL42pGL.d.ts → app-CjRIKZb5.d.ts} +1 -1
  7. package/dist/app.d.ts +1 -1
  8. package/dist/app.js +208 -136
  9. package/dist/{briefs-Cb4T2BUI.js → briefs-BkM_ZW4B.js} +4 -4
  10. package/dist/{catalog-runtime-BYGR3Dr4.js → catalog-runtime-Cw9V2jpn.js} +1 -1
  11. package/dist/{checkpoint-CJe-dZFF.js → checkpoint-oZYD3-Ar.js} +7 -7
  12. package/dist/cli/chat.js +13 -13
  13. package/dist/cli/check.js +3 -3
  14. package/dist/cli/main.js +1 -1
  15. package/dist/cli/plugins.js +3 -3
  16. package/dist/cli/snapshot-create.js +3 -3
  17. package/dist/cli/upgrade.js +3 -3
  18. package/dist/{client-C2WBBx7m.js → client-Pcxo3lGn.js} +2 -2
  19. package/dist/{config-Bws6Rpsh.js → config-CYvEow1F.js} +2 -2
  20. package/dist/{context-Bplcgypl.js → context-0Et9iVSB.js} +1 -1
  21. package/dist/{conversation-DPbmIwjy.js → conversation-BnhOMfEB.js} +49 -22
  22. package/dist/{conversation-privacy-pCcW0a5Y.js → conversation-privacy-hQmyZbOC.js} +1 -1
  23. package/dist/{credential-sync-ibuNsMyl.js → credential-sync-CUGbiiCM.js} +14 -14
  24. package/dist/{executor-D36FWjcf.js → executor-BXMlFrV6.js} +1 -1
  25. package/dist/{history-DI9KJT3J.d.ts → history-nukv1YN8.d.ts} +26 -1
  26. package/dist/images-8siTAUNW.js +82 -0
  27. package/dist/instrumentation.js +2 -2
  28. package/dist/{job-queue-2mFFDMHB.js → job-queue-AI0_QAgc.js} +1 -1
  29. package/dist/{logging-CvjMHRvg.js → logging-BPBx6WF-.js} +1 -1
  30. package/dist/nitro.d.ts +1 -1
  31. package/dist/nitro.js +3 -3
  32. package/dist/{oauth-authorization-l4O1rXsL.js → oauth-authorization-Cq1GaLIP.js} +1 -1
  33. package/dist/{oauth-callback-server-Ds8M5FFX.js → oauth-callback-server-CnF03VYh.js} +2 -2
  34. package/dist/{pending-auth-DLNJbD8H.js → pending-auth-CHUjr_6d.js} +1 -1
  35. package/dist/{profile-dvV7PB7u.js → profile-upzC-wN1.js} +4 -4
  36. package/dist/{prompt-DehgjkO5.js → prompt-CZIQcPHy.js} +1 -1
  37. package/dist/{registry-C6FHctIu.js → registry-DM5aMhjm.js} +2 -2
  38. package/dist/{resolve-DqwGI9wq.js → resolve-sF6Lg7Ay.js} +2 -2
  39. package/dist/{runner-CzYEcB73.js → runner-Bu2wYpK8.js} +10 -10
  40. package/dist/{sandbox-egress-signals-BZOv0fns.js → sandbox-egress-signals-Dgerhizb.js} +1 -1
  41. package/dist/{schema-BZg-xzfG.js → schema-BSiwcvjm.js} +1 -1
  42. package/dist/{skills-EhiVbjF4.js → skills-CAI5s___.js} +2 -2
  43. package/dist/{spawn-Ck3L0rEr.js → spawn-DRK9TBgY.js} +2 -2
  44. package/dist/{task-queue-TXhAWQwj.js → task-queue-iuDAqfZg.js} +3 -3
  45. package/dist/{task-runner-axUJS1No.js → task-runner-S3QtH38c.js} +10 -10
  46. package/dist/{thread-state-CTuWhjru.js → thread-state-C_arVuaN.js} +5 -5
  47. package/dist/{turn-failure-response-csVoLOzx.js → turn-failure-response-DarwGYgC.js} +9 -9
  48. package/dist/{turn-lifecycle-C1S6vELh.js → turn-lifecycle-CdiIejXH.js} +1 -1
  49. package/dist/{turn-session-routing-5RejBvit.js → turn-session-routing-DyLGd_wU.js} +1 -1
  50. package/dist/{validation-q2PFxkTQ.js → validation-BMig74Zp.js} +1 -1
  51. package/dist/{version-ByLtIYyy.js → version-lhQSfLjx.js} +1 -1
  52. package/dist/version.js +1 -1
  53. package/dist/{web-authorization-Biy8nsS7.js → web-authorization-r2lKYKJ2.js} +6 -6
  54. package/dist/{web-input-DM9LaEdn.js → web-input-BU-Fu7iq.js} +46 -36
  55. package/dist/{work-QrbHdXTc.js → work-B9koS8sW.js} +7 -7
  56. package/dist/{worker-r17aopXW.js → worker-C_iJSRgG.js} +5 -5
  57. package/package.json +5 -4
@@ -1,9 +1,9 @@
1
- import { I as isRecord, L as toOptionalNumber, R as toOptionalString } from "./logging-CvjMHRvg.js";
2
- import { pt as JUNIOR_THREAD_STATE_TTL_MS, qt as getDb } from "./agent-hooks-FUetyyLe.js";
1
+ import { I as isRecord, L as toOptionalNumber, R as toOptionalString } from "./logging-BPBx6WF-.js";
2
+ import { $t as getDb, ht as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-bEwEJhlg.js";
3
3
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
4
- import { u as juniorLocationConfigurations } from "./executor-D36FWjcf.js";
5
- import { Y as persistConversationMessages } from "./checkpoint-CJe-dZFF.js";
6
- import { w as getStateAdapter } from "./profile-dvV7PB7u.js";
4
+ import { u as juniorLocationConfigurations } from "./executor-BXMlFrV6.js";
5
+ import { Y as persistConversationMessages } from "./checkpoint-oZYD3-Ar.js";
6
+ import { w as getStateAdapter } from "./profile-upzC-wN1.js";
7
7
  import { z } from "zod";
8
8
  import { randomUUID } from "node:crypto";
9
9
  import { and, eq, sql } from "drizzle-orm";
@@ -1,12 +1,12 @@
1
- import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-C2WBBx7m.js";
2
- import { I as isRecord, t as buildTurnFailureResponse } from "./logging-CvjMHRvg.js";
3
- import { _ as parseSlackMessageTs } from "./context-Bplcgypl.js";
4
- import { Wt as getConversationEventStore } from "./agent-hooks-FUetyyLe.js";
5
- import { A as messageCardKey, N as readMessageCards, j as messageCardRefSchema } from "./conversation-DPbmIwjy.js";
6
- import { J as hydrateConversationMessages, ct as markConversationMessage } from "./checkpoint-CJe-dZFF.js";
7
- import { r as clearPendingAuth, s as buildDeterministicTurnId } from "./pending-auth-DLNJbD8H.js";
8
- import { g as markTurnCompleted, h as markTurnClosed } from "./oauth-authorization-l4O1rXsL.js";
9
- import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-CTuWhjru.js";
1
+ import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-Pcxo3lGn.js";
2
+ import { I as isRecord, t as buildTurnFailureResponse } from "./logging-BPBx6WF-.js";
3
+ import { b as parseSlackMessageTs } from "./context-0Et9iVSB.js";
4
+ import { Xt as getConversationEventStore } from "./agent-hooks-bEwEJhlg.js";
5
+ import { A as messageCardKey, N as readMessageCards, j as messageCardRefSchema } from "./conversation-BnhOMfEB.js";
6
+ import { J as hydrateConversationMessages, ct as markConversationMessage } from "./checkpoint-oZYD3-Ar.js";
7
+ import { r as clearPendingAuth, s as buildDeterministicTurnId } from "./pending-auth-CHUjr_6d.js";
8
+ import { g as markTurnCompleted, h as markTurnClosed } from "./oauth-authorization-Cq1GaLIP.js";
9
+ import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-C_arVuaN.js";
10
10
  //#region src/chat/conversations/pending-cards.ts
11
11
  /** Read undelivered card snapshots across resume and history replacement. */
12
12
  async function loadPendingMessageCards(conversationId) {
@@ -1,4 +1,4 @@
1
- import { Wt as getConversationEventStore } from "./agent-hooks-FUetyyLe.js";
1
+ import { Xt as getConversationEventStore } from "./agent-hooks-bEwEJhlg.js";
2
2
  //#region src/chat/conversations/turn-lifecycle.ts
3
3
  /** Persist correlated turn lifecycle facts with retry-safe terminal exclusion. */
4
4
  var ConversationTurnLifecycleService = class {
@@ -34,7 +34,7 @@ function slackSourceForDestination(args) {
34
34
  * Reads parent Conversations when this Conversation has no Destination.
35
35
  */
36
36
  async function resolveConversationRouting(args) {
37
- const conversationStore = args.conversationStore ?? (await import("./agent-hooks-FUetyyLe.js").then((n) => n.Ut)).getConversationStore();
37
+ const conversationStore = args.conversationStore ?? (await import("./agent-hooks-bEwEJhlg.js").then((n) => n.Yt)).getConversationStore();
38
38
  const chain = await loadConversationChain(args.conversationId, conversationStore);
39
39
  let destination;
40
40
  let source;
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BYGR3Dr4.js";
2
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Cw9V2jpn.js";
3
3
  import { isDeepStrictEqual } from "node:util";
4
4
  //#region src/chat/plugins/validation.ts
5
5
  var validation_exports = /* @__PURE__ */ __exportAll({
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.226.0";
2
+ var version = "0.227.0";
3
3
  //#endregion
4
4
  //#region src/version.ts
5
5
  /** Installed Junior package version, or `unknown` when package metadata is unavailable. */
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as JUNIOR_VERSION } from "./version-ByLtIYyy.js";
1
+ import { t as JUNIOR_VERSION } from "./version-lhQSfLjx.js";
2
2
  export { JUNIOR_VERSION };
@@ -1,9 +1,9 @@
1
- import { Pt as ensureConversationWake, Wt as requestConversationWork } from "./agent-runner-DEF7auSj.js";
2
- import { Wt as getConversationEventStore } from "./agent-hooks-FUetyyLe.js";
3
- import { n as loadTurnCheckpoint, o as failTurnRecord, s as getTurnRecord } from "./checkpoint-CJe-dZFF.js";
4
- import { w as getStateAdapter } from "./profile-dvV7PB7u.js";
5
- import { a as getVercelConversationWorkQueue } from "./job-queue-2mFFDMHB.js";
6
- import { n as resolveTurnSessionRouting } from "./turn-session-routing-5RejBvit.js";
1
+ import { Ht as requestConversationWork, Mt as ensureConversationWake } from "./agent-runner-BGDSjciH.js";
2
+ import { Xt as getConversationEventStore } from "./agent-hooks-bEwEJhlg.js";
3
+ import { n as loadTurnCheckpoint, o as failTurnRecord, s as getTurnRecord } from "./checkpoint-oZYD3-Ar.js";
4
+ import { w as getStateAdapter } from "./profile-upzC-wN1.js";
5
+ import { a as getVercelConversationWorkQueue } from "./job-queue-AI0_QAgc.js";
6
+ import { n as resolveTurnSessionRouting } from "./turn-session-routing-DyLGd_wU.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,28 +1,29 @@
1
- import { $ as eventAutomationTriggerAvailable, Ct as appendAndEnqueueInboundMessage, D as recordSlackAttachment, Dn as isVisionImageMediaType, E as readAttachmentVisionSummary, En as buildSteeringPiMessage, F as readSlackRawMessageContext, H as isListedScheduledAutomation, I as resolveSlackChannelIdFromMessage, It as getConversationWorkState, J as saveScheduledAutomation, K as parseScheduledAutomationRow, L as resolveSlackChannelIdFromThreadId, Mn as shouldEmitDevAgentTrace, N as storeAttachment, O as renderAttachmentText, On as RetryableDeliveryError, P as parseSlackThreadId, R as listThreadReplies, Sn as removeReactionFromMessage, St as appendAndEnqueueExclusiveInboundMessage, Tn as createUserTokenStore, U as listPublicScheduledAutomationsForTeams, _n as normalizeSlackReplyMarkdown, _t as EVENT_WAIT_MS, a as isExperimentalFeatureEnabled, at as getEventAutomation, bn as addReactionToMessage, c as createContextCompactor, ct as listPublicEventAutomationsForTeams, en as maybePostAutomatedTurnLimitNotice, et as effectiveTaskOutcomes, gn as formatSlackLink, hn as escapeSlackMrkdwnText, jn as AuthorizationFlowDisabledError, k as renderBlockText, nt as deleteEventAutomation, ot as listDeletedEventAutomationsCreatedBy, q as readScheduledAutomation, rt as eventAutomationBelongsToUser, s as executeAgentRun, st as listEventAutomationsCreatedBy, t as createAgentRunner, tn as recordFinishedTurnForAutomatedLimit, v as PluginCredentialFailureError, vn as normalizeSlackStatusText, vt as isEventMailboxMetadata, xn as postSlackMessage, y as latestProgressStatus, yn as truncateStatusText, yt as getEventCatalog } from "./agent-runner-DEF7auSj.js";
2
- import { b as isProviderRetryError, i as completeText, m as escapeXml, r as completeObject } from "./client-C2WBBx7m.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-CvjMHRvg.js";
4
- import { a as getChatConfig, c as getSlackClientId, d as getSlackSigningSecret, h as normalizeSlackEmojiName, l as getSlackClientSecret, n as botConfig, s as getSlackBotToken } from "./config-Bws6Rpsh.js";
1
+ import { $t as recordFinishedTurnForAutomatedLimit, B as isListedScheduledAutomation, Cn as createUserTokenStore, D as renderBlockText, E as renderAttachmentText, F as resolveSlackChannelIdFromThreadId, G as readScheduledAutomation, I as listThreadReplies, K as saveScheduledAutomation, M as parseSlackThreadId, N as readSlackRawMessageContext, On as AuthorizationFlowDisabledError, P as resolveSlackChannelIdFromMessage, Pt as getConversationWorkState, Q as effectiveTaskOutcomes, Qt as maybePostAutomatedTurnLimitNotice, Tn as RetryableDeliveryError, V as listPublicScheduledAutomationsForTeams, W as parseScheduledAutomationRow, Z as eventAutomationTriggerAvailable, _n as truncateStatusText, _t as getEventCatalog, a as isExperimentalFeatureEnabled, at as listEventAutomationsCreatedBy, bn as removeReactionFromMessage, bt as appendAndEnqueueExclusiveInboundMessage, c as createContextCompactor, et as deleteEventAutomation, gn as normalizeSlackStatusText, gt as isEventMailboxMetadata, hn as normalizeSlackReplyMarkdown, ht as EVENT_WAIT_MS, it as listDeletedEventAutomationsCreatedBy, j as storeAttachment, kn as shouldEmitDevAgentTrace, mn as formatSlackLink, ot as listPublicEventAutomationsForTeams, pn as escapeSlackMrkdwnText, rt as getEventAutomation, s as executeAgentRun, t as createAgentRunner, tt as eventAutomationBelongsToUser, v as PluginCredentialFailureError, vn as addReactionToMessage, wn as buildSteeringPiMessage, xt as appendAndEnqueueInboundMessage, y as latestProgressStatus, yn as postSlackMessage } from "./agent-runner-BGDSjciH.js";
2
+ import { b as isProviderRetryError, i as completeText, m as escapeXml, r as completeObject } from "./client-Pcxo3lGn.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-BPBx6WF-.js";
4
+ import { a as getChatConfig, c as getSlackClientId, d as getSlackSigningSecret, h as normalizeSlackEmojiName, l as getSlackClientSecret, n as botConfig, s as getSlackBotToken } from "./config-CYvEow1F.js";
5
5
  import { o as modelIdForProfile, r as defaultModelId } from "./model-profile-BwU8mqwD.js";
6
- import { _ as parseSlackMessageTs, a as createActor, c as isActorUserId, l as isUserActor, o as createSlackActor, p as parseSlackChannelId, s as createSlackResumeActor, t as credentialContextForActor, u as parseActorUserId } from "./context-Bplcgypl.js";
7
- import { B as downloadPrivateSlackFile, G as isDmChannel, H as getHeaderString, Jt as getSqlExecutor, K as normalizeSlackConversationId, Kt as getConversationStore, Nt as buildSentryConversationUrl, U as getSlackClient, Wt as getConversationEventStore, fn as requireSlackDestination, mt as getDashboardConversationLink, o as getPluginSlackConversationLink, ot as cancelSubscriptions, pt as JUNIOR_THREAD_STATE_TTL_MS, q as runWithSlackInstallationToken, qt as getDb, un as createSlackDestination, z as SlackActionError } from "./agent-hooks-FUetyyLe.js";
6
+ import { a as createActor, b as parseSlackMessageTs, c as isActorUserId, l as isUserActor, o as createSlackActor, p as parseSlackChannelId, s as createSlackResumeActor, t as credentialContextForActor, u as parseActorUserId } from "./context-0Et9iVSB.js";
7
+ import { $t as getDb, B as downloadPrivateSlackFile, Ft as buildSentryConversationUrl, G as isDmChannel, H as getHeaderString, It as getSlackFileId, K as normalizeSlackConversationId, Qt as getConversationStore, Rt as readAttachmentVisionSummary, U as getSlackClient, Xt as getConversationEventStore, en as getSqlExecutor, gn as createSlackDestination, gt as getDashboardConversationLink, ht as JUNIOR_THREAD_STATE_TTL_MS, o as getPluginSlackConversationLink, ot as cancelSubscriptions, q as runWithSlackInstallationToken, vn as requireSlackDestination, z as SlackActionError, zt as recordSlackAttachment } from "./agent-hooks-bEwEJhlg.js";
8
8
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
9
- import { D as juniorIdentities, O as juniorUsers, o as juniorSchedulerTasks } from "./executor-D36FWjcf.js";
10
- import { X as instructionProvenanceFor } from "./conversation-DPbmIwjy.js";
11
- import { $ as fallbackShortTitle, A as commitAcceptedReply, B as recordAuthorizationCompleted, J as hydrateConversationMessages, N as loadConversationProjection, O as trimTrailingAssistantMessages, P as loadProjection, Q as resolveConversationTitle, W as recordSubscribedReplyRoute, Y as persistConversationMessages, Z as persistConversationMessageSummaries, a as completeTurnRecord, at as estimateConversationContextTokens, c as listTurnSummaries, ct as markConversationMessage, dt as turnHasReply, ft as upsertConversationMessage, i as abandonTurnRecord, it as createConversationMemoryService, j as commitMessages, l as recordTurnSummary, lt as normalizeConversationText, n as loadTurnCheckpoint, nt as appendThreadContextMessages, o as failTurnRecord, ot as getConversationMessageSlackTs, p as buildTurnErrorResponse, pt as estimateTextTokens, r as saveTurnCheckpoint, rt as buildConversationContext, s as getTurnRecord, st as isHumanConversationMessage, u as persistWithRetry, ut as recordDeliveredAssistantMessage } from "./checkpoint-CJe-dZFF.js";
12
- import { E as acquireActiveLock, O as withLock, T as MUTATION_LOCK_TTL_MS, w as getStateAdapter } from "./profile-dvV7PB7u.js";
13
- import { a as isPendingAuthLatestRequest, o as buildDeterministicAssistantMessageId, r as clearPendingAuth, s as buildDeterministicTurnId } from "./pending-auth-DLNJbD8H.js";
14
- 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-l4O1rXsL.js";
15
- import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-DehgjkO5.js";
16
- import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-2mFFDMHB.js";
9
+ import { D as juniorIdentities, O as juniorUsers, o as juniorSchedulerTasks } from "./executor-BXMlFrV6.js";
10
+ import { I as readMessageAttachments, R as isVisionImageMediaType, tt as instructionProvenanceFor } from "./conversation-BnhOMfEB.js";
11
+ import { $ as fallbackShortTitle, A as commitAcceptedReply, B as recordAuthorizationCompleted, J as hydrateConversationMessages, N as loadConversationProjection, O as trimTrailingAssistantMessages, P as loadProjection, Q as resolveConversationTitle, W as recordSubscribedReplyRoute, Y as persistConversationMessages, Z as persistConversationMessageSummaries, a as completeTurnRecord, at as estimateConversationContextTokens, c as listTurnSummaries, ct as markConversationMessage, dt as turnHasReply, ft as upsertConversationMessage, i as abandonTurnRecord, it as createConversationMemoryService, j as commitMessages, l as recordTurnSummary, lt as normalizeConversationText, n as loadTurnCheckpoint, nt as appendThreadContextMessages, o as failTurnRecord, ot as getConversationMessageSlackTs, p as buildTurnErrorResponse, pt as estimateTextTokens, r as saveTurnCheckpoint, rt as buildConversationContext, s as getTurnRecord, st as isHumanConversationMessage, u as persistWithRetry, ut as recordDeliveredAssistantMessage } from "./checkpoint-oZYD3-Ar.js";
12
+ import { E as acquireActiveLock, O as withLock, T as MUTATION_LOCK_TTL_MS, w as getStateAdapter } from "./profile-upzC-wN1.js";
13
+ import { a as isPendingAuthLatestRequest, o as buildDeterministicAssistantMessageId, r as clearPendingAuth, s as buildDeterministicTurnId } from "./pending-auth-CHUjr_6d.js";
14
+ 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-Cq1GaLIP.js";
15
+ import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-CZIQcPHy.js";
16
+ import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-AI0_QAgc.js";
17
17
  import { c as sumUtcHoursIntoSixHours, m as healthReportSchema, t as webMessageId } from "./web-message-id-xPI_EFSC.js";
18
- 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-axUJS1No.js";
19
- import { i as resolveAgentInvocationId, o as AgentRunError, s as executeTurn, t as createAgentInvocationWorker } from "./work-QrbHdXTc.js";
20
- import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-C1S6vELh.js";
21
- 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-CTuWhjru.js";
22
- import { a as getPausedTurnRequest, c as getTurnAuthorization, i as createPausedTurns, n as deleteWebAuthorization, s as wakePausedTurn, t as createWebAuthorization } from "./web-authorization-Biy8nsS7.js";
23
- import { n as resolveTurnSessionRouting } from "./turn-session-routing-5RejBvit.js";
24
- import { t as bindSpawnAgent } from "./spawn-Ck3L0rEr.js";
25
- 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-csVoLOzx.js";
18
+ 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-S3QtH38c.js";
19
+ import { i as resolveAgentInvocationId, o as AgentRunError, s as executeTurn, t as createAgentInvocationWorker } from "./work-B9koS8sW.js";
20
+ import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-CdiIejXH.js";
21
+ 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-C_arVuaN.js";
22
+ import { a as getPausedTurnRequest, c as getTurnAuthorization, i as createPausedTurns, n as deleteWebAuthorization, s as wakePausedTurn, t as createWebAuthorization } from "./web-authorization-r2lKYKJ2.js";
23
+ import { n as resolveTurnSessionRouting } from "./turn-session-routing-DyLGd_wU.js";
24
+ import { t as bindSpawnAgent } from "./spawn-DRK9TBgY.js";
25
+ 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-DarwGYgC.js";
26
+ import { r as storeInputImages } from "./images-8siTAUNW.js";
26
27
  import { z } from "zod";
27
28
  import { createHash } from "node:crypto";
28
29
  import { and, desc, eq, inArray, lt, notInArray, or, sql } from "drizzle-orm";
@@ -414,12 +415,6 @@ function renderSlackObjectCard(card, conversationId) {
414
415
  ...field,
415
416
  type: "string"
416
417
  }));
417
- if (card.sourceUpdatedAt) customFields.push({
418
- key: "sourceUpdatedAt",
419
- label: "Source updated",
420
- type: "string",
421
- value: card.sourceUpdatedAt
422
- });
423
418
  return {
424
419
  text,
425
420
  entity: {
@@ -2830,11 +2825,6 @@ function buildStoredAttachmentPromptText(args) {
2830
2825
  "</attachment>"
2831
2826
  ].join("\n");
2832
2827
  }
2833
- function getSlackFileId(attachment) {
2834
- const metadataId = attachment.fetchMetadata?.fileId;
2835
- if (metadataId) return metadataId;
2836
- return (attachment.url ?? attachment.fetchMetadata?.url ?? "").match(/(?:^|[-/])(F[A-Z0-9]+)(?:[-/]|$)/i)?.[1];
2837
- }
2838
2828
  function getCachedImageSummaries(args) {
2839
2829
  if (!args.conversation || !args.messageTs) return [];
2840
2830
  const conversationMessage = args.conversation.messages.find((message) => getConversationMessageSlackTs(message) === args.messageTs);
@@ -3186,6 +3176,10 @@ function toConversationMessage(args) {
3186
3176
  },
3187
3177
  meta: {
3188
3178
  attachmentCount: args.entry.attachments.length,
3179
+ slackFileIds: args.entry.attachments.flatMap((attachment) => {
3180
+ const id = getSlackFileId(attachment);
3181
+ return id ? [id] : [];
3182
+ }),
3189
3183
  explicitMention: args.explicitMention,
3190
3184
  imageAttachmentCount: imageAttachmentCount > 0 ? imageAttachmentCount : void 0,
3191
3185
  imagesHydrated: !messageHasPotentialImageAttachment,
@@ -7075,6 +7069,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage) {
7075
7069
  const isResume = resolved.kind === "resume";
7076
7070
  let turnInputFacts;
7077
7071
  let text = "";
7072
+ let attachments = [];
7078
7073
  let turnId = "";
7079
7074
  let userMessageId = "";
7080
7075
  let startedAtMs = Date.now();
@@ -7089,6 +7084,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage) {
7089
7084
  if (resolved.kind === "mailbox") {
7090
7085
  const first = resolved.batch[0];
7091
7086
  text = joinMailboxText(resolved.batch.map((entry) => entry.message));
7087
+ attachments = resolved.batch.flatMap((entry) => readMessageAttachments(entry.message.input.attachments));
7092
7088
  startedAtMs = first.message.createdAtMs;
7093
7089
  userMessageId = first.message.inboundMessageId;
7094
7090
  turnId = buildDeterministicTurnId(userMessageId);
@@ -7117,6 +7113,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage) {
7117
7113
  });
7118
7114
  userMessageId = userMessage.id;
7119
7115
  text = userMessage.text;
7116
+ attachments = userMessage.meta?.attachments ?? [];
7120
7117
  startedAtMs = userMessage.createdAtMs;
7121
7118
  inputMessageIds = [userMessageId];
7122
7119
  }
@@ -7178,6 +7175,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage) {
7178
7175
  createdAtMs: startedAtMs,
7179
7176
  author,
7180
7177
  meta: {
7178
+ ...attachments.length ? { attachments } : void 0,
7181
7179
  explicitMention: true,
7182
7180
  replied: false,
7183
7181
  ...source.kind === "web" ? { source: "web" } : void 0,
@@ -7275,6 +7273,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage) {
7275
7273
  runId: currentRunId,
7276
7274
  instruction: {
7277
7275
  text,
7276
+ storedAttachments: attachments,
7278
7277
  context: buildConversationContext(conversation, { excludeMessageId: userMessageId })
7279
7278
  },
7280
7279
  history: piMessages,
@@ -7621,7 +7620,6 @@ function createProductionConversationWorkOptions(options) {
7621
7620
  }
7622
7621
  //#endregion
7623
7622
  //#region src/chat/conversations/web-input.ts
7624
- /** Store web input in a Conversation mailbox. */
7625
7623
  function normalizeEmail(email) {
7626
7624
  return email.trim().toLowerCase();
7627
7625
  }
@@ -7667,7 +7665,7 @@ function webActorFromEmail(email, profile) {
7667
7665
  /** Build one web mailbox entry. */
7668
7666
  function buildWebInboundMessage(args) {
7669
7667
  const text = args.message.trim();
7670
- if (!text) throw new Error("Web Message must not be empty");
7668
+ if (!text && !args.attachments?.length) throw new Error("Web Message must not be empty");
7671
7669
  if (!args.actor.email) throw new Error("Web Actor requires a verified email");
7672
7670
  const destination = resolveConversationDestination({
7673
7671
  conversationId: args.conversationId,
@@ -7683,6 +7681,7 @@ function buildWebInboundMessage(args) {
7683
7681
  input: {
7684
7682
  authorId: args.actor.userId,
7685
7683
  text,
7684
+ ...args.attachments?.length ? { attachments: args.attachments } : void 0,
7686
7685
  metadata: {
7687
7686
  authorEmail: normalizeEmail(args.actor.email),
7688
7687
  ...args.actor.fullName && { authorFullName: args.actor.fullName },
@@ -7730,12 +7729,13 @@ async function createAndEnqueueConversation(input, options) {
7730
7729
  conversationId,
7731
7730
  idempotencyKey: input.idempotencyKey,
7732
7731
  message: input.message,
7732
+ images: input.images,
7733
7733
  rootVisibility: input.visibility === "private" ? "private" : "public"
7734
7734
  }, options);
7735
7735
  }
7736
7736
  async function appendAndEnqueueWebMessage(input, options) {
7737
7737
  const text = input.message.trim();
7738
- if (!text) throw new Error("Web Message must not be empty");
7738
+ if (!text && !input.images?.length) throw new Error("Web Message must not be empty");
7739
7739
  if (!input.actor.email) throw new Error("Web Actor requires a verified email");
7740
7740
  const nowMs = options.nowMs ?? Date.now();
7741
7741
  const messageId = await webMessageId({
@@ -7749,12 +7749,22 @@ async function appendAndEnqueueWebMessage(input, options) {
7749
7749
  nowMs,
7750
7750
  ...input.rootVisibility && { rootVisibility: input.rootVisibility }
7751
7751
  });
7752
+ let attachments = [];
7753
+ if (input.images?.length) {
7754
+ if (!options.attachmentStorage) throw new Error("Attachment storage is unavailable.");
7755
+ attachments = await storeInputImages({
7756
+ conversationId: input.conversationId,
7757
+ files: input.images,
7758
+ storage: options.attachmentStorage
7759
+ });
7760
+ }
7752
7761
  const result = await (options.exclusive ? appendAndEnqueueExclusiveInboundMessage : appendAndEnqueueInboundMessage)({
7753
7762
  message: buildWebInboundMessage({
7754
7763
  actor: input.actor,
7755
7764
  conversationId: input.conversationId,
7756
7765
  destination,
7757
7766
  message: text,
7767
+ attachments,
7758
7768
  messageId,
7759
7769
  nowMs
7760
7770
  }),
@@ -1,11 +1,11 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { Ct as appendAndEnqueueInboundMessage, dt as createAgentInvocationSchema, ft as AgentInvocationBusyError, jn as AuthorizationFlowDisabledError, lt as agentBindingSchema, n as runAgentWithTimeout, pt as AgentInvocationLimitError, ut as agentInvocationSchema, v as PluginCredentialFailureError } from "./agent-runner-DEF7auSj.js";
3
- import { Jt as getSqlExecutor, Kt as getConversationStore, Wt as getConversationEventStore } from "./agent-hooks-FUetyyLe.js";
4
- import { f as juniorAgentBindings, p as juniorAgentInvocations } from "./executor-D36FWjcf.js";
5
- import { I as openConversationProjection, _ as getTerminalAssistantMessages, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord } from "./checkpoint-CJe-dZFF.js";
6
- import { d as getConversationTurnBoundaryError, l as TurnInputCommitLostError, p as isTurnInputCommitLostError, r as getAssistantReplyText } from "./oauth-authorization-l4O1rXsL.js";
7
- import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-C1S6vELh.js";
8
- import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-CTuWhjru.js";
2
+ import { On as AuthorizationFlowDisabledError, ct as agentInvocationSchema, dt as AgentInvocationLimitError, lt as createAgentInvocationSchema, n as runAgentWithTimeout, st as agentBindingSchema, ut as AgentInvocationBusyError, v as PluginCredentialFailureError, xt as appendAndEnqueueInboundMessage } from "./agent-runner-BGDSjciH.js";
3
+ import { Qt as getConversationStore, Xt as getConversationEventStore, en as getSqlExecutor } from "./agent-hooks-bEwEJhlg.js";
4
+ import { f as juniorAgentBindings, p as juniorAgentInvocations } from "./executor-BXMlFrV6.js";
5
+ import { I as openConversationProjection, _ as getTerminalAssistantMessages, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord } from "./checkpoint-oZYD3-Ar.js";
6
+ import { d as getConversationTurnBoundaryError, l as TurnInputCommitLostError, p as isTurnInputCommitLostError, r as getAssistantReplyText } from "./oauth-authorization-Cq1GaLIP.js";
7
+ import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-CdiIejXH.js";
8
+ import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-C_arVuaN.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 completeConversationWork, Bt as recordConversationRetry, Dt as clearConsumedConversationWake, Et as checkInConversationWork, Gt as startConversationWork, It as getConversationWorkState, Mt as deadLetterAttempt, Nt as drainConversationMailbox, Pt as ensureConversationWake, Qt as isInvalidConversationRecordError, Ut as requestAnotherSlice, Vt as releaseConversationWork, Yt as hasConversationStop, Zt as isFinalAttempt, jt as countPendingConversationMessages, kt as completeConversationStop, wt as beginConversationResume, xt as ackMessages, zt as recordAttemptFailure } from "./agent-runner-DEF7auSj.js";
3
- import { b as isProviderRetryError } from "./client-C2WBBx7m.js";
4
- import { C as withLogContext, d as logException, f as logInfo, p as logWarn } from "./logging-CvjMHRvg.js";
5
- import { a as getChatConfig } from "./config-Bws6Rpsh.js";
6
- import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-2mFFDMHB.js";
2
+ import { At as deadLetterAttempt, Dt as completeConversationStop, Lt as recordAttemptFailure, Mt as ensureConversationWake, Ot as completeConversationWork, Pt as getConversationWorkState, Rt as recordConversationRetry, St as beginConversationResume, Tt as clearConsumedConversationWake, Ut as startConversationWork, Vt as requestAnotherSlice, Xt as isInvalidConversationRecordError, Yt as isFinalAttempt, jt as drainConversationMailbox, kt as countPendingConversationMessages, qt as hasConversationStop, wt as checkInConversationWork, yt as ackMessages, zt as releaseConversationWork } from "./agent-runner-BGDSjciH.js";
3
+ import { b as isProviderRetryError } from "./client-Pcxo3lGn.js";
4
+ import { C as withLogContext, d as logException, f as logInfo, p as logWarn } from "./logging-BPBx6WF-.js";
5
+ import { a as getChatConfig } from "./config-CYvEow1F.js";
6
+ import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-AI0_QAgc.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.226.0",
3
+ "version": "0.227.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -67,6 +67,7 @@
67
67
  "@opentelemetry/core": "2.9.0",
68
68
  "@sentry/node": "10.65.0",
69
69
  "@sinclair/typebox": "^0.34.49",
70
+ "@slack/types": "^2.21.1",
70
71
  "@slack/web-api": "^7.16.0",
71
72
  "@vercel/blob": "^2.6.1",
72
73
  "@vercel/functions": "^3.6.0",
@@ -85,7 +86,7 @@
85
86
  "pg": "^8.16.3",
86
87
  "yaml": "^2.9.0",
87
88
  "zod": "^4.5.4",
88
- "@sentry/junior-plugin-api": "0.226.0"
89
+ "@sentry/junior-plugin-api": "0.227.0"
89
90
  },
90
91
  "devDependencies": {
91
92
  "@emnapi/core": "^1.10.0",
@@ -104,9 +105,9 @@
104
105
  "typescript": "^6.0.3",
105
106
  "vercel": "^54.4.0",
106
107
  "vitest": "^4.1.7",
107
- "@sentry/junior-github": "0.226.0",
108
+ "@sentry/junior-github": "0.227.0",
108
109
  "@sentry/junior-testing": "0.0.0",
109
- "@sentry/junior-memory": "0.226.0"
110
+ "@sentry/junior-memory": "0.227.0"
110
111
  },
111
112
  "scripts": {
112
113
  "build": "tsdown",