@sentry/junior 0.286.0 → 0.287.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 (69) hide show
  1. package/dist/{adapter-JQZaJ-B_.js → adapter-CL-HUKgd.js} +1 -1
  2. package/dist/{admin-Dm2bimJ-.js → admin-C9urXVfi.js} +2 -1
  3. package/dist/{agent-runner-DGCwOEyL.js → agent-runner-Bfnw551N.js} +644 -312
  4. package/dist/api/schema.d.ts +2 -2
  5. package/dist/api/schema.js +7 -7
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +36 -53
  8. package/dist/{app-BKq0JzWx.d.ts → app-DBY5TnfY.d.ts} +2 -2
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +62 -29
  11. package/dist/{assistant-reply-CAPafcUY.js → assistant-reply-u_PRYzuz.js} +1 -1
  12. package/dist/{automation-B-jJN_gM.js → automation-DksGNDRO.js} +3 -6
  13. package/dist/{background-compaction-queue-Btu2oab_.js → background-compaction-queue-CYI909P5.js} +3 -3
  14. package/dist/{briefs-UMeYehUe.js → briefs-DaXiMWzT.js} +6 -5
  15. package/dist/{catalog-runtime-Bym8GVdh.js → catalog-runtime-BCIuBe4d.js} +1 -1
  16. package/dist/cli/chat.js +14 -14
  17. package/dist/cli/check.js +3 -3
  18. package/dist/cli/main.js +3 -3
  19. package/dist/cli/plugins.js +4 -4
  20. package/dist/cli/snapshot-create.js +4 -4
  21. package/dist/cli/upgrade.d.ts +1 -1
  22. package/dist/cli/upgrade.js +3 -3
  23. package/dist/{client-B0aAs7wC.js → config-CkHcUMN7.js} +580 -3
  24. package/dist/{connections-CQ7p0aNJ.js → connections-BnIj0wtx.js} +9 -9
  25. package/dist/{conversation-BusI2uzj.js → conversation-E7ZPJx2H.js} +8 -1
  26. package/dist/{conversation-pending-messages-DwehU0Fd.js → conversation-pending-messages-DVch6YQw.js} +2 -5
  27. package/dist/{conversation-privacy-Cd_nZZBM.js → conversation-privacy-DF1hW0ja.js} +1 -1
  28. package/dist/{credential-sync-DmiJi_At.js → credential-sync-CzMar9hq.js} +13 -13
  29. package/dist/{viewer-CH-ASQzh.js → db-DJ11eZqq.js} +37 -343
  30. package/dist/{db-C5zi4ecs.d.ts → db-YDKKDxlh.d.ts} +1 -1
  31. package/dist/{executor-Dipi2Ixl.js → executor-BY9TB31g.js} +11 -4
  32. package/dist/instrumentation.js +2 -2
  33. package/dist/{logging-CMFhLLj4.js → logging-BO5zU6Mt.js} +1 -1
  34. package/dist/{media-B-BpXo41.js → media-Cz1ZiV1U.js} +2 -2
  35. package/dist/{message-D1xLljUF.js → message-CsUbuEc8.js} +10 -10
  36. package/dist/nitro.d.ts +1 -1
  37. package/dist/nitro.js +2 -2
  38. package/dist/{oauth-callback-server-DCAFIUQr.js → oauth-callback-server-hiDKK0_n.js} +2 -2
  39. package/dist/{projection-CoeMNxJ4.js → projection-CL_YWeGf.js} +82 -160
  40. package/dist/{prompt-C9OQEfan.js → prompt-BHOEQSmf.js} +182 -2
  41. package/dist/{registry-u-sFYtx_.js → registry-BriFLnaJ.js} +1 -1
  42. package/dist/{reporting-window-B4TwyuJo.js → reporting-window-B3Ze-Qnt.js} +4 -1
  43. package/dist/{resolve-DYqgL3Eo.js → resolve-Bt6GgAiA.js} +3 -3
  44. package/dist/{result-CescSwAw.js → result-Bo1TZu0Q.js} +8 -8
  45. package/dist/{runner-Cr67a8TB.js → runner-D3YeCQgt.js} +8 -8
  46. package/dist/{sandbox-egress-signals-DLOazy5W.js → sandbox-egress-signals-CcnSPP4S.js} +1 -1
  47. package/dist/{schema-BUSi3sgv.js → schema-BWE3RJEB.js} +17 -5
  48. package/dist/{schema-Ih60j59-.d.ts → schema-C6fsEwjo.d.ts} +46 -1
  49. package/dist/{service-account-CGEqz9wG.js → service-account-DiQQuuw7.js} +3 -3
  50. package/dist/{service-account-CsKxktLk.js → service-account-r6fl0b-9.js} +3 -3
  51. package/dist/{session-stop-CGz5DByb.js → session-stop-B2Nut40V.js} +18 -18
  52. package/dist/{skills-COCqf61f.js → skills-CD5aJdzg.js} +2 -2
  53. package/dist/spawn-CalgZQiu.js +79 -0
  54. package/dist/{stop-GyFZkHuQ.js → stop-kujZLbi0.js} +56 -240
  55. package/dist/{store-D0-8plWp.js → store-DdIEUL1q.js} +3 -3
  56. package/dist/{task-runner-xPuQmEot.js → task-runner-D_RDr2Hu.js} +12 -11
  57. package/dist/{turn-failure-response-BOviBdT-.js → turn-failure-response-B5nV1Er-.js} +16 -11
  58. package/dist/{validation-DZDKorGz.js → validation-K4pqwoVZ.js} +1 -1
  59. package/dist/{version-BTIz7fGi.js → version-DBvhk1X9.js} +1 -1
  60. package/dist/version.js +1 -1
  61. package/dist/viewer-DrMmFUul.js +337 -0
  62. package/dist/{work-C75_IM5e.js → work-ljRoODGu.js} +30 -19
  63. package/dist/{worker-Dl47I729.js → worker-CYO1Q0Js.js} +5 -6
  64. package/migrations/0088_conversation_unsubscribe.sql +1 -0
  65. package/migrations/meta/0088_snapshot.json +4372 -0
  66. package/migrations/meta/_journal.json +7 -0
  67. package/package.json +4 -4
  68. package/dist/config-B9f9Lqo5.js +0 -579
  69. package/dist/spawn-C8F_iXWO.js +0 -42
@@ -1,5 +1,5 @@
1
- import { In as createUserTokenStore } from "./projection-CoeMNxJ4.js";
2
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-DmiJi_At.js";
1
+ import { Rn as createUserTokenStore } from "./projection-CL_YWeGf.js";
2
+ import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-CzMar9hq.js";
3
3
  import { createServer } from "node:http";
4
4
  // src/chat/local/oauth-callback-server.ts
5
5
  const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
