@sentry/junior 0.302.0 → 0.303.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 (93) hide show
  1. package/dist/{adapter-context-Cx9fn9B3.js → adapter-context-BdVnSuY5.js} +2 -2
  2. package/dist/{admin-_poE5NKL.js → admin-AfeAdS3J.js} +2 -2
  3. package/dist/{agent-runner-CY9RvsTX.js → agent-runner-BP8_DLUv.js} +2987 -2948
  4. package/dist/api/schema.d.ts +2 -2
  5. package/dist/api/schema.js +6 -6
  6. package/dist/api.d.ts +13 -12
  7. package/dist/api.js +207 -80
  8. package/dist/{app-BpY3wtRP.d.ts → app-Dd9v1mNx.d.ts} +15 -15
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +63 -64
  11. package/dist/{automation-Cva5ZOwW.js → automation-D9MvhOWY.js} +3 -1
  12. package/dist/{background-compaction-queue-CXFq1_Cz.js → background-compaction-queue-xaE05jxH.js} +6 -6
  13. package/dist/{briefs-B3NG-pid.js → briefs-D8i-dKTp.js} +4 -4
  14. package/dist/{catalog-runtime-Dss0lSV6.js → catalog-runtime-d1EM6Z0V.js} +2 -2
  15. package/dist/cli/chat.d.ts +1 -1
  16. package/dist/cli/chat.js +21 -21
  17. package/dist/cli/check.js +8 -8
  18. package/dist/cli/env.d.ts +1 -0
  19. package/dist/cli/env.js +8 -7
  20. package/dist/cli/init.js +13 -4
  21. package/dist/cli/main.js +4 -4
  22. package/dist/cli/plugins.js +6 -6
  23. package/dist/cli/snapshot-create.js +7 -5
  24. package/dist/cli/upgrade.d.ts +2 -2
  25. package/dist/cli/upgrade.js +5 -5
  26. package/dist/{config-CzeZiMKs.js → config-oGM7KA9M.js} +44 -63
  27. package/dist/{connections-CDYhMfrs.js → connections-BlikzEJv.js} +6 -6
  28. package/dist/{continue-in-slack-7Uf05ndC.js → continue-in-slack-BZnYifiG.js} +5 -5
  29. package/dist/{conversation-BNXfq6Lb.js → conversation-CY1jnBiC.js} +1 -1
  30. package/dist/{conversation-feed-Clf_cv0n.js → conversation-feed-BZJRk6UV.js} +1 -1
  31. package/dist/{conversation-privacy-D9xnM5mK.js → conversation-privacy-Cx515ddM.js} +7 -7
  32. package/dist/{conversation-turn-D7SEZgTG.js → conversation-turn-DAhRdX4m.js} +20 -23
  33. package/dist/{credential-sync-DoD0gW-j.js → credential-sync-DfhmWFeo.js} +18 -18
  34. package/dist/{db-B-gtnNjr.js → db-C-2tFxk3.js} +15 -15
  35. package/dist/{db-BdsCzytP.d.ts → db-DPqcEM9_.d.ts} +25 -25
  36. package/dist/{executor-DZg20EqU.js → executor-NVfS8aQ2.js} +14 -8
  37. package/dist/{history-IjdmO_r6.js → history-UZ3M2M9r.js} +13 -10
  38. package/dist/{install-t1KQyTUs.js → install-CHLrpRZc.js} +3 -3
  39. package/dist/instrumentation.d.ts +4 -4
  40. package/dist/instrumentation.js +10 -10
  41. package/dist/{lineage-C79GjoQr.js → lineage-HGLhd_-N.js} +2 -2
  42. package/dist/{logging-C9oDAg4M.js → logging-DiyqRLBx.js} +19 -19
  43. package/dist/{message-BLUCzJXN.js → message-CkCOcbFH.js} +9 -9
  44. package/dist/{model-input-5jwNC45G.js → model-input-DmoPPtPE.js} +4 -9
  45. package/dist/nitro.d.ts +1 -1
  46. package/dist/nitro.js +7 -7
  47. package/dist/{oauth-callback-server-BBl66vCb.js → oauth-callback-server-CIf_6YmA.js} +5 -4
  48. package/dist/{oauth-relay-DRzq73b6.js → oauth-relay-DAmfVmJu.js} +3 -6
  49. package/dist/{package-discovery-DJhGdS4c.js → package-discovery-x4AvVhMj.js} +1 -1
  50. package/dist/{plugin-module-Cf5gVPWP.js → plugin-module-Cv2ETe8Y.js} +1 -1
  51. package/dist/{plugins-BBX07Jzt.js → plugins-Bkk0XRo2.js} +3 -3
  52. package/dist/{projection-CIBwgD3s.js → projection-DBq8tsA5.js} +221 -173
  53. package/dist/{prompt-CRQbzp5e.js → prompt-D2KlJopL.js} +4 -4
  54. package/dist/{queue-CZyYgPF0.d.ts → queue-CbEHUO0l.d.ts} +1 -1
  55. package/dist/{queue-DtCDaIct.js → queue-DFaOscp5.js} +4 -4
  56. package/dist/{registry-DdFQHZ_d.js → registry-Bu0Z9BEO.js} +37 -37
  57. package/dist/{resolve-CdW4BdrK.js → resolve-DXuA3G0g.js} +3 -3
  58. package/dist/{result-oOMv1t4O.js → result-DpiNseDA.js} +10 -15
  59. package/dist/rolldown-runtime-BKpuH2hG.js +26 -0
  60. package/dist/{runner-DqitLtm-.js → runner-iu1heRFv.js} +10 -10
  61. package/dist/{sandbox-egress-signals-Bw9I0yfJ.js → sandbox-egress-signals-2HFYDcQf.js} +1 -1
  62. package/dist/{schema-BIFM-U1a.d.ts → schema-DHMOaRzC.d.ts} +520 -13
  63. package/dist/{schema-DnVQepWP.js → schema-DvfX3Gq_.js} +77 -13
  64. package/dist/{secrets-DebYU866.js → secrets-DHaJ5TTn.js} +4 -4
  65. package/dist/{sentry-BRTJqumy.js → sentry-CPbZjomA.js} +3 -28
  66. package/dist/{sentry-route-name-BhwWnfqj.js → sentry-route-name-C6EIzAGP.js} +1 -1
  67. package/dist/{service-account-CrZftRTb.js → service-account-BcT5LR7V.js} +47 -47
  68. package/dist/{service-account-B6mKAPVo.js → service-account-xYkaQTrw.js} +3 -3
  69. package/dist/{session-stop-DW63Z3kj.js → session-stop-BLLp1IP_.js} +28 -35
  70. package/dist/{skills-C16fz60Z.js → skills-CNAGH4ju.js} +6 -9
  71. package/dist/{slack-conversation-unfurl-BHhefEb7.js → slack-conversation-unfurl-DYnqe5ci.js} +10 -15
  72. package/dist/{spawn-D_RnFYfy.js → spawn-cGasWW33.js} +7 -7
  73. package/dist/{legacy-web-actor-id-C-cEeWqL.js → state-CDS6h_Wv.js} +32 -32
  74. package/dist/{stop-7p1i08CY.js → stop-DMMA67yT.js} +221 -139
  75. package/dist/{store-C28I0CVW.js → store-Dgs7Oe44.js} +5 -5
  76. package/dist/{task-queue-BVUJbQ28.js → task-queue-DcF0nhhz.js} +3 -3
  77. package/dist/{task-runner-CWi8j7Z6.js → task-runner-BGXF7Fo7.js} +15 -18
  78. package/dist/{thread-context-D3-yYUd0.js → thread-context-BPky1KBe.js} +12 -12
  79. package/dist/{turn-session-routing-BFMS9ATF.js → turn-session-routing-DGvn9MSl.js} +32 -32
  80. package/dist/{turn-user-message-C3-O8Omt.js → turn-user-message-19CkuUvM.js} +3 -3
  81. package/dist/{validation-BSFKUIb4.js → validation-lu1DgjNQ.js} +2 -2
  82. package/dist/vercel.js +1 -1
  83. package/dist/{version-BHHXNi-0.js → version-Uo3c94Dx.js} +1 -1
  84. package/dist/version.js +1 -1
  85. package/dist/{viewer-B1SO21Qa.js → viewer-BPQHMx3-.js} +3 -3
  86. package/dist/{warmup-Bz9bzkzN.js → warmup-H8uLvW9e.js} +149 -130
  87. package/dist/{worker-BspReIIK.js → worker-B-pM_-3K.js} +9 -12
  88. package/migrations/0109_user_preferences.sql +1 -0
  89. package/migrations/0110_code_change_repository_state_index.sql +1 -0
  90. package/migrations/meta/0109_snapshot.json +4925 -0
  91. package/migrations/meta/0110_snapshot.json +4952 -0
  92. package/migrations/meta/_journal.json +15 -1
  93. package/package.json +16 -19
