@sentry/junior 0.258.0 → 0.260.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/adapter-Dj5BTJRd.js +270 -0
  2. package/dist/{admin-My1SLGVO.js → admin-tzkZDqrH.js} +1 -1
  3. package/dist/{agent-hooks-BJ_5mlRH.js → agent-hooks-V4Hfc2tB.js} +711 -697
  4. package/dist/{agent-runner-DGsFQw72.js → agent-runner-DvTUyGTY.js} +751 -2508
  5. package/dist/api/schema.d.ts +239 -54
  6. package/dist/api/schema.js +4 -4
  7. package/dist/api.js +218 -57
  8. package/dist/{app-PX2H1PxU.d.ts → app-BsBUs3rF.d.ts} +6 -3
  9. package/dist/app.d.ts +2 -2
  10. package/dist/app.js +31 -31
  11. package/dist/{assistant-reply-H1M-91oF.js → assistant-reply-CEOMzsWy.js} +1 -1
  12. package/dist/{automation-DWBFBenG.js → automation-DrpcA-SX.js} +3 -0
  13. package/dist/{briefs-vYoK85rJ.js → briefs-BSCkyYqs.js} +4 -4
  14. package/dist/{catalog-runtime-BN4DVxco.js → catalog-runtime-Bpcs2b2L.js} +1 -1
  15. package/dist/cli/chat.d.ts +1 -1
  16. package/dist/cli/chat.js +16 -16
  17. package/dist/cli/check.js +3 -3
  18. package/dist/cli/main.js +6 -2
  19. package/dist/cli/plugins.d.ts +1 -1
  20. package/dist/cli/plugins.js +4 -4
  21. package/dist/cli/run.d.ts +2 -1
  22. package/dist/cli/run.js +2 -1
  23. package/dist/cli/snapshot-create.js +4 -3
  24. package/dist/cli/upgrade.d.ts +1 -1
  25. package/dist/cli/upgrade.js +3 -3
  26. package/dist/{client-DbyHuMFU.js → client-JeyzRwsT.js} +57 -4
  27. package/dist/{config-_WO_AjCB.js → config-ULs6Zl9b.js} +5 -2
  28. package/dist/{connections-ag_1JOhB.js → connections-CZ7HhEmN.js} +174 -10
  29. package/dist/{conversation-DjN3mlog.js → conversation-CvuKJ3tA.js} +108 -155
  30. package/dist/{conversation-privacy-DHP_xnVj.js → conversation-privacy-BQSlZXgV.js} +1 -1
  31. package/dist/{credential-sync-B-CPX_ag.js → credential-sync-BKcv5rBe.js} +14 -177
  32. package/dist/{executor-RvG6kVe1.js → executor-BoGNVEDn.js} +3 -2
  33. package/dist/{images-C2J_bj2g.js → images-BBmDXQCB.js} +3 -3
  34. package/dist/instrumentation.js +2 -2
  35. package/dist/{job-queue-DVe37it2.js → job-queue-CbdVyaCo.js} +1 -1
  36. package/dist/{logging-DsHONhVm.js → logging-DSMmkHXG.js} +1 -1
  37. package/dist/{message-DyitL8no.js → message-zaj5gBbS.js} +3 -3
  38. package/dist/nitro.d.ts +2 -2
  39. package/dist/nitro.js +3 -3
  40. package/dist/{oauth-callback-server-CDby-pCn.js → oauth-callback-server-yYFG8Own.js} +2 -2
  41. package/dist/{plugins-B11Mfkmv.d.ts → plugins-B_0Cr0MO.d.ts} +5 -1
  42. package/dist/{profile-DpYjfKke.js → profile-ByWkAY7L.js} +24 -293
  43. package/dist/{prompt-xgpyMtg7.js → prompt-DeVax2qO.js} +1 -1
  44. package/dist/{registry-Du566MtJ.js → registry-BL-osYWN.js} +41 -2
  45. package/dist/{resolve-ClCIgh8E.js → resolve-HuPG2VMB.js} +9 -4
  46. package/dist/{result-BBbKA61B.js → result-DS7V4a3-.js} +9 -14
  47. package/dist/{runner-CCuqFSqx.js → runner-Cba_OfGl.js} +11 -11
  48. package/dist/{sandbox-egress-signals-DY1mbKF4.js → sandbox-egress-signals-C7NcPzea.js} +1 -1
  49. package/dist/{schema-DrMh3NtR.js → schema-OzL8Zw4H.js} +82 -3
  50. package/dist/service-account-DqwHhwJA.js +120 -0
  51. package/dist/service-account-Ko1Xs--F.js +661 -0
  52. package/dist/{session-stop-CIoFiwwe.js → session-stop-HfKx-pky.js} +180 -22
  53. package/dist/{skills-DyQBLIrK.js → skills-D6_bcAuW.js} +2 -2
  54. package/dist/{spawn-Dqfeo7XP.js → spawn-BWqK6EwM.js} +2 -2
  55. package/dist/{store-DJLwq4x8.js → store-DzRbd5VT.js} +6 -6
  56. package/dist/{task-queue-BzW4MaWU.js → task-queue-9LICOzcL.js} +3 -3
  57. package/dist/{task-runner-D3qJh4fK.js → task-runner-DGnd_B5X.js} +10 -10
  58. package/dist/{tasks-CEXKTASS.js → tasks-CjrS098O.js} +4928 -2389
  59. package/dist/thread-state-CqkYowEz.js +184 -0
  60. package/dist/{turn-failure-response-CWx7aNIh.js → turn-failure-response-BkKmGqFt.js} +8 -9
  61. package/dist/{turn-lifecycle-C9JFst7-.js → turn-lifecycle-DYv8IV6w.js} +1 -1
  62. package/dist/{turn-session-routing-CUxtfpr7.js → turn-session-routing-TaVhKmdz.js} +1 -1
  63. package/dist/{validation-BHRxa5G4.js → validation-BrXMYPyo.js} +1 -1
  64. package/dist/{version-C0U6rHg0.js → version-Ct049vav.js} +1 -1
  65. package/dist/version.js +1 -1
  66. package/dist/{viewer-CGvvRqKp.js → viewer-C-J0ewlH.js} +19 -10
  67. package/dist/{web-input-Keb5GRWj.js → web-input-C_xB3RXp.js} +41 -37
  68. package/dist/{work-DRcsJ3hV.js → work-D829Ue7k.js} +9 -10
  69. package/dist/{worker-Cjo-QqPq.js → worker-BRTYzlpk.js} +5 -5
  70. package/migrations/0061_workspace_vcpus.sql +1 -0
  71. package/migrations/meta/0061_snapshot.json +3471 -0
  72. package/migrations/meta/_journal.json +7 -0
  73. package/package.json +6 -6
  74. package/dist/experimental-BNK1l1jv.js +0 -49
  75. package/dist/oauth-authorization-djQn5Nhy.js +0 -97
  76. package/dist/pending-auth-D8J1uJUS.js +0 -442
  77. package/dist/thread-state-W3f6kAtz.js +0 -426
