@sentry/junior 0.303.0 → 0.305.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 (82) hide show
  1. package/dist/{adapter-context-BdVnSuY5.js → adapter-context-BpvbUki8.js} +2 -2
  2. package/dist/{admin-AfeAdS3J.js → admin-CoDt35ny.js} +5 -5
  3. package/dist/{agent-runner-BP8_DLUv.js → agent-runner-C5d6rY5g.js} +600 -389
  4. package/dist/api/schema.d.ts +1 -1
  5. package/dist/api/schema.js +5 -5
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +59 -61
  8. package/dist/{app-Dd9v1mNx.d.ts → app-Cs157Zc5.d.ts} +5 -3
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +86 -82
  11. package/dist/{automation-D9MvhOWY.js → automation-CuA3yEcD.js} +1 -1
  12. package/dist/{background-compaction-queue-xaE05jxH.js → background-compaction-queue-BTqMIfTA.js} +7 -3
  13. package/dist/{briefs-D8i-dKTp.js → briefs-BRdznF7c.js} +11 -8
  14. package/dist/{catalog-runtime-d1EM6Z0V.js → catalog-runtime-J52Tej47.js} +1 -1
  15. package/dist/cli/chat.js +15 -15
  16. package/dist/cli/check.js +5 -5
  17. package/dist/cli/init.js +1 -1
  18. package/dist/cli/main.js +3 -3
  19. package/dist/cli/plugins.js +4 -4
  20. package/dist/cli/snapshot-create.js +5 -5
  21. package/dist/cli/upgrade.d.ts +1 -1
  22. package/dist/cli/upgrade.js +4 -4
  23. package/dist/{config-oGM7KA9M.js → config-CBZp0udd.js} +101 -7
  24. package/dist/{connections-BlikzEJv.js → connections-BYmuJ6Vm.js} +6 -6
  25. package/dist/{continue-in-slack-BZnYifiG.js → continue-in-slack-Cvot6S38.js} +8 -8
  26. package/dist/{conversation-CY1jnBiC.js → conversation-BOqdRtUx.js} +4 -12
  27. package/dist/{conversation-feed-BZJRk6UV.js → conversation-feed-CgpgP7yi.js} +35 -2
  28. package/dist/{conversation-privacy-Cx515ddM.js → conversation-privacy-D2pOzBNl.js} +10 -2
  29. package/dist/{conversation-turn-DAhRdX4m.js → conversation-turn-CI8WDpnK.js} +17 -17
  30. package/dist/{credential-sync-DfhmWFeo.js → credential-sync-COqnZ1Dx.js} +14 -14
  31. package/dist/{db-C-2tFxk3.js → db-DU84dCVu.js} +169 -6
  32. package/dist/{db-DPqcEM9_.d.ts → db-zbN5ZV_o.d.ts} +2 -2
  33. package/dist/{executor-NVfS8aQ2.js → executor-CFyrgOu1.js} +43 -9
  34. package/dist/{history-UZ3M2M9r.js → history-m2-ceTTX.js} +8 -2
  35. package/dist/{install-CHLrpRZc.js → install-CQ76CfRw.js} +2 -2
  36. package/dist/instrumentation.js +7 -3
  37. package/dist/{lineage-HGLhd_-N.js → lineage-DLd2UxVP.js} +2 -2
  38. package/dist/{logging-DiyqRLBx.js → logging-BPNTQVFu.js} +1 -1
  39. package/dist/{message-CkCOcbFH.js → message-BWJLeQ5e.js} +8 -8
  40. package/dist/{model-input-DmoPPtPE.js → model-input-DoM9Ht-d.js} +2 -2
  41. package/dist/nitro.d.ts +1 -1
  42. package/dist/nitro.js +5 -5
  43. package/dist/{oauth-callback-server-CIf_6YmA.js → oauth-callback-server-DeHbnAQl.js} +2 -2
  44. package/dist/{projection-DBq8tsA5.js → projection-CcFBVFUo.js} +552 -63
  45. package/dist/{prompt-D2KlJopL.js → prompt-C5LREK2p.js} +185 -12
  46. package/dist/{queue-DFaOscp5.js → queue-B2AAL3ym.js} +4 -4
  47. package/dist/{registry-Bu0Z9BEO.js → registry-BjZZqKqi.js} +1 -1
  48. package/dist/{resolve-DXuA3G0g.js → resolve-CeJgXuH1.js} +3 -3
  49. package/dist/{result-DpiNseDA.js → result-icDrueyB.js} +8 -8
  50. package/dist/{runner-iu1heRFv.js → runner-nVfMkMMB.js} +9 -9
  51. package/dist/{sandbox-egress-signals-2HFYDcQf.js → sandbox-egress-signals-H9vQ5qRf.js} +1 -1
  52. package/dist/{schema-DvfX3Gq_.js → schema-Bx0Mlo32.js} +3 -3
  53. package/dist/{schema-DHMOaRzC.d.ts → schema-CKcu-IK6.d.ts} +43 -11
  54. package/dist/{service-account-BcT5LR7V.js → service-account-DU5865XA.js} +6 -5
  55. package/dist/{service-account-xYkaQTrw.js → service-account-Dw06p3zm.js} +5 -5
  56. package/dist/{session-stop-BLLp1IP_.js → session-stop-uotLtp4g.js} +181 -59
  57. package/dist/{skills-CNAGH4ju.js → skills-Bex1EaO5.js} +2 -2
  58. package/dist/{slack-conversation-unfurl-DYnqe5ci.js → slack-conversation-unfurl-EPG3riWF.js} +12 -11
  59. package/dist/{spawn-cGasWW33.js → spawn-CoD3vDuS.js} +6 -6
  60. package/dist/{state-CDS6h_Wv.js → state-nCR4Muhn.js} +4 -4
  61. package/dist/{stop-DMMA67yT.js → stop-BFVd0P0m.js} +170 -65
  62. package/dist/{store-Dgs7Oe44.js → store-Ca6G962n.js} +5 -5
  63. package/dist/{task-queue-DcF0nhhz.js → task-queue-BLPZU6kC.js} +3 -3
  64. package/dist/{task-runner-BGXF7Fo7.js → task-runner-xsOPIxCZ.js} +7 -7
  65. package/dist/{thread-context-BPky1KBe.js → thread-context-BOvZhsKK.js} +8 -8
  66. package/dist/{turn-session-routing-DGvn9MSl.js → turn-session-routing-2bW2qfeb.js} +8 -8
  67. package/dist/{turn-user-message-19CkuUvM.js → turn-user-message-BrhuyYrH.js} +3 -3
  68. package/dist/{validation-lu1DgjNQ.js → validation-BnY9K5WB.js} +1 -1
  69. package/dist/{version-Uo3c94Dx.js → version-qROlRQGF.js} +1 -1
  70. package/dist/version.js +1 -1
  71. package/dist/{viewer-BPQHMx3-.js → viewer-CxUiOraX.js} +3 -3
  72. package/dist/{warmup-H8uLvW9e.js → warmup--Gkz7iB-.js} +79 -476
  73. package/dist/{worker-B-pM_-3K.js → worker-DJ8d9fmD.js} +7 -7
  74. package/migrations/0111_attachment_kinds.sql +14 -0
  75. package/migrations/0112_attachment_url_fill.sql +51 -0
  76. package/migrations/0113_attachment_url_index.sql +1 -0
  77. package/migrations/meta/0099_snapshot.json +102 -326
  78. package/migrations/meta/0111_snapshot.json +5011 -0
  79. package/migrations/meta/0112_snapshot.json +5011 -0
  80. package/migrations/meta/0113_snapshot.json +5033 -0
  81. package/migrations/meta/_journal.json +21 -0
  82. package/package.json +7 -7
