@sentry/junior 0.258.0 → 0.260.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 (77) hide show
  1. package/dist/adapter-Dj5BTJRd.js +270 -0
  2. package/dist/{admin-My1SLGVO.js → admin-tzkZDqrH.js} +1 -1
  3. package/dist/{agent-hooks-BJ_5mlRH.js → agent-hooks-V4Hfc2tB.js} +711 -697
  4. package/dist/{agent-runner-DGsFQw72.js → agent-runner-DvTUyGTY.js} +751 -2508
  5. package/dist/api/schema.d.ts +239 -54
  6. package/dist/api/schema.js +4 -4
  7. package/dist/api.js +218 -57
  8. package/dist/{app-PX2H1PxU.d.ts → app-BsBUs3rF.d.ts} +6 -3
  9. package/dist/app.d.ts +2 -2
  10. package/dist/app.js +31 -31
  11. package/dist/{assistant-reply-H1M-91oF.js → assistant-reply-CEOMzsWy.js} +1 -1
  12. package/dist/{automation-DWBFBenG.js → automation-DrpcA-SX.js} +3 -0
  13. package/dist/{briefs-vYoK85rJ.js → briefs-BSCkyYqs.js} +4 -4
  14. package/dist/{catalog-runtime-BN4DVxco.js → catalog-runtime-Bpcs2b2L.js} +1 -1
  15. package/dist/cli/chat.d.ts +1 -1
  16. package/dist/cli/chat.js +16 -16
  17. package/dist/cli/check.js +3 -3
  18. package/dist/cli/main.js +6 -2
  19. package/dist/cli/plugins.d.ts +1 -1
  20. package/dist/cli/plugins.js +4 -4
  21. package/dist/cli/run.d.ts +2 -1
  22. package/dist/cli/run.js +2 -1
  23. package/dist/cli/snapshot-create.js +4 -3
  24. package/dist/cli/upgrade.d.ts +1 -1
  25. package/dist/cli/upgrade.js +3 -3
  26. package/dist/{client-DbyHuMFU.js → client-JeyzRwsT.js} +57 -4
  27. package/dist/{config-_WO_AjCB.js → config-ULs6Zl9b.js} +5 -2
  28. package/dist/{connections-ag_1JOhB.js → connections-CZ7HhEmN.js} +174 -10
  29. package/dist/{conversation-DjN3mlog.js → conversation-CvuKJ3tA.js} +108 -155
  30. package/dist/{conversation-privacy-DHP_xnVj.js → conversation-privacy-BQSlZXgV.js} +1 -1
  31. package/dist/{credential-sync-B-CPX_ag.js → credential-sync-BKcv5rBe.js} +14 -177
  32. package/dist/{executor-RvG6kVe1.js → executor-BoGNVEDn.js} +3 -2
  33. package/dist/{images-C2J_bj2g.js → images-BBmDXQCB.js} +3 -3
  34. package/dist/instrumentation.js +2 -2
  35. package/dist/{job-queue-DVe37it2.js → job-queue-CbdVyaCo.js} +1 -1
  36. package/dist/{logging-DsHONhVm.js → logging-DSMmkHXG.js} +1 -1
  37. package/dist/{message-DyitL8no.js → message-zaj5gBbS.js} +3 -3
  38. package/dist/nitro.d.ts +2 -2
  39. package/dist/nitro.js +3 -3
  40. package/dist/{oauth-callback-server-CDby-pCn.js → oauth-callback-server-yYFG8Own.js} +2 -2
  41. package/dist/{plugins-B11Mfkmv.d.ts → plugins-B_0Cr0MO.d.ts} +5 -1
  42. package/dist/{profile-DpYjfKke.js → profile-ByWkAY7L.js} +24 -293
  43. package/dist/{prompt-xgpyMtg7.js → prompt-DeVax2qO.js} +1 -1
  44. package/dist/{registry-Du566MtJ.js → registry-BL-osYWN.js} +41 -2
  45. package/dist/{resolve-ClCIgh8E.js → resolve-HuPG2VMB.js} +9 -4
  46. package/dist/{result-BBbKA61B.js → result-DS7V4a3-.js} +9 -14
  47. package/dist/{runner-CCuqFSqx.js → runner-Cba_OfGl.js} +11 -11
  48. package/dist/{sandbox-egress-signals-DY1mbKF4.js → sandbox-egress-signals-C7NcPzea.js} +1 -1
  49. package/dist/{schema-DrMh3NtR.js → schema-OzL8Zw4H.js} +82 -3
  50. package/dist/service-account-DqwHhwJA.js +120 -0
  51. package/dist/service-account-Ko1Xs--F.js +661 -0
  52. package/dist/{session-stop-CIoFiwwe.js → session-stop-HfKx-pky.js} +180 -22
  53. package/dist/{skills-DyQBLIrK.js → skills-D6_bcAuW.js} +2 -2
  54. package/dist/{spawn-Dqfeo7XP.js → spawn-BWqK6EwM.js} +2 -2
  55. package/dist/{store-DJLwq4x8.js → store-DzRbd5VT.js} +6 -6
  56. package/dist/{task-queue-BzW4MaWU.js → task-queue-9LICOzcL.js} +3 -3
  57. package/dist/{task-runner-D3qJh4fK.js → task-runner-DGnd_B5X.js} +10 -10
  58. package/dist/{tasks-CEXKTASS.js → tasks-CjrS098O.js} +4928 -2389
  59. package/dist/thread-state-CqkYowEz.js +184 -0
  60. package/dist/{turn-failure-response-CWx7aNIh.js → turn-failure-response-BkKmGqFt.js} +8 -9
  61. package/dist/{turn-lifecycle-C9JFst7-.js → turn-lifecycle-DYv8IV6w.js} +1 -1
  62. package/dist/{turn-session-routing-CUxtfpr7.js → turn-session-routing-TaVhKmdz.js} +1 -1
  63. package/dist/{validation-BHRxa5G4.js → validation-BrXMYPyo.js} +1 -1
  64. package/dist/{version-C0U6rHg0.js → version-Ct049vav.js} +1 -1
  65. package/dist/version.js +1 -1
  66. package/dist/{viewer-CGvvRqKp.js → viewer-C-J0ewlH.js} +19 -10
  67. package/dist/{web-input-Keb5GRWj.js → web-input-C_xB3RXp.js} +41 -37
  68. package/dist/{work-DRcsJ3hV.js → work-D829Ue7k.js} +9 -10
  69. package/dist/{worker-Cjo-QqPq.js → worker-BRTYzlpk.js} +5 -5
  70. package/migrations/0061_workspace_vcpus.sql +1 -0
  71. package/migrations/meta/0061_snapshot.json +3471 -0
  72. package/migrations/meta/_journal.json +7 -0
  73. package/package.json +6 -6
  74. package/dist/experimental-BNK1l1jv.js +0 -49
  75. package/dist/oauth-authorization-djQn5Nhy.js +0 -97
  76. package/dist/pending-auth-D8J1uJUS.js +0 -442
  77. package/dist/thread-state-W3f6kAtz.js +0 -426
package/dist/api.js CHANGED
@@ -1,27 +1,30 @@
1
- import { K as listChildAgents, L as editEventAutomation, Lt as createUserTokenStore, O as parseSlackThreadId, P as editScheduledAutomation, R as AutomationEditError, T as readLiveAttachment, V as resolveTaskOutcomes, bt as conversationSubtreeColumns, g as readStats, ot as getChildAgentLabel, yt as conversationSubtree, z as eventAutomationTriggerAvailable } from "./agent-runner-DGsFQw72.js";
2
- import { f as logException, m as logWarn, p as logInfo } from "./logging-DsHONhVm.js";
1
+ import { D as AutomationConflictError, E as sameDefinitionValue, L as loadTurnProjection, O as automationRevision, S as automationDefinition, T as readAutomationVersion, a as saveScheduledAutomation, bn as createUserTokenStore, k as requireAutomationRevision, rr as piMessageFromHistoryItem, v as saveEventAutomation, y as setEventAutomationStatus } from "./tasks-CjrS098O.js";
2
+ import { p as escapeXml } from "./client-JeyzRwsT.js";
3
+ import { f as logException, m as logWarn, p as logInfo } from "./logging-DSMmkHXG.js";
3
4
  import { d as parseSlackTeamId, g as parseSlackMessageTs, l as parseSlackChannelId } from "./actor-tlxzqaRe.js";
