@sentry/junior 0.310.0 → 0.311.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 (112) hide show
  1. package/dist/adapter-B1wujchl.js +259 -0
  2. package/dist/{adapter-context-BhKpjpGD.js → adapter-context-G2M0y6rP.js} +2 -2
  3. package/dist/{admin-tgZEZAk2.js → admin-DCiBhUT1.js} +1 -2
  4. package/dist/{agent-runner-D9cvNlQl.js → agent-runner-BVHPUIc8.js} +543 -1703
  5. package/dist/api/schema.d.ts +2 -2
  6. package/dist/api/schema.js +7 -6
  7. package/dist/api.d.ts +21 -3
  8. package/dist/api.js +1479 -372
  9. package/dist/{app-B_7Wn0en.d.ts → app-Cw5Vy6H6.d.ts} +14 -3
  10. package/dist/app.d.ts +2 -2
  11. package/dist/app.js +232 -506
  12. package/dist/{background-compaction-queue-BGHqkhkY.js → background-compaction-queue-CJDnWVOJ.js} +4 -4
  13. package/dist/{briefs-DKxkoruh.js → briefs-BDjnug6Y.js} +3 -3
  14. package/dist/{catalog-runtime-BxwzbLKY.js → catalog-runtime-DMY3VV-D.js} +1 -1
  15. package/dist/cli/chat.js +16 -16
  16. package/dist/cli/check.js +23 -29
  17. package/dist/cli/init.js +1 -6
  18. package/dist/cli/main.js +3 -3
  19. package/dist/cli/plugins.js +8 -7
  20. package/dist/cli/snapshot-create.js +5 -5
  21. package/dist/cli/upgrade.d.ts +1 -1
  22. package/dist/cli/upgrade.js +3 -3
  23. package/dist/{config-Dkt2Le2b.js → config-BrXDQefC.js} +239 -5
  24. package/dist/{continue-in-slack-BWVwePKD.js → continue-in-slack-DNXSC9So.js} +6 -5
  25. package/dist/{conversation-M9KZ5JxF.js → conversation-ca__NDQW.js} +47 -8
  26. package/dist/{conversation-feed-Ci6YD1N-.js → conversation-feed-DkinDu5o.js} +15 -6
  27. package/dist/{conversation-privacy-C39g8BY4.js → conversation-privacy-DxttrKb9.js} +1 -1
  28. package/dist/{conversation-turn-CBlZIH02.js → conversation-turn-DWw7Xhdr.js} +41 -38
  29. package/dist/{credential-sync-vGnrB0BY.js → credential-sync-Bk8wGb8Y.js} +15 -16
  30. package/dist/{db-B4Hjxr-u.d.ts → db-7ETESH44.d.ts} +3 -1
  31. package/dist/{db-CFZggNoy.js → db-DTxzH7u5.js} +1609 -1040
  32. package/dist/{executor-BPkZDx5-.js → executor-DqTiYj9S.js} +450 -99
  33. package/dist/{html-2r2KmLwi.js → html-B9Sl4Axb.js} +6 -6
  34. package/dist/{install-C-oE6C_u.js → install-Sg4ePfLl.js} +2 -2
  35. package/dist/instrumentation.js +3 -3
  36. package/dist/{lineage-CsvrEFQe.js → lineage-BHAMpNKr.js} +2 -2
  37. package/dist/{logging-D5gkyvnK.js → logging-FjclQsXu.js} +47 -9
  38. package/dist/{message-DwvJ-I3w.js → message-CJ7_RL50.js} +5 -8
  39. package/dist/{model-input-MAq2881y.js → model-input-CMLh4Cwq.js} +3 -3
  40. package/dist/nitro.d.ts +1 -1
  41. package/dist/nitro.js +3 -3
  42. package/dist/{oauth-callback-server-DIF6Li06.js → oauth-callback-server-RVcbiDjL.js} +2 -2
  43. package/dist/{oauth-relay-DPE-wrwO.js → oauth-relay-Bu9kkaQu.js} +1 -1
  44. package/dist/{projection-jZSlEAXG.js → projection-Cns7XwWa.js} +9445 -5574
  45. package/dist/{prompt-CaMyeCpA.js → prompt-CDqcsDYC.js} +4 -4
  46. package/dist/{registry-BBkWFCl8.js → registry-BPwuOP2O.js} +5 -8
  47. package/dist/{resolve-B38MkHXE.js → resolve-BK29bBry.js} +3 -3
  48. package/dist/rule-DAxQY-1h.js +20 -0
  49. package/dist/{runner-11h8PrHh.js → runner-BcAE-cJm.js} +10 -10
  50. package/dist/{sandbox-egress-signals-CTcACAtJ.js → sandbox-egress-signals-C-q0go5b.js} +1 -1
  51. package/dist/{schedule-DWxZ3kja.js → schedule-BLJ476XQ.js} +209 -43
  52. package/dist/{schema-obw5jvR4.js → schema-BLgSZXcL.js} +255 -49
  53. package/dist/{schema-DriSvB40.d.ts → schema-DYcJeV7d.d.ts} +701 -62
  54. package/dist/{service-account-Zc5bUcIJ.js → service-account-gN0zqf0S.js} +68 -68
  55. package/dist/{service-account-Bx93N1n1.js → service-account-iJoCtkHR.js} +3 -3
  56. package/dist/{skills-C8Npu5zO.js → skills-BoZ80epJ.js} +2 -2
  57. package/dist/{slack-conversation-unfurl-DlRVA02H.js → slack-conversation-unfurl-CogYrITA.js} +8 -10
  58. package/dist/{spawn-CXr58R0x.js → spawn-Dk92r7mX.js} +5 -6
  59. package/dist/{state-CGrGVeQC.js → state-DH3Cmgp3.js} +4 -4
  60. package/dist/{stop-DYzjRf2U.js → stop-CYsfc0Ed.js} +1063 -313
  61. package/dist/{store-D4FQ1Nml.js → store-DmmMIrQi.js} +5 -5
  62. package/dist/{task-queue-CaZffYaH.js → task-queue-C_zldF5J.js} +3 -3
  63. package/dist/{task-runner-Dm7BHbGp.js → task-runner-C7oCJQIx.js} +20 -13
  64. package/dist/{thread-context-Dyj1KWaY.js → thread-context-BW2BsQbH.js} +13 -11
  65. package/dist/{turn-session-routing-CD0BRCex.js → turn-session-routing-Xh_2nSQe.js} +52 -54
  66. package/dist/{validation-DxVNIxA0.js → validation-DrJd0nnq.js} +1 -1
  67. package/dist/{version-Cr7Z71yG.js → version-CNKZ8owc.js} +1 -1
  68. package/dist/version.js +1 -1
  69. package/dist/{warmup-C6LOZ2d2.js → warmup-BWdHew2H.js} +14287 -7195
  70. package/dist/{web-message-id-BT8Mg8LL.js → web-message-id-Ch5dPq-a.js} +32 -144
  71. package/dist/{worker-CUBtu1Li.js → worker-t9qpu_Zx.js} +7 -8
  72. package/migrations/0126_artifact_drop_public.sql +8 -0
  73. package/migrations/0127_artifact_path.sql +4 -0
  74. package/migrations/0128_artifact_path_index.sql +1 -0
  75. package/migrations/0129_review_item_answered_index.sql +1 -0
  76. package/migrations/0130_review_item_status_index.sql +1 -0
  77. package/migrations/0131_brief_outcome_status.sql +1 -0
  78. package/migrations/0132_brief_outcome_status_backfill.sql +7 -0
  79. package/migrations/0133_brief_created_at_index.sql +1 -0
  80. package/migrations/0134_slack_person_search_index.sql +1 -0
  81. package/migrations/0135_code_change_size.sql +3 -0
  82. package/migrations/0136_merge_conflict_notice_dismiss.sql +16 -0
  83. package/migrations/0137_inbox_snoozes.sql +27 -0
  84. package/migrations/0138_code_change_search_index.sql +2 -0
  85. package/migrations/0139_review_item_owner.sql +22 -0
  86. package/migrations/0140_review_item_owner_index.sql +1 -0
  87. package/migrations/0141_memory_core_adoption.sql +89 -0
  88. package/migrations/0142_memory_core_indexes.sql +17 -0
  89. package/migrations/meta/0126_snapshot.json +5488 -0
  90. package/migrations/meta/0127_snapshot.json +5519 -0
  91. package/migrations/meta/0128_snapshot.json +5519 -0
  92. package/migrations/meta/0129_snapshot.json +5547 -0
  93. package/migrations/meta/0130_snapshot.json +5563 -0
  94. package/migrations/meta/0131_snapshot.json +5569 -0
  95. package/migrations/meta/0132_snapshot.json +5569 -0
  96. package/migrations/meta/0133_snapshot.json +5590 -0
  97. package/migrations/meta/0134_snapshot.json +5606 -0
  98. package/migrations/meta/0135_snapshot.json +5624 -0
  99. package/migrations/meta/0136_snapshot.json +5624 -0
  100. package/migrations/meta/0137_snapshot.json +5864 -0
  101. package/migrations/meta/0138_snapshot.json +5894 -0
  102. package/migrations/meta/0139_snapshot.json +5898 -0
  103. package/migrations/meta/0140_snapshot.json +5919 -0
  104. package/migrations/meta/0141_snapshot.json +6429 -0
  105. package/migrations/meta/0142_snapshot.json +6457 -0
  106. package/migrations/meta/_journal.json +120 -1
  107. package/package.json +6 -7
  108. package/dist/result-BaqSZcJb.js +0 -548
  109. package/dist/session-stop-BfY4rhJs.js +0 -4255
  110. package/dist/turn-user-message-9IxeEv5v.js +0 -364
  111. package/dist/users-CaUAYMb3.js +0 -181
  112. package/dist/viewer-AHldghAD.js +0 -212
