@sentry/junior 0.318.0 → 0.320.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 (94) hide show
  1. package/dist/{context-BKF_5zzI.js → adapter-DlLLoJKj.js} +537 -537
  2. package/dist/{admin-UOHix_5P.js → admin-BzRXDVfh.js} +1 -1
  3. package/dist/{agent-runner-DeYymwh2.js → agent-DxZ7nHfD.js} +19866 -6720
  4. package/dist/{agent-status-BA5x3Xtp.js → agent-status-Bq_AIpyp.js} +105 -1
  5. package/dist/{agent-update-delivery-DH8bx7jU.js → agent-update-delivery-CO4FU5Gg.js} +4 -5
  6. package/dist/api/schema.d.ts +45 -23
  7. package/dist/api/schema.js +4 -4
  8. package/dist/api.js +79 -84
  9. package/dist/{app-DKAOuaoC.d.ts → app-CHCFIIDu.d.ts} +5 -4
  10. package/dist/app.d.ts +2 -2
  11. package/dist/app.js +119 -194
  12. package/dist/{change-record-BzJgLsv7.d.ts → change-record-K-KsqNhT.d.ts} +9 -5
  13. package/dist/{channel-access-A0de5lRv.js → channel-access-BghWqlXx.js} +1 -1
  14. package/dist/{chat-core-engine-D3Wd7f5n.js → chat-core-engine-BgfSLrDu.js} +31 -14
  15. package/dist/cli/chat.d.ts +1 -1
  16. package/dist/cli/chat.js +23 -23
  17. package/dist/cli/check.js +5 -5
  18. package/dist/cli/main.js +2 -2
  19. package/dist/cli/plugins.d.ts +1 -1
  20. package/dist/cli/plugins.js +8 -8
  21. package/dist/cli/snapshot-create.js +5 -5
  22. package/dist/cli/upgrade.d.ts +1 -1
  23. package/dist/cli/upgrade.js +3 -4
  24. package/dist/{continue-in-slack-YxwMQVeR.js → continue-in-slack-DBlQP4PC.js} +3 -3
  25. package/dist/{conversation-feed-Cj7IuBtM.js → conversation-feed-DEUdD7mb.js} +2 -106
  26. package/dist/{conversation-privacy-Cr_dNW1p.js → conversation-privacy-qoh95v90.js} +1 -1
  27. package/dist/{create-Btl1y1rq.js → create-jZSaDrCR.js} +115 -5
  28. package/dist/{credential-sync-DTarZ63K.js → credential-sync-Bj9-UlNE.js} +15 -18
  29. package/dist/{db-of6e3sGt.js → db-BacvswT0.js} +4602 -727
  30. package/dist/{deployment-C0qXa0FD.js → deployment-BoJkRPDt.js} +3 -3
  31. package/dist/{engine-context-C_QL_bMQ.js → engine-context-Bi3Ync5t.js} +521 -150
  32. package/dist/{html-9_pS9SjY.js → html-DW0pw5Pr.js} +6 -8
  33. package/dist/instrumentation.js +7 -23
  34. package/dist/list-Dz3CdP3g.js +5016 -0
  35. package/dist/{logging-BnOG0qz2.js → logging-DsTnMqyi.js} +8 -33
  36. package/dist/{mailbox-turn-Byrry9o1.js → markers-C33gNYNE.js} +1705 -1284
  37. package/dist/nitro.d.ts +2 -2
  38. package/dist/nitro.js +6 -7
  39. package/dist/{oauth-callback-server-CjnnUr4o.js → oauth-callback-server-C-pEhAQK.js} +2 -2
  40. package/dist/{oauth-relay-BvHFH0fV.js → oauth-relay-DIXdH-io.js} +1 -1
  41. package/dist/{plugins-fBrz8PCV.d.ts → plugins-DhGXZjlu.d.ts} +1 -0
  42. package/dist/{profile-iHw1uu32.js → profile-v9vA3RvH.js} +16 -18
  43. package/dist/{prompt-DEkStuxG.js → prompt-C5CW2wKO.js} +1 -1
  44. package/dist/{reports-C1d9azyV.js → reports-eBgrhPXS.js} +2 -2
  45. package/dist/{resolve-DC6zBuDV.js → resolve-HVXmbeCr.js} +5 -5
  46. package/dist/{result-DxewDuXb.js → result-BPNzgeTl.js} +20 -9
  47. package/dist/{runner-99YxVN_r.js → runner-aNSDTST6.js} +7 -8
  48. package/dist/{sandbox-egress-signals-CgoX5CTI.js → sandbox-egress-signals-nzp9Ykf7.js} +1 -1
  49. package/dist/{schema-BTojNBr5.js → schema-BlTO5M1d.js} +16 -8
  50. package/dist/{service-account-YDCPSByj.js → service-account-DWIf1t6p.js} +4 -5
  51. package/dist/{skills-CleC0Hze.js → skills-50izzzdK.js} +9 -9
  52. package/dist/{slack-conversation-unfurl-BNQLC12R.js → slack-conversation-unfurl-C6jXhVYg.js} +7 -7
  53. package/dist/storage-BtCxXiNt.js +273 -0
  54. package/dist/{system-prompt-table-Ci6Ck4gk.js → system-prompt-table-CIR1B44Z.js} +27 -85
  55. package/dist/topic-B2EWKKBT.js +6 -0
  56. package/dist/{package-discovery-DD9vencX.js → topics-DxuKurCX.js} +21 -1
  57. package/dist/{types-DCzTAA63.js → types-BNHkJrOP.js} +25 -11
  58. package/dist/{users-Cb9c1k9q.js → users-DOVo9sdU.js} +1 -1
  59. package/dist/{validation-BiUmWPhy.js → validation-CK0vuEHB.js} +4 -4
  60. package/dist/{version-VEXiEcZu.js → version-BuLVNlxB.js} +1 -1
  61. package/dist/version.js +1 -1
  62. package/dist/{worker-ChWYQdhm.js → worker-C82kHU1R.js} +4 -4
  63. package/migrations/20261127052408_space_name_nullable/migration.sql +5 -0
  64. package/migrations/20261127052408_space_name_nullable/snapshot.json +29 -0
  65. package/migrations/20261127060000_annotation_object_id_index/migration.sql +1 -0
  66. package/migrations/20261127060000_annotation_object_id_index/snapshot.json +69 -0
  67. package/migrations/20261127060001_annotation_subjects/migration.sql +78 -0
  68. package/migrations/20261127060001_annotation_subjects/snapshot.json +104 -0
  69. package/migrations/20261127060002_annotation_subject_index/migration.sql +1 -0
  70. package/migrations/20261127060002_annotation_subject_index/snapshot.json +70 -0
  71. package/migrations/20261127060003_annotation_title_url/migration.sql +84 -0
  72. package/migrations/20261127060003_annotation_title_url/snapshot.json +73 -0
  73. package/migrations/20261127150242_drop_space_members/migration.sql +9 -0
  74. package/migrations/20261127150242_drop_space_members/snapshot.json +53 -0
  75. package/package.json +9 -7
  76. package/dist/auth-pause-state-f9hJM_zO.js +0 -113
  77. package/dist/catalog-runtime-BfdAnztW.js +0 -6
  78. package/dist/child-message-peFWLcCZ.js +0 -15
  79. package/dist/conversation-turn-Bru4w_FD.js +0 -1250
  80. package/dist/job-runner-B2XEvpif.js +0 -1505
  81. package/dist/lineage-nh4z9iQN.js +0 -36
  82. package/dist/list-HRP3TIRl.js +0 -12631
  83. package/dist/markers-CTTtJqYn.js +0 -342
  84. package/dist/message-BRUuLgrY.js +0 -153
  85. package/dist/model-input-CFC62mf-.js +0 -82
  86. package/dist/registry-Cl7Labpe.js +0 -3279
  87. package/dist/run-conversation-Cz2ubZK-.js +0 -337
  88. package/dist/sender-actors-77zTQbSG.js +0 -84
  89. package/dist/spawn-DuZfodPa.js +0 -45
  90. package/dist/task-runner-BJ9Up3bG.js +0 -1529
  91. package/dist/topic-CRYYBYp-.js +0 -7
  92. package/dist/topics-BoCkoPJJ.js +0 -21
  93. package/dist/turn-membership-VT7XZh-L.js +0 -856
  94. package/dist/turn-wake-C7HeLHAM.js +0 -151
