@sentry/junior 0.263.0 → 0.265.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 (67) hide show
  1. package/README.md +1 -1
  2. package/dist/{adapter-BIacI0Bt.js → adapter-cUkPH3Om.js} +1 -1
  3. package/dist/{admin-C7vUk7s9.js → admin-Cf0rDmWV.js} +1 -1
  4. package/dist/{agent-runner-BUBas7Yy.js → agent-runner-C6MwHJEs.js} +296 -238
  5. package/dist/api/schema.d.ts +213 -16
  6. package/dist/api/schema.js +3 -3
  7. package/dist/api.js +107 -40
  8. package/dist/{app-Bo0kB987.d.ts → app-Csbi9dW7.d.ts} +4 -3
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +101 -393
  11. package/dist/{assistant-reply-BFmjgJjD.js → assistant-reply-UPA8vKlC.js} +1 -1
  12. package/dist/{automation-CWX0qL8U.js → automation-2RbKzpMT.js} +30 -9
  13. package/dist/{briefs-h55v5lX9.js → briefs-DRjx8kQ9.js} +3 -3
  14. package/dist/{catalog-runtime-Suf-aLlh.js → catalog-runtime-D3qbJlYz.js} +1 -1
  15. package/dist/cli/chat.js +15 -15
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/init.js +4 -18
  18. package/dist/cli/main.js +4 -4
  19. package/dist/cli/plugins.js +4 -4
  20. package/dist/cli/snapshot-create.js +4 -4
  21. package/dist/cli/upgrade.js +3 -3
  22. package/dist/{client-DZBCBj1M.js → client-DX34VNtH.js} +3 -8
  23. package/dist/{config-Dnv8KmNs.js → config-BayQ9hHH.js} +100 -3
  24. package/dist/{connections-Br0_xv27.js → connections-mpN5Lsnj.js} +11 -10
  25. package/dist/{conversation-privacy-FY8yc2q3.js → conversation-privacy-frjQCJa9.js} +1 -1
  26. package/dist/{credential-sync-BvkiyWF5.js → credential-sync-CZmyDNdR.js} +20 -20
  27. package/dist/{agent-hooks-CqnZfuCt.js → credentialed-C6pKlB1p.js} +3197 -66
  28. package/dist/{executor-J9k2sp9m.js → executor-CAr7xQr2.js} +10 -300
  29. package/dist/{images-DV2FlEGL.js → images-B2yA3HWE.js} +2 -2
  30. package/dist/instrumentation.js +41 -25
  31. package/dist/{job-queue-B4yTgklN.js → job-queue-Cjo6Yg_b.js} +53 -14
  32. package/dist/{logging-Dk_FpF36.js → logging-D2QBriUo.js} +19 -32
  33. package/dist/{message-BzseAFH1.js → message-C9ymnpBS.js} +4 -4
  34. package/dist/nitro.d.ts +17 -2
  35. package/dist/nitro.js +26 -27
  36. package/dist/{oauth-callback-server-bTspTMCC.js → oauth-callback-server-BtMf3TPZ.js} +2 -2
  37. package/dist/{prompt-CxatQVaj.js → prompt-CvaDdSX3.js} +1 -1
  38. package/dist/{registry-BFzQFV_y.js → registry-COTeZ2cV.js} +1 -1
  39. package/dist/{resolve-CnRHib0U.js → resolve-g9PKz9pH.js} +7 -106
  40. package/dist/{result-DczfmNBa.js → result-COnC42GR.js} +8 -8
  41. package/dist/{runner-CJd9Wec-.js → runner-BnTNS7x_.js} +10 -10
  42. package/dist/{sandbox-egress-signals-DUmVkOx4.js → sandbox-egress-signals-C_IIdLFk.js} +1 -1
  43. package/dist/{schema-QidbykYl.js → schema-D5Amlzkp.js} +44 -3
  44. package/dist/{sentry-BBUlHih9.js → sentry-MDkYAVPV.js} +3 -6
  45. package/dist/{service-account-BI2kQDrb.js → service-account-CwvToidT.js} +3 -3
  46. package/dist/{service-account-x2QZXm4X.js → service-account-YdYftwV2.js} +5 -5
  47. package/dist/{session-stop-CtyJsnEj.js → session-stop-CpCUy1ZJ.js} +121 -81
  48. package/dist/{skills-Dbzx9-rS.js → skills-Bb2KaJ3m.js} +2 -2
  49. package/dist/{spawn-D8WU99UV.js → spawn-mbTcrLb3.js} +2 -2
  50. package/dist/{store-TKg1HVKx.js → store-CqRnaZSq.js} +3 -3
  51. package/dist/{store-UlOrW6JC.js → store-DdT74Lvq.js} +18 -9
  52. package/dist/{task-queue-BRB49H-J.js → task-queue-8XjDIORF.js} +14 -19
  53. package/dist/{task-runner-C575f2Dd.js → task-runner-6mLmG6g_.js} +46 -28
  54. package/dist/{tasks-LOItiYgL.js → tasks-DGbrur6x.js} +14 -2075
  55. package/dist/{thread-state-IDHdZA7R.js → thread-state-D45lz-oC.js} +5 -5
  56. package/dist/{turn-failure-response-h_LSXJ-M.js → turn-failure-response-CaEPLSBn.js} +7 -7
  57. package/dist/{turn-lifecycle-Cvi6Sb8Y.js → turn-lifecycle-C35IyRGp.js} +1 -1
  58. package/dist/{turn-session-routing-5Nyv4fso.js → turn-session-routing-BKx6rfVd.js} +1 -1
  59. package/dist/{validation-BeTriWC2.js → validation-C0X3CX51.js} +1 -1
  60. package/dist/{version-BQX_hLDC.js → version-BPHgJwnm.js} +1 -1
  61. package/dist/version.js +1 -1
  62. package/dist/{viewer-DmNRM88V.js → viewer-B2wXNspU.js} +21 -5
  63. package/dist/{web-input-BHcGXSox.js → web-input-Y6aXvmfa.js} +145 -46
  64. package/dist/{work-DLJMV02b.js → work-DMbqK0kT.js} +10 -10
  65. package/dist/{worker-vfG2ESg1.js → worker-B-rDJ3XN.js} +8 -6
  66. package/package.json +10 -9
  67. package/dist/profile-Dq5I7TV1.js +0 -582