@@ -1,32 +1,30 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { $ as loadTurnCheckpoint, $a as SANDBOX_RUNTIME, $i as loadSnapshotsForProfile, $o as isConversationScopedChannel, Ba as WorkspaceSnapshotNotReadyError, Bo as loadForkHistory, Cn as getTerminalAssistantMessages, Co as readConversationAccessFromSql, Cs as createPluginCache, Ea as openSlackDirectMessage, Fr as insertReviewItem, Gi as deleteWorkspace, Gr as canReadReviewItem, H as PluginCredentialFailureError, Ha as isWorkspaceSnapshotNotReadyError, Hr as PLUGIN_REVIEW_ITEM_KEY_PREFIX, Ia as isAbortError, Ji as listWorkspaces, Jo as SlackActionError, K as AuthorizationFlowDisabledError, Ki as getWorkspace, Li as getDashboardTaskLink, Mr as dismissOpenReviewItems, Nr as getOpenReviewItemByDedupeKey, Pr as getReviewItem, Qi as invalidateReadySnapshot, Qn as getOAuthAccountProviders, Qo as getSlackClient, T as resolveTaskTitle, Ta as getSlackMessagePermalink, Un as escapeClosingTags, Uo as matchSlackAttachments, Vr as updateReviewItemContent, Wi as createWorkspace, Wr as canAgentChangeReviewItem, X as clearPendingAuth, Xa as buildSandboxEgressNetworkPolicy, Xi as updateWorkspace, Xo as getFilePermalink, Xr as requireReviewItemAssignees, Yo as downloadPrivateSlackFile, Yr as readReviewItemAgentScope, Zi as WorkspaceValidationError, Zr as requireReviewItemLinks, _i as createWatch, _s as defaultTimezone, ai as resolveAssignees, as as withSlackRetries, at as failTurnRecord, bi as getWatch, bo as canAccessConversation, ci as getSlackToolContext, cn as replyTextSchema, di as RESOURCE_WATCH_TOOL_SOURCE, do as SANDBOX_WORKSPACE_ROOT, dr as getStaticPluginToolDefinitions, ds as searchConversations, ea as setWorkspaceSnapshot, et as lostWorkerBeforeFirstSave, fi as STOP_WATCHING_TOOL_NAME, fn as NO_REPLY_TOOL_NAME, gi as createTimerWatch, ia as isStale, ii as resolveAssignee, in as REPLY_TOOL_NAME, j as markConversationMessage, ji as getDashboardConversationLink, kr as closeReviewItem, li as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, lo as SANDBOX_REPOS_ROOT, mi as cancelWatch, mn as isLegacyNoReplyMarker, ms as createPluginAnnotations, na as create, ni as activeParticipantUserIds, no as ToolInputError, ns as normalizeSlackConversationId, nt as saveTurnCheckpoint, oa as getSandboxProvider, on as readTurnAnswer, os as sleep, pn as findLegacyNoReplyMarker, ps as saveObjectAnnotations, qa as createSandboxEgressCredentialToken, qi as getWorkspaceByName, qn as renderTag, ri as automationCreatorUserId, rn as isTurnExecutionLimitExceededError, rr as createPluginHookRunner, rt as abandonTurnRecord, s as openConversationProjection, st as getTurnRecord, ta as setWorkspaceSnapshotBuild, ti as EVERYONE_ASSIGNEE, to as workspaceRepoCheckoutPath, tt as pauseLostWorkerTurn, ui as RESOURCE_SUBSCRIPTION_MAX_TTL_MS, un as getAssistantReplyText, ur as getPlugins, v as hydrateConversationMessages, vi as deliverWatch, vn as REPORT_BLOCKED_TOOL_NAME, w as fallbackShortTitle, xi as listWatches, ya as slackMention, yi as findMatchingWatches, yo as createPluginLogger, zo as FORK_INSTRUCTIONS, zr as searchReviewItems } from "./projection-DBq8tsA5.js";
3
- import { D as resolveGatewayModel, X as bufferBody, Y as resolveGatewayCredential, _ as TURN_REASONING_LEVELS, b as GEN_AI_PROVIDER_NAME, i as getChatConfig, n as botConfig, q as isProviderRetryError, x as GEN_AI_SERVER_ADDRESS } from "./config-oGM7KA9M.js";
4
- import { E as withSpan, G as normalizeIdentityEmail, J as toOptionalString, h as logWarn, i as extractGenAiUsageAttributes, m as logInfo, o as getActiveTraceContext, p as logException, x as setSpanStatus, z as getDeploymentId } from "./logging-DiyqRLBx.js";
2
+ import { $ as loadTurnCheckpoint, $a as workspaceRepoCheckoutPath, $i as setWorkspaceSnapshotBuild, $r as EVERYONE_ASSIGNEE, Ar as dismissOpenReviewItems, Ba as isWorkspaceSnapshotNotReadyError, Br as PLUGIN_REVIEW_ITEM_KEY_PREFIX, Ca as getSlackMessagePermalink, Cn as getTerminalAssistantMessages, Cs as defaultTimezone, Dr as closeReviewItem, Fi as getDashboardTaskLink, Ga as createSandboxEgressCredentialToken, Gi as getWorkspaceByName, Gn as renderTag, H as PluginCredentialFailureError, Hi as createWorkspace, Hr as canAgentChangeReviewItem, Ja as buildSandboxEgressNetworkPolicy, Ji as updateWorkspace, Jo as readLiveAttachment, Jr as requireReviewItemAssignees, K as AuthorizationFlowDisabledError, Ki as listWorkspaces, Lo as FORK_INSTRUCTIONS, Lr as searchReviewItems, Mr as getReviewItem, Nr as insertReviewItem, Pa as isAbortError, Qi as setWorkspaceSnapshot, Ra as WorkspaceSnapshotNotReadyError, Ro as loadForkHistory, T as resolveTaskTitle, Ui as deleteWorkspace, Ur as canReadReviewItem, Vn as escapeClosingTags, Vo as matchSlackAttachments, Wi as getWorkspace, X as clearPendingAuth, Xi as invalidateReadySnapshot, Xn as getOAuthAccountProviders, Yi as WorkspaceValidationError, Yo as recordUploadedAttachment, Yr as requireReviewItemLinks, Za as SANDBOX_RUNTIME, Zi as loadSnapshotsForProfile, _a as slackMention, _i as findMatchingWatches, _o as createPluginLogger, _s as searchConversations, as as isConversationScopedChannel, at as failTurnRecord, bs as createPluginAnnotations, ci as RESOURCE_SUBSCRIPTION_MAX_TTL_MS, cn as replyTextSchema, cr as getPlugins, cs as normalizeSlackConversationId, ds as withSlackRetries, ea as create, ei as activeParticipantUserIds, eo as ToolInputError, es as SlackActionError, et as lostWorkerBeforeFirstSave, fi as cancelWatch, fn as NO_REPLY_TOOL_NAME, fs as sleep, gi as deliverWatch, hi as createWatch, ia as getSandboxProvider, in as REPLY_TOOL_NAME, is as getSlackClient, j as markConversationMessage, jr as getOpenReviewItemByDedupeKey, ki as getDashboardConversationLink, ks as createPluginCache, li as RESOURCE_WATCH_TOOL_SOURCE, lo as SANDBOX_WORKSPACE_ROOT, lr as getStaticPluginToolDefinitions, mi as createTimerWatch, mn as isLegacyNoReplyMarker, na as isStale, ni as resolveAssignee, ns as getFilePermalink, nt as saveTurnCheckpoint, oi as getSlackToolContext, on as readTurnAnswer, pn as findLegacyNoReplyMarker, qr as readReviewItemAgentScope, ri as resolveAssignees, rn as isTurnExecutionLimitExceededError, rt as abandonTurnRecord, s as openConversationProjection, si as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, so as SANDBOX_REPOS_ROOT, st as getTurnRecord, ti as automationCreatorUserId, tr as createPluginHookRunner, ts as downloadPrivateSlackFile, tt as pauseLostWorkerTurn, ui as STOP_WATCHING_TOOL_NAME, un as getAssistantReplyText, v as hydrateConversationMessages, vi as getWatch, vn as REPORT_BLOCKED_TOOL_NAME, vo as canAccessConversation, w as fallbackShortTitle, wa as openSlackDirectMessage, xo as readConversationAccessFromSql, yi as listWatches, ys as saveObjectAnnotations, zr as updateReviewItemContent } from "./projection-CcFBVFUo.js";
3
+ import { $ as bufferBody, X as isProviderRetryError, _ as TURN_REASONING_LEVELS, i as getChatConfig, k as resolveGatewayModel, n as botConfig } from "./config-CBZp0udd.js";
4
+ import { E as withSpan, G as normalizeIdentityEmail, J as toOptionalString, h as logWarn, m as logInfo, o as getActiveTraceContext, p as logException, x as setSpanStatus, z as getDeploymentId } from "./logging-BPNTQVFu.js";
5
5
  import { h as startSpan, n as captureMessage, u as sentry_exports } from "./sentry-CPbZjomA.js";
6
- import { n as pluginCatalogRuntime } from "./catalog-runtime-d1EM6Z0V.js";
7
- import { A as enqueueEventNotification, B as resolveEventMentions, C as listActiveMailboxTurns, G as conversationSubtree, I as maybePostAutomatedTurnLimitNotice, J as isExperimentalFeatureEnabled, K as conversationSubtreeColumns, M as isEventMailboxMetadata, Q as requireSlackChannelMessageScope, S as listActiveMailboxTurnSources, U as recordFinishedTurnForAutomatedLimit, W as resetAutomatedTurnLimit, X as getEventCatalog, at as workspaceSnapshotFinishedEvent, b as getAuthPausedConversationTurnId, f as buildSteeringPiMessage, g as withoutSavedSteeringMessages, i as resumeStoppedConversationTree, it as WORKSPACE_SNAPSHOT_READY_EVENT, k as EVENT_WAIT_MS, m as instructionForInputs, n as isSkippedAfterConversationStop, nt as slackChannelMessageTrigger, ot as workspaceSnapshotWatch, r as markConversationsStopped, rt as WORKSPACE_SNAPSHOT_FAILED_EVENT, st as buildDeploymentSystemPrompt, t as getConversationStoppedAtMs, v as saveUserCustomization, y as addConversationNote } from "./session-stop-BLLp1IP_.js";
8
- import { A as agentTypeInstructions, M as formatAgentTypes, Q as briefOutcomeStatusSchema, U as removedCardSchema, Z as briefLinkSchema, j as agentTypeSchema, k as AGENT_TYPES } from "./conversation-CY1jnBiC.js";
9
- import { A as eventAutomationTriggerSchema, F as compileScheduleIntent, H as automationTaskSchema, L as toolScheduleIntentSchema, P as ScheduleIntentError, R as weekdaySchema, U as automationTaskText, V as automationTaskDescription, l as automationListQuerySchema, z as automationSkillNameSchema } from "./automation-D9MvhOWY.js";
6
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-J52Tej47.js";
7
+ import { A as enqueueEventNotification, B as resolveEventMentions, C as listActiveMailboxTurns, G as recordFinishedTurnForAutomatedLimit, I as maybePostAutomatedTurnLimitNotice, J as conversationSubtreeColumns, K as resetAutomatedTurnLimit, M as isEventMailboxMetadata, Q as getEventCatalog, S as listActiveMailboxTurnSources, X as isExperimentalFeatureEnabled, at as WORKSPACE_SNAPSHOT_FAILED_EVENT, b as getAuthPausedConversationTurnId, ct as workspaceSnapshotWatch, et as requireSlackChannelMessageScope, f as buildSteeringPiMessage, g as withoutSavedSteeringMessages, i as resumeStoppedConversationTree, it as slackChannelMessageTrigger, k as EVENT_WAIT_MS, lt as buildDeploymentSystemPrompt, m as instructionForInputs, n as isSkippedAfterConversationStop, ot as WORKSPACE_SNAPSHOT_READY_EVENT, q as conversationSubtree, r as markConversationsStopped, st as workspaceSnapshotFinishedEvent, t as getConversationStoppedAtMs, v as saveUserCustomization, y as addConversationNote } from "./session-stop-uotLtp4g.js";
8
+ import { A as agentTypeSchema, H as removedCardSchema, O as AGENT_TYPES, X as briefLinkSchema, Z as briefOutcomeStatusSchema, j as formatAgentTypes, k as agentTypeInstructions } from "./conversation-BOqdRtUx.js";
9
+ import { A as eventAutomationTriggerSchema, F as compileScheduleIntent, H as automationTaskSchema, L as toolScheduleIntentSchema, P as ScheduleIntentError, R as weekdaySchema, U as automationTaskText, V as automationTaskDescription, l as automationListQuerySchema, z as automationSkillNameSchema } from "./automation-CuA3yEcD.js";
10
10
  import { d as parseSlackChannelReferenceId, f as parseSlackTeamId, o as isUserActor, p as parseSlackUserId, u as parseSlackChannelId, v as parseSlackMessageTs } from "./actor-D2iXzvlN.js";