package/dist/api.js CHANGED
@@ -1,35 +1,30 @@
1
- import { d as readLiveAttachment, o as readSlackAttachmentSource, y as getAttachmentStorage } from "./turn-membership-VT7XZh-L.js";
2
- import { $c as snoozeTimerTrigger, $d as juniorConversationParticipants, Aa as AutomationConflictError, Ac as inboxItemTitle, B as conversationRangeColumns, Bc as readAvatarFetch, Bd as questionSearchDocument, Bt as setTodoStatusByUser, Cl as rankSearchMatches, Cs as listPushSubscriptions, Ct as getPlugins, Dd as listedConversation, Ds as isPausedBySlack, Du as completeText, Er as readableSlackTeamId, Es as savePushSubscription, Fc as subjectKindPlugin, Fd as juniorTodos, Fu as readServedProviders, G as conversationTurnFailedSql, Gc as clearInboxWakeReasons, Gs as findUserByEmail, H as conversationIsActiveSql, Hd as automationFuzzyTitle, Hi as createPluginEmbedder, Ic as subjectTodo, Id as todoFuzzyTitle, Iu as saveEnabledProviders, J as conversationKindFromRow, Jc as inboxItemSnoozedBy, Jd as juniorInboxItemConversations, Jo as subjectKey, Ka as microUsdSql, Kd as inboxItemFuzzyTitle, Ko as codeChangeSubjectProvider, Ld as todoSearchDocument, Lu as cacheKeyPrefix, Mc as INBOX_SUBJECT_KINDS, Mi as formatSlackLink, Nc as questionLinks, Nr as getVercelConversationWorkQueue, Od as notLeadConversation, Ot as apiRoutePrefix, Pc as subjectKindLabel, Pu as readEnabledProviders, Q as canActOnInboxItem, Qc as snoozeInboxItems, Qo as canPauseConversationDelivery, Qs as updateViewerDisplayName, Rc as identityAvatarUrl, Rd as juniorQuestions, Rn as createInboxItemShow, Ru as createCache, Sf as juniorDestinations, Sl as prefixRank, Sr as createConversationAccessReader, Ss as deletePushSubscription, Tc as searchInboxItems, Td as rootSpaceIdSql, Ts as saveNotificationSchedule, Ua as readAutomationTitlesByConversationId, Ud as automationSearchDocument, V as conversationUsageCostExpr, Vc as readUserAvatarUrls, Vd as juniorAutomationRuns, W as conversationStatusSql, Wd as juniorAutomations, Xc as readViewerInboxSnoozes, Xo as codeRepositoryUrl, Xr as runWithSlackInstallation, Xs as resolveViewerUser, Ya as usdToMicroUsdUnbiased, Yd as juniorInboxItems, Yo as codeChangeUrl, Ys as readViewerAvatarUrl, Zc as settleInboxSnoozes, Zd as juniorAgentBindings, Zl as eventWatchUnavailable, Zo as linkedCodeProviders, _l as searchTypedMemories, a as getDb, al as getDashboardSettingsLink, at as inboxItemForUser, bc as getInboxItem, bf as slackPersonSearchDocument, bl as fuzzyRank, cf as codeChangeSearchDocument, dc as countInboxItemsNeedingUserBySubject, df as juniorCodeRepositories, dt as inboxItemVisibleTo, ea as createPluginCache, el as unsnoozeInboxRow, es as pauseConversationDelivery, et as canAnswerInboxItem, fc as inboxItemsNeedingUserVersionQuery, fl as REVALIDATED_READ_PATHS, fs as isPublicConversation, gl as memoryDb, gs as resolveNotificationTimezone, gt as itemNeedsUser, hf as juniorConversations, hl as revalidateContent, hs as sendPushNotificationToUser, i as getConversationStore, if as juniorConversationEvents, il as getDashboardPersonLink, is as listConversationAnnotations, jc as itemQuestion, ji as escapeSlackMrkdwnText, jr as rootVisibleToViewer, kc as inboxItemRequest, kd as topLevelConversation, lf as codeRepositorySearchDocument, lt as inboxItemReaderForUser, ml as contentVersionHeaders, mn as steerWebPendingMessages, ms as readWebPushConfig, mt as isOnlyAssignee, nt as canUserReadInboxItem, o as getSqlExecutor, of as juniorApiTokens, pc as listWaitingConversations, pl as contentVersion, pt as isInboxItemForEveryone, qa as microUsdToUsd, qc as inboxItemInRow, qd as inboxItemSearchDocument, ql as automationEventCatalog, qo as readSubjectLinks, rf as juniorConversationMetrics, rs as createPluginAnnotations, so as getEventCatalog, tl as getDashboardConversationLink, ts as resumeConversationDelivery, uf as juniorCodeChanges, ut as inboxItemReaderForUserInConversation, vf as juniorIdentities, vl as parseTypedQuery, w as loadConversationSlackTenantIds, wc as ownerConversationId, wi as postSlackMessage, wl as scoredSearchMatches, wo as cancelWatch, wr as readConversationAccessFromSql, ws as readNotificationSchedule, wt as getRegistrations, xf as juniorUsers, xl as prefixMatch, yf as slackPersonPredicate, yl as fuzzyMatch, z as conversationAggregateColumns, zd as questionFuzzyTitle, zn as pushConversationInboxItemsNow, zt as listTodos } from "./db-of6e3sGt.js";
3
- import { T as withSpan, f as logException, g as runBestEffort, m as logWarn, p as logInfo, v as setSentryUser } from "./logging-BnOG0qz2.js";
4
- import { $t as AutomationEditError, Bt as deleteViewerTask, Et as throwApiError, G as reportConversationRead, Gt as collectionRowTitle, H as stopArchivedWork, Jt as readViewerAutomationRuns, Q as listOwnedWatches, Rt as activateViewerAutomationVersion, Tt as jsonResponse, Ut as updateViewerAutomation, V as setConversationArchive, Vt as readViewerAutomationEdit, Wt as ViewerTaskNotFoundError, Xt as readViewerAutomationVersions, Yt as readViewerAutomationSummary, Zt as readViewerAutomations, _t as createAttachmentUpload, at as readSpace, dn as addStats, fn as readStats, h as previewOriginBelongsTo, hn as connectedState, ht as AttachmentUploadError, in as SAVINGS_NAMESPACE, it as listSpaces, m as readAttachmentContent, mn as closeBreaker, nt as getSpaceLead, ot as updateSpace, p as AttachmentDownloadError, pn as breakerStates, pt as webActorFromUser, qt as readViewerAutomationExecutions, rn as viewerAutomationCollection, rt as createSpace, st as acceptsWebMessages, un as savingsTotals, wt as emptyResponse, xt as inviteToConversation, yt as writeAttachmentUpload, zt as changeViewerAutomationLifecycle } from "./agent-runner-DeYymwh2.js";
5
- import { At as spaceListQuerySchema, B as conversationDetailQuerySchema, C as automationScheduleIntentSchema, D as automationVersionActivateSchema, E as automationUpdateSchema, G as conversationParamsSchema, It as updateSpaceBodySchema, Kt as MAX_ATTACHMENT_BYTES, L as conversationAttachmentParamsSchema, Ln as apiErrorSchema, Mt as spaceParamsSchema, N as CONVERSATION_DETAIL_VERSION_HEADER, O as automationVersionListSchema, On as automationTaskText, Ot as archiveSpaceBodySchema, P as CONVERSATION_VERSION_HEADER, Pt as spaceSchema, R as conversationAttachmentQuerySchema, Rt as conversationReadPositionSchema, T as automationSummarySchema, U as conversationEventPageSchema, V as conversationDetailReportSchema, W as conversationEventsQuerySchema, _ as automationListQuerySchema, an as compileScheduleIntent, b as automationRunListSchema, c as automationEditSchema, fn as inboxItemQuestion, g as automationListPageSchema, in as ScheduleIntentError, jn as notificationScheduleSchema, jt as spaceListSchema, k as automationVersionParamsSchema, kt as createSpaceBodySchema, l as automationEventCatalogSchema, m as automationLifecycleSchema, o as isOpenTodoStatus, s as automationEditErrorSchema, u as automationExecutionListSchema, w as automationSchedulePreviewSchema, y as automationParamsSchema } from "./types-DCzTAA63.js";
6
- import { $ as userSearchQuerySchema, $t as conversationChildAgentsReportSchema, A as cacheHealthQuerySchema, At as startConnectionResponseSchema, B as serviceAccountParamsSchema, Bt as codeRepositoryQuerySchema, C as inboxSnoozeResourceQuerySchema, Ct as pushSubscriptionBodySchema, D as inboxSnoozeWakesClearSchema, Dt as connectionParamsSchema, E as inboxSnoozeSubjectSchema, Et as connectionListSchema, F as cacheWarmingSavingsRefillResponseSchema, G as createPersonalTokenBodySchema, Gt as conversationTodoSchema, H as startServiceAccountSignInResponseSchema, I as cacheWarmingSavingsReportSchema, Jt as todoStatusBodySchema, K as createdPersonalTokenSchema, Kt as conversationTodosReportSchema, L as closeCacheWarmingBreakerResponseSchema, Lt as codeOverviewReportSchema, M as cacheWarmingBreakerListSchema, N as cacheWarmingBreakerParamsSchema, Nt as codeChangeSearchQuerySchema, O as gatewayProvidersSchema, P as cacheWarmingSavingsQuerySchema, Pt as codeChangeSearchReportSchema, R as disconnectServiceAccountResponseSchema, Rt as codePersonReportSchema, S as inboxSnoozeCreateSchema, St as notificationSettingsSchema, T as inboxSnoozeSchema, Tt as testNotificationResponseSchema, U as searchQuerySchema, Vt as codeRepositoryReportSchema, W as searchReportSchema, Wt as personCodeQuerySchema, X as revokePersonalTokenResponseSchema, Xt as conversationWatchesReportSchema, Y as personalTokenParamsSchema, Zt as watchParamsSchema, _ as inboxItemListSchema, _n as acceptedConversationMessageSchema, _t as locationParamsSchema, a as statsReportSchema, an as objectLinksQuerySchema, at as avatarParamsSchema, b as inboxItemWaitingConversationsSchema, bn as forkConversationBodySchema, bt as activitySixHours$1, c as workspaceBodySchema, ct as peopleSearchReportSchema, dn as conversationDeliveryResponseSchema, dt as personalSpendReportSchema, en as continueConversationInSlackBodySchema, et as userSearchReportSchema, f as workspaceSchema, fn as conversationCatchUpBodySchema, g as inboxItemListQuerySchema, gn as createAttachmentUploadBodySchema, gt as locationDirectoryReportSchema, h as inboxItemCountSchema, hn as attachmentUploadSchema, ht as locationDetailReportSchema, in as attachObjectLinkResponseSchema, it as actorProfileReportSchema, j as cacheHealthReportSchema, k as updateGatewayProvidersBodySchema, kt as disconnectConnectionResponseSchema, l as workspaceListSchema, ln as conversationOutlineSchema, lt as personCardReportSchema, m as inboxItemCountQuerySchema, mn as attachmentUploadParamsSchema, n as versionsQuerySchema, on as objectLinksReportSchema, p as inboxItemActionSchema, pn as conversationCatchUpSchema, pt as spaceConfigurationSchema, q as personalTokenListSchema, qt as todoParamsSchema, r as versionsSchema, rn as attachObjectLinkBodySchema, rt as actorDirectoryReportSchema, s as deleteWorkspaceResponseSchema, sn as conversationStatsReportSchema, st as peopleSearchQuerySchema, tn as continueConversationInSlackResponseSchema, u as workspaceParamsSchema, un as conversationDeliveryBodySchema, ut as personParamsSchema, v as inboxItemParamsSchema, vn as createConversationBodySchema, vt as activityDays$1, w as inboxSnoozeResourceSchema, wt as pushSubscriptionDeleteBodySchema, xn as forkConversationResponseSchema, y as inboxItemSchema, yn as createConversationMessageBodySchema, yt as activityHours$2, z as serviceAccountListSchema, zt as codeRepositoryParamsSchema } from "./schema-BTojNBr5.js";
7
- import { A as conversationUnchangedDetailWithMailboxSchema, B as runtimeInfoReportSchema, M as steerConversationPendingMessagesResponseSchema, N as healthReportSchema, P as pluginOperationalReportFeedSchema, T as conversationDetailWithMailboxReportSchema, U as skillReportsSchema, V as skillDetailReportSchema, _ as reorderPinnedConversationsBodySchema, a as conversationInviteResponseSchema, i as conversationInviteBodySchema, j as steerConversationPendingMessagesBodySchema, k as conversationPendingMessagesReportSchema, n as conversationFeedSchema, t as conversationFeedQuerySchema, v as reorderPinnedConversationsResponseSchema, z as pluginsSchema } from "./conversation-feed-Cj7IuBtM.js";
8
- import { Ht as createWorkspace, Jt as listWorkspacesByRepository, L as isAllowedDomain, Lt as readUserCustomization, Qt as workspaceRepoCheckoutPath, Rt as saveUserCustomization, Ut as deleteWorkspace, Wt as getWorkspace, Xt as WorkspaceValidationError, Yt as updateWorkspace, qt as listWorkspaces, rn as isExperimentalFeatureEnabled, tr as createPluginEgress, z as parseEmail, zt as addConversationNote } from "./mailbox-turn-Byrry9o1.js";
9
- import { A as setConversationSubscriptionOperation, C as cancelQueuedMessagesOperation, Ct as resolveObjectLinkNow, D as renameConversationOperation, E as pinConversationOperation, Et as guardedFetch, Gt as resolvePersonLink, J as resolveMentions, Jt as readFirstHumanMessageTexts, M as reorderPinnedConversations, N as apiOperationHandler, O as setConversationAutoArchiveOperation, Q as readInboxItemForUser, S as archiveDoneConversationsOperation, St as readObjectLinkTypes, T as leaveConversationOperation, Tt as viewerCanViewPluginLink, X as actOnInboxItem, Xt as IMAGE_WIDTHS, Y as InboxItemActionError, Yt as createViewerMcp, Zt as decodeImageId, _ as createConversationForViewer, a as resolveInboxItemSubjects, at as updateUserSettings, bt as OBJECT_LINK_TTL_MS, c as readConversationAuxiliaryCostsFromSql, d as conversationVersionsQuery, f as readConversationDetailEtag, g as appendConversationMessageForViewer, gt as startSavingsRefill, h as readConversationEvents, i as encodePageCursor, it as readUserSettings, j as stopConversationOperation, jt as getProductionSlackAdapter, k as setConversationSpaceOperation, l as childAgentTotalsReport, m as keepQuickQuestionForViewer, mt as readSavingsRefill, n as readConversationFeed, o as readConversationDetail, p as forkConversationForViewer, pt as scheduleInboxSnoozeTimer, q as requireConversationPendingMessages, qt as conversationSummaryFromStoredConversation, r as decodePageCursor, rt as DEFAULT_USER_SETTINGS, s as readConversationTreeStates, t as conversationFeedVersionQuery, u as readConversationTreeMetricsFromSql, v as requireWebMessageConversation, wt as resolveObjectLinks, x as archiveConversationOperation, xt as readLinkObjectType, yt as readHealthReport } from "./list-HRP3TIRl.js";
10
- import { a as transcriptEntriesFromReportEvents, d as reportParentAgentInput, o as readConversationEventPage } from "./task-runner-BJ9Up3bG.js";
11
- import { E as parseSlackChannelId, L as botConfig, O as parseSlackTeamId, R as getChatConfig, T as withLock, n as credentialContextForActor, y as getStateAdapter } from "./context-BKF_5zzI.js";
12
- import { i as listChildAgents } from "./markers-CTTtJqYn.js";
13
- import { i as continueConversationInSlack, r as canContinueInSlack, t as BUSY } from "./continue-in-slack-YxwMQVeR.js";
1
+ import { n as getAttachmentStorage } from "./storage-BtCxXiNt.js";
2
+ import { $ as canActOnInboxItem, $c as questionLinks, $f as topLevelConversation, $o as pauseConversationDelivery, Ac as countInboxItemsNeedingUserBySubject, Ap as juniorApiTokens, As as isPublicConversation, B as conversationAggregateColumns, Bd as disconnectServiceAccount, Bl as parseTypedQuery, Bs as deletePushSubscription, Bt as setTodoStatusByUser, Cp as juniorConversationParticipants, Dp as juniorConversationMetrics, Dr as createConversationAccessReader, El as getDashboardSettingsLink, Et as getRegistrations, Fa as AutomationConflictError, Fl as contentVersion, Fp as juniorCodeRepositories, G as conversationStatusSql, Gd as serviceAccountPlugins, Gl as rankSearchMatches, Gp as juniorUsers, Gs as isPausedBySlack, H as conversationUsageCostExpr, Hd as getServiceAccountStatus, Hl as fuzzyRank, Hp as juniorIdentities, Hs as readNotificationSchedule, Il as contentVersionHeaders, Ir as rootVisibleToViewer, Ja as readAutomationTitlesByConversationId, Jc as inboxItemRequest, K as conversationTurnFailedSql, Kd as startServiceAccountSignIn, Kl as scoredSearchMatches, Kp as juniorDestinations, Ll as revalidateContent, Mc as listWaitingConversations, Mp as codeChangeSearchDocument, Ms as readWebPushConfig, Np as codeRepositorySearchDocument, Ns as sendPushNotificationToUser, Op as juniorConversationEvents, Ot as apiRoutePrefix, Pd as getAppContext, Pl as REVALIDATED_READ_PATHS, Pp as juniorCodeChanges, Ps as resolveNotificationTimezone, Qa as microUsdToUsd, Qf as notLeadConversation, Rl as memoryDb, Rn as createInboxItemShow, Rr as getVercelConversationWorkQueue, Ss as upsertPluginAnnotation, Tl as getDashboardPersonLink, Tt as getPlugins, U as conversationIsActiveSql, Uc as ownerConversationId, Ul as prefixMatch, Up as slackPersonPredicate, Us as saveNotificationSchedule, V as conversationRangeColumns, Vd as finishServiceAccountSignIn, Vl as fuzzyMatch, Vs as listPushSubscriptions, Wc as searchInboxItems, Wl as prefixRank, Wp as slackPersonSearchDocument, Ws as savePushSubscription, Xc as itemQuestion, Y as conversationKindFromRow, Yc as inboxItemTitle, Yf as rootSpaceIdSql, Yu as completeText, Za as microUsdSql, Zc as INBOX_SUBJECT_KINDS, Zf as listedConversation, Zo as canPauseConversationDelivery, _c as updateViewerDisplayName, _l as readViewerInboxSnoozes, _p as inboxItemSearchDocument, _t as itemNeedsUser, a as getDb, aa as createPluginCache, ad as cacheKeyPrefix, al as identityAvatarUrl, ap as juniorTodos, as as codeChangeSubjectProvider, bl as snoozeTimerTrigger, cl as readUserAvatarUrls, cp as juniorQuestions, cs as codeChangeUrl, dp as juniorAutomationRuns, dt as inboxItemReaderForUserInConversation, el as subjectKindDismissNote, eo as usdToMicroUsdUnbiased, es as resumeConversationDelivery, fl as clearInboxWakeReasons, fo as getEventCatalog, fp as automationFuzzyTitle, ft as inboxItemVisibleTo, gp as inboxItemFuzzyTitle, gs as annotationSubject, hc as resolveViewerUser, hl as inboxItemSnoozedBy, ht as isOnlyAssignee, hu as automationEventCatalog, i as getConversationStore, id as saveEnabledProviders, is as codeChangeSubjectKinds, jc as inboxItemsNeedingUserVersionQuery, jr as readableSlackTeamId, ko as cancelWatch, kr as readConversationAccessFromSql, lc as findUserByEmail, lp as questionFuzzyTitle, ls as codeRepositoryUrl, mc as readViewerAvatarUrl, mf as webActorUserIds, ml as inboxItemInRow, mn as steerWebPendingMessages, mp as juniorAutomations, ms as ANNOTATION_SUBJECT_KINDS, mt as isInboxItemForEveryone, nd as readEnabledProviders, nl as subjectKindPlugin, o as getSqlExecutor, od as createCache, op as todoFuzzyTitle, os as readSubjectLinks, pp as automationSearchDocument, qi as createPluginEmbedder, rd as readServedProviders, rl as subjectTodo, rt as canUserReadInboxItem, sl as readAvatarFetch, sp as todoSearchDocument, ss as subjectKey, st as inboxItemForUser, ti as runWithSlackInstallation, tl as subjectKindLabel, tt as canAnswerInboxItem, up as questionSearchDocument, us as linkedCodeProviders, ut as inboxItemReaderForUser, vl as settleInboxSnoozes, vp as juniorInboxItemConversations, vr as hasAssigneeRoles, w as loadConversationSlackTenantIds, xl as unsnoozeInboxRow, xp as juniorAgentBindings, yl as snoozeInboxItems, yp as juniorInboxItems, ys as listConversationAnnotations, yu as eventWatchUnavailable, zc as getInboxItem, zl as searchTypedMemories, zn as pushConversationInboxItemsNow, zp as juniorConversations, zt as listTodos } from "./db-BacvswT0.js";
3
+ import { T as withSpan, f as logException, g as runBestEffort, m as logWarn, p as logInfo, v as setSentryUser } from "./logging-DsTnMqyi.js";
4
+ import { $n as updateViewerAutomation, $t as decodeImageId, At as resolveObjectLinkNow, B as listOwnedWatches, Cr as closeBreaker, Dn as createAttachmentUpload, Dt as OBJECT_LINK_TTL_MS, Fn as jsonResponse, G as getSpaceLead, I as reportConversationRead, In as throwApiError, J as getProductionSlackAdapter, Jn as activateViewerAutomationVersion, Kt as conversationSummaryFromStoredConversation, Ln as readSlackAttachmentSource, M as setConversationArchive, N as stopArchivedWork, Nt as viewerCanViewPluginLink, Ot as readLinkObjectType, Pn as emptyResponse, Pt as guardedFetch, Qt as IMAGE_WIDTHS, Rt as resolvePersonLink, Sr as breakerStates, Tn as AttachmentUploadError, Vn as readLiveAttachment, W as postSlackDetachNotice, Xn as deleteViewerTask, Xt as createViewerMcp, Yn as changeViewerAutomationLifecycle, Yt as readFirstHumanMessageTexts, Zn as readViewerAutomationEdit, _n as updateSpace, a as AttachmentDownloadError, ar as readViewerAutomationSummary, br as addStats, cr as AutomationEditError, dt as readConversationEventPage, er as ViewerTaskNotFoundError, fr as viewerAutomationCollection, gn as readSpace, gt as reportParentAgentInput, hn as listSpaces, ir as readViewerAutomationRuns, jn as inviteToConversation, jr as listSpaceConfiguration, jt as resolveObjectLinks, kn as writeAttachmentUpload, kt as readObjectLinkTypes, mn as createSpace, o as readAttachmentContent, or as readViewerAutomationVersions, pr as SAVINGS_NAMESPACE, rr as readViewerAutomationExecutions, s as previewOriginBelongsTo, sr as readViewerAutomations, tr as collectionRowTitle, ut as transcriptEntriesFromReportEvents, vn as acceptsWebMessages, wn as webActorFromUser, wr as connectedState, xr as readStats, yr as savingsTotals } from "./agent-DxZ7nHfD.js";
5
+ import { At as spaceListQuerySchema, B as conversationDetailQuerySchema, C as automationScheduleIntentSchema, D as automationVersionActivateSchema, E as automationUpdateSchema, G as conversationParamsSchema, It as updateSpaceBodySchema, L as conversationAttachmentParamsSchema, Mn as notificationScheduleSchema, Mt as spaceParamsSchema, N as CONVERSATION_DETAIL_VERSION_HEADER, O as automationVersionListSchema, Ot as archiveSpaceBodySchema, P as CONVERSATION_VERSION_HEADER, Pt as spaceSchema, R as conversationAttachmentQuerySchema, Rn as apiErrorSchema, Rt as conversationReadPositionSchema, T as automationSummarySchema, U as conversationEventPageSchema, V as conversationDetailReportSchema, W as conversationEventsQuerySchema, _ as automationListQuerySchema, an as ScheduleIntentError, b as automationRunListSchema, c as automationEditSchema, g as automationListPageSchema, jt as spaceListSchema, k as automationVersionParamsSchema, kn as automationTaskText, kt as createSpaceBodySchema, l as automationEventCatalogSchema, m as automationLifecycleSchema, o as isOpenTodoStatus, on as compileScheduleIntent, pn as inboxItemQuestion, qt as MAX_ATTACHMENT_BYTES, s as automationEditErrorSchema, u as automationExecutionListSchema, w as automationSchedulePreviewSchema, y as automationParamsSchema } from "./types-BNHkJrOP.js";
6
+ import { $ as userSearchQuerySchema, $t as conversationChildAgentsReportSchema, A as cacheHealthQuerySchema, At as startConnectionResponseSchema, B as serviceAccountParamsSchema, Bt as codeRepositoryQuerySchema, C as inboxSnoozeResourceQuerySchema, Ct as pushSubscriptionBodySchema, D as inboxSnoozeWakesClearSchema, Dt as connectionParamsSchema, E as inboxSnoozeSubjectSchema, Et as connectionListSchema, F as cacheWarmingSavingsRefillResponseSchema, G as createPersonalTokenBodySchema, Gt as conversationTodoSchema, H as startServiceAccountSignInResponseSchema, I as cacheWarmingSavingsReportSchema, Jt as todoStatusBodySchema, K as createdPersonalTokenSchema, Kt as conversationTodosReportSchema, L as closeCacheWarmingBreakerResponseSchema, Lt as codeOverviewReportSchema, M as cacheWarmingBreakerListSchema, N as cacheWarmingBreakerParamsSchema, Nt as codeChangeSearchQuerySchema, O as gatewayProvidersSchema, P as cacheWarmingSavingsQuerySchema, Pt as codeChangeSearchReportSchema, R as disconnectServiceAccountResponseSchema, Rt as codePersonReportSchema, S as inboxSnoozeCreateSchema, St as notificationSettingsSchema, T as inboxSnoozeSchema, Tt as testNotificationResponseSchema, U as searchQuerySchema, Vt as codeRepositoryReportSchema, W as searchReportSchema, Wt as personCodeQuerySchema, X as revokePersonalTokenResponseSchema, Xt as conversationWatchesReportSchema, Y as personalTokenParamsSchema, Zt as watchParamsSchema, _ as inboxItemListSchema, _n as acceptedConversationMessageSchema, _t as locationParamsSchema, a as statsReportSchema, an as objectLinksQuerySchema, at as avatarParamsSchema, b as inboxItemWaitingConversationsSchema, bn as forkConversationBodySchema, bt as activitySixHours$1, c as workspaceBodySchema, ct as peopleSearchReportSchema, dn as conversationDeliveryResponseSchema, dt as personalSpendReportSchema, en as continueConversationInSlackBodySchema, et as userSearchReportSchema, f as workspaceSchema, fn as conversationCatchUpBodySchema, g as inboxItemListQuerySchema, gn as createAttachmentUploadBodySchema, gt as locationDirectoryReportSchema, h as inboxItemCountSchema, hn as attachmentUploadSchema, ht as locationDetailReportSchema, in as attachObjectLinkResponseSchema, it as actorProfileReportSchema, j as cacheHealthReportSchema, k as updateGatewayProvidersBodySchema, kt as disconnectConnectionResponseSchema, l as workspaceListSchema, ln as conversationOutlineSchema, lt as personCardReportSchema, m as inboxItemCountQuerySchema, mn as attachmentUploadParamsSchema, n as versionsQuerySchema, on as objectLinksReportSchema, p as inboxItemActionSchema, pn as conversationCatchUpSchema, pt as spaceConfigurationSchema, q as personalTokenListSchema, qt as todoParamsSchema, r as versionsSchema, rn as attachObjectLinkBodySchema, rt as actorDirectoryReportSchema, s as deleteWorkspaceResponseSchema, sn as conversationStatsReportSchema, st as peopleSearchQuerySchema, tn as continueConversationInSlackResponseSchema, u as workspaceParamsSchema, un as conversationDeliveryBodySchema, ut as personParamsSchema, v as inboxItemParamsSchema, vn as createConversationBodySchema, vt as activityDays$1, w as inboxSnoozeResourceSchema, wt as pushSubscriptionDeleteBodySchema, xn as forkConversationResponseSchema, y as inboxItemSchema, yn as createConversationMessageBodySchema, yt as activityHours$2, z as serviceAccountListSchema, zt as codeRepositoryParamsSchema } from "./schema-BlTO5M1d.js";
7
+ import { A as conversationUnchangedDetailWithMailboxSchema, B as runtimeInfoReportSchema, M as steerConversationPendingMessagesResponseSchema, N as healthReportSchema, P as pluginOperationalReportFeedSchema, T as conversationDetailWithMailboxReportSchema, U as skillReportsSchema, V as skillDetailReportSchema, _ as reorderPinnedConversationsBodySchema, a as conversationInviteResponseSchema, i as conversationInviteBodySchema, j as steerConversationPendingMessagesBodySchema, k as conversationPendingMessagesReportSchema, n as conversationFeedSchema, t as conversationFeedQuerySchema, v as reorderPinnedConversationsResponseSchema, z as pluginsSchema } from "./conversation-feed-DEUdD7mb.js";
8
+ import { Mt as readUserCustomization, Nt as saveUserCustomization, Pt as addConversationNote, Xt as deleteWorkspace, Yt as createWorkspace, Zt as getWorkspace, an as workspaceRepoCheckoutPath, en as listWorkspaces, ht as parseEmail, i as listChildAgents, lr as createPluginEgress, nn as updateWorkspace, pt as isAllowedDomain, rn as WorkspaceValidationError, tn as listWorkspacesByRepository, un as isExperimentalFeatureEnabled } from "./markers-C33gNYNE.js";
9
+ import { A as setConversationSubscriptionOperation, C as cancelQueuedMessagesOperation, D as renameConversationOperation, E as pinConversationOperation, J as resolveMentions, M as reorderPinnedConversations, N as apiOperationHandler, O as setConversationAutoArchiveOperation, Q as readInboxItemForUser, S as archiveDoneConversationsOperation, T as leaveConversationOperation, X as actOnInboxItem, Y as InboxItemActionError, _ as createConversationForViewer, a as resolveInboxItemSubjects, at as updateUserSettings, c as readConversationAuxiliaryCostsFromSql, d as conversationVersionsQuery, f as readConversationDetailEtag, g as appendConversationMessageForViewer, gt as startSavingsRefill, h as readConversationEvents, i as encodePageCursor, it as readUserSettings, j as stopConversationOperation, k as setConversationSpaceOperation, l as childAgentTotalsReport, m as keepQuickQuestionForViewer, mt as readSavingsRefill, n as readConversationFeed, o as readConversationDetail, p as forkConversationForViewer, pt as scheduleInboxSnoozeTimer, q as requireConversationPendingMessages, r as decodePageCursor, rt as DEFAULT_USER_SETTINGS, s as readConversationTreeStates, t as conversationFeedVersionQuery, u as readConversationTreeMetricsFromSql, v as requireWebMessageConversation, x as archiveConversationOperation, yt as readHealthReport } from "./list-Dz3CdP3g.js";
10
+ import { E as parseSlackChannelId, L as botConfig, O as parseSlackTeamId, R as getChatConfig, f as credentialContextForActor, i as getStateAdapter, u as withLock } from "./adapter-DlLLoJKj.js";
11
+ import { i as continueConversationInSlack, r as canContinueInSlack, t as BUSY } from "./continue-in-slack-DBlQP4PC.js";
14
12
  import { a as INPUT_IMAGE_TYPES, i as INLINE_VIDEO_TYPES, n as userCustomizationSchema, o as detectImageMediaType } from "./user-customization-CvfuY9Eo.js";