package/dist/api.js CHANGED
@@ -1,31 +1,30 @@
1
- import { D as AutomationConflictError, E as sameDefinitionValue, I 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-LOItiYgL.js";
2
- import { p as escapeXml } from "./client-DZBCBj1M.js";
3
- import { f as logException, m as logWarn, p as logInfo } from "./logging-Dk_FpF36.js";
1
+ import { D as AutomationConflictError, E as sameDefinitionValue, I as loadTurnProjection, O as automationRevision, S as automationDefinition, Sn as piMessageFromHistoryItem, T as readAutomationVersion, a as saveScheduledAutomation, k as requireAutomationRevision, nt as fallbackShortTitle, v as saveEventAutomation, y as setEventAutomationStatus } from "./tasks-DGbrur6x.js";
2
+ import { p as escapeXml } from "./client-DX34VNtH.js";
3
+ import { f as logException, m as logWarn, p as logInfo } from "./logging-D2QBriUo.js";
4
4
  import { d as parseSlackTeamId, g as parseSlackMessageTs, l as parseSlackChannelId } from "./actor-tlxzqaRe.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-DmNRM88V.js";
5
+ import { C as parseSessionSource, D as agentTurnUsageSchema, O as hasAgentTurnUsage, a as resolveViewerUser, d as getConversationStore, f as getDb, g as loadConversationSlackTenantIds, h as withConversationEventLock, k as resolveRootConversationId, l as getConversationEventStore, p as getSqlExecutor, s as updateViewerDisplayName, t as findUserByEmail, w as addAgentTurnUsage, y as locationFromRow } from "./viewer-B2wXNspU.js";
6
6
  import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, o as conversationReadColumns, s as juniorConversations } from "./agent-invocations-CxKldAeB.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-J9k2sp9m.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-CAr7xQr2.js";
8
8
  import { d as contextProvenance } from "./history-AY8rs-FR.js";
