@sentry/junior 0.93.0 → 0.95.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.
- package/dist/{agent-hooks-ZG7IDOIN.js → agent-hooks-FTQ5EGPO.js} +9 -10
- package/dist/api/people/list.js +7 -7
- package/dist/api/people/profile.js +7 -7
- package/dist/api/people/shared.d.ts +2 -2
- package/dist/api-reference.d.ts +1 -1
- package/dist/app.js +474 -231
- package/dist/{catalog-runtime-NZHMSMYC.js → catalog-runtime-2D7IVKUT.js} +3 -3
- package/dist/chat/advisor-request.d.ts +4 -0
- package/dist/chat/agent/request.d.ts +2 -0
- package/dist/chat/agent/resume.d.ts +2 -0
- package/dist/chat/conversations/history.d.ts +128 -0
- package/dist/chat/conversations/legacy-import.d.ts +38 -0
- package/dist/chat/conversations/messages.d.ts +39 -0
- package/dist/chat/conversations/projection.d.ts +94 -0
- package/dist/chat/conversations/retention.d.ts +36 -0
- package/dist/chat/conversations/sql/conversation-row.d.ts +14 -0
- package/dist/chat/conversations/sql/history.d.ts +4 -0
- package/dist/chat/conversations/sql/legacy-history-import.d.ts +55 -0
- package/dist/chat/conversations/sql/messages.d.ts +4 -0
- package/dist/chat/conversations/sql/migrations.d.ts +14 -3
- package/dist/chat/conversations/sql/purge.d.ts +53 -0
- package/dist/chat/conversations/sql/store.d.ts +7 -2
- package/dist/chat/conversations/store.d.ts +19 -0
- package/dist/chat/conversations/visible-compactions.d.ts +11 -0
- package/dist/chat/conversations/visible-messages.d.ts +47 -0
- package/dist/chat/db.d.ts +12 -1
- package/dist/chat/egress/credentialed.d.ts +1 -1
- package/dist/chat/identities/sql.d.ts +1 -1
- package/dist/chat/logging.d.ts +2 -1
- package/dist/chat/resource-events/store.d.ts +2 -1
- package/dist/chat/runtime/reply-executor.d.ts +8 -0
- package/dist/chat/runtime/thread-state.d.ts +2 -0
- package/dist/chat/sandbox/egress/schemas.d.ts +4 -0
- package/dist/chat/sandbox/egress/session.d.ts +2 -2
- package/dist/chat/sandbox/resources.d.ts +4 -0
- package/dist/chat/services/mcp-auth-orchestration.d.ts +8 -0
- package/dist/chat/services/plugin-auth-orchestration.d.ts +12 -0
- package/dist/chat/services/turn-session-record.d.ts +14 -2
- package/dist/chat/sleep.d.ts +2 -0
- package/dist/chat/state/conversation.d.ts +7 -4
- package/dist/chat/state/session-log.d.ts +23 -1
- package/dist/chat/state/turn-session.d.ts +6 -0
- package/dist/chat/tool-support/private-trace-result.d.ts +4 -0
- package/dist/chat/tool-support/zod-tool.d.ts +1 -0
- package/dist/chat/tools/advisor/tool.d.ts +9 -4
- package/dist/chat/tools/definition.d.ts +2 -0
- package/dist/chat/tools/execution/tool-error-handler.d.ts +2 -2
- package/dist/chat/tools/system-time.d.ts +8 -0
- package/dist/chat/xml.d.ts +2 -0
- package/dist/{chunk-NYWPISSO.js → chunk-2XXEKR44.js} +1 -1
- package/dist/{chunk-QGEWC27H.js → chunk-5XMNOD3S.js} +5 -7
- package/dist/{chunk-NFXSLTYG.js → chunk-6ONME5IG.js} +864 -62
- package/dist/{chunk-LFLTJQVR.js → chunk-7FBGKXPE.js} +4 -0
- package/dist/{chunk-MC4ZZE4Q.js → chunk-AYP4ERVZ.js} +1 -1
- package/dist/{chunk-GHGPTPBL.js → chunk-B7PUBQQM.js} +1 -1
- package/dist/chunk-CM5EZD5F.js +17 -0
- package/dist/chunk-CRRBJ3JP.js +1037 -0
- package/dist/{chunk-G3E7SCME.js → chunk-CZEX6KIQ.js} +23 -0
- package/dist/{chunk-TNUUATT7.js → chunk-E3E2XNCN.js} +2 -2
- package/dist/{chunk-LNCREA5Z.js → chunk-EKNJM5IG.js} +3 -127
- package/dist/{chunk-NAPITCZ6.js → chunk-GUE7HTNR.js} +251 -6
- package/dist/{chunk-BTH37NCU.js → chunk-GVOUCI2O.js} +1 -1
- package/dist/{chunk-YYBX2BD5.js → chunk-GY34VGP5.js} +1 -1
- package/dist/{chunk-JJUJ4CO2.js → chunk-HCXXB35T.js} +1489 -360
- package/dist/{chunk-YTNPU7I2.js → chunk-HDTO3A74.js} +2 -2
- package/dist/{chunk-YJ4OPVNA.js → chunk-HZNJLKKI.js} +1 -1
- package/dist/{chunk-HDNWZMUN.js → chunk-KDPCGVIT.js} +116 -51
- package/dist/chunk-N4RNJ32C.js +48 -0
- package/dist/{chunk-UUB3D2XI.js → chunk-NSCHU54X.js} +8 -10
- package/dist/{chunk-PFXC67GJ.js → chunk-RAIB6WSG.js} +6 -80
- package/dist/chunk-WAGQ377B.js +724 -0
- package/dist/{chunk-6H4PP63X.js → chunk-WCMQJE4F.js} +24 -14
- package/dist/{chunk-S6QKIGRM.js → chunk-WPOJ443W.js} +15 -25
- package/dist/{chunk-MAVOJ54A.js → chunk-XX4N4E6C.js} +25 -388
- package/dist/cli/chat.js +24 -23
- package/dist/cli/check.js +4 -4
- package/dist/cli/plugins.js +11 -12
- package/dist/cli/snapshot-warmup.js +7 -8
- package/dist/cli/upgrade.js +78 -17
- package/dist/db/schema/agent-steps.d.ts +134 -0
- package/dist/db/schema/conversation-messages.d.ts +153 -0
- package/dist/{chat/conversations/sql → db}/schema/conversations.d.ts +34 -0
- package/dist/{chat/conversations/sql → db}/schema.d.ts +319 -8
- package/dist/db-W55B74OP.js +24 -0
- package/dist/deployment.d.ts +2 -0
- package/dist/handlers/retention.d.ts +6 -0
- package/dist/instrumentation.js +16 -3
- package/dist/legacy-import-ZPLGLAFD.js +17 -0
- package/dist/nitro.js +14 -4
- package/dist/reporting/conversations/activity.d.ts +40 -0
- package/dist/reporting/conversations/context.d.ts +8 -0
- package/dist/reporting/conversations/details.d.ts +6 -0
- package/dist/reporting/conversations/index.d.ts +4 -0
- package/dist/reporting/conversations/shared.d.ts +9 -0
- package/dist/reporting/conversations/statistics.d.ts +4 -0
- package/dist/reporting/conversations/summaries.d.ts +17 -0
- package/dist/reporting/conversations/transcript.d.ts +28 -0
- package/dist/reporting/conversations/types.d.ts +178 -0
- package/dist/reporting/conversations.d.ts +1 -178
- package/dist/reporting.d.ts +4 -3
- package/dist/reporting.js +603 -827
- package/dist/{runner-XAZPJNAQ.js → runner-OOSBDYRK.js} +35 -41
- package/dist/{validation-KYAWETI4.js → validation-QCGRFRFZ.js} +4 -4
- package/migrations/README.md +32 -0
- package/migrations/meta/0000_snapshot.json +978 -0
- package/migrations/meta/_journal.json +13 -0
- package/package.json +9 -6
- package/dist/chat/sql/schema.d.ts +0 -1049
- package/dist/chat/state/conversation-details.d.ts +0 -47
- package/dist/chunk-7STN2ZSK.js +0 -250
- package/dist/chunk-LE5ANBUZ.js +0 -1040
- package/dist/chunk-QL66APYJ.js +0 -1377
- package/dist/db-YDN6AFJH.js +0 -18
- /package/dist/{chat/sql → db}/db.d.ts +0 -0
- /package/dist/{chat/sql → db}/executor.d.ts +0 -0
- /package/dist/{chat/sql → db}/neon.d.ts +0 -0
- /package/dist/{chat/sql → db}/postgres.d.ts +0 -0
- /package/dist/{chat/conversations/sql → db}/schema/destinations.d.ts +0 -0
- /package/dist/{chat/conversations/sql → db}/schema/identities.d.ts +0 -0
- /package/dist/{chat/conversations/sql → db}/schema/migrations.d.ts +0 -0
- /package/dist/{chat/conversations/sql → db}/schema/timestamps.d.ts +0 -0
- /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
|
|
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("
|
|
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("
|
|
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-6ONME5IG.js";
|
|
9
|
+
import "./chunk-GUE7HTNR.js";
|
|
10
|
+
import "./chunk-GY34VGP5.js";
|
|
11
|
+
import "./chunk-B7PUBQQM.js";
|
|
12
|
+
import "./chunk-WPOJ443W.js";
|
|
13
|
+
import "./chunk-OB42YVAE.js";
|
|
14
|
+
import "./chunk-3DA7X2U3.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
|
+
};
|
package/dist/deployment.d.ts
CHANGED
|
@@ -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>;
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
consumePrivateTraceResultMarker
|
|
3
|
+
} from "./chunk-CM5EZD5F.js";
|
|
1
4
|
import {
|
|
2
5
|
getCurrentConversationPrivacy
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GY34VGP5.js";
|
|
4
7
|
import "./chunk-OB42YVAE.js";
|
|
5
8
|
import {
|
|
6
9
|
getClient,
|
|
@@ -12,7 +15,7 @@ import {
|
|
|
12
15
|
import {
|
|
13
16
|
getDeploymentServiceVersion,
|
|
14
17
|
getDeploymentTelemetryAttributes
|
|
15
|
-
} from "./chunk-
|
|
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
|
-
|
|
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-CRRBJ3JP.js";
|
|
5
|
+
import "./chunk-6ONME5IG.js";
|
|
6
|
+
import "./chunk-GUE7HTNR.js";
|
|
7
|
+
import "./chunk-GY34VGP5.js";
|
|
8
|
+
import "./chunk-B7PUBQQM.js";
|
|
9
|
+
import "./chunk-WPOJ443W.js";
|
|
10
|
+
import "./chunk-OB42YVAE.js";
|
|
11
|
+
import "./chunk-3DA7X2U3.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-
|
|
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-
|
|
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
|
-
|
|
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,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,17 @@
|
|
|
1
|
+
import type { Conversation as StoredConversation } from "@/chat/conversations/store";
|
|
2
|
+
import { type ConversationReaderOptions } from "./context";
|
|
3
|
+
import type { ConversationFeed, ConversationSummaryReport, ConversationSurface, PluginConversationSummary } from "./types";
|
|
4
|
+
/** Build the privacy-safe title shared by summary and detail reports. */
|
|
5
|
+
export declare function titleFromConversation(args: {
|
|
6
|
+
conversation: StoredConversation;
|
|
7
|
+
surface: ConversationSurface;
|
|
8
|
+
}): string;
|
|
9
|
+
/** Project the current stored execution into the public run summary shape. */
|
|
10
|
+
export declare function sessionReportFromConversation(conversation: StoredConversation, nowMs: number): ConversationSummaryReport;
|
|
11
|
+
/** Read the recent conversation feed for reporting consumers. */
|
|
12
|
+
export declare function readConversationFeed(options?: ConversationReaderOptions): Promise<ConversationFeed>;
|
|
13
|
+
/** List recent conversation summaries for plugin operational reports. */
|
|
14
|
+
export declare function listRecentConversationSummaries(options?: {
|
|
15
|
+
limit?: number;
|
|
16
|
+
} & ConversationReaderOptions): Promise<PluginConversationSummary[]>;
|
|
17
|
+
/** 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;
|