11
- import { $ as fenceLock, C as isPersonInput, D as turnBehavior, E as promptModeTurnTools, J as getStateAdapter, M as SYSTEM_IDENTITY_ID, O as conversationKindFromRow, P as resolveActorIdentityId, _t as sameDestination, a as getConversationStore, dt as conversationDetailTouch, et as withLock, ft as nextDetailVersion, g as setArchivedAt, h as readConversationTrees, i as getConversationMessageSearchStore, lt as resolveRootConversationId, m as conversationDescendants, o as getDb, p as conversationAncestors, pt as touchConversationDetail, r as getConversationEventStore, s as getSqlExecutor, ut as rootConversationIsArchived, w as isTopLevelKind, y as userMessageQueries } from "./db-C-2tFxk3.js";
12
- import { $ as deleteEventAutomation, A as readAutomationExecutionStatusDays, Ct as hasEventCatalogEntries, D as emptyAutomationRunWindows, Dt as registeredResourceTypeSchema, Et as registeredEventTypeSchema, H as deleteScheduledAutomation, K as saveScheduledAutomation, M as readAutomationExecutionSummaries, N as readAutomationExecutions, Ot as requireEventIdentifier, P as readAutomationRuns, St as eventWatchUnavailable, Tt as registeredEventTriggerProblems, W as parseScheduledAutomationRow, _t as automationEventCatalog, a as getPersistedThreadState, at as setEventAutomationStatus, c as coerceThreadConversationState, ct as automationDefinition, dt as readAutomationVersion, ft as sameDefinitionValue, g as getDispatchRecord, h as getDispatchInputMessageId, ht as requireAutomationRevision, i as getPersistedSandboxState, it as saveEventAutomation, j as readAutomationExecutionStatusHours, k as readAutomationExecutionByConversationId, kt as requireValidEventTrigger, m as getDispatchIdForConversation, mt as automationRevision, n as resolveTurnSessionRouting, nt as listDeletedEventAutomationsCreatedBy, rt as parseEventAutomationRow, s as persistThreadStateById, ut as listAutomationVersions, vt as describeRegisteredEventTrigger, wt as registeredEventMatchSchema, xt as eventNamespaceSchema } from "./turn-session-routing-DGvn9MSl.js";
13
- import { A as juniorAttachmentUploads, F as juniorDestinations, M as juniorConversations, N as juniorIdentities, P as juniorUsers, T as juniorConversationEvents, _ as juniorConversationReadPositions, f as juniorAutomations, g as juniorAgentInvocations, h as juniorAgentBindings, j as juniorAttachments, p as juniorStats, u as juniorAutomationRuns, v as juniorConversationParticipants } from "./executor-NVfS8aQ2.js";
11
+ import { A as conversationKindFromRow, E as isTopLevelKind, I as resolveActorIdentityId, O as promptModeTurnTools, P as SYSTEM_IDENTITY_ID, T as isPersonInput, X as getStateAdapter, _ as readConversationTrees, a as getConversationStore, dt as resolveRootConversationId, ft as rootConversationIsArchived, g as conversationDescendants, h as conversationAncestors, i as getConversationMessageSearchStore, k as turnBehavior, mt as nextDetailVersion, nt as withLock, o as getDb, r as getConversationEventStore, s as getSqlExecutor, tt as fenceLock, v as setArchivedAt, x as userMessageQueries, yt as sameDestination } from "./db-DU84dCVu.js";
12
+ import { $ as deleteEventAutomation, A as readAutomationExecutionStatusDays, Ct as hasEventCatalogEntries, D as emptyAutomationRunWindows, Dt as registeredResourceTypeSchema, Et as registeredEventTypeSchema, H as deleteScheduledAutomation, K as saveScheduledAutomation, M as readAutomationExecutionSummaries, N as readAutomationExecutions, Ot as requireEventIdentifier, P as readAutomationRuns, St as eventWatchUnavailable, Tt as registeredEventTriggerProblems, W as parseScheduledAutomationRow, _t as automationEventCatalog, a as getPersistedThreadState, at as setEventAutomationStatus, c as coerceThreadConversationState, ct as automationDefinition, dt as readAutomationVersion, ft as sameDefinitionValue, g as getDispatchRecord, h as getDispatchInputMessageId, ht as requireAutomationRevision, i as getPersistedSandboxState, it as saveEventAutomation, j as readAutomationExecutionStatusHours, k as readAutomationExecutionByConversationId, kt as requireValidEventTrigger, m as getDispatchIdForConversation, mt as automationRevision, n as resolveTurnSessionRouting, nt as listDeletedEventAutomationsCreatedBy, rt as parseEventAutomationRow, s as persistThreadStateById, ut as listAutomationVersions, vt as describeRegisteredEventTrigger, wt as registeredEventMatchSchema, xt as eventNamespaceSchema } from "./turn-session-routing-2bW2qfeb.js";
13
+ import { A as juniorAttachmentUploads, F as juniorUsers, I as juniorDestinations, N as juniorConversations, P as juniorIdentities, T as juniorConversationEvents, _ as juniorConversationReadPositions, f as juniorAutomations, g as juniorAgentInvocations, h as juniorAgentBindings, j as juniorAttachments, p as juniorStats, u as juniorAutomationRuns, v as juniorConversationParticipants } from "./executor-CFyrgOu1.js";
14
14
  import { i as getFirstRunAtMs, o as getZonedDateTimeParts, s as isValidTimeZone } from "./schedule-cP0AACm1.js";
15
- import { t as discoverSkills } from "./skills-CNAGH4ju.js";
15
+ import { t as discoverSkills } from "./skills-Bex1EaO5.js";
16
16
  import { M as sumUtcHoursIntoSixHours, T as apiErrorSchema, c as formatUserInputAnswer, d as userInputRequestSchema, g as USER_CUSTOMIZATION_MAX_CHARS, h as isVisionImageMediaType, m as detectImageMediaType, n as AGENT_INVOCATION_MAILBOX_STATUSES, r as AGENT_INVOCATION_PARENT_MAILBOX_STATUSES, t as webMessageId, v as userCustomizationTextSchema, w as isAgentInvocationResultEventType, x as AGENT_PARENT_MESSAGE_EVENT_TYPE, y as AGENT_INVOCATION_EVENT_NAMESPACE } from "./web-message-id-lNodcCOI.js";
17
- import { f as identityAvatarUrl, h as readUserAvatarUrls } from "./viewer-BPQHMx3-.js";
18
- import { A as getAgentInvocationResultMessageId, C as ownAgentInvocation, I as getUnnamedAgentConversationId, N as getChildAgentLockName, O as getAgentInvocationIdForResult, P as getNamedAgentConversationId, R as buildDeterministicTurnId, S as listChildMessages, T as getAgentInvocationId, _ as ConversationTurnLifecycleService, b as hasAgentInvocationReply, d as isTurnInputCommitLostError, j as getAgentInvocationTurnId, k as getAgentInvocationMessageId, l as getConversationTurnBoundaryError, p as markTurnClosed, s as TurnInputCommitLostError, t as getTurnUserMessage, w as readChildMessageSender } from "./turn-user-message-19CkuUvM.js";
19
- import { D as stopConversationWork, _ as getConversationWorkState, h as ensureConversationWake, m as dropPendingMessages, n as appendAndEnqueueExclusiveInboundMessage, r as appendAndEnqueueInboundMessage, v as getConversationWorkStates, w as requestConversationWork } from "./store-Dgs7Oe44.js";
20
- import { d as contextProvenance, m as sameActorIdentity, t as KNOWN_CONVERSATION_EVENT_TYPES, u as agentInstructionProvenance } from "./history-UZ3M2M9r.js";
21
- import { f as credentialContextForActor, p as credentialContextSchema } from "./registry-Bu0Z9BEO.js";
22
- import { o as getVercelConversationWorkQueue, p as getTurnRequestDeadline } from "./background-compaction-queue-xaE05jxH.js";
23
- import { r as EVENT_AUTHOR_ID, u as completeText } from "./prompt-D2KlJopL.js";
24
- import { n as postinstall, o as getSandboxResources, t as dependencies } from "./install-CHLrpRZc.js";
25
- import { a as sendCacheWarmup, c as sendWorkspaceSnapshotJob, s as sendNextWorkspaceSnapshotJob } from "./queue-DFaOscp5.js";
17
+ import { f as identityAvatarUrl, h as readUserAvatarUrls } from "./viewer-CxUiOraX.js";
18
+ import { A as getAgentInvocationResultMessageId, C as ownAgentInvocation, I as getUnnamedAgentConversationId, N as getChildAgentLockName, O as getAgentInvocationIdForResult, P as getNamedAgentConversationId, R as buildDeterministicTurnId, S as listChildMessages, T as getAgentInvocationId, _ as ConversationTurnLifecycleService, b as hasAgentInvocationReply, d as isTurnInputCommitLostError, j as getAgentInvocationTurnId, k as getAgentInvocationMessageId, l as getConversationTurnBoundaryError, p as markTurnClosed, s as TurnInputCommitLostError, t as getTurnUserMessage, w as readChildMessageSender } from "./turn-user-message-BrhuyYrH.js";
19
+ import { D as stopConversationWork, _ as getConversationWorkState, h as ensureConversationWake, m as dropPendingMessages, n as appendAndEnqueueExclusiveInboundMessage, r as appendAndEnqueueInboundMessage, v as getConversationWorkStates, w as requestConversationWork } from "./store-Ca6G962n.js";
20
+ import { d as contextProvenance, m as sameActorIdentity, t as KNOWN_CONVERSATION_EVENT_TYPES, u as agentInstructionProvenance } from "./history-m2-ceTTX.js";
21
+ import { f as credentialContextForActor, p as credentialContextSchema } from "./registry-BjZZqKqi.js";
22
+ import { o as getVercelConversationWorkQueue, p as getTurnRequestDeadline } from "./background-compaction-queue-BTqMIfTA.js";
23
+ import { p as searchWeb, r as EVENT_AUTHOR_ID, u as completeText } from "./prompt-C5LREK2p.js";
24
+ import { n as postinstall, o as getSandboxResources, t as dependencies } from "./install-CQ76CfRw.js";
25
+ import { a as sendCacheWarmup, c as sendWorkspaceSnapshotJob, s as sendNextWorkspaceSnapshotJob } from "./queue-B2AAL3ym.js";
26
26
  import * as z from "zod";
27
27
  import { streamSimple } from "@earendil-works/pi-ai/compat";