4
- import { C as addAgentTurnUsage, D as hasAgentTurnUsage, E as agentTurnUsageSchema, O as resolveRootConversationId, S as parseSessionSource, c as getConversationEventStore, d as getDb, f as getSqlExecutor, h as loadConversationSlackTenantId, i as resolveViewerUser, m as withConversationEventLock, o as updateViewerDisplayName, t as findUserByEmail, u as getConversationStore, v as locationFromRow } from "./viewer-CGvvRqKp.js";
5
+ import { C as addAgentTurnUsage, D as hasAgentTurnUsage, E as agentTurnUsageSchema, O as resolveRootConversationId, S as parseSessionSource, c as getConversationEventStore, d as getDb, f as getSqlExecutor, h as loadConversationSlackTenantIds, i as resolveViewerUser, m as withConversationEventLock, o as updateViewerDisplayName, t as findUserByEmail, u as getConversationStore, v as locationFromRow } from "./viewer-C-J0ewlH.js";
5
6
  import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, o as conversationReadColumns, s as juniorConversations } from "./agent-invocations-Qfz7dWgU.js";
6
- import { f as juniorConversationBriefs, g as juniorApiTokens, h as juniorConversationEvents, m as juniorConversationMetrics, u as juniorConversationParticipants, v as juniorCodeChanges, y as juniorCodeRepositories } from "./executor-RvG6kVe1.js";
7
+ import { f as juniorConversationBriefs, g as juniorApiTokens, h as juniorConversationEvents, m as juniorConversationMetrics, u as juniorConversationParticipants, v as juniorCodeChanges, y as juniorCodeRepositories } from "./executor-BoGNVEDn.js";
7
8
  import { d as contextProvenance } from "./history-AY8rs-FR.js";