9
- import { n as pluginCatalogRuntime } from "./catalog-runtime-Suf-aLlh.js";
10
- import { F as AutomationEditError, G as conversationSubtree, I as eventAutomationTriggerAvailable, K as conversationSubtreeColumns, P as editEventAutomation, R as resolveTaskOutcomes, S as readLiveAttachment, T as parseSlackThreadId, U as listChildAgents, j as editScheduledAutomation, m as readStats } from "./agent-runner-BUBas7Yy.js";
11
- import { At as conversationArchivedForUser, C as WorkspaceValidationError, Dt as readConversationAccessFromSql, Et as createPluginLogger, Ft as viewerConversationMembership, Jt as listConversationAnnotationsById, Lt as readLatestConversationBrief, M as workspaceRepoCheckoutPath, Mt as conversationIsMemberRoot, Nt as conversationNotArchivedForEmail, O as SANDBOX_RUNTIME, Ot as conversationArchiveTimes, Pt as conversationNotArchivedForUser, Qt as createPluginCache, Rt as readConversationEventPage, S as updateWorkspace, Zt as lookupSlackUser, _ as deleteWorkspace, b as listWorkspaces, ct as getSlackClient, g as createWorkspace, jt as conversationHasParticipantUser, kt as conversationArchivedForEmail, pt as withSlackRetries, qt as listConversationAnnotations, u as getPlugins, v as getWorkspace, x as listWorkspacesByRepository, zt as buildSentryConversationUrl } from "./agent-hooks-CqnZfuCt.js";
9
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-D3qbJlYz.js";
10
+ import { F as AutomationEditError, K as conversationSubtree, P as editEventAutomation, R as resolveTaskOutcomes, S as readLiveAttachment, T as parseSlackThreadId, W as listChildAgents, j as editScheduledAutomation, m as readStats, q as conversationSubtreeColumns, z as listOwnedWatches } from "./agent-runner-C6MwHJEs.js";
11
+ import { An as createPluginLogger, C as listWorkspaces, E as WorkspaceValidationError, Fn as conversationHasParticipantUser, Hn as readConversationEventPage, In as conversationIsMemberRoot, Ln as conversationNotArchivedForEmail, M as create, Mn as conversationArchiveTimes, N as hash, Nn as conversationArchivedForEmail, Pn as conversationArchivedForUser, Qn as listConversationAnnotationsById, Rn as conversationNotArchivedForUser, T as updateWorkspace, Un as buildSentryConversationUrl, Vn as readLatestConversationBrief, Zn as listConversationAnnotations, an as withSlackRetries, b as deleteWorkspace, en as getSlackClient, j as SANDBOX_RUNTIME, jn as readConversationAccessFromSql, n as createUserTokenStore, nr as createPluginCache, p as getPlugins, tr as lookupSlackUser, w as listWorkspacesByRepository, wt as workspaceRepoCheckoutPath, x as getWorkspace, y as createWorkspace, zn as viewerConversationMembership } from "./credentialed-C6pKlB1p.js";
12
12
  import { t as getFirstRunAtMs } from "./cadence-R7Em4RjE.js";
13
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-B0baEwoA.js";
14
- import { n as hash, t as create } from "./profile-Dq5I7TV1.js";
15
- import { h as getChildAgentLabel } from "./store-TKg1HVKx.js";
16
- import { d as getEventCatalog, x as automationEventCatalog } from "./session-stop-CtyJsnEj.js";
17
- import { d as getSandboxResources, t as getCachedSnapshot } from "./resolve-CnRHib0U.js";
18
- import { a as getVercelConversationWorkQueue } from "./job-queue-B4yTgklN.js";
19
- import { a as cancelHumanFacingPendingMessages, h as getConversation } from "./store-UlOrW6JC.js";
20
- import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-x2QZXm4X.js";
21
- 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-CWX0qL8U.js";
14
+ import { h as getChildAgentLabel } from "./store-CqRnaZSq.js";
15
+ import { d as getEventCatalog, x as automationEventCatalog } from "./session-stop-CpCUy1ZJ.js";
16
+ import { s as getSandboxResources, t as getCachedSnapshot } from "./resolve-g9PKz9pH.js";
17
+ import { a as getVercelConversationWorkQueue } from "./job-queue-Cjo6Yg_b.js";
18
+ import { a as cancelHumanFacingPendingMessages, h as getConversation } from "./store-DdT74Lvq.js";
19
+ import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-YdYftwV2.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-2RbKzpMT.js";
22
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";
23
- 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-BHcGXSox.js";
24
- import { F as conversationAggregateColumns, I as conversationRangeColumns, M as readAutomationTitlesByConversationId, P as conversationActiveDaysColumn } from "./task-runner-C575f2Dd.js";
25
- import { d as legacyWebMailboxMetadataSchema } from "./result-DczfmNBa.js";
26
- import { a as startConnection, l as getWebAuthorization, n as isConnectableProvider, r as listConnections, t as disconnectConnection, u as htmlCallbackResponse } from "./connections-Br0_xv27.js";
27
- import { t as decodeInputImages } from "./images-DV2FlEGL.js";
28
- 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-QidbykYl.js";
22
+ import { B as readHealthReport, I as getAttachmentStorage, _ 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-Y6aXvmfa.js";
23
+ import { F as conversationAggregateColumns, I as conversationRangeColumns, M as readAutomationTitlesByConversationId, P as conversationActiveDaysColumn } from "./task-runner-6mLmG6g_.js";
24
+ import { d as legacyWebMailboxMetadataSchema } from "./result-COnC42GR.js";
25
+ import { a as startConnection, l as getWebAuthorization, n as isConnectableProvider, r as listConnections, t as disconnectConnection, u as htmlCallbackResponse } from "./connections-mpN5Lsnj.js";
26
+ import { t as decodeInputImages } from "./images-B2yA3HWE.js";
27
+ import { A as activityHours$1, C as personParamsSchema, D as locationDirectoryReportSchema, E as locationDetailReportSchema, H as codePersonReportSchema, I as disconnectConnectionResponseSchema, L as startConnectionResponseSchema, N as connectionListSchema, O as locationParamsSchema, P as connectionParamsSchema, Q as apiErrorSchema, S as actorProfileReportSchema, U as codeRepositoryParamsSchema, V as codeOverviewReportSchema, W as codeRepositoryReportSchema, X as stopConversationTurnResponseSchema, Y as conversationChildAgentsReportSchema, Z 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 conversationWatchesReportSchema, s as workspaceParamsSchema, u as disconnectServiceAccountResponseSchema, w as personalSpendReportSchema, x as actorDirectoryReportSchema, y as personalTokenParamsSchema } from "./schema-D5Amlzkp.js";
29
28
  import { Hono } from "hono";
30
29
  import path from "node:path";
31
30
  import { z } from "zod";
@@ -889,6 +888,21 @@ function decodeConversationCursor(args) {
889
888
  return;
890
889
  }
891
890
  }