15
13
  import { u as sentry_exports } from "./sentry-CPbZjomA.js";
16
- import { N as webActorUserIds, a as disconnectServiceAccount, d as startServiceAccountSignIn, o as finishServiceAccountSignIn, s as getServiceAccountStatus, u as serviceAccountPlugins } from "./registry-Cl7Labpe.js";
17
- import { a as fillUtcDays, c as startOfUtcHour, d as trailingUtcHourWindow, f as trailingUtcSixHourWindow, i as HOUR_MS$3, l as sumUtcHoursIntoSixHours, o as fillUtcHours, p as utcHourKey, r as DAY_MS$3, s as fillUtcSixHours, u as trailingUtcDayWindow } from "./agent-status-BA5x3Xtp.js";
18
- import { A as createUserTokenStore, n as hash, t as create, u as SANDBOX_RUNTIME } from "./profile-iHw1uu32.js";
19
- import { a as isConnectableProvider, c as startConnection, i as disconnectConnection, o as listConnections, t as escapeHtml, u as htmlCallbackResponse } from "./html-9_pS9SjY.js";
20
- import { G as mapBounded, h as createPluginLogger } from "./prompt-DEkStuxG.js";
21
- import { F as listSpaceConfiguration } from "./job-runner-B2XEvpif.js";
22
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BfdAnztW.js";
23
- import { o as getSandboxResources, t as getCachedSnapshot } from "./resolve-DC6zBuDV.js";
14
+ import { _ as utcHourKey, c as HOUR_MS$3, d as fillUtcSixHours, f as startOfUtcHour, g as trailingUtcSixHourWindow, h as trailingUtcHourWindow, l as fillUtcDays, m as trailingUtcDayWindow, p as sumUtcHoursIntoSixHours, s as DAY_MS$3, u as fillUtcHours } from "./agent-status-Bq_AIpyp.js";
15
+ import { A as createUserTokenStore, n as hash, t as create, u as SANDBOX_RUNTIME } from "./profile-v9vA3RvH.js";
16
+ import { a as isConnectableProvider, c as startConnection, i as disconnectConnection, o as listConnections, t as escapeHtml, u as htmlCallbackResponse } from "./html-DW0pw5Pr.js";
17
+ import { G as mapBounded, h as createPluginLogger } from "./prompt-C5CW2wKO.js";
18
+ import { o as getSandboxResources, t as getCachedSnapshot } from "./resolve-HVXmbeCr.js";
24
19
  import { Hono } from "hono";