8
- import { At as loadTurnProjection, D as AutomationConflictError, E as sameDefinitionValue, O as automationRevision, S as automationDefinition, T as readAutomationVersion, a as saveScheduledAutomation, k as requireAutomationRevision, pn as piMessageFromHistoryItem, v as saveEventAutomation, y as setEventAutomationStatus } from "./tasks-CEXKTASS.js";
9
- import { C as WorkspaceValidationError, Ct as readLatestConversationBrief, Ht as getSlackClient, Lt as lookupSlackUser, M as workspaceRepoCheckoutPath, Nt as listConversationAnnotations, O as SANDBOX_RUNTIME, Pt as listConversationAnnotationsById, S as updateWorkspace, Tt as buildSentryConversationUrl, _ as deleteWorkspace, _t as conversationHasParticipantEmail, b as listWorkspaces, bt as conversationNotArchivedForUser, ft as createPluginLogger, g as createWorkspace, gt as conversationArchivedForUser, ht as conversationArchivedForEmail, mt as conversationArchiveTimes, pt as readConversationAccessFromSql, qt as withSlackRetries, u as getPlugins, v as getWorkspace, vt as conversationHasParticipantUser, wt as readConversationEventPage, x as listWorkspacesByRepository, xt as viewerConversationMembership, yt as conversationNotArchivedForEmail } from "./agent-hooks-BJ_5mlRH.js";
10
- import { A as forkConversationBodySchema, F as readMessageAttachments, I as INPUT_IMAGE_TYPES, O as createConversationBodySchema, T as conversationStatsReportSchema, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, c as conversationAttachmentParamsSchema, d as conversationDetailReportSchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, j as forkConversationResponseSchema, k as createConversationMessageBodySchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-DjN3mlog.js";
11
- import { n as hash, t as create } from "./profile-DpYjfKke.js";
12
- import { l as getEventCatalog, y as automationEventCatalog } from "./session-stop-CIoFiwwe.js";
9
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Bpcs2b2L.js";
10
+ import { F as AutomationEditError, I as eventAutomationTriggerAvailable, P as editEventAutomation, R as resolveTaskOutcomes, S as readLiveAttachment, T as parseSlackThreadId, U as listChildAgents, _t as conversationSubtreeColumns, gt as conversationSubtree, j as editScheduledAutomation, m as readStats, rt as getChildAgentLabel } from "./agent-runner-DvTUyGTY.js";
11
+ import { At as conversationHasParticipantUser, C as WorkspaceValidationError, Dt as conversationArchivedForEmail, Et as conversationArchiveTimes, Ft as readLatestConversationBrief, Gt as listConversationAnnotations, It as readConversationEventPage, Kt as listConversationAnnotationsById, Lt as buildSentryConversationUrl, M as workspaceRepoCheckoutPath, Mt as conversationNotArchivedForUser, Nt as viewerConversationMembership, O as SANDBOX_RUNTIME, Ot as conversationArchivedForUser, S as updateWorkspace, Tt as readConversationAccessFromSql, Yt as lookupSlackUser, _ as deleteWorkspace, b as listWorkspaces, ct as getSlackClient, g as createWorkspace, jt as conversationNotArchivedForEmail, kt as conversationHasParticipantEmail, pt as withSlackRetries, u as getPlugins, v as getWorkspace, wt as createPluginLogger, x as listWorkspacesByRepository } from "./agent-hooks-V4Hfc2tB.js";
13
12
  import { t as getFirstRunAtMs } from "./cadence-R7Em4RjE.js";
14
- import { t as getCachedSnapshot } from "./resolve-ClCIgh8E.js";
15
- import { a as getVercelConversationWorkQueue } from "./job-queue-DVe37it2.js";
16
- import { a as cancelHumanFacingPendingMessages, h as getConversation } from "./store-DJLwq4x8.js";
17
- import { M as compileScheduleIntent, P as weekdaySchema, _ as automationSummarySchema, b as automationVersionListSchema, c as automationLifecycleSchema, d as automationParamsSchema, f as automationRunListSchema, g as automationSchedulePreviewSchema, h as automationScheduleIntentSchema, i as automationExecutionListSchema, j as ScheduleIntentError, l as automationListQuerySchema, n as automationEditSchema, r as automationEventCatalogSchema, t as automationEditErrorSchema, u as automationListSchema, v as automationUpdateSchema, x as automationVersionParamsSchema, y as automationVersionActivateSchema } from "./automation-DWBFBenG.js";
13
+ import { A as forkConversationResponseSchema, B as readMessageAttachments, D as createConversationBodySchema, O as createConversationMessageBodySchema, V as INPUT_IMAGE_TYPES, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, c as conversationAttachmentParamsSchema, d as conversationDetailReportSchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, k as forkConversationBodySchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-CvuKJ3tA.js";
14
+ import { n as hash, t as create } from "./profile-ByWkAY7L.js";
15
+ import { d as getEventCatalog, x as automationEventCatalog } from "./session-stop-HfKx-pky.js";
16
+ import { d as getSandboxResources, t as getCachedSnapshot } from "./resolve-HuPG2VMB.js";
17
+ import { a as getVercelConversationWorkQueue } from "./job-queue-CbdVyaCo.js";
18
+ import { a as cancelHumanFacingPendingMessages, h as getConversation } from "./store-DzRbd5VT.js";
19
+ import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-Ko1Xs--F.js";
20
+ import { M as compileScheduleIntent, P as weekdaySchema, _ as automationSummarySchema, b as automationVersionListSchema, c as automationLifecycleSchema, d as automationParamsSchema, f as automationRunListSchema, g as automationSchedulePreviewSchema, h as automationScheduleIntentSchema, i as automationExecutionListSchema, j as ScheduleIntentError, l as automationListQuerySchema, n as automationEditSchema, r as automationEventCatalogSchema, t as automationEditErrorSchema, u as automationListSchema, v as automationUpdateSchema, x as automationVersionParamsSchema, y as automationVersionActivateSchema } from "./automation-DrpcA-SX.js";
18
21
  import { C as skillReportsSchema, a as fillUtcHours, b as pluginsSchema, c as sumUtcHoursIntoSixHours, d as trailingUtcSixHourWindow, f as utcDayKey, h as pluginOperationalReportFeedSchema, i as fillUtcDays, l as trailingUtcDayWindow, m as healthReportSchema, n as DAY_MS$1, o as fillUtcSixHours, p as utcHourKey, r as HOUR_MS$1, s as startOfUtcHour, u as trailingUtcHourWindow, x as runtimeInfoReportSchema } from "./web-message-id-CJSUiksE.js";
19
- import { B as readHealthReport, I as createVercelAttachmentStorage, _ as readViewerAutomationRuns, a as recordWebConversationActivity, b as readViewerAutomations, d as resolveSlackConversationContextFromThreadId, g as readViewerAutomationExecutions, h as readConversationSourceTask, i as createConversationId, k as stopConversationTurn, l as getProductionSlackAdapter, m as deleteViewerTask, o as webActorFromEmail, p as ViewerTaskNotFoundError, r as createAndEnqueueConversation, t as appendAndEnqueueWebMessage, u as formatSlackConversationRedactedLabel, v as readViewerAutomationSummary, w as clearSlackPendingReactions, x as resolveViewerTaskCandidate, y as readViewerAutomationVersions } from "./web-input-Keb5GRWj.js";
20
- import { F as conversationAggregateColumns, I as conversationRangeColumns, M as readAutomationTitlesByConversationId, P as conversationActiveDaysColumn } from "./task-runner-D3qJh4fK.js";
21
- import { d as legacyWebMailboxMetadataSchema } from "./result-BBbKA61B.js";
22
- import { a as startConnection, l as getWebAuthorization, n as isConnectableProvider, r as listConnections, t as disconnectConnection } from "./connections-ag_1JOhB.js";
23
- import { t as decodeInputImages } from "./images-C2J_bj2g.js";
24
- import { C as locationParamsSchema, E as activitySixHours$1, H as conversationChildAgentsReportSchema, I as codeOverviewReportSchema, L as codePersonReportSchema, M as startConnectionResponseSchema, O as connectionListSchema, R as codeRepositoryParamsSchema, S as locationDirectoryReportSchema, T as activityHours$1, U as stopConversationTurnResponseSchema, W as apiErrorSchema, _ as actorProfileReportSchema, a as workspaceBodySchema, d as createdPersonalTokenSchema, f as personalTokenListSchema, g as actorDirectoryReportSchema, h as revokePersonalTokenResponseSchema, i as deleteWorkspaceResponseSchema, j as disconnectConnectionResponseSchema, k as connectionParamsSchema, l as workspaceSchema, m as personalTokenParamsSchema, n as statsReportSchema, o as workspaceListSchema, s as workspaceParamsSchema, u as createPersonalTokenBodySchema, v as personParamsSchema, w as activityDays$1, x as locationDetailReportSchema, y as personalSpendReportSchema, z as codeRepositoryReportSchema } from "./schema-DrMh3NtR.js";
22
+ import { B as readHealthReport, I as createVercelAttachmentStorage, _ as readViewerAutomationRuns, a as recordWebConversationActivity, b as readViewerAutomations, d as resolveSlackConversationContextFromThreadId, g as readViewerAutomationExecutions, h as readConversationSourceTask, i as createConversationId, k as stopConversationTurn, l as getProductionSlackAdapter, m as deleteViewerTask, o as webActorFromEmail, p as ViewerTaskNotFoundError, r as createAndEnqueueConversation, t as appendAndEnqueueWebMessage, u as formatSlackConversationRedactedLabel, v as readViewerAutomationSummary, w as clearSlackPendingReactions, x as resolveViewerTaskCandidate, y as readViewerAutomationVersions } from "./web-input-C_xB3RXp.js";
23
+ import { F as conversationAggregateColumns, I as conversationRangeColumns, M as readAutomationTitlesByConversationId, P as conversationActiveDaysColumn } from "./task-runner-DGnd_B5X.js";
24
+ import { d as legacyWebMailboxMetadataSchema } from "./result-DS7V4a3-.js";
25
+ import { a as startConnection, l as getWebAuthorization, n as isConnectableProvider, r as listConnections, t as disconnectConnection, u as htmlCallbackResponse } from "./connections-CZ7HhEmN.js";
26
+ import { t as decodeInputImages } from "./images-BBmDXQCB.js";
27
+ import { A as activityHours$1, C as personParamsSchema, D as locationDirectoryReportSchema, E as locationDetailReportSchema, H as codePersonReportSchema, I as disconnectConnectionResponseSchema, J as stopConversationTurnResponseSchema, L as startConnectionResponseSchema, N as connectionListSchema, O as locationParamsSchema, P as connectionParamsSchema, S as actorProfileReportSchema, U as codeRepositoryParamsSchema, V as codeOverviewReportSchema, W as codeRepositoryReportSchema, X as apiErrorSchema, Y as conversationStatsReportSchema, _ as personalTokenListSchema, a as workspaceBodySchema, b as revokePersonalTokenResponseSchema, d as serviceAccountListSchema, f as serviceAccountParamsSchema, g as createdPersonalTokenSchema, h as createPersonalTokenBodySchema, i as deleteWorkspaceResponseSchema, j as activitySixHours$1, k as activityDays$1, l as workspaceSchema, m as startServiceAccountSignInResponseSchema, n as statsReportSchema, o as workspaceListSchema, q as conversationChildAgentsReportSchema, s as workspaceParamsSchema, u as disconnectServiceAccountResponseSchema, w as personalSpendReportSchema, x as actorDirectoryReportSchema, y as personalTokenParamsSchema } from "./schema-OzL8Zw4H.js";
25
28
  import { Hono } from "hono";
26
29
  import path from "node:path";
27
30
  import { z } from "zod";
@@ -75,6 +78,13 @@ const requireViewer = createMiddleware(async (context, next) => {
75
78
  if (!context.get("viewer")) throwApiError(401, "Authentication required.");
76
79
  await next();
77
80
  });
81
+ /** Require a Junior admin viewer. */
82
+ const requireAdmin = createMiddleware(async (context, next) => {
83
+ const viewer = context.get("viewer");
84
+ if (!viewer) throwApiError(401, "Authentication required.");
85
+ if (viewer.isAdmin !== true) throwApiError(403, "Only Junior admins can do this.");
86
+ await next();
87
+ });
78
88
  // src/api/conversations/archive.ts
79
89
  async function setViewerArchive(args) {
80
90
  const executor = getSqlExecutor();
@@ -877,22 +887,42 @@ function decodeConversationCursor(args) {
877
887
  return;
878
888
  }
879
889
  }
880
- // src/api/conversations/message-mentions.ts
890
+ // src/api/mentions.ts
881
891
  const SLACK_USER_MENTION_RE = /<@([UW][A-Z0-9]+)(?:\|[^<>]*)?>/g;
882
- function mentionedSlackUserIds(text) {
883
- if (!text) return [];
884
- return [...new Set([...text.matchAll(SLACK_USER_MENTION_RE)].map((m) => m[1]))];
892
+ function mentionedSlackUserIds(texts) {
893
+ const ids = texts.flatMap((text) => text ? [...text.matchAll(SLACK_USER_MENTION_RE)].map((m) => m[1]) : []);
894
+ return [...new Set(ids)];
885
895
  }
886
- function messageMentionText(data) {
887
- return [data.text, data.trustedSummary].filter(Boolean).join("\n");
896
+ /**
897
+ * Resolve the people that each source mentions, in source order. Every API
898
+ * that returns display text uses this, so the dashboard can show the same
899
+ * names and People links everywhere. It does one identity query per Slack
900
+ * workspace.
901
+ */
902
+ async function resolveMentions(executor, sources) {
903
+ const idsBySource = sources.map((source) => mentionedSlackUserIds(source.texts));
904
+ const idsByTenant = /* @__PURE__ */ new Map();
905
+ sources.forEach((source, index) => {
906
+ if (idsBySource[index].length === 0) return;
907
+ const ids = idsByTenant.get(source.tenantId) ?? /* @__PURE__ */ new Set();
908
+ for (const id of idsBySource[index]) ids.add(id);
909
+ idsByTenant.set(source.tenantId, ids);
910
+ });
911
+ const peopleByTenant = new Map(await Promise.all([...idsByTenant].map(async ([tenantId, ids]) => [tenantId, await readMentionedPeople(executor, tenantId, [...ids])])));
912
+ return sources.map((source, index) => {
913
+ const people = peopleByTenant.get(source.tenantId);
914
+ return idsBySource[index].flatMap((id) => {
915
+ const person = people?.get(id);
916
+ return person ? [person] : [];
917
+ });
918
+ });
888
919
  }
889
920
  /**
890
921
  * Read current names for mentioned Slack users. Known Junior identities come
891
922
  * first. The email is set only for a linked, verified Junior user, because
892
923
  * that email is the People profile route.
893
924
  */
894
- async function resolveSlackMentions(executor, conversationId, userIds) {
895
- const tenantId = await loadConversationSlackTenantId(executor, conversationId);
925
+ async function readMentionedPeople(executor, tenantId, userIds) {
896
926
  const rows = await executor.db().select({
897
927
  displayName: juniorIdentities.displayName,
898
928
  emailVerified: juniorIdentities.emailVerified,
@@ -932,26 +962,67 @@ async function resolveSlackMentions(executor, conversationId, userIds) {
932
962
  }
933
963
  return people;
934
964
  }
935
- /** Attach the people that each visible message mentions, resolved at read time. */
936
- async function attachMessageMentions(executor, conversationId, events) {
937
- const idsByIndex = events.map((event) => event.data.type === "message" && !event.data.redacted ? mentionedSlackUserIds(messageMentionText(event.data)) : []);
938
- const allIds = [...new Set(idsByIndex.flat())];
939
- if (allIds.length === 0) return events;
940
- const people = await resolveSlackMentions(executor, conversationId, allIds);
941
- return events.map((event, index) => {
942
- if (event.data.type !== "message") return event;
943
- const mentions = idsByIndex[index].flatMap((id) => {
944
- const person = people.get(id);
945
- return person ? [person] : [];
946
- });
947
- return mentions.length > 0 ? {
948
- ...event,
949
- data: {
950
- ...event.data,
951
- mentions
952
- }
953
- } : event;
965
+ // src/api/conversations/mentions.ts
966
+ /** Text in one event that the dashboard renders with mentions. */
967
+ function eventMentionTexts(data) {
968
+ switch (data.type) {
969
+ case "message": return data.redacted ? [] : [
970
+ data.text,
971
+ data.trustedSummary,
972
+ ...(data.events ?? []).map((event) => event.trustedSummary)
973
+ ];
974
+ case "assistant_message": return data.parts.map((part) => part.text);
975
+ case "compaction":
976
+ case "handoff": return [data.summary];
977
+ case "structured_event": return [data.presentation.preview, ...(data.presentation.details ?? []).map((detail) => detail.description)];
978
+ default: return [];
979
+ }
980
+ }
981
+ function briefMentionTexts(brief) {
982
+ return [
983
+ brief.summary,
984
+ brief.intent,
985
+ brief.outcome.text,
986
+ ...brief.decisions.flatMap((decision) => [decision.text, decision.by]),
987
+ ...brief.openDecisions.flatMap((decision) => [decision.text, decision.owner]),
988
+ ...brief.facts
989
+ ];
990
+ }
991
+ function withMentions(value, mentions) {
992
+ return mentions.length > 0 ? {
993
+ ...value,
994
+ mentions
995
+ } : value;
996
+ }
997
+ /**
998
+ * Attach the people that each event and the Brief of one conversation
999
+ * mention, resolved at read time.
1000
+ */
1001
+ async function attachConversationMentions(executor, conversationId, content) {
1002
+ const tenantId = (await loadConversationSlackTenantIds(executor, [conversationId])).get(conversationId);
1003
+ const sources = content.events.map((event) => ({
1004
+ tenantId,
1005
+ texts: eventMentionTexts(event.data)
1006
+ }));
1007
+ if (content.brief) sources.push({
1008
+ tenantId,
1009
+ texts: briefMentionTexts(content.brief)
954
1010
  });
1011
+ const mentions = await resolveMentions(executor, sources);
1012
+ return {
1013
+ briefMentions: content.brief ? mentions.at(-1) : [],
1014
+ events: content.events.map((event, index) => withMentions(event, mentions[index]))
1015
+ };
1016
+ }
1017
+ /** Attach the people that each activity preview mentions, resolved at read time. */
1018
+ async function attachActivityPreviewMentions(executor, previews) {
1019
+ const entries = [...previews];
1020
+ const tenants = await loadConversationSlackTenantIds(executor, entries.map(([conversationId]) => conversationId));
1021
+ const mentions = await resolveMentions(executor, entries.map(([conversationId, preview]) => ({
1022
+ tenantId: tenants.get(conversationId),
1023
+ texts: [preview.text]
1024
+ })));
1025
+ return new Map(entries.map(([conversationId, preview], index) => [conversationId, withMentions(preview, mentions[index])]));
955
1026
  }
956
1027
  // src/api/conversations/shared.ts
957
1028
  /** Format a Slack destination without exposing private channel names. */
@@ -1427,6 +1498,7 @@ async function readConversationFeedFromSql(options = {}) {
1427
1498
  readConversationActivityPreviews(db, conversationIds),
1428
1499
  readAutomationTitlesByConversationId(conversations)
1429
1500
  ]);
1501
+ const visibleActivityPreviews = await attachActivityPreviewMentions(getSqlExecutor(), new Map([...activityPreviewByConversation].filter(([conversationId]) => accessByConversation.get(conversationId)?.canViewPrivateContent)));
1430
1502
  const sidebarAnnotationsByConversation = await listConversationSidebarAnnotations(conversationIds, new Map(conversationIds.map((conversationId) => [conversationId, accessByConversation.get(conversationId)?.canViewPrivateContent ? annotationsByConversation.get(conversationId) ?? [] : []])));
1431
1503
  const assignedWork = new Set(conversationWork.assignedIds);
1432
1504
  const unfinishedWork = new Set(conversationWork.unfinishedIds);
@@ -1456,7 +1528,7 @@ async function readConversationFeedFromSql(options = {}) {
1456
1528
  ...unfinishedWork.has(conversation.conversationId) ? { unfinishedWork: true } : void 0
1457
1529
  };
1458
1530
  const annotations = access?.canViewPrivateContent ? annotationsByConversation.get(conversation.conversationId) ?? [] : [];
1459
- const activityPreview = access?.canViewPrivateContent ? activityPreviewByConversation.get(conversation.conversationId) : void 0;
1531
+ const activityPreview = visibleActivityPreviews.get(conversation.conversationId);
1460
1532
  const participants = access?.canViewPrivateContent ? participantsByConversation.get(conversation.conversationId) : void 0;
1461
1533
  return {
1462
1534
  ...summary,
@@ -1649,7 +1721,11 @@ async function readConversationDetailFromSql(conversationId, options) {
1649
1721
  conversationId,
1650
1722
  limit: options.limit
1651
1723
  }) : { events: [] };
1652
- const events = await attachMessageMentions(executor, conversationId, page.events);
1724
+ const brief = access?.canViewPrivateContent ? briefVersion?.content : void 0;
1725
+ const { briefMentions, events } = await attachConversationMentions(executor, conversationId, {
1726
+ ...brief ? { brief } : void 0,
1727
+ events: page.events
1728
+ });
1653
1729
  const metrics = metricsByConversation.get(conversationId);
1654
1730
  const auxiliaryCosts = auxiliaryCostsByConversation.get(conversationId);
1655
1731
  const childAgentTotals = childAgentTotalsReport(metrics, auxiliaryCosts);
@@ -1664,6 +1740,7 @@ async function readConversationDetailFromSql(conversationId, options) {
1664
1740
  ...childAgentTotals ? { childAgentTotals } : void 0,
1665
1741
  ...briefVersion ? { brief: {
1666
1742
  content: briefVersion.content,
1743
+ ...briefMentions.length > 0 ? { mentions: briefMentions } : void 0,
1667
1744
  updatedAt: briefVersion.createdAt.toISOString(),
1668
1745
  version: briefVersion.version
1669
1746
  } } : void 0,
@@ -1710,7 +1787,7 @@ async function readConversationEvents(conversationId, beforeValue, options = {})
1710
1787
  limit: options.limit ?? 500
1711
1788
  }) : { events: [] };
1712
1789
  return conversationEventPageSchema.parse({
1713
- events: await attachMessageMentions(getSqlExecutor(), conversationId, page.events),
1790
+ events: (await attachConversationMentions(getSqlExecutor(), conversationId, { events: page.events })).events,
1714
1791
  eventHistory: conversationEventHistory({
1715
1792
  canExposePayload,
1716
1793
  ...transcriptPurgedAtMs === void 0 ? void 0 : { transcriptPurgedAtMs }
@@ -3633,7 +3710,7 @@ async function readPeoplePluginReports(args) {
3633
3710
  reports: [],
3634
3711
  source: "plugins"
3635
3712
  });
3636
- const { getPluginProfileReports } = await import("./agent-hooks-BJ_5mlRH.js").then((n) => n.t);
3713
+ const { getPluginProfileReports } = await import("./agent-hooks-V4Hfc2tB.js").then((n) => n.t);
3637
3714
  return pluginOperationalReportFeedSchema.parse({
3638
3715
  generatedAt: new Date(nowMs).toISOString(),
3639
3716
  reports: await getPluginProfileReports({
@@ -4011,6 +4088,66 @@ function createPersonalTokenRoutes() {
4011
4088
  });
4012
4089
  return app;
4013
4090
  }
4091
+ // src/api/service-accounts/routes.ts
4092
+ /**
4093
+ * Public URL of the OAuth callback for one plugin's service account.
4094
+ *
4095
+ * It uses the request origin unless `JUNIOR_BASE_URL` is set, so the
4096
+ * provider sends the Admin back to the dashboard session that started it.
4097
+ */
4098
+ function callbackUrl(request, provider) {
4099
+ const base = process.env.JUNIOR_BASE_URL?.trim() || new URL(request.url).origin;
4100
+ return new URL(`api/service-accounts/${encodeURIComponent(provider)}/callback`, base.endsWith("/") ? base : `${base}/`).toString();
4101
+ }
4102
+ function requirePlugin(provider) {
4103
+ const plugin = pluginCatalogRuntime.getDefinition(provider);
4104
+ if (!plugin?.manifest.accounts?.serviceAccount) throwApiError(404, "Service account not found.");
4105
+ return plugin;
4106
+ }
4107
+ function callbackPage(title, message, status) {
4108
+ return htmlCallbackResponse(escapeXml(title), escapeXml(message), status, { footerMessage: "You can close this tab and return to the dashboard." });
4109
+ }
4110
+ /**
4111
+ * Create admin-only routes that list, connect, and disconnect plugin service
4112
+ * accounts.
4113
+ *
4114
+ * Whoever signs in decides which account everyone falls back to, so every
4115
+ * route, including the OAuth callback, requires a Junior admin. The callback
4116
+ * also accepts only a sign-in that the same Admin started.
4117
+ */
4118
+ function createServiceAccountRoutes() {
4119
+ const app = new Hono();
4120
+ app.get("/", requireAdmin, async () => jsonResponse(serviceAccountListSchema, { serviceAccounts: await Promise.all(serviceAccountPlugins(pluginCatalogRuntime.getProviders()).map(getServiceAccountStatus)) }));
4121
+ app.post("/:provider", requireAdmin, validateRequest("param", serviceAccountParamsSchema, "Invalid provider."), async (context) => {
4122
+ const { provider } = context.req.valid("param");
4123
+ const { authorizationUrl } = await startServiceAccountSignIn({
4124
+ plugin: requirePlugin(provider),
4125
+ redirectUrl: callbackUrl(context.req.raw, provider),
4126
+ startedBy: context.get("viewer").email
4127
+ });
4128
+ return jsonResponse(startServiceAccountSignInResponseSchema, { authorizationUrl: authorizationUrl.toString() });
4129
+ });
4130
+ app.get("/:provider/callback", requireAdmin, validateRequest("param", serviceAccountParamsSchema, "Invalid provider."), async (context) => {
4131
+ const { provider } = context.req.valid("param");
4132
+ const plugin = requirePlugin(provider);
4133
+ const viewer = context.get("viewer");
4134
+ const result = await finishServiceAccountSignIn({
4135
+ callback: new URL(context.req.url).searchParams,
4136
+ connectedBy: viewer.email,
4137
+ plugin
4138
+ });
4139
+ if (!result.ok) return callbackPage("Connection failed", result.message, 400);
4140
+ logInfo("dashboard.service_account.connected", { "app.credential.provider": provider });
4141
+ return callbackPage(`${plugin.manifest.displayName} service account connected`, `People who have not connected ${plugin.manifest.displayName} now use this account for what its policy allows.`, 200);
4142
+ });
4143
+ app.delete("/:provider", requireAdmin, validateRequest("param", serviceAccountParamsSchema, "Invalid provider."), async (context) => {
4144
+ const { provider } = context.req.valid("param");
4145
+ await disconnectServiceAccount(requirePlugin(provider));
4146
+ logInfo("dashboard.service_account.disconnected", { "app.credential.provider": provider });
4147
+ return jsonResponse(disconnectServiceAccountResponseSchema, { disconnected: true });
4148
+ });
4149
+ return app;
4150
+ }
4014
4151
  // src/chat/plugins/user-pages.ts
4015
4152
  /**
4016
4153
  * Runtime ownership for plugin user pages.
@@ -4334,6 +4471,18 @@ async function previewAutomationSchedule(user, id, intent) {
4334
4471
  throw error;
4335
4472
  }
4336
4473
  }
4474
+ // src/api/automations/mentions.ts
4475
+ /** Attach the people that each Automation instruction mentions, resolved at read time. */
4476
+ async function attachAutomationMentions(executor, automations) {
4477
+ const mentions = await resolveMentions(executor, automations.map((automation) => ({
4478
+ tenantId: automation.destination.teamId,
4479
+ texts: [automation.instruction]
4480
+ })));
4481
+ return automations.map((automation, index) => mentions[index].length > 0 ? {
4482
+ ...automation,
4483
+ mentions: mentions[index]
4484
+ } : automation);
4485
+ }
4337
4486
  // src/api/automations/routes.ts
4338
4487
  /** Translate expected edit failures; unexpected failures stay at the API boundary. */
4339
4488
  function editErrorResponse(error) {
@@ -4358,7 +4507,11 @@ function createAutomationRoutes() {
4358
4507
  app.get("/", requireViewer, validateRequest("query", automationListQuerySchema, "Invalid task list query."), async (context) => {
4359
4508
  const user = context.get("viewer");
4360
4509
  const query = context.req.valid("query");
4361
- return jsonResponse(automationListSchema, await readViewerAutomations(user, query));
4510
+ const list = await readViewerAutomations(user, query);
4511
+ return jsonResponse(automationListSchema, {
4512
+ ...list,
4513
+ automations: await attachAutomationMentions(getSqlExecutor(), list.automations)
4514
+ });
4362
4515
  });
4363
4516
  app.get("/event-catalog", requireViewer, () => {
4364
4517
  return jsonResponse(automationEventCatalogSchema, readAutomationEventCatalog());
@@ -4378,7 +4531,12 @@ function createAutomationRoutes() {
4378
4531
  const user = context.get("viewer");
4379
4532
  const params = context.req.valid("param");
4380
4533
  try {
4381
- return jsonResponse(automationExecutionListSchema, await readViewerAutomationExecutions(user, params.id));
4534
+ const list = await readViewerAutomationExecutions(user, params.id);
4535
+ const [automation] = await attachAutomationMentions(getSqlExecutor(), [list.automation]);
4536
+ return jsonResponse(automationExecutionListSchema, {
4537
+ ...list,
4538
+ automation
4539
+ });
4382
4540
  } catch (error) {
4383
4541
  if (error instanceof ViewerTaskNotFoundError) return jsonResponse(apiErrorSchema, { error: error.message }, { status: 404 });
4384
4542
  throw error;
@@ -4444,7 +4602,7 @@ function createAutomationRoutes() {
4444
4602
  });
4445
4603
  app.get("/:id", requireViewer, async (context) => {
4446
4604
  const automation = await readViewerAutomationSummary(context.get("viewer"), context.req.param("id"));
4447
- return automation ? jsonResponse(automationSummarySchema, automation) : jsonResponse(apiErrorSchema, { error: "Automation was not found." }, { status: 404 });
4605
+ return automation ? jsonResponse(automationSummarySchema, (await attachAutomationMentions(getSqlExecutor(), [automation]))[0]) : jsonResponse(apiErrorSchema, { error: "Automation was not found." }, { status: 404 });
4448
4606
  });
4449
4607
  app.delete("/:id", requireViewer, validateRequest("param", automationParamsSchema, "Invalid task."), async (context) => {
4450
4608
  const user = context.get("viewer");
@@ -4494,6 +4652,7 @@ function view(workspace) {
4494
4652
  id: workspace.id,
4495
4653
  name: workspace.name,
4496
4654
  setupScript: workspace.setupScript,
4655
+ vcpus: workspace.vcpus,
4497
4656
  repos: workspace.repos.map((repo) => ({
4498
4657
  provider: repo.provider,
4499
4658
  repo: repo.repo,
@@ -4519,6 +4678,7 @@ function createWorkspaceRoutes() {
4519
4678
  const [baselineSnapshot, workspaces] = await Promise.all([baselineSnapshotView(), listWorkspaces(getDb())]);
4520
4679
  return jsonResponse(workspaceListSchema, {
4521
4680
  baselineSnapshot,
4681
+ defaultVcpus: getSandboxResources()?.vcpus ?? null,
4522
4682
  workspaces: workspaces.map(view)
4523
4683
  });
4524
4684
  });
@@ -4581,7 +4741,7 @@ function readDescriptionText(home) {
4581
4741
  }
4582
4742
  /** Read discovered skill names for authenticated runtime diagnostics. */
4583
4743
  async function readSkillReports() {
4584
- const { discoverSkills } = await import("./skills-DyQBLIrK.js").then((n) => n.o);
4744
+ const { discoverSkills } = await import("./skills-D6_bcAuW.js").then((n) => n.o);
4585
4745
  const skills = await discoverSkills();
4586
4746
  return skillReportsSchema.parse(skills.map((skill) => ({
4587
4747
  name: skill.name,
@@ -4590,7 +4750,7 @@ async function readSkillReports() {
4590
4750
  }
4591
4751
  /** Read safe configured plugin metadata for authenticated runtime diagnostics. */
4592
4752
  async function readPlugins() {
4593
- const { pluginCatalogRuntime } = await import("./catalog-runtime-BN4DVxco.js").then((n) => n.t);
4753
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-Bpcs2b2L.js").then((n) => n.t);
4594
4754
  return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
4595
4755
  configKeys: plugin.manifest.configKeys ?? [],
4596
4756
  description: plugin.manifest.description,
@@ -4602,7 +4762,7 @@ async function readPlugins() {
4602
4762
  async function readRuntimeInfoReport() {
4603
4763
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
4604
4764
  import("./package-discovery-DJBompdd.js").then((n) => n.r),
4605
- import("./catalog-runtime-BN4DVxco.js").then((n) => n.t),
4765
+ import("./catalog-runtime-Bpcs2b2L.js").then((n) => n.t),
4606
4766
  readPlugins(),
4607
4767
  readSkillReports()
4608
4768
  ]);
@@ -4619,7 +4779,7 @@ async function readRuntimeInfoReport() {
4619
4779
  /** Read sanitized operational summaries contributed by plugins. */
4620
4780
  async function readPluginOperationalReportFeed() {
4621
4781
  const nowMs = Date.now();
4622
- const { getPluginOperationalReports } = await import("./agent-hooks-BJ_5mlRH.js").then((n) => n.t);
4782
+ const { getPluginOperationalReports } = await import("./agent-hooks-V4Hfc2tB.js").then((n) => n.t);
4623
4783
  return pluginOperationalReportFeedSchema.parse({
4624
4784
  source: "plugins",
4625
4785
  generatedAt: new Date(nowMs).toISOString(),
@@ -4643,6 +4803,7 @@ function createJuniorApi(options = {}) {
4643
4803
  app.route("/api/code", createCodeRoutes());
4644
4804
  app.route("/api/connections", createConnectionRoutes());
4645
4805
  app.route("/api/personal-tokens", createPersonalTokenRoutes());
4806
+ app.route("/api/service-accounts", createServiceAccountRoutes());
4646
4807
  app.route("/api/people", createPeopleRoutes());
4647
4808
  app.route("/api/locations", createLocationRoutes());
4648
4809
  app.route("/api/user-pages", createUserPageRoutes());
@@ -1,18 +1,19 @@
1
1
  import { n as ConversationWorkQueue, t as ConversationQueueMessage } from "./queue-C37RbDVc.js";
2
2
  import { t as ConversationStore } from "./store-CG0VJyye.js";
3
3
  import "./history-BgI33Kie.js";
4
- import { n as JuniorPluginSet } from "./plugins-B11Mfkmv.js";
4
+ import { n as JuniorPluginSet } from "./plugins-B_0Cr0MO.js";
5
5
  import { Hono } from "hono";
6
6
  import "@earendil-works/pi-ai/compat";
7
7
  import "@earendil-works/pi-ai/api/anthropic-messages";
8
+ import "ai";
8
9
  import { z } from "zod";
9
10
  import { Destination, OwnedObjectAnnotation, PluginRegistration, Source, User } from "@sentry/junior-plugin-api";
10
11
  import "@earendil-works/pi-agent-core";
12
+ import { Sandbox } from "@vercel/sandbox";
11
13
  import "@earendil-works/pi-ai";
12
14
  import "@sinclair/typebox";
13
- import { Sandbox } from "@vercel/sandbox";
14
- import { Client } from "@modelcontextprotocol/sdk/client";
15
15
  import "@modelcontextprotocol/sdk/client/auth.js";
16
+ import { Client } from "@modelcontextprotocol/sdk/client";
16
17
  import { Message, StateAdapter } from "chat";
17
18
  import "@chat-adapter/slack";
18
19
  declare const TURN_REASONING_LEVELS: readonly ["none", "low", "medium", "high", "xhigh"];
@@ -31,6 +32,8 @@ interface ModelProfileConfig {
31
32
  /** App-level profile input: a model id string or a full profile config. */
32
33
  type ModelProfileInput = string | ModelProfileConfig;
33
34
  interface BotModelConfig {
35
+ /** Decision model used by the passive reply router. */
36
+ decisionModelId?: string;
34
37
  /** Model used for embeddings. */
35
38
  embeddingModelId?: string;
36
39
  /** Model used for low-cost structured and utility calls. */
package/dist/app.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as ModelProfileInput, n as createApp, r as JuniorDashboardOptions, t as JuniorAppOptions } from "./app-PX2H1PxU.js";
2
- import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-B11Mfkmv.js";
1
+ import { i as ModelProfileInput, n as createApp, r as JuniorDashboardOptions, t as JuniorAppOptions } from "./app-BsBUs3rF.js";
2
+ import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-B_0Cr0MO.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 ModelProfileInput, createApp, defineJuniorPlugins };
package/dist/app.js CHANGED
@@ -1,39 +1,37 @@
1
- import { At as consumeSandboxEgressPermissionDeniedSignal, B as effectiveTaskOutcomes, Ct as ingestEvent, Dt as SANDBOX_EGRESS_PROXY_PATH, E as requestAttachmentDeletion, Et as shouldPropagateSandboxEgressTrace, F as logScheduledAutomationRunSkipped, Ft as resolveBaseUrl, I as scheduledAutomationRunAttributes, It as startOAuthFlow, Kt as getConfigDefaults, Lt as createUserTokenStore, Nt as formatProviderLabel, O as parseSlackThreadId, Ot as clearSandboxEgressSignals, St as processWorkspaceSnapshotJob, Tt as normalizeSandboxEgressTracePropagationDomains, U as stopConversationSession, W as recordSubagentEnded, b as unpublishedArtifactHeaders, i as executeCredentialedEgressRequest, jt as parseSandboxEgressCredentialToken, kt as consumeSandboxEgressAuthRequiredSignal, lt as listPendingAgentInvocationMailboxAppends, n as executeAgentRun, qt as setConfigDefaults, t as createAgentRunner, ut as listPendingAgentInvocationResults, v as publicArtifactHeaders, w as collectAttachmentGarbage, wt as resolveSandboxEgressProviderForHost, x as lookupSlackUserProfile, y as readPublicArtifact } from "./agent-runner-DGsFQw72.js";
2
- import { C as withContext, M as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, R as normalizeIdentityEmail, T as withSpan, b as setSpanStatus, f as logException, k as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, m as logWarn, p as logInfo, r as createRequestContext, v as setSentryUser, w as withLogContext, y as setSpanAttributes } from "./logging-DsHONhVm.js";
1
+ import { $ as projectConversationMessages, C as automationVersionOf, Cn as resolveSandboxEgressProviderForHost, Dn as clearSandboxEgressSignals, En as SANDBOX_EGRESS_PROXY_PATH, Hn as slackMention, In as resolveBaseUrl, Ln as startOAuthFlow, On as consumeSandboxEgressAuthRequiredSignal, Pn as formatProviderLabel, Tn as shouldPropagateSandboxEgressTrace, X as appendConversationMessages, Xn as slackEntitySchema, Zn as slackExternalRefIdSchema, _n as isExperimentalFeatureEnabled, ar as setConfigDefaults, b as admitEventAutomationRun, bn as createUserTokenStore, c as withScheduledAutomationLock, cn as SubscribedReplyReason, dn as getThreadStopDecision, gn as getExperimentalFeatures, i as readScheduledAutomation, ir as getConfigDefaults, jn as parseSandboxEgressCredentialToken, kn as consumeSandboxEgressPermissionDeniedSignal, l as blockEventAutomation, n as listScheduledAutomationsForTeam, nt as settleConversationTitleWork, o as saveScheduledAutomationInLock, p as findMatchingEventAutomations, s as scheduledRunId, u as collectEventAutomationMatchKeys, vn as setExperimentalFeatures, wn as normalizeSandboxEgressTracePropagationDomains, x as eventAutomationRunLimitReason, yn as executeCredentialedEgressRequest } from "./tasks-CjrS098O.js";
2
+ import { C as withContext, M as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, R as normalizeIdentityEmail, T as withSpan, b as setSpanStatus, f as logException, k as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, m as logWarn, p as logInfo, r as createRequestContext, v as setSentryUser, w as withLogContext, y as setSpanAttributes } from "./logging-DSMmkHXG.js";
3
3
  import { n as captureMessage, r as continueTrace } from "./sentry-BBUlHih9.js";
4
- import { t as JUNIOR_VERSION } from "./version-C0U6rHg0.js";
5
- import { _ as snapshotRuntimeConfig, d as restoreRuntimeConfig, f as setBotModelConfig, g as setSlackReactionConfig, h as setRuntimeLimits, i as getChatConfig, m as setProfiles, n as botConfig, o as getSlackBotToken, p as setCrossActorMidRunMode, u as resetRuntimeConfig } from "./config-_WO_AjCB.js";
4
+ import { t as JUNIOR_VERSION } from "./version-Ct049vav.js";
5
+ import { _ as snapshotRuntimeConfig, d as restoreRuntimeConfig, f as setBotModelConfig, g as setSlackReactionConfig, h as setRuntimeLimits, i as getChatConfig, m as setProfiles, n as botConfig, o as getSlackBotToken, p as setCrossActorMidRunMode, u as resetRuntimeConfig } from "./config-ULs6Zl9b.js";
6
6
  import { _ as slackMessageTsSchema, d as parseSlackTeamId, f as parseSlackUserId, h as slackUserIdSchema, m as slackTeamIdSchema, o as parseActorUserId, p as slackChannelIdSchema } from "./actor-tlxzqaRe.js";
7
- import { N as recordGoogleSignIn, _ as withConversationMutationLock, c as getConversationEventStore, d as getDb, f as getSqlExecutor, m as withConversationEventLock, r as readActorIdentity, u as getConversationStore } from "./viewer-CGvvRqKp.js";
7
+ import { N as recordGoogleSignIn, _ as withConversationMutationLock, c as getConversationEventStore, d as getDb, f as getSqlExecutor, m as withConversationEventLock, r as readActorIdentity, u as getConversationStore } from "./viewer-C-J0ewlH.js";
8
8
  import { a as juniorAgentInvocations, d as juniorDestinations, i as juniorAgentBindings, s as juniorConversations } from "./agent-invocations-Qfz7dWgU.js";
9
- import { a as juniorAutomationRuns, f as juniorConversationBriefs, h as juniorConversationEvents, s as juniorAutomations } from "./executor-RvG6kVe1.js";
10
- import { m as credentialLogContext } from "./registry-Du566MtJ.js";
11
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BN4DVxco.js";
12
- import { C as automationVersionOf, Kt as projectConversationMessages, P as slackMention, U as slackEntitySchema, Ut as appendConversationMessages, W as slackExternalRefIdSchema, Yt as settleConversationTitleWork, b as admitEventAutomationRun, c as withScheduledAutomationLock, i as readScheduledAutomation, l as blockEventAutomation, n as listScheduledAutomationsForTeam, o as saveScheduledAutomationInLock, p as findMatchingEventAutomations, s as scheduledRunId, u as collectEventAutomationMatchKeys, x as eventAutomationRunLimitReason } from "./tasks-CEXKTASS.js";
13
- import { $ as bindSlackDirectCredentialSubject, At as resolveRootVisibility, Ht as getSlackClient, Jt as getWorkspaceTeamId, Nt as listConversationAnnotations, Q as bindScheduledAutomationCredentialSubject, U as collectEventMatchKeys, Wt as isDmChannel, X as takeDueTimerWatches, Yt as runWithWorkspaceTeamId, Z as bindEventAutomationCredentialSubject, a as getPluginRoutes, at as getDashboardConversationLink, ct as setDashboardConversationLinkOptions, d as setPlugins, et as verifyEventAutomationCredentialSubject, f as validatePlugins, ft as createPluginLogger, h as setBriefsConfig, i as getPluginApiRoutes, lt as createPluginState, nt as verifySlackDirectCredentialSubject, pt as readConversationAccessFromSql, q as findMatchingWatches, st as getDashboardTaskLink, tt as verifyScheduledAutomationCredentialSubject, u as getPlugins } from "./agent-hooks-BJ_5mlRH.js";
14
- import { W as annotationCard } from "./conversation-DjN3mlog.js";
15
- import { O as withLock$1, w as getStateAdapter } from "./profile-DpYjfKke.js";
16
- import { l as getThreadStopDecision, o as SubscribedReplyReason } from "./pending-auth-D8J1uJUS.js";
17
- import { b as eventGuidance, f as slackChannelMessageEvent, k as renderTaskInput, l as getEventCatalog, m as slackChannelMessageRunsAutomation, p as slackChannelMessageReplyThreadTs, u as SLACK_EVENT_NAMESPACE } from "./session-stop-CIoFiwwe.js";
9
+ import { a as juniorAutomationRuns, f as juniorConversationBriefs, h as juniorConversationEvents, s as juniorAutomations } from "./executor-BoGNVEDn.js";
10
+ import { m as credentialLogContext } from "./registry-BL-osYWN.js";
11
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Bpcs2b2L.js";
12
+ import { B as stopConversationSession, C as requestAttachmentDeletion, L as effectiveTaskOutcomes, M as logScheduledAutomationRunSkipped, N as scheduledAutomationRunAttributes, T as parseSlackThreadId, V as recordSubagentEnded, _ as unpublishedArtifactHeaders, g as readPublicArtifact, h as publicArtifactHeaders, n as executeAgentRun, ot as listPendingAgentInvocationMailboxAppends, st as listPendingAgentInvocationResults, t as createAgentRunner, v as lookupSlackUserProfile, vt as processWorkspaceSnapshotJob, x as collectAttachmentGarbage, yt as ingestEvent } from "./agent-runner-DvTUyGTY.js";
13
+ import { $ as bindSlackDirectCredentialSubject, Gt as listConversationAnnotations, Ht as resolveRootVisibility, Q as bindScheduledAutomationCredentialSubject, Tt as readConversationAccessFromSql, U as collectEventMatchKeys, X as takeDueTimerWatches, Z as bindEventAutomationCredentialSubject, _t as getDashboardConversationLink, a as getPluginRoutes, bt as setDashboardConversationLinkOptions, ct as getSlackClient, d as setPlugins, et as verifyEventAutomationCredentialSubject, f as validatePlugins, h as setBriefsConfig, ht as runWithWorkspaceTeamId, i as getPluginApiRoutes, mt as getWorkspaceTeamId, nt as verifySlackDirectCredentialSubject, q as findMatchingWatches, tt as verifyScheduledAutomationCredentialSubject, u as getPlugins, ut as isDmChannel, wt as createPluginLogger, xt as createPluginState, yt as getDashboardTaskLink } from "./agent-hooks-V4Hfc2tB.js";
18
14
  import { n as getNextRunAtMs } from "./cadence-R7Em4RjE.js";
19
- import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-ClCIgh8E.js";
20
- import { a as getVercelConversationWorkQueue, g as isConversationQueueMessageRejectedError, h as conversationQueueMessageSchema, i as verifyWorkspaceSnapshotJobMessage, o as resolveConversationWorkQueueTopic, s as verifyConversationQueueMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-DVe37it2.js";
21
- import { A as hasRunnableConversationWork$1, M as isInvalidConversationRecordError, O as CONVERSATION_WORK_STALE_ENQUEUE_MS, S as removeActiveConversation, _ as hasRunnableConversationWork, c as clearExpiredConversationLease, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-DJLwq4x8.js";
22
- import { D as scheduledRunSchema } from "./automation-DWBFBenG.js";
23
- import { i as setExperimentalFeatures, n as getExperimentalFeatures, r as isExperimentalFeatureEnabled } from "./experimental-BNK1l1jv.js";
24
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-BHRxa5G4.js";
15
+ import { M as annotationCard } from "./conversation-CvuKJ3tA.js";
16
+ import { r as getStateAdapter, s as withLock$1 } from "./adapter-Dj5BTJRd.js";
17
+ import { M as renderTaskInput, S as eventGuidance, d as getEventCatalog, f as SLACK_EVENT_NAMESPACE, g as slackChannelMessageRunsAutomation, h as slackChannelMessageReplyThreadTs, m as slackChannelMessageEvent } from "./session-stop-HfKx-pky.js";
18
+ import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-HuPG2VMB.js";
19
+ import { a as getVercelConversationWorkQueue, g as isConversationQueueMessageRejectedError, h as conversationQueueMessageSchema, i as verifyWorkspaceSnapshotJobMessage, o as resolveConversationWorkQueueTopic, s as verifyConversationQueueMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-CbdVyaCo.js";
20
+ import { A as hasRunnableConversationWork$1, M as isInvalidConversationRecordError, O as CONVERSATION_WORK_STALE_ENQUEUE_MS, S as removeActiveConversation, _ as hasRunnableConversationWork, c as clearExpiredConversationLease, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-DzRbd5VT.js";
21
+ import { D as scheduledRunSchema } from "./automation-DrpcA-SX.js";
22
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-BrXMYPyo.js";
25
23
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-DOm9Y6qI.js";
26
- import { A as THREAD_OPTOUT_ACK, C as buildSlackInboundMessage, D as normalizeIncomingSlackThreadId, E as stopSlackThread, F as renderSlackObjectCard, I as createVercelAttachmentStorage, M as parseContent, N as runWithSlackInstallation, O as withNormalizedThreadId, P as verifySlackSignature, R as enqueueAgentDispatch, S as recordSkippedConversationMessage, T as isSlackMessageStopped, a as recordWebConversationActivity, c as createProductionSlackWebhookServices, f as createSlackWebApiStatusSender, j as startProcessingReaction, k as stopConversationTurn, l as getProductionSlackAdapter, n as conversationTurnIdForMessage, o as webActorFromEmail, s as createProductionConversationWorkOptions, t as appendAndEnqueueWebMessage, v as readViewerAutomationSummary, w as clearSlackPendingReactions, z as GET$3 } from "./web-input-Keb5GRWj.js";
27
- import { C as existingConversationId, N as recordAutomationExecution, c as getDispatchConversationId, d as getDispatchRecord, h as listPendingDispatchMailboxAppends, i as buildDispatchId, m as isTerminalDispatchStatus, o as confirmDispatchMailboxAppend, p as getPluginDispatchProjection, s as createOrGetDispatch, t as processPluginTask, x as notifyAutomationBlocked, y as markDispatchFailed } from "./task-runner-D3qJh4fK.js";
28
- import { o as getAuthPausedConversationTurnId, t as enqueueAgentInvocationResult } from "./result-BBbKA61B.js";
29
- import { r as enqueueAgentInvocation } from "./work-DRcsJ3hV.js";
30
- import { s as coerceThreadConversationState } from "./thread-state-W3f6kAtz.js";
31
- import { o as unlinkProvider } from "./connections-ag_1JOhB.js";
32
- import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-B-CPX_ag.js";
33
- import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-BzW4MaWU.js";
34
- import { t as processConversationWork } from "./worker-Cjo-QqPq.js";
35
- import { t as bindMessageAgent } from "./message-DyitL8no.js";
36
- import { t as bindSpawnAgent } from "./spawn-Dqfeo7XP.js";
24
+ import { A as THREAD_OPTOUT_ACK, C as buildSlackInboundMessage, D as normalizeIncomingSlackThreadId, E as stopSlackThread, F as renderSlackObjectCard, I as createVercelAttachmentStorage, M as parseContent, N as runWithSlackInstallation, O as withNormalizedThreadId, P as verifySlackSignature, R as enqueueAgentDispatch, S as recordSkippedConversationMessage, T as isSlackMessageStopped, a as recordWebConversationActivity, c as createProductionSlackWebhookServices, f as createSlackWebApiStatusSender, j as startProcessingReaction, k as stopConversationTurn, l as getProductionSlackAdapter, n as conversationTurnIdForMessage, o as webActorFromEmail, s as createProductionConversationWorkOptions, t as appendAndEnqueueWebMessage, v as readViewerAutomationSummary, w as clearSlackPendingReactions, z as GET$3 } from "./web-input-C_xB3RXp.js";
25
+ import { C as existingConversationId, N as recordAutomationExecution, c as getDispatchConversationId, d as getDispatchRecord, h as listPendingDispatchMailboxAppends, i as buildDispatchId, m as isTerminalDispatchStatus, o as confirmDispatchMailboxAppend, p as getPluginDispatchProjection, s as createOrGetDispatch, t as processPluginTask, x as notifyAutomationBlocked, y as markDispatchFailed } from "./task-runner-DGnd_B5X.js";
26
+ import { o as getAuthPausedConversationTurnId, t as enqueueAgentInvocationResult } from "./result-DS7V4a3-.js";
27
+ import { r as enqueueAgentInvocation } from "./work-D829Ue7k.js";
28
+ import { s as coerceThreadConversationState } from "./thread-state-CqkYowEz.js";
29
+ import { o as unlinkProvider } from "./connections-CZ7HhEmN.js";
30
+ import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-BKcv5rBe.js";
31
+ import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-9LICOzcL.js";
32
+ import { t as processConversationWork } from "./worker-BRTYzlpk.js";
33
+ import { t as bindMessageAgent } from "./message-zaj5gBbS.js";
34
+ import { t as bindSpawnAgent } from "./spawn-BWqK6EwM.js";
37
35
  import { createRequire } from "node:module";
38
36
  import { Hono } from "hono";
39
37
  import { z } from "zod";
@@ -5297,6 +5295,8 @@ function dashboardHostRoutePaths(dashboard, authenticatedRoutes = []) {
5297
5295
  "/api/people/*",
5298
5296
  "/api/personal-tokens",
5299
5297
  "/api/personal-tokens/*",
5298
+ "/api/service-accounts",
5299
+ "/api/service-accounts/*",
5300
5300
  "/api/workspaces",
5301
5301
  "/api/workspaces/*",
5302
5302
  "/api/config",
@@ -1,4 +1,4 @@
1
- import { ct as extractAssistantText } from "./tasks-CEXKTASS.js";
1
+ import { Gt as extractAssistantText } from "./tasks-CjrS098O.js";
2
2
  // src/chat/no-reply.ts
3
3
  const NO_REPLY_MARKER = "[[NO_REPLY]]";
4
4
  /**