@@ -1,11 +1,11 @@
1
- import { r as notificationScheduleSchema } from "./schedule-cP0AACm1.js";
2
- import { D as idempotencyKeySchema, O as conversationChildAgentTotalsSchema, S as conversationUsageSchema, b as conversationSummaryReportSchema, c as conversationAuxiliaryCostsSchema, i as actorIdentitySchema, q as inputFileSchema } from "./conversation-BNXfq6Lb.js";
3
- import "./automation-Cva5ZOwW.js";
4
1
  import { M as sumUtcHoursIntoSixHours, O as fillUtcDays, d as userInputRequestSchema, i as AGENT_INVOCATION_STATUSES, k as fillUtcHours } from "./web-message-id-lNodcCOI.js";
5
- import "./conversation-feed-Clf_cv0n.js";
2
+ import { D as idempotencyKeySchema, O as conversationChildAgentTotalsSchema, S as conversationUsageSchema, b as conversationSummaryReportSchema, c as conversationAuxiliaryCostsSchema, i as actorIdentitySchema, q as inputFileSchema } from "./conversation-CY1jnBiC.js";
3
+ import "./conversation-feed-BZJRk6UV.js";
6
4
  import { t as isPushServiceEndpoint } from "./push-endpoint-CO-nomUd.js";
5
+ import { r as notificationScheduleSchema } from "./schedule-cP0AACm1.js";
6
+ import "./automation-D9MvhOWY.js";
7
7
  import * as z from "zod";
8
- import { codeChangeStateSchema, eventMatchSchema, ownedObjectAnnotationSchema } from "@sentry/junior-plugin-api";
8
+ import { codeChangeStateSchema, eventMatchSchema, objectTypeSchema, ownedObjectAnnotationSchema } from "@sentry/junior-plugin-api";
9
9
  // src/api/schema/conversation-attachment-upload.ts
10
10
  /**
11
11
  * Ask to upload one file for a Message. `conversationId` names an existing
@@ -306,12 +306,16 @@ const codeChangeSummarySchema = z.object({
306
306
  closed: z.number().int().nonnegative(),
307
307
  costUsd: z.number().nonnegative().optional(),
308
308
  created: z.number().int().nonnegative(),
309
+ /** Open changes with no activity for more than {@link IDLE_CHANGE_DAYS} days. */
310
+ idle: z.number().int().nonnegative(),
309
311
  medianCostUsd: z.number().nonnegative().optional(),
310
312
  medianMergeTimeMs: z.number().nonnegative().optional(),
311
313
  merged: z.number().int().nonnegative(),
312
314
  mergeRate: z.number().min(0).max(1).optional(),
313
315
  open: z.number().int().nonnegative()
314
316
  }).strict();
317
+ /** Whole days without activity after which an open change counts as idle. */
318
+ const IDLE_CHANGE_DAYS = 7;
315
319
  /** UTC day (`YYYY-MM-DD`) or hour (`YYYY-MM-DDTHH`) activity bucket key. */
316
320
  const codeMetricBucketSchema = z.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/);