25
20
  import * as z from "zod";
26
21
  import path from "node:path";
27
22
  import { and, asc, count as count$1, desc, eq, exists, gt, gte, inArray, isNotNull, isNull, like, lt, lte, ne, or, sql } from "drizzle-orm";
28
23
  import { alias, union } from "drizzle-orm/pg-core";
29
24
  import { normalizeEventIdentifier, objectPresentation, pluginUserPageContentSchema, pluginUserPageCursorSchema, pluginUserPageFilterSchema, pluginUserPageLinksSchema, pluginUserPageQuerySchema } from "@sentry/junior-plugin-api";
30
- import { createHash, randomBytes, randomUUID } from "node:crypto";
31
- import fs from "node:fs/promises";
32
25
  import { readFileSync } from "node:fs";
26
+ import { createHash, randomBytes, randomUUID } from "node:crypto";
27
+ import fs$1 from "node:fs/promises";
33
28
  import { HTTPException } from "hono/http-exception";
34
29
  import { bodyLimit } from "hono/body-limit";
35
30
  import { waitUntil } from "@vercel/functions";
@@ -69,16 +64,19 @@ async function attachObjectLink(viewer, conversationId, url) {
69
64
  key: `object_attached:${linkType.owner}:${object.key}`,
70
65
  text: [`${viewer.displayName ?? viewer.email} attached ${article} ${type} (${link}) to this Conversation.`, readTool ? `Read it live with \`${readTool}\` when the work needs its content.` : ""].filter(Boolean).join(" ")
71
66
  });