@@ -1,10 +1,10 @@
1
- import { F as sumUtcHoursIntoSixHours, M as fillUtcHours, d as userInputRequestSchema, i as AGENT_INVOCATION_STATUSES, j as fillUtcDays, y as PLAN_ITEM_STATUSES } from "./web-message-id-BT8Mg8LL.js";
2
- import { $ as inputFileSchema, D as conversationChildAgentTotalsSchema, E as idempotencyKeySchema, c as conversationAuxiliaryCostsSchema, i as actorIdentitySchema, m as conversationParamsSchema, x as conversationUsageSchema, y as conversationSummaryReportSchema } from "./conversation-M9KZ5JxF.js";
3
- import "./conversation-feed-Ci6YD1N-.js";
1
+ import { A as sumUtcHoursIntoSixHours, D as fillUtcHours, E as fillUtcDays, i as AGENT_INVOCATION_STATUSES, v as PLAN_ITEM_STATUSES } from "./web-message-id-Ch5dPq-a.js";
2
+ import { E as idempotencyKeySchema, O as conversationChildAgentTotalsSchema, c as conversationAuxiliaryCostsSchema, i as actorIdentitySchema, m as conversationParamsSchema, tt as inputFileSchema, x as conversationUsageSchema, y as conversationSummaryReportSchema } from "./conversation-ca__NDQW.js";
3
+ import { J as reviewItemRequestSchema, r as notificationScheduleSchema } from "./schedule-BLJ476XQ.js";
4
+ import "./conversation-feed-DkinDu5o.js";
4
5
  import { t as isPushServiceEndpoint } from "./push-endpoint-CO-nomUd.js";
