@sentry/junior 0.94.0 → 0.96.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 (127) hide show
  1. package/dist/{agent-hooks-ZG7IDOIN.js → agent-hooks-5URSMY3O.js} +10 -11
  2. package/dist/api/people/list.js +8 -8
  3. package/dist/api/people/profile.js +8 -8
  4. package/dist/api/people/shared.d.ts +2 -2
  5. package/dist/api-reference.d.ts +2 -2
  6. package/dist/app.js +434 -199
  7. package/dist/{catalog-runtime-NZHMSMYC.js → catalog-runtime-MSMAYYIK.js} +4 -4
  8. package/dist/chat/advisor-request.d.ts +4 -0
  9. package/dist/chat/agent/request.d.ts +2 -0
  10. package/dist/chat/agent/resume.d.ts +2 -0
  11. package/dist/chat/conversations/history.d.ts +128 -0
  12. package/dist/chat/conversations/legacy-import.d.ts +38 -0
  13. package/dist/chat/conversations/messages.d.ts +39 -0
  14. package/dist/chat/conversations/projection.d.ts +94 -0
  15. package/dist/chat/conversations/retention.d.ts +36 -0
  16. package/dist/chat/conversations/sql/conversation-row.d.ts +14 -0
  17. package/dist/chat/conversations/sql/history.d.ts +4 -0
  18. package/dist/chat/conversations/sql/legacy-history-import.d.ts +55 -0
  19. package/dist/chat/conversations/sql/messages.d.ts +4 -0
  20. package/dist/chat/conversations/sql/migrations.d.ts +14 -3
  21. package/dist/chat/conversations/sql/purge.d.ts +53 -0
  22. package/dist/chat/conversations/sql/store.d.ts +7 -2
  23. package/dist/chat/conversations/store.d.ts +19 -0
  24. package/dist/chat/conversations/visible-compactions.d.ts +11 -0
  25. package/dist/chat/conversations/visible-messages.d.ts +47 -0
  26. package/dist/chat/db.d.ts +12 -1
  27. package/dist/chat/identities/sql.d.ts +1 -1
  28. package/dist/chat/logging.d.ts +4 -3
  29. package/dist/chat/plugins/auth/oauth-request.d.ts +2 -0
  30. package/dist/chat/resource-events/notification.d.ts +2 -0
  31. package/dist/chat/resource-events/store.d.ts +2 -1
  32. package/dist/chat/runtime/agent-run-outcome.d.ts +3 -0
  33. package/dist/chat/runtime/reply-executor.d.ts +8 -0
  34. package/dist/chat/runtime/thread-state.d.ts +2 -0
  35. package/dist/chat/sandbox/resources.d.ts +4 -0
  36. package/dist/chat/sentry.d.ts +1 -1
  37. package/dist/chat/services/mcp-auth-orchestration.d.ts +8 -0
  38. package/dist/chat/services/plugin-auth-orchestration.d.ts +12 -0
  39. package/dist/chat/services/turn-session-record.d.ts +14 -2
  40. package/dist/chat/sleep.d.ts +2 -0
  41. package/dist/chat/state/conversation.d.ts +7 -4
  42. package/dist/chat/state/session-log.d.ts +23 -1
  43. package/dist/chat/state/turn-session.d.ts +9 -1
  44. package/dist/chat/tool-support/private-trace-result.d.ts +4 -0
  45. package/dist/chat/tool-support/zod-tool.d.ts +1 -0
  46. package/dist/chat/tools/advisor/tool.d.ts +9 -4
  47. package/dist/chat/tools/definition.d.ts +2 -0
  48. package/dist/chat/tools/execution/tool-error-handler.d.ts +2 -2
  49. package/dist/chat/tools/system-time.d.ts +8 -0
  50. package/dist/chat/usage.d.ts +27 -13
  51. package/dist/chat/xml.d.ts +2 -0
  52. package/dist/{chunk-TNUUATT7.js → chunk-2NAZZPPS.js} +2 -2
  53. package/dist/{chunk-NYWPISSO.js → chunk-2XXEKR44.js} +1 -1
  54. package/dist/chunk-5C6XTTFI.js +1037 -0
  55. package/dist/{chunk-3DA7X2U3.js → chunk-6GWA276C.js} +15 -0
  56. package/dist/{chunk-LFLTJQVR.js → chunk-7FBGKXPE.js} +4 -0
  57. package/dist/{chunk-LNCREA5Z.js → chunk-AAZXTVJT.js} +4 -128
  58. package/dist/{chunk-GHGPTPBL.js → chunk-B7PUBQQM.js} +1 -1
  59. package/dist/{chunk-6H4PP63X.js → chunk-BYZWPRJA.js} +24 -14
  60. package/dist/chunk-CM5EZD5F.js +17 -0
  61. package/dist/{chunk-G3E7SCME.js → chunk-CZEX6KIQ.js} +23 -0
  62. package/dist/{chunk-YJ4OPVNA.js → chunk-DZENG5ML.js} +1 -1
  63. package/dist/{chunk-QGEWC27H.js → chunk-GQ3GK22G.js} +5 -7
  64. package/dist/{chunk-YYBX2BD5.js → chunk-GY34VGP5.js} +1 -1
  65. package/dist/{chunk-S6QKIGRM.js → chunk-I35CTGPO.js} +71 -29
  66. package/dist/{chunk-KRMANDHI.js → chunk-IYM2SIVG.js} +1489 -355
  67. package/dist/{chunk-BTH37NCU.js → chunk-L7CDEIVJ.js} +12 -4
  68. package/dist/chunk-MNTINMWR.js +865 -0
  69. package/dist/{chunk-MAVOJ54A.js → chunk-P3YFQLEN.js} +25 -388
  70. package/dist/{chunk-YTNPU7I2.js → chunk-PMNN6ST4.js} +2 -2
  71. package/dist/{chunk-PFXC67GJ.js → chunk-RAIB6WSG.js} +6 -80
  72. package/dist/{chunk-NFXSLTYG.js → chunk-RITD7E5L.js} +864 -62
  73. package/dist/{chunk-UUB3D2XI.js → chunk-S5KZ5LPG.js} +8 -10
  74. package/dist/{chunk-HDNWZMUN.js → chunk-UKHVMPX5.js} +112 -103
  75. package/dist/chunk-WM6KHPBQ.js +48 -0
  76. package/dist/{chunk-MC4ZZE4Q.js → chunk-YDT7SNCN.js} +1 -1
  77. package/dist/{chunk-NAPITCZ6.js → chunk-YDVEH3SB.js} +251 -6
  78. package/dist/cli/chat.js +25 -24
  79. package/dist/cli/check.js +5 -5
  80. package/dist/cli/main.js +1 -1
  81. package/dist/cli/plugins.js +12 -13
  82. package/dist/cli/snapshot-warmup.js +8 -9
  83. package/dist/cli/upgrade.js +79 -18
  84. package/dist/db/schema/agent-steps.d.ts +134 -0
  85. package/dist/db/schema/conversation-messages.d.ts +153 -0
  86. package/dist/{chat/conversations/sql → db}/schema/conversations.d.ts +34 -0
  87. package/dist/{chat/conversations/sql → db}/schema.d.ts +319 -8
  88. package/dist/db-2D6RMG67.js +24 -0
  89. package/dist/deployment.d.ts +2 -0
  90. package/dist/handlers/retention.d.ts +6 -0
  91. package/dist/instrumentation.js +17 -4
  92. package/dist/legacy-import-VZ2MEGP7.js +17 -0
  93. package/dist/nitro.js +14 -4
  94. package/dist/reporting/conversations/activity.d.ts +40 -0
  95. package/dist/reporting/conversations/context.d.ts +8 -0
  96. package/dist/reporting/conversations/details.d.ts +6 -0
  97. package/dist/reporting/conversations/index.d.ts +4 -0
  98. package/dist/reporting/conversations/shared.d.ts +9 -0
  99. package/dist/reporting/conversations/statistics.d.ts +4 -0
  100. package/dist/reporting/conversations/summaries.d.ts +20 -0
  101. package/dist/reporting/conversations/transcript.d.ts +28 -0
  102. package/dist/reporting/conversations/types.d.ts +191 -0
  103. package/dist/reporting/conversations.d.ts +1 -178
  104. package/dist/reporting.d.ts +5 -4
  105. package/dist/reporting.js +703 -837
  106. package/dist/{runner-XAZPJNAQ.js → runner-JZBRQP4F.js} +36 -42
  107. package/dist/{sentry-EGFOV3DH.js → sentry-JMWTS32N.js} +11 -1
  108. package/dist/{validation-KYAWETI4.js → validation-6XOOQGME.js} +5 -5
  109. package/migrations/README.md +32 -0
  110. package/migrations/meta/0000_snapshot.json +978 -0
  111. package/migrations/meta/_journal.json +13 -0
  112. package/package.json +10 -7
  113. package/dist/chat/sql/schema.d.ts +0 -1049
  114. package/dist/chat/state/conversation-details.d.ts +0 -47
  115. package/dist/chunk-7STN2ZSK.js +0 -250
  116. package/dist/chunk-LE5ANBUZ.js +0 -1040
  117. package/dist/chunk-QL66APYJ.js +0 -1377
  118. package/dist/db-YDN6AFJH.js +0 -18
  119. /package/dist/{chat/sql → db}/db.d.ts +0 -0
  120. /package/dist/{chat/sql → db}/executor.d.ts +0 -0
  121. /package/dist/{chat/sql → db}/neon.d.ts +0 -0
  122. /package/dist/{chat/sql → db}/postgres.d.ts +0 -0
  123. /package/dist/{chat/conversations/sql → db}/schema/destinations.d.ts +0 -0
  124. /package/dist/{chat/conversations/sql → db}/schema/identities.d.ts +0 -0
  125. /package/dist/{chat/conversations/sql → db}/schema/migrations.d.ts +0 -0
  126. /package/dist/{chat/conversations/sql → db}/schema/timestamps.d.ts +0 -0
  127. /package/dist/{chat/conversations/sql → db}/schema/users.d.ts +0 -0
