@sentry/junior 0.270.0 → 0.272.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 (75) hide show
  1. package/dist/{actor-CP9K2Idu.js → actor-B4DYygOB.js} +1 -1
  2. package/dist/{adapter-BQNTKVTF.js → adapter-BDYDi1F9.js} +1 -1
  3. package/dist/{admin-CKVEoXa4.js → admin-Dj7EFycG.js} +1 -1
  4. package/dist/{agent-runner-MSQSMFkq.js → agent-runner-Cl6Usx2Y.js} +336 -280
  5. package/dist/api/schema.d.ts +2 -2
  6. package/dist/api/schema.js +5 -5
  7. package/dist/api.d.ts +1 -1
  8. package/dist/api.js +81 -37
  9. package/dist/{app-Bz8t4P8p.d.ts → app-DjZblE2J.d.ts} +8 -2
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +74 -40
  12. package/dist/{interruption-marker-CdblrIQK.js → assistant-reply-DN2w6JL_.js} +2 -8
  13. package/dist/{automation-Dwh_xcqM.js → automation-CV7g5h3A.js} +1 -1
  14. package/dist/{briefs-DNFzFFVx.js → briefs-PysAqnjV.js} +4 -4
  15. package/dist/{catalog-runtime-Bdym_wKy.js → catalog-runtime-BNeCWIaF.js} +1 -1
  16. package/dist/cli/chat.js +14 -14
  17. package/dist/cli/check.js +3 -3
  18. package/dist/cli/main.js +3 -3
  19. package/dist/cli/plugins.js +4 -4
  20. package/dist/cli/snapshot-create.js +4 -4
  21. package/dist/cli/upgrade.d.ts +1 -1
  22. package/dist/cli/upgrade.js +3 -3
  23. package/dist/{client-B2MjENki.js → client-FRphcDWW.js} +2 -2
  24. package/dist/{config-Dm3pWRqY.js → config-BUP9wjiR.js} +3 -3
  25. package/dist/{connections-0BBhiD-p.js → connections-CesHau9u.js} +10 -10
  26. package/dist/{conversation-AhOVzN_k.js → conversation-BtQzLoK8.js} +12 -1
  27. package/dist/{conversation-privacy-C1pJ89rs.js → conversation-privacy-DiGvA9a3.js} +1 -1
  28. package/dist/{credential-sync-BRiWYs6_.js → credential-sync-D2odJC30.js} +15 -15
  29. package/dist/{credentialed-BeBaJMZ_.js → credentialed-CgTulRDH.js} +33 -26
  30. package/dist/{db-BYOuu6v2.d.ts → db-BPLmOwXf.d.ts} +11 -1
  31. package/dist/{executor-BB6eJkD4.js → executor-DGDpyegI.js} +30 -7
  32. package/dist/instrumentation.js +2 -2
  33. package/dist/{job-queue-DiaXoSDg.js → job-queue-CjB97sii.js} +2 -2
  34. package/dist/{list-BTDRxkOg.js → list-JZUP1yog.js} +37 -53
  35. package/dist/{logging-C6EdT6PP.js → logging-CjkDr-jP.js} +1 -1
  36. package/dist/message-D9y8PKA1.js +186 -0
  37. package/dist/nitro.d.ts +1 -1
  38. package/dist/nitro.js +3 -3
  39. package/dist/{oauth-callback-server-CjFFVGqa.js → oauth-callback-server-02Pej6hj.js} +2 -2
  40. package/dist/{prompt-BPSdXYXV.js → prompt-vfceH0c-.js} +1 -1
  41. package/dist/{registry-CndmkP2P.js → registry-7XgwNgQe.js} +2 -2
  42. package/dist/{reporting-window-DRCi1Ls_.js → reporting-window-DgHgwQB3.js} +6 -1
  43. package/dist/{resolve-BkAA1wH7.js → resolve-CuuxNfWG.js} +3 -3
  44. package/dist/{result-9TJTpuYP.js → result-BRhb6iN1.js} +17 -13
  45. package/dist/{runner-BmKLSyJm.js → runner-DaWCofuS.js} +11 -11
  46. package/dist/{sandbox-egress-signals-CjLaogMo.js → sandbox-egress-signals-Bn6FA1UC.js} +1 -1
  47. package/dist/{schema-WayPSHFu.d.ts → schema-CNjAzYOw.d.ts} +28 -5
  48. package/dist/{schema-DNLJ_MzW.js → schema-D5VLF4NT.js} +13 -9
  49. package/dist/{service-account-DlhYl-Mu.js → service-account-D9vrsi8d.js} +3 -3
  50. package/dist/{service-account-D6e9cVmH.js → service-account-H45LIAG2.js} +3 -3
  51. package/dist/{session-stop-MZRgYqYH.js → session-stop-HKl0ECX0.js} +81 -153
  52. package/dist/{skills-BggTR_ue.js → skills-CsiKu3-g.js} +2 -2
  53. package/dist/{spawn-DmtlcAT_.js → spawn-DqjBxqWh.js} +2 -2
  54. package/dist/{store-BeWGgaMA.js → store-CPF2kzbu.js} +3 -3
  55. package/dist/{store-Byarin7b.js → store-DyVKH0QB.js} +47 -30
  56. package/dist/{task-queue-Dt1_ZoI_.js → task-queue-BbQXCcNX.js} +3 -3
  57. package/dist/{task-runner-DyKqAPpm.js → task-runner-ChzW5E7R.js} +7 -7
  58. package/dist/{thread-state-BHBLMvgb.js → thread-state-Ds8JTsX6.js} +5 -5
  59. package/dist/{turn-failure-response-DWXy_0oJ.js → turn-failure-response-DCMvjsA0.js} +15 -10
  60. package/dist/{turn-lifecycle-AiXkVqCB.js → turn-lifecycle-DM_77q33.js} +1 -1
  61. package/dist/{turn-session-routing-B9KLBhaT.js → turn-session-routing-BV_gX7n3.js} +13 -13
  62. package/dist/{validation-BW60Vtx_.js → validation-DcGelbBi.js} +1 -1
  63. package/dist/{version-CivPYmkH.js → version-C48azPKq.js} +1 -1
  64. package/dist/version.js +1 -1
  65. package/dist/{viewer-BTgAfdUg.js → viewer-BCRuO8Wg.js} +26 -10
  66. package/dist/{work-Bjm52fHo.js → work-zxkmbJAp.js} +27 -11
  67. package/dist/{worker-CMbgtHLu.js → worker-CNNxHF1V.js} +6 -6
  68. package/migrations/0071_review_item_turn.sql +1 -0
  69. package/migrations/0072_conversation_read_positions.sql +10 -0
  70. package/migrations/meta/0071_snapshot.json +4003 -0
  71. package/migrations/meta/0072_snapshot.json +4064 -0
  72. package/migrations/meta/_journal.json +14 -0
  73. package/package.json +4 -4
  74. package/dist/message-DsjiWRVg.js +0 -59
  75. package/migrations/AGENTS.md +0 -17
@@ -40,6 +40,7 @@ declare const userInputFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
40
40
  options: z.ZodArray<z.ZodObject<{
41
41
  label: z.ZodString;
42
42
  description: z.ZodOptional<z.ZodString>;
43
+ recommended: z.ZodOptional<z.ZodBoolean>;
43
44
  }, z.core.$strip>>;