891
+ // src/api/conversations/first-message.ts
892
+ /**
893
+ * Read the text of the first human message for each untitled conversation.
894
+ * Read-time titles use it while the generated title is still unset.
895
+ */
896
+ async function readFirstHumanMessageTexts(db, conversations) {
897
+ const untitledIds = conversations.flatMap((conversation) => conversation.title ? [] : [conversation.conversationId]);
898
+ if (untitledIds.length === 0) return /* @__PURE__ */ new Map();
899
+ const text = sql`${juniorConversationEvents.payload}->>'text'`;
900
+ const rows = await db.selectDistinctOn([juniorConversationEvents.conversationId], {
901
+ conversationId: juniorConversationEvents.conversationId,
902
+ text: text.as("text")
903
+ }).from(juniorConversationEvents).where(and(inArray(juniorConversationEvents.conversationId, untitledIds), eq(juniorConversationEvents.type, "message"), sql`${juniorConversationEvents.payload}->>'role' = 'user'`, sql`coalesce(${juniorConversationEvents.payload}->'meta'->'author'->>'isBot', 'false') <> 'true'`, isNotNull(sql`nullif(btrim(${text}), '')`))).orderBy(juniorConversationEvents.conversationId, asc(juniorConversationEvents.createdAt), asc(juniorConversationEvents.seq));
904
+ return new Map(rows.map((row) => [row.conversationId, row.text]));
905
+ }
892
906
  // src/api/mentions.ts
893
907
  const SLACK_USER_MENTION_RE = /<@([UW][A-Z0-9]+)(?:\|[^<>]*)?>/g;
894
908
  function mentionedSlackUserIds(texts) {
@@ -1102,7 +1116,7 @@ function titleFromConversation(args) {
1102
1116
  return (args.canViewPrivateContent ? void 0 : privateConversationLabel(slackConversation)) ?? args.conversation.title ?? args.automationTitle ?? slackStatsLocationLabel({
1103
1117
  channel: slackThread?.channelId,
1104
1118
  channelName: effectiveChannelName
1105
- }) ?? (args.conversation.source === "plugin" ? "Automation run" : surfaceFallbackLabel(args.surface));
1119
+ }) ?? (args.conversation.source === "plugin" ? "Automation run" : fallbackShortTitle(args.firstHumanMessageText ?? "", surfaceFallbackLabel(args.surface)));
1106
1120
  }
1107
1121
  function channelNameFromConversation(conversation, canViewPrivateContent, visibility) {
1108
1122
  const effectiveChannelName = conversation.channelName;
@@ -1156,6 +1170,7 @@ function conversationSummaryFromStoredConversation(args) {
1156
1170
  automationTitle: args.automationTitle,
1157
1171
  canViewPrivateContent,
1158
1172
  conversation,
1173
+ firstHumanMessageText: args.firstHumanMessageText,
1159
1174
  surface,
1160
1175
  visibility
1161
1176
  }),
@@ -1482,7 +1497,7 @@ async function readConversationFeedFromSql(options = {}) {
1482
1497
  } : void 0);
1483
1498
  const conversations = rows.map((row) => conversationFromRow(row));
1484
1499
  const conversationIds = conversations.map((conversation) => conversation.conversationId);