@@ -1,10 +1,287 @@
1
+ import { juniorAgentSteps } from "./schema/agent-steps";
2
+ import { juniorConversationMessages } from "./schema/conversation-messages";
1
3
  import { juniorConversations } from "./schema/conversations";
2
4
  import { juniorDestinations } from "./schema/destinations";
3
5
  import { juniorIdentities } from "./schema/identities";
4
6
  import { juniorSchemaMigrations } from "./schema/migrations";
5
7
  import { juniorUsers } from "./schema/users";
6
- export { juniorConversations, juniorDestinations, juniorIdentities, juniorSchemaMigrations, juniorUsers, };
7
- export declare const schema: {
8
+ export { juniorAgentSteps, juniorConversationMessages, juniorConversations, juniorDestinations, juniorIdentities, juniorSchemaMigrations, juniorUsers, };
9
+ export declare const juniorSqlSchema: {
10
+ juniorAgentSteps: import("drizzle-orm/pg-core").PgTableWithColumns<{
11
+ name: "junior_agent_steps";
12
+ schema: undefined;
13
+ columns: {
14
+ conversationId: import("drizzle-orm/pg-core").PgColumn<{
15
+ name: "conversation_id";
16
+ tableName: "junior_agent_steps";
17
+ dataType: "string";
18
+ columnType: "PgText";
19
+ data: string;
20
+ driverParam: string;
21
+ notNull: true;
22
+ hasDefault: false;
23
+ isPrimaryKey: false;
24
+ isAutoincrement: false;
25
+ hasRuntimeDefault: false;
26
+ enumValues: [string, ...string[]];
27
+ baseColumn: never;
28
+ identity: undefined;
29
+ generated: undefined;
30
+ }, {}, {}>;
31
+ seq: import("drizzle-orm/pg-core").PgColumn<{
32
+ name: "seq";
33
+ tableName: "junior_agent_steps";
34
+ dataType: "number";
35
+ columnType: "PgInteger";
36
+ data: number;
37
+ driverParam: string | number;
38
+ notNull: true;
39
+ hasDefault: false;
40
+ isPrimaryKey: false;
41
+ isAutoincrement: false;
42
+ hasRuntimeDefault: false;
43
+ enumValues: undefined;
44
+ baseColumn: never;
45
+ identity: undefined;
46
+ generated: undefined;
47
+ }, {}, {}>;
48
+ contextEpoch: import("drizzle-orm/pg-core").PgColumn<{
49
+ name: "context_epoch";
50
+ tableName: "junior_agent_steps";
51
+ dataType: "number";
52
+ columnType: "PgInteger";
53
+ data: number;
54
+ driverParam: string | number;
55
+ notNull: true;
56
+ hasDefault: false;
57
+ isPrimaryKey: false;
58
+ isAutoincrement: false;
59
+ hasRuntimeDefault: false;
60
+ enumValues: undefined;
61
+ baseColumn: never;
62
+ identity: undefined;
63
+ generated: undefined;
64
+ }, {}, {}>;
65
+ type: import("drizzle-orm/pg-core").PgColumn<{
66
+ name: "type";
67
+ tableName: "junior_agent_steps";
68
+ dataType: "string";
69
+ columnType: "PgText";
70
+ data: string;
71
+ driverParam: string;
72
+ notNull: true;
73
+ hasDefault: false;
74
+ isPrimaryKey: false;
75
+ isAutoincrement: false;
76
+ hasRuntimeDefault: false;
77
+ enumValues: [string, ...string[]];
78
+ baseColumn: never;
79
+ identity: undefined;
80
+ generated: undefined;
81
+ }, {}, {}>;
82
+ role: import("drizzle-orm/pg-core").PgColumn<{
83
+ name: "role";
84
+ tableName: "junior_agent_steps";
85
+ dataType: "string";
86
+ columnType: "PgText";
87
+ data: string;
88
+ driverParam: string;
89
+ notNull: false;
90
+ hasDefault: false;
91
+ isPrimaryKey: false;
92
+ isAutoincrement: false;
93
+ hasRuntimeDefault: false;
94
+ enumValues: [string, ...string[]];
95
+ baseColumn: never;
96
+ identity: undefined;
97
+ generated: undefined;
98
+ }, {}, {}>;
99
+ payload: import("drizzle-orm/pg-core").PgColumn<{
100
+ name: "payload";
101
+ tableName: "junior_agent_steps";
102
+ dataType: "json";
103
+ columnType: "PgJsonb";
104
+ data: Record<string, unknown>;
105
+ driverParam: unknown;
106
+ notNull: true;
107
+ hasDefault: false;
108
+ isPrimaryKey: false;
109
+ isAutoincrement: false;
110
+ hasRuntimeDefault: false;
111
+ enumValues: undefined;
112
+ baseColumn: never;
113
+ identity: undefined;
114
+ generated: undefined;
115
+ }, {}, {
116
+ $type: Record<string, unknown>;
117
+ }>;
118
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
119
+ name: string;
120
+ tableName: "junior_agent_steps";
121
+ dataType: "date";
122
+ columnType: "PgTimestamp";
123
+ data: Date;
124
+ driverParam: string;
125
+ notNull: true;
126
+ hasDefault: false;
127
+ isPrimaryKey: false;
128
+ isAutoincrement: false;
129
+ hasRuntimeDefault: false;
130
+ enumValues: undefined;
131
+ baseColumn: never;
132
+ identity: undefined;
133
+ generated: undefined;
134
+ }, {}, {}>;
135
+ };
136
+ dialect: "pg";
137
+ }>;
138
+ juniorConversationMessages: import("drizzle-orm/pg-core").PgTableWithColumns<{
139
+ name: "junior_conversation_messages";
140
+ schema: undefined;
141
+ columns: {
142
+ conversationId: import("drizzle-orm/pg-core").PgColumn<{
143
+ name: "conversation_id";
144
+ tableName: "junior_conversation_messages";
145
+ dataType: "string";
146
+ columnType: "PgText";
147
+ data: string;
148
+ driverParam: string;
149
+ notNull: true;
150
+ hasDefault: false;
151
+ isPrimaryKey: false;
152
+ isAutoincrement: false;
153
+ hasRuntimeDefault: false;
154
+ enumValues: [string, ...string[]];
155
+ baseColumn: never;
156
+ identity: undefined;
157
+ generated: undefined;
158
+ }, {}, {}>;
159
+ messageId: import("drizzle-orm/pg-core").PgColumn<{
160
+ name: "message_id";
161
+ tableName: "junior_conversation_messages";
162
+ dataType: "string";
163
+ columnType: "PgText";
164
+ data: string;
165
+ driverParam: string;
166
+ notNull: true;
167
+ hasDefault: false;
168
+ isPrimaryKey: false;
169
+ isAutoincrement: false;
170
+ hasRuntimeDefault: false;
171
+ enumValues: [string, ...string[]];
172
+ baseColumn: never;
173
+ identity: undefined;
174
+ generated: undefined;
175
+ }, {}, {}>;
176
+ role: import("drizzle-orm/pg-core").PgColumn<{
177
+ name: "role";
178
+ tableName: "junior_conversation_messages";
179
+ dataType: "string";
180
+ columnType: "PgText";
181
+ data: import("../chat/conversations/messages").ConversationMessageRole;
182
+ driverParam: string;
183
+ notNull: true;
184
+ hasDefault: false;
185
+ isPrimaryKey: false;
186
+ isAutoincrement: false;
187
+ hasRuntimeDefault: false;
188
+ enumValues: [string, ...string[]];
189
+ baseColumn: never;
190
+ identity: undefined;
191
+ generated: undefined;
192
+ }, {}, {
193
+ $type: import("../chat/conversations/messages").ConversationMessageRole;
194
+ }>;
195
+ authorIdentityId: import("drizzle-orm/pg-core").PgColumn<{
196
+ name: "author_identity_id";
197
+ tableName: "junior_conversation_messages";
198
+ dataType: "string";
199
+ columnType: "PgText";
200
+ data: string;
201
+ driverParam: string;
202
+ notNull: false;
203
+ hasDefault: false;
204
+ isPrimaryKey: false;
205
+ isAutoincrement: false;
206
+ hasRuntimeDefault: false;
207
+ enumValues: [string, ...string[]];
208
+ baseColumn: never;
209
+ identity: undefined;
210
+ generated: undefined;
211
+ }, {}, {}>;
212
+ text: import("drizzle-orm/pg-core").PgColumn<{
213
+ name: "text";
214
+ tableName: "junior_conversation_messages";
215
+ dataType: "string";
216
+ columnType: "PgText";
217
+ data: string;
218
+ driverParam: string;
219
+ notNull: true;
220
+ hasDefault: false;
221
+ isPrimaryKey: false;
222
+ isAutoincrement: false;
223
+ hasRuntimeDefault: false;
224
+ enumValues: [string, ...string[]];
225
+ baseColumn: never;
226
+ identity: undefined;
227
+ generated: undefined;
228
+ }, {}, {}>;
229
+ meta: import("drizzle-orm/pg-core").PgColumn<{
230
+ name: "meta";
231
+ tableName: "junior_conversation_messages";
232
+ dataType: "json";
233
+ columnType: "PgJsonb";
234
+ data: Record<string, unknown>;
235
+ driverParam: unknown;
236
+ notNull: false;
237
+ hasDefault: false;
238
+ isPrimaryKey: false;
239
+ isAutoincrement: false;
240
+ hasRuntimeDefault: false;
241
+ enumValues: undefined;
242
+ baseColumn: never;
243
+ identity: undefined;
244
+ generated: undefined;
245
+ }, {}, {
246
+ $type: Record<string, unknown>;
247
+ }>;
248
+ repliedAt: import("drizzle-orm/pg-core").PgColumn<{
249
+ name: string;
250
+ tableName: "junior_conversation_messages";
251
+ dataType: "date";
252
+ columnType: "PgTimestamp";
253
+ data: Date;
254
+ driverParam: string;
255
+ notNull: false;
256
+ hasDefault: false;
257
+ isPrimaryKey: false;
258
+ isAutoincrement: false;
259
+ hasRuntimeDefault: false;
260
+ enumValues: undefined;
261
+ baseColumn: never;
262
+ identity: undefined;
263
+ generated: undefined;
264
+ }, {}, {}>;
265
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
266
+ name: string;
267
+ tableName: "junior_conversation_messages";
268
+ dataType: "date";
269
+ columnType: "PgTimestamp";
270
+ data: Date;
271
+ driverParam: string;
272
+ notNull: true;
273
+ hasDefault: false;
274
+ isPrimaryKey: false;
275
+ isAutoincrement: false;
276
+ hasRuntimeDefault: false;
277
+ enumValues: undefined;
278
+ baseColumn: never;
279
+ identity: undefined;
280
+ generated: undefined;
281
+ }, {}, {}>;
282
+ };
283
+ dialect: "pg";
284
+ }>;
8
285
  juniorConversations: import("drizzle-orm/pg-core").PgTableWithColumns<{
9
286
  name: "junior_conversations";
10
287
  schema: undefined;
@@ -48,7 +325,7 @@ export declare const schema: {
48
325
  tableName: "junior_conversations";
49
326
  dataType: "string";
50
327
  columnType: "PgText";
51
- data: import("../store").ConversationSource;
328
+ data: import("../chat/conversations/store").ConversationSource;
52
329
  driverParam: string;
53
330
  notNull: false;
54
331
  hasDefault: false;
@@ -60,7 +337,7 @@ export declare const schema: {
60
337
  identity: undefined;
61
338
  generated: undefined;
62
339
  }, {}, {
63
- $type: import("../store").ConversationSource;
340
+ $type: import("../chat/conversations/store").ConversationSource;
64
341
  }>;
65
342
  originType: import("drizzle-orm/pg-core").PgColumn<{
66
343
  name: "origin_type";
@@ -354,7 +631,7 @@ export declare const schema: {
354
631
  tableName: "junior_conversations";
355
632
  dataType: "string";
356
633
  columnType: "PgText";
357
- data: import("../store").ConversationStatus;
634
+ data: import("../chat/conversations/store").ConversationStatus;
358
635
  driverParam: string;
359
636
  notNull: true;
360
637
  hasDefault: false;
@@ -366,7 +643,7 @@ export declare const schema: {
366
643
  identity: undefined;
367
644
  generated: undefined;
368
645
  }, {}, {
369
- $type: import("../store").ConversationStatus;
646
+ $type: import("../chat/conversations/store").ConversationStatus;
370
647
  }>;
371
648
  runId: import("drizzle-orm/pg-core").PgColumn<{
372
649
  name: "run_id";
@@ -419,6 +696,40 @@ export declare const schema: {
419
696
  identity: undefined;
420
697
  generated: undefined;
421
698
  }, {}, {}>;
699
+ parentConversationId: import("drizzle-orm/pg-core").PgColumn<{
700
+ name: "parent_conversation_id";
701
+ tableName: "junior_conversations";
702
+ dataType: "string";
703
+ columnType: "PgText";
704
+ data: string;
705
+ driverParam: string;
706
+ notNull: false;
707
+ hasDefault: false;
708
+ isPrimaryKey: false;
709
+ isAutoincrement: false;
710
+ hasRuntimeDefault: false;
711
+ enumValues: [string, ...string[]];
712
+ baseColumn: never;
713
+ identity: undefined;
714
+ generated: undefined;
715
+ }, {}, {}>;
716
+ transcriptPurgedAt: import("drizzle-orm/pg-core").PgColumn<{
717
+ name: string;
718
+ tableName: "junior_conversations";
719
+ dataType: "date";
720
+ columnType: "PgTimestamp";
721
+ data: Date;
722
+ driverParam: string;
723
+ notNull: false;
724
+ hasDefault: false;
725
+ isPrimaryKey: false;
726
+ isAutoincrement: false;
727
+ hasRuntimeDefault: false;
728
+ enumValues: undefined;
729
+ baseColumn: never;
730
+ identity: undefined;
731
+ generated: undefined;
732
+ }, {}, {}>;
422
733
  };
423
734
  dialect: "pg";
424
735
  }>;
@@ -646,7 +957,7 @@ export declare const schema: {
646
957
  tableName: "junior_identities";
647
958
  dataType: "string";
648
959
  columnType: "PgText";
649
- data: import("../../identities/identity").IdentityKind;
960
+ data: import("../chat/identities/identity").IdentityKind;
650
961
  driverParam: string;
651
962
  notNull: true;
652
963
  hasDefault: false;
@@ -658,7 +969,7 @@ export declare const schema: {
658
969
  identity: undefined;
659
970
  generated: undefined;
660
971
  }, {}, {
661
- $type: import("../../identities/identity").IdentityKind;
972
+ $type: import("../chat/identities/identity").IdentityKind;
662
973
  }>;
663
974
  provider: import("drizzle-orm/pg-core").PgColumn<{
664
975
  name: "provider";
@@ -0,0 +1,24 @@
1
+ import {
2
+ closeDb,
3
+ getAgentStepStore,
4
+ getConversationMessageStore,
5
+ getConversationStore,
6
+ getDb,
7
+ getSqlExecutor
8
+ } from "./chunk-RITD7E5L.js";
9
+ import "./chunk-YDVEH3SB.js";
10
+ import "./chunk-GY34VGP5.js";
11
+ import "./chunk-B7PUBQQM.js";
12
+ import "./chunk-I35CTGPO.js";
13
+ import "./chunk-OB42YVAE.js";
14
+ import "./chunk-6GWA276C.js";
15
+ import "./chunk-7FBGKXPE.js";
16
+ import "./chunk-MLKGABMK.js";
17
+ export {
18
+ closeDb,
19
+ getAgentStepStore,
20
+ getConversationMessageStore,
21
+ getConversationStore,
22
+ getDb,
23
+ getSqlExecutor
24
+ };
@@ -1,5 +1,7 @@
1
1
  export declare const JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";
2
2
  export declare const JUNIOR_HEARTBEAT_CRON_SCHEDULE = "* * * * *";
3
+ export declare const JUNIOR_RETENTION_ROUTE = "/api/internal/retention";
4
+ export declare const JUNIOR_RETENTION_CRON_SCHEDULE = "0 4 * * *";
3
5
  export declare const JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE = "/api/internal/agent/continue";
4
6
  export declare const JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE = "/api/internal/plugin/tasks";
5
7
  export declare const LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION = "api/internal/agent/continue.ts";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Handle the authenticated internal retention cron. One request runs a single
3
+ * bounded purge batch and returns its counts. Failures are contained here so
4
+ * retention can never affect task execution, heartbeat recovery, or delivery.
5
+ */
6
+ export declare function GET(request: Request): Promise<Response>;
@@ -1,6 +1,9 @@
1
+ import {
2
+ consumePrivateTraceResultMarker
3
+ } from "./chunk-CM5EZD5F.js";
1
4
  import {
2
5
  getCurrentConversationPrivacy
3
- } from "./chunk-YYBX2BD5.js";
6
+ } from "./chunk-GY34VGP5.js";
4
7
  import "./chunk-OB42YVAE.js";
5
8
  import {
6
9
  getClient,
@@ -8,11 +11,11 @@ import {
8
11
  init,
9
12
  vercelAIIntegration,
10
13
  withStreamedSpan
11
- } from "./chunk-3DA7X2U3.js";
14
+ } from "./chunk-6GWA276C.js";
12
15
  import {
13
16
  getDeploymentServiceVersion,
14
17
  getDeploymentTelemetryAttributes
15
- } from "./chunk-LFLTJQVR.js";
18
+ } from "./chunk-7FBGKXPE.js";
16
19
  import "./chunk-MLKGABMK.js";
17
20
 
18
21
  // src/chat/sentry-payload-filter.ts
@@ -41,10 +44,20 @@ function scrubPayloadAttributes(attributes) {
41
44
  if (!shouldScrubPayloads(attributes)) {
42
45
  return;
43
46
  }
47
+ const preserveProjectedToolResult = consumePrivateTraceResultMarker(attributes);
48
+ let redacted = false;
44
49
  for (const key of PAYLOAD_ATTRIBUTE_KEYS) {
50
+ if (key === "gen_ai.tool.call.result" && preserveProjectedToolResult) {
51
+ continue;
52
+ }
53
+ if (key in attributes) {
54
+ redacted = true;
55
+ }
45
56
  delete attributes[key];
46
57
  }
47
- attributes["app.conversation.payload_redacted"] = true;
58
+ if (redacted) {
59
+ attributes["app.conversation.payload_redacted"] = true;
60
+ }
48
61
  }
49
62
  function scrubContainer(container) {
50
63
  if (!container) {
@@ -0,0 +1,17 @@
1
+ import {
2
+ ensureLegacyConversationImport,
3
+ importConversationFromLegacy
4
+ } from "./chunk-5C6XTTFI.js";
5
+ import "./chunk-RITD7E5L.js";
6
+ import "./chunk-YDVEH3SB.js";
7
+ import "./chunk-GY34VGP5.js";
8
+ import "./chunk-B7PUBQQM.js";
9
+ import "./chunk-I35CTGPO.js";
10
+ import "./chunk-OB42YVAE.js";
11
+ import "./chunk-6GWA276C.js";
12
+ import "./chunk-7FBGKXPE.js";
13
+ import "./chunk-MLKGABMK.js";
14
+ export {
15
+ ensureLegacyConversationImport,
16
+ importConversationFromLegacy
17
+ };
package/dist/nitro.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveConversationWorkQueueTopic
3
- } from "./chunk-NYWPISSO.js";
3
+ } from "./chunk-2XXEKR44.js";
4
4
  import {
5
5
  PLUGIN_TASK_QUEUE_TOPIC
6
6
  } from "./chunk-KNFROR7R.js";
@@ -12,7 +12,7 @@ import {
12
12
  loadPluginSetFromModule,
13
13
  resolvePluginModule
14
14
  } from "./chunk-Y2CM7HXH.js";
15
- import "./chunk-GHGPTPBL.js";
15
+ import "./chunk-B7PUBQQM.js";
16
16
  import {
17
17
  discoverInstalledPluginPackageContent,
18
18
  isValidPackageName,
@@ -22,8 +22,10 @@ import {
22
22
  JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE,
23
23
  JUNIOR_HEARTBEAT_CRON_SCHEDULE,
24
24
  JUNIOR_HEARTBEAT_ROUTE,
25
- JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE
26
- } from "./chunk-LFLTJQVR.js";
25
+ JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE,
26
+ JUNIOR_RETENTION_CRON_SCHEDULE,
27
+ JUNIOR_RETENTION_ROUTE
28
+ } from "./chunk-7FBGKXPE.js";
27
29
  import "./chunk-MLKGABMK.js";
28
30
 
29
31
  // src/nitro.ts
@@ -335,6 +337,14 @@ function configureVercelDeployment(nitro, options) {
335
337
  schedule: JUNIOR_HEARTBEAT_CRON_SCHEDULE
336
338
  });
337
339
  }
340
+ if (!nitro.options.vercel.config.crons.some(
341
+ (cron) => cron.path === JUNIOR_RETENTION_ROUTE
342
+ )) {
343
+ nitro.options.vercel.config.crons.push({
344
+ path: JUNIOR_RETENTION_ROUTE,
345
+ schedule: JUNIOR_RETENTION_CRON_SCHEDULE
346
+ });
347
+ }
338
348
  nitro.options.vercel.functions ??= {};
339
349
  nitro.options.vercel.functions.maxDuration ??= defaultMaxDuration;
340
350
  const callbackMaxDuration = nitro.options.vercel.functions.maxDuration ?? defaultMaxDuration;
@@ -0,0 +1,40 @@
1
+ import type { AgentStepEntry, StoredAgentStep } from "@/chat/conversations/history";
2
+ import type { PiMessage } from "@/chat/pi/messages";
3
+ import type { ConversationActivityReport, ConversationActivityStatus, ConversationSubagentActivityReport } from "./types";
4
+ /**
5
+ * Build the current-run activity timeline from durable agent steps.
6
+ *
7
+ * Tool executions, subagent starts/ends, and their nesting are derived from the
8
+ * conversation's `junior_agent_steps` rows instead of the legacy Redis session
9
+ * log; tool statuses come from the aligned `pi_message` tool results. Redaction
10
+ * stays byte-compatible with the prior session-log path.
11
+ */
12
+ export declare function buildConversationActivityFromSteps(args: {
13
+ canExposePayload: boolean;
14
+ steps: StoredAgentStep[];
15
+ messages: PiMessage[];
16
+ }): ConversationActivityReport[];
17
+ export type SubagentStartedStep = StoredAgentStep & {
18
+ entry: Extract<AgentStepEntry, {
19
+ type: "subagent_started";
20
+ }>;
21
+ };
22
+ export type SubagentEndedStep = StoredAgentStep & {
23
+ entry: Extract<AgentStepEntry, {
24
+ type: "subagent_ended";
25
+ }>;
26
+ };
27
+ /** Pair durable subagent start and end steps into one activity report. */
28
+ export declare function subagentActivityFromSteps(start: SubagentStartedStep, end: SubagentEndedStep | undefined, options?: {
29
+ canExposeTranscript?: boolean;
30
+ parentStatus?: ConversationActivityStatus;
31
+ }): ConversationSubagentActivityReport;
32
+ /**
33
+ * Read one child-agent transcript through its parent conversation.
34
+ *
35
+ * The parent records `subagent_started`/`subagent_ended` as durable steps that
36
+ * name the child by `childConversationId`; the transcript is the child
37
+ * conversation's own projected Pi messages. `runId` is retained for the route
38
+ * signature but no longer scopes the lookup — subagent steps live on the parent
39
+ * conversation regardless of the run that produced them.
40
+ */
@@ -0,0 +1,8 @@
1
+ import type { ConversationMessageStore } from "@/chat/conversations/messages";
2
+ import type { ConversationStore } from "@/chat/conversations/store";
3
+ export interface ConversationReaderOptions {
4
+ messageStore?: ConversationMessageStore;
5
+ conversationStore?: ConversationStore;
6
+ }
7
+ /** Resolve the conversation store supplied by a reporting consumer. */
8
+ export declare function conversationStore(options?: ConversationReaderOptions): ConversationStore;
@@ -0,0 +1,6 @@
1
+ import { type ConversationReaderOptions } from "./context";
2
+ import type { ConversationReport, ConversationSubagentTranscriptReport } from "./types";
3
+ /** Read one conversation transcript for reporting consumers. */
4
+ export declare function readConversationReport(conversationId: string, options?: ConversationReaderOptions): Promise<ConversationReport>;
5
+ /** Read one child-agent transcript through its parent conversation. */
6
+ export declare function readConversationSubagentTranscriptReport(conversationId: string, _runId: string, subagentId: string, options?: ConversationReaderOptions): Promise<ConversationSubagentTranscriptReport>;
@@ -0,0 +1,4 @@
1
+ export { readConversationReport, readConversationSubagentTranscriptReport, } from "./details";
2
+ export { listRecentConversationSummaries, readConversationFeed, } from "./summaries";
3
+ export { readConversationStatsReport } from "./statistics";
4
+ export * from "./types";
@@ -0,0 +1,9 @@
1
+ import type { ConversationSummaryReport, ConversationSurface } from "./types";
2
+ /** Parse an ISO report timestamp without leaking invalid numbers downstream. */
3
+ export declare function reportTime(value: string): number | undefined;
4
+ /** Format a Slack destination without exposing private channel names. */
5
+ export declare function slackStatsLocationLabel(input: Pick<ConversationSummaryReport, "channel" | "channelName" | "channelNameRedacted">): string | undefined;
6
+ /** Return the generic display label for a conversation surface. */
7
+ export declare function surfaceFallbackLabel(surface: ConversationSurface): string;
8
+ /** Select the most recently seen run independent of input ordering. */
9
+ export declare function newestRun(runs: ConversationSummaryReport[]): ConversationSummaryReport;
@@ -0,0 +1,4 @@
1
+ import { type ConversationReaderOptions } from "./context";
2
+ import type { ConversationStatsReport } from "./types";
3
+ export declare function readConversationStatsReport(options?: ConversationReaderOptions): Promise<ConversationStatsReport>;
4
+ /** List recent conversation summaries for plugin operational reports. */
@@ -0,0 +1,20 @@
1
+ import type { AgentTurnSessionSummary } from "@/chat/state/turn-session";
2
+ import type { Conversation as StoredConversation } from "@/chat/conversations/store";
3
+ import { type ConversationReaderOptions } from "./context";
4
+ import type { ConversationFeed, ConversationSummaryReport, ConversationSurface, PluginConversationSummary } from "./types";
5
+ /** Build the privacy-safe title shared by summary and detail reports. */
6
+ export declare function titleFromConversation(args: {
7
+ conversation: StoredConversation;
8
+ surface: ConversationSurface;
9
+ }): string;
10
+ /** Project the current stored execution into the public run summary shape. */
11
+ export declare function sessionReportFromConversation(conversation: StoredConversation, nowMs: number): ConversationSummaryReport;
12
+ /** Enrich a durable conversation projection with one complete turn summary. */
13
+ export declare function sessionReportFromTurnSummary(conversation: StoredConversation, summary: AgentTurnSessionSummary, nowMs: number): ConversationSummaryReport;
14
+ /** Read the recent conversation feed for reporting consumers. */
15
+ export declare function readConversationFeed(options?: ConversationReaderOptions): Promise<ConversationFeed>;
16
+ /** List recent conversation summaries for plugin operational reports. */
17
+ export declare function listRecentConversationSummaries(options?: {
18
+ limit?: number;
19
+ } & ConversationReaderOptions): Promise<PluginConversationSummary[]>;
20
+ /** Build the current run's reportable content from the current context epoch. */
@@ -0,0 +1,28 @@
1
+ import type { PiMessage } from "@/chat/pi/messages";
2
+ import type { ConversationSubagentActivityReport, ConversationSubagentTranscriptReport, TranscriptMessage } from "./types";
3
+ /** Normalize one provider transcript message into the reporting contract. */
4
+ export declare function normalizeTranscriptMessage(message: PiMessage, options?: {
5
+ unwrapAdvisorTask?: boolean;
6
+ }): TranscriptMessage;
7
+ /** Describe a redacted payload without exposing its contents. */
8
+ export declare function redactedPayloadFields(prefix: "input" | "output", value: unknown): {
9
+ [x: string]: string | number | string[];
10
+ };
11
+ /** Redact transcript payloads while retaining safe structural metadata. */
12
+ export declare function redactTranscriptMessage(message: TranscriptMessage): TranscriptMessage;
13
+ /** Count user-visible conversation messages in a normalized transcript. */
14
+ export declare function countConversationMessages(transcript: TranscriptMessage[]): number;
15
+ /** Read the latest trace identifier carried by a transcript message. */
16
+ export declare function traceIdFromTranscript(transcript: TranscriptMessage[]): string | undefined;
17
+ /** Build a subagent transcript response from its durable activity metadata. */
18
+ export declare function subagentTranscriptReport(activity: ConversationSubagentActivityReport, options?: {
19
+ subagentConversationId?: string;
20
+ subagentSentryConversationUrl?: string;
21
+ transcript?: TranscriptMessage[];
22
+ transcriptMessageCount?: number;
23
+ transcriptRedacted?: boolean;
24
+ transcriptRedactionReason?: "non_public_conversation";
25
+ transcriptExpired?: boolean;
26
+ transcriptExpiredAt?: string;
27
+ unavailableReason?: ConversationSubagentTranscriptReport["unavailableReason"];
28
+ }): ConversationSubagentTranscriptReport;