44
45
  }, z.core.$strip>, z.ZodObject<{
45
46
  id: z.ZodString;
@@ -49,6 +50,7 @@ declare const userInputFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
49
50
  options: z.ZodArray<z.ZodObject<{
50
51
  label: z.ZodString;
51
52
  description: z.ZodOptional<z.ZodString>;
53
+ recommended: z.ZodOptional<z.ZodBoolean>;
52
54
  }, z.core.$strip>>;
53
55
  }, z.core.$strip>, z.ZodObject<{
54
56
  id: z.ZodString;
@@ -66,6 +68,7 @@ declare const userInputRequestSchema: z.ZodObject<{
66
68
  options: z.ZodArray<z.ZodObject<{
67
69
  label: z.ZodString;
68
70
  description: z.ZodOptional<z.ZodString>;
71
+ recommended: z.ZodOptional<z.ZodBoolean>;
69
72
  }, z.core.$strip>>;
70
73
  }, z.core.$strip>, z.ZodObject<{
71
74
  id: z.ZodString;
@@ -75,6 +78,7 @@ declare const userInputRequestSchema: z.ZodObject<{
75
78
  options: z.ZodArray<z.ZodObject<{
76
79
  label: z.ZodString;
77
80
  description: z.ZodOptional<z.ZodString>;
81
+ recommended: z.ZodOptional<z.ZodBoolean>;
78
82
  }, z.core.$strip>>;
79
83
  }, z.core.$strip>, z.ZodObject<{
80
84
  id: z.ZodString;
@@ -1725,6 +1729,9 @@ declare const conversationDetailReportSchema: z.ZodObject<{
1725
1729
  label: z.ZodString;
1726
1730
  }, z.core.$strict>>>;
1727
1731
  canFork: z.ZodOptional<z.ZodBoolean>;
1732
+ readPosition: z.ZodOptional<z.ZodObject<{
1733
+ lastReadSeq: z.ZodNumber;
1734
+ }, z.core.$strict>>;
1728
1735
  forkedFromConversationId: z.ZodOptional<z.ZodString>;
1729
1736
  forkedFromTitle: z.ZodOptional<z.ZodString>;
1730
1737
  forks: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -2876,6 +2883,17 @@ declare const stopConversationTurnResponseSchema: z.ZodObject<{
2876
2883
  }, z.core.$strict>>;
2877
2884
  }, z.core.$strict>;
2878
2885
  type StopConversationTurnResponse = z.infer<typeof stopConversationTurnResponseSchema>;
2886
+ /**
2887
+ * How far the signed-in viewer has read a Conversation transcript.
2888
+ *
2889
+ * `lastReadSeq` is the event sequence of the last transcript row the viewer
2890
+ * saw. The server keeps the highest value it receives, so it only moves
2891
+ * forward.
2892
+ */
2893
+ declare const conversationReadPositionSchema: z.ZodObject<{
2894
+ lastReadSeq: z.ZodNumber;
2895
+ }, z.core.$strict>;
2896
+ type ConversationReadPosition = z.infer<typeof conversationReadPositionSchema>;
2879
2897
  /**
2880
2898
  * One direct child agent of a Conversation, from agent invocation records.
2881
2899
  *
@@ -5767,6 +5785,7 @@ type PluginOperationalReportFeed = z.infer<typeof pluginOperationalReportFeedSch
5767
5785
  /** One Review item as the viewer sees it. */
5768
5786
  declare const reviewItemSchema: z.ZodObject<{
5769
5787
  addedByConversationId: z.ZodString;
5788
+ addedByTurnId: z.ZodOptional<z.ZodString>;
5770
5789
  answer: z.ZodOptional<z.ZodObject<{
5771
5790
  other: z.ZodOptional<z.ZodString>;
5772
5791
  requestId: z.ZodString;
@@ -5806,6 +5825,7 @@ declare const reviewItemSchema: z.ZodObject<{
5806
5825
  options: z.ZodArray<z.ZodObject<{
5807
5826
  label: z.ZodString;
5808
5827
  description: z.ZodOptional<z.ZodString>;
5828
+ recommended: z.ZodOptional<z.ZodBoolean>;
5809
5829
  }, z.core.$strip>>;
5810
5830
  }, z.core.$strip>, z.ZodObject<{
5811
5831
  id: z.ZodString;
@@ -5815,6 +5835,7 @@ declare const reviewItemSchema: z.ZodObject<{
5815
5835
  options: z.ZodArray<z.ZodObject<{
5816
5836
  label: z.ZodString;
5817
5837
  description: z.ZodOptional<z.ZodString>;
5838
+ recommended: z.ZodOptional<z.ZodBoolean>;
5818
5839
  }, z.core.$strip>>;
5819
5840
  }, z.core.$strip>, z.ZodObject<{
5820
5841
  id: z.ZodString;
@@ -5842,12 +5863,14 @@ declare const reviewItemSchema: z.ZodObject<{
5842
5863
  }, z.core.$strict>;
5843
5864
  type ReviewItemPayload = z.output<typeof reviewItemSchema>;
5844
5865
  /**
5845
- * One page of the review desk list. Open items come first, newest change
5846
- * first. The first page of a search also has the newest archived matches.
5866
+ * One page of the review desk list. Open items come first, oldest first.
5867
+ * The first page of a search, or of a list that includes archived items,
5868
+ * also has the newest archived matches.
5847
5869
  */
5848
5870
  declare const reviewItemListSchema: z.ZodObject<{
5849
5871
  items: z.ZodArray<z.ZodObject<{
5850
5872
  addedByConversationId: z.ZodString;
5873
+ addedByTurnId: z.ZodOptional<z.ZodString>;
5851
5874
  answer: z.ZodOptional<z.ZodObject<{
5852
5875
  other: z.ZodOptional<z.ZodString>;
5853
5876
  requestId: z.ZodString;
@@ -5887,6 +5910,7 @@ declare const reviewItemListSchema: z.ZodObject<{
5887
5910
  options: z.ZodArray<z.ZodObject<{
5888
5911
  label: z.ZodString;
5889
5912
  description: z.ZodOptional<z.ZodString>;
5913
+ recommended: z.ZodOptional<z.ZodBoolean>;
5890
5914
  }, z.core.$strip>>;
5891
5915
  }, z.core.$strip>, z.ZodObject<{
5892
5916
  id: z.ZodString;
@@ -5896,6 +5920,7 @@ declare const reviewItemListSchema: z.ZodObject<{
5896
5920
  options: z.ZodArray<z.ZodObject<{
5897
5921
  label: z.ZodString;
5898
5922
  description: z.ZodOptional<z.ZodString>;
5923
+ recommended: z.ZodOptional<z.ZodBoolean>;
5899
5924
  }, z.core.$strip>>;
5900
5925
  }, z.core.$strip>, z.ZodObject<{
5901
5926
  id: z.ZodString;
@@ -5935,8 +5960,6 @@ declare const reviewItemWaitingConversationsSchema: z.ZodObject<{
5935
5960
  /** One person action on a Review item. */
5936
5961
  declare const reviewItemActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
5937
5962
  action: z.ZodLiteral<"take">;
5938
- }, z.core.$strict>, z.ZodObject<{
5939
- action: z.ZodLiteral<"complete">;
5940
5963
  }, z.core.$strict>, z.ZodObject<{
5941
5964
  action: z.ZodLiteral<"dismiss">;
5942
5965
  }, z.core.$strict>, z.ZodObject<{
@@ -5947,4 +5970,4 @@ declare const reviewItemActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
5947
5970
  }, z.core.$strict>;
5948
5971
  }, z.core.$strict>], "action">;
5949
5972
  type ReviewItemActionBody = z.output<typeof reviewItemActionSchema>;
5950
- export { automationExecutionStatusDaySchema as $, ConversationReportEvent as $n, codePersonReportSchema as $r, LocationSummaryReport as $t, StatsReport as A, ConversationStatsReport as An, conversationPendingMessageSchema as Ar, createPersonalTokenBodySchema as At, AutomationRun as B, ConversationActivityPreview as Bn, steerConversationPendingMessagesResponseSchema as Br, startServiceAccountSignInResponseSchema as Bt, pluginPackageContentReportSchema as C, INPUT_IMAGE_TYPES as Ci, ConversationChildAgentsReport as Cn, conversationEventPageSchema as Cr, workspaceListSchema as Ct, skillReportSchema as D, stopConversationTurnResponseSchema as Dn, conversationParamsSchema as Dr, USER_CUSTOMIZATION_MAX_CHARS as Dt, runtimeInfoReportSchema as E, StopConversationTurnResponse as En, conversationFeedSchema as Er, workspaceSchema as Et, AutomationExecutionDay as F, ActorIdentity as Fn, createConversationBodySchema as Fr, revokePersonalTokenResponseSchema as Ft, AutomationUpdate as G, ConversationEventHistory as Gn, CodeOverviewReport as Gr, startConnectionResponseSchema as Gt, AutomationRunWindows as H, ConversationAuxiliaryCosts as Hn, conversationTurnFailureReasonSchema as Hr, connectionParamsSchema as Ht, AutomationExecutionList as I, ArchiveConversationBody as In, createConversationMessageBodySchema as Ir, disconnectServiceAccountResponseSchema as It, automationEditErrorSchema as J, ConversationModelUsage as Jn, CodeRepositorySummary as Jr, LocationActivityDayReport as Jt, AutomationVersionList as K, ConversationEventPage as Kn, CodePersonReport as Kr, ApiError as Kt, AutomationExecutionStatusDay as L, ArchiveConversationResponse as Ln, forkConversationBodySchema as Lr, serviceAccountListSchema as Lt, statsReportSchema as M, GuardianStats as Mn, conversationReportEventDataSchema as Mr, personalTokenListSchema as Mt, AutomationEdit as N, conversationStatsReportSchema as Nn, conversationReportEventSchema as Nr, personalTokenMetadataSchema as Nt, skillReportsSchema as O, ConversationMetricDay as On, conversationPendingAuthorizationSchema as Or, userCustomizationSchema as Ot, AutomationExecution as P, AcceptedConversationMessage as Pn, conversationSummaryReportSchema as Pr, personalTokenParamsSchema as Pt, automationExecutionSchema as Q, ConversationPendingMessagesReport as Qn, codeOverviewReportSchema as Qr, LocationParams as Qt, AutomationList as R, CancelConversationPendingMessagesBody as Rn, forkConversationResponseSchema as Rr, serviceAccountParamsSchema as Rt, pluginPackageContentItemReportSchema as S, MessageAttachment as Si, ConversationChildAgent as Sn, conversationEventHistorySchema as Sr, workspaceBodySchema as St, pluginsSchema as T, conversationChildAgentsReportSchema as Tn, conversationFeedQuerySchema as Tr, workspaceRepoSchema as Tt, AutomationScheduleIntent as U, ConversationCost as Un, CodeActivityDay as Ur, connectionSchema as Ut, AutomationRunList as V, ConversationAgentTreeNode as Vn, conversationTurnFailureCodeSchema as Vr, connectionListSchema as Vt, AutomationSummary as W, ConversationDetailReport as Wn, CodeChangeSummaryReport as Wr, disconnectConnectionResponseSchema as Wt, automationEventCatalogSchema as X, ConversationPendingMessage as Xn, codeChangeSummaryReportSchema as Xr, LocationDetailReport as Xt, automationEditSchema as Y, ConversationParams as Yn, codeActivityDaySchema as Yr, LocationActorSummaryReport as Yt, automationExecutionListSchema as Z, ConversationPendingMessageDelivery as Zn, codeChangeSummarySchema as Zr, LocationDirectoryReport as Zt, SkillReport as _, normalizeUserInputAnswer as _i, personalSpendReportSchema as _n, cancelConversationPendingMessagesResponseSchema as _r, BaselineSnapshotReport as _t, reviewItemCountSchema as a, DailyConversationActivity as ai, ActorDirectoryReport as an, ConversationSurface as ar, automationRunSchema as at, pluginOperationalReportFeedSchema as b, MAX_INPUT_IMAGES as bi, conversationWatchSchema as bn, conversationDetailQuerySchema as br, baselineSnapshotSchema as bt, reviewItemWaitingConversationsSchema as c, messageCardText as ci, ActorSummaryReport as cn, ConversationUsage as cr, automationSchedulePreviewSchema as ct, PluginOperationalReport as d, USER_INPUT_NOTE as di, PeopleActivityDayReport as dn, SteerConversationPendingMessagesBody as dr, automationVersionActivateSchema as dt, codeRepositoryParamsSchema as ei, locationActivityDayReportSchema as en, ConversationReportEventData as er, automationExecutionStatusSchema as et, PluginOperationalReportFeed as f, UserInputAnswer as fi, PersonParams as fn, SteerConversationPendingMessagesResponse as fr, automationVersionListSchema as ft, RuntimeInfoReport as g, isEmptyUserInputAnswer as gi, personParamsSchema as gn, cancelConversationPendingMessagesBodySchema as gr, scheduledAutomationSummarySchema as gt, Plugins as h, buttonUserInputField as hi, actorProfileReportSchema as hn, archiveConversationResponseSchema as hr, eventAutomationSummarySchema as ht, reviewItemActionSchema as i, conversationChildAgentTotalsSchema as ii, ActorActivityDayReport as in, ConversationSummaryReport as ir, automationRunListSchema as it, statSchema as j, GuardianMetricDay as jn, conversationPendingMessagesReportSchema as jr, createdPersonalTokenSchema as jt, StatReport as k, ConversationStatsItem as kn, conversationPendingMessageDeliverySchema as kr, PersonalTokenMetadata as kt, HealthReport as l, resolveMessageCards as li, ActorTotalsReport as ln, CreateConversationBody as lr, automationSummarySchema as lt, PluginPackageContentReport as m, UserInputRequest as mi, actorDirectoryReportSchema as mn, archiveConversationBodySchema as mr, automationVersionSchema as mt, ReviewItemActionBody as n, codeRepositorySummarySchema as ni, locationDirectoryReportSchema as nn, ConversationReportStatus as nr, automationListSchema as nt, reviewItemListSchema as o, dailyConversationActivitySchema as oi, ActorDirectoryWindows as on, ConversationTurnFailureCode as or, automationRunWindowsSchema as ot, PluginPackageContentItemReport as p, UserInputField as pi, PersonalSpendReport as pn, acceptedConversationMessageSchema as pr, automationVersionParamsSchema as pt, ListedAutomationVersion as q, ConversationFeed as qn, CodeRepositoryReport as qr, apiErrorSchema as qt, ReviewItemPayload as r, ConversationChildAgentTotals as ri, locationParamsSchema as rn, ConversationSourceTask as rr, automationParamsSchema as rt, reviewItemSchema as s, MessageCard as si, ActorProfileReport as sn, ConversationTurnFailureReason as sr, automationScheduleIntentSchema as st, OwnedObjectAnnotation$1 as t, codeRepositoryReportSchema as ti, locationDetailReportSchema as tn, ConversationReportMessageEvent as tr, automationListQuerySchema as tt, Plugin as u, AutomationCard as ui, ActorWindowMetrics as un, CreateConversationMessageBody as ur, automationUpdateSchema as ut, SkillReports as v, webMessageId as vi, ConversationWatch as vn, conversationActivityPreviewSchema as vr, WorkspaceListReport as vt, pluginSchema as w, conversationChildAgentSchema as wn, conversationEventsQuerySchema as wr, workspaceParamsSchema as wt, pluginOperationalReportSchema as x, MAX_INPUT_IMAGE_BYTES as xi, conversationWatchesReportSchema as xn, conversationDetailReportSchema as xr, deleteWorkspaceResponseSchema as xt, healthReportSchema as y, InputImage as yi, ConversationWatchesReport as yn, conversationAuxiliaryCostsSchema as yr, WorkspaceReport as yt, AutomationListQuery as z, CancelConversationPendingMessagesResponse as zn, steerConversationPendingMessagesBodySchema as zr, serviceAccountSchema as zt };
5973
+ export { automationExecutionStatusDaySchema as $, ConversationPendingMessageDelivery as $n, codeChangeSummarySchema as $r, LocationSummaryReport as $t, StatsReport as A, ConversationMetricDay as An, conversationPendingAuthorizationSchema as Ar, createPersonalTokenBodySchema as At, AutomationRun as B, CancelConversationPendingMessagesBody as Bn, forkConversationResponseSchema as Br, startServiceAccountSignInResponseSchema as Bt, pluginPackageContentReportSchema as C, MAX_INPUT_IMAGE_BYTES as Ci, ConversationChildAgentsReport as Cn, conversationDetailReportSchema as Cr, workspaceListSchema as Ct, skillReportSchema as D, conversationReadPositionSchema as Dn, conversationFeedQuerySchema as Dr, USER_CUSTOMIZATION_MAX_CHARS as Dt, runtimeInfoReportSchema as E, ConversationReadPosition as En, conversationEventsQuerySchema as Er, workspaceSchema as Et, AutomationExecutionDay as F, conversationStatsReportSchema as Fn, conversationReportEventSchema as Fr, revokePersonalTokenResponseSchema as Ft, AutomationUpdate as G, ConversationCost as Gn, CodeActivityDay as Gr, startConnectionResponseSchema as Gt, AutomationRunWindows as H, ConversationActivityPreview as Hn, steerConversationPendingMessagesResponseSchema as Hr, connectionParamsSchema as Ht, AutomationExecutionList as I, AcceptedConversationMessage as In, conversationSummaryReportSchema as Ir, disconnectServiceAccountResponseSchema as It, automationEditErrorSchema as J, ConversationEventPage as Jn, CodePersonReport as Jr, LocationActivityDayReport as Jt, AutomationVersionList as K, ConversationDetailReport as Kn, CodeChangeSummaryReport as Kr, ApiError as Kt, AutomationExecutionStatusDay as L, ActorIdentity as Ln, createConversationBodySchema as Lr, serviceAccountListSchema as Lt, statsReportSchema as M, ConversationStatsReport as Mn, conversationPendingMessageSchema as Mr, personalTokenListSchema as Mt, AutomationEdit as N, GuardianMetricDay as Nn, conversationPendingMessagesReportSchema as Nr, personalTokenMetadataSchema as Nt, skillReportsSchema as O, StopConversationTurnResponse as On, conversationFeedSchema as Or, userCustomizationSchema as Ot, AutomationExecution as P, GuardianStats as Pn, conversationReportEventDataSchema as Pr, personalTokenParamsSchema as Pt, automationExecutionSchema as Q, ConversationPendingMessage as Qn, codeChangeSummaryReportSchema as Qr, LocationParams as Qt, AutomationList as R, ArchiveConversationBody as Rn, createConversationMessageBodySchema as Rr, serviceAccountParamsSchema as Rt, pluginPackageContentItemReportSchema as S, MAX_INPUT_IMAGES as Si, ConversationChildAgent as Sn, conversationDetailQuerySchema as Sr, workspaceBodySchema as St, pluginsSchema as T, INPUT_IMAGE_TYPES as Ti, conversationChildAgentsReportSchema as Tn, conversationEventPageSchema as Tr, workspaceRepoSchema as Tt, AutomationScheduleIntent as U, ConversationAgentTreeNode as Un, conversationTurnFailureCodeSchema as Ur, connectionSchema as Ut, AutomationRunList as V, CancelConversationPendingMessagesResponse as Vn, steerConversationPendingMessagesBodySchema as Vr, connectionListSchema as Vt, AutomationSummary as W, ConversationAuxiliaryCosts as Wn, conversationTurnFailureReasonSchema as Wr, disconnectConnectionResponseSchema as Wt, automationEventCatalogSchema as X, ConversationModelUsage as Xn, CodeRepositorySummary as Xr, LocationDetailReport as Xt, automationEditSchema as Y, ConversationFeed as Yn, CodeRepositoryReport as Yr, LocationActorSummaryReport as Yt, automationExecutionListSchema as Z, ConversationParams as Zn, codeActivityDaySchema as Zr, LocationDirectoryReport as Zt, SkillReport as _, buttonUserInputField as _i, personalSpendReportSchema as _n, archiveConversationResponseSchema as _r, BaselineSnapshotReport as _t, reviewItemCountSchema as a, ConversationChildAgentTotals as ai, ActorDirectoryReport as an, ConversationSourceTask as ar, automationRunSchema as at, pluginOperationalReportFeedSchema as b, webMessageId as bi, conversationWatchSchema as bn, conversationActivityPreviewSchema as br, baselineSnapshotSchema as bt, reviewItemWaitingConversationsSchema as c, dailyConversationActivitySchema as ci, ActorSummaryReport as cn, ConversationTurnFailureCode as cr, automationSchedulePreviewSchema as ct, PluginOperationalReport as d, resolveMessageCards as di, PeopleActivityDayReport as dn, CreateConversationBody as dr, automationVersionActivateSchema as dt, codeOverviewReportSchema as ei, locationActivityDayReportSchema as en, ConversationPendingMessagesReport as er, automationExecutionStatusSchema as et, PluginOperationalReportFeed as f, AutomationCard as fi, PersonParams as fn, CreateConversationMessageBody as fr, automationVersionListSchema as ft, RuntimeInfoReport as g, UserInputRequest as gi, personParamsSchema as gn, archiveConversationBodySchema as gr, scheduledAutomationSummarySchema as gt, Plugins as h, UserInputField as hi, actorProfileReportSchema as hn, acceptedConversationMessageSchema as hr, eventAutomationSummarySchema as ht, reviewItemActionSchema as i, codeRepositorySummarySchema as ii, ActorActivityDayReport as in, ConversationReportStatus as ir, automationRunListSchema as it, statSchema as j, ConversationStatsItem as jn, conversationPendingMessageDeliverySchema as jr, createdPersonalTokenSchema as jt, StatReport as k, stopConversationTurnResponseSchema as kn, conversationParamsSchema as kr, PersonalTokenMetadata as kt, HealthReport as l, MessageCard as li, ActorTotalsReport as ln, ConversationTurnFailureReason as lr, automationSummarySchema as lt, PluginPackageContentReport as m, UserInputAnswer as mi, actorDirectoryReportSchema as mn, SteerConversationPendingMessagesResponse as mr, automationVersionSchema as mt, ReviewItemActionBody as n, codeRepositoryParamsSchema as ni, locationDirectoryReportSchema as nn, ConversationReportEventData as nr, automationListSchema as nt, reviewItemListSchema as o, conversationChildAgentTotalsSchema as oi, ActorDirectoryWindows as on, ConversationSummaryReport as or, automationRunWindowsSchema as ot, PluginPackageContentItemReport as p, USER_INPUT_NOTE as pi, PersonalSpendReport as pn, SteerConversationPendingMessagesBody as pr, automationVersionParamsSchema as pt, ListedAutomationVersion as q, ConversationEventHistory as qn, CodeOverviewReport as qr, apiErrorSchema as qt, ReviewItemPayload as r, codeRepositoryReportSchema as ri, locationParamsSchema as rn, ConversationReportMessageEvent as rr, automationParamsSchema as rt, reviewItemSchema as s, DailyConversationActivity as si, ActorProfileReport as sn, ConversationSurface as sr, automationScheduleIntentSchema as st, OwnedObjectAnnotation$1 as t, codePersonReportSchema as ti, locationDetailReportSchema as tn, ConversationReportEvent as tr, automationListQuerySchema as tt, Plugin as u, messageCardText as ui, ActorWindowMetrics as un, ConversationUsage as ur, automationUpdateSchema as ut, SkillReports as v, isEmptyUserInputAnswer as vi, ConversationWatch as vn, cancelConversationPendingMessagesBodySchema as vr, WorkspaceListReport as vt, pluginSchema as w, MessageAttachment as wi, conversationChildAgentSchema as wn, conversationEventHistorySchema as wr, workspaceParamsSchema as wt, pluginOperationalReportSchema as x, InputImage as xi, conversationWatchesReportSchema as xn, conversationAuxiliaryCostsSchema as xr, deleteWorkspaceResponseSchema as xt, healthReportSchema as y, normalizeUserInputAnswer as yi, ConversationWatchesReport as yn, cancelConversationPendingMessagesResponseSchema as yr, WorkspaceReport as yt, AutomationListQuery as z, ArchiveConversationResponse as zn, forkConversationBodySchema as zr, serviceAccountSchema as zt };
@@ -1,7 +1,7 @@
1
1
  import { r as AGENT_INVOCATION_STATUSES, u as juniorDestinationKindSchema } from "./agent-invocations-C1RNOCs8.js";
2
- import { E as conversationSummaryReportSchema, F as conversationChildAgentTotalsSchema, O as conversationUsageSchema, l as conversationAuxiliaryCostsSchema, n as actorIdentitySchema } from "./conversation-AhOVzN_k.js";
3
- import { i as fillUtcHours, r as fillUtcDays, s as sumUtcHoursIntoSixHours, y as userInputRequestSchema } from "./reporting-window-DRCi1Ls_.js";
4
- import "./automation-Dwh_xcqM.js";
2
+ import { E as conversationSummaryReportSchema, F as conversationChildAgentTotalsSchema, O as conversationUsageSchema, l as conversationAuxiliaryCostsSchema, n as actorIdentitySchema } from "./conversation-BtQzLoK8.js";
3
+ import { i as fillUtcHours, r as fillUtcDays, s as sumUtcHoursIntoSixHours, y as userInputRequestSchema } from "./reporting-window-DgHgwQB3.js";
4
+ import "./automation-CV7g5h3A.js";
5
5
  import "./reporting-schema-CZREhYc-.js";
6
6
  import { z } from "zod";
7
7
  import { codeChangeStateSchema, eventMatchSchema } from "@sentry/junior-plugin-api";
@@ -484,12 +484,14 @@ const personSchema = z.object({
484
484
  /** One Review item as the viewer sees it. */
485
485
  const reviewItemSchema = z.object({
486
486
  addedByConversationId: z.string().min(1),
487
+ /** Turn that added the item. Unset for a plugin item. */
488
+ addedByTurnId: z.string().min(1).optional(),
487
489
  answer: answerSchema.optional(),
488
490
  assignedToEveryone: z.boolean(),
489
491
  assignees: z.array(personSchema),
490
492
  automationId: z.string().min(1).optional(),
491
493
  body: z.string(),
492
- /** True when the viewer can take, submit, complete, or dismiss it. */
494
+ /** True when the viewer can take, submit, or dismiss it. */
493
495
  canAct: z.boolean(),
494
496
  /** True when the viewer can act and is not already the only assignee. */
495
497
  canTake: z.boolean(),
@@ -518,8 +520,8 @@ const reviewItemSchema = z.object({
518
520
  }).strict();
519
521
  /**
520
522
  * Review desk list filters. The list has the open items that the viewer can
521
- * see, one page at a time. A search also finds done and dismissed items,
522
- * after the open ones.
523
+ * see, one page at a time. A search or `include=archived` also finds done and
524
+ * dismissed items, after the open ones.
523
525
  */
524
526
  const reviewItemListQuerySchema = z.object({
525
527
  conversationId: z.string().min(1).optional(),
@@ -527,11 +529,14 @@ const reviewItemListQuerySchema = z.object({
527
529
  cursor: z.string().min(1).max(1e3).optional(),
528
530
  /** The number of open items on one page. */
529
531
  limit: z.coerce.number().int().min(1).max(100).default(50),
532
+ /** Also list the newest done and dismissed items, with the first page. */
533
+ include: z.enum(["archived"]).optional(),
530
534
  q: z.string().trim().max(200).optional()
531
535
  }).strict();
532
536
  /**
533
- * One page of the review desk list. Open items come first, newest change
534
- * first. The first page of a search also has the newest archived matches.
537
+ * One page of the review desk list. Open items come first, oldest first.
538
+ * The first page of a search, or of a list that includes archived items,
539
+ * also has the newest archived matches.
535
540
  */
536
541
  const reviewItemListSchema = z.object({
537
542
  items: z.array(reviewItemSchema),
@@ -553,7 +558,6 @@ const reviewItemParamsSchema = z.object({ id: z.string().min(1) }).strict();
553
558
  /** One person action on a Review item. */
554
559
  const reviewItemActionSchema = z.discriminatedUnion("action", [
555
560
  z.object({ action: z.literal("take") }).strict(),
556
- z.object({ action: z.literal("complete") }).strict(),
557
561
  z.object({ action: z.literal("dismiss") }).strict(),
558
562
  z.object({
559
563
  action: z.literal("submit"),
@@ -1,6 +1,6 @@
1
- import { n as pluginCatalogRuntime } from "./catalog-runtime-Bdym_wKy.js";
2
- import { t as disconnectStateAdapter } from "./adapter-BQNTKVTF.js";
3
- import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-D6e9cVmH.js";
1
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BNeCWIaF.js";
2
+ import { t as disconnectStateAdapter } from "./adapter-BDYDi1F9.js";
3
+ import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-H45LIAG2.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,7 +1,7 @@
1
- import { B as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-C6EdT6PP.js";
2
- import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-CndmkP2P.js";
1
+ import { B as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-CjkDr-jP.js";
2
+ import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-7XgwNgQe.js";
3
3
  import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
4
- import { r as getStateAdapter } from "./adapter-BQNTKVTF.js";
4
+ import { r as getStateAdapter } from "./adapter-BDYDi1F9.js";
5
5
  import { AsyncLocalStorage } from "node:async_hooks";
6
6
  import { randomUUID } from "node:crypto";
7
7
  import { UnauthorizedError, auth } from "@modelcontextprotocol/sdk/client/auth.js";
@@ -1,16 +1,16 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { Cr as isAssistantMessage, Dr as normalizeToolNameFromResult, Er as isToolResultMessage, Tr as isToolResultError, dt as CORE_EVENT_NAMESPACE, ht as eventGuidance, mt as eventCatalogEntry } from "./turn-session-routing-B9KLBhaT.js";
3
- import { n as botConfig } from "./config-Dm3pWRqY.js";
4
- import { h as logWarn, m as logInfo, p as logException } from "./logging-C6EdT6PP.js";
5
- import { C as getSqlExecutor, j as SYSTEM_IDENTITY_ID, x as getConversationStore } from "./viewer-BTgAfdUg.js";
2
+ import { Cr as isAssistantMessage, Dr as normalizeToolNameFromResult, Er as isToolResultMessage, Tr as isToolResultError, dt as CORE_EVENT_NAMESPACE, ht as eventGuidance, mt as eventCatalogEntry } from "./turn-session-routing-BV_gX7n3.js";
3
+ import { n as botConfig } from "./config-BUP9wjiR.js";
4
+ import { h as logWarn, m as logInfo, p as logException } from "./logging-CjkDr-jP.js";
5
+ import { C as getSqlExecutor, j as SYSTEM_IDENTITY_ID, x as getConversationStore } from "./viewer-BCRuO8Wg.js";
6
6
  import { s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
7
- import "./executor-BB6eJkD4.js";
8
- import { h as credentialSubjectSchema } from "./registry-CndmkP2P.js";
9
- import { Et as postSlackMessage, Hn as ToolInputError, In as JUNIOR_THREAD_STATE_TTL_MS, Ln as getDashboardConversationLink, Rn as getDashboardObjectIconLink, Sn as verifyTimerWatchCredentialSubject, gt as normalizeSlackReplyMarkdown, ht as formatSlackLink, l as getPluginSlackConversationLink, mt as escapeSlackMrkdwnText, p as getPlugins, vr as buildSentryConversationUrl } from "./credentialed-BeBaJMZ_.js";
10
- import { r as getStateAdapter } from "./adapter-BQNTKVTF.js";
11
- import { r as EVENT_AUTHOR_ID } from "./prompt-BPSdXYXV.js";
12
- import { i as sanitizeAssistantText, t as getInterruptionMarker } from "./interruption-marker-CdblrIQK.js";
13
- import { r as appendAndEnqueueInboundMessage } from "./store-BeWGgaMA.js";
7
+ import "./executor-DGDpyegI.js";
8
+ import { h as credentialSubjectSchema } from "./registry-7XgwNgQe.js";
9
+ import { Et as postSlackMessage, Hn as ToolInputError, In as JUNIOR_THREAD_STATE_TTL_MS, Ln as getDashboardConversationLink, Rn as getDashboardObjectIconLink, Sn as verifyTimerWatchCredentialSubject, gt as normalizeSlackReplyMarkdown, ht as formatSlackLink, l as getPluginSlackConversationLink, mt as escapeSlackMrkdwnText, p as getPlugins, vr as buildSentryConversationUrl } from "./credentialed-CgTulRDH.js";
10
+ import { r as getStateAdapter } from "./adapter-BDYDi1F9.js";
11
+ import { r as EVENT_AUTHOR_ID } from "./prompt-vfceH0c-.js";
12
+ import { r as sanitizeAssistantText } from "./assistant-reply-DN2w6JL_.js";
13
+ import { r as appendAndEnqueueInboundMessage } from "./store-CPF2kzbu.js";
14
14
  import { z } from "zod";
15
15
  import { eq, inArray } from "drizzle-orm";
16
16
  import { eventMatchFieldsSchema, objectFactFields, objectPresentation, objectTypeSchema } from "@sentry/junior-plugin-api";
@@ -501,44 +501,7 @@ function buildSlackReplyBlocks(text, footer) {
501
501
  return blocks.length ? blocks : void 0;
502
502
  }
503
503
  // src/chat/slack/output.ts
504
- const MAX_INLINE_CHARS = 2200;
505
- const MAX_INLINE_LINES = 45;
506
- const CONTINUED_MARKER = "\n\n[Continued below]";
507
- function countSlackLines(text) {
508
- if (!text) return 0;
509
- return text.split("\n").length;
510
- }
511
- function fitsInlineBudget(text, maxChars = MAX_INLINE_CHARS, maxLines = MAX_INLINE_LINES) {
512
- return text.length <= maxChars && countSlackLines(text) <= maxLines;
513
- }
514
- function findSplitIndex(text, maxChars) {
515
- if (text.length <= maxChars) return text.length;
516
- const bounded = text.slice(0, maxChars);
517
- const newlineIndex = bounded.lastIndexOf("\n");
518
- if (newlineIndex > 0) return newlineIndex;
519
- const spaceIndex = bounded.lastIndexOf(" ");
520
- if (spaceIndex > 0) return spaceIndex;
521
- return maxChars;
522
- }
523
- function splitByLineBudget(text, maxLines) {
524
- if (maxLines <= 0) return "";
525
- const lines = text.split("\n");
526
- if (lines.length <= maxLines) return text;
527
- return lines.slice(0, maxLines).join("\n");
528
- }
529
- function reserveInlineBudgetForSuffix(suffix, maxChars = MAX_INLINE_CHARS, maxLines = MAX_INLINE_LINES) {
530
- return {
531
- maxChars: Math.max(1, maxChars - suffix.length),
532
- maxLines: Math.max(1, maxLines - Math.max(0, countSlackLines(suffix) - 1))
533
- };
534
- }
535
- function forceSplitBudget(text, budget) {
536
- const lineCount = countSlackLines(text);
537
- return {
538
- maxChars: text.length <= budget.maxChars ? Math.max(1, text.length - 1) : budget.maxChars,
539
- maxLines: lineCount <= budget.maxLines ? Math.max(1, lineCount - 1) : budget.maxLines
540
- };
541
- }
504
+ const MAX_INLINE_CHARS = 4e3;
542
505
  function getFenceContinuation(text) {
543
506
  let open;
544
507
  for (const line of text.split("\n")) {
@@ -560,113 +523,52 @@ function getFenceContinuation(text) {
560
523
  reopenPrefix: `${open.openerLine}\n`
561
524
  };
562
525
  }
563
- function appendSlackSuffix(text, marker) {
564
- return `${text}${getFenceContinuation(text)?.closeSuffix ?? ""}${marker}`;
565
- }
566
- function stripTrailingContinuationMarker(text) {
567
- return text.endsWith(CONTINUED_MARKER) ? text.slice(0, -19) : text;
526
+ function findSplitIndex(text, maxChars) {
527
+ const bounded = text.slice(0, maxChars);
528
+ const newlineIndex = bounded.lastIndexOf("\n");
529
+ if (newlineIndex > 0) return newlineIndex;
530
+ const spaceIndex = bounded.lastIndexOf(" ");
531
+ if (spaceIndex > 0) return spaceIndex;
532
+ return maxChars;
568
533
  }
569
- function takeSlackContinuationChunk(text, budget) {
570
- let { prefix, rest } = takeSlackInlinePrefix(text, budget);
571
- if (!rest) ({prefix, rest} = takeSlackInlinePrefix(text, forceSplitBudget(text, budget)));
572
- let carryover = rest ? getFenceContinuation(prefix) : null;
573
- if (!carryover) return {
574
- prefix,
575
- rest
576
- };
577
- const carryoverBudget = reserveInlineBudgetForSuffix(`${carryover.closeSuffix}${CONTINUED_MARKER}`);
578
- ({prefix, rest} = takeSlackInlinePrefix(text, carryoverBudget));
579
- if (!rest) ({prefix, rest} = takeSlackInlinePrefix(text, forceSplitBudget(text, carryoverBudget)));
580
- carryover = rest ? getFenceContinuation(prefix) : null;
581
- if (!carryover) return {
582
- prefix,
583
- rest
584
- };
534
+ function takePrefix(text, maxChars) {
535
+ const prefix = text.slice(0, findSplitIndex(text, maxChars)).trimEnd() || text.slice(0, maxChars);
585
536
  return {
586
537
  prefix,
587
- rest: `${carryover.reopenPrefix}${rest}`
538
+ rest: text.slice(prefix.length).trimStart()
588
539
  };
589
540
  }
590
- /** Return the first continuation-safe chunk plus any remaining text. */
591
- function takeSlackContinuationPrefix(text, options) {
592
- const budget = {
593
- maxChars: options?.maxChars ?? getSlackContinuationBudget().maxChars,
594
- maxLines: options?.maxLines ?? getSlackContinuationBudget().maxLines
595
- };
596
- const { prefix, rest } = (() => {
597
- if (options?.forceSplit) return takeSlackContinuationChunk(text, budget);
598
- const initial = takeSlackInlinePrefix(text, budget);
599
- return initial.rest ? takeSlackContinuationChunk(text, budget) : initial;
600
- })();
601
- return {
602
- prefix,
603
- renderedPrefix: rest ? appendSlackSuffix(prefix, CONTINUED_MARKER) : prefix,
541
+ /** Take one post that fits the budget, closing a code fence it leaves open. */
542
+ function takeChunk(text) {
543
+ let { prefix, rest } = takePrefix(text, MAX_INLINE_CHARS);
544
+ let carryover = getFenceContinuation(prefix);
545
+ if (!carryover) return {
546
+ chunk: prefix,
604
547
  rest
605
548
  };
606
- }
607
- /**
608
- * Take the largest Slack-safe inline prefix from `text` under the configured
609
- * character and line budgets. Returns the consumed prefix plus remaining text.
610
- */
611
- function takeSlackInlinePrefix(text, options) {
612
- const maxChars = options?.maxChars ?? MAX_INLINE_CHARS;
613
- const maxLines = options?.maxLines ?? MAX_INLINE_LINES;
614
- const normalized = text.replace(/\r\n?/g, "\n");
615
- if (!normalized) return {
616
- prefix: "",
617
- rest: ""
618
- };
619
- if (fitsInlineBudget(normalized, maxChars, maxLines)) return {
620
- prefix: normalized,
621
- rest: ""
622
- };
623
- const lineBounded = splitByLineBudget(normalized, maxLines);
624
- const cutIndex = findSplitIndex(lineBounded, maxChars);
625
- const prefix = lineBounded.slice(0, cutIndex).trimEnd();
626
- if (prefix) return {
627
- prefix,
628
- rest: normalized.slice(prefix.length).trimStart()
549
+ ({prefix, rest} = takePrefix(text, MAX_INLINE_CHARS - carryover.closeSuffix.length));
550
+ carryover = getFenceContinuation(prefix);
551
+ if (!carryover || !rest) return {
552
+ chunk: prefix,
553
+ rest
629
554
  };
630
- const hardPrefix = normalized.slice(0, Math.max(1, maxChars)).trimEnd();
631
555
  return {
632
- prefix: hardPrefix || normalized.slice(0, Math.max(1, maxChars)),
633
- rest: normalized.slice(hardPrefix.length || Math.max(1, maxChars)).trimStart()
556
+ chunk: `${prefix}${carryover.closeSuffix}`,
557
+ rest: `${carryover.reopenPrefix}${rest}`
634
558
  };
635
559
  }
636
- /**
637
- * Split a normalized Slack reply into multiple inline-safe thread messages.
638
- *
639
- * Replies split across more than two messages receive explicit continuation
640
- * markers on non-final chunks. When
641
- * `interrupted` is true, the final chunk receives an interruption marker.
642
- */
643
- function splitSlackReplyText(text, options) {
644
- const normalized = normalizeSlackReplyMarkdown(text);
645
- if (!normalized) return [];
560
+ /** Split a normalized Slack reply into thread posts that fit Slack limits. */
561
+ function splitSlackReplyText(text) {
646
562
  const chunks = [];
647
- const continuationBudget = reserveInlineBudgetForSuffix(CONTINUED_MARKER);
648
- let remaining = normalized;
649
- while (remaining) {
650
- if (options?.interrupted ? fitsInlineBudget(appendSlackSuffix(remaining, getInterruptionMarker())) : fitsInlineBudget(remaining)) {
651
- chunks.push(options?.interrupted ? appendSlackSuffix(remaining, getInterruptionMarker()) : remaining);
652
- break;
653
- }
654
- const { renderedPrefix, rest } = takeSlackContinuationPrefix(remaining, {
655
- ...continuationBudget,
656
- forceSplit: true
657
- });
658
- chunks.push(renderedPrefix);
563
+ let remaining = normalizeSlackReplyMarkdown(text);
564
+ while (remaining.length > MAX_INLINE_CHARS) {
565
+ const { chunk, rest } = takeChunk(remaining);
566
+ chunks.push(chunk);
659
567
  remaining = rest;
660
568
  }
661
- if (chunks.length === 2) chunks[0] = stripTrailingContinuationMarker(chunks[0] ?? "");
569
+ if (remaining) chunks.push(remaining);
662
570
  return chunks;
663
571
  }
664
- /**
665
- * Reserve enough inline budget for a continuation suffix on the current chunk.
666
- */
667
- function getSlackContinuationBudget() {
668
- return reserveInlineBudgetForSuffix(CONTINUED_MARKER);
669
- }
670
572
  // src/chat/slack/reply.ts
671
573
  /**
672
574
  * Resolve where a Turn posts in Slack.
@@ -1001,10 +903,17 @@ const SLACK_CURRENT_CHANNEL_IDENTIFIER = "current_channel";
1001
903
  const CHANNEL_RESOURCE_TYPE = "channel";
1002
904
  const MESSAGE_POSTED_EVENT = "message.posted";
1003
905
  const CHANNEL_ID_PATTERN = /^[CG][A-Z0-9]{2,}$/;
1004
- const CHANNEL_MESSAGE_MATCH_FIELDS = eventMatchFieldsSchema.parse({ userId: {
1005
- kind: "string",
1006
- description: "Slack user ID of the message author. Required to run on bot posts, such as alert bots."
1007
- } });
906
+ const CHANNEL_MESSAGE_MATCH_FIELDS = eventMatchFieldsSchema.parse({
907
+ channelId: {
908
+ kind: "string",
909
+ description: "Slack channel ID of the message. It is always the channel where the automation posts.",
910
+ events: [MESSAGE_POSTED_EVENT]
911
+ },
912
+ userId: {
913
+ kind: "string",
914
+ description: "Slack user ID of the message author. Required to run on bot posts, such as alert bots."
915
+ }
916
+ });
1008
917
  /**
1009
918
  * Event registration for new top-level Slack channel messages. Only event
1010
919
  * automations can use it, so watchEvents rejects it.
@@ -1022,7 +931,7 @@ function slackChannelMessageEvents() {
1022
931
  matchFields: CHANNEL_MESSAGE_MATCH_FIELDS
1023
932
  }],
1024
933
  events: { [MESSAGE_POSTED_EVENT]: {
1025
- reach: "resource",
934
+ reach: { anyOf: ["channelId"] },
1026
935
  guidance: "A person or bot posted a new top-level message in this channel. A bot post runs the automation only when match names the bot in userId. A reply goes in that message's thread. If the instructions do not apply to this message, end with no action."
1027
936
  } },
1028
937
  limits: { [CHANNEL_RESOURCE_TYPE]: {
@@ -1032,23 +941,42 @@ function slackChannelMessageEvents() {
1032
941
  };
1033
942
  }
1034
943
  /**
944
+ * Set the `channelId` filter of a Slack channel-message trigger to the
945
+ * channel where the automation posts. A trigger that names another channel,
946
+ * or a saved trigger with an identifier, stays as it is for
947
+ * `requireSlackChannelMessageScope` to check.
948
+ */
949
+ function slackChannelMessageTrigger(trigger, channelId) {
950
+ if (trigger.namespace !== "slack") return trigger;
951
+ if (trigger.identifier != null || trigger.match?.channelId !== void 0) return trigger;
952
+ return {
953
+ ...trigger,
954
+ match: {
955
+ ...trigger.match,
956
+ channelId
957
+ }
958
+ };
959
+ }
960
+ /**
1035
961
  * Bind a Slack channel-message automation to its own channel.
1036
962
  *
1037
- * Resolve `current_channel` to the destination channel and reject other
1038
- * channels, so private channel text cannot reach another channel.
963
+ * The trigger names the channel with a `channelId` filter. A saved trigger
964
+ * can name it with an identifier instead, where `current_channel` means the
965
+ * destination channel. Reject other channels, so private channel text cannot
966
+ * reach another channel.
1039
967
  */
1040
968
  function requireSlackChannelMessageScope(automation) {
1041
969
  if (automation.trigger.namespace !== "slack") return automation;
1042
970
  const channelId = automation.destination.channelId;
1043
971
  if (!CHANNEL_ID_PATTERN.test(channelId)) throw new ToolInputError("A Slack channel-message automation works only in a channel, not in a DM.");
1044
- const identifier = automation.trigger.identifier === "current_channel" ? channelId : automation.trigger.identifier;
1045
- if (identifier !== channelId) throw new ToolInputError(`A Slack channel-message automation can watch only the channel where it posts. Use identifier "${SLACK_CURRENT_CHANNEL_IDENTIFIER}", or create the automation in the channel to watch.`);
972
+ const { identifier, match } = automation.trigger;
973
+ 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 channelId filter, or create the automation in the channel to watch.");
1046
974
  return {
1047
975
  ...automation,
1048
976
  credentialMode: "system",
1049
977
  trigger: {
1050
978
  ...automation.trigger,
1051
- identifier
979
+ ...identifier === void 0 ? void 0 : { identifier: channelId }
1052
980
  }
1053
981
  };
1054
982
  }
@@ -1082,8 +1010,8 @@ function slackChannelMessageEvent(input) {
1082
1010
  * Decide whether a channel-message Event may run one automation.
1083
1011
  *
1084
1012
  * A message runs only automations that post in its own channel, so private
1085
- * channel text cannot reach another channel. The trigger identifier already
1086
- * names that channel, and this check keeps the rule when it does not.
1013
+ * channel text cannot reach another channel. The trigger already names that
1014
+ * channel, and this check keeps the rule when it does not.
1087
1015
  * A bot post runs only automations whose match names its author in `userId`.
1088
1016
  * Bots can post often and would use up the run limit of every other
1089
1017
  * automation in the channel.
@@ -1397,4 +1325,4 @@ async function skipInputBeforeConversationStop(context) {
1397
1325
  await context.attempt.ack();
1398
1326
  return { status: "completed" };
1399
1327
  }
1400
- export { automationResultSchema as A, maybePostAutomatedTurnLimitNotice as C, recordFinishedTurnForAutomatedLimit as D, renderSlackObjectCard as E, remindMissingAutomationResult as F, runDispatchOutcome as I, finishedRunReply as M, postsRunNotices as N, resetAutomatedTurnLimit as O, readAutomationResult as P, renderTaskInput as S, sendSlackReply as T, WORKSPACE_SNAPSHOT_FAILED_EVENT as _, EVENT_WAIT_MS as a, workspaceSnapshotWatch as b, isEventMailboxMetadata as c, getEventCatalog as d, SLACK_EVENT_NAMESPACE as f, slackChannelMessageRunsAutomation as g, slackChannelMessageReplyThreadTs as h, skipInputBeforeConversationStop as i, deliversFinalText as j, FINISH_AUTOMATION_RUN_TOOL_NAME as k, renderEventBatchText as l, slackChannelMessageEvent as m, markConversationsStopped as n, enqueueEventNotification as o, requireSlackChannelMessageScope as p, session_stop_exports as r, eventBatchMessageEvents as s, getConversationStoppedAtMs as t, timerWatchCredentialSubject as u, WORKSPACE_SNAPSHOT_READY_EVENT as v, resolveSlackReplyTarget as w, joinMailboxText as x, workspaceSnapshotFinishedEvent as y };
1328
+ export { recordFinishedTurnForAutomatedLimit as A, renderTaskInput as C, sendSlackReply as D, resolveSlackReplyTarget as E, finishedRunReply as F, postsRunNotices as I, readAutomationResult as L, FINISH_AUTOMATION_RUN_TOOL_NAME as M, automationResultSchema as N, renderSlackObjectCard as O, deliversFinalText as P, remindMissingAutomationResult as R, joinMailboxText as S, postAutomatedTurnLimitNoticeForConversation as T, slackChannelMessageTrigger as _, EVENT_WAIT_MS as a, workspaceSnapshotFinishedEvent as b, isEventMailboxMetadata as c, getEventCatalog as d, SLACK_EVENT_NAMESPACE as f, slackChannelMessageRunsAutomation as g, slackChannelMessageReplyThreadTs as h, skipInputBeforeConversationStop as i, resetAutomatedTurnLimit as j, admitAutomatedTurn as k, renderEventBatchText as l, slackChannelMessageEvent as m, markConversationsStopped as n, enqueueEventNotification as o, requireSlackChannelMessageScope as p, session_stop_exports as r, eventBatchMessageEvents as s, getConversationStoppedAtMs as t, timerWatchCredentialSubject as u, WORKSPACE_SNAPSHOT_FAILED_EVENT as v, maybePostAutomatedTurnLimitNotice as w, workspaceSnapshotWatch as x, WORKSPACE_SNAPSHOT_READY_EVENT as y, runDispatchOutcome as z };
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { h as logWarn } from "./logging-C6EdT6PP.js";
2
+ import { h as logWarn } from "./logging-CjkDr-jP.js";
3
3
  import { s as skillRoots } from "./package-discovery-DJBompdd.js";
4
- import { n as pluginCatalogRuntime } from "./catalog-runtime-Bdym_wKy.js";
4
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BNeCWIaF.js";
5
5
  import path from "node:path";
6
6
  import { z } from "zod";
7
7
  import fs from "node:fs/promises";
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { At as actorFromRun, jt as toolInvocationDestination } from "./agent-runner-MSQSMFkq.js";
3
- import { n as createAndEnqueueAgentInvocation } from "./work-Bjm52fHo.js";
2
+ import { Mt as actorFromRun, Nt as toolInvocationDestination } from "./agent-runner-Cl6Usx2Y.js";
3
+ import { n as createAndEnqueueAgentInvocation } from "./work-zxkmbJAp.js";
4
4
  // src/chat/agent-invocations/spawn.ts
5
5
  var spawn_exports = /* @__PURE__ */ __exportAll({ bindSpawnAgent: () => bindSpawnAgent });
6
6
  /** Bind a Run's Actor and credentials to new Agent invocations. */
@@ -1,6 +1,6 @@
1
- import { $n as recordAttemptFailure$1, Bn as clearExpiredConversationLease$1, Fn as appendInboundMessage, Gn as getConversation$1, Hn as completeConversationWork$1, In as beginConversationResume$1, Kn as getConversationWorkState$1, Ln as cancelHumanFacingPendingMessages$1, Nn as ackMessages$1, Pn as appendExclusiveInboundMessage, Qn as markConversationWorkEnqueued$1, Rn as checkInConversationWork$1, Un as deadLetterAttempt$1, Vn as completeConversationStop$1, Wn as drainConversationMailbox$1, Zn as listActiveConversationIds$1, ar as startConversationWork$1, er as recordConversationRetry$1, ir as requestConversationWork$1, nr as removeActiveConversation$1, or as steerWebPendingMessages$1, rr as requestAnotherSlice$1, sr as stopConversationWork$1, tr as releaseConversationWork$1, zn as clearConsumedConversationWake$1 } from "./turn-session-routing-B9KLBhaT.js";
2
- import { x as getConversationStore } from "./viewer-BTgAfdUg.js";
3
- import "./job-queue-DiaXoSDg.js";
1
+ import { $n as recordAttemptFailure$1, Bn as clearExpiredConversationLease$1, Fn as appendInboundMessage, Gn as getConversation$1, Hn as completeConversationWork$1, In as beginConversationResume$1, Kn as getConversationWorkState$1, Ln as cancelHumanFacingPendingMessages$1, Nn as ackMessages$1, Pn as appendExclusiveInboundMessage, Qn as markConversationWorkEnqueued$1, Rn as checkInConversationWork$1, Un as deadLetterAttempt$1, Vn as completeConversationStop$1, Wn as drainConversationMailbox$1, Zn as listActiveConversationIds$1, ar as startConversationWork$1, er as recordConversationRetry$1, ir as requestConversationWork$1, nr as removeActiveConversation$1, or as steerWebPendingMessages$1, rr as requestAnotherSlice$1, sr as stopConversationWork$1, tr as releaseConversationWork$1, zn as clearConsumedConversationWake$1 } from "./turn-session-routing-BV_gX7n3.js";
2
+ import { x as getConversationStore } from "./viewer-BCRuO8Wg.js";
3
+ import "./job-queue-CjB97sii.js";
4
4
  // src/chat/task-execution/store.ts
5
5
  function metadataStore(options) {
6
6
  return options.conversationStore ?? getConversationStore();