@@ -1,97 +1,6 @@
1
1
  import { a as conversationTurnFailureReasonSchema, h as usageSchema, i as conversationTurnFailureCodeSchema } from "./history-AY8rs-FR.js";
2
2
  import { z } from "zod";
3
3
  import { codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, objectFactFields, objectTypeSchema } from "@sentry/junior-plugin-api";
4
- // src/chat/automations/card.ts
5
- /** Saved automation facts shown with a Message, not a live status view. */
6
- const automationCardSchema = z.object({
7
- kind: z.literal("automation"),
8
- id: z.string().min(1),
9
- title: z.string().min(1).max(160),
10
- url: z.string().url().nullable(),
11
- instruction: z.string().max(4e3),
12
- trigger: z.string().min(1),
13
- warning: z.string().nullable()
14
- }).strict();
15
- /** Render saved card facts for text-only delivery and accessible fallbacks. */
16
- function automationCardText(card) {
17
- return [
18
- card.title,
19
- card.warning,
20
- card.trigger,
21
- card.instruction,
22
- card.url,
23
- `Automation ID: ${card.id}`
24
- ].filter(Boolean).join("\n");
25
- }
26
- // src/chat/conversations/cards.ts
27
- const storedCardSchema = automationCardSchema.extend({ operation: z.enum([
28
- "created",
29
- "updated",
30
- "deleted"
31
- ]).optional() });
32
- /** Render each built-in card with its own text format. */
33
- function messageCardText(card) {
34
- switch (card.kind) {
35
- case "object": return [
36
- card.title,
37
- card.label !== card.title ? card.label : void 0,
38
- card.description,
39
- card.status,
40
- ...objectFactFields(card.facts).map((field) => `${field.label}: ${field.value}`),
41
- card.trigger,
42
- card.warning,
43
- card.url
44
- ].filter(Boolean).join("\n");
45
- case "automation": return automationCardText(card);
46
- }
47
- }
48
- /** Identify a deleted object whose pending card must be omitted. */
49
- const removedCardSchema = z.object({
50
- plugin: z.string().min(1),
51
- key: z.string().min(1)
52
- }).strict();
53
- /** Store only the annotation identity with a Message. */
54
- const messageCardRefSchema = removedCardSchema.extend({ kind: z.literal("object") });
55
- /** Remove display facts before saving or reporting a Message card. */
56
- function messageCardRef(card) {
57
- return card.kind === "object" ? {
58
- kind: "object",
59
- plugin: card.plugin,
60
- key: card.key
61
- } : {
62
- kind: "object",
63
- plugin: "junior",
64
- key: card.id
65
- };
66
- }
67
- /** Read references, including identities from older saved card snapshots. */
68
- function readMessageCardRefs(value) {
69
- return [...storedCardSchema.array().parse(value.cards ?? []).flatMap(({ operation, ...card }) => operation === "deleted" ? [] : [messageCardRef(card)]), ...messageCardRefSchema.strip().array().parse(value.objectCards ?? [])];
70
- }
71
- /** Resolve current saved facts without fetching providers or changing history. */
72
- function resolveMessageCards(refs, annotations) {
73
- return refs.map((ref) => {
74
- const annotation = annotations.find((item) => item.kind === ref.kind && item.plugin === ref.plugin && item.key === ref.key);
75
- return annotation ? annotationCard(annotation) : {
76
- ...ref,
77
- objectType: "item",
78
- title: ref.key,
79
- label: ref.key,
80
- url: null,
81
- warning: "Saved annotation is unavailable."
82
- };
83
- });
84
- }
85
- /** Copy saved annotation facts without storage timestamps for Message delivery. */
86
- function annotationCard(annotation) {
87
- const { createdAt: _createdAt, updatedAt: _updatedAt, ...value } = annotation;
88
- return value.kind === "object" ? value : {
89
- ...value,
90
- kind: "object",
91
- objectType: value.objectType ?? "item",
92
- title: value.label
93
- };
94
- }
95
4
  // src/chat/briefs/schema.ts