317
321
  const codeActivityDaySchema = z.object({
@@ -363,11 +367,19 @@ const codeOverviewReportSchema = z.object({
363
367
  windowStart: z.string()
364
368
  }).strict();
365
369
  const codeRepositoryParamsSchema = z.object({ repositoryId: z.string().uuid() }).strict();
370
+ /** Optional change state that limits the listed repository changes. */
371
+ const codeRepositoryQuerySchema = z.object({ state: codeChangeStateSchema.optional() }).strict();
366
372
  /** Code activity, recent changes, and Workspaces for one repository. */
367
373
  const codeRepositoryReportSchema = z.object({
368
374
  activityDays: z.array(codeActivityDaySchema),
369
375
  activityHours: z.array(codeActivityDaySchema).optional(),
370
376
  activitySixHours: z.array(codeActivityDaySchema).optional(),
377
+ /** Every code change in the repository by state, past the listed ones. */
378
+ changeCounts: z.object({
379
+ closed: z.number().int().nonnegative(),
380
+ merged: z.number().int().nonnegative(),
381
+ open: z.number().int().nonnegative()
382
+ }).strict(),
371
383
  changes: z.array(codeChangeSummaryReportSchema),
372
384
  generatedAt: z.string(),
373
385
  repository: z.object({
@@ -391,10 +403,16 @@ const codePersonReportSchema = z.object({
391
403
  activitySixHours: z.array(codeActivityDaySchema).optional(),
392
404
  changes: z.array(codeChangeSummaryReportSchema),
393
405
  generatedAt: z.string(),
406
+ /** Set when `changes` is a full page: pass it as `cursor` for the next. */
407
+ nextCursor: z.string().optional(),
394
408
  summary: codeChangeSummarySchema,
395
409
  windowEnd: z.string(),
396
410
  windowStart: z.string()
397
411
  }).strict();
412
+ /** Query for one page of a person's code changes. */
413
+ const personCodeQuerySchema = z.object({
414
+ /** `nextCursor` from the previous page. */
415
+ cursor: z.string().min(1).max(500).optional() }).strict();
398
416
  // src/api/schema/connection.ts
399
417
  const connectionSchema = z.object({
400
418
  provider: z.string(),
@@ -775,6 +793,11 @@ const reviewItemSchema = z.object({
775
793
  ]),
776
794
  subject: z.object({
777
795
  id: z.string().min(1),
796
+ /**
797
+ * The object type of the link type that claims `url`, such as
798
+ * `code_change` for a pull request. Unset when none claims it.
799
+ */
800
+ objectType: objectTypeSchema.optional(),
778
801
  title: z.string().min(1).optional(),
779
802
  url: z.string().min(1).optional()
780
803
  }).strict().optional(),
@@ -785,7 +808,8 @@ const reviewItemSchema = z.object({
785
808
  /**
786
809
  * Review desk list filters. The list has the open items that the viewer can
787
810
  * see, one page at a time. A search or `include=archived` also finds done and
788
- * dismissed items, after the open ones.
811
+ * dismissed items, after the open ones. `status` lists closed items instead,
812
+ * with the same visibility.
789
813
  */
790
814
  const reviewItemListQuerySchema = z.object({
791
815
  conversationId: z.string().min(1).optional(),
@@ -800,7 +824,22 @@ const reviewItemListQuerySchema = z.object({
800
824
  limit: z.coerce.number().int().min(1).max(100).default(50),
801
825
  /** Also list the newest done and dismissed items, with the first page. */
802
826
  include: z.enum(["archived"]).optional(),
803
- q: z.string().trim().max(200).optional()
827
+ q: z.string().trim().max(200).optional(),
828
+ /**
829
+ * `waiting` lists the open items that wait on the viewer first, then the
830
+ * rest, newest first within each group. By default open items page
831
+ * oldest first. A closed list ignores it.
832
+ */
833
+ sort: z.enum(["waiting"]).optional(),
834
+ /**
835
+ * `open` (the default), or closed statuses, comma separated, such as
836
+ * `done,dismissed`. Closed items page newest closed first.
837
+ */
838
+ status: z.string().default("open").transform((value) => [...new Set(value.split(","))]).pipe(z.array(z.enum([
839
+ "open",
840
+ "done",
841
+ "dismissed"
842
+ ])).refine((statuses) => !statuses.includes("open") || statuses.length === 1, "List open items on their own."))
804
843
  }).strict();
805
844
  /**
806
845
  * One page of the review desk list. Open items come first, oldest first.
@@ -814,13 +853,38 @@ const reviewItemListSchema = z.object({
814
853
  /** Set when more open items follow. Pass it as `cursor` to read them. */
815
854
  nextCursor: z.string().min(1).optional()
816
855
  }).strict();
817
- /** The count of Review items for the nav. */
818
- const reviewItemCountSchema = z.object({
856
+ /** `GET /api/review-items/count` query. */
857
+ const reviewItemCountQuerySchema = z.object({
858
+ /** `automations` also counts the viewer's Automations that need attention. */
859
+ include: z.enum(["automations"]).optional(),
860
+ /**
861
+ * The newest item of each snoozed Inbox row, comma separated. Snoozes
862
+ * live in the browser, so the server counts only the ids it is given.
863
+ */
864
+ snoozed: z.string().default("").transform((value) => [...new Set(value.split(",").filter(Boolean))]).pipe(z.array(z.string().min(1).max(200)).max(100))
865
+ }).strict();
819
866
  /**
820
- * Open action items assigned to the viewer as a User
821
- * (`reviewItemNeedsUser`). Notices and items for Everyone do not count.
867
+ * The counts behind the Inbox badge, which shows the sum of `needsViewer`
868
+ * and `automations`, and behind the Inbox entries.
822
869
  */
823
- needsViewer: z.number().int().nonnegative() }).strict();
870
+ const reviewItemCountSchema = z.object({
871
+ /**
872
+ * The viewer's own Automations that need attention, as the Inbox lists
873
+ * them (`scope=attention&owner=me`). Only with `include=automations`.
874
+ */
875
+ automations: z.number().int().nonnegative().optional(),
876
+ /** The `needsViewer` items whose subject is a code change. */
877
+ codeChanges: z.number().int().nonnegative(),
878
+ /** The `needsViewer` items that ask with a form. */
879
+ decisions: z.number().int().nonnegative(),
880
+ /**
881
+ * Open action items assigned to the viewer as a User
882
+ * (`reviewItemNeedsUser`). Notices and items for Everyone do not count.
883
+ */
884
+ needsViewer: z.number().int().nonnegative(),
885
+ /** The `snoozed` ids that are open and listed for the viewer. */
886
+ snoozed: z.number().int().nonnegative()
887
+ }).strict();
824
888
  /**
825
889
  * Conversations linked to an open action item assigned to the viewer. `title`
826
890
  * is the newest such item; `count` is how many there are; `waitingSince` is
@@ -933,4 +997,4 @@ const versionsSchema = z.object({
933
997
  /** The viewer's rolling model spend. */
934
998
  spend: z.string().min(1)
935
999
  }).strict();
936
- export { connectionListSchema as $, createPersonalTokenBodySchema as A, conversationAutoArchiveSchema as At, personalSpendReportSchema as B, conversationCatchUpSchema as Bt, cacheWarmingSavingsReportSchema as C, stopConversationTurnResponseSchema as Ct, serviceAccountParamsSchema as D, archiveConversationBodySchema as Dt, serviceAccountListSchema as E, conversationOutlineSchema as Et, revokePersonalTokenResponseSchema as F, pinConversationBodySchema as Ft, activityDays as G, locationDetailReportSchema as H, attachmentUploadSchema as Ht, actorDirectoryReportSchema as I, pinConversationResponseSchema as It, dailyConversationActivitySchema as J, activityHours as K, actorProfileReportSchema as L, reorderPinnedConversationsBodySchema as Lt, personalTokenListSchema as M, conversationSubscriptionResponseSchema as Mt, personalTokenMetadataSchema as N, conversationDeliveryBodySchema as Nt, serviceAccountSchema as O, archiveConversationResponseSchema as Ot, personalTokenParamsSchema as P, conversationDeliveryResponseSchema as Pt, testNotificationResponseSchema as Q, avatarParamsSchema as R, reorderPinnedConversationsResponseSchema as Rt, cacheWarmingSavingsRefillResponseSchema as S, objectLinksReportSchema as St, disconnectServiceAccountResponseSchema as T, CONVERSATION_OUTLINE_TEXT_LENGTH as Tt, locationDirectoryReportSchema as U, createAttachmentUploadBodySchema as Ut, locationActivityDayReportSchema as V, attachmentUploadParamsSchema as Vt, locationParamsSchema as W, pushSubscriptionBodySchema as X, notificationSettingsSchema as Y, pushSubscriptionDeleteBodySchema as Z, reviewItemSchema as _, continueConversationInSlackResponseSchema as _t, baselineSnapshotSchema as a, codeChangeSummaryReportSchema as at, cacheWarmingBreakerParamsSchema as b, attachObjectLinkResponseSchema as bt, workspaceListSchema as c, codePersonReportSchema as ct, workspaceSchema as d, codeRepositorySummarySchema as dt, connectionParamsSchema as et, reviewItemActionSchema as f, conversationWatchSchema as ft, reviewItemParamsSchema as g, continueConversationInSlackBodySchema as gt, reviewItemListSchema as h, conversationChildAgentsReportSchema as ht, statsReportSchema as i, codeActivityDaySchema as it, createdPersonalTokenSchema as j, conversationSubscriptionBodySchema as jt, startServiceAccountSignInResponseSchema as k, archiveDoneConversationsResponseSchema as kt, workspaceParamsSchema as l, codeRepositoryParamsSchema as lt, reviewItemListQuerySchema as m, conversationChildAgentSchema as mt, versionsSchema as n, disconnectConnectionResponseSchema as nt, deleteWorkspaceResponseSchema as o, codeChangeSummarySchema as ot, reviewItemCountSchema as p, conversationWatchesReportSchema as pt, activitySixHours as q, statSchema as r, startConnectionResponseSchema as rt, workspaceBodySchema as s, codeOverviewReportSchema as st, versionsQuerySchema as t, connectionSchema as tt, workspaceRepoSchema as u, codeRepositoryReportSchema as ut, reviewItemWaitingConversationsSchema as v, MAX_OBJECT_LINKS as vt, closeCacheWarmingBreakerResponseSchema as w, conversationStatsReportSchema as wt, cacheWarmingSavingsQuerySchema as x, objectLinksQuerySchema as xt, cacheWarmingBreakerListSchema as y, attachObjectLinkBodySchema as yt, personParamsSchema as z, conversationCatchUpBodySchema as zt };
1000
+ export { testNotificationResponseSchema as $, startServiceAccountSignInResponseSchema as A, conversationOutlineSchema as At, personParamsSchema as B, pinConversationResponseSchema as Bt, cacheWarmingSavingsRefillResponseSchema as C, attachObjectLinkBodySchema as Ct, serviceAccountListSchema as D, stopConversationTurnResponseSchema as Dt, disconnectServiceAccountResponseSchema as E, objectLinksReportSchema as Et, personalTokenParamsSchema as F, conversationSubscriptionBodySchema as Ft, locationParamsSchema as G, attachmentUploadParamsSchema as Gt, locationActivityDayReportSchema as H, reorderPinnedConversationsResponseSchema as Ht, revokePersonalTokenResponseSchema as I, conversationSubscriptionResponseSchema as It, activitySixHours as J, activityDays as K, attachmentUploadSchema as Kt, actorDirectoryReportSchema as L, conversationDeliveryBodySchema as Lt, createdPersonalTokenSchema as M, archiveConversationResponseSchema as Mt, personalTokenListSchema as N, archiveDoneConversationsResponseSchema as Nt, serviceAccountParamsSchema as O, conversationStatsReportSchema as Ot, personalTokenMetadataSchema as P, conversationAutoArchiveSchema as Pt, pushSubscriptionDeleteBodySchema as Q, actorProfileReportSchema as R, conversationDeliveryResponseSchema as Rt, cacheWarmingSavingsQuerySchema as S, MAX_OBJECT_LINKS as St, closeCacheWarmingBreakerResponseSchema as T, objectLinksQuerySchema as Tt, locationDetailReportSchema as U, conversationCatchUpBodySchema as Ut, personalSpendReportSchema as V, reorderPinnedConversationsBodySchema as Vt, locationDirectoryReportSchema as W, conversationCatchUpSchema as Wt, notificationSettingsSchema as X, dailyConversationActivitySchema as Y, pushSubscriptionBodySchema as Z, reviewItemParamsSchema as _, conversationWatchesReportSchema as _t, baselineSnapshotSchema as a, IDLE_CHANGE_DAYS as at, cacheWarmingBreakerListSchema as b, continueConversationInSlackBodySchema as bt, workspaceListSchema as c, codeChangeSummarySchema as ct, workspaceSchema as d, codeRepositoryParamsSchema as dt, connectionListSchema as et, reviewItemActionSchema as f, codeRepositoryQuerySchema as ft, reviewItemListSchema as g, conversationWatchSchema as gt, reviewItemListQuerySchema as h, personCodeQuerySchema as ht, statsReportSchema as i, startConnectionResponseSchema as it, createPersonalTokenBodySchema as j, archiveConversationBodySchema as jt, serviceAccountSchema as k, CONVERSATION_OUTLINE_TEXT_LENGTH as kt, workspaceParamsSchema as l, codeOverviewReportSchema as lt, reviewItemCountSchema as m, codeRepositorySummarySchema as mt, versionsSchema as n, connectionSchema as nt, deleteWorkspaceResponseSchema as o, codeActivityDaySchema as ot, reviewItemCountQuerySchema as p, codeRepositoryReportSchema as pt, activityHours as q, createAttachmentUploadBodySchema as qt, statSchema as r, disconnectConnectionResponseSchema as rt, workspaceBodySchema as s, codeChangeSummaryReportSchema as st, versionsQuerySchema as t, connectionParamsSchema as tt, workspaceRepoSchema as u, codePersonReportSchema as ut, reviewItemSchema as v, conversationChildAgentSchema as vt, cacheWarmingSavingsReportSchema as w, attachObjectLinkResponseSchema as wt, cacheWarmingBreakerParamsSchema as x, continueConversationInSlackResponseSchema as xt, reviewItemWaitingConversationsSchema as y, conversationChildAgentsReportSchema as yt, avatarParamsSchema as z, pinConversationBodySchema as zt };
@@ -1,18 +1,18 @@
1
1
  // src/chat/secrets.ts
2
2
  /** Read the server secret that signs internal tokens and payloads. */
3
3
  function readJuniorSecret() {
4
- return process.env.JUNIOR_SECRET?.trim() || void 0;
4
+ return process.env["JUNIOR_SECRET"]?.trim() || void 0;
5
5
  }
6
6
  /** Read the raw dashboard session secret, with `JUNIOR_SECRET` as fallback. */
7
7
  function readSignInSecret() {
8
- return process.env.BETTER_AUTH_SECRET ?? process.env.JUNIOR_SECRET;
8
+ return process.env["BETTER_AUTH_SECRET"] ?? process.env["JUNIOR_SECRET"];
9
9
  }
10
10
  /** Read the bearer secret that internal cron requests must send. */
11
11
  function readSchedulerSecret() {
12
- return process.env.JUNIOR_SCHEDULER_SECRET?.trim() || process.env.CRON_SECRET?.trim();
12
+ return process.env["JUNIOR_SCHEDULER_SECRET"]?.trim() || process.env["CRON_SECRET"]?.trim();
13
13
  }
14
14
  /** Read the VAPID private key that signs web push messages. */
15
15
  function readWebPushPrivateKey() {
16
- return process.env.JUNIOR_WEB_PUSH_PRIVATE_KEY?.trim();
16
+ return process.env["JUNIOR_WEB_PUSH_PRIVATE_KEY"]?.trim();
17
17
  }
18
18
  export { readWebPushPrivateKey as i, readSchedulerSecret as n, readSignInSecret as r, readJuniorSecret as t };
@@ -1,30 +1,5 @@
1
- import "node:module";
1
+ import { n as __reExport, t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
2
  import { captureException, captureMessage, continueTrace, flush, getActiveSpan, getClient, getGlobalScope, getTraceData, init, logger, setTag, setUser, spanToJSON, startInactiveSpan, startSpan, startSpanManual, withActiveSpan, withScope } from "@sentry/node";
3
- // \0rolldown/runtime.js
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __exportAll = (all, no_symbols) => {
9
- let target = {};
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: true
13
- });
14
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
15
- return target;
16
- };
17
- var __copyProps = (to, from, except, desc) => {
18
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
19
- key = keys[i];
20
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
21
- get: ((k) => from[k]).bind(null, key),
22
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
23
- });
24
- }
25
- return to;
26
- };
27
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
28
3
  // src/chat/sentry.ts
29
4
  var sentry_exports = /* @__PURE__ */ __exportAll({
30
5
  captureException: () => captureException,
@@ -45,7 +20,7 @@ var sentry_exports = /* @__PURE__ */ __exportAll({
45
20
  startSpanManual: () => startSpanManual,
46
21
  withActiveSpan: () => withActiveSpan,
47
22
  withScope: () => withScope
48
- });
23
+ }, 2);
49
24
  import * as import__sentry_node from "@sentry/node";
50
25
  __reExport(sentry_exports, import__sentry_node);
51
- export { withScope as _, getClient as a, init as c, setTag as d, setUser as f, withActiveSpan as g, startSpan as h, getActiveSpan as i, logger as l, startInactiveSpan as m, captureMessage as n, getGlobalScope as o, spanToJSON as p, continueTrace as r, getTraceData as s, captureException as t, sentry_exports as u, __exportAll as v };
26
+ export { withScope as _, getClient as a, init as c, setTag as d, setUser as f, withActiveSpan as g, startSpan as h, getActiveSpan as i, logger as l, startInactiveSpan as m, captureMessage as n, getGlobalScope as o, spanToJSON as p, continueTrace as r, getTraceData as s, captureException as t, sentry_exports as u };
@@ -1,4 +1,4 @@
1
- import { i as getActiveSpan, u as sentry_exports } from "./sentry-BRTJqumy.js";
1
+ import { i as getActiveSpan, u as sentry_exports } from "./sentry-CPbZjomA.js";
2
2
  import { matchedRoutes } from "hono/route";
3
3
  // src/chat/sentry-route-name.ts
4
4
  const HTTP_ROUTE_ATTRIBUTE = "app.http.route";
@@ -1,7 +1,7 @@
1
- import { K as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-C9oDAg4M.js";
2
- import { $ as fenceLock, J as getStateAdapter, Z as MUTATION_LOCK_TTL_MS, et as withLock, ht as parseDestination } from "./db-B-gtnNjr.js";
3
- import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-DdFQHZ_d.js";
4
- import { i as readEncryptedState, r as createEncryptedState, t as findLegacyWebActorUserId } from "./legacy-web-actor-id-C-cEeWqL.js";
1
+ import { K as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-DiyqRLBx.js";
2
+ import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-Bu0Z9BEO.js";
3
+ import { $ as fenceLock, J as getStateAdapter, Z as MUTATION_LOCK_TTL_MS, et as withLock, ht as parseDestination } from "./db-C-2tFxk3.js";
4
+ import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-CDS6h_Wv.js";
5
5
  import { AsyncLocalStorage } from "node:async_hooks";
6
6
  import { randomUUID } from "node:crypto";
7
7
  import { sourceSchema } from "@sentry/junior-plugin-api";
@@ -119,29 +119,29 @@ function parseMcpAuthSession(value) {
119
119
  if (!isRecord(value)) return;
120
120
  try {
121
121
  const parsed = value;
122
- if (parsed.schemaVersion !== 2 || typeof parsed.authSessionId !== "string" || typeof parsed.provider !== "string" || typeof parsed.userId !== "string" || typeof parsed.conversationId !== "string" || typeof parsed.sessionId !== "string" || typeof parsed.userMessage !== "string" || typeof parsed.createdAtMs !== "number" || typeof parsed.updatedAtMs !== "number") return;
123
- const destination = parsed.destination === void 0 ? void 0 : parseDestination(parsed.destination);
124
- if (parsed.destination !== void 0 && !destination) return;
125
- const source = parsed.source === void 0 ? void 0 : sourceSchema.safeParse(parsed.source);
126
- if (parsed.source !== void 0 && (!source || !source.success)) return;
122
+ if (parsed["schemaVersion"] !== 2 || typeof parsed["authSessionId"] !== "string" || typeof parsed["provider"] !== "string" || typeof parsed["userId"] !== "string" || typeof parsed["conversationId"] !== "string" || typeof parsed["sessionId"] !== "string" || typeof parsed["userMessage"] !== "string" || typeof parsed["createdAtMs"] !== "number" || typeof parsed["updatedAtMs"] !== "number") return;
123
+ const destination = parsed["destination"] === void 0 ? void 0 : parseDestination(parsed["destination"]);
124
+ if (parsed["destination"] !== void 0 && !destination) return;
125
+ const source = parsed["source"] === void 0 ? void 0 : sourceSchema.safeParse(parsed["source"]);
126
+ if (parsed["source"] !== void 0 && (!source || !source.success)) return;
127
127
  return {
128
128
  schemaVersion: 2,
129
- authSessionId: parsed.authSessionId,
130
- provider: parsed.provider,
131
- userId: parsed.userId,
132
- conversationId: parsed.conversationId,
129
+ authSessionId: parsed["authSessionId"],
130
+ provider: parsed["provider"],
131
+ userId: parsed["userId"],
132
+ conversationId: parsed["conversationId"],
133
133
  ...destination ? { destination } : void 0,
134
134
  ...source?.success ? { source: source.data } : void 0,
135
- sessionId: parsed.sessionId,
136
- userMessage: parsed.userMessage,
137
- createdAtMs: parsed.createdAtMs,
138
- updatedAtMs: parsed.updatedAtMs,
139
- ...typeof parsed.channelId === "string" ? { channelId: parsed.channelId } : void 0,
140
- ...typeof parsed.threadTs === "string" ? { threadTs: parsed.threadTs } : void 0,
141
- ...typeof parsed.toolChannelId === "string" ? { toolChannelId: parsed.toolChannelId } : void 0,
142
- ...isRecord(parsed.configuration) ? { configuration: parsed.configuration } : void 0,
143
- ...typeof parsed.authorizationUrl === "string" ? { authorizationUrl: parsed.authorizationUrl } : void 0,
144
- ...typeof parsed.codeVerifier === "string" ? { codeVerifier: parsed.codeVerifier } : void 0
135
+ sessionId: parsed["sessionId"],
136
+ userMessage: parsed["userMessage"],
137
+ createdAtMs: parsed["createdAtMs"],
138
+ updatedAtMs: parsed["updatedAtMs"],
139
+ ...typeof parsed["channelId"] === "string" ? { channelId: parsed["channelId"] } : void 0,
140
+ ...typeof parsed["threadTs"] === "string" ? { threadTs: parsed["threadTs"] } : void 0,
141
+ ...typeof parsed["toolChannelId"] === "string" ? { toolChannelId: parsed["toolChannelId"] } : void 0,
142
+ ...isRecord(parsed["configuration"]) ? { configuration: parsed["configuration"] } : void 0,
143
+ ...typeof parsed["authorizationUrl"] === "string" ? { authorizationUrl: parsed["authorizationUrl"] } : void 0,
144
+ ...typeof parsed["codeVerifier"] === "string" ? { codeVerifier: parsed["codeVerifier"] } : void 0
145
145
  };
146
146
  } catch {
147
147
  return;
@@ -151,10 +151,10 @@ function parseServerSession(value) {
151
151
  if (typeof value !== "string") return;
152
152
  try {
153
153
  const parsed = JSON.parse(value);
154
- if (!isRecord(parsed) || typeof parsed.sessionId !== "string" || typeof parsed.updatedAtMs !== "number") return;
154
+ if (!isRecord(parsed) || typeof parsed["sessionId"] !== "string" || typeof parsed["updatedAtMs"] !== "number") return;
155
155
  return {
156
- sessionId: parsed.sessionId,
157
- updatedAtMs: parsed.updatedAtMs
156
+ sessionId: parsed["sessionId"],
157
+ updatedAtMs: parsed["updatedAtMs"]
158
158
  };
159
159
  } catch {
160
160
  return;
@@ -165,9 +165,9 @@ function parseStoredCredentials(value) {
165
165
  const parsed = typeof value === "string" ? JSON.parse(value) : value;
166
166
  if (!isRecord(parsed)) return;
167
167
  return {
168
- ...isRecord(parsed.clientInformation) ? { clientInformation: parsed.clientInformation } : void 0,
169
- ...isRecord(parsed.discoveryState) ? { discoveryState: parsed.discoveryState } : void 0,
170
- ...isRecord(parsed.tokens) ? { tokens: parsed.tokens } : void 0
168
+ ...isRecord(parsed["clientInformation"]) ? { clientInformation: parsed["clientInformation"] } : void 0,
169
+ ...isRecord(parsed["discoveryState"]) ? { discoveryState: parsed.discoveryState } : void 0,
170
+ ...isRecord(parsed["tokens"]) ? { tokens: parsed["tokens"] } : void 0
171
171
  };
172
172
  } catch {
173
173
  return;
@@ -294,7 +294,7 @@ function refreshTokenOf(body) {
294
294
  */
295
295
  function serializeMcpTokenRefresh(owner, fetchFn = globalThis.fetch) {
296
296
  let sentAccessToken;
297
- return (async (input, init) => {
297
+ return async (input, init) => {
298
298
  const sentRefreshToken = refreshTokenOf(init?.body);
299
299
  if (!sentRefreshToken) {
300
300
  const authorization = new Headers(init?.headers).get("authorization");
@@ -312,14 +312,14 @@ function serializeMcpTokenRefresh(owner, fetchFn = globalThis.fetch) {
312
312
  const response = await fetchFn(input, init);
313
313
  if (!response.ok) return response;
314
314
  const tokens = await response.clone().json();
315
- if (typeof tokens.access_token !== "string") return response;
315
+ if (typeof tokens["access_token"] !== "string") return response;
316
316
  await fenceLock(state, lock, REFRESH_LOCK_TTL_MS);
317
317
  await putMcpStoredOAuthCredentials(userId, provider, {
318
318
  ...stored,
319
319
  tokens: {
320
320
  ...current,
321
321
  ...tokens,
322
- refresh_token: typeof tokens.refresh_token === "string" ? tokens.refresh_token : sentRefreshToken
322
+ refresh_token: typeof tokens["refresh_token"] === "string" ? tokens["refresh_token"] : sentRefreshToken
323
323
  }
324
324
  });
325
325
  return response;
@@ -330,7 +330,7 @@ function serializeMcpTokenRefresh(owner, fetchFn = globalThis.fetch) {
330
330
  });
331
331
  if (!attempt.acquired) throw new Error(`Timed out waiting for the ${provider} MCP token refresh`);
332
332
  return attempt.value;
333
- });
333
+ };
334
334
  }
335
335
  // src/chat/mcp/client.ts
336
336
  const MCP_CLIENT_INFO = {
@@ -567,14 +567,14 @@ function updateLockKey(provider) {
567
567
  function parseCredentials(value) {
568
568
  try {
569
569
  const parsed = typeof value === "string" ? JSON.parse(value) : value;
570
- if (!isRecord(parsed) || !isRecord(parsed.clientInformation) || !isRecord(parsed.tokens) || typeof parsed.connectedAtMs !== "number" || typeof parsed.redirectUrl !== "string") return;
570
+ if (!isRecord(parsed) || !isRecord(parsed["clientInformation"]) || !isRecord(parsed["tokens"]) || typeof parsed["connectedAtMs"] !== "number" || typeof parsed["redirectUrl"] !== "string") return;
571
571
  return {
572
- clientInformation: parsed.clientInformation,
573
- connectedAtMs: parsed.connectedAtMs,
574
- ...typeof parsed.connectedBy === "string" ? { connectedBy: parsed.connectedBy } : void 0,
575
- ...isRecord(parsed.discoveryState) ? { discoveryState: parsed.discoveryState } : void 0,
576
- redirectUrl: parsed.redirectUrl,
577
- tokens: parsed.tokens
572
+ clientInformation: parsed["clientInformation"],
573
+ connectedAtMs: parsed["connectedAtMs"],
574
+ ...typeof parsed["connectedBy"] === "string" ? { connectedBy: parsed["connectedBy"] } : void 0,
575
+ ...isRecord(parsed["discoveryState"]) ? { discoveryState: parsed.discoveryState } : void 0,
576
+ redirectUrl: parsed["redirectUrl"],
577
+ tokens: parsed["tokens"]
578
578
  };
579
579
  } catch {
580
580
  return;
@@ -709,14 +709,14 @@ function signInKey(state) {
709
709
  return `${SIGN_IN_KEY_PREFIX}:${state}`;
710
710
  }
711
711
  function parseSignIn(value) {
712
- if (!isRecord(value) || !isRecord(value.clientInformation) || typeof value.codeVerifier !== "string" || typeof value.provider !== "string" || typeof value.redirectUrl !== "string") return;
712
+ if (!isRecord(value) || !isRecord(value["clientInformation"]) || typeof value["codeVerifier"] !== "string" || typeof value["provider"] !== "string" || typeof value["redirectUrl"] !== "string") return;
713
713
  return {
714
- clientInformation: value.clientInformation,
715
- codeVerifier: value.codeVerifier,
716
- ...isRecord(value.discoveryState) ? { discoveryState: value.discoveryState } : void 0,
717
- provider: value.provider,
718
- redirectUrl: value.redirectUrl,
719
- ...typeof value.startedBy === "string" ? { startedBy: value.startedBy } : void 0
714
+ clientInformation: value["clientInformation"],
715
+ codeVerifier: value["codeVerifier"],
716
+ ...isRecord(value["discoveryState"]) ? { discoveryState: value.discoveryState } : void 0,
717
+ provider: value["provider"],
718
+ redirectUrl: value["redirectUrl"],
719
+ ...typeof value["startedBy"] === "string" ? { startedBy: value["startedBy"] } : void 0
720
720
  };
721
721
  }
722
722
  /** Build an OAuth client provider that keeps sign-in state in memory. */
@@ -1,6 +1,6 @@
1
- import { K as disconnectStateAdapter } from "./db-B-gtnNjr.js";
2
- import { n as pluginCatalogRuntime } from "./catalog-runtime-Dss0lSV6.js";
3
- import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-CrZftRTb.js";
1
+ import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-BcT5LR7V.js";
2
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-d1EM6Z0V.js";
3
+ import { K as disconnectStateAdapter } from "./db-C-2tFxk3.js";
4
4
  import { CLI_USAGE } from "./cli/run.js";
5
5
  import { createServer } from "node:http";
6
6
  // src/cli/service-account.ts
@@ -1,17 +1,17 @@
1
- import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { Bn as SCRIPT_TOOLS_SECTION_TAG, Da as postSlackMessage, Di as verifyTimerWatchCredentialSubject, Fn as retainRuntimeTurnContext, Hn as TURN_CONTEXT_TAG, In as stripRuntimeTurnContext, Io as buildSentryConversationUrl, Jn as renderUntrustedTag, Ki as listWorkspaces, Kn as renderChildTag, M as normalizeConversationText, Nn as latestTurnContextSection, Nr as getReviewItem, Oi as JUNIOR_THREAD_STATE_TTL_MS, Rn as CAPABILITY_SECTION_TAG, Tn as hasRuntimeTurnContext, Un as escapeClosingTags, Vn as SESSION_CONTEXT_SECTION_TAG, Wn as escapeTagText, Yn as tagJson, _a as slackMention, ct as listTurnSummaries, di as cancelSubscriptions, do as sandboxSkillFile, eo as ToolInputError, fn as NO_REPLY_TOOL_NAME, fo as sandboxSkillPathResolution, ha as normalizeSlackReplyMarkdown, in as REPLY_TOOL_NAME, ji as getDashboardObjectIconLink, ki as getDashboardConversationLink, lo as SANDBOX_WORKSPACE_ROOT, lr as getPluginUserPromptContributions, ma as formatSlackLink, oo as SANDBOX_DATA_ROOT, or as getPluginSlackConversationLink, ot as getStoredTurnFields, pa as escapeSlackMrkdwnText, qn as renderTag$1, so as SANDBOX_REPOS_ROOT, sr as getPluginSystemPromptContributions, st as getTurnRecord, uo as sandboxSkillDir, ur as getPlugins, vn as REPORT_BLOCKED_TOOL_NAME, x as toStoredConversationMessage, zn as REQUEST_CONTEXT_SECTION_TAG } from "./projection-CIBwgD3s.js";
3
- import { I as renderCurrentInstruction, R as escapeXml, n as botConfig, z as escapeXmlText } from "./config-CzeZiMKs.js";
4
- import { G as normalizeIdentityEmail, h as logWarn, m as logInfo, p as logException, v as serializeGenAiAttribute } from "./logging-C9oDAg4M.js";
5
- import { o as isUserActor, t as createActor } from "./actor-D2iXzvlN.js";
6
- import { C as isPersonInput, J as getStateAdapter, M as SYSTEM_IDENTITY_ID, a as getConversationStore, ft as nextDetailVersion, o as getDb, r as getConversationEventStore, s as getSqlExecutor } from "./db-B-gtnNjr.js";
7
- import { M as juniorConversations, N as juniorIdentities, P as juniorUsers } from "./executor-DZg20EqU.js";
8
- import { a as listReferenceFiles, c as soulPathCandidates, l as worldPathCandidates } from "./package-discovery-DJhGdS4c.js";
9
- import { h as credentialSubjectSchema } from "./registry-DdFQHZ_d.js";
10
- import { i as parseSkillFile } from "./skills-C16fz60Z.js";
11
- import { a as EVENT_SYSTEM_ACTOR, f as JUNIOR_NATIVE_EVENT_NAMESPACE, g as conversationNoteEvent, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage, r as EVENT_AUTHOR_ID } from "./prompt-CRQbzp5e.js";
12
- import { bt as eventGuidance, gt as CORE_EVENT_NAMESPACE, yt as eventCatalogEntry } from "./turn-session-routing-BFMS9ATF.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
+ import { Ai as JUNIOR_THREAD_STATE_TTL_MS, Bn as SCRIPT_TOOLS_SECTION_TAG, Fn as retainRuntimeTurnContext, Hn as TURN_CONTEXT_TAG, In as stripRuntimeTurnContext, Ji as listWorkspaces, Jn as renderUntrustedTag, Kn as renderChildTag, M as normalizeConversationText, Ni as getDashboardObjectIconLink, Nn as latestTurnContextSection, Pr as getReviewItem, Rn as CAPABILITY_SECTION_TAG, Ro as buildSentryConversationUrl, Tn as hasRuntimeTurnContext, Un as escapeClosingTags, Vn as SESSION_CONTEXT_SECTION_TAG, Wn as escapeTagText, Yn as tagJson, _a as normalizeSlackReplyMarkdown, co as SANDBOX_DATA_ROOT, ct as listTurnSummaries, do as SANDBOX_WORKSPACE_ROOT, fn as NO_REPLY_TOOL_NAME, fo as sandboxSkillDir, ga as formatSlackLink, ha as escapeSlackMrkdwnText, in as REPLY_TOOL_NAME, ji as getDashboardConversationLink, ka as postSlackMessage, ki as verifyTimerWatchCredentialSubject, lo as SANDBOX_REPOS_ROOT, lr as getPluginUserPromptContributions, mo as sandboxSkillPathResolution, no as ToolInputError, or as getPluginSlackConversationLink, ot as getStoredTurnFields, pi as cancelSubscriptions, po as sandboxSkillFile, qn as renderTag$1, sr as getPluginSystemPromptContributions, st as getTurnRecord, ur as getPlugins, vn as REPORT_BLOCKED_TOOL_NAME, x as toStoredConversationMessage, ya as slackMention, zn as REQUEST_CONTEXT_SECTION_TAG } from "./projection-DBq8tsA5.js";
3
+ import { C as isPersonInput, J as getStateAdapter, M as SYSTEM_IDENTITY_ID, a as getConversationStore, ft as nextDetailVersion, o as getDb, r as getConversationEventStore, s as getSqlExecutor } from "./db-C-2tFxk3.js";
4
+ import { I as renderCurrentInstruction, R as escapeXml, n as botConfig, z as escapeXmlText } from "./config-oGM7KA9M.js";
5
+ import { a as listReferenceFiles, c as soulPathCandidates, l as worldPathCandidates } from "./package-discovery-x4AvVhMj.js";
6
+ import { G as normalizeIdentityEmail, h as logWarn, m as logInfo, p as logException, v as serializeGenAiAttribute } from "./logging-DiyqRLBx.js";
7
+ import { a as EVENT_SYSTEM_ACTOR, f as JUNIOR_NATIVE_EVENT_NAMESPACE, g as conversationNoteEvent, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage, r as EVENT_AUTHOR_ID } from "./prompt-D2KlJopL.js";
13
8
  import { c as formatUserInputAnswer, h as isVisionImageMediaType, v as userCustomizationTextSchema } from "./web-message-id-lNodcCOI.js";
14
- import { r as appendAndEnqueueInboundMessage } from "./store-C28I0CVW.js";
9
+ import { M as juniorConversations, N as juniorIdentities, P as juniorUsers } from "./executor-NVfS8aQ2.js";
10
+ import { i as parseSkillFile } from "./skills-CNAGH4ju.js";
11
+ import { o as isUserActor, t as createActor } from "./actor-D2iXzvlN.js";
12
+ import { r as appendAndEnqueueInboundMessage } from "./store-Dgs7Oe44.js";
13
+ import { bt as eventGuidance, gt as CORE_EVENT_NAMESPACE, yt as eventCatalogEntry } from "./turn-session-routing-DGvn9MSl.js";
14
+ import { h as credentialSubjectSchema } from "./registry-Bu0Z9BEO.js";
15
15
  import * as z from "zod";
16
16
  import path from "node:path";
17
17
  import { isDeepStrictEqual } from "node:util";
@@ -1245,7 +1245,7 @@ function slackChannelMessageEvents() {
1245
1245
  */
1246
1246
  function slackChannelMessageTrigger(trigger, channelId) {
1247
1247
  if (trigger.namespace !== "slack") return trigger;
1248
- if (trigger.identifier != null || trigger.match?.channelId !== void 0) return trigger;
1248
+ if (trigger.identifier != null || trigger.match?.["channelId"] !== void 0) return trigger;
1249
1249
  return {
1250
1250
  ...trigger,
1251
1251
  match: {
@@ -1267,7 +1267,7 @@ function requireSlackChannelMessageScope(automation) {
1267
1267
  const channelId = automation.destination.channelId;
1268
1268
  if (!CHANNEL_ID_PATTERN.test(channelId)) throw new ToolInputError("A Slack channel-message automation works only in a channel, not in a DM.");
1269
1269
  const { identifier, match } = automation.trigger;
1270
- if ((identifier === void 0 ? match?.channelId : identifier === "current_channel" ? channelId : identifier) !== channelId) throw new ToolInputError("A Slack channel-message automation can watch only the channel where it posts. Leave out the channel_id filter, or create the automation in the channel to watch.");
1270
+ if ((identifier === void 0 ? match?.["channelId"] : identifier === "current_channel" ? channelId : identifier) !== channelId) throw new ToolInputError("A Slack channel-message automation can watch only the channel where it posts. Leave out the channel_id filter, or create the automation in the channel to watch.");
1271
1271
  return {
1272
1272
  ...automation,
1273
1273
  credentialMode: "system",
@@ -1321,15 +1321,15 @@ function slackChannelMessageEvent(input) {
1321
1321
  */
1322
1322
  function slackChannelMessageRunsAutomation(event, automation) {
1323
1323
  if (event.namespace !== "slack") return true;
1324
- if (event.data?.channelId !== automation.destination.channelId) return false;
1325
- if (event.data?.location === THREAD_LOCATION && ![automation.trigger.match?.location].flat().includes(THREAD_LOCATION)) return false;
1326
- if (event.data?.postedByBot !== true) return true;
1327
- return automation.trigger.match?.userId !== void 0;
1324
+ if (event.data?.["channelId"] !== automation.destination.channelId) return false;
1325
+ if (event.data?.["location"] === THREAD_LOCATION && ![automation.trigger.match?.["location"]].flat().includes(THREAD_LOCATION)) return false;
1326
+ if (event.data?.["postedByBot"] !== true) return true;
1327
+ return automation.trigger.match?.["userId"] !== void 0;
1328
1328
  }
1329
1329
  /** Return the source message thread for a channel-message run. */
1330
1330
  function slackChannelMessageReplyThreadTs(event) {
1331
1331
  if (event.namespace !== "slack") return void 0;
1332
- const messageTs = event.data?.threadTs ?? event.data?.messageTs;
1332
+ const messageTs = event.data?.["threadTs"] ?? event.data?.["messageTs"];
1333
1333
  return typeof messageTs === "string" ? messageTs : void 0;
1334
1334
  }
1335
1335
  // src/chat/events/runtime-catalog.ts
@@ -2094,7 +2094,7 @@ async function releaseFailedNoticeClaim(args) {
2094
2094
  try {
2095
2095
  await clearAutomatedTurnLimitNoticeClaim(args);
2096
2096
  } catch (error) {
2097
- logException(error, "automated_turn_limit.notice_claim_clear_failed");
2097
+ logException(error, "automated_turn_limit.notice.claim_clear_failed");
2098
2098
  }
2099
2099
  }
2100
2100
  /** Post the pause notice for one Conversation Location when known. */
@@ -2103,7 +2103,7 @@ async function postAutomatedTurnLimitNoticeForConversation(args) {
2103
2103
  const conversation = await getConversationStore().get({ conversationId: args.conversationId });
2104
2104
  const location = conversation?.parentConversationId ? void 0 : conversation?.location;
2105
2105
  if (!location || location.provider !== "slack") {
2106
- logWarn("automated_turn_limit.notice_skipped", {
2106
+ logWarn("automated_turn_limit.notice.skipped", {
2107
2107
  conversationId: args.conversationId,
2108
2108
  "app.automated_turn_limit.reason": location ? "unsupported_location" : "missing_location"
2109
2109
  });
@@ -2124,7 +2124,7 @@ async function postAutomatedTurnLimitNoticeForConversation(args) {
2124
2124
  });
2125
2125
  return true;
2126
2126
  } catch (error) {
2127
- logException(error, "automated_turn_limit.notice_failed", { conversationId: args.conversationId });
2127
+ logException(error, "automated_turn_limit.notice.failed", { conversationId: args.conversationId });
2128
2128
  await releaseFailedNoticeClaim({
2129
2129
  conversationId: args.conversationId,
2130
2130
  nowMs: args.nowMs
@@ -2353,11 +2353,11 @@ function eventTaskFacts(subscription, event, people = [], doneBy) {
2353
2353
  function isEventMailboxMetadata(value) {
2354
2354
  if (!value || typeof value !== "object" || Array.isArray(value)) return false;
2355
2355
  const record = value;
2356
- if (record.kind !== "event") return false;
2357
- const event = record.event;
2356
+ if (record["kind"] !== "event") return false;
2357
+ const event = record["event"];
2358
2358
  if (!event || typeof event !== "object" || Array.isArray(event)) return false;
2359
2359
  const fields = event;
2360
- return typeof fields.eventKey === "string" && typeof fields.eventType === "string" && typeof fields.namespace === "string" && typeof fields.identifier === "string" && (fields.subscriptionId === void 0 || typeof fields.subscriptionId === "string") && (fields.objectType === void 0 || objectTypeSchema.safeParse(fields.objectType).success) && (fields.trustedSummary === void 0 || typeof fields.trustedSummary === "string");
2360
+ return typeof fields["eventKey"] === "string" && typeof fields["eventType"] === "string" && typeof fields["namespace"] === "string" && typeof fields["identifier"] === "string" && (fields["subscriptionId"] === void 0 || typeof fields["subscriptionId"] === "string") && (fields["objectType"] === void 0 || objectTypeSchema.safeParse(fields["objectType"]).success) && (fields["trustedSummary"] === void 0 || typeof fields["trustedSummary"] === "string");
2361
2361
  }
2362
2362
  /**
2363
2363
  * Return the timer creator subject when every event in the batch carries a
@@ -2812,7 +2812,7 @@ async function loadTurnConversationNotes(input) {
2812
2812
  newestFirst.push(failedTurnNote(data.failureCode, data.eventId));
2813
2813
  if (newestFirst.length === MAX_CONVERSATION_NOTES_PER_TURN) break scan;
2814
2814
  } else if (foundTurn && data.type === "structured_event" && data.namespace === "junior" && data.name === conversationNoteEvent.eventName && data.version === conversationNoteEvent.version) {
2815
- newestFirst.push(conversationNoteEvent.parse(data.content).text);
2815
+ newestFirst.push(conversationNoteEvent.parse(data.content)["text"]);
2816
2816
  if (newestFirst.length === MAX_CONVERSATION_NOTES_PER_TURN) break scan;
2817
2817
  }
2818
2818
  if (!page.hasOlder || page.events.length === 0) break;
@@ -3283,14 +3283,7 @@ async function eventReviewItemInputs(messages) {
3283
3283
  return new Map(rendered.flatMap(([id, text]) => text ? [[id, text]] : []));
3284
3284
  }
3285
3285
  // src/chat/conversations/session-stop.ts
3286
- var session_stop_exports = /* @__PURE__ */ __exportAll({
3287
- getConversationStoppedAtMs: () => getConversationStoppedAtMs,
3288
- isSkippedAfterConversationStop: () => isSkippedAfterConversationStop,
3289
- isWatchEvent: () => isWatchEvent,
3290
- markConversationsStopped: () => markConversationsStopped,
3291
- resumeStoppedConversationTree: () => resumeStoppedConversationTree,
3292
- skipInputAfterConversationStop: () => skipInputAfterConversationStop
3293
- });
3286
+ var session_stop_exports = /* @__PURE__ */ __exportAll({ skipInputAfterConversationStop: () => skipInputAfterConversationStop });
3294
3287
  /** Skip reason on the Message that saves Events for a stopped Conversation. */
3295
3288
  const STOPPED_CONVERSATION_SKIP_REASON = "stopped conversation";
3296
3289
  /**
@@ -1,7 +1,7 @@
1
- import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { h as logWarn } from "./logging-C9oDAg4M.js";
3
- import { s as skillRoots } from "./package-discovery-DJhGdS4c.js";
4
- import { n as pluginCatalogRuntime } from "./catalog-runtime-Dss0lSV6.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
+ import { s as skillRoots } from "./package-discovery-x4AvVhMj.js";
3
+ import { h as logWarn } from "./logging-DiyqRLBx.js";
4
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-d1EM6Z0V.js";
5
5
  import * as z from "zod";
6
6
  import path from "node:path";
7
7
  import fs from "node:fs/promises";
@@ -10,10 +10,7 @@ import { parse } from "yaml";
10
10
  var skills_exports = /* @__PURE__ */ __exportAll({
11
11
  discoverSkills: () => discoverSkills,
12
12
  findSkillByName: () => findSkillByName,
13
- loadSkillsByName: () => loadSkillsByName,
14
- parseSkillFile: () => parseSkillFile,
15
- parseSkillInvocation: () => parseSkillInvocation,
16
- stripFrontmatter: () => stripFrontmatter
13
+ parseSkillFile: () => parseSkillFile
17
14
  });
18
15
  const FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;
19
16
  const SKILL_NAME_RE = /^[a-z0-9-]+$/;
@@ -136,7 +133,7 @@ const SKILL_CACHE_TTL_MS = 5e3;
136
133
  let skillCache = null;
137
134
  function resolveSkillRoots(options) {
138
135
  const additionalRoots = options?.additionalRoots ?? [];
139
- const envRoots = process.env.SKILL_DIRS?.split(path.delimiter).filter(Boolean) ?? [];
136
+ const envRoots = process.env["SKILL_DIRS"]?.split(path.delimiter).filter(Boolean) ?? [];
140
137
  const defaults = skillRoots();
141
138
  const pluginRoots = pluginCatalogRuntime.getSkillRoots();
142
139
  const seen = /* @__PURE__ */ new Set();