5
- import { r as notificationScheduleSchema } from "./schedule-DWxZ3kja.js";
6
6
  import * as z from "zod";
7
- import { codeChangeStateSchema, eventMatchSchema, objectTypeSchema, ownedObjectAnnotationSchema } from "@sentry/junior-plugin-api";
7
+ import { codeChangeSizeSchema, codeChangeStateSchema, eventMatchSchema, objectTypeSchema, ownedObjectAnnotationSchema } from "@sentry/junior-plugin-api";
8
8
  // src/api/schema/conversation-attachment-upload.ts
9
9
  /**
10
10
  * Ask to upload one file for a Message. `conversationId` names an existing
@@ -69,6 +69,10 @@ const conversationSubscriptionResponseSchema = z.object({
69
69
  archivedAt: z.string().datetime().nullable(),
70
70
  subscribed: z.boolean()
71
71
  }).strict();
72
+ /** Invite one mentioned person, by Slack user id, to a public Conversation. */
73
+ const conversationInviteBodySchema = z.object({ slackUserId: z.string().min(1).max(64) }).strict();
74
+ /** `added` is false when the person was already a Participant. */
75
+ const conversationInviteResponseSchema = z.object({ added: z.boolean() }).strict();
72
76
  // src/api/schema/conversation-archive.ts
73
77
  /**
74
78
  * Archive or restore one conversation. `applyToChildren` applies to a child
@@ -297,6 +301,8 @@ const conversationWatchesReportSchema = z.object({
297
301
  conversationId: z.string().min(1),
298
302
  watches: z.array(conversationWatchSchema)
299
303
  }).strict();
304
+ /** Route params that name one Watch of one Conversation. */
305
+ const watchParamsSchema = conversationParamsSchema.extend({ watchId: z.string().min(1) }).strict();
300
306
  // src/api/schema/plan.ts