@@ -1,27 +1,27 @@
1
1
  import { a as getClient$1, h as startSpan, n as captureMessage, r as continueTrace, v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { a as completeText, c as resolveGatewayModel, i as completeObject, m as escapeXml, o as embedTexts, p as unwrapCurrentInstruction, r as completeDecision, s as rerankTexts, t as GEN_AI_PROVIDER_NAME, w as toOptionalTrimmed, x as isProviderRetryError } from "./client-B0aAs7wC.js";
3
- import { i as getChatConfig, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName } from "./config-B9f9Lqo5.js";
4
- import { E as withSpan, G as toOptionalNumber, K as toOptionalString, W as isRecord$2, _ as runBestEffort, a as extractGenAiUsageSummary, b as setSpanAttributes, c as getLogContextAttributes, d as logAudit, h as logWarn, m as logInfo, o as getActiveTraceContext, p as logException, t as buildTurnFailureResponse, x as setSpanStatus, y as setSentryUser } from "./logging-CMFhLLj4.js";
5
- import { t as canExposeConversationPayload } from "./conversation-privacy-Cd_nZZBM.js";
2
+ import { E as resolveGatewayModel, M as escapeXml, S as completeObject, T as rerankTexts, U as toOptionalTrimmed, i as getChatConfig, j as unwrapCurrentInstruction, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName, w as embedTexts, x as completeDecision, y as GEN_AI_PROVIDER_NAME, z as isProviderRetryError } from "./config-CkHcUMN7.js";
3
+ import { E as withSpan, G as toOptionalNumber, K as toOptionalString, W as isRecord$2, _ as runBestEffort, a as extractGenAiUsageSummary, b as setSpanAttributes, c as getLogContextAttributes, d as logAudit, h as logWarn, m as logInfo, o as getActiveTraceContext, p as logException, t as buildTurnFailureResponse, x as setSpanStatus, y as setSentryUser } from "./logging-BO5zU6Mt.js";
4
+ import { t as canExposeConversationPayload } from "./conversation-privacy-DF1hW0ja.js";
6
5
  import { c as parseStoredSlackActor, d as parseSlackChannelReferenceId, f as parseSlackTeamId, h as parseSlackMessageTs, i as isActorUserId, l as toStoredSlackActor, p as parseSlackUserId, s as parseActorUserId } from "./actor-6jsm_v96.js";
7
- import { $ as conversationDetailTouch, B as startLocationThread, C as getSqlExecutor, D as createSqlConversationEventStore, F as createSqlStore, H as resolveActorIdentityId, O as eventFromRow, S as getDb, Y as saveUserTimezone, Z as bindProviderConversation, dt as sameDestination, g as createCache, i as readActorIdentity, k as withConversationEventLock, l as resolveViewerUser, lt as parseDestination, n as findUserByEmailFromSql, nt as addAgentTurnUsage, o as readIdentityById, ot as hasAgentTurnUsage, p as parseAvatarUrl, q as readUserTimezone, s as readIdentityByIdFromSql, x as getConversationStore, y as getConversationEventStore } from "./viewer-CH-ASQzh.js";
8
- import { A as juniorConversations, D as juniorCodeChanges, E as juniorConversationAnnotations, M as juniorUsers, N as juniorDestinations, O as juniorCodeRepositories, a as juniorPushSubscriptions, b as juniorConversationBriefs, f as juniorAutomations, i as juniorWorkspaces, j as juniorIdentities, k as juniorAttachments, l as juniorReviewItems, m as juniorLocationConfigurations, n as juniorSnapshots, o as juniorReviewItemAssignees, r as juniorWorkspaceRepos, s as juniorReviewItemConversations, v as juniorConversationParticipants, w as juniorConversationEvents } from "./executor-Dipi2Ixl.js";
9
- import { _ as instructionProvenanceFor, g as instructionActors, h as contextProvenance, o as agentHistoryItemSchema } from "./media-B-BpXo41.js";
10
- import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, f as credentialContextForActor, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-u-sFYtx_.js";
11
- import { n as pluginCatalogRuntime } from "./catalog-runtime-Bym8GVdh.js";
6
+ import { D as resolveActorIdentityId, G as hasAgentTurnUsage, I as bindProviderConversation, J as parseDestination, M as readUserTimezone, P as saveUserTimezone, R as conversationDetailTouch, V as addAgentTurnUsage, X as sameDestination, a as getConversationStore, d as createSqlConversationEventStore, f as eventFromRow, o as getDb, p as withConversationEventLock, r as getConversationEventStore, s as getSqlExecutor, w as startLocationThread, y as createSqlStore } from "./db-DJ11eZqq.js";
7
+ import { A as juniorConversations, D as juniorCodeChanges, E as juniorConversationAnnotations, M as juniorUsers, N as juniorDestinations, O as juniorCodeRepositories, a as juniorPushSubscriptions, b as juniorConversationBriefs, f as juniorAutomations, i as juniorWorkspaces, j as juniorIdentities, k as juniorAttachments, l as juniorReviewItems, m as juniorLocationConfigurations, n as juniorSnapshots, o as juniorReviewItemAssignees, r as juniorWorkspaceRepos, s as juniorReviewItemConversations, v as juniorConversationParticipants, w as juniorConversationEvents } from "./executor-BY9TB31g.js";
8
+ import { _ as instructionProvenanceFor, g as instructionActors, h as contextProvenance, o as agentHistoryItemSchema } from "./media-Cz1ZiV1U.js";
9
+ import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, f as credentialContextForActor, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-BriFLnaJ.js";
10
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BCIuBe4d.js";
11
+ import { d as JUNIOR_NATIVE_EVENT_NAMESPACE, f as agentsInstructionsUpdatedEvent, g as renderJuniorNativeConversationEvent, l as completeObject$1, m as authenticationUnlinkedEvent, n as briefEntriesFromReportEvents, o as isEventConversationMessage, p as authenticationLinkedEvent, s as generateBrief, t as BRIEF_PROMPT, u as completeText } from "./prompt-BHOEQSmf.js";
12
12
  import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS, r as acquireActiveLock } from "./locks-D-0h111u.js";