96
5
  /**
97
6
  * Runtime schemas for the Brief record and the generator input. Both cross a
@@ -312,6 +221,97 @@ const messageAttachmentSchema = z.object({
312
221
  function readMessageAttachments(value) {
313
222
  return messageAttachmentSchema.array().parse(value ?? []);
314
223
  }
224
+ // src/chat/automations/card.ts
225
+ /** Saved automation facts shown with a Message, not a live status view. */
226
+ const automationCardSchema = z.object({
227
+ kind: z.literal("automation"),
228
+ id: z.string().min(1),
229
+ title: z.string().min(1).max(160),
230
+ url: z.string().url().nullable(),
231
+ instruction: z.string().max(4e3),
232
+ trigger: z.string().min(1),
233
+ warning: z.string().nullable()
234
+ }).strict();
235
+ /** Render saved card facts for text-only delivery and accessible fallbacks. */
236
+ function automationCardText(card) {
237
+ return [
238
+ card.title,
239
+ card.warning,
240
+ card.trigger,
241
+ card.instruction,
242
+ card.url,
243
+ `Automation ID: ${card.id}`
244
+ ].filter(Boolean).join("\n");
245
+ }
246
+ // src/chat/conversations/cards.ts
247
+ const storedCardSchema = automationCardSchema.extend({ operation: z.enum([
248
+ "created",
249
+ "updated",
250
+ "deleted"
251
+ ]).optional() });
252
+ /** Render each built-in card with its own text format. */
253
+ function messageCardText(card) {
254
+ switch (card.kind) {
255
+ case "object": return [
256
+ card.title,
257
+ card.label !== card.title ? card.label : void 0,
258
+ card.description,
259
+ card.status,
260
+ ...objectFactFields(card.facts).map((field) => `${field.label}: ${field.value}`),
261
+ card.trigger,
262
+ card.warning,
263
+ card.url
264
+ ].filter(Boolean).join("\n");
265
+ case "automation": return automationCardText(card);
266
+ }
267
+ }
268
+ /** Identify a deleted object whose pending card must be omitted. */
269
+ const removedCardSchema = z.object({
270
+ plugin: z.string().min(1),
271
+ key: z.string().min(1)
272
+ }).strict();
273
+ /** Store only the annotation identity with a Message. */
274
+ const messageCardRefSchema = removedCardSchema.extend({ kind: z.literal("object") });
275
+ /** Remove display facts before saving or reporting a Message card. */
276
+ function messageCardRef(card) {
277
+ return card.kind === "object" ? {
278
+ kind: "object",
279
+ plugin: card.plugin,
280
+ key: card.key
281
+ } : {
282
+ kind: "object",
283
+ plugin: "junior",
284
+ key: card.id
285
+ };
286
+ }
287
+ /** Read references, including identities from older saved card snapshots. */
288
+ function readMessageCardRefs(value) {
289
+ return [...storedCardSchema.array().parse(value.cards ?? []).flatMap(({ operation, ...card }) => operation === "deleted" ? [] : [messageCardRef(card)]), ...messageCardRefSchema.strip().array().parse(value.objectCards ?? [])];
290
+ }
291
+ /** Resolve current saved facts without fetching providers or changing history. */
292
+ function resolveMessageCards(refs, annotations) {
293
+ return refs.map((ref) => {
294
+ const annotation = annotations.find((item) => item.kind === ref.kind && item.plugin === ref.plugin && item.key === ref.key);
295
+ return annotation ? annotationCard(annotation) : {
296
+ ...ref,
297
+ objectType: "item",
298
+ title: ref.key,
299
+ label: ref.key,
300
+ url: null,
301
+ warning: "Saved annotation is unavailable."
302
+ };
303
+ });
304
+ }
305
+ /** Copy saved annotation facts without storage timestamps for Message delivery. */
306
+ function annotationCard(annotation) {
307
+ const { createdAt: _createdAt, updatedAt: _updatedAt, ...value } = annotation;
308
+ return value.kind === "object" ? value : {
309
+ ...value,
310
+ kind: "object",
311
+ objectType: value.objectType ?? "item",
312
+ title: value.label
313
+ };
314
+ }
315
315
  // src/api/schema/child-agent-totals.ts