301
307
  const planItemAssigneeSchema = z.discriminatedUnion("kind", [
302
308
  z.object({ kind: z.literal("self") }).strict(),
@@ -394,6 +400,8 @@ const codeChangeSummaryReportSchema = z.object({
394
400
  openedAt: z.string(),
395
401
  provider: z.string().min(1),
396
402
  repository: z.string().min(1),
403
+ /** Lines and files changed. Unknown parts are absent. */
404
+ size: codeChangeSizeSchema.optional(),
397
405
  state: codeChangeStateSchema,
398
406
  title: z.string().optional(),
399
407
  url: z.string().url().optional()
@@ -409,6 +417,19 @@ const codeOverviewReportSchema = z.object({
409
417
  windowEnd: z.string(),
410
418
  windowStart: z.string()
411
419
  }).strict();
420
+ /** A search of tracked code changes, for the composer `#` menu. */
421
+ const codeChangeSearchQuerySchema = z.object({ q: z.string().trim().min(1).max(100) }).strict();
422
+ /** A tracked code change that a Message can link to. */
423
+ const mentionableCodeChangeSchema = z.object({
424
+ draft: z.boolean(),
425
+ number: z.number().int(),
426
+ /** `owner/repo`. */
427
+ repository: z.string(),
428
+ state: codeChangeStateSchema,
429
+ title: z.string().nullable(),
430
+ url: z.string()
431
+ }).strict();
432
+ const codeChangeSearchReportSchema = z.object({ changes: z.array(mentionableCodeChangeSchema) }).strict();
412
433
  const codeRepositoryParamsSchema = z.object({ repositoryId: z.string().uuid() }).strict();
413
434
  /** Optional change state that limits the listed repository changes. */
414
435
  const codeRepositoryQuerySchema = z.object({ state: codeChangeStateSchema.optional() }).strict();
@@ -609,6 +630,23 @@ const locationDetailReportSchema = locationSummaryReportSchema.extend({
609
630
  }).strict();
610
631
  // src/api/schema/person.ts
611
632
  const personParamsSchema = z.object({ email: z.string().trim().min(1) }).strict();
633
+ /**
634
+ * A people search. With `conversationId`, it finds only people in the Slack
635
+ * workspace of that Conversation, so a mention reaches them there.
636
+ */
637
+ const peopleSearchQuerySchema = z.object({
638
+ conversationId: z.string().min(1).max(500).optional(),
639
+ q: z.string().trim().min(1).max(100)
640
+ }).strict();
641
+ /**
642
+ * A person that a Message can mention: they have a Slack user id. `hasUser`
643
+ * is true when they are a User, so they have a feed to Invite them to.
644
+ */
645
+ const mentionablePersonSchema = actorIdentitySchema.extend({
646
+ hasUser: z.literal(true).optional(),
647
+ slackUserId: z.string().min(1)
648
+ }).strict();
649
+ const peopleSearchReportSchema = z.object({ people: z.array(mentionablePersonSchema) }).strict();
612
650
  /** Route parameters for the photo of one Identity. */
613
651
  const avatarParamsSchema = z.object({ identityId: z.string().min(1).max(200) }).strict();
614
652
  const peopleConversationStatsItemSchema = conversationStatsItemSchema.omit({ costUsd: true });
@@ -693,6 +731,28 @@ const personalSpendReportSchema = z.object({
693
731
  windowEnd: z.string(),
694
732
  windowStart: z.string()
695
733
  }).strict();
734
+ /** The most recent merged code changes and Conversations a person card lists. */
735
+ const PERSON_CARD_RECENT_LIMIT = 3;
736
+ /**
737
+ * The person card that opens on a reference to a person: their object card,
738
+ * when Junior knows them, the code changes they merged most recently, and
739
+ * their recent Junior activity. The activity names only Conversations that
740
+ * the viewer may read.
741
+ */
742
+ const personCardReportSchema = z.object({
743
+ activity: z.object({
744
+ /** The last Turn of the person in the last 30 days. */
745
+ lastActiveAt: z.string().optional(),
746
+ recentConversations: z.array(z.object({
747
+ conversationId: z.string(),
748
+ lastTurnAt: z.string(),
749
+ title: z.string()
750
+ }).strict()).max(3)
751
+ }).strict(),
752
+ card: ownedObjectAnnotationSchema.optional(),
753
+ /** The same code changes as the People profile, newest merge first. */
754
+ mergedChanges: z.array(codeChangeSummaryReportSchema).max(3)
755
+ }).strict();
696
756
  // src/api/schema/personal-token.ts
697
757
  const personalTokenMetadataSchema = z.object({
698
758
  id: z.string().uuid(),
@@ -797,25 +857,138 @@ const cacheWarmingSavingsRefillSchema = z.object({
797
857
  totalConversations: z.number().int().nonnegative().optional()
798
858
  }).strict();
799
859
  const cacheWarmingSavingsRefillResponseSchema = z.object({ refill: cacheWarmingSavingsRefillSchema }).strict();
800
- // src/chat/review-items/evidence.ts
860
+ const cacheHealthQuerySchema = z.object({ window: z.enum(["24h", "7d"]).default("24h") }).strict();
861
+ /** Prompt cache of agent model calls, without warmups. */
862
+ const cacheHealthCallsSchema = z.object({
863
+ calls: z.number().int().nonnegative(),
864
+ /** Input tokens, cache reads and writes included. */
865
+ inputTokens: z.number().int().nonnegative(),
866
+ cacheWriteTokens: z.number().int().nonnegative()
867
+ }).strict();
801
868
  /**
802
- * One source that an agent cites for a Review item: a link or a
803
- * Conversation, with a short label and an optional one-line note. A link
804
- * points outside Junior; a Conversation reference points to work in Junior.
805
- * The question stores the list, and the dashboard shows it beside the
806
- * answer choices.
869
+ * Cache health of a recent window, read from Junior's own Sentry telemetry.
870
+ * A full rewrite wrote over 50k tokens to the cache and read under 20k.
807
871
  */
808
- const reviewItemEvidenceSchema = z.object({
809
- conversationId: z.string().min(1).max(500).optional(),
810
- label: z.string().min(1).max(120),
811
- note: z.string().min(1).max(200).optional(),
812
- url: z.string().min(1).max(2e3).optional()
813
- }).strict().refine((entry) => entry.url === void 0 !== (entry.conversationId === void 0), "Evidence has a `url` or a `conversationId`, not both.");
872
+ const cacheHealthDataSchema = z.object({
873
+ status: z.literal("ok"),
874
+ window: z.enum(["24h", "7d"]),
875
+ /** The agent model whose calls count. */
876
+ modelId: z.string(),
877
+ /** When Sentry answered. */
878
+ fetchedAt: z.string(),
879
+ /** Sentry rate limited a newer read, so this is an older answer. */
880
+ stale: z.boolean(),
881
+ buckets: z.array(cacheHealthCallsSchema.extend({
882
+ /** UTC bucket start, `YYYY-MM-DDTHH`. */
883
+ start: z.string(),
884
+ fullRewrites: z.number().int().nonnegative()
885
+ })),
886
+ /** The same window a week earlier. */
887
+ lastWeek: cacheHealthCallsSchema,
888
+ warmups: z.object({
889
+ /** Warmup calls by how the Turn before ended, or `tool_wait`. */
890
+ sentByTurnEnding: z.record(z.string(), z.number().int().nonnegative()),
891
+ skipReasons: z.record(z.string(), z.number().int().nonnegative()),
892
+ /** Cost of every warmup call. */
893
+ costUsd: z.number().nonnegative()
894
+ }).strict(),
895
+ /** Idle periods that count, by `IdlePeriodOutcome`. */
896
+ idlePeriods: z.object({
897
+ saved: z.number().int().nonnegative(),
898
+ notWarmed: z.number().int().nonnegative(),
899
+ stoppedEarly: z.number().int().nonnegative(),
900
+ cacheLost: z.number().int().nonnegative(),
901
+ /** Cache writes that the saved periods avoided, less their reads. */
902
+ savedUsd: z.number().nonnegative()
903
+ }).strict(),
904
+ breakers: z.array(cacheWarmingBreakerSchema),
905
+ /** Breaker changes in the window. A close at the end of a pause is not one. */
906
+ breakerEvents: z.object({
907
+ opened: z.number().int().nonnegative(),
908
+ closed: z.number().int().nonnegative()
909
+ }).strict()
910
+ }).strict();
911
+ const cacheHealthReportSchema = z.discriminatedUnion("status", [
912
+ cacheHealthDataSchema,
913
+ z.object({
914
+ status: z.literal("unconfigured"),
915
+ missing: z.array(z.enum([
916
+ "SENTRY_DSN",
917
+ "SENTRY_ORG_SLUG",
918
+ "SENTRY_READ_TOKEN"
919
+ ]))
920
+ }).strict(),
921
+ z.object({ status: z.literal("denied") }).strict(),
922
+ z.object({ status: z.literal("rate_limited") }).strict(),
923
+ z.object({ status: z.literal("busy") }).strict()
924
+ ]);
925
+ // src/api/schema/gateway-providers.ts
926
+ const providerSlugSchema = z.string().regex(/^[a-zA-Z][a-zA-Z0-9-]*$/).max(64);
927
+ /** The "Enabled providers" setting, with what the gateway lists for each model. */
928
+ const gatewayProvidersSchema = z.object({
929
+ /** Null when every provider is enabled. */
930
+ enabled: z.array(z.string()).nullable(),
931
+ /** Every provider that serves one of the models below. */
932
+ providers: z.array(z.string()),
933
+ /** Models that the agent runs, with the providers that serve each. */
934
+ models: z.array(z.object({
935
+ id: z.string(),
936
+ providers: z.array(z.string())
937
+ }).strict())
938
+ }).strict();
939
+ const updateGatewayProvidersBodySchema = z.object({ enabled: z.array(providerSlugSchema).max(100).nullable() }).strict();
940
+ // src/api/schema/inbox-snooze.ts
941
+ const conversationRowSchema = z.object({
942
+ conversationId: z.string().min(1),
943
+ reviewItemId: z.string().min(1).optional()
944
+ }).strict();
945
+ const itemRowSchema = z.object({ reviewItemId: z.string().min(1) }).strict();
814
946
  /**
815
- * The question of a Review item with the evidence for its answer. Evidence
816
- * is part of the question, so it is stored in the `request` column.
947
+ * The Inbox row of a snooze: one Conversation, one item in it, or one item
948
+ * on its own.
817
949
  */
818
- const reviewItemRequestSchema = userInputRequestSchema.safeExtend({ evidence: z.array(reviewItemEvidenceSchema).optional() });
950
+ const inboxSnoozeSubjectSchema = z.union([conversationRowSchema, itemRowSchema]);
951
+ /**
952
+ * An Event that ends a snooze: `wake` shows the item again, and `resolve`
953
+ * dismisses it. The Event is on the page at `resourceUrl`, such as another
954
+ * pull request, or on each item's subject when it is unset.
955
+ */
956
+ const inboxSnoozeTriggerSchema = z.object({
957
+ eventType: z.string().min(1),
958
+ outcome: z.enum(["wake", "resolve"]),
959
+ resourceUrl: z.string().url().max(2e3).optional()
960
+ }).strict();
961
+ /**
962
+ * An Event resource that a snooze can wait on, such as a pull request, and
963
+ * the Event types of its resource type.
964
+ */
965
+ const inboxSnoozeResourceSchema = z.object({
966
+ events: z.array(z.string().min(1)).min(1),
967
+ namespace: z.string().min(1),
968
+ /** How each Event reads after the resource's name, such as "is merged". */
969
+ phrases: z.record(z.string().min(1), z.string().min(1)),
970
+ resourceType: z.string().min(1)
971
+ }).strict();
972
+ /** `GET /api/inbox/snoozes/resource` query: the page that a person names. */
973
+ const inboxSnoozeResourceQuerySchema = z.object({ url: z.string().url().max(2e3) }).strict();
974
+ /**
975
+ * Most triggers in one snooze. It bounds the trigger rows that one request
976
+ * writes for each item, and fits every Event of one page: a GitHub pull
977
+ * request has 13.
978
+ */
979
+ const INBOX_SNOOZE_MAX_TRIGGERS = 30;
980
+ const snoozeUntil = {
981
+ triggers: z.array(inboxSnoozeTriggerSchema).min(1).max(30).optional(),
982
+ wakeAt: z.string().datetime().optional()
983
+ };
984
+ /**
985
+ * `POST /api/inbox/snoozes` body: hide the row's open items from the viewer
986
+ * until `wakeAt` or one of `triggers` fires, whichever is first. A later
987
+ * item in the row shows by itself.
988
+ */
989
+ const inboxSnoozeCreateSchema = z.union([conversationRowSchema.extend(snoozeUntil).strict(), itemRowSchema.extend(snoozeUntil).strict()]).refine((body) => body.wakeAt !== void 0 || body.triggers !== void 0, { message: "Set wakeAt, triggers, or both." });
990
+ /** The items that a snooze hid from the viewer, one snooze each. */
991
+ const inboxSnoozeSchema = z.object({ reviewItemIds: z.array(z.string().min(1)).min(1) }).strict();
819
992
  // src/api/schema/review-item.ts
820
993
  const answerSchema = z.object({
821
994
  other: z.string().max(4e3).optional(),
@@ -823,15 +996,16 @@ const answerSchema = z.object({
823
996
  values: z.record(z.string(), z.array(z.string().max(4e3)).max(20))
824
997
  }).strict();
825
998
  const personSchema = z.object({
999
+ /** Junior API path of the profile photo. */
1000
+ avatarUrl: z.string().min(1).optional(),
826
1001
  displayName: z.string().min(1).optional(),
827
1002
  email: z.string().min(1),
828
1003
  userId: z.string().min(1)
829
1004
  }).strict();
830
1005
  /** One Review item as the viewer sees it. */
831
1006
  const reviewItemSchema = z.object({
832
- addedByConversationId: z.string().min(1),
833
1007
  /**
834
- * Names the Conversation that added the item when it is not
1008
+ * Names the Conversation that owns the item when it is not
835
1009
  * `rootConversationId`, such as a child agent's Thread title.
836
1010
  */
837
1011
  addedByLabel: z.string().min(1).optional(),
@@ -854,6 +1028,17 @@ const reviewItemSchema = z.object({
854
1028
  createdAt: z.string().datetime(),
855
1029
  id: z.string().min(1),
856
1030
  kind: z.enum(["notice", "action"]),
1031
+ /** People that the title, body, and question mention. */
1032
+ mentions: z.array(actorIdentitySchema).optional(),
1033
+ /**
1034
+ * What the item belongs to: the Conversation of the agent or plugin
1035
+ * that added it, or the Automation of an Automation alert. Its kind
1036
+ * decides the item's visibility and where the Inbox stacks it.
1037
+ */
1038
+ owner: z.object({
1039
+ id: z.string().min(1),
1040
+ kind: z.enum(["conversation", "automation"])
1041
+ }).strict(),
857
1042
  /**
858
1043
  * Other open work that the viewer can see on the same subject or linked
859
1044
  * work. Only an open item has it.
@@ -872,11 +1057,12 @@ const reviewItemSchema = z.object({
872
1057
  }).strict().optional(),
873
1058
  request: reviewItemRequestSchema.optional(),
874
1059
  /**
875
- * The top of the item's Conversation tree that the viewer can see, at
876
- * any depth: the Conversation that added the item when it is a root, or
877
- * when the viewer cannot see its root. The Inbox stacks items by it.
1060
+ * The top of the owner Conversation's tree that the viewer can see, at
1061
+ * any depth: the owner when it is a root, or when the viewer cannot see
1062
+ * its root. The Inbox stacks items by it. Unset when the owner is not a
1063
+ * Conversation; then the Inbox stacks items by their owner.
878
1064
  */
879
- rootConversationId: z.string().min(1),
1065
+ rootConversationId: z.string().min(1).optional(),
880
1066
  status: z.enum([
881
1067
  "open",
882
1068
  "done",
@@ -889,6 +1075,12 @@ const reviewItemSchema = z.object({
889
1075
  * `code_change` for a pull request. Unset when none claims it.
890
1076
  */
891
1077
  objectType: objectTypeSchema.optional(),
1078
+ /**
1079
+ * The Event resource that `url` names, such as a pull request, with
1080
+ * the Event types that can wake or resolve a snooze of the item.
1081
+ * Unset when no Event source claims it.
1082
+ */
1083
+ resource: inboxSnoozeResourceSchema.optional(),
892
1084
  title: z.string().min(1).optional(),
893
1085
  url: z.string().min(1).optional()
894
1086
  }).strict().optional(),
@@ -897,7 +1089,7 @@ const reviewItemSchema = z.object({
897
1089
  visibility: z.enum(["public", "private"])
898
1090
  }).strict();
899
1091
  /**
900
- * Review desk list filters. The list has the open items that the viewer can
1092
+ * Inbox list filters. The list has the open items that the viewer can
901
1093
  * see, one page at a time. A search or `include=archived` also finds done and
902
1094
  * dismissed items, after the open ones. `status` lists closed items instead,
903
1095
  * with the same visibility.
@@ -911,6 +1103,13 @@ const reviewItemListQuerySchema = z.object({
911
1103
  * list keeps items assigned to the viewer, to Everyone, or to no one.
912
1104
  */
913
1105
  for: z.enum(["viewer"]).optional(),
1106
+ /** `automation` lists only Automation alerts. */
1107
+ owner: z.enum(["automation"]).optional(),
1108
+ /**
1109
+ * `true` lists only the open items in Inbox rows that the viewer
1110
+ * snoozed, the Snoozed view. Without it, `for=viewer` hides them.
1111
+ */
1112
+ snoozed: z.enum(["true"]).optional(),
914
1113
  /** The number of open items on one page. */
915
1114
  limit: z.coerce.number().int().min(1).max(100).default(50),
916
1115
  /** Also list the newest done and dismissed items, with the first page. */
@@ -933,7 +1132,7 @@ const reviewItemListQuerySchema = z.object({
933
1132
  ])).refine((statuses) => !statuses.includes("open") || statuses.length === 1, "List open items on their own."))
934
1133
  }).strict();
935
1134
  /**
936
- * One page of the review desk list. Open items come first, oldest first.
1135
+ * One page of the Inbox list. Open items come first, oldest first.
937
1136
  * The first page of a search, or of a list that includes archived items,
938
1137
  * also has the newest archived matches.
939
1138
  */
@@ -945,23 +1144,22 @@ const reviewItemListSchema = z.object({
945
1144
  nextCursor: z.string().min(1).optional()
946
1145
  }).strict();
947
1146
  /** `GET /api/review-items/count` query. */
948
- const reviewItemCountQuerySchema = z.object({
949
- /** `automations` also counts the viewer's Automations that need attention. */
950
- include: z.enum(["automations"]).optional(),
951
- /**
952
- * The newest item of each snoozed Inbox row, comma separated. Snoozes
953
- * live in the browser, so the server counts only the ids it is given.
954
- */
955
- snoozed: z.string().default("").transform((value) => [...new Set(value.split(",").filter(Boolean))]).pipe(z.array(z.string().min(1).max(200)).max(100))
956
- }).strict();
1147
+ const reviewItemCountQuerySchema = z.object({
1148
+ /**
1149
+ * Extra counts, comma separated. `automations` counts the viewer's
1150
+ * Automations that need attention, and `snoozed` their snoozed rows.
1151
+ */
1152
+ include: z.string().default("").transform((value) => [...new Set(value.split(",").filter(Boolean))]).pipe(z.array(z.enum(["automations", "snoozed"]))) }).strict();
957
1153
  /**
958
- * The counts behind the Inbox badge, which shows the sum of `needsViewer`
959
- * and `automations`, and behind the Inbox entries.
1154
+ * The counts behind the Inbox badge, which shows `needsViewer`, and behind
1155
+ * the Inbox entries. An Automation alert is a Review item, so
1156
+ * `needsViewer` counts it.
960
1157
  */
961
1158
  const reviewItemCountSchema = z.object({
962
1159
  /**
963
- * The viewer's own Automations that need attention, as the Inbox lists
964
- * them (`scope=attention&owner=me`). Only with `include=automations`.
1160
+ * The viewer's own Automations that need attention, as the Automations
1161
+ * entry counts them (`scope=attention&owner=me`). Only with
1162
+ * `include=automations`.
965
1163
  */
966
1164
  automations: z.number().int().nonnegative().optional(),
967
1165
  /** The `needsViewer` items whose subject is a code change. */
@@ -973,7 +1171,10 @@ const reviewItemCountSchema = z.object({
973
1171
  * (`reviewItemNeedsUser`). Notices and items for Everyone do not count.
974
1172
  */
975
1173
  needsViewer: z.number().int().nonnegative(),
976
- /** The `snoozed` ids that are open and listed for the viewer. */
1174
+ /**
1175
+ * The Inbox rows that the viewer snoozed and that still have an open
1176
+ * item for them, as Snoozed lists them. 0 without `include=snoozed`.
1177
+ */
977
1178
  snoozed: z.number().int().nonnegative()
978
1179
  }).strict();
979
1180
  /**
@@ -1062,9 +1263,14 @@ const statsReportSchema = z.object({
1062
1263
  windowStart: z.string()
1063
1264
  }).strict();
1064
1265
  // src/api/schema/versions.ts
1266
+ /** The most Conversations that one versions read gives tokens for. */
1267
+ const VERSIONS_CONVERSATION_LIMIT = 50;
1065
1268
  const versionsQuerySchema = z.object({
1066
- /** The open Conversation, whose token comes back as `conversation`. */
1067
- conversationId: z.string().min(1).optional() }).strict();
1269
+ /**
1270
+ * The Conversations on screen, comma separated. Their tokens come back
1271
+ * in `conversationDetails`.
1272
+ */
1273
+ conversationIds: z.string().default("").transform((value) => [...new Set(value.split(",").filter(Boolean))]).pipe(z.array(z.string().min(1).max(200)).max(50)) }).strict();
1068
1274
  /**
1069
1275
  * Opaque change tokens for the dashboard reads that refresh by themselves.
1070
1276
  * A token changes when the read it covers can change. Compare a token only
@@ -1072,11 +1278,11 @@ conversationId: z.string().min(1).optional() }).strict();
1072
1278
  */
1073
1279
  const versionsSchema = z.object({
1074
1280
  /**
1075
- * Tree token of the requested Conversation, the same value as the
1076
- * detail report's `CONVERSATION_VERSION_HEADER`. Missing when it does
1077
- * not exist.
1281
+ * Tree token of each requested Conversation by id, the same value as
1282
+ * its detail report's `CONVERSATION_VERSION_HEADER`. A Conversation
1283
+ * that does not exist has no entry.
1078
1284
  */
1079
- conversation: z.string().min(1).optional(),
1285
+ conversationDetails: z.record(z.string(), z.string().min(1)),
1080
1286
  /**
1081
1287
  * The viewer's Conversation feed. It lists a short token for each
1082
1288
  * feed-row input as `name:token`, separated by spaces, so the dashboard
@@ -1088,4 +1294,4 @@ const versionsSchema = z.object({
1088
1294
  /** The viewer's rolling model spend. */
1089
1295
  spend: z.string().min(1)
1090
1296
  }).strict();
1091
- export { testNotificationResponseSchema as $, startServiceAccountSignInResponseSchema as A, objectLinksReportSchema as At, personParamsSchema as B, conversationSubscriptionResponseSchema as Bt, cacheWarmingSavingsRefillResponseSchema as C, conversationChildAgentsReportSchema as Ct, serviceAccountListSchema as D, attachObjectLinkBodySchema as Dt, disconnectServiceAccountResponseSchema as E, MAX_OBJECT_LINKS as Et, personalTokenParamsSchema as F, archiveConversationBodySchema as Ft, locationParamsSchema as G, reorderPinnedConversationsBodySchema as Gt, locationActivityDayReportSchema as H, conversationDeliveryResponseSchema as Ht, revokePersonalTokenResponseSchema as I, archiveConversationResponseSchema as It, activitySixHours as J, conversationCatchUpSchema as Jt, activityDays as K, reorderPinnedConversationsResponseSchema as Kt, actorDirectoryReportSchema as L, archiveDoneConversationsResponseSchema as Lt, createdPersonalTokenSchema as M, conversationStatsReportSchema as Mt, personalTokenListSchema as N, CONVERSATION_OUTLINE_TEXT_LENGTH as Nt, serviceAccountParamsSchema as O, attachObjectLinkResponseSchema as Ot, personalTokenMetadataSchema as P, conversationOutlineSchema as Pt, pushSubscriptionDeleteBodySchema as Q, actorProfileReportSchema as R, conversationAutoArchiveSchema as Rt, cacheWarmingSavingsQuerySchema as S, conversationChildAgentSchema as St, closeCacheWarmingBreakerResponseSchema as T, continueConversationInSlackResponseSchema as Tt, locationDetailReportSchema as U, pinConversationBodySchema as Ut, personalSpendReportSchema as V, conversationDeliveryBodySchema as Vt, locationDirectoryReportSchema as W, pinConversationResponseSchema as Wt, notificationSettingsSchema as X, attachmentUploadSchema as Xt, dailyConversationActivitySchema as Y, attachmentUploadParamsSchema as Yt, pushSubscriptionBodySchema as Z, createAttachmentUploadBodySchema as Zt, reviewItemParamsSchema as _, conversationPlanReportSchema as _t, baselineSnapshotSchema as a, IDLE_CHANGE_DAYS as at, cacheWarmingBreakerListSchema as b, conversationWatchSchema 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, conversationPlanItemSchema as gt, reviewItemListQuerySchema as h, personCodeQuerySchema as ht, statsReportSchema as i, startConnectionResponseSchema as it, createPersonalTokenBodySchema as j, stopConversationTurnResponseSchema as jt, serviceAccountSchema as k, objectLinksQuerySchema 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, conversationCatchUpBodySchema 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, planItemParamsSchema as vt, cacheWarmingSavingsReportSchema as w, continueConversationInSlackBodySchema as wt, cacheWarmingBreakerParamsSchema as x, conversationWatchesReportSchema as xt, reviewItemWaitingConversationsSchema as y, planItemStatusBodySchema as yt, avatarParamsSchema as z, conversationSubscriptionBodySchema as zt };
1297
+ export { peopleSearchQuerySchema as $, CONVERSATION_OUTLINE_TEXT_LENGTH as $t, cacheHealthReportSchema as A, codeRepositoryQuerySchema as At, serviceAccountSchema as B, conversationWatchesReportSchema as Bt, inboxSnoozeResourceQuerySchema as C, codeChangeSearchQuerySchema as Ct, gatewayProvidersSchema as D, codeOverviewReportSchema as Dt, inboxSnoozeSubjectSchema as E, codeChangeSummarySchema as Et, cacheWarmingSavingsReportSchema as F, conversationPlanItemSchema as Ft, personalTokenMetadataSchema as G, continueConversationInSlackResponseSchema as Gt, createPersonalTokenBodySchema as H, conversationChildAgentSchema as Ht, closeCacheWarmingBreakerResponseSchema as I, conversationPlanReportSchema as It, PERSON_CARD_RECENT_LIMIT as J, attachObjectLinkResponseSchema as Jt, personalTokenParamsSchema as K, MAX_OBJECT_LINKS as Kt, disconnectServiceAccountResponseSchema as L, planItemParamsSchema as Lt, cacheWarmingBreakerParamsSchema as M, codeRepositorySummarySchema as Mt, cacheWarmingSavingsQuerySchema as N, mentionableCodeChangeSchema as Nt, updateGatewayProvidersBodySchema as O, codePersonReportSchema as Ot, cacheWarmingSavingsRefillResponseSchema as P, personCodeQuerySchema as Pt, mentionablePersonSchema as Q, conversationStatsReportSchema as Qt, serviceAccountListSchema as R, planItemStatusBodySchema as Rt, inboxSnoozeCreateSchema as S, codeActivityDaySchema as St, inboxSnoozeSchema as T, codeChangeSummaryReportSchema as Tt, createdPersonalTokenSchema as U, conversationChildAgentsReportSchema as Ut, startServiceAccountSignInResponseSchema as V, watchParamsSchema as Vt, personalTokenListSchema as W, continueConversationInSlackBodySchema as Wt, actorProfileReportSchema as X, objectLinksReportSchema as Xt, actorDirectoryReportSchema as Y, objectLinksQuerySchema as Yt, avatarParamsSchema as Z, stopConversationTurnResponseSchema as Zt, reviewItemListSchema as _, attachmentUploadParamsSchema as _n, connectionParamsSchema as _t, statsReportSchema as a, conversationInviteBodySchema as an, locationDetailReportSchema as at, reviewItemWaitingConversationsSchema as b, startConnectionResponseSchema as bt, workspaceBodySchema as c, conversationSubscriptionResponseSchema as cn, activityDays as ct, workspaceRepoSchema as d, pinConversationBodySchema as dn, dailyConversationActivitySchema as dt, conversationOutlineSchema as en, peopleSearchReportSchema as et, workspaceSchema as f, pinConversationResponseSchema as fn, notificationSettingsSchema as ft, reviewItemListQuerySchema as g, conversationCatchUpSchema as gn, connectionListSchema as gt, reviewItemCountSchema as h, conversationCatchUpBodySchema as hn, testNotificationResponseSchema as ht, statSchema as i, conversationAutoArchiveSchema as in, locationActivityDayReportSchema as it, cacheWarmingBreakerListSchema as j, codeRepositoryReportSchema as jt, cacheHealthQuerySchema as k, codeRepositoryParamsSchema as kt, workspaceListSchema as l, conversationDeliveryBodySchema as ln, activityHours as lt, reviewItemCountQuerySchema as m, reorderPinnedConversationsResponseSchema as mn, pushSubscriptionDeleteBodySchema as mt, versionsQuerySchema as n, archiveConversationResponseSchema as nn, personParamsSchema as nt, baselineSnapshotSchema as o, conversationInviteResponseSchema as on, locationDirectoryReportSchema as ot, reviewItemActionSchema as p, reorderPinnedConversationsBodySchema as pn, pushSubscriptionBodySchema as pt, revokePersonalTokenResponseSchema as q, attachObjectLinkBodySchema as qt, versionsSchema as r, archiveDoneConversationsResponseSchema as rn, personalSpendReportSchema as rt, deleteWorkspaceResponseSchema as s, conversationSubscriptionBodySchema as sn, locationParamsSchema as st, VERSIONS_CONVERSATION_LIMIT as t, archiveConversationBodySchema as tn, personCardReportSchema as tt, workspaceParamsSchema as u, conversationDeliveryResponseSchema as un, activitySixHours as ut, reviewItemParamsSchema as v, attachmentUploadSchema as vn, connectionSchema as vt, inboxSnoozeResourceSchema as w, codeChangeSearchReportSchema as wt, INBOX_SNOOZE_MAX_TRIGGERS as x, IDLE_CHANGE_DAYS as xt, reviewItemSchema as y, createAttachmentUploadBodySchema as yn, disconnectConnectionResponseSchema as yt, serviceAccountParamsSchema as z, conversationWatchSchema as zt };