72
- await createPluginAnnotations({
67
+ await upsertPluginAnnotation(db, {
68
+ annotation: {
69
+ kind: "resource_link",
70
+ key: object.key,
71
+ objectType: object.objectType,
72
+ url: link
73
+ },
73
74
  conversationId,
74
- db,
75
- plugin: linkType.owner
76
- }).upsert({
77
- kind: "resource_link",
78
- key: object.key,
79
- label: link.slice(0, 256),
80
- objectType: object.objectType,
81
- url: link
75
+ plugin: linkType.owner,
76
+ subject: annotationSubject(linkType.owner, object) ?? {
77
+ id: link,
78
+ kind: ANNOTATION_SUBJECT_KINDS.link
79
+ }
82
80
  });
83
81
  return { status: "attached" };
84
82
  }
@@ -230,26 +228,6 @@ async function catchUpOnConversation(viewer, conversationId, range) {
230
228
  ...conversation.title ? { title: conversation.title } : void 0
231
229
  });
232
230
  }
233
- // src/chat/slack/detach-notice.ts
234
- function detachNoticeText(conversationId, actorName) {
235
- const url = getDashboardConversationLink(conversationId);
236
- const dashboard = url ? formatSlackLink(url, "the dashboard") : "the dashboard";
237
- return `${escapeSlackMrkdwnText(actorName)} detached this conversation from Slack. Updates continue in ${dashboard}. Mention me here to attach it again.`;
238
- }
239
- /**
240
- * Tell a Slack thread once that its Conversation was detached, so people
241
- * there know replies stopped. Call it only when the detach changed state.
242
- * Run it inside the Slack installation of `location.teamId`.
243
- */
244
- async function postSlackDetachNotice(args) {
245
- const { location } = args;
246
- if (!location.threadTs) return;
247
- await postSlackMessage({
248
- channelId: location.channelId,
249
- text: detachNoticeText(args.conversationId, args.actorName),
250
- threadTs: location.threadTs
251
- });
252
- }
253
231
  // src/api/conversations/delivery.ts