1485
- const [accessByConversation, archiveTimesByConversation, annotationsByConversation, auxiliaryCostsByRoot, metricsByRoot, participantsByConversation, teamDomainByTeamId, conversationWork, lastUserMessageAtByConversation, activityPreviewByConversation, automationTitleByConversation] = await Promise.all([
1500
+ const [accessByConversation, archiveTimesByConversation, annotationsByConversation, auxiliaryCostsByRoot, metricsByRoot, participantsByConversation, teamDomainByTeamId, conversationWork, lastUserMessageAtByConversation, activityPreviewByConversation, automationTitleByConversation, firstHumanMessageTextByConversation] = await Promise.all([
1486
1501
  readConversationAccessFromSql(db, conversationIds, options.viewer),
1487
1502
  conversationArchiveTimes(db, conversationIds, filter?.kind === "viewer" ? { userId: filter.userId } : filter?.kind === "actorEmail" ? { email: filter.email } : void 0),
1488
1503
  listConversationAnnotationsById(db, conversationIds),
@@ -1493,7 +1508,8 @@ async function readConversationFeedFromSql(options = {}) {
1493
1508
  listConversationWork(conversationIds),
1494
1509
  readLastUserMessageAtByConversation(db, conversationIds),
1495
1510
  readConversationActivityPreviews(db, conversationIds),
1496
- readAutomationTitlesByConversationId(conversations)
1511
+ readAutomationTitlesByConversationId(conversations),
1512
+ readFirstHumanMessageTexts(db, conversations)
1497
1513
  ]);
1498
1514
  const visibleActivityPreviews = await attachActivityPreviewMentions(getSqlExecutor(), new Map([...activityPreviewByConversation].filter(([conversationId]) => accessByConversation.get(conversationId)?.canViewPrivateContent)));
1499
1515
  const sidebarAnnotationsByConversation = await listConversationSidebarAnnotations(conversationIds, new Map(conversationIds.map((conversationId) => [conversationId, accessByConversation.get(conversationId)?.canViewPrivateContent ? annotationsByConversation.get(conversationId) ?? [] : []])));
@@ -1515,6 +1531,7 @@ async function readConversationFeedFromSql(options = {}) {
1515
1531
  auxiliaryCosts: auxiliaryCosts?.total,
1516
1532
  ...childAgentTotals ? { childAgentTotals } : void 0,
1517
1533
  durationMs: metrics?.durationMs ?? row.conversation.durationMs,
1534
+ firstHumanMessageText: firstHumanMessageTextByConversation.get(conversation.conversationId),
1518
1535
  teamDomainByTeamId,
1519
1536
  ...row.location?.visibility === "public" ? { locationId: row.location.id } : void 0,
1520
1537
  usage: metrics?.usage ?? row.conversation.usage ?? void 0
@@ -1627,7 +1644,11 @@ async function readConversationAgentTree(conversationId, viewer) {
1627
1644
  }
1628
1645
  if (ids.length < 2) return;
1629
1646
  const root = parentId ? void 0 : await getConversationStore().get({ conversationId: ids[0] });
1630
- const [access, automationTitleByConversation] = await Promise.all([readConversationAccessFromSql(getDb(), ids, viewer), readAutomationTitlesByConversationId(root ? [root] : [])]);
1647
+ const [access, automationTitleByConversation, firstHumanMessageTextByConversation] = await Promise.all([
1648
+ readConversationAccessFromSql(getDb(), ids, viewer),
1649
+ readAutomationTitlesByConversationId(root ? [root] : []),
1650
+ readFirstHumanMessageTexts(getDb(), root ? [root] : [])
1651
+ ]);
1631
1652
  return await Promise.all(ids.map(async (id) => {
1632
1653
  const itemAccess = access.get(id);
1633
1654
  if (root?.conversationId === id) return {
@@ -1636,7 +1657,8 @@ async function readConversationAgentTree(conversationId, viewer) {
1636
1657
  access: itemAccess,
1637
1658
  automationTitle: automationTitleByConversation.get(id),
1638
1659
  conversation: root,
1639
- durationMs: 0
1660
+ durationMs: 0,
1661
+ firstHumanMessageText: firstHumanMessageTextByConversation.get(id)
1640
1662
  }).displayTitle
1641
1663
  };
1642
1664
  if (!itemAccess?.canViewPrivateContent) return {
@@ -1668,6 +1690,7 @@ function projectConversationDetail(args) {
1668
1690
  ...args.childAgentTotals ? { childAgentTotals: args.childAgentTotals } : void 0,
1669
1691
  conversation,
1670
1692
  durationMs: args.durationMs,
1693
+ firstHumanMessageText: args.firstHumanMessageText,
1671
1694
  ...args.locationId ? { locationId: args.locationId } : void 0,
1672
1695
  ...args.teamDomainByTeamId ? { teamDomainByTeamId: args.teamDomainByTeamId } : void 0,
1673
1696
  usage: args.usage
@@ -1696,12 +1719,13 @@ async function readConversationDetailFromSql(conversationId, options) {
1696
1719
  if (!record) return void 0;
1697
1720
  const archivedAtMs = options.viewer ? await readConversationArchivedAt(options.viewer, conversationId) : void 0;
1698
1721
  const executor = getSqlExecutor();
1699
- const [accessByConversation, annotations, automationTitleByConversation, auxiliaryCostsByConversation, briefVersion, modelUsage, metricsByConversation, participantsByConversation, sourceTask, teamDomainByTeamId] = await Promise.all([
1722
+ const [accessByConversation, annotations, automationTitleByConversation, auxiliaryCostsByConversation, briefVersion, firstHumanMessageTextByConversation, modelUsage, metricsByConversation, participantsByConversation, sourceTask, teamDomainByTeamId] = await Promise.all([
1700
1723
  readConversationAccessFromSql(getDb(), [conversationId], options.viewer),
1701
1724
  listConversationAnnotations(getDb(), conversationId),
1702
1725
  readAutomationTitlesByConversationId([record.conversation]),
1703
1726
  readConversationAuxiliaryCostsFromSql(getDb(), [conversationId]),
1704
1727
  readLatestConversationBrief(getDb(), conversationId),
1728
+ readFirstHumanMessageTexts(getDb(), [record.conversation]),
1705
1729
  record.conversation.transcriptPurgedAtMs === void 0 ? readConversationModelUsageFromSql(executor, { conversationId }) : Promise.resolve([]),
1706
1730
  readConversationTreeMetricsFromSql(getDb(), [conversationId]),
1707
1731
  readConversationParticipants(getDb(), [conversationId]),
@@ -1743,6 +1767,7 @@ async function readConversationDetailFromSql(conversationId, options) {
1743
1767
  } } : void 0,
1744
1768
  durationMs: metrics?.durationMs ?? record.durationMs,
1745
1769
  events,
1770
+ firstHumanMessageText: firstHumanMessageTextByConversation.get(conversationId),
1746
1771
  modelUsage,
1747
1772
  participants: participantsByConversation.get(conversationId) ?? [],
1748
1773
  ...sourceTask ? { sourceTask } : void 0,
@@ -2357,6 +2382,39 @@ function viewerWebMessages(messages, viewer) {
2357
2382
  }] : [];
2358
2383
  });
2359
2384
  }
2385
+ // src/api/conversations/watches.ts
2386
+ /**
2387
+ * Load the active Watches that one Conversation owns, or throw a standard API
2388
+ * not-found error. Viewers who cannot see private content get only the
2389
+ * resource type, event types, and times of each Watch.
2390
+ */
2391
+ async function requireConversationWatches(conversationId, options = {}) {
2392
+ if (!await getConversationStore().get({ conversationId })) throwApiError(404, "Conversation not found.");
2393
+ const [accessByConversation, owned] = await Promise.all([readConversationAccessFromSql(getDb(), [conversationId], options.viewer), listOwnedWatches(conversationId)]);
2394
+ const canExposePayload = accessByConversation.get(conversationId)?.canViewPrivateContent ?? false;
2395
+ const watches = owned.map(({ childAgent, watch }) => ({
2396
+ ...childAgent ? { childAgent: {
2397
+ conversationId: childAgent.conversationId,
2398
+ ...canExposePayload && childAgent.name ? { name: childAgent.name } : void 0
2399
+ } } : void 0,
2400
+ createdAt: new Date(watch.createdAtMs).toISOString(),
2401
+ events: watch.events,
2402
+ expiresAt: new Date(watch.expiresAtMs).toISOString(),
2403
+ ...watch.firesAtMs !== void 0 ? { firesAt: new Date(watch.firesAtMs).toISOString() } : void 0,
2404
+ id: watch.id,
2405
+ namespace: watch.namespace,
2406
+ resourceType: watch.resourceType,
2407
+ ...canExposePayload ? {
2408
+ intent: watch.intent,
2409
+ label: watch.label,
2410
+ ...watch.match ? { match: watch.match } : void 0
2411
+ } : { redacted: true }
2412
+ }));
2413
+ return conversationWatchesReportSchema.parse({
2414
+ conversationId,
2415
+ watches
2416
+ });
2417
+ }
2360
2418
  // src/api/conversations/routes.ts
2361
2419
  /** Create the HTTP routes owned by the conversations API. */
2362
2420
  function createConversationRoutes(options) {
@@ -2418,6 +2476,11 @@ function createConversationRoutes(options) {
2418
2476
  const viewer = context.get("viewer");
2419
2477
  return jsonResponse(conversationChildAgentsReportSchema, await requireConversationChildAgents(conversationId, { viewer }));
2420
2478
  });
2479
+ app.get("/:conversationId/watches", validateRequest("param", conversationParamsSchema, "Invalid route parameters."), async (context) => {
2480
+ const { conversationId } = context.req.valid("param");
2481
+ const viewer = context.get("viewer");
2482
+ return jsonResponse(conversationWatchesReportSchema, await requireConversationWatches(conversationId, { viewer }));
2483
+ });
2421
2484
  app.get("/:conversationId/pending-messages", validateRequest("param", conversationParamsSchema, "Invalid route parameters."), async (context) => {
2422
2485
  const { conversationId } = context.req.valid("param");
2423
2486
  const viewer = context.get("viewer");
@@ -3016,6 +3079,7 @@ function summaryFromRow(row, options = {}) {
3016
3079
  automationTitle: options.automationTitle,
3017
3080
  conversation,
3018
3081
  durationMs: options.metrics?.durationMs ?? row.durationMs,
3082
+ firstHumanMessageText: options.firstHumanMessageText,
3019
3083
  ...options.access?.visibility === "public" && row.destinationId ? { locationId: row.destinationId } : void 0,
3020
3084
  usage: options.metrics?.usage ?? row.usage ?? void 0
3021
3085
  });
@@ -3315,10 +3379,11 @@ async function readLocationDetailFromSql(locationId, options = {}) {
3315
3379
  const activity = activityDays$1(days, nowMs, ACTIVITY_DAYS$1);
3316
3380
  const hourlyActivity = activityHours$1(hours, nowMs);
3317
3381
  const recentConversationIds = recentRows.map((row) => row.conversationId);
3318
- const [accessByConversation, metricsByRoot, automationTitleByConversation] = await Promise.all([
3382
+ const [accessByConversation, metricsByRoot, automationTitleByConversation, firstHumanMessageTextByConversation] = await Promise.all([
3319
3383
  readConversationAccessFromSql(getDb(), recentConversationIds, options.viewer),
3320
3384
  readConversationTreeMetricsFromSql(getDb(), recentConversationIds),
3321
- readAutomationTitlesByConversationId(recentRows)
3385
+ readAutomationTitlesByConversationId(recentRows),
3386
+ readFirstHumanMessageTexts(getDb(), recentRows)
3322
3387
  ]);
3323
3388
  return {
3324
3389
  ...location,
@@ -3330,6 +3395,7 @@ async function readLocationDetailFromSql(locationId, options = {}) {
3330
3395
  recentConversations: recentRows.map((row) => summaryFromRow(row, {
3331
3396
  access: accessByConversation.get(row.conversationId),
3332
3397
  automationTitle: automationTitleByConversation.get(row.conversationId),
3398
+ firstHumanMessageText: firstHumanMessageTextByConversation.get(row.conversationId),
3333
3399
  metrics: metricsByRoot.get(row.conversationId)
3334
3400
  })),
3335
3401
  source: "conversation_index",
@@ -3711,7 +3777,7 @@ async function readPeoplePluginReports(args) {
3711
3777
  reports: [],
3712
3778
  source: "plugins"
3713
3779
  });
3714
- const { getPluginProfileReports } = await import("./agent-hooks-CqnZfuCt.js").then((n) => n.t);
3780
+ const { getPluginProfileReports } = await import("./credentialed-C6pKlB1p.js").then((n) => n.a);
3715
3781
  return pluginOperationalReportFeedSchema.parse({
3716
3782
  generatedAt: new Date(nowMs).toISOString(),
3717
3783
  reports: await getPluginProfileReports({
@@ -3861,10 +3927,11 @@ async function readPeopleProfileFromSql(email, options = {}) {
3861
3927
  const surfaces = /* @__PURE__ */ new Map();
3862
3928
  for (const row of surfaceRows) addAggregate(surfaces, surfaceLabel(row.surface), row);
3863
3929
  const recentConversationIds = recentRows.map((row) => row.conversationId);
3864
- const [accessByConversation, metricsByRoot, automationTitleByConversation] = await Promise.all([
3930
+ const [accessByConversation, metricsByRoot, automationTitleByConversation, firstHumanMessageTextByConversation] = await Promise.all([
3865
3931
  readConversationAccessFromSql(getDb(), recentConversationIds, options.viewer),
3866
3932
  readConversationTreeMetricsFromSql(getDb(), recentConversationIds),
3867
- readAutomationTitlesByConversationId(recentRows)
3933
+ readAutomationTitlesByConversationId(recentRows),
3934
+ readFirstHumanMessageTexts(getDb(), recentRows)
3868
3935
  ]);
3869
3936
  return {
3870
3937
  activityDays: activityDays(days, nowMs),
@@ -3875,6 +3942,7 @@ async function readPeopleProfileFromSql(email, options = {}) {
3875
3942
  recentConversations: recentRows.map((row) => summaryFromRow(row, {
3876
3943
  access: accessByConversation.get(row.conversationId),
3877
3944
  automationTitle: automationTitleByConversation.get(row.conversationId),
3945
+ firstHumanMessageText: firstHumanMessageTextByConversation.get(row.conversationId),
3878
3946
  metrics: metricsByRoot.get(row.conversationId)
3879
3947
  })),
3880
3948
  actor,
@@ -4275,8 +4343,7 @@ function editView(automation, ownedByViewer) {
4275
4343
  ...common,
4276
4344
  kind: "event",
4277
4345
  status: automation.task.status === "deleted" ? "active" : automation.task.status,
4278
- trigger: automation.task.trigger,
4279
- triggerAvailable: eventAutomationTriggerAvailable(automation.task, getEventCatalog())
4346
+ trigger: automation.task.trigger
4280
4347
  };
4281
4348
  }
4282
4349
  /** Load exact editable values by ID, independent of list filters. */
@@ -4743,7 +4810,7 @@ function readDescriptionText(home) {
4743
4810
  }
4744
4811
  /** Read discovered skill names for authenticated runtime diagnostics. */
4745
4812
  async function readSkillReports() {
4746
- const { discoverSkills } = await import("./skills-Dbzx9-rS.js").then((n) => n.o);
4813
+ const { discoverSkills } = await import("./skills-Bb2KaJ3m.js").then((n) => n.o);
4747
4814
  const skills = await discoverSkills();
4748
4815
  return skillReportsSchema.parse(skills.map((skill) => ({
4749
4816
  name: skill.name,
@@ -4752,7 +4819,7 @@ async function readSkillReports() {
4752
4819
  }
4753
4820
  /** Read safe configured plugin metadata for authenticated runtime diagnostics. */
4754
4821
  async function readPlugins() {
4755
- const { pluginCatalogRuntime } = await import("./catalog-runtime-Suf-aLlh.js").then((n) => n.t);
4822
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-D3qbJlYz.js").then((n) => n.t);
4756
4823
  return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
4757
4824
  configKeys: plugin.manifest.configKeys ?? [],
4758
4825
  description: plugin.manifest.description,
@@ -4764,7 +4831,7 @@ async function readPlugins() {
4764
4831
  async function readRuntimeInfoReport() {
4765
4832
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
4766
4833
  import("./package-discovery-DJBompdd.js").then((n) => n.r),
4767
- import("./catalog-runtime-Suf-aLlh.js").then((n) => n.t),
4834
+ import("./catalog-runtime-D3qbJlYz.js").then((n) => n.t),
4768
4835
  readPlugins(),
4769
4836
  readSkillReports()
4770
4837
  ]);
@@ -4781,7 +4848,7 @@ async function readRuntimeInfoReport() {
4781
4848
  /** Read sanitized operational summaries contributed by plugins. */
4782
4849
  async function readPluginOperationalReportFeed() {
4783
4850
  const nowMs = Date.now();
4784
- const { getPluginOperationalReports } = await import("./agent-hooks-CqnZfuCt.js").then((n) => n.t);
4851
+ const { getPluginOperationalReports } = await import("./credentialed-C6pKlB1p.js").then((n) => n.a);
4785
4852
  return pluginOperationalReportFeedSchema.parse({
4786
4853
  source: "plugins",
4787
4854
  generatedAt: new Date(nowMs).toISOString(),
@@ -4799,7 +4866,7 @@ function createJuniorApi(options = {}) {
4799
4866
  app.get("/api/plugin-reports", async () => jsonResponse(pluginOperationalReportFeedSchema, await readPluginOperationalReportFeed()));
4800
4867
  app.get("/api/stats", async () => jsonResponse(statsReportSchema, await readStatsReport()));
4801
4868
  app.route("/api/conversations", createConversationRoutes({
4802
- attachmentStorage: createVercelAttachmentStorage(),
4869
+ attachmentStorage: getAttachmentStorage(),
4803
4870
  queue: options.conversationWorkQueue ?? getVercelConversationWorkQueue()
4804
4871
  }));
4805
4872
  app.route("/api/code", createCodeRoutes());
@@ -9,7 +9,6 @@ import "ai";
9
9
  import { z } from "zod";
10
10
  import { Destination, OwnedObjectAnnotation, PluginRegistration, Source, User } from "@sentry/junior-plugin-api";
11
11
  import "@earendil-works/pi-agent-core";
12
- import { Sandbox } from "@vercel/sandbox";
13
12
  import "@earendil-works/pi-ai";
14
13
  import "@sinclair/typebox";
15
14
  import "@modelcontextprotocol/sdk/client/auth.js";
@@ -134,6 +133,10 @@ declare const inboundMessageSchema: z.ZodObject<{
134
133
  slack: "slack";
135
134
  web: "web";
136
135
  }>;
136
+ traceContext: z.ZodCatch<z.ZodOptional<z.ZodObject<{
137
+ baggage: z.ZodOptional<z.ZodString>;
138
+ sentryTrace: z.ZodString;
139
+ }, z.core.$strip>>>;
137
140
  }, z.core.$strict>;
138
141
  type InboundMessage = z.output<typeof inboundMessageSchema>;
139
142
  interface ConversationWorkerContext {
@@ -194,8 +197,6 @@ interface JuniorDashboardOptions {
194
197
  basePath?: string;
195
198
  /** Public deployment origin used for auth callbacks and external links. */
196
199
  baseURL?: string;
197
- /** Expose the config-gated component gallery for local visual QA. */
198
- componentGallery?: boolean;
199
200
  /** Disable dashboard route mounting while preserving serializable config shape. */
200
201
  disabled?: boolean;
201
202
  /** Replace Conversation route responses with dashboard visual-QA fixtures. */
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-Bo0kB987.js";
1
+ import { i as ModelProfileInput, n as createApp, r as JuniorDashboardOptions, t as JuniorAppOptions } from "./app-Csbi9dW7.js";
2
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 };