28
- import { createGatewayProvider } from "@ai-sdk/gateway";
29
- import { generateText } from "ai";
30
28
  import path from "node:path";
31
29
  import { isDeepStrictEqual, promisify } from "node:util";
32
30
  import { createHash, randomUUID } from "node:crypto";
@@ -3289,10 +3287,6 @@ function parseSlackThreadId(threadId) {
3289
3287
  threadTs
3290
3288
  };
3291
3289
  }
3292
- /** Resolve the Slack channel ID from a `slack:<channel>:<ts>` thread identifier. */
3293
- function resolveSlackChannelIdFromThreadId(threadId) {
3294
- return parseSlackThreadId(threadId)?.channelId;
3295
- }
3296
3290
  /** Best-effort channel ID extraction from a raw Slack message payload. */
3297
3291
  function resolveSlackChannelIdFromMessage(message) {
3298
3292
  const messageChannelId = parseSlackChannelId(message.channelId);
@@ -3302,7 +3296,6 @@ function resolveSlackChannelIdFromMessage(message) {
3302
3296
  const rawChannel = parseSlackChannelId(raw.channel);
3303
3297
  if (rawChannel) return rawChannel;
3304
3298
  }
3305
- return resolveSlackChannelIdFromThreadId(toTrimmedSlackString(message.threadId));
3306
3299
  }
3307
3300
  // src/chat/slack/timestamp-param.ts
3308
3301
  /** Define a model-facing Slack timestamp, normalizing numeric model args to strings. */