254
232
  /**
255
233
  * Detach a root from its Location, or attach it again. Only a participant
@@ -1522,8 +1500,9 @@ async function cancelConversationWatchForViewer(viewer, conversationId, watchId)
1522
1500
  // src/api/conversations/todos.ts
1523
1501
  /** Closed To-dos that the report shows after the open ones. */
1524
1502
  const RECENT_CLOSED_TODOS = 5;
1525
- function reportTodo(todo, canViewPrivateContent) {
1503
+ function reportTodo(todo, canViewPrivateContent, viewer) {
1526
1504
  const { assignee } = todo;
1505
+ const forViewer = assignee.kind === "user" && viewer !== void 0 && assignee.userId === viewer.id ? { viewer: true } : void 0;
1527
1506
  return {
1528
1507
  id: todo.id,
1529
1508
  status: todo.status,
@@ -1533,13 +1512,17 @@ function reportTodo(todo, canViewPrivateContent) {
1533
1512
  ...todo.notes ? { notes: todo.notes } : void 0,
1534
1513
  assignee: assignee.kind === "user" ? {
1535
1514
  kind: "user",
1536
- name: assignee.name ?? assignee.email
1515
+ name: assignee.name ?? assignee.email,
1516
+ ...forViewer
1537
1517
  } : assignee,
1538
1518
  ...todo.changedBy ? { changedBy: todo.changedBy.name ?? todo.changedBy.email } : todo.changedByAgent?.name ? { changedBy: todo.changedByAgent.name } : void 0
1539
1519
  } : {
1540
1520
  assignee: assignee.kind === "agent" ? {
1541
1521
  kind: "agent",
1542
1522
  conversationId: assignee.conversationId
1523
+ } : assignee.kind === "user" ? {
1524
+ kind: "user",
1525
+ ...forViewer
1543
1526
  } : { kind: assignee.kind },
1544
1527
  redacted: true
1545
1528
  }
@@ -1557,7 +1540,7 @@ async function requireConversationTodos(conversationId, options = {}) {
1557
1540
  const closed = todos.filter((todo) => !isOpenTodoStatus(todo.status)).sort((left, right) => right.updatedAtMs - left.updatedAtMs).slice(0, RECENT_CLOSED_TODOS);
1558
1541
  return {
1559
1542
  conversationId,
1560
- todos: [...todos.filter((todo) => isOpenTodoStatus(todo.status)), ...closed].map((todo) => reportTodo(todo, canViewPrivateContent))
1543
+ todos: [...todos.filter((todo) => isOpenTodoStatus(todo.status)), ...closed].map((todo) => reportTodo(todo, canViewPrivateContent, options.viewer))
1561
1544
  };
1562
1545
  }
1563
1546
  /**
@@ -1576,7 +1559,7 @@ async function setConversationTodoStatus(viewer, conversationId, todoId, body) {
1576
1559
  userId: viewer.id
1577
1560
  });
1578
1561
  if (!todo) throwApiError(404, "To-do not found.");
1579
- return reportTodo(todo, conversationAccess.canViewPrivateContent);
1562
+ return reportTodo(todo, conversationAccess.canViewPrivateContent, viewer);
1580
1563
  }
1581
1564
  // src/api/conversations/routes.ts
1582
1565
  /** Create the HTTP routes owned by the conversations API. */
@@ -3069,12 +3052,12 @@ const TREE_STATE_ORDER = [
3069
3052
  */
3070
3053
  async function readSpaceStates(db, spaceIds, viewerUserId) {
3071
3054
  if (spaceIds.length === 0) return /* @__PURE__ */ new Map();
3072
- const leads = db.select({ id: spaceLead.conversationId }).from(spaceLead).where(and(eq(spaceLead.kind, "lead"), inArray(spaceLead.spaceId, [...spaceIds])));
3055
+ const leads = sql`array(${db.select({ id: spaceLead.conversationId }).from(spaceLead).where(and(eq(spaceLead.kind, "lead"), inArray(spaceLead.spaceId, [...spaceIds])))})`;
3073
3056
  const roots = await db.select({
3074
3057
  conversationId: juniorConversations.conversationId,
3075
3058
  spaceId: rootSpaceIdSql(juniorConversations),
3076
3059
  latestTurnFailed: conversationTurnFailedSql(juniorConversations)
3077
- }).from(juniorConversations).where(and(or(inArray(juniorConversations.conversationId, leads), inArray(juniorConversations.parentConversationId, leads)), isNull(juniorConversations.archivedAt), isNull(juniorConversations.quickQuestionAt), rootVisibleToViewer(viewerUserId))).orderBy(desc(juniorConversations.lastActivityAt)).limit(SPACE_STATE_CONVERSATION_LIMIT);
3060
+ }).from(juniorConversations).where(and(or(sql`${juniorConversations.conversationId} = any(${leads})`, sql`${juniorConversations.parentConversationId} = any(${leads})`), isNull(juniorConversations.archivedAt), isNull(juniorConversations.quickQuestionAt), rootVisibleToViewer(viewerUserId))).orderBy(desc(juniorConversations.lastActivityAt)).limit(SPACE_STATE_CONVERSATION_LIMIT);
3078
3061
  const trees = await readConversationTreeStates(db, roots.map((root) => root.conversationId), viewerUserId);
3079
3062
  const states = new Map(spaceIds.map((spaceId) => [spaceId, {
3080
3063
  latestTurnFailed: false,
@@ -3531,7 +3514,7 @@ async function readPeoplePluginReports(args) {
3531
3514
  reports: [],
3532
3515
  source: "plugins"
3533
3516
  });
3534
- const { getPluginProfileReports } = await import("./reports-C1d9azyV.js");
3517
+ const { getPluginProfileReports } = await import("./reports-eBgrhPXS.js");
3535
3518
  return pluginOperationalReportFeedSchema.parse({
3536
3519
  generatedAt: new Date(nowMs).toISOString(),
3537
3520
  reports: await getPluginProfileReports({
@@ -4145,12 +4128,6 @@ async function searchAutomationsForViewer(viewer, query, limit) {
4145
4128
  }]);
4146
4129
  }
4147
4130
  // src/chat/inbox-items/search.ts
4148
- function codeChangeSubjectKinds() {
4149
- return getPlugins().flatMap((plugin) => (plugin.inboxSubjects ?? []).flatMap((subject) => {
4150
- const kind = `${plugin.manifest.name}:${subject.kind}`;
4151
- return codeChangeSubjectProvider(kind) ? [kind] : [];
4152
- }));
4153
- }
4154
4131
  function subjectCodeChange(item, change) {
4155
4132
  return and(eq(change.providerId, item.subjectId), eq(change.provider, sql`split_part(${item.subjectKind}, ':', 1)`));
4156
4133
  }
@@ -4393,7 +4370,7 @@ function callbackUrl(request, provider) {
4393
4370
  return new URL(`api/service-accounts/${encodeURIComponent(provider)}/callback`, base.endsWith("/") ? base : `${base}/`).toString();
4394
4371
  }
4395
4372
  function requirePlugin(provider) {
4396
- const plugin = pluginCatalogRuntime.getDefinition(provider);
4373
+ const plugin = getAppContext().catalog.getDefinition(provider);
4397
4374
  if (!plugin?.manifest.accounts?.serviceAccount) throwApiError(404, "Service account not found.");
4398
4375
  return plugin;
4399
4376
  }
@@ -4410,7 +4387,7 @@ function callbackPage(title, message, status) {
4410
4387
  */
4411
4388
  function createServiceAccountRoutes() {
4412
4389
  const app = new Hono();
4413
- app.get("/", requireAdmin, async () => jsonResponse(serviceAccountListSchema, { serviceAccounts: await mapBounded(serviceAccountPlugins(pluginCatalogRuntime.getProviders()), getServiceAccountStatus) }));
4390
+ app.get("/", requireAdmin, async () => jsonResponse(serviceAccountListSchema, { serviceAccounts: await mapBounded(serviceAccountPlugins(getAppContext().catalog.getProviders()), getServiceAccountStatus) }));
4414
4391
  app.post("/:provider", requireAdmin, validateRequest("param", serviceAccountParamsSchema, "Invalid provider."), async (context) => {
4415
4392
  const { provider } = context.req.valid("param");
4416
4393
  const { authorizationUrl } = await startServiceAccountSignIn({
@@ -5479,6 +5456,19 @@ async function readItemRoots(db, items, viewer) {
5479
5456
  }]];
5480
5457
  }));
5481
5458
  }
5459
+ /**
5460
+ * Read the owner Conversations of a page of items that the viewer cannot
5461
+ * see. Only a role on a plugin item's object (`assigneeRoles`) puts a
5462
+ * person on an item outside its Conversation, so only those owners are
5463
+ * read. Their card then shows the item and its subject, and no
5464
+ * Conversation.
5465
+ */
5466
+ async function readHiddenOwners(db, items, viewer) {
5467
+ const ids = [...new Set(items.flatMap((item) => hasAssigneeRoles(item) ? ownerConversationId(item) ?? [] : []))];
5468
+ if (ids.length === 0) return /* @__PURE__ */ new Set();
5469
+ const access = await readConversationAccessFromSql(db, ids, viewer);
5470
+ return new Set(ids.filter((id) => !access.get(id)?.canViewPrivateContent));
5471
+ }
5482
5472
  // src/api/inbox-items/mentions.ts
5483
5473
  /**
5484
5474
  * Resolve the people that each Inbox item's title, body, and question
@@ -5548,6 +5538,7 @@ function subjectPayload(item, views, viewer) {
5548
5538
  const url = view?.url;
5549
5539
  const object = view?.object;
5550
5540
  const label = subjectKindLabel(subject.kind, getPlugins(), object, viewer);
5541
+ const dismissNote = subjectKindDismissNote(subject.kind, getPlugins(), object, viewer);
5551
5542
  const objectType = url && readLinkObjectType(url);
5552
5543
  const snoozeUrl = url ?? questionLinks(item)[0];
5553
5544
  const resource = snoozeUrl && snoozeSubjectResource(getEventCatalog(), snoozeUrl);
@@ -5555,6 +5546,7 @@ function subjectPayload(item, views, viewer) {
5555
5546
  id: subject.id,
5556
5547
  kind: subject.kind,
5557
5548
  ...label ? { label } : void 0,
5549
+ ...dismissNote ? { dismissNote } : void 0,
5558
5550
  ...url ? { url } : void 0,
5559
5551
  ...object ? { object } : void 0,
5560
5552
  ...objectType ? { objectType } : void 0,
@@ -5577,8 +5569,10 @@ function wakePayload(reason) {
5577
5569
  };
5578
5570
  }
5579
5571
  /** Build the API payload of one Inbox item for its viewer. */
5580
- function inboxItemPayload(item, viewer, roots, mentions, related, wake, views) {
5581
- const conversationId = ownerConversationId(item);
5572
+ function inboxItemPayload(item, viewer, roots, mentions, related, wake, views, hidden) {
5573
+ const owner = ownerConversationId(item);
5574
+ const conversationHidden = owner !== void 0 && hidden.has(owner);
5575
+ const conversationId = conversationHidden ? void 0 : owner;
5582
5576
  const root = conversationId ? roots.get(conversationId) : void 0;
5583
5577
  const todo = subjectTodo(item.subject);
5584
5578
  const question = inboxItemQuestion(item.request);
@@ -5589,8 +5583,8 @@ function inboxItemPayload(item, viewer, roots, mentions, related, wake, views) {
5589
5583
  body: item.body,
5590
5584
  canAct: canActOnInboxItem(item, viewer.id),
5591
5585
  canAnswer: canAnswerInboxItem(item, viewer.id),
5592
- canTake: canActOnInboxItem(item, viewer.id) && !isOnlyAssignee(item, viewer.id),
5593
- conversationIds: item.conversationIds,
5586
+ canTake: canActOnInboxItem(item, viewer.id) && !isOnlyAssignee(item, viewer.id) && !hasAssigneeRoles(item),
5587
+ conversationIds: conversationHidden ? [] : item.conversationIds,
5594
5588
  createdAt: item.createdAt.toISOString(),
5595
5589
  id: item.id,
5596
5590
  kind: item.kind,
@@ -5602,7 +5596,7 @@ function inboxItemPayload(item, viewer, roots, mentions, related, wake, views) {
5602
5596
  visibility: item.visibility,
5603
5597
  ...conversationId ? { rootConversationId: root?.rootConversationId ?? conversationId } : void 0,
5604
5598
  ...item.answer ? { answer: item.answer } : void 0,
5605
- ...item.addedByTurnId ? { addedByTurnId: item.addedByTurnId } : void 0,
5599
+ ...item.addedByTurnId && !conversationHidden ? { addedByTurnId: item.addedByTurnId } : void 0,
5606
5600
  ...item.addedByAutomationId ? { automationId: item.addedByAutomationId } : void 0,
5607
5601
  ...item.closeReason ? { closeReason: item.closeReason } : void 0,
5608
5602
  ...item.closedAt ? { closedAt: item.closedAt.toISOString() } : void 0,
@@ -5622,8 +5616,9 @@ function inboxItemPayload(item, viewer, roots, mentions, related, wake, views) {
5622
5616
  */
5623
5617
  async function inboxItemPayloads(items, viewer, reader) {
5624
5618
  const db = getDb();
5625
- const [roots, mentions, related, snoozes, views] = await Promise.all([
5619
+ const [roots, hidden, mentions, related, snoozes, views] = await Promise.all([
5626
5620
  readItemRoots(db, items, viewer),
5621
+ readHiddenOwners(db, items, viewer),
5627
5622
  readInboxItemMentions(getSqlExecutor(), items),
5628
5623
  readRelatedReviewWork(db, reader, viewer, items),
5629
5624
  readViewerInboxSnoozes(db, {
@@ -5633,7 +5628,7 @@ async function inboxItemPayloads(items, viewer, reader) {
5633
5628
  resolveInboxItemSubjects(viewer, items)
5634
5629
  ]);
5635
5630
  return items.map((item, index) => {
5636
- const payload = inboxItemPayload(item, viewer, roots, mentions[index], related.get(item.id), snoozes.wakeReasons.get(item.id), views);
5631
+ const payload = inboxItemPayload(item, viewer, roots, mentions[index], related.get(item.id), snoozes.wakeReasons.get(item.id), views, hidden);
5637
5632
  return snoozes.snoozed.has(item.id) ? {
5638
5633
  ...payload,
5639
5634
  snoozedByViewer: true
@@ -5982,7 +5977,7 @@ function readDescriptionText(home) {
5982
5977
  }
5983
5978
  /** Read discovered skills for runtime diagnostics and the Automation editor. */
5984
5979
  async function readSkillReports() {
5985
- const { discoverSkills } = await import("./skills-CleC0Hze.js").then((n) => n.s);
5980
+ const { discoverSkills } = await import("./skills-50izzzdK.js").then((n) => n.s);
5986
5981
  const skills = await discoverSkills();
5987
5982
  return skillReportsSchema.parse(skills.map((skill) => ({
5988
5983
  name: skill.name,
@@ -5996,10 +5991,10 @@ async function readSkillReports() {
5996
5991
  * what the skill tells Junior. Returns null when no skill has that name.
5997
5992
  */
5998
5993
  async function readSkillDetailReport(name) {
5999
- const { discoverSkills, findSkillByName, parseSkillFile } = await import("./skills-CleC0Hze.js").then((n) => n.s);
5994
+ const { discoverSkills, findSkillByName, parseSkillFile } = await import("./skills-50izzzdK.js").then((n) => n.s);
6000
5995
  const skill = findSkillByName(name, await discoverSkills());
6001
5996
  if (!skill) return null;
6002
- const parsed = parseSkillFile(await fs.readFile(path.join(skill.skillPath, "SKILL.md"), "utf8"), skill.name);
5997
+ const parsed = parseSkillFile(await fs$1.readFile(path.join(skill.skillPath, "SKILL.md"), "utf8"), skill.name);
6003
5998
  if (!parsed.ok) throw new Error(`Invalid skill file for ${skill.name}: ${parsed.error}`);
6004
5999
  return skillDetailReportSchema.parse({
6005
6000
  name: skill.name,
@@ -6011,8 +6006,8 @@ async function readSkillDetailReport(name) {
6011
6006
  }
6012
6007
  /** Read safe configured plugin metadata for authenticated runtime diagnostics. */
6013
6008
  async function readPlugins() {
6014
- const { pluginCatalogRuntime } = await import("./catalog-runtime-BfdAnztW.js").then((n) => n.t);
6015
- return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
6009
+ const { getAppContext } = await import("./db-BacvswT0.js").then((n) => n.Md);
6010
+ return pluginsSchema.parse(getAppContext().catalog.getProviders().map((plugin) => ({
6016
6011
  configKeys: plugin.manifest.configKeys ?? [],
6017
6012
  description: plugin.manifest.description,
6018
6013
  displayName: plugin.manifest.displayName,
@@ -6021,9 +6016,9 @@ async function readPlugins() {
6021
6016
  }
6022
6017
  /** Read authenticated runtime discovery data. */
6023
6018
  async function readRuntimeInfoReport() {
6024
- const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
6025
- import("./package-discovery-DD9vencX.js").then((n) => n.r),
6026
- import("./catalog-runtime-BfdAnztW.js").then((n) => n.t),
6019
+ const [{ homeDir }, { getAppContext }, plugins, skills] = await Promise.all([
6020
+ import("./topics-DxuKurCX.js").then((n) => n.c),
6021
+ import("./db-BacvswT0.js").then((n) => n.Md),
6027
6022
  readPlugins(),
6028
6023
  readSkillReports()
6029
6024
  ]);
@@ -6034,13 +6029,13 @@ async function readRuntimeInfoReport() {
6034
6029
  descriptionText: readDescriptionText(home),
6035
6030
  providers: plugins.map((plugin) => plugin.name),
6036
6031
  skills,
6037
- packagedContent: pluginCatalogRuntime.getPackageContent()
6032
+ packagedContent: getAppContext().catalog.getPackageContent()
6038
6033
  });
6039
6034
  }
6040
6035
  /** Read sanitized operational summaries contributed by plugins. */
6041
6036
  async function readPluginOperationalReportFeed() {
6042
6037
  const nowMs = Date.now();
6043
- const { getPluginOperationalReports } = await import("./reports-C1d9azyV.js");
6038
+ const { getPluginOperationalReports } = await import("./reports-eBgrhPXS.js");
6044
6039
  return pluginOperationalReportFeedSchema.parse({
6045
6040
  source: "plugins",
6046
6041
  generatedAt: new Date(nowMs).toISOString(),
@@ -1,6 +1,6 @@
1
- import { n as JuniorPluginSet } from "./plugins-fBrz8PCV.js";
1
+ import { n as JuniorPluginSet } from "./plugins-DhGXZjlu.js";
2
2
  import { n as ConversationQueueMessage, r as ConversationWorkQueue, t as WaitUntilFn } from "./types-fnU7Xs__.js";
3
- import "./change-record-BzJgLsv7.js";
3
+ import "./change-record-K-KsqNhT.js";
4
4
  import "./db-BpxcYXfD.js";
5
5
  import "./sentry-DrKC2NeM.js";
6
6
  import { Hono } from "hono";
@@ -9,11 +9,12 @@ import "@earendil-works/pi-ai/compat";
9
9
  import "@earendil-works/pi-ai/api/anthropic-messages";
10
10
  import "drizzle-orm";
11
11
  import { Destination, Source, locationSchema } from "@sentry/junior-plugin-api";
12
+ import "@modelcontextprotocol/sdk/client/auth.js";
13
+ import "@modelcontextprotocol/sdk/client";
12
14
  import "ai";
13
15
  import "@earendil-works/pi-ai";
16
+ import "@vercel/queue";
14
17
  import "@earendil-works/pi-agent-core";
15
- import "@modelcontextprotocol/sdk/client/auth.js";
16
- import "@modelcontextprotocol/sdk/client";
17
18
  import { StateAdapter } from "chat";
18
19
  import { SlackAdapter } from "@chat-adapter/slack";
19
20
  interface BotModelConfig {
package/dist/app.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as MemoryOptions, n as createApp, r as JuniorDashboardOptions, t as JuniorAppOptions } from "./app-DKAOuaoC.js";
2
- import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-fBrz8PCV.js";
1
+ import { i as MemoryOptions, n as createApp, r as JuniorDashboardOptions, t as JuniorAppOptions } from "./app-CHCFIIDu.js";
2
+ import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-DhGXZjlu.js";
3
3
  import { t as JUNIOR_VERSION } from "./version-Cc2OFd9G.js";
4
4
  export { JUNIOR_VERSION, JuniorAppOptions, type JuniorDashboardOptions, type JuniorPluginInput, type JuniorPluginSet, type JuniorPluginSetOptions, type MemoryOptions, createApp, defineJuniorPlugins };