13
- import { a as setStateValues, i as getStateValues, n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-JQZaJ-B_.js";
13
+ import { g as createCache, i as readActorIdentity, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, s as readIdentityByIdFromSql } from "./viewer-DrMmFUul.js";
14
+ import { a as setStateValues, i as getStateValues, n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-CL-HUKgd.js";
14
15
  import { n as isWithinNotificationSchedule, r as notificationScheduleSchema, s as isValidTimeZone, t as DEFAULT_NOTIFICATION_SCHEDULE } from "./schedule-BTp__wrw.js";
15
- import { A as reviewItemChangeRecordSchema, B as readMessageAttachments, G as conversationBriefSchema, K as parseBriefInput, M as messageCardRef, P as readMessageCardRefs, W as briefResourceLabel, _ as conversationReportEventSchema, q as parseStoredBrief, v as conversationReportMessageEventSchema } from "./conversation-BusI2uzj.js";
16
- import { n as briefEntriesFromReportEvents, o as isEventConversationMessage, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-C9OQEfan.js";
16
+ import { A as reviewItemChangeRecordSchema, B as readMessageAttachments, G as conversationBriefSchema, K as parseBriefInput, M as messageCardRef, P as readMessageCardRefs, W as briefResourceLabel, _ as conversationReportEventSchema, q as parseStoredBrief, v as conversationReportMessageEventSchema } from "./conversation-E7ZPJx2H.js";
17
17
  import { n as redactSandboxEgressProxyPath, t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
18
18
  import path from "node:path";
19
19
  import { isDeepStrictEqual } from "node:util";
20
20
  import { AsyncLocalStorage } from "node:async_hooks";
21
21
  import { createHash, createHmac, createPrivateKey, createPublicKey, generateKeyPairSync, randomBytes, randomUUID, sign, timingSafeEqual } from "node:crypto";
22
22
  import * as z from "zod";
23
- import { and, arrayContains, asc, count, desc, eq, exists, getTableColumns, gt, gte, ilike, inArray, isNotNull, isNull, lt, lte, max, ne, or, sql } from "drizzle-orm";
24
- import { EgressAuthRequired, EgressPolicyDenied, actorSchema, codeChangeInputSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, defineConversationEvent, destinationSchema, eventDataSchema, eventInputSchema, eventMatchSchema, eventMatches, eventTypeSchema, isPluginModelCostEventName, missingToolAnnotationKeys, normalizeEventIdentifier, objectAnnotationSchema, objectIconPath, objectTypeSchema, pluginAuthorizationSchema, pluginCredentialHeaderTransformSchema, pluginCredentialResultSchema, pluginEventsSchema, pluginGrantSchema, pluginModelCostEventNames, pluginProviderAccountSchema, pluginStoredTokensSchema, pluginToolReplySchema, promptContextSchema, promptMessageSchema, sourceSchema, stableEventMatchKey } from "@sentry/junior-plugin-api";
23
+ import { and, arrayContains, asc, count, desc, eq, exists, getTableColumns, gt, gte, ilike, inArray, isNotNull, isNull, lt, lte, max, ne, notInArray, or, sql } from "drizzle-orm";
24
+ import { EgressAuthRequired, EgressPolicyDenied, actorSchema, codeChangeInputSchema, conversationAnnotationInputSchema, defineConversationEvent, destinationSchema, eventDataSchema, eventInputSchema, eventMatchSchema, eventMatches, eventTypeSchema, isPluginModelCostEventName, missingToolAnnotationKeys, normalizeEventIdentifier, objectAnnotationSchema, objectIconPath, objectTypeSchema, pluginAuthorizationSchema, pluginCredentialHeaderTransformSchema, pluginCredentialResultSchema, pluginEventsSchema, pluginGrantSchema, pluginModelCostEventNames, pluginProviderAccountSchema, pluginStoredTokensSchema, pluginToolReplySchema, promptContextSchema, promptMessageSchema, sourceSchema, stableEventMatchKey } from "@sentry/junior-plugin-api";
25
25
  import { alias, union } from "drizzle-orm/pg-core";
26
26
  import fs from "node:fs/promises";
27
27
  import pLimit from "p-limit";
@@ -63,139 +63,6 @@ z.object({
63
63
  content: z.array(z.unknown()),
64
64
  role: z.string().min(1)
65
65
  }).passthrough().transform((value) => value);
66
- // src/chat/conversations/structured-events.ts
67
- /** Reserved namespace for Junior-owned conversation metadata events. */
68
- const JUNIOR_NATIVE_EVENT_NAMESPACE = "junior";
69
- const authenticationEventContentSchema = z.object({
70
- accountLabel: z.string().trim().min(1).max(120).optional(),
71
- actorId: z.string().min(1),
72
- authorizationId: z.string().min(1).optional(),
73
- provider: z.string().regex(/^[a-z][a-z0-9-]*$/),
74
- providerLabel: z.string().trim().min(1).max(80).optional()
75
- }).strict();
76
- const agentsInstructionsUpdatedContentSchema = z.object({
77
- action: z.enum([
78
- "loaded",
79
- "replaced",
80
- "cleared"
81
- ]),
82
- directory: z.string().trim().min(1).max(500).optional(),
83
- fingerprint: z.string().trim().min(1).max(128),
84
- sources: z.array(z.object({
85
- content: z.string().min(1).max(32768),
86
- path: z.string().trim().min(1).max(500)
87
- }).strict()).max(32),
88
- textBytes: z.number().int().nonnegative().optional()
89
- }).strict();
90
- function providerTitle(content) {
91
- return content.providerLabel?.trim() || content.provider;
92
- }
93
- function agentsInstructionsTitle(action) {
94
- if (action === "loaded") return "Loaded AGENTS.md";
95
- if (action === "replaced") return "Updated AGENTS.md";
96
- return "Cleared AGENTS.md";
97
- }
98
- function sourceFilename(sourcePath) {
99
- return sourcePath.split("/").at(-1) || sourcePath;
100
- }
101
- function formatBytes(bytes) {
102
- if (bytes < 1024) return `${bytes} bytes`;
103
- const kilobytes = bytes / 1024;
104
- return `${Number.isInteger(kilobytes) ? kilobytes : kilobytes.toFixed(1)} KB`;
105
- }
106
- function agentsInstructionsPreview(content) {
107
- const source = content.sources[0];
108
- if (!source) return void 0;
109
- const filename = sourceFilename(source.path);
110
- const label = content.sources.length === 1 ? filename : `${content.sources.length} AGENTS.md files`;
111
- return typeof content.textBytes === "number" ? `${label} · ${formatBytes(content.textBytes)}` : label;
112
- }
113
- /** Junior-owned account-link transcript event. */
114
- const authenticationLinkedEvent = defineConversationEvent({
115
- name: "authentication_linked",
116
- version: 1,
117
- schema: authenticationEventContentSchema,
118
- renderEvent(event) {
119
- const provider = providerTitle(event);
120
- return {
121
- icon: "link",
122
- title: `${provider} connected`,
123
- ...event.accountLabel ? { preview: `Connected as \`${event.accountLabel}\`` } : void 0,
124
- details: [{
125
- title: `${provider} connected`,
126
- ...event.accountLabel ? { description: `Connected as \`${event.accountLabel}\`` } : void 0,
127
- metadata: [event.provider]
128
- }]
129
- };
130
- }
131
- });
132
- /** Junior-owned account-unlink transcript event. */
133
- const authenticationUnlinkedEvent = defineConversationEvent({
134
- name: "authentication_unlinked",
135
- version: 1,
136
- schema: authenticationEventContentSchema,
137
- renderEvent(event) {
138
- const provider = providerTitle(event);
139
- return {
140
- icon: "key",
141
- title: `${provider} disconnected`,
142
- details: [{
143
- title: `${provider} disconnected`,
144
- metadata: [event.provider]
145
- }]
146
- };
147
- }
148
- });
149
- /** Junior-owned AGENTS.md bootstrap transition for the dashboard timeline. */
150
- const agentsInstructionsUpdatedEvent = defineConversationEvent({
151
- name: "agents_instructions_updated",
152
- version: 1,
153
- schema: agentsInstructionsUpdatedContentSchema,
154
- renderEvent(event) {
155
- const title = agentsInstructionsTitle(event.action);
156
- const preview = agentsInstructionsPreview(event);
157
- return {
158
- icon: "brain",
159
- title,
160
- ...preview ? { preview } : void 0,
161
- ...event.sources.length > 0 ? { details: event.sources.map((source) => ({
162
- title: sourceFilename(source.path),
163
- content: source.content
164
- })) } : void 0
165
- };
166
- }
167
- });
168
- /** Core-written Conversation note. `notes.ts` owns when the model sees it. */
169
- const conversationNoteEvent = defineConversationEvent({
170
- name: "conversation_note",
171
- version: 1,
172
- schema: z.object({ text: z.string().trim().min(1).max(500) }).strict(),
173
- renderEvent(event) {
174
- return {
175
- icon: "info",
176
- title: "Note for the next Turn",
177
- preview: event.text
178
- };
179
- }
180
- });
181
- const NATIVE_EVENT_DEFINITIONS = [
182
- authenticationLinkedEvent,
183
- authenticationUnlinkedEvent,
184
- agentsInstructionsUpdatedEvent,
185
- conversationNoteEvent
186
- ];
187
- /** Resolve a registered Junior-native conversation event definition. */
188
- function getJuniorNativeEventDefinition(args) {
189
- return NATIVE_EVENT_DEFINITIONS.find((definition) => definition.eventName === args.name && definition.version === args.version);
190
- }
191
- /** Render one Junior-native event through its active definition. */
192
- function renderJuniorNativeConversationEvent(args) {
193
- if (args.namespace !== "junior") return void 0;
194
- const definition = getJuniorNativeEventDefinition(args);
195
- if (!definition) return void 0;
196
- const presentation = definition.renderEvent(definition.parse(args.content));
197
- return presentation === void 0 ? void 0 : conversationEventPresentationSchema.parse(presentation);
198
- }
199
66
  // src/chat/pi/conversation-events.ts
200
67
  function authorizationObservationMessage(data, createdAtMs) {
201
68
  const label = data.kind === "mcp" ? "MCP authorization" : "Authorization";
@@ -1417,6 +1284,9 @@ function reportSubagentLabel(data, canExposePayload) {
1417
1284
  ...data.title ? { title: data.title } : void 0
1418
1285
  };
1419
1286
  }
1287
+ function childKind(threadIds, conversationId) {
1288
+ return threadIds?.has(conversationId) ? "thread" : "task";
1289
+ }
1420
1290
  /**
1421
1291
  * Project canonical events into the ordered reporting boundary.
1422
1292
  *
@@ -1494,6 +1364,7 @@ function projectConversationReportEventPage(args) {
1494
1364
  startedSeq: event.seq,
1495
1365
  startedAt: new Date(event.createdAtMs).toISOString(),
1496
1366
  childConversationId: event.data.childConversationId,
1367
+ childKind: childKind(args.threadIds, event.data.childConversationId),
1497
1368
  subagentKind: event.data.subagentKind,
1498
1369
  ...reportSubagentLabel(event.data, args.canExposePayload),
1499
1370
  status: "running",
@@ -1507,6 +1378,7 @@ function projectConversationReportEventPage(args) {
1507
1378
  startedSeq: started.seq,
1508
1379
  startedAt: new Date(started.createdAtMs).toISOString(),
1509
1380
  childConversationId: started.data.childConversationId,
1381
+ childKind: childKind(args.threadIds, started.data.childConversationId),
1510
1382
  subagentKind: started.data.subagentKind,
1511
1383
  ...reportSubagentLabel(started.data, args.canExposePayload),
1512
1384
  ...started.data.parentToolCallId ? { parentToolCallId: started.data.parentToolCallId } : void 0,
@@ -1560,6 +1432,13 @@ function readLatestTurnsPageStart(executor, conversationId, turns) {
1560
1432
  const turnStart = executor.db().select({ seq: started.seq }).from(started).where(and(eq(started.conversationId, conversationId), eq(started.type, "turn_started"))).orderBy(desc(started.seq)).offset(turns - 1).limit(1);
1561
1433
  return executor.db().select({ seq: max(ended.seq) }).from(ended).where(and(eq(ended.conversationId, conversationId), inArray(ended.type, ["turn_completed", "turn_failed"]), lt(ended.seq, sql`(${turnStart})`)));
1562
1434
  }
1435
+ /** Read which children that the page's subagent events name are Threads. */
1436
+ async function readThreadIds(executor, events) {
1437
+ const ids = [...new Set(events.flatMap((event) => event.data.type === "subagent_started" ? [event.data.childConversationId] : []))];
1438
+ if (ids.length === 0) return /* @__PURE__ */ new Set();
1439
+ const rows = await executor.db().select({ conversationId: juniorConversations.conversationId }).from(juniorConversations).where(and(inArray(juniorConversations.conversationId, ids), eq(juniorConversations.kind, "thread")));
1440
+ return new Set(rows.map((row) => row.conversationId));
1441
+ }
1563
1442
  /** Read the first Turn start, which marks history inherited from a fork. */
1564
1443
  async function readFirstTurnStart(executor, conversationId) {
1565
1444
  const [row] = await readConversationEventRows(executor, {
@@ -1618,11 +1497,14 @@ async function projectConversationEvents(executor, args) {
1618
1497
  }),
1619
1498
  args.canExposePayload ? hydrateMessageAttachments(executor, args.conversationId, events) : void 0
1620
1499
  ]);
1500
+ const subagentStartEvents = subagentStartRows.map(eventFromRow);
1501
+ const threadIds = await readThreadIds(executor, [...events, ...subagentStartEvents]);
1621
1502
  return projectEventPage({
1622
1503
  canExposePayload: args.canExposePayload,
1623
1504
  events,
1624
1505
  ...args.firstTurnStart ? { firstTurnStart: args.firstTurnStart } : void 0,
1625
- subagentStartEvents: subagentStartRows.map(eventFromRow),
1506
+ subagentStartEvents,
1507
+ threadIds,
1626
1508
  toolStartEvents: toolStartRows.map(eventFromRow),
1627
1509
  modelContextEvents: [...turnBoundaryRows, ...modelCallRows].sort((left, right) => left.seq - right.seq).map(eventFromRow)
1628
1510
  });
@@ -2042,10 +1924,11 @@ async function updateConversationBrief(context) {
2042
1924
  const input = await briefInputFromSql(executor, run.conversationId, terminalSeq);
2043
1925
  const modelId = botConfig.fastModelId;
2044
1926
  const generation = await generateBrief({
2045
- completeObject: (request) => completeObject({
1927
+ completeObject: (request) => completeObject$1({
2046
1928
  ...request,
2047
1929
  modelId,
2048
- promptName: "junior.brief_update"
1930
+ operation: "brief_update",
1931
+ cost: { owner: "caller" }
2049
1932
  }),
2050
1933
  input,
2051
1934
  previous: previous?.content,
@@ -2150,6 +2033,17 @@ function conversationIsMemberRoot(member) {
2150
2033
  const memberRoots = "userId" in member ? union(started.where(eq(juniorIdentities.userId, member.userId)), participating.where(eq(juniorConversationParticipants.userId, member.userId))) : union(started.innerJoin(juniorUsers, eq(juniorUsers.id, juniorIdentities.userId)).where(eq(juniorUsers.primaryEmailNormalized, member.email)), participating.innerJoin(juniorUsers, eq(juniorUsers.id, juniorConversationParticipants.userId)).where(eq(juniorUsers.primaryEmailNormalized, member.email)));
2151
2034
  return inArray(juniorConversations.conversationId, memberRoots);
2152
2035
  }
2036
+ /**
2037
+ * True when the person has not unsubscribed from the conversation. The
2038
+ * active feed uses it, so a conversation that someone else carries on
2039
+ * leaves the feed of a person who left it.
2040
+ */
2041
+ function conversationIsNotUnsubscribedRoot(member) {
2042
+ const rows = getDb().select({ conversationId: juniorConversationParticipants.rootConversationId }).from(juniorConversationParticipants);
2043
+ const left = isNotNull(juniorConversationParticipants.unsubscribedAt);
2044
+ const unsubscribedRoots = "userId" in member ? rows.where(and(eq(juniorConversationParticipants.userId, member.userId), left)) : rows.innerJoin(juniorUsers, eq(juniorUsers.id, juniorConversationParticipants.userId)).where(and(eq(juniorUsers.primaryEmailNormalized, member.email), left));
2045
+ return notInArray(juniorConversations.conversationId, unsubscribedRoots);
2046
+ }
2153
2047
  /** Root-actor ownership or a materialized participant row for the same person. */
2154
2048
  function viewerConversationMembership(args) {
2155
2049
  if (args.actorMatch && args.participantMatch) return or(args.actorMatch, args.participantMatch);
@@ -2254,13 +2148,13 @@ function createConversationAccessReader(db, viewer) {
2254
2148
  /**
2255
2149
  * Apply `policies/conversation-access.md`: whether work in the `requester`
2256
2150
  * Conversation may read or find the data of the `target` Conversation. The
2257
- * person of the Turn does not change the result. A private Conversation is
2258
- * reachable only from its own tree.
2151
+ * person of the Turn does not change the result. A public Conversation is
2152
+ * reachable from any Conversation, on any surface and in any provider tenant.
2153
+ * A private Conversation is reachable only from its own tree.
2259
2154
  */
2260
2155
  function canAccessConversation(args) {
2261
2156
  const { requester, target } = args;
2262
2157
  if (requester.rootConversationId !== void 0 && requester.rootConversationId === target.rootConversationId) return true;
2263
- if (!requester.tenant || !target.tenant || requester.tenant.provider !== target.tenant.provider || requester.tenant.providerTenantId !== target.tenant.providerTenantId) return false;
2264
2158
  return target.visibility === "public";
2265
2159
  }
2266
2160
  // src/chat/plugins/conversation-event-reader.ts
@@ -11297,6 +11191,14 @@ const CONTEXT_INPUT_LIMIT_RATIO = .95;
11297
11191
  const COMPACTION_TARGET_RATIO = .8;
11298
11192
  const BACKGROUND_COMPACTION_MARK_RATIO = .7;
11299
11193
  const FALLBACK_CONTEXT_WINDOW_TOKENS = 4e5;
11194
+ const CLAUDE_TOKEN_ESTIMATE = {
11195
+ charsPerToken: 2.5,
11196
+ toolResultOverheadTokens: 150
11197
+ };
11198
+ const DEFAULT_TOKEN_ESTIMATE = {
11199
+ charsPerToken: 4,
11200
+ toolResultOverheadTokens: 0
11201
+ };
11300
11202
  function positiveInteger(value, fallback) {
11301
11203
  return Number.isFinite(value) && value > 0 ? Math.floor(value) : fallback;
11302
11204
  }
@@ -11304,14 +11206,19 @@ function positiveInteger(value, fallback) {
11304
11206
  function estimateTextTokens(text) {
11305
11207
  return Math.ceil(text.length / 4);
11306
11208
  }
11209
+ /** Resolve the size-only token estimate inputs for one model's requests. */
11210
+ function getTokenEstimateProfile(modelId) {
11211
+ return modelId.startsWith("anthropic/") ? CLAUDE_TOKEN_ESTIMATE : DEFAULT_TOKEN_ESTIMATE;
11212
+ }
11307
11213
  /** Estimate the tokens that the system prompt and tool definitions add to a model request. */
11308
- function estimateRequestOverheadTokens(systemPrompt, tools) {
11214
+ function estimateRequestOverheadTokens(systemPrompt, tools, modelId) {
11309
11215
  const definitions = tools.map(({ name, description, parameters }) => ({
11310
11216
  name,
11311
11217
  description,
11312
11218
  parameters
11313
11219
  }));
11314
- return estimateTextTokens(systemPrompt + JSON.stringify(definitions));
11220
+ const chars = systemPrompt.length + JSON.stringify(definitions).length;
11221
+ return Math.ceil(chars / getTokenEstimateProfile(modelId).charsPerToken);
11315
11222
  }
11316
11223
  /** Derive the automatic compaction threshold from model context capacity. */
11317
11224
  function calculateContextCompactionTriggerTokens(model) {
@@ -11693,7 +11600,8 @@ async function decideSubscribedThreadReply(args) {
11693
11600
  actorId: args.input.context.actorId ?? "",
11694
11601
  runId: args.input.context.runId ?? ""
11695
11602
  },
11696
- promptName: "junior.passive_reply_route"
11603
+ operation: "passive_reply_route",
11604
+ cost: { owner: "caller" }
11697
11605
  });
11698
11606
  return {
11699
11607
  ...result.costUsd !== void 0 ? { costUsd: result.costUsd } : void 0,
@@ -11820,6 +11728,17 @@ function renderUntrustedTag(name, attrs, writer, text) {
11820
11728
  function renderChildTag(name, text) {
11821
11729
  return `<${name}>${text}</${name}>`;
11822
11730
  }
11731
+ const PARENT_AGENT_TASK_OPEN = "<parent-agent-task>\n";
11732
+ const PARENT_AGENT_TASK_CLOSE = "\n</parent-agent-task>";
11733
+ /**
11734
+ * Return the text of a `<parent-agent-task>` input without its tag, as
11735
+ * `<current-instruction>` is read for a person. Returns nothing for another
11736
+ * input. The tag is only for the model: provenance decides authority.
11737
+ */
11738
+ function readParentAgentTask(text) {
11739
+ if (!text.startsWith(PARENT_AGENT_TASK_OPEN) || !text.endsWith(PARENT_AGENT_TASK_CLOSE)) return;
11740
+ return text.slice(20, -21).replaceAll("&lt;/", "</");
11741
+ }
11823
11742
  /**
11824
11743
  * Return whether a prompt text part is a runtime-created input. Only the
11825
11744
  * runtime writes a part that starts with one of these tags: typed person
@@ -11982,7 +11901,7 @@ function getUserMessageInstructionText(message) {
11982
11901
  const texts = typeof content === "string" ? [content] : Array.isArray(content) ? content.flatMap((part) => textPartValue(part) ?? []) : [];
11983
11902
  const inputs = texts.flatMap((text) => {
11984
11903
  const withoutContext = text.replace(EMBEDDED_THREAD_CONTEXT_PATTERN, "").trim();
11985
- if (isRuntimeInputText(withoutContext)) return [withoutContext];
11904
+ if (isRuntimeInputText(withoutContext)) return [readParentAgentTask(withoutContext) ?? withoutContext];
11986
11905
  const instruction = unwrapCurrentInstruction(withoutContext);
11987
11906
  return instruction === void 0 ? [] : [instruction.trim()];
11988
11907
  });
@@ -14721,7 +14640,8 @@ async function generateShortTitle(args) {
14721
14640
  signal: args.signal,
14722
14641
  modelId: botConfig.fastModelId,
14723
14642
  temperature: 0,
14724
- promptName: `junior.${args.kind}_title`,
14643
+ operation: `${args.kind}_title`,
14644
+ cost: args.cost,
14725
14645
  messages: [{
14726
14646
  role: "user",
14727
14647
  content: [
@@ -14757,6 +14677,7 @@ async function resolveTaskTitle(args) {
14757
14677
  if (explicit) return explicit;
14758
14678
  return generateShortTitle({
14759
14679
  completeText: args.completeText,
14680
+ cost: args.cost,
14760
14681
  kind: "task",
14761
14682
  sourceText: args.instruction,
14762
14683
  signal: args.signal
@@ -14830,6 +14751,7 @@ async function ensureConversationTitleOnce(args) {
14830
14751
  title = await generateShortTitle({
14831
14752
  completeText,
14832
14753
  context,
14754
+ cost: { conversationId: args.conversationId },
14833
14755
  kind,
14834
14756
  sourceText
14835
14757
  });
@@ -15191,7 +15113,7 @@ async function loadTurnProjection(args) {
15191
15113
  }
15192
15114
  /** Load MCP providers the credential subject connected in this conversation. */
15193
15115
  async function loadConnectedMcpProviders(args) {
15194
- return connectedMcpProvidersFromEvents(await getConversationEventStore().loadHistory(args.conversationId), args.credentialSubjectId);
15116
+ return connectedMcpProvidersFromEvents(await getConversationEventStore().loadEventsOfType(args.conversationId, "mcp_provider_connected"), args.credentialSubjectId);
15195
15117
  }
15196
15118
  function messageTimestamp(message) {
15197
15119
  const timestamp = message.timestamp;
@@ -15486,4 +15408,4 @@ async function recordGuardianActionReviewed(args) {
15486
15408
  createdAtMs: Date.now()
15487
15409
  }]);
15488
15410
  }
15489
- export { pauseLostWorkerTurn as $, createConversationAccessReader as $a, updateSlackMessage as $i, registration_exports as $n, bindScheduledAutomationCredentialSubject as $r, getUserMessageInstructionText as $t, isHumanConversationMessage as A, resolveSandboxCommandEnvironment as Aa, ensureDockerDaemon as Ai, getAgentBackgroundCompactionMarkTokens as An, lookupSlackUser as Ao, reviewItemNeedsSomeone as Ar, moveIdleConversationDestination as At, createPluginAuthOrchestration as B, SANDBOX_DATA_ROOT as Ba, formatSlackLink as Bi, resolvePluginOAuthAccount as Bn, getConfigDefaults as Bo, RESOURCE_WATCH_TOOL_SOURCE as Br, stopConversationWork as Bt, resolveConversationTitle as C, clearSandboxEgressSignals as Ca, invalidateReadySnapshot as Ci, SubscribedReplyReason as Cn, resolveRootVisibility as Co, canActOnReviewItem as Cr, getConversationWorkState as Ct, buildConversationContext as D, parseSandboxEgressCredentialToken as Da, create as Di, calculateContextCompactionTargetTokens as Dn, listConversationAnnotationsById as Do, readReviewItemAgentScope as Dr, isInvalidConversationRecordError as Dt, resolveTaskTitle as E, createSandboxEgressCredentialToken as Ea, setWorkspaceSnapshotBuild as Ei, getThreadStopDecision as En, listConversationAnnotations as Eo, isOnlyAssignee as Er, isFinalAttempt as Et, trimConversationMessages as F, workspaceRepoCheckoutPath as Fa, formatProviderLabel as Fi, setExperimentalFeatures as Fn, historyItemFromPiMessage as Fo, resolveAssignees as Fr, removeActiveConversation as Ft, abandonReplacedPendingAuth as G, sandboxSkillFile as Ga, addReactionToMessage as Gi, getPluginSlackConversationLink as Gn, createTimerWatch as Gr, buildTurnErrorResponse as Gt, AuthPausePersistenceError as H, SANDBOX_SKILLS_ROOT as Ha, normalizeSlackStatusText as Hi, createPluginHookRunner as Hn, cancelSubscriptions as Hr, TurnBudgetExceededError as Ht, turnHasReply as I, PluginToolDeniedError as Ia, parseOAuthStatePayload as Ii, createUserTokenStore as In, piMessageFromHistoryItem as Io, resolveChannelCapabilities as Ir, requestAnotherSlice as It, getConversationPendingAuth as J, buildNonInteractiveShellScript as Ja, openSlackDirectMessage as Ji, getPluginUserPromptContributions as Jn, findMatchingWatches as Jr, CODEMODE_TOOL_NAME as Jt, canReusePendingAuthLink as K, sandboxSkillPathResolution as Ka, deleteSlackMessage as Ki, getPluginSystemPromptContributions as Kn, createWatch as Kr, createTurnLimitGate as Kt, upsertConversationMessage as L, createPluginEmbedder as La, resolveBaseUrl as Li, findLegacyWebActorUserId as Ln, projectConversationEvents$1 as Lo, getSlackToolContext as Lr, requestConversationWork as Lt, markConversationMessage as M, SANDBOX_RUNTIME as Ma, isVercelSandboxEgressRequest as Mi, getAgentContextInputLimitTokens as Mn, createPluginCache as Mo, EVERYONE_ASSIGNEE as Mr, recordConversationRetry as Mt, normalizeConversationText as N, sleep$2 as Na, proxyVercelSandboxEgressRequest as Ni, getExperimentalFeatures as Nn, createDurableLocationConfigurationService as No, automationCreatorUserId as Nr, releaseConversationWork as Nt, estimateConversationMessagesTokens as O, sandboxEgressSignalsResponseSchema as Oa, hash as Oi, estimateRequestOverheadTokens as On, defaultTimezone as Oo, requireReviewItemAssignees as Or, listActiveConversationIds as Ot, recordDeliveredAssistantMessage as P, tryWorkspaceRepoCheckoutPath as Pa, deliverOAuthAuthorization as Pi, isExperimentalFeatureEnabled as Pn, configValueSchema as Po, resolveAssignee as Pr, releaseInboundMessage as Pt, lostWorkerBeforeFirstSave as Q, canAccessConversation as Qa, removeReactionFromMessage as Qi, coreTaskRegistrations as Qn, bindEventAutomationCredentialSubject as Qr, getTerminalAssistantMessages as Qt, createPluginEgress as R, createPluginModel as Ra, startOAuthFlow as Ri, webActorUserIds as Rn, JUNIOR_NATIVE_EVENT_NAMESPACE as Ro, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as Rr, startConversationWork as Rt, projectConversationMessages as S, workspaceSnapshotNotReadyUserMessage as Sa, WorkspaceValidationError as Si, buildDeterministicTurnId as Sn, slackAttachmentsVersionQuery as So, PLUGIN_REVIEW_ITEM_KEY_PREFIX as Sr, getConversation as St, fallbackShortTitle as T, consumeSandboxEgressPermissionDeniedSignal as Ta, setWorkspaceSnapshot as Ti, getSubscribedReplyPreflightDecision as Tn, createPluginAnnotations as To, canReadReviewItem as Tr, hasRunnableConversationWork as Tt, AuthorizationFlowDisabledError as U, SANDBOX_WORKSPACE_ROOT as Ua, slackMention as Ui, getPluginApiRoutes as Un, cancelWatch as Ur, TurnSliceLimitExceededError as Ut, authorizationId as V, SANDBOX_REPOS_ROOT as Va, normalizeSlackReplyMarkdown as Vi, agent_hooks_exports as Vn, setConfigDefaults as Vo, STOP_WATCHING_TOOL_NAME as Vr, TURN_LIMIT_WRAP_UP_MESSAGE as Vt, AuthorizationPauseError as W, sandboxSkillDir as Wa, truncateStatusText as Wi, getPluginRoutes as Wn, collectEventMatchKeys as Wr, TurnToolCallLimitExceededError as Wt, continuableMessages as X, createPluginModelCostRecorder as Xa, postSlackEphemeralMessage as Xi, setPlugins as Xn, listWatches as Xr, extractAssistantText as Xt, wasPendingAuthStopped as Y, runNonInteractiveCommand as Ya, openSlackModal as Yi, getPlugins as Yn, getWatch as Yr, persistWithRetry as Yt, loadTurnCheckpoint as Z, createPluginLogger as Za, postSlackMessage as Zi, validatePlugins as Zn, takeDueTimerWatches as Zr, getPiMessageRole as Zt, appendConversationMessages as _, throwSandboxOperationError as _a, getWorkspace as _i, renderChildTag as _n, notInheritedByForkChild as _o, listWaitingConversations as _r, clearExpiredConversationLease as _t, loadProjection as a, getFilePermalink as aa, JUNIOR_THREAD_STATE_TTL_MS as ai, isStandaloneRuntimeContextMessage as an, viewerConversationMembership as ao, listPushSubscriptions as ar, listTurnSummaries as at, persistConversationMessages as b, getWorkspaceSnapshotNotReadyError as ba, listWorkspacesByRepository as bi, tagJson as bn, readAttachmentVisionSummary as bo, takeReviewItem as br, deadLetterAttempt as bt, recordAgentsInstructionsUpdated as c, isConversationScopedChannel as ca, getDashboardReviewItemLink as ci, normalizeToolNameFromResult as cn, readConversationBriefThrough as co, savePushSubscription as cr, CONVERSATION_WORK_STALE_ENQUEUE_MS as ct, recordAuthorizationCompleted as d, runWithSlackInstallationToken as da, setDashboardConversationLinkOptions as di, trimTrailingAssistantMessages as dn, readConversationEventPageAfter as do, countReviewItemsNeedingUser as dr, appendInboundMessage as dt, uploadFilesToConversation as ea, bindSlackDirectCredentialSubject as ei, hasRuntimeTurnContext as en, readConversationAccessFromSql as eo, setBriefsConfig as er, saveTurnCheckpoint as et, recordAuthorizationRequested as f, withSlackRetries as fa, ToolInputError as fi, REQUEST_CONTEXT_SECTION_TAG as fn, readConversationEventPageAround as fo, dismissOpenReviewItems as fr, beginConversationResume as ft, recordToolExecutionStarted as g, isAlreadyExistsError as ga, deleteWorkspace as gi, escapeTagText as gn, loadForkHistory as go, listReplyActionItems as gr, clearConsumedConversationWake as gt, recordSubscribedReplyRoute as h, isAbortError as ha, createWorkspace as hi, escapeClosingTags as hn, buildSentryConversationUrl as ho, insertReviewItem as hr, claimInboundMessage as ht, loadConversationProjection as i, downloadPrivateSlackFile as ia, verifyTimerWatchCredentialSubject as ii, isContinuablePiBoundary as in, conversationViewerMarks as io, deletePushSubscription as ir, getTurnRecord as it, latestConversationMessageSeq as j, normalizeSandboxEgressTracePropagationDomains as ja, getSandboxProvider as ji, getAgentContextCompactionTriggerTokens as jn, lookupSlackUserNames as jo, reviewItemReaderForUser as jr, recordAttemptFailure as jt, getConversationMessageSlackTs as k, buildSandboxEgressNetworkPolicy as ka, isStale as ki, estimateTextTokens as kn, resolveUserTimezone as ko, requireReviewItemLinks as kr, markConversationWorkEnqueued as kt, recordAttachmentsDelivered as l, isDmChannel as la, getDashboardSettingsLink as li, retainRuntimeTurnContext as ln, readLatestConversationBrief as lo, REVIEW_ITEM_REPLIED_REASON as lr, ackMessages as lt, recordMcpProviderConnected as m, runWithWorkspaceTeamId as ma, renderToolResultNudge as mi, TURN_CONTEXT_TAG as mn, readConversationMessageEventSeq as mo, getReviewItem as mr, checkInConversationWork as mt, commitMessages as n, slackExternalRefIdSchema as na, verifyScheduledAutomationCredentialSubject as ni, instructionTextForProjection as nn, conversationIsMemberRoot as no, sendPushNotificationToUser as nr, completeTurnRecord as nt, loadTurnProjection as o, getHeaderString as oa, getDashboardConversationLink as oi, isToolResultError as on, viewerMarksFromParticipant as oo, readNotificationSchedule as or, recordTurnSummary as ot, recordGuardianActionReviewed as p, getWorkspaceTeamId as pa, createPluginState as pi, SESSION_CONTEXT_SECTION_TAG as pn, readConversationLastEventSeq as po, getOpenReviewItemByDedupeKey as pr, cancelHumanFacingPendingMessages as pt, clearPendingAuth as q, buildCommandScript as qa, getSlackMessagePermalink as qi, getPluginTools as qn, deliverWatch as qr, isTurnExecutionLimitExceededError as qt, loadConnectedMcpProviders as r, SlackActionError as ra, verifySlackDirectCredentialSubject as ri, isAssistantMessage as rn, conversationPinnedForUser as ro, resolveNotificationTimezone as rr, failTurnRecord as rt, openConversationProjection as s, getSlackClient as sa, getDashboardObjectIconLink as si, isToolResultMessage as sn, createPluginConversationEvents as so, saveNotificationSchedule as sr, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS as st, commitAcceptedReply as t, slackEntitySchema as ta, verifyEventAutomationCredentialSubject as ti, hasTurnInput as tn, conversationHasParticipantUser as to, readWebPushConfig as tr, abandonTurnRecord as tt, recordAuthenticationLinked as u, normalizeSlackConversationId as ua, getDashboardTaskLink as ui, stripRuntimeTurnContext as un, readConversationEventPage as uo, closeReviewItem as ur, appendExclusiveInboundMessage as ut, hydrateConversationMessages as v, wrapSandboxSetupError as va, getWorkspaceByName as vi, renderTag as vn, getSlackFileId as vo, reviewItemsNeedingUserVersionQuery as vr, completeConversationStop as vt, settleConversationTitleWork as w, consumeSandboxEgressAuthRequiredSignal as wa, loadSnapshotsForProfile as wi, decideSubscribedThreadReply as wn, saveObjectAnnotations as wo, canAgentChangeReviewItem as wr, hasConversationStop as wt, toStoredConversationMessage as x, isWorkspaceSnapshotNotReadyError as xa, updateWorkspace as xi, buildDeterministicAssistantMessageId as xn, recordSlackAttachment as xo, updateReviewItemContent as xr, drainConversationMailbox as xt, persistConversationMessageWindow as y, WorkspaceSnapshotNotReadyError as ya, listWorkspaces as yi, renderUntrustedTag as yn, matchSlackAttachments as yo, searchReviewItems as yr, completeConversationWork as yt, PluginCredentialFailureError as z, SANDBOX_COMMAND_PATH as za, escapeSlackMrkdwnText as zi, getOAuthAccountProviders as zn, conversationNoteEvent as zo, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as zr, steerWebPendingMessages as zt };
15411
+ export { pauseLostWorkerTurn as $, createPluginLogger as $a, postSlackMessage as $i, validatePlugins as $n, takeDueTimerWatches as $r, getUserMessageInstructionText as $t, isHumanConversationMessage as A, sandboxEgressSignalsResponseSchema as Aa, hash as Ai, estimateTextTokens as An, listConversationAnnotationsById as Ao, requireReviewItemAssignees as Ar, moveIdleConversationDestination as At, createPluginAuthOrchestration as B, createPluginModel as Ba, startOAuthFlow as Bi, webActorUserIds as Bn, projectConversationEvents$1 as Bo, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as Br, stopConversationWork as Bt, resolveConversationTitle as C, isWorkspaceSnapshotNotReadyError as Ca, updateWorkspace as Ci, buildDeterministicTurnId as Cn, readAttachmentVisionSummary as Co, updateReviewItemContent as Cr, getConversationWorkState as Ct, buildConversationContext as D, consumeSandboxEgressPermissionDeniedSignal as Da, setWorkspaceSnapshot as Di, getThreadStopDecision as Dn, saveObjectAnnotations as Do, canReadReviewItem as Dr, isInvalidConversationRecordError as Dt, resolveTaskTitle as E, consumeSandboxEgressAuthRequiredSignal as Ea, loadSnapshotsForProfile as Ei, getSubscribedReplyPreflightDecision as En, resolveRootVisibility as Eo, canAgentChangeReviewItem as Er, isFinalAttempt as Et, trimConversationMessages as F, sleep$2 as Fa, proxyVercelSandboxEgressRequest as Fi, getExperimentalFeatures as Fn, createPluginCache as Fo, automationCreatorUserId as Fr, removeActiveConversation as Ft, abandonReplacedPendingAuth as G, SANDBOX_WORKSPACE_ROOT as Ga, slackMention as Gi, getPluginApiRoutes as Gn, cancelWatch as Gr, buildTurnErrorResponse as Gt, AuthPausePersistenceError as H, SANDBOX_DATA_ROOT as Ha, formatSlackLink as Hi, resolvePluginOAuthAccount as Hn, setConfigDefaults as Ho, RESOURCE_WATCH_TOOL_SOURCE as Hr, TurnBudgetExceededError as Ht, turnHasReply as I, tryWorkspaceRepoCheckoutPath as Ia, deliverOAuthAuthorization as Ii, isExperimentalFeatureEnabled as In, createDurableLocationConfigurationService as Io, resolveAssignee as Ir, requestAnotherSlice as It, getConversationPendingAuth as J, sandboxSkillPathResolution as Ja, deleteSlackMessage as Ji, getPluginSystemPromptContributions as Jn, createWatch as Jr, CODEMODE_TOOL_NAME as Jt, canReusePendingAuthLink as K, sandboxSkillDir as Ka, truncateStatusText as Ki, getPluginRoutes as Kn, collectEventMatchKeys as Kr, createTurnLimitGate as Kt, upsertConversationMessage as L, workspaceRepoCheckoutPath as La, formatProviderLabel as Li, setExperimentalFeatures as Ln, configValueSchema as Lo, resolveAssignees as Lr, requestConversationWork as Lt, markConversationMessage as M, resolveSandboxCommandEnvironment as Ma, ensureDockerDaemon as Mi, getAgentContextCompactionTriggerTokens as Mn, resolveUserTimezone as Mo, reviewItemNeedsSomeone as Mr, recordConversationRetry as Mt, normalizeConversationText as N, normalizeSandboxEgressTracePropagationDomains as Na, getSandboxProvider as Ni, getAgentContextInputLimitTokens as Nn, lookupSlackUser as No, reviewItemReaderForUser as Nr, releaseConversationWork as Nt, estimateConversationMessagesTokens as O, createSandboxEgressCredentialToken as Oa, setWorkspaceSnapshotBuild as Oi, calculateContextCompactionTargetTokens as On, createPluginAnnotations as Oo, isOnlyAssignee as Or, listActiveConversationIds as Ot, recordDeliveredAssistantMessage as P, SANDBOX_RUNTIME as Pa, isVercelSandboxEgressRequest as Pi, getTokenEstimateProfile as Pn, lookupSlackUserNames as Po, EVERYONE_ASSIGNEE as Pr, releaseInboundMessage as Pt, lostWorkerBeforeFirstSave as Q, createPluginModelCostRecorder as Qa, postSlackEphemeralMessage as Qi, setPlugins as Qn, listWatches as Qr, getTerminalAssistantMessages as Qt, createPluginEgress as R, PluginToolDeniedError as Ra, parseOAuthStatePayload as Ri, createUserTokenStore as Rn, historyItemFromPiMessage as Ro, resolveChannelCapabilities as Rr, startConversationWork as Rt, projectConversationMessages as S, getWorkspaceSnapshotNotReadyError as Sa, listWorkspacesByRepository as Si, buildDeterministicAssistantMessageId as Sn, matchSlackAttachments as So, takeReviewItem as Sr, getConversation as St, fallbackShortTitle as T, clearSandboxEgressSignals as Ta, invalidateReadySnapshot as Ti, decideSubscribedThreadReply as Tn, slackAttachmentsVersionQuery as To, canActOnReviewItem as Tr, hasRunnableConversationWork as Tt, AuthorizationFlowDisabledError as U, SANDBOX_REPOS_ROOT as Ua, normalizeSlackReplyMarkdown as Ui, agent_hooks_exports as Un, STOP_WATCHING_TOOL_NAME as Ur, TurnSliceLimitExceededError as Ut, authorizationId as V, SANDBOX_COMMAND_PATH as Va, escapeSlackMrkdwnText as Vi, getOAuthAccountProviders as Vn, getConfigDefaults as Vo, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as Vr, TURN_LIMIT_WRAP_UP_MESSAGE as Vt, AuthorizationPauseError as W, SANDBOX_SKILLS_ROOT as Wa, normalizeSlackStatusText as Wi, createPluginHookRunner as Wn, cancelSubscriptions as Wr, TurnToolCallLimitExceededError as Wt, continuableMessages as X, buildNonInteractiveShellScript as Xa, openSlackDirectMessage as Xi, getPluginUserPromptContributions as Xn, findMatchingWatches as Xr, extractAssistantText as Xt, wasPendingAuthStopped as Y, buildCommandScript as Ya, getSlackMessagePermalink as Yi, getPluginTools as Yn, deliverWatch as Yr, persistWithRetry as Yt, loadTurnCheckpoint as Z, runNonInteractiveCommand as Za, openSlackModal as Zi, getPlugins as Zn, getWatch as Zr, getPiMessageRole as Zt, appendConversationMessages as _, isAbortError as _a, createWorkspace as _i, readParentAgentTask as _n, readConversationMessageEventSeq as _o, insertReviewItem as _r, clearExpiredConversationLease as _t, loadProjection as a, SlackActionError as aa, verifySlackDirectCredentialSubject as ai, isStandaloneRuntimeContextMessage as an, conversationIsNotUnsubscribedRoot as ao, resolveNotificationTimezone as ar, listTurnSummaries as at, persistConversationMessages as b, wrapSandboxSetupError as ba, getWorkspaceByName as bi, renderUntrustedTag as bn, notInheritedByForkChild as bo, reviewItemsNeedingUserVersionQuery as br, deadLetterAttempt as bt, recordAgentsInstructionsUpdated as c, getHeaderString as ca, getDashboardConversationLink as ci, normalizeToolNameFromResult as cn, viewerConversationMembership as co, readNotificationSchedule as cr, CONVERSATION_WORK_STALE_ENQUEUE_MS as ct, recordAuthorizationCompleted as d, isDmChannel as da, getDashboardSettingsLink as di, trimTrailingAssistantMessages as dn, readConversationBriefThrough as do, REVIEW_ITEM_REPLIED_REASON as dr, appendInboundMessage as dt, removeReactionFromMessage as ea, bindEventAutomationCredentialSubject as ei, hasRuntimeTurnContext as en, canAccessConversation as eo, coreTaskRegistrations as er, saveTurnCheckpoint as et, recordAuthorizationRequested as f, normalizeSlackConversationId as fa, getDashboardTaskLink as fi, REQUEST_CONTEXT_SECTION_TAG as fn, readLatestConversationBrief as fo, closeReviewItem as fr, beginConversationResume as ft, recordToolExecutionStarted as g, runWithWorkspaceTeamId as ga, renderToolResultNudge as gi, escapeTagText as gn, readConversationLastEventSeq as go, getReviewItem as gr, clearConsumedConversationWake as gt, recordSubscribedReplyRoute as h, getWorkspaceTeamId as ha, createPluginState as hi, escapeClosingTags as hn, readConversationEventPageAround as ho, getOpenReviewItemByDedupeKey as hr, claimInboundMessage as ht, loadConversationProjection as i, slackExternalRefIdSchema as ia, verifyScheduledAutomationCredentialSubject as ii, isContinuablePiBoundary as in, conversationIsMemberRoot as io, sendPushNotificationToUser as ir, getTurnRecord as it, latestConversationMessageSeq as j, buildSandboxEgressNetworkPolicy as ja, isStale as ji, getAgentBackgroundCompactionMarkTokens as jn, defaultTimezone as jo, requireReviewItemLinks as jr, recordAttemptFailure as jt, getConversationMessageSlackTs as k, parseSandboxEgressCredentialToken as ka, create as ki, estimateRequestOverheadTokens as kn, listConversationAnnotations as ko, readReviewItemAgentScope as kr, markConversationWorkEnqueued as kt, recordAttachmentsDelivered as l, getSlackClient as la, getDashboardObjectIconLink as li, retainRuntimeTurnContext as ln, viewerMarksFromParticipant as lo, saveNotificationSchedule as lr, ackMessages as lt, recordMcpProviderConnected as m, withSlackRetries as ma, ToolInputError as mi, TURN_CONTEXT_TAG as mn, readConversationEventPageAfter as mo, dismissOpenReviewItems as mr, checkInConversationWork as mt, commitMessages as n, uploadFilesToConversation as na, bindSlackDirectCredentialSubject as ni, instructionTextForProjection as nn, readConversationAccessFromSql as no, setBriefsConfig as nr, completeTurnRecord as nt, loadTurnProjection as o, downloadPrivateSlackFile as oa, verifyTimerWatchCredentialSubject as oi, isToolResultError as on, conversationPinnedForUser as oo, deletePushSubscription as or, recordTurnSummary as ot, recordGuardianActionReviewed as p, runWithSlackInstallationToken as pa, setDashboardConversationLinkOptions as pi, SESSION_CONTEXT_SECTION_TAG as pn, readConversationEventPage as po, countReviewItemsNeedingUser as pr, cancelHumanFacingPendingMessages as pt, clearPendingAuth as q, sandboxSkillFile as qa, addReactionToMessage as qi, getPluginSlackConversationLink as qn, createTimerWatch as qr, isTurnExecutionLimitExceededError as qt, loadConnectedMcpProviders as r, slackEntitySchema as ra, verifyEventAutomationCredentialSubject as ri, isAssistantMessage as rn, conversationHasParticipantUser as ro, readWebPushConfig as rr, failTurnRecord as rt, openConversationProjection as s, getFilePermalink as sa, JUNIOR_THREAD_STATE_TTL_MS as si, isToolResultMessage as sn, conversationViewerMarks as so, listPushSubscriptions as sr, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS as st, commitAcceptedReply as t, updateSlackMessage as ta, bindScheduledAutomationCredentialSubject as ti, hasTurnInput as tn, createConversationAccessReader as to, registration_exports as tr, abandonTurnRecord as tt, recordAuthenticationLinked as u, isConversationScopedChannel as ua, getDashboardReviewItemLink as ui, stripRuntimeTurnContext as un, createPluginConversationEvents as uo, savePushSubscription as ur, appendExclusiveInboundMessage as ut, hydrateConversationMessages as v, isAlreadyExistsError as va, deleteWorkspace as vi, renderChildTag as vn, buildSentryConversationUrl as vo, listReplyActionItems as vr, completeConversationStop as vt, settleConversationTitleWork as w, workspaceSnapshotNotReadyUserMessage as wa, WorkspaceValidationError as wi, SubscribedReplyReason as wn, recordSlackAttachment as wo, PLUGIN_REVIEW_ITEM_KEY_PREFIX as wr, hasConversationStop as wt, toStoredConversationMessage as x, WorkspaceSnapshotNotReadyError as xa, listWorkspaces as xi, tagJson as xn, getSlackFileId as xo, searchReviewItems as xr, drainConversationMailbox as xt, persistConversationMessageWindow as y, throwSandboxOperationError as ya, getWorkspace as yi, renderTag as yn, loadForkHistory as yo, listWaitingConversations as yr, completeConversationWork as yt, PluginCredentialFailureError as z, createPluginEmbedder as za, resolveBaseUrl as zi, findLegacyWebActorUserId as zn, piMessageFromHistoryItem as zo, getSlackToolContext as zr, steerWebPendingMessages as zt };
@@ -1,5 +1,185 @@
1
- import { G as conversationBriefSchema, K as parseBriefInput, U as briefOutcomeStatusSchema } from "./conversation-BusI2uzj.js";
1
+ import { C as completeText$1, S as completeObject$1, x as completeDecision$1 } from "./config-CkHcUMN7.js";
2
+ import { _ as runBestEffort, a as extractGenAiUsageSummary } from "./logging-BO5zU6Mt.js";
3
+ import { H as agentTurnCostUsd, r as getConversationEventStore } from "./db-DJ11eZqq.js";
4
+ import { G as conversationBriefSchema, K as parseBriefInput, U as briefOutcomeStatusSchema } from "./conversation-E7ZPJx2H.js";
2
5
  import * as z from "zod";
6
+ import { conversationEventPresentationSchema, defineConversationEvent } from "@sentry/junior-plugin-api";
7
+ // src/chat/conversations/structured-events.ts
8
+ /** Reserved namespace for Junior-owned conversation metadata events. */
9
+ const JUNIOR_NATIVE_EVENT_NAMESPACE = "junior";
10
+ const authenticationEventContentSchema = z.object({
11
+ accountLabel: z.string().trim().min(1).max(120).optional(),
12
+ actorId: z.string().min(1),
13
+ authorizationId: z.string().min(1).optional(),
14
+ provider: z.string().regex(/^[a-z][a-z0-9-]*$/),
15
+ providerLabel: z.string().trim().min(1).max(80).optional()
16
+ }).strict();
17
+ const agentsInstructionsUpdatedContentSchema = z.object({
18
+ action: z.enum([
19
+ "loaded",
20
+ "replaced",
21
+ "cleared"
22
+ ]),
23
+ directory: z.string().trim().min(1).max(500).optional(),
24
+ fingerprint: z.string().trim().min(1).max(128),
25
+ sources: z.array(z.object({
26
+ content: z.string().min(1).max(32768),
27
+ path: z.string().trim().min(1).max(500)
28
+ }).strict()).max(32),
29
+ textBytes: z.number().int().nonnegative().optional()
30
+ }).strict();
31
+ function providerTitle(content) {
32
+ return content.providerLabel?.trim() || content.provider;
33
+ }
34
+ function agentsInstructionsTitle(action) {
35
+ if (action === "loaded") return "Loaded AGENTS.md";
36
+ if (action === "replaced") return "Updated AGENTS.md";
37
+ return "Cleared AGENTS.md";
38
+ }
39
+ function sourceFilename(sourcePath) {
40
+ return sourcePath.split("/").at(-1) || sourcePath;
41
+ }
42
+ function formatBytes(bytes) {
43
+ if (bytes < 1024) return `${bytes} bytes`;
44
+ const kilobytes = bytes / 1024;
45
+ return `${Number.isInteger(kilobytes) ? kilobytes : kilobytes.toFixed(1)} KB`;
46
+ }
47
+ function agentsInstructionsPreview(content) {
48
+ const source = content.sources[0];
49
+ if (!source) return void 0;
50
+ const filename = sourceFilename(source.path);
51
+ const label = content.sources.length === 1 ? filename : `${content.sources.length} AGENTS.md files`;
52
+ return typeof content.textBytes === "number" ? `${label} · ${formatBytes(content.textBytes)}` : label;
53
+ }
54
+ /** Junior-owned account-link transcript event. */
55
+ const authenticationLinkedEvent = defineConversationEvent({
56
+ name: "authentication_linked",
57
+ version: 1,
58
+ schema: authenticationEventContentSchema,
59
+ renderEvent(event) {
60
+ const provider = providerTitle(event);
61
+ return {
62
+ icon: "link",
63
+ title: `${provider} connected`,
64
+ ...event.accountLabel ? { preview: `Connected as \`${event.accountLabel}\`` } : void 0,
65
+ details: [{
66
+ title: `${provider} connected`,
67
+ ...event.accountLabel ? { description: `Connected as \`${event.accountLabel}\`` } : void 0,
68
+ metadata: [event.provider]
69
+ }]
70
+ };
71
+ }
72
+ });
73
+ /** Junior-owned account-unlink transcript event. */
74
+ const authenticationUnlinkedEvent = defineConversationEvent({
75
+ name: "authentication_unlinked",
76
+ version: 1,
77
+ schema: authenticationEventContentSchema,
78
+ renderEvent(event) {
79
+ const provider = providerTitle(event);
80
+ return {
81
+ icon: "key",
82
+ title: `${provider} disconnected`,
83
+ details: [{
84
+ title: `${provider} disconnected`,
85
+ metadata: [event.provider]
86
+ }]
87
+ };
88
+ }
89
+ });
90
+ /** Junior-owned AGENTS.md bootstrap transition for the dashboard timeline. */
91
+ const agentsInstructionsUpdatedEvent = defineConversationEvent({
92
+ name: "agents_instructions_updated",
93
+ version: 1,
94
+ schema: agentsInstructionsUpdatedContentSchema,
95
+ renderEvent(event) {
96
+ const title = agentsInstructionsTitle(event.action);
97
+ const preview = agentsInstructionsPreview(event);
98
+ return {
99
+ icon: "brain",
100
+ title,
101
+ ...preview ? { preview } : void 0,
102
+ ...event.sources.length > 0 ? { details: event.sources.map((source) => ({
103
+ title: sourceFilename(source.path),
104
+ content: source.content
105
+ })) } : void 0
106
+ };
107
+ }
108
+ });
109
+ /** Core-written Conversation note. `notes.ts` owns when the model sees it. */
110
+ const conversationNoteEvent = defineConversationEvent({
111
+ name: "conversation_note",
112
+ version: 1,
113
+ schema: z.object({ text: z.string().trim().min(1).max(500) }).strict(),
114
+ renderEvent(event) {
115
+ return {
116
+ icon: "info",
117
+ title: "Note for the next Turn",
118
+ preview: event.text
119
+ };
120
+ }
121
+ });
122
+ const NATIVE_EVENT_DEFINITIONS = [
123
+ authenticationLinkedEvent,
124
+ authenticationUnlinkedEvent,
125
+ agentsInstructionsUpdatedEvent,
126
+ conversationNoteEvent
127
+ ];
128
+ /** Resolve a registered Junior-native conversation event definition. */
129
+ function getJuniorNativeEventDefinition(args) {
130
+ return NATIVE_EVENT_DEFINITIONS.find((definition) => definition.eventName === args.name && definition.version === args.version);
131
+ }
132
+ /** Render one Junior-native event through its active definition. */
133
+ function renderJuniorNativeConversationEvent(args) {
134
+ if (args.namespace !== "junior") return void 0;
135
+ const definition = getJuniorNativeEventDefinition(args);
136
+ if (!definition) return void 0;
137
+ const presentation = definition.renderEvent(definition.parse(args.content));
138
+ return presentation === void 0 ? void 0 : conversationEventPresentationSchema.parse(presentation);
139
+ }
140
+ // src/chat/core-model.ts
141
+ function gatewayParams(params) {
142
+ const { cost: _cost, operation, ...rest } = params;
143
+ return {
144
+ ...rest,
145
+ promptName: `junior.${operation}`
146
+ };
147
+ }
148
+ async function recordCost(attribution, costUsd) {
149
+ const { cost, operation } = attribution;
150
+ if (costUsd === void 0 || !("conversationId" in cost)) return;
151
+ await runBestEffort(async () => {
152
+ await getConversationEventStore().append(cost.conversationId, [{
153
+ createdAtMs: Date.now(),
154
+ data: {
155
+ type: "structured_event",
156
+ namespace: JUNIOR_NATIVE_EVENT_NAMESPACE,
157
+ name: operation,
158
+ version: 1,
159
+ ...cost.turnId ? { turnId: cost.turnId } : void 0,
160
+ content: { costUsd }
161
+ }
162
+ }], { activity: "preserve" });
163
+ }, "model_cost.record.failed", { "gen_ai.prompt.name": `junior.${operation}` });
164
+ }
165
+ /** Run a text completion and attribute its cost. */
166
+ async function completeText(params) {
167
+ const result = await completeText$1(gatewayParams(params));
168
+ await recordCost(params, agentTurnCostUsd(extractGenAiUsageSummary(result.message)));
169
+ return result;
170
+ }
171
+ /** Run a schema-constrained completion and attribute its cost. */
172
+ async function completeObject(params) {
173
+ const result = await completeObject$1(gatewayParams(params));
174
+ await recordCost(params, result.costUsd);
175
+ return result;
176
+ }
177
+ /** Answer decision questions and attribute the cost. */
178
+ async function completeDecision(params) {
179
+ const result = await completeDecision$1(gatewayParams(params));
180
+ await recordCost(params, result.costUsd);
181
+ return result;
182
+ }
3
183
  // src/chat/briefs/generate.ts
4
184
  const MAX_INPUT_CHARS = 6e4;
5
185
  const MAX_MESSAGE_TEXT_CHARS = 4e3;
@@ -526,4 +706,4 @@ Rules:
526
706
  - Cite a URL only when its exact full string occurs in an entry, evidence, or the previous Brief. Return cited URLs in \`urls\`. Core adds code changes and resources separately.
527
707
  - Keep the summary under 600 characters, intent under 400 characters, outcome text under 600 characters, and each other string under 400 characters.
528
708
  `;
529
- export { EVENT_SYSTEM_ACTOR as a, EVENT_MESSAGE_AUTHOR as i, briefEntriesFromReportEvents as n, isEventConversationMessage as o, EVENT_AUTHOR_ID as r, generateBrief as s, BRIEF_PROMPT as t };
709
+ export { EVENT_SYSTEM_ACTOR as a, completeDecision as c, JUNIOR_NATIVE_EVENT_NAMESPACE as d, agentsInstructionsUpdatedEvent as f, renderJuniorNativeConversationEvent as g, conversationNoteEvent as h, EVENT_MESSAGE_AUTHOR as i, completeObject as l, authenticationUnlinkedEvent as m, briefEntriesFromReportEvents as n, isEventConversationMessage as o, authenticationLinkedEvent as p, EVENT_AUTHOR_ID as r, generateBrief as s, BRIEF_PROMPT as t, completeText as u };