@@ -4880,7 +4873,7 @@ function createSetConversationSubscriptionTool(context) {
4880
4873
  ...setConversationSubscriptionToolDefinition,
4881
4874
  async execute(input) {
4882
4875
  const user = (await context.resolveActorIdentity?.())?.user;
4883
- if (!user) throw new ToolInputError("This person has no linked Junior user, so their subscription cannot change.");
4876
+ if (!user) throw new ToolInputError("This person has no linked User, so their subscription cannot change.");
4884
4877
  const result = await updateConversationSubscription(user, context.conversationId, input.subscribed);
4885
4878
  if (!result) throw new ToolInputError("This person is not a participant of this conversation.");
4886
4879
  return {
@@ -6087,10 +6080,10 @@ const agentInvocationMailboxMetadataSchema = z.object({
6087
6080
  agentInvocationId: z.string().min(1),
6088
6081
  kind: z.literal("agent_invocation")
6089
6082
  }).strict();
6090
- /** Map a durable invocation's model settings and depth to the child Run policy. */
6091
- function agentInvocationRunPolicy(invocation, canSpawn) {
6083
+ /** Map a durable invocation's model settings to the child Run policy. */
6084
+ function agentInvocationRunPolicy(invocation) {
6092
6085
  return {
6093
- disabledFeatures: canSpawn ? ["interactive-auth"] : ["interactive-auth", "subagents"],
6086
+ disabledFeatures: ["interactive-auth"],
6094
6087
  ...invocation.reasoningLevel ? { reasoning: invocation.reasoningLevel } : void 0
6095
6088
  };
6096
6089
  }
@@ -6375,11 +6368,8 @@ async function saveAgentInvocationResult(args) {
6375
6368
  * Build the invocation consumer that advances work through the shared runner.
6376
6369
  * `enqueueResult` sends each terminal result to the parent mailbox. Omit it
6377
6370
  * only where the parent has no mailbox, such as the local CLI.
6378
- * `maxAgentDepth` is the number of child agent levels that can start their
6379
- * own child agents. The default, 0, lets only the root start child agents.
6380
6371
  */
6381
6372
  function createAgentInvocationWorker(agentRunner, options = {}) {
6382
- const canSpawn = (options.maxAgentDepth ?? 0) > 0;
6383
6373
  return async (context, invocationId) => {
6384
6374
  let invocation = await getAgentInvocation(invocationId);
6385
6375
  if (!invocation) throw new Error(`Agent invocation is missing for ${invocationId}`);
@@ -6494,7 +6484,7 @@ function createAgentInvocationWorker(agentRunner, options = {}) {
6494
6484
  surface: "internal",
6495
6485
  deadlineAtMs: getTurnRequestDeadline()?.deadlineAtMs,
6496
6486
  ...stopSignal ? { signal: stopSignal } : void 0,
6497
- ...agentInvocationRunPolicy(invocation, canSpawn),
6487
+ ...agentInvocationRunPolicy(invocation),
6498
6488
  state: { sandboxRef },
6499
6489
  durability: {
6500
6490
  drainSteeringMessages: createAgentMessageSteeringDrain(context, invocation),
@@ -7585,407 +7575,6 @@ function contentPartText(part) {
7585
7575
  default: return "";
7586
7576
  }
7587
7577
  }
7588
- // src/chat/attachments/store.ts
7589
- const DAY_MS = 864e5;
7590
- const ATTACHMENT_GC_BATCH_LIMIT = 200;
7591
- /** Time that Junior keeps attachment bytes after the file is stored. */
7592
- const ATTACHMENT_RETENTION_MS = 30 * DAY_MS;
7593
- function attachmentIdentity(file) {
7594
- if ("data" in file) return file.source ?? { sha256: createHash("sha256").update(file.data).digest("hex") };
7595
- return file.source;
7596
- }
7597
- /** Stable conversation-owned id for one file and its presentation metadata. */
7598
- function attachmentId(args) {
7599
- const identity = "sha256" in args.identity ? [
7600
- args.conversationId,
7601
- args.storageProvider,
7602
- args.identity.sha256,
7603
- args.filename,
7604
- args.contentType
7605
- ] : [
7606
- args.conversationId,
7607
- args.storageProvider,
7608
- args.filename,
7609
- args.contentType,
7610
- args.identity.provider,
7611
- args.identity.id
7612
- ];
7613
- return createHash("sha256").update(identity.join("\0")).digest("hex");
7614
- }
7615
- /**
7616
- * Object key for one write attempt.
7617
- *
7618
- * Attachment ids are content-stable. Object keys are not: each put gets a fresh
7619
- * key so a failed-write cleanup or GC delete cannot remove another writer's
7620
- * durable blob.
7621
- */
7622
- function attachmentKey(args) {
7623
- return `conversations/${args.conversationId}/attachments/${args.attachmentId}/${args.writeId}/${args.filename}`;
7624
- }
7625
- /** A source whose bytes do not match its declared size. A retry cannot fix it. */
7626
- var AttachmentSizeError = class extends Error {
7627
- constructor(bytes, expected, options) {
7628
- super(`Attachment body does not match its declared ${expected} bytes (read ${bytes})`, options);
7629
- this.name = "AttachmentSizeError";
7630
- }
7631
- };
7632
- /** Tries for one object write, each with a freshly opened body. */
7633
- const WRITE_ATTEMPTS = 3;
7634
- async function bestEffortDelete(storage, key) {
7635
- if (key === null) return;
7636
- try {
7637
- await storage.delete([key]);
7638
- } catch {}
7639
- }
7640
- /**
7641
- * Stream one file to a fresh key, and return its size and digest.
7642
- *
7643
- * The digest is taken while the bytes stream, so the body is never held
7644
- * whole. A body that does not match its declared size is not kept.
7645
- */
7646
- async function writeAttachmentObject(args) {
7647
- for (let attempt = 1;; attempt += 1) try {
7648
- return await writeAttachmentObjectOnce(args);
7649
- } catch (error) {
7650
- if (error instanceof AttachmentSizeError || attempt >= WRITE_ATTEMPTS) {
7651
- await bestEffortDelete(args.storage, args.key);
7652
- throw error;
7653
- }
7654
- }
7655
- }
7656
- async function writeAttachmentObjectOnce(args) {
7657
- const { file } = args;
7658
- const expected = "data" in file ? file.data.byteLength : file.bytes;
7659
- const source = "data" in file ? bufferBody(file.data) : await file.open();
7660
- const hash = createHash("sha256");
7661
- let bytes = 0;
7662
- const body = source.pipeThrough(new TransformStream({ transform(chunk, controller) {
7663
- bytes += chunk.byteLength;
7664
- if (bytes > expected) throw new AttachmentSizeError(bytes, expected);
7665
- hash.update(chunk);
7666
- controller.enqueue(chunk);
7667
- } }));
7668
- try {
7669
- await args.storage.put({
7670
- body,
7671
- bytes: expected,
7672
- contentType: file.mimeType,
7673
- key: args.key
7674
- });
7675
- } catch (error) {
7676
- if (bytes > expected) throw new AttachmentSizeError(bytes, expected, { cause: error });
7677
- throw error;
7678
- }
7679
- if (bytes !== expected) throw new AttachmentSizeError(bytes, expected);
7680
- return {
7681
- bytes,
7682
- sha256: hash.digest("hex")
7683
- };
7684
- }
7685
- async function isConversationPurged(db, conversationId) {
7686
- const [row] = await db.db().select({ transcriptPurgedAt: juniorConversations.transcriptPurgedAt }).from(juniorConversations).where(eq(juniorConversations.conversationId, conversationId));
7687
- return row?.transcriptPurgedAt != null;
7688
- }
7689
- function purgedConversationError(conversationId) {
7690
- return /* @__PURE__ */ new Error(`Cannot store attachment for purged conversation ${conversationId}`);
7691
- }
7692
- async function assertConversationNotPurged(db, conversationId) {
7693
- if (await isConversationPurged(db, conversationId)) throw purgedConversationError(conversationId);
7694
- }
7695
- /** Mark a just-written row for deletion and drop its unused object. */
7696
- async function rejectPurgedAttachmentWrite(args) {
7697
- const db = args.db.db();
7698
- await db.with(conversationDetailTouch(db, [args.conversationId])).update(juniorAttachments).set({ deleteRequestedAt: args.now }).where(eq(juniorAttachments.id, args.id));
7699
- await bestEffortDelete(args.storage, args.storageKey);
7700
- throw purgedConversationError(args.conversationId);
7701
- }
7702
- /**
7703
- * Return another writer's live row only when the conversation is still active.
7704
- *
7705
- * The caller already wrote a unique object for this attempt. Delete that unused
7706
- * object either way. If the conversation is purged, do not report success for a
7707
- * row that purge/GC is about to remove.
7708
- */
7709
- async function reuseLiveAttachment(args) {
7710
- await bestEffortDelete(args.storage, args.storageKey);
7711
- await assertConversationNotPurged(args.db, args.conversationId);
7712
- return { id: args.id };
7713
- }
7714
- /**
7715
- * Persist one conversation-owned file.
7716
- *
7717
- * Identity is stable under the conversation: it comes from the file's source
7718
- * when it has one, and from its digest otherwise. Object storage is written
7719
- * first under a unique key; the SQL row is created only after that write
7720
- * succeeds. A row means the attachment is durable. Retries reuse an existing
7721
- * live row. A purge-marked row is revived by writing a new object and pointing
7722
- * the row at it, unless the conversation is still purged. If the SQL write
7723
- * fails after object storage accepts the bytes, this path deletes that unique
7724
- * object. A process crash between those steps can leave an unreferenced unique
7725
- * object with no SQL row.
7726
- */
7727
- async function storeAttachment(args) {
7728
- const now = new Date(args.nowMs ?? Date.now());
7729
- const identity = attachmentIdentity(args.file);
7730
- const source = args.file.source;
7731
- const id = attachmentId({
7732
- conversationId: args.conversationId,
7733
- contentType: args.file.mimeType,
7734
- filename: args.file.filename,
7735
- identity,
7736
- storageProvider: args.storage.provider
7737
- });
7738
- const [existing] = await args.db.db().select({
7739
- contentType: juniorAttachments.contentType,
7740
- conversationId: juniorAttachments.conversationId,
7741
- deleteRequestedAt: juniorAttachments.deleteRequestedAt,
7742
- filename: juniorAttachments.filename,
7743
- id: juniorAttachments.id,
7744
- provider: juniorAttachments.provider,
7745
- providerId: juniorAttachments.providerId,
7746
- storageProvider: juniorAttachments.storageProvider,
7747
- sha256: juniorAttachments.sha256,
7748
- storageKey: juniorAttachments.storageKey
7749
- }).from(juniorAttachments).where(eq(juniorAttachments.id, id));
7750
- if (existing) {
7751
- if (existing.contentType !== args.file.mimeType || existing.conversationId !== args.conversationId || existing.filename !== args.file.filename || existing.provider !== (source?.provider ?? null) || existing.providerId !== (source?.id ?? null) || existing.storageProvider !== args.storage.provider || "sha256" in identity && existing.sha256 !== identity.sha256) throw new Error(`Attachment write conflicts with ${existing.id}`);
7752
- if (existing.deleteRequestedAt === null) {
7753
- await assertConversationNotPurged(args.db, args.conversationId);
7754
- return { id: existing.id };
7755
- }
7756
- }
7757
- await assertConversationNotPurged(args.db, args.conversationId);
7758
- const { file } = args;
7759
- let storageKey = null;
7760
- let written;
7761
- if ("deferred" in file) written = {
7762
- bytes: file.bytes,
7763
- sha256: null
7764
- };
7765
- else {
7766
- storageKey = attachmentKey({
7767
- attachmentId: id,
7768
- conversationId: args.conversationId,
7769
- filename: file.filename,
7770
- writeId: randomUUID()
7771
- });
7772
- written = await writeAttachmentObject({
7773
- file,
7774
- key: storageKey,
7775
- storage: args.storage
7776
- });
7777
- }
7778
- if (existing?.deleteRequestedAt != null) {
7779
- if (await isConversationPurged(args.db, args.conversationId)) {
7780
- await bestEffortDelete(args.storage, storageKey);
7781
- throw purgedConversationError(args.conversationId);
7782
- }
7783
- const oldStorageKey = existing.storageKey;
7784
- if ((await args.db.db().with(conversationDetailTouch(args.db.db(), [args.conversationId])).update(juniorAttachments).set({
7785
- ...written,
7786
- deleteRequestedAt: null,
7787
- storageKey
7788
- }).where(and(eq(juniorAttachments.id, id), isNotNull(juniorAttachments.deleteRequestedAt))).returning({ id: juniorAttachments.id })).length > 0) {
7789
- if (await isConversationPurged(args.db, args.conversationId)) await rejectPurgedAttachmentWrite({
7790
- conversationId: args.conversationId,
7791
- db: args.db,
7792
- id,
7793
- now,
7794
- storage: args.storage,
7795
- storageKey
7796
- });
7797
- if (oldStorageKey !== storageKey) await bestEffortDelete(args.storage, oldStorageKey);
7798
- return { id };
7799
- }
7800
- const [afterRace] = await args.db.db().select({
7801
- deleteRequestedAt: juniorAttachments.deleteRequestedAt,
7802
- id: juniorAttachments.id,
7803
- storageKey: juniorAttachments.storageKey
7804
- }).from(juniorAttachments).where(eq(juniorAttachments.id, id));
7805
- if (afterRace?.deleteRequestedAt === null) return reuseLiveAttachment({
7806
- conversationId: args.conversationId,
7807
- db: args.db,
7808
- id: afterRace.id,
7809
- storage: args.storage,
7810
- storageKey
7811
- });
7812
- }
7813
- let inserted = [];
7814
- try {
7815
- inserted = await args.db.db().with(conversationDetailTouch(args.db.db(), [args.conversationId])).insert(juniorAttachments).values({
7816
- id,
7817
- conversationId: args.conversationId,
7818
- storageProvider: args.storage.provider,
7819
- storageKey,
7820
- provider: source?.provider,
7821
- providerId: source?.id,
7822
- filename: args.file.filename,
7823
- contentType: args.file.mimeType,
7824
- ...written,
7825
- createdAt: now
7826
- }).onConflictDoNothing({ target: juniorAttachments.id }).returning({ id: juniorAttachments.id });
7827
- } catch (error) {
7828
- await bestEffortDelete(args.storage, storageKey);
7829
- throw error;
7830
- }
7831
- if (inserted.length > 0) {
7832
- if (await isConversationPurged(args.db, args.conversationId)) await rejectPurgedAttachmentWrite({
7833
- conversationId: args.conversationId,
7834
- db: args.db,
7835
- id,
7836
- now,
7837
- storage: args.storage,
7838
- storageKey
7839
- });
7840
- return { id };
7841
- }
7842
- const [row] = await args.db.db().select({
7843
- deleteRequestedAt: juniorAttachments.deleteRequestedAt,
7844
- id: juniorAttachments.id,
7845
- storageKey: juniorAttachments.storageKey
7846
- }).from(juniorAttachments).where(eq(juniorAttachments.id, id));
7847
- if (!row) {
7848
- await bestEffortDelete(args.storage, storageKey);
7849
- throw new Error(`Attachment row missing after write for ${id}`);
7850
- }
7851
- if (row.deleteRequestedAt === null) return reuseLiveAttachment({
7852
- conversationId: args.conversationId,
7853
- db: args.db,
7854
- id: row.id,
7855
- storage: args.storage,
7856
- storageKey
7857
- });
7858
- if (await isConversationPurged(args.db, args.conversationId)) {
7859
- await bestEffortDelete(args.storage, storageKey);
7860
- throw purgedConversationError(args.conversationId);
7861
- }
7862
- if ((await args.db.db().with(conversationDetailTouch(args.db.db(), [args.conversationId])).update(juniorAttachments).set({
7863
- ...written,
7864
- deleteRequestedAt: null,
7865
- storageKey
7866
- }).where(and(eq(juniorAttachments.id, id), isNotNull(juniorAttachments.deleteRequestedAt))).returning({ id: juniorAttachments.id })).length > 0) {
7867
- if (await isConversationPurged(args.db, args.conversationId)) await rejectPurgedAttachmentWrite({
7868
- conversationId: args.conversationId,
7869
- db: args.db,
7870
- id,
7871
- now,
7872
- storage: args.storage,
7873
- storageKey
7874
- });
7875
- if (row.storageKey !== storageKey) await bestEffortDelete(args.storage, row.storageKey);
7876
- return { id };
7877
- }
7878
- const [afterRace] = await args.db.db().select({
7879
- deleteRequestedAt: juniorAttachments.deleteRequestedAt,
7880
- id: juniorAttachments.id
7881
- }).from(juniorAttachments).where(eq(juniorAttachments.id, id));
7882
- if (afterRace?.deleteRequestedAt === null) return reuseLiveAttachment({
7883
- conversationId: args.conversationId,
7884
- db: args.db,
7885
- id: afterRace.id,
7886
- storage: args.storage,
7887
- storageKey
7888
- });
7889
- await bestEffortDelete(args.storage, storageKey);
7890
- throw new Error(`Attachment ${id} disappeared while reviving`);
7891
- }
7892
- /**
7893
- * Record an object that a browser already wrote, under the upload's id.
7894
- *
7895
- * The row takes over the object key. A retry with the same id keeps the
7896
- * first row. The caller checked the object's size, type, and digest.
7897
- */
7898
- async function recordUploadedAttachment(args) {
7899
- const { attachment } = args;
7900
- const now = new Date(args.nowMs);
7901
- await assertConversationNotPurged(args.db, attachment.conversationId);
7902
- if ((await args.db.db().with(conversationDetailTouch(args.db.db(), [attachment.conversationId])).insert(juniorAttachments).values({
7903
- ...attachment,
7904
- storageProvider: args.storage.provider,
7905
- createdAt: now
7906
- }).onConflictDoNothing({ target: juniorAttachments.id }).returning({ id: juniorAttachments.id })).length > 0 && await isConversationPurged(args.db, attachment.conversationId)) await rejectPurgedAttachmentWrite({
7907
- conversationId: attachment.conversationId,
7908
- db: args.db,
7909
- id: attachment.id,
7910
- now,
7911
- storage: args.storage,
7912
- storageKey: attachment.storageKey
7913
- });
7914
- }
7915
- /** Load one live attachment owned by a conversation. */
7916
- async function readLiveAttachment(args) {
7917
- const [row] = await args.db.db().select({
7918
- bytes: juniorAttachments.bytes,
7919
- contentType: juniorAttachments.contentType,
7920
- conversationId: juniorAttachments.conversationId,
7921
- deleteRequestedAt: juniorAttachments.deleteRequestedAt,
7922
- filename: juniorAttachments.filename,
7923
- id: juniorAttachments.id,
7924
- provider: juniorAttachments.provider,
7925
- providerId: juniorAttachments.providerId,
7926
- storageProvider: juniorAttachments.storageProvider,
7927
- storageKey: juniorAttachments.storageKey
7928
- }).from(juniorAttachments).where(and(eq(juniorAttachments.id, args.attachmentId), eq(juniorAttachments.conversationId, args.conversationId), isNull(juniorAttachments.deleteRequestedAt)));
7929
- if (!row) return null;
7930
- if (await isConversationPurged(args.db, args.conversationId)) return null;
7931
- return {
7932
- bytes: row.bytes,
7933
- contentType: row.contentType,
7934
- conversationId: row.conversationId,
7935
- filename: row.filename,
7936
- id: row.id,
7937
- source: row.provider && row.providerId ? {
7938
- id: row.providerId,
7939
- provider: row.provider
7940
- } : null,
7941
- storageKey: row.storageKey,
7942
- storageProvider: row.storageProvider
7943
- };
7944
- }
7945
- /** Persist many conversation-owned files. */
7946
- async function storeAttachments(args) {
7947
- const stored = [];
7948
- for (const file of args.files) stored.push(await storeAttachment({
7949
- conversationId: args.conversationId,
7950
- db: args.db,
7951
- file: {
7952
- data: file.data,
7953
- filename: file.filename,
7954
- mimeType: file.mimeType
7955
- },
7956
- ...args.nowMs !== void 0 ? { nowMs: args.nowMs } : void 0,
7957
- storage: args.storage
7958
- }));
7959
- return stored;
7960
- }
7961
- /** Mark attachments unavailable when their conversation content is purged. */
7962
- async function requestAttachmentDeletion(db, conversationIds, nowMs) {
7963
- if (conversationIds.length === 0) return;
7964
- await db.db().with(conversationDetailTouch(db.db(), conversationIds)).update(juniorAttachments).set({ deleteRequestedAt: new Date(nowMs) }).where(and(inArray(juniorAttachments.conversationId, conversationIds), isNull(juniorAttachments.deleteRequestedAt)));
7965
- }
7966
- /**
7967
- * Delete purged attachments in one bounded batch.
7968
- *
7969
- * Eligible rows are 30 days old, explicitly purge-marked, or owned by a
7970
- * conversation whose transcript is already purged. Delete object keys first,
7971
- * then remove rows that are still eligible so a failed blob delete remains
7972
- * retryable.
7973
- */
7974
- async function collectAttachmentGarbage(args) {
7975
- const expiresBefore = /* @__PURE__ */ new Date(args.nowMs - ATTACHMENT_RETENTION_MS);
7976
- const rows = await args.db.db().select({
7977
- id: juniorAttachments.id,
7978
- storageKey: juniorAttachments.storageKey
7979
- }).from(juniorAttachments).innerJoin(juniorConversations, eq(juniorAttachments.conversationId, juniorConversations.conversationId)).where(and(eq(juniorAttachments.storageProvider, args.storage.provider), or(lte(juniorAttachments.createdAt, expiresBefore), isNotNull(juniorAttachments.deleteRequestedAt), isNotNull(juniorConversations.transcriptPurgedAt)))).orderBy(asc(juniorAttachments.createdAt), asc(juniorAttachments.id)).limit(args.limit ?? ATTACHMENT_GC_BATCH_LIMIT);
7980
- if (rows.length === 0) return { deleted: 0 };
7981
- const keys = rows.flatMap((row) => row.storageKey ? [row.storageKey] : []);
7982
- if (keys.length > 0) await args.storage.delete(keys);
7983
- const stillEligible = await args.db.db().select({ id: juniorAttachments.id }).from(juniorAttachments).innerJoin(juniorConversations, eq(juniorAttachments.conversationId, juniorConversations.conversationId)).where(and(inArray(juniorAttachments.id, rows.map((row) => row.id)), or(lte(juniorAttachments.createdAt, expiresBefore), isNotNull(juniorAttachments.deleteRequestedAt), isNotNull(juniorConversations.transcriptPurgedAt))));
7984
- if (stillEligible.length === 0) return { deleted: 0 };
7985
- const removed = await args.db.db().delete(juniorAttachments).where(inArray(juniorAttachments.id, stillEligible.map((row) => row.id))).returning({ conversationId: juniorAttachments.conversationId });
7986
- await touchConversationDetail(args.db.db(), removed.map((row) => row.conversationId));
7987
- return { deleted: removed.length };
7988
- }
7989
7578
  // src/chat/attachments/uploads.ts
7990
7579
  const MINUTE_MS = 6e4;
7991
7580
  /** Time that a browser has to write the bytes after it asks to upload. */
@@ -8736,7 +8325,7 @@ function createAddReviewItemTool(context, services) {
8736
8325
  everyone: existing.assignedToEveryone,
8737
8326
  userIds: existing.assignees.map((assignee) => assignee.userId)
8738
8327
  } : await defaultAssignees(scope, context.conversationId);
8739
- if (!assignees.everyone && assignees.userIds.length === 0 && !scope.actorIsPerson) throw new ToolInputError("No person would see this item: no default assignee has a Junior user, and this Turn has no person. Set `assignees`.");
8328
+ if (!assignees.everyone && assignees.userIds.length === 0 && !scope.actorIsPerson) throw new ToolInputError("No person would see this item: no default assignee has a User, and this Turn has no person. Set `assignees`.");
8740
8329
  await requireReviewItemAssignees({
8741
8330
  assignees,
8742
8331
  automationId: existing ? existing.automationId : scope.reader.automationId,
@@ -9706,6 +9295,9 @@ function createEditFileTool() {
9706
9295
  }
9707
9296
  });
9708
9297
  }
9298
+ // src/chat/tool-support/result-cap.ts
9299
+ /** Default limit for the text that the model sees from one tool result. */
9300
+ const TOOL_RESULT_MAX_CHARS = 32e3;
9709
9301
  const FULL_RESULT_DIR = "/tmp/jr";
9710
9302
  function fullResultPath(toolCallId) {
9711
9303
  const id = createHash("sha256").update(toolCallId).digest("hex").slice(0, 8);
@@ -10399,6 +9991,38 @@ function getTimeZoneOffsetMinutes(timestampMs, timezone) {
10399
9991
  const asUtcMs = Date.UTC(parts.year, parts.month - 1, parts.day, parts.hour, parts.minute, parts.second);
10400
9992
  return Math.round((timestampMs - asUtcMs) / 6e4);
10401
9993
  }
9994
+ const submitFeedbackToolDefinition = zodToolDefinition({
9995
+ annotations: {
9996
+ destructiveHint: false,
9997
+ idempotentHint: false,
9998
+ openWorldHint: true,
9999
+ readOnlyHint: false
10000
+ },
10001
+ description: "Report a problem with your own tools or runtime to the maintainers, not to the user. Use it once when a tool failed, timed out, was too slow, returned wrong data, or was missing, such as a Sandbox that did not start. Skip it when the work went fine, or when the cause is the user's input, access, or a permission they control. Returns the feedback id.",
10002
+ inputSchema: z.object({ message: z.string().trim().min(1).max(4096).describe("What you tried, the tool and its error or delay, and whether you finished. Do not quote message text, file contents, secrets, or personal data.") }),
10003
+ outputSchema: juniorToolOutputSchema.extend({ feedback_id: z.string().describe("Id of the feedback sent to maintainers.") })
10004
+ });
10005
+ /**
10006
+ * Send the agent's report of a tool or runtime problem to the maintainers as
10007
+ * Sentry user feedback, next to the dashboard Reply ratings.
10008
+ */
10009
+ function createSubmitFeedbackTool(context) {
10010
+ return zodTool({
10011
+ ...submitFeedbackToolDefinition,
10012
+ execute: async (input) => {
10013
+ return { feedback_id: sentry_exports.captureFeedback({
10014
+ message: input.message,
10015
+ name: `${botConfig.userName} agent`,
10016
+ source: "junior_agent",
10017
+ tags: {
10018
+ "gen_ai.conversation.id": context.conversationId,
10019
+ ...context.conversationPrivacy ? { "app.conversation.privacy": context.conversationPrivacy } : void 0
10020
+ },
10021
+ url: getDashboardConversationLink(context.conversationId)
10022
+ }) };
10023
+ }
10024
+ });
10025
+ }
10402
10026
  const updateUserCustomizationToolDefinition = zodToolDefinition({
10403
10027
  exposure: "deferred",
10404
10028
  source: {
@@ -10426,7 +10050,7 @@ function createUpdateUserCustomizationTool(context) {
10426
10050
  ...updateUserCustomizationToolDefinition,
10427
10051
  async execute(input) {
10428
10052
  const user = (await context.resolveActorIdentity?.())?.user;
10429
- if (!user) throw new ToolInputError("This person has no linked Junior user, so customization cannot be saved.");
10053
+ if (!user) throw new ToolInputError("This person has no linked User, so customization cannot be saved.");
10430
10054
  if (!await saveUserCustomization(user.id, input.customization)) throw new Error("User customization target user was not found.");
10431
10055
  return { customization: input.customization };
10432
10056
  }
@@ -11291,17 +10915,14 @@ function createWebFetchTool(hooks, options = {}) {
11291
10915
  // src/chat/tools/web/search.ts
11292
10916
  const SEARCH_TIMEOUT_MS = 6e4;
11293
10917
  const MAX_RESULTS = 5;
11294
- const SEARCH_TOOL_NAME = "parallelSearch";
11295
10918
  function asString(value) {
11296
10919
  return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
11297
10920
  }
11298
- function parseSearchResults(toolResults, maxResults) {
11299
- const typedResults = Array.isArray(toolResults) ? toolResults : [];
10921
+ function parseSearchResults(outputs, maxResults) {
11300
10922
  const parsedResults = [];
11301
- for (const toolResult of typedResults) {
11302
- if (toolResult["type"] !== "tool-result" || toolResult["toolName"] !== SEARCH_TOOL_NAME) continue;
11303
- const output = toolResult.output;
11304
- const results = Array.isArray(output?.results) ? output.results : [];
10923
+ for (const output of outputs) {
10924
+ const results = output?.results;
10925
+ if (!Array.isArray(results)) continue;
11305
10926
  for (const result of results) {
11306
10927
  const url = asString(result["url"]);
11307
10928
  if (!url) continue;
@@ -11329,7 +10950,7 @@ const webSearchToolDefinition = zodToolDefinition({
11329
10950
  }),
11330
10951
  outputSchema: juniorToolOutputSchema
11331
10952
  });
11332
- function createWebSearchTool(modelId, override) {
10953
+ function createWebSearchTool(modelId, cost, override) {
11333
10954
  return zodTool({
11334
10955
  ...webSearchToolDefinition,
11335
10956
  execute: async ({ query, max_results }) => {
@@ -11339,35 +10960,15 @@ function createWebSearchTool(modelId, override) {
11339
10960
  });
11340
10961
  const maxResults = max_results ?? 3;
11341
10962
  const controller = new AbortController();
11342
- const credential = await resolveGatewayCredential();
11343
- const provider = createGatewayProvider({ apiKey: credential.token });
11344
- const results = parseSearchResults((await withSpan(`chat ${modelId}`, "gen_ai.chat", {}, async (setSpanAttributes) => {
11345
- const response = await withTimeout(generateText({
11346
- model: provider.chat(modelId),
11347
- prompt: query,
11348
- tools: { [SEARCH_TOOL_NAME]: provider.tools.parallelSearch({
11349
- mode: "agentic",
11350
- maxResults
11351
- }) },
11352
- toolChoice: {
11353
- type: "tool",
11354
- toolName: SEARCH_TOOL_NAME
11355
- },
11356
- abortSignal: controller.signal
11357
- }), SEARCH_TIMEOUT_MS, "webSearch", { onTimeout: () => controller.abort() });
11358
- setSpanAttributes({
11359
- "gen_ai.response.finish_reasons": [response.finishReason],
11360
- ...extractGenAiUsageAttributes(response.usage)
11361
- });
11362
- return response;
11363
- }, {
11364
- "gen_ai.provider.name": GEN_AI_PROVIDER_NAME,
11365
- "gen_ai.operation.name": "chat",
11366
- "gen_ai.request.model": modelId,
11367
- "server.address": GEN_AI_SERVER_ADDRESS,
11368
- "server.port": 443,
11369
- "gen_ai.provider.auth_mode": credential.mode
11370
- })).toolResults, maxResults);
10963
+ const { outputs } = await withTimeout(searchWeb({
10964
+ operation: "web_search",
10965
+ cost,
10966
+ modelId,
10967
+ query,
10968
+ maxResults,
10969
+ signal: controller.signal
10970
+ }), SEARCH_TIMEOUT_MS, "webSearch", { onTimeout: () => controller.abort() });
10971
+ const results = parseSearchResults(outputs, maxResults);
11371
10972
  return {
11372
10973
  model: modelId,
11373
10974
  query,
@@ -12416,6 +12017,7 @@ const CORE_TOOLS = {
12416
12017
  updatePlan: always(updatePlanToolDefinition),
12417
12018
  reportProgress: always(reportProgressToolDefinition),
12418
12019
  systemTime: always(systemTimeToolDefinition),
12020
+ submitFeedback: always(submitFeedbackToolDefinition),
12419
12021
  bash: always(bashToolDefinition),
12420
12022
  readFile: always(readFileToolDefinition),
12421
12023
  editFile: always(editFileToolDefinition),
@@ -12468,6 +12070,7 @@ const CORE_TOOLS = {
12468
12070
  loadAttachment: RUN_BUILT,
12469
12071
  publishImage: RUN_BUILT,
12470
12072
  unpublishImage: RUN_BUILT,
12073
+ transcribeAudio: RUN_BUILT,
12471
12074
  spawnAgent: {
12472
12075
  when: hasAgents,
12473
12076
  definition: () => spawnAgentToolDefinition
@@ -13943,4 +13546,4 @@ async function runCacheWarmup(message) {
13943
13546
  }, startedAtMs, warm);
13944
13547
  }, attributes);
13945
13548
  }
13946
- export { createStopAgentTool as $, renderAttachmentText as $n, automationToolContext as $r, markAgentInvocationParentMailboxAppended as $t, createWebSearchTool as A, resolveTaskOutcomes as Ai, PARENT_AGENT_TARGET as An, positiveInteger$1 as Ar, verifyAttachmentUploads as At, createStopWatchingResourcesTool as B, isAttemptInterrupt as Bn, automationIdForToolCall as Br, listOwnedWatches as Bt, incrementStat as C, requireAutomationTaskText as Ci, createAgentInvocationForMessage as Cn, joinPublicChannel as Cr, createConversationId as Ct, requireReadyWorkspaceSnapshot as D, missingAutomationSkillReason as Di, AgentMessageTargetError as Dn, createSlackCanvasEditTool as Dr, AttachmentUploadError as Dt, processWorkspaceSnapshotJob as E, findAutomationSkill as Ei, AgentMessagePausedError as En, createSlackCanvasReadTool as Er, resolveConversationDestination as Et, userLookupIdentityProviders as F, NO_REPLY_GAP_MS as Fi, wakeAuthorizedTurn as Fn, createRunAutomationNowTool as Fr, storeAttachment as Ft, createReadFileTool as G, AgentRunError as Gn, automationTriggerSchema as Gr, getActiveAgentInvocationForConversation as Gt, createSearchConversationEventsTool as H, createWebAuthorization as Hn, automationToolResult as Hr, listUnreportedSiblingAgents as Ht, lookupSlackBot as I, gapSegment as Ii, wakePausedTurn as In, createDeleteAutomationTool as Ir, storeAttachments as It, capToolResult as J, setConversationSubscription as Jn, triggerKind as Jr, getLatestAgentInvocationForConversation as Jt, missingFileResult as K, executeTurn as Kn, editedAutomationTask as Kr, getAgentInvocation as Kt, lookupSlackUserProfile as L, getTurnAuthorization as Ln, AUTOMATIONS_TOOL_SOURCE as Lr, createReadConversationEventTool as Lt, createWatchTimerTool as M, IDLE_HORIZON_MS as Mi, supersedeTurnForInput as Mn, createOperationKey as Mr, collectAttachmentGarbage as Mt, createWatchEventsTool as N, MINUTE_MS$1 as Ni, createPausedTurns as Nn, createCanvas as Nr, readLiveAttachment as Nt, prepareWorkspaceSnapshot as O, effectiveTaskOutcomes as Oi, findChildAgentConversationId as On, SLACK_TOOL_SOURCE as Or, collectAttachmentUploadGarbage as Ot, createUserLookupTool as P, MIN_WARMUP_PREFIX_TOKENS as Pi, getPausedTurnRequest as Pn, createSearchAutomationsTool as Pr, requestAttachmentDeletion as Pt, createUpdatePlanTool as Q, createSlackThreadReadTool as Qn, getConversationAccess as Qr, listPendingAgentInvocationResults as Qt, createUpdateUserCustomizationTool as R, canJoinTurn as Rn, zodTool as Rr, createRunOperatorSqlTool as Rt, createWorkspaceTools as S, requireEventAutomationTrigger as Si, recordSubagentEnded as Sn, isPublicSlackChannel as Sr, createAndEnqueueConversation as St, ensureWorkspaceSnapshotBuild as T, requireAutomationSkill as Ti, AgentDepthLimitError as Tn, createSlackCanvasWriteTool as Tr, webActorFromUser as Tt, createSearchConversationsTool as U, deleteWebAuthorization as Un, automationToolResultSchema as Ur, NON_TERMINAL_AGENT_INVOCATION_STATUSES as Ut, createSearchEventTypesTool as V, selectAttemptMessages as Vn, automationSkillToolSchema as Vr, listChildAgents as Vt, createWriteFileTool as W, getWebAuthorization as Wn, automationTriggerChangesSchema as Wr, TERMINAL_AGENT_INVOCATION_STATUSES as Wt, editFile as X, jsonResponse as Xn, juniorToolOutputSchema as Xr, listAgentInvocationsForConversation as Xt, createEditFileTool as Y, emptyResponse as Yn, injectContinuationToolName as Yr, isTerminalAgentInvocation as Yt, createBashTool as Z, throwApiError as Zn, makeStructuredToolOutput as Zr, listPendingAgentInvocationMailboxAppends as Zt, closeBreaker as _, readViewerAutomationVersions as _i, dropOwnUnreadLoopReplies as _n, checkSlackChannelReadAccess as _r, renderReviewItemMessage as _t, createCacheWarmingRecorder as a, activateViewerAutomationVersion as ai, routeChildInput as an, createSlackListCreateTool as ar, createNoReplyTool as at, coreToolSlots as b, editEventAutomation as bi, cancelSignInWait as bn, getConversationInfo as br, appendAndEnqueueWebMessage as bt, isConversationWorkDone as c, changeViewerAutomationLifecycle as ci, logDroppedParentMessage as cn, createSlackConversationSearchChannelPort as cr, readLastUserMessageAtByConversation as ct, addHistoryPeriod as d, updateViewerAutomation as di, createAgentInvocationWorker as dn, readSlackRawMessageContext as dr, markConversationRead as dt, automationToolsDisabledReason as ei, reportReplacedWithoutOpenWork as en, renderBlockText as er, createSpawnAgentTool as et, firstLiveSavingsDate as f, ViewerTaskNotFoundError as fi, createAndEnqueueAgentInvocation as fn, resolveSlackChannelIdFromMessage as fr, reportConversationRead as ft, breakerStates as g, readViewerAutomationSummary as gi, resolveAgentInvocationId as gn, slackChannelRefParam as gr, deliverReviewItemChange as gt, savingsTotals as h, readViewerAutomationRuns as hi, enqueueAgentInvocation as hn, resolveSlackChannelRef as hr, createUpdateReviewItemTool as ht, GLOBAL_GAPS_TTL_MS as i, requireToolDestination as ii, readChildConversationSender as in, createSlackListGetItemsTool as ir, createReplyTool as it, createWebFetchTool as j, countOwnedAutomationsNeedingAttention as ji, supersedeOpenMailboxTurns as jn, resolveWorkspacePath as jr, writeAttachmentUpload as jt, ingestEvent as k, moveTaskOutcomes as ki, getAgentBinding as kn, isMissingPathError as kr, createAttachmentUpload as kt, listConversationWork as l, deleteViewerTask as li, parentMessageText as ln, createSlackChannelListMessagesTool as lr, archiveConversation as lt, replaceHistorySavings as m, readViewerAutomationExecutions as mi, endAgentInvocationsOfStoppedWork as mn, createSlackChannelJoinTool as mr, createSearchReviewItemsTool as mt, CONVERSATION_STATE_TTL_MS as n, requireToolCaller as ni, childAgentInput as nn, createSlackPublicSearchTool as nr, createReportProgressTool as nt, segmentGapsKey as o, automationEditor as oi, childAgentTurnOptions as on, createSlackListAddItemsTool as or, createMessageAgentTool as ot, idlePeriodSavings as p, readConversationSourceTask as pi, endActiveAgentInvocations as pn, resolveSlackChannelIdFromThreadId as pr, createAddReviewItemTool as pt, sliceFileContent as q, createSetConversationSubscriptionTool as qn, newAutomationTask as qr, getChildAgentLabel as qt, GLOBAL_GAPS_MAX as r, requireToolCreator as ri, getChildAgentInputSender as rn, createSlackListUpdateItemTool as rr, createReportBlockedTool as rt, warmup_exports as s, changeAutomationLifecycle as si, isParentMessageMeta as sn, createSlackConversationMessageSearchTool as sr, createArchiveAgentTool as st, ANSWER_TOOL_ENDINGS as t, requireToolAutomation as ti, sendsResultToParent as tn, parseSlackMessageReference as tr, createListAgentsTool as tt, SAVINGS_NAMESPACE as u, readViewerAutomationEdit as ui, readParentMessage as un, parseSlackThreadId as ur, conversationReadPositionQuery as ut, connectedState as v, readViewerAutomations as vi, stopChildAgentsBelow as vn, joinPublicChannelForRead as vr, reviewItemChangeRecord as vt, readStats as w, AutomationEditError as wi, createAgentInvocationFromLatest as wn, listThreadReplies as wr, recordWebConversationActivity as wt, enabledMode as x, changedEventMatch as xi, completeCancelledConversationTurn as xn, isConversationMember as xr, conversationTurnIdForMessage as xt, providerCacheTtlMs as y, editScheduledAutomation as yi, stopChildAgentsOf as yn, getChannelMessage as yr, acceptsWebMessages as yt, createSystemTimeTool as z, canShareTurn as zn, zodToolDefinition as zr, createListWatchesTool as zt };
13549
+ export { createBashTool as $, createSlackPublicSearchTool as $n, requireToolCreator as $r, childAgentInput as $t, createWebSearchTool as A, MIN_WARMUP_PREFIX_TOKENS as Ai, createPausedTurns as An, createSearchAutomationsTool as Ar, collectAttachmentUploadGarbage as At, createSystemTimeTool as B, deleteWebAuthorization as Bn, automationTriggerChangesSchema as Br, NON_TERMINAL_AGENT_INVOCATION_STATUSES as Bt, incrementStat as C, missingAutomationSkillReason as Ci, AgentMessagePausedError as Cn, createSlackCanvasEditTool as Cr, conversationTurnIdForMessage as Ct, requireReadyWorkspaceSnapshot as D, countOwnedAutomationsNeedingAttention as Di, PARENT_AGENT_TARGET as Dn, resolveWorkspacePath as Dr, webActorFromUser as Dt, processWorkspaceSnapshotJob as E, resolveTaskOutcomes as Ei, getAgentBinding as En, positiveInteger$1 as Er, recordWebConversationActivity as Et, userLookupIdentityProviders as F, canJoinTurn as Fn, zodToolDefinition as Fr, createRunOperatorSqlTool as Ft, createWriteFileTool as G, setConversationSubscription as Gn, injectContinuationToolName as Gr, getLatestAgentInvocationForConversation as Gt, createSearchEventTypesTool as H, AgentRunError as Hn, editedAutomationTask as Hr, getActiveAgentInvocationForConversation as Ht, lookupSlackBot as I, canShareTurn as In, automationIdForToolCall as Ir, createListWatchesTool as It, sliceFileContent as J, throwApiError as Jn, getConversationAccess as Jr, listPendingAgentInvocationMailboxAppends as Jt, createReadFileTool as K, emptyResponse as Kn, juniorToolOutputSchema as Kr, isTerminalAgentInvocation as Kt, lookupSlackUserProfile as L, isAttemptInterrupt as Ln, automationSkillToolSchema as Lr, listOwnedWatches as Lt, createWatchTimerTool as M, gapSegment as Mi, wakeAuthorizedTurn as Mn, createDeleteAutomationTool as Mr, verifyAttachmentUploads as Mt, createWatchEventsTool as N, wakePausedTurn as Nn, AUTOMATIONS_TOOL_SOURCE as Nr, writeAttachmentUpload as Nt, prepareWorkspaceSnapshot as O, IDLE_HORIZON_MS as Oi, supersedeOpenMailboxTurns as On, createOperationKey as Or, resolveConversationDestination as Ot, createUserLookupTool as P, getTurnAuthorization as Pn, zodTool as Pr, createReadConversationEventTool as Pt, editFile as Q, parseSlackMessageReference as Qn, requireToolCaller as Qr, sendsResultToParent as Qt, createUpdateUserCustomizationTool as R, selectAttemptMessages as Rn, automationToolResult as Rr, listChildAgents as Rt, createWorkspaceTools as S, findAutomationSkill as Si, AgentDepthLimitError as Sn, createSlackCanvasReadTool as Sr, appendAndEnqueueWebMessage as St, ensureWorkspaceSnapshotBuild as T, moveTaskOutcomes as Ti, findChildAgentConversationId as Tn, isMissingPathError as Tr, createConversationId as Tt, createSearchConversationEventsTool as U, executeTurn as Un, newAutomationTask as Ur, getAgentInvocation as Ut, createStopWatchingResourcesTool as V, getWebAuthorization as Vn, automationTriggerSchema as Vr, TERMINAL_AGENT_INVOCATION_STATUSES as Vt, createSearchConversationsTool as W, createSetConversationSubscriptionTool as Wn, triggerKind as Wr, getChildAgentLabel as Wt, capToolResult as X, renderAttachmentText as Xn, automationToolsDisabledReason as Xr, markAgentInvocationParentMailboxAppended as Xt, TOOL_RESULT_MAX_CHARS as Y, createSlackThreadReadTool as Yn, automationToolContext as Yr, listPendingAgentInvocationResults as Yt, createEditFileTool as Z, renderBlockText as Zn, requireToolAutomation as Zr, reportReplacedWithoutOpenWork as Zt, closeBreaker as _, changedEventMatch as _i, cancelSignInWait as _n, isConversationMember as _r, createUpdateReviewItemTool as _t, createCacheWarmingRecorder as a, deleteViewerTask as ai, logDroppedParentMessage as an, createSlackConversationSearchChannelPort as ar, createReportBlockedTool as at, coreToolSlots as b, AutomationEditError as bi, createAgentInvocationForMessage as bn, listThreadReplies as br, reviewItemChangeRecord as bt, isConversationWorkDone as c, ViewerTaskNotFoundError as ci, createAgentInvocationWorker as cn, readSlackRawMessageContext as cr, createMessageAgentTool as ct, addHistoryPeriod as d, readViewerAutomationRuns as di, endAgentInvocationsOfStoppedWork as dn, resolveSlackChannelRef as dr, archiveConversation as dt, requireToolDestination as ei, getChildAgentInputSender as en, createSlackListUpdateItemTool as er, createUpdatePlanTool as et, firstLiveSavingsDate as f, readViewerAutomationSummary as fi, enqueueAgentInvocation as fn, slackChannelRefParam as fr, conversationReadPositionQuery as ft, breakerStates as g, editEventAutomation as gi, stopChildAgentsOf as gn, getConversationInfo as gr, createSearchReviewItemsTool as gt, savingsTotals as h, editScheduledAutomation as hi, stopChildAgentsBelow as hn, getChannelMessage as hr, createAddReviewItemTool as ht, GLOBAL_GAPS_TTL_MS as i, changeViewerAutomationLifecycle as ii, isParentMessageMeta as in, createSlackConversationMessageSearchTool as ir, createReportProgressTool as it, createWebFetchTool as j, NO_REPLY_GAP_MS as ji, getPausedTurnRequest as jn, createRunAutomationNowTool as jr, createAttachmentUpload as jt, ingestEvent as k, MINUTE_MS$1 as ki, supersedeTurnForInput as kn, createCanvas as kr, AttachmentUploadError as kt, listConversationWork as l, readConversationSourceTask as li, createAndEnqueueAgentInvocation as ln, resolveSlackChannelIdFromMessage as lr, createArchiveAgentTool as lt, replaceHistorySavings as m, readViewerAutomations as mi, dropOwnUnreadLoopReplies as mn, joinPublicChannelForRead as mr, reportConversationRead as mt, CONVERSATION_STATE_TTL_MS as n, automationEditor as ni, routeChildInput as nn, createSlackListCreateTool as nr, createSpawnAgentTool as nt, segmentGapsKey as o, readViewerAutomationEdit as oi, parentMessageText as on, createSlackChannelListMessagesTool as or, createReplyTool as ot, idlePeriodSavings as p, readViewerAutomationVersions as pi, resolveAgentInvocationId as pn, checkSlackChannelReadAccess as pr, markConversationRead as pt, missingFileResult as q, jsonResponse as qn, makeStructuredToolOutput as qr, listAgentInvocationsForConversation as qt, GLOBAL_GAPS_MAX as r, changeAutomationLifecycle as ri, childAgentTurnOptions as rn, createSlackListAddItemsTool as rr, createListAgentsTool as rt, warmup_exports as s, updateViewerAutomation as si, readParentMessage as sn, parseSlackThreadId as sr, createNoReplyTool as st, ANSWER_TOOL_ENDINGS as t, activateViewerAutomationVersion as ti, readChildConversationSender as tn, createSlackListGetItemsTool as tr, createStopAgentTool as tt, SAVINGS_NAMESPACE as u, readViewerAutomationExecutions as ui, endActiveAgentInvocations as un, createSlackChannelJoinTool as ur, readLastUserMessageAtByConversation as ut, connectedState as v, requireEventAutomationTrigger as vi, completeCancelledConversationTurn as vn, isPublicSlackChannel as vr, deliverReviewItemChange as vt, readStats as w, effectiveTaskOutcomes as wi, AgentMessageTargetError as wn, SLACK_TOOL_SOURCE as wr, createAndEnqueueConversation as wt, enabledMode as x, requireAutomationSkill as xi, createAgentInvocationFromLatest as xn, createSlackCanvasWriteTool as xr, acceptsWebMessages as xt, providerCacheTtlMs as y, requireAutomationTaskText as yi, recordSubagentEnded as yn, joinPublicChannel as yr, renderReviewItemMessage as yt, createSubmitFeedbackTool as z, createWebAuthorization as zn, automationToolResultSchema as zr, listUnreportedSiblingAgents as zt };