316
316
  /**
317
317
  * The part of a Conversation total that its child agents spent, at any depth.
@@ -462,6 +462,7 @@ const conversationAnnotationReportSchema = conversationAnnotationInputSchema.and
462
462
  }));
463
463
  const conversationActivityPreviewSchema = z.object({
464
464
  createdAt: z.string().datetime(),
465
+ mentions: z.array(actorIdentitySchema).optional(),
465
466
  role: z.enum(["assistant", "user"]),
466
467
  text: z.string().min(1)
467
468
  }).strict();
@@ -512,6 +513,13 @@ const conversationSummaryReportSchema = z.object({
512
513
  isPriority: z.boolean().optional(),
513
514
  unfinishedWork: z.boolean().optional()
514
515
  }).strict();
516
+ /** One Event listed on a message that holds several Events. */
517
+ const conversationReportMessageEventSchema = z.object({
518
+ eventType: z.string().min(1),
519
+ label: z.string().min(1).optional(),
520
+ objectType: objectTypeSchema.optional(),
521
+ trustedSummary: z.string().min(1).optional()
522
+ }).strict();
515
523
  const conversationReportMessageEventDataSchema = z.object({
516
524
  type: z.literal("message"),
517
525
  messageId: z.string().min(1),
@@ -522,11 +530,12 @@ const conversationReportMessageEventDataSchema = z.object({
522
530
  ]),
523
531
  source: z.enum(["slack", "web"]).optional(),
524
532
  actorIdentity: actorIdentitySchema.optional(),
525
- mentions: z.array(actorIdentitySchema).optional(),
526
533
  eventType: z.string().min(1).optional(),
527
534
  eventObjectType: objectTypeSchema.optional(),
528
535
  explicitMention: z.boolean().optional(),
529
536
  trustedSummary: z.string().min(1).optional(),
537
+ /** Every Event when several arrived together in one message. */
538
+ events: z.array(conversationReportMessageEventSchema).optional(),
530
539
  cards: z.array(messageCardRefSchema).optional(),
531
540
  text: z.string().optional(),
532
541
  attachments: z.array(messageAttachmentSchema).optional(),
@@ -536,9 +545,9 @@ const conversationReportMessageEventDataSchema = z.object({
536
545
  code: "custom",
537
546
  message: "message content must be text or explicitly redacted"
538
547
  });
539
- if (data.redacted && (data.actorIdentity || data.mentions || data.cards || data.attachments)) context.addIssue({
548
+ if (data.redacted && (data.actorIdentity || data.cards || data.attachments || data.events)) context.addIssue({
540
549
  code: "custom",
541
- message: "redacted messages must not expose actor identity, mentions, cards, or attachments"
550
+ message: "redacted messages must not expose actor identity, cards, attachments, or events"
542
551
  });
543
552
  });
544
553
  const conversationReportMessageHandledEventDataSchema = z.object({
@@ -743,6 +752,8 @@ const conversationReportEventSchema = z.object({
743
752
  seq: z.number().int().nonnegative(),
744
753
  createdAt: z.string().datetime(),
745
754
  data: conversationReportEventDataSchema,
755
+ /** People mentioned in the event text, resolved at read time. */
756
+ mentions: z.array(actorIdentitySchema).optional(),
746
757
  model: z.object({
747
758
  modelId: z.string().min(1),
748
759
  modelProfile: z.string().min(1).optional(),
@@ -872,6 +883,8 @@ const conversationDetailReportSchema = conversationSummaryReportSchema.extend({
872
883
  forks: z.array(z.string()).optional(),
873
884
  brief: z.object({
874
885
  content: conversationBriefSchema,
886
+ /** People mentioned in the Brief text, resolved at read time. */
887
+ mentions: z.array(actorIdentitySchema).optional(),
875
888
  updatedAt: z.string().datetime(),
876
889
  version: z.number().int().positive()
877
890
  }).strict().optional(),
@@ -894,64 +907,4 @@ const conversationFeedSchema = z.object({
894
907
  source: z.literal("conversation_index"),
895
908
  generatedAt: z.string()
896
909
  }).strict();
897
- const conversationStatsItemSchema = z.object({
898
- active: z.number(),
899
- conversations: z.number(),
900
- durationMs: z.number(),
901
- failed: z.number(),
902
- label: z.string(),
903
- costUsd: z.number().optional(),
904
- tokens: z.number().optional()
905
- }).strict();
906
- /** UTC day (`YYYY-MM-DD`) or hour (`YYYY-MM-DDTHH`) activity bucket key. */
907
- const conversationMetricBucketSchema = z.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/);
908
- const conversationMetricDaySchema = z.object({
909
- cachedInputTokens: z.number().optional(),
910
- cacheCreationTokens: z.number().optional(),
911
- conversations: z.number(),
912
- costUsd: z.number().optional(),
913
- date: conversationMetricBucketSchema,
914
- durationMs: z.number(),
915
- inputTokens: z.number().optional(),
916
- tokens: z.number().optional()
917
- }).strict();
918
- const guardianMetricDaySchema = z.object({
919
- allow: z.number(),
920
- ask: z.number(),
921
- costUsd: z.number().optional(),
922
- date: conversationMetricBucketSchema,
923
- deny: z.number(),
924
- requests: z.number()
925
- }).strict();
926
- const guardianStatsSchema = z.object({
927
- allow: z.number(),
928
- ask: z.number(),
929
- costUsd: z.number().optional(),
930
- deny: z.number(),
931
- metricDays: z.array(guardianMetricDaySchema),
932
- metricHours: z.array(guardianMetricDaySchema).optional(),
933
- metricSixHours: z.array(guardianMetricDaySchema).optional(),
934
- requests: z.number()
935
- }).strict();
936
- const conversationStatsReportSchema = z.object({
937
- active: z.number(),
938
- cachedInputTokens: z.number().optional(),
939
- cacheCreationTokens: z.number().optional(),
940
- conversations: z.number(),
941
- durationMs: z.number(),
942
- failed: z.number(),
943
- generatedAt: z.string(),
944
- guardian: guardianStatsSchema,
945
- metricDays: z.array(conversationMetricDaySchema),
946
- metricHours: z.array(conversationMetricDaySchema).optional(),
947
- metricSixHours: z.array(conversationMetricDaySchema).optional(),
948
- locations: z.array(conversationStatsItemSchema),
949
- actors: z.array(conversationStatsItemSchema),
950
- source: z.literal("conversation_index"),
951
- costUsd: z.number().optional(),
952
- inputTokens: z.number().optional(),
953
- tokens: z.number().optional(),
954
- windowEnd: z.string(),
955
- windowStart: z.string()
956
- }).strict();
957
- export { forkConversationBodySchema as A, briefLinkSchema as B, conversationReportEventSchema as C, conversationUsageSchema as D, conversationSummaryReportSchema as E, readMessageAttachments as F, messageCardRef as G, conversationBriefSchema as H, INPUT_IMAGE_TYPES as I, removedCardSchema as J, messageCardText as K, detectImageMediaType as L, conversationChildAgentTotalsSchema as M, MAX_INPUT_IMAGES as N, createConversationBodySchema as O, MAX_INPUT_IMAGE_BYTES as P, isVisionImageMediaType as R, conversationReportEventDataSchema as S, conversationStatsReportSchema as T, parseBriefInput as U, briefOutcomeStatusSchema as V, annotationCard as W, resolveMessageCards as Y, conversationParamsSchema as _, cancelConversationPendingMessagesBodySchema as a, conversationPendingMessageSchema as b, conversationAttachmentParamsSchema as c, conversationDetailReportSchema as d, conversationEventHistorySchema as f, conversationFeedSchema as g, conversationFeedQuerySchema as h, archiveConversationResponseSchema as i, forkConversationResponseSchema as j, createConversationMessageBodySchema as k, conversationAuxiliaryCostsSchema as l, conversationEventsQuerySchema as m, actorIdentitySchema as n, cancelConversationPendingMessagesResponseSchema as o, conversationEventPageSchema as p, readMessageCardRefs as q, archiveConversationBodySchema as r, conversationActivityPreviewSchema as s, acceptedConversationMessageSchema as t, conversationDetailQuerySchema as u, conversationPendingAuthorizationSchema as v, conversationStatsItemSchema as w, conversationPendingMessagesReportSchema as x, conversationPendingMessageDeliverySchema as y, briefCodeChangeSchema as z };
910
+ export { forkConversationResponseSchema as A, readMessageAttachments as B, conversationReportEventSchema as C, createConversationBodySchema as D, conversationUsageSchema as E, readMessageCardRefs as F, briefLinkSchema as G, detectImageMediaType as H, removedCardSchema as I, parseBriefInput as J, briefOutcomeStatusSchema as K, resolveMessageCards as L, annotationCard as M, messageCardRef as N, createConversationMessageBodySchema as O, messageCardText as P, MAX_INPUT_IMAGES as R, conversationReportEventDataSchema as S, conversationSummaryReportSchema as T, isVisionImageMediaType as U, INPUT_IMAGE_TYPES as V, briefCodeChangeSchema as W, conversationParamsSchema as _, cancelConversationPendingMessagesBodySchema as a, conversationPendingMessageSchema as b, conversationAttachmentParamsSchema as c, conversationDetailReportSchema as d, conversationEventHistorySchema as f, conversationFeedSchema as g, conversationFeedQuerySchema as h, archiveConversationResponseSchema as i, conversationChildAgentTotalsSchema as j, forkConversationBodySchema as k, conversationAuxiliaryCostsSchema as l, conversationEventsQuerySchema as m, actorIdentitySchema as n, cancelConversationPendingMessagesResponseSchema as o, conversationEventPageSchema as p, conversationBriefSchema as q, archiveConversationBodySchema as r, conversationActivityPreviewSchema as s, acceptedConversationMessageSchema as t, conversationDetailQuerySchema as u, conversationPendingAuthorizationSchema as v, conversationReportMessageEventSchema as w, conversationPendingMessagesReportSchema as x, conversationPendingMessageDeliverySchema as y, MAX_INPUT_IMAGE_BYTES as z };
@@ -1,4 +1,4 @@
1
- import { m as logWarn } from "./logging-DsHONhVm.js";
1
+ import { m as logWarn } from "./logging-DSMmkHXG.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  // src/chat/conversation-privacy.ts
4
4
  const SAFE_METADATA_KEY_LIMIT = 20;
@@ -1,188 +1,25 @@
1
- import { Ft as resolveBaseUrl, Lt as createUserTokenStore, Nt as formatProviderLabel, Pt as parseOAuthStatePayload, _ as resolvePluginOAuthAccount, d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, s as deleteMcpAuthSession, x as lookupSlackUserProfile, xt as getMcpProviderErrorAttributes } from "./agent-runner-DGsFQw72.js";
2
- import { f as escapeXml } from "./client-DbyHuMFU.js";
3
- import { L as isNativeIdentityProvider, f as logException, g as runBestEffort, m as logWarn } from "./logging-DsHONhVm.js";
4
- import { a as getRuntimeMetadata, n as botConfig } from "./config-_WO_AjCB.js";
1
+ import { $n as resolvePluginOAuthAccount, Et as getConversationPendingAuth, Fn as parseOAuthStatePayload, H as recordAuthenticationLinked, In as resolveBaseUrl, Pn as formatProviderLabel, Pt as getTurnRecord, U as recordAuthorizationCompleted, bn as createUserTokenStore, qn as postSlackMessage } from "./tasks-CjrS098O.js";
2
+ import { p as escapeXml } from "./client-JeyzRwsT.js";
3
+ import { L as isNativeIdentityProvider, f as logException, g as runBestEffort, m as logWarn } from "./logging-DSMmkHXG.js";
4
+ import { a as getRuntimeMetadata, n as botConfig } from "./config-ULs6Zl9b.js";
5
5
  import { f as parseSlackUserId } from "./actor-tlxzqaRe.js";
6
- import { F as upsertIdentity, I as upsertLinkedIdentity, b as identityFromActor, f as getSqlExecutor, j as findUserByVerifiedEmails } from "./viewer-CGvvRqKp.js";
6
+ import { F as upsertIdentity, I as upsertLinkedIdentity, b as identityFromActor, f as getSqlExecutor, j as findUserByVerifiedEmails } from "./viewer-C-J0ewlH.js";
7
7
  import { i as homeDir } from "./package-discovery-DJBompdd.js";
8
- import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-Du566MtJ.js";
9
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BN4DVxco.js";
10
- import { t as discoverSkills } from "./skills-DyQBLIrK.js";
11
- import { B as postSlackMessage, Ft as recordAuthenticationLinked, It as recordAuthorizationCompleted, Z as getTurnRecord } from "./tasks-CEXKTASS.js";
12
- import { Ht as getSlackClient } from "./agent-hooks-BJ_5mlRH.js";
13
- import { E as acquireActiveLock, w as getStateAdapter } from "./profile-DpYjfKke.js";
14
- import { i as getConversationPendingAuth } from "./pending-auth-D8J1uJUS.js";
15
- import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-W3f6kAtz.js";
16
- import { c as deleteWebAuthorization, f as wakeAuthorizedTurn, i as readConnectedOAuthTokens, p as wakePausedTurn } from "./connections-ag_1JOhB.js";
8
+ import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-BL-osYWN.js";
9
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Bpcs2b2L.js";
10
+ import { t as discoverSkills } from "./skills-D6_bcAuW.js";
11
+ import { a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, v as lookupSlackUserProfile } from "./agent-runner-DvTUyGTY.js";
12
+ import { ct as getSlackClient } from "./agent-hooks-V4Hfc2tB.js";
13
+ import { a as acquireActiveLock, r as getStateAdapter } from "./adapter-Dj5BTJRd.js";
14
+ import { _ as getMcpProviderErrorAttributes } from "./service-account-Ko1Xs--F.js";
15
+ import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-CqkYowEz.js";
16
+ import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-CZ7HhEmN.js";
17
17
  import { n as relayLocalOAuthCallback } from "./oauth-relay-CTygMkNx.js";
18
18
  import path from "node:path";
19
19
  import { z } from "zod";
20
20
  import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
21
21
  import { pluginStoredTokensSchema } from "@sentry/junior-plugin-api";
22
22
  import fs from "node:fs";
23
- // src/handlers/oauth-html.ts
24
- /** Build pre-escaped callback HTML with the shared response security policy. */
25
- function htmlCallbackResponse(title, message, status, options = {}) {
26
- const footerMessage = options.footerMessage ?? `You can close this tab and return to ${botConfig.userName}.`;
27
- const isSuccess = status >= 200 && status < 300;
28
- const statusClass = isSuccess ? "success" : "error";
29
- const statusIcon = isSuccess ? "" : "!";
30
- const html = `<!DOCTYPE html>
31
- <html lang="en">
32
- <head>
33
- <meta charset="utf-8">
34
- <meta name="viewport" content="width=device-width, initial-scale=1">
35
- <meta name="color-scheme" content="light dark">
36
- <title>${title}</title>
37
- <style>
38
- :root {
39
- color-scheme: light dark;
40
- --canvas: #f4f1fa;
41
- --surface: #ffffff;
42
- --text: #211a2c;
43
- --muted: #6e6479;
44
- --border: #ded7e8;
45
- --accent: #6c5fc7;
46
- --success: #16835c;
47
- --success-soft: #ddf5ea;
48
- --error: #bc3d50;
49
- --error-soft: #fce7eb;
50
- --shadow: 0 24px 64px rgba(45, 31, 63, 0.14);
51
- }
52
-
53
- * { box-sizing: border-box; }
54
-
55
- body {
56
- min-height: 100vh;
57
- margin: 0;
58
- display: grid;
59
- place-items: center;
60
- padding: 24px;
61
- background: var(--canvas);
62
- color: var(--text);
63
- font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
64
- }
65
-
66
- main {
67
- width: min(100%, 480px);
68
- padding: 48px 40px 40px;
69
- text-align: center;
70
- background: var(--surface);
71
- border: 1px solid var(--border);
72
- border-radius: 24px;
73
- box-shadow: var(--shadow);
74
- }
75
-
76
- .brand {
77
- display: inline-flex;
78
- align-items: center;
79
- gap: 8px;
80
- margin-bottom: 32px;
81
- color: var(--muted);
82
- font-size: 14px;
83
- font-weight: 700;
84
- letter-spacing: 0.08em;
85
- text-transform: uppercase;
86
- }
87
-
88
- .brand-mark {
89
- width: 10px;
90
- height: 10px;
91
- background: var(--accent);
92
- border-radius: 3px;
93
- transform: rotate(12deg);
94
- }
95
-
96
- .status {
97
- width: 64px;
98
- height: 64px;
99
- margin: 0 auto 24px;
100
- display: grid;
101
- place-items: center;
102
- border-radius: 20px;
103
- font-size: 32px;
104
- font-weight: 750;
105
- line-height: 1;
106
- }
107
-
108
- .status.success { color: var(--success); background: var(--success-soft); }
109
- .status.success::before {
110
- content: "";
111
- width: 12px;
112
- height: 24px;
113
- margin-top: -5px;
114
- border-right: 4px solid currentColor;
115
- border-bottom: 4px solid currentColor;
116
- transform: rotate(45deg);
117
- }
118
- .status.error { color: var(--error); background: var(--error-soft); }
119
-
120
- h1 {
121
- margin: 0;
122
- font-size: clamp(28px, 7vw, 36px);
123
- line-height: 1.12;
124
- letter-spacing: -0.035em;
125
- }
126
-
127
- .message {
128
- margin: 16px auto 0;
129
- color: var(--muted);
130
- font-size: 17px;
131
- line-height: 1.6;
132
- }
133
-
134
- .footer {
135
- margin: 32px 0 0;
136
- padding-top: 24px;
137
- color: var(--muted);
138
- border-top: 1px solid var(--border);
139
- font-size: 14px;
140
- line-height: 1.5;
141
- }
142
-
143
- @media (prefers-color-scheme: dark) {
144
- :root {
145
- --canvas: #15121a;
146
- --surface: #211c28;
147
- --text: #f6f1fb;
148
- --muted: #b8adbf;
149
- --border: #3a3243;
150
- --accent: #a99af0;
151
- --success: #72d6ad;
152
- --success-soft: #193c30;
153
- --error: #ff9aaa;
154
- --error-soft: #48262e;
155
- --shadow: 0 24px 64px rgba(0, 0, 0, 0.36);
156
- }
157
- }
158
-
159
- @media (max-width: 520px) {
160
- body { padding: 16px; }
161
- main { padding: 40px 24px 32px; border-radius: 20px; }
162
- }
163
- </style>
164
- </head>
165
- <body>
166
- <main>
167
- <div class="brand"><span class="brand-mark" aria-hidden="true"></span>${botConfig.userName}</div>
168
- <div class="status ${statusClass}" aria-hidden="true">${statusIcon}</div>
169
- <h1>${title}</h1>
170
- <p class="message">${message}</p>
171
- <p class="footer">${footerMessage}</p>
172
- </main>
173
- </body>
174
- </html>`;
175
- return new Response(html, {
176
- status,
177
- headers: {
178
- "Cache-Control": "no-store",
179
- "Content-Security-Policy": "default-src 'none'; style-src 'unsafe-inline'; frame-ancestors 'none'; base-uri 'none'; form-action 'none'",
180
- "Content-Type": "text/html; charset=utf-8",
181
- "Referrer-Policy": "no-referrer",
182
- "X-Content-Type-Options": "nosniff"
183
- }
184
- });
185
- }
186
23
  // src/handlers/mcp-oauth-callback.ts
187
24
  /**
188
25
  * MCP OAuth callback handler.
@@ -1,6 +1,6 @@
1
- import { f as logException } from "./logging-DsHONhVm.js";
1
+ import { f as logException } from "./logging-DSMmkHXG.js";
2
2
  import { g as startSpanManual } from "./sentry-BBUlHih9.js";
3
- import "./config-_WO_AjCB.js";
3
+ import "./config-ULs6Zl9b.js";
4
4
  import { a as juniorAgentInvocations, c as juniorIdentities, d as juniorDestinations, f as timestamptz, i as juniorAgentBindings, l as juniorUsers, s as juniorConversations } from "./agent-invocations-Qfz7dWgU.js";
5
5
  import { AsyncLocalStorage } from "node:async_hooks";
6
6
  import { sql } from "drizzle-orm";
@@ -386,6 +386,7 @@ const juniorWorkspaces = pgTable("junior_workspaces", {
386
386
  id: text("id").primaryKey(),
387
387
  name: text("name").notNull(),
388
388
  setupScript: text("setup_script").notNull().default(""),
389
+ vcpus: integer("vcpus"),
389
390
  createdAt: timestamptz("created_at").notNull(),
390
391
  updatedAt: timestamptz("updated_at").notNull()
391
392
  }, (table) => [uniqueIndex("junior_workspaces_name_idx").on(table.name)]);
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { D as storeAttachment, T as readLiveAttachment } from "./agent-runner-DGsFQw72.js";
3
- import { f as getSqlExecutor } from "./viewer-CGvvRqKp.js";
4
- import { L as detectImageMediaType } from "./conversation-DjN3mlog.js";
2
+ import { f as getSqlExecutor } from "./viewer-C-J0ewlH.js";
3
+ import { S as readLiveAttachment, w as storeAttachment } from "./agent-runner-DvTUyGTY.js";
4
+ import { H as detectImageMediaType } from "./conversation-CvuKJ3tA.js";
5
5
  // src/chat/attachments/images.ts
6
6
  var images_exports = /* @__PURE__ */ __exportAll({
7
7
  decodeInputImages: () => decodeInputImages,
@@ -1,6 +1,6 @@
1
- import { F as getDeploymentTelemetryAttributes, P as getDeploymentServiceVersion } from "./logging-DsHONhVm.js";
1
+ import { F as getDeploymentTelemetryAttributes, P as getDeploymentServiceVersion } from "./logging-DSMmkHXG.js";
2
2
  import { _ as vercelAIIntegration, a as getClient, b as withStreamedSpan, c as init, o as getGlobalScope } from "./sentry-BBUlHih9.js";
3
- import { n as getCurrentConversationPrivacy } from "./conversation-privacy-DHP_xnVj.js";
3
+ import { n as getCurrentConversationPrivacy } from "./conversation-privacy-BQSlZXgV.js";
4
4
  import { t as consumePrivateTraceResultMarker } from "./private-trace-result-CE7_lEdq.js";
5
5
  // src/chat/sentry-payload-filter.ts
6
6
  const PAYLOAD_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
@@ -1,4 +1,4 @@
1
- import { i as getChatConfig } from "./config-_WO_AjCB.js";
1
+ import { i as getChatConfig } from "./config-ULs6Zl9b.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  import { z } from "zod";
4
4
  import { createHash, createHmac, timingSafeEqual } from "node:crypto";
@@ -1,5 +1,5 @@
1
1
  import { d as setTag, f as setUser, h as startSpan, i as getActiveSpan, l as logger, n as captureMessage, p as spanToJSON, s as getTraceData, t as captureException, y as withScope } from "./sentry-BBUlHih9.js";
2
- import { t as JUNIOR_VERSION } from "./version-C0U6rHg0.js";
2
+ import { t as JUNIOR_VERSION } from "./version-Ct049vav.js";
3
3
  import path from "node:path";
4
4
  import { styleText } from "node:util";
5
5
  import { ConfigError, configureSync, getConfig, getLogger } from "@logtape/logtape";
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { Ht as toolInvocationDestination, Q as getActiveAgentInvocationForConversation, Vt as actorFromRun, Y as createAgentInvocationForMessage, Z as findChildAgentConversationId, _t as AgentMessageTargetError, vt as PARENT_AGENT_TARGET } from "./agent-runner-DGsFQw72.js";
3
- import { n as enqueueAgentMessageToParent } from "./result-BBbKA61B.js";
4
- import { r as enqueueAgentInvocation } from "./work-DRcsJ3hV.js";
2
+ import { Ct as actorFromRun, J as findChildAgentConversationId, K as createAgentInvocationForMessage, Y as getActiveAgentInvocationForConversation, ht as PARENT_AGENT_TARGET, mt as AgentMessageTargetError, wt as toolInvocationDestination } from "./agent-runner-DvTUyGTY.js";
3
+ import { n as enqueueAgentMessageToParent } from "./result-DS7V4a3-.js";
4
+ import { r as enqueueAgentInvocation } from "./work-D829Ue7k.js";
5
5
  // src/chat/agent-invocations/message.ts
6
6
  var message_exports = /* @__PURE__ */ __exportAll({ bindMessageAgent: () => bindMessageAgent });
7
7
  /**
package/dist/nitro.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { r as JuniorDashboardOptions } from "./app-PX2H1PxU.js";
2
- import { n as JuniorPluginSet } from "./plugins-B11Mfkmv.js";
1
+ import { r as JuniorDashboardOptions } from "./app-BsBUs3rF.js";
2
+ import { n as JuniorPluginSet } from "./plugins-B_0Cr0MO.js";
3
3
  export type JuniorNitroDashboardOptions = JuniorDashboardOptions;
4
4
  export interface JuniorPluginModuleReference {
5
5
  /** Runtime-safe module that exports a `defineJuniorPlugins(...)` set. */
package/dist/nitro.js CHANGED
@@ -1,8 +1,8 @@
1
- import { A as JUNIOR_RETENTION_CRON_SCHEDULE, D as JUNIOR_HEARTBEAT_CRON_SCHEDULE, E as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, M as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, O as JUNIOR_HEARTBEAT_ROUTE, j as JUNIOR_RETENTION_ROUTE, k as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE } from "./logging-DsHONhVm.js";
1
+ import { A as JUNIOR_RETENTION_CRON_SCHEDULE, D as JUNIOR_HEARTBEAT_CRON_SCHEDULE, E as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, M as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, O as JUNIOR_HEARTBEAT_ROUTE, j as JUNIOR_RETENTION_ROUTE, k as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE } from "./logging-DSMmkHXG.js";
2
2
  import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-DJBompdd.js";
3
- import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-DVe37it2.js";
3
+ import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-CbdVyaCo.js";
4
4
  import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-DOm9Y6qI.js";
5
- import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-BzW4MaWU.js";
5
+ import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-9LICOzcL.js";
6
6
  import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-Cf5gVPWP.js";
7
7
  import path from "node:path";
8
8
  import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
@@ -1,5 +1,5 @@
1
- import { Lt as createUserTokenStore } from "./agent-runner-DGsFQw72.js";
2
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-B-CPX_ag.js";
1
+ import { bn as createUserTokenStore } from "./tasks-CjrS098O.js";
2
+ import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-BKcv5rBe.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,4 +1,4 @@
1
- import { PluginMcpConfig, PluginRegistration, PluginRuntimePostinstallCommand } from "@sentry/junior-plugin-api";
1
+ import { PluginMcpConfig, PluginRegistration, PluginRuntimePostinstallCommand, PluginServiceAccountConfig } from "@sentry/junior-plugin-api";
2
2
  interface PluginOAuthConfig {
3
3
  clientIdEnv: string;
4
4
  clientSecretEnv: string;
@@ -68,6 +68,10 @@ interface PluginManifestConfig {
68
68
  wrappedTools?: string[] | null;
69
69
  } | null;
70
70
  oauth?: PluginOAuthConfigPatch | null;
71
+ accounts?: {
72
+ userOAuth?: boolean | null;
73
+ serviceAccount?: PluginServiceAccountConfig | null;
74
+ } | null;
71
75
  target?: {
72
76
  type?: string;
73
77
  configKey?: string;