@sentry/junior 0.154.0 → 0.156.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-VEHV2QUA.js → agent-hooks-CCAR46PQ.js} +11 -12
- package/dist/api/conversations/list.d.ts +5 -3
- package/dist/api/conversations/membership.d.ts +16 -0
- package/dist/api/locations/detail.d.ts +2 -0
- package/dist/api/schema/conversation.d.ts +22 -4
- package/dist/api/schema/location.d.ts +2 -0
- package/dist/api/schema/person.d.ts +2 -0
- package/dist/api/schema.js +1 -1
- package/dist/api.js +331 -188
- package/dist/app.js +154 -51
- package/dist/catalog-runtime-3SNKYCBG.js +16 -0
- package/dist/chat/agent/types.d.ts +2 -0
- package/dist/chat/attachments/storage.d.ts +12 -0
- package/dist/chat/attachments/store.d.ts +52 -0
- package/dist/chat/attachments/vercel.d.ts +3 -0
- package/dist/chat/conversations/retention.d.ts +4 -0
- package/dist/chat/conversations/sql/event-actor.d.ts +14 -0
- package/dist/chat/conversations/sql/event-lock.d.ts +1 -1
- package/dist/chat/conversations/sql/participants.d.ts +17 -0
- package/dist/chat/ingress/bot-mention.d.ts +13 -0
- package/dist/chat/plugins/unfinished-work.d.ts +8 -0
- package/dist/chat/runtime/agent-runner.d.ts +4 -0
- package/dist/chat/runtime/slack-resume.d.ts +1 -1
- package/dist/chat/services/conversation-memory.d.ts +1 -1
- package/dist/chat/slack/tools/send-files.d.ts +17 -11
- package/dist/chat/state/conversation.d.ts +3 -1
- package/dist/chat/tools/types.d.ts +2 -0
- package/dist/{chunk-XYMCZGH6.js → chunk-3FFUC32L.js} +8 -10
- package/dist/{chunk-4U4MNYGP.js → chunk-3L2PMOSR.js} +6 -8
- package/dist/{chunk-PTJ75ZWR.js → chunk-4ZZDTHFC.js} +94 -9
- package/dist/{chunk-DAJZZFU7.js → chunk-53W3LZEW.js} +386 -93
- package/dist/{chunk-F7QUK3YP.js → chunk-6CINHXIL.js} +5 -5
- package/dist/{chunk-6VWMX7NS.js → chunk-6JUU7J2B.js} +4 -4
- package/dist/{chunk-HUO3UTAQ.js → chunk-7MA4HV4W.js} +1 -1
- package/dist/{chunk-O4AQDOKA.js → chunk-7RAETIYO.js} +7 -7
- package/dist/{chunk-4R2XCKUH.js → chunk-A6WPDFHQ.js} +1 -1
- package/dist/{chunk-CZD6M57V.js → chunk-AIJRG227.js} +191 -126
- package/dist/{chunk-RUIXF3YQ.js → chunk-BDUENQD3.js} +1 -1
- package/dist/{chunk-NUG3VYHL.js → chunk-CK2H7CFO.js} +2 -2
- package/dist/{chunk-HOGJ6TBT.js → chunk-CN2XSVKF.js} +6 -6
- package/dist/{chunk-3567VGCN.js → chunk-EDJ64P2P.js} +1 -1
- package/dist/{chunk-6PJXR4BC.js → chunk-GKC43TLS.js} +2 -2
- package/dist/{chunk-A6LWN4K6.js → chunk-GSBPZHLQ.js} +11 -11
- package/dist/{chunk-Y654CTW2.js → chunk-IIO5PFZX.js} +366 -138
- package/dist/{chunk-F2Q3ZHW2.js → chunk-IZEBHYI4.js} +1 -1
- package/dist/{chunk-QGR6QTC4.js → chunk-JUJR6WTL.js} +4 -4
- package/dist/{chunk-ZQT4RHUO.js → chunk-KBGMYLSV.js} +4 -1
- package/dist/{chunk-DK2FSQHS.js → chunk-KCA5MKHU.js} +5 -5
- package/dist/{chunk-NNN2WYAD.js → chunk-MC57E5U5.js} +1 -1
- package/dist/{chunk-6AF5GOZA.js → chunk-MJE7XKWP.js} +1 -1
- package/dist/{chunk-7CPN5JTA.js → chunk-NTNU6T2D.js} +3 -3
- package/dist/{chunk-NG4IAOVD.js → chunk-OGZPRMZA.js} +1 -1
- package/dist/{chunk-UCH55IGZ.js → chunk-OMQJB7YN.js} +28 -37
- package/dist/{chunk-2XNVS6RC.js → chunk-PMFGVLDU.js} +12 -11
- package/dist/{chunk-65IAU2L2.js → chunk-SE3D225X.js} +1 -1
- package/dist/{chunk-CCAU73CE.js → chunk-SRJA6QLM.js} +2 -2
- package/dist/{chunk-7RFWIHPM.js → chunk-TN4LVILT.js} +5 -5
- package/dist/{chunk-3ZR2R5EQ.js → chunk-TNXGMFWV.js} +1 -1
- package/dist/{chunk-HZF5P5UN.js → chunk-V7YE4WCP.js} +58 -7
- package/dist/{chunk-MSOZLASC.js → chunk-WD7SEUZO.js} +2 -2
- package/dist/{chunk-UG5UCHHJ.js → chunk-X5NZQH5U.js} +4 -2
- package/dist/{chunk-3HX67UPN.js → chunk-X7W45B5G.js} +1 -1
- package/dist/{chunk-FVY7AJ46.js → chunk-ZNWRYNCA.js} +7 -7
- package/dist/cli/chat.js +36 -36
- package/dist/cli/check.js +8 -9
- package/dist/cli/init.js +41 -7
- package/dist/cli/plugins.js +15 -16
- package/dist/cli/snapshot-create.js +11 -12
- package/dist/cli/upgrade.js +9 -10
- package/dist/db/schema/attachments.d.ts +178 -0
- package/dist/db/schema/conversation-events.d.ts +20 -0
- package/dist/db/schema/conversation-participants.d.ts +63 -0
- package/dist/db/schema.d.ts +255 -1
- package/dist/{db-SOJJLMJK.js → db-TYUUKGJX.js} +8 -8
- package/dist/handlers/retention.d.ts +4 -1
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-GCJROMVO.js → oauth-callback-server-AWVDKPR5.js} +26 -26
- package/dist/{runner-SY6KDQCN.js → runner-JUQXMACC.js} +15 -16
- package/dist/{sandbox-egress-signals-EKPAVWQL.js → sandbox-egress-signals-U3ZX7C5W.js} +3 -4
- package/dist/{skills-XJ2LJ2ML.js → skills-4GZTZX4V.js} +8 -9
- package/dist/spawn-32SSRWU4.js +37 -0
- package/dist/{validation-XQWY6QRY.js → validation-DRLNJRND.js} +8 -9
- package/dist/version.js +1 -1
- package/dist/{work-FFT5JAOU.js → work-TGIXRRJY.js} +20 -21
- package/dist/worker-IFXZOYED.js +24 -0
- package/migrations/0026_conversation_event_actor_and_participants.sql +140 -0
- package/migrations/0027_attachment_storage.sql +16 -0
- package/migrations/meta/0026_snapshot.json +2424 -0
- package/migrations/meta/0027_snapshot.json +2554 -0
- package/migrations/meta/_journal.json +15 -1
- package/package.json +10 -7
- package/dist/catalog-runtime-AK5MY63F.js +0 -17
- package/dist/chunk-F3B2YJ76.js +0 -57
- package/dist/spawn-QFCQREEP.js +0 -38
- package/dist/worker-JAITK72F.js +0 -25
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_SQL_STATEMENT_TIMEOUT_MS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GKC43TLS.js";
|
|
4
4
|
import {
|
|
5
5
|
juniorDestinations,
|
|
6
6
|
timestamptz
|
|
@@ -14,14 +14,8 @@ import {
|
|
|
14
14
|
import { drizzle } from "drizzle-orm/neon-serverless";
|
|
15
15
|
import { migrate } from "drizzle-orm/neon-serverless/migrator";
|
|
16
16
|
|
|
17
|
-
// src/db/schema/
|
|
18
|
-
import {
|
|
19
|
-
foreignKey,
|
|
20
|
-
jsonb as jsonb3,
|
|
21
|
-
pgTable as pgTable4,
|
|
22
|
-
primaryKey,
|
|
23
|
-
text as text4
|
|
24
|
-
} from "drizzle-orm/pg-core";
|
|
17
|
+
// src/db/schema/attachments.ts
|
|
18
|
+
import { index as index3, integer as integer2, pgTable as pgTable4, text as text4 } from "drizzle-orm/pg-core";
|
|
25
19
|
|
|
26
20
|
// src/db/schema/conversations.ts
|
|
27
21
|
import { sql as sql2 } from "drizzle-orm";
|
|
@@ -179,14 +173,49 @@ var juniorConversations = pgTable3(
|
|
|
179
173
|
]
|
|
180
174
|
);
|
|
181
175
|
|
|
176
|
+
// src/db/schema/attachments.ts
|
|
177
|
+
var juniorAttachments = pgTable4(
|
|
178
|
+
"junior_attachments",
|
|
179
|
+
{
|
|
180
|
+
id: text4("id").primaryKey(),
|
|
181
|
+
conversationId: text4("conversation_id").notNull().references(() => juniorConversations.conversationId, {
|
|
182
|
+
onDelete: "cascade"
|
|
183
|
+
}),
|
|
184
|
+
provider: text4("provider").notNull(),
|
|
185
|
+
storageKey: text4("storage_key").notNull(),
|
|
186
|
+
filename: text4("filename").notNull(),
|
|
187
|
+
contentType: text4("content_type").notNull(),
|
|
188
|
+
bytes: integer2("bytes").notNull(),
|
|
189
|
+
sha256: text4("sha256").notNull(),
|
|
190
|
+
createdAt: timestamptz("created_at").notNull(),
|
|
191
|
+
/** Set when conversation purge marks the attachment unavailable. */
|
|
192
|
+
deleteRequestedAt: timestamptz("delete_requested_at")
|
|
193
|
+
},
|
|
194
|
+
(table) => [
|
|
195
|
+
index3("junior_attachments_conversation_idx").on(table.conversationId),
|
|
196
|
+
index3("junior_attachments_gc_idx").on(
|
|
197
|
+
table.provider,
|
|
198
|
+
table.deleteRequestedAt,
|
|
199
|
+
table.createdAt
|
|
200
|
+
)
|
|
201
|
+
]
|
|
202
|
+
);
|
|
203
|
+
|
|
182
204
|
// src/db/schema/conversation-annotations.ts
|
|
183
|
-
|
|
205
|
+
import {
|
|
206
|
+
foreignKey,
|
|
207
|
+
jsonb as jsonb3,
|
|
208
|
+
pgTable as pgTable5,
|
|
209
|
+
primaryKey,
|
|
210
|
+
text as text5
|
|
211
|
+
} from "drizzle-orm/pg-core";
|
|
212
|
+
var juniorConversationAnnotations = pgTable5(
|
|
184
213
|
"junior_conversation_annotations",
|
|
185
214
|
{
|
|
186
|
-
conversationId:
|
|
187
|
-
plugin:
|
|
188
|
-
kind:
|
|
189
|
-
key:
|
|
215
|
+
conversationId: text5("conversation_id").notNull(),
|
|
216
|
+
plugin: text5("plugin").notNull(),
|
|
217
|
+
kind: text5("kind").notNull(),
|
|
218
|
+
key: text5("key").notNull(),
|
|
190
219
|
annotation: jsonb3("annotation_json").$type().notNull(),
|
|
191
220
|
createdAt: timestamptz("created_at").notNull(),
|
|
192
221
|
updatedAt: timestamptz("updated_at").notNull()
|
|
@@ -205,15 +234,15 @@ var juniorConversationAnnotations = pgTable4(
|
|
|
205
234
|
);
|
|
206
235
|
|
|
207
236
|
// src/db/schema/api-tokens.ts
|
|
208
|
-
import { index as
|
|
209
|
-
var juniorApiTokens =
|
|
237
|
+
import { index as index4, pgTable as pgTable6, text as text6, uniqueIndex as uniqueIndex3 } from "drizzle-orm/pg-core";
|
|
238
|
+
var juniorApiTokens = pgTable6(
|
|
210
239
|
"junior_api_tokens",
|
|
211
240
|
{
|
|
212
|
-
id:
|
|
213
|
-
ownerEmailNormalized:
|
|
214
|
-
name:
|
|
215
|
-
tokenHash:
|
|
216
|
-
tokenSuffix:
|
|
241
|
+
id: text6("id").primaryKey(),
|
|
242
|
+
ownerEmailNormalized: text6("owner_email_normalized").notNull(),
|
|
243
|
+
name: text6("name").notNull(),
|
|
244
|
+
tokenHash: text6("token_hash").notNull(),
|
|
245
|
+
tokenSuffix: text6("token_suffix").notNull(),
|
|
217
246
|
createdAt: timestamptz("created_at").notNull(),
|
|
218
247
|
expiresAt: timestamptz("expires_at").notNull(),
|
|
219
248
|
lastUsedAt: timestamptz("last_used_at"),
|
|
@@ -221,32 +250,35 @@ var juniorApiTokens = pgTable5(
|
|
|
221
250
|
},
|
|
222
251
|
(table) => [
|
|
223
252
|
uniqueIndex3("junior_api_tokens_token_hash_uidx").on(table.tokenHash),
|
|
224
|
-
|
|
253
|
+
index4("junior_api_tokens_owner_email_idx").on(table.ownerEmailNormalized)
|
|
225
254
|
]
|
|
226
255
|
);
|
|
227
256
|
|
|
228
257
|
// src/db/schema/conversation-events.ts
|
|
229
258
|
import {
|
|
230
259
|
foreignKey as foreignKey2,
|
|
231
|
-
index as
|
|
232
|
-
integer as
|
|
260
|
+
index as index5,
|
|
261
|
+
integer as integer3,
|
|
233
262
|
jsonb as jsonb4,
|
|
234
|
-
pgTable as
|
|
263
|
+
pgTable as pgTable7,
|
|
235
264
|
primaryKey as primaryKey2,
|
|
236
|
-
text as
|
|
265
|
+
text as text7,
|
|
237
266
|
uniqueIndex as uniqueIndex4
|
|
238
267
|
} from "drizzle-orm/pg-core";
|
|
239
268
|
import { sql as sql3 } from "drizzle-orm";
|
|
240
|
-
var juniorConversationEvents =
|
|
269
|
+
var juniorConversationEvents = pgTable7(
|
|
241
270
|
"junior_conversation_events",
|
|
242
271
|
{
|
|
243
|
-
conversationId:
|
|
244
|
-
seq:
|
|
245
|
-
historyVersion:
|
|
246
|
-
schemaVersion:
|
|
247
|
-
idempotencyKey:
|
|
248
|
-
type:
|
|
272
|
+
conversationId: text7("conversation_id").notNull(),
|
|
273
|
+
seq: integer3("seq").notNull(),
|
|
274
|
+
historyVersion: integer3("history_version").notNull(),
|
|
275
|
+
schemaVersion: integer3("schema_version").default(1).notNull(),
|
|
276
|
+
idempotencyKey: text7("idempotency_key"),
|
|
277
|
+
type: text7("type").notNull(),
|
|
249
278
|
payload: jsonb4("payload").$type().notNull(),
|
|
279
|
+
actorIdentityId: text7("actor_identity_id").references(
|
|
280
|
+
() => juniorIdentities.id
|
|
281
|
+
),
|
|
250
282
|
createdAt: timestamptz("created_at").notNull()
|
|
251
283
|
},
|
|
252
284
|
(table) => [
|
|
@@ -259,17 +291,22 @@ var juniorConversationEvents = pgTable6(
|
|
|
259
291
|
columns: [table.conversationId],
|
|
260
292
|
foreignColumns: [juniorConversations.conversationId]
|
|
261
293
|
}),
|
|
262
|
-
|
|
294
|
+
index5("junior_conversation_events_history_version_idx").on(
|
|
263
295
|
table.conversationId,
|
|
264
296
|
table.historyVersion,
|
|
265
297
|
table.seq
|
|
266
298
|
),
|
|
267
|
-
|
|
299
|
+
index5("junior_conversation_events_type_idx").on(
|
|
268
300
|
table.conversationId,
|
|
269
301
|
table.type,
|
|
270
302
|
table.seq
|
|
271
303
|
),
|
|
272
|
-
|
|
304
|
+
index5("junior_conversation_events_actor_identity_idx").on(
|
|
305
|
+
table.actorIdentityId,
|
|
306
|
+
table.conversationId,
|
|
307
|
+
table.seq
|
|
308
|
+
),
|
|
309
|
+
index5("junior_conversation_events_message_search_idx").using("gin", sql3`to_tsvector('english', ${table.payload}->>'text')`).where(sql3`${table.type} = 'message'`),
|
|
273
310
|
uniqueIndex4("junior_conversation_events_idempotency_idx").on(
|
|
274
311
|
table.conversationId,
|
|
275
312
|
table.idempotencyKey
|
|
@@ -278,15 +315,15 @@ var juniorConversationEvents = pgTable6(
|
|
|
278
315
|
);
|
|
279
316
|
|
|
280
317
|
// src/db/schema/conversation-bindings.ts
|
|
281
|
-
import { index as
|
|
282
|
-
var juniorConversationBindings =
|
|
318
|
+
import { index as index6, pgTable as pgTable8, primaryKey as primaryKey3, text as text8 } from "drizzle-orm/pg-core";
|
|
319
|
+
var juniorConversationBindings = pgTable8(
|
|
283
320
|
"junior_conversation_bindings",
|
|
284
321
|
{
|
|
285
|
-
conversationId:
|
|
286
|
-
provider:
|
|
287
|
-
providerTenantId:
|
|
288
|
-
providerDestinationId:
|
|
289
|
-
providerConversationId:
|
|
322
|
+
conversationId: text8("conversation_id").notNull().references(() => juniorConversations.conversationId),
|
|
323
|
+
provider: text8("provider").notNull(),
|
|
324
|
+
providerTenantId: text8("provider_tenant_id").notNull().default(""),
|
|
325
|
+
providerDestinationId: text8("provider_destination_id").notNull(),
|
|
326
|
+
providerConversationId: text8("provider_conversation_id").notNull(),
|
|
290
327
|
createdAt: timestamptz("created_at").notNull()
|
|
291
328
|
},
|
|
292
329
|
(table) => [
|
|
@@ -299,34 +336,58 @@ var juniorConversationBindings = pgTable7(
|
|
|
299
336
|
table.providerConversationId
|
|
300
337
|
]
|
|
301
338
|
}),
|
|
302
|
-
|
|
339
|
+
index6("junior_conversation_bindings_conversation_idx").on(
|
|
303
340
|
table.conversationId
|
|
304
341
|
)
|
|
305
342
|
]
|
|
306
343
|
);
|
|
307
344
|
|
|
345
|
+
// src/db/schema/conversation-participants.ts
|
|
346
|
+
import { index as index7, pgTable as pgTable9, primaryKey as primaryKey4, text as text9 } from "drizzle-orm/pg-core";
|
|
347
|
+
var juniorConversationParticipants = pgTable9(
|
|
348
|
+
"junior_conversation_participants",
|
|
349
|
+
{
|
|
350
|
+
userId: text9("user_id").notNull().references(() => juniorUsers.id),
|
|
351
|
+
rootConversationId: text9("root_conversation_id").notNull().references(() => juniorConversations.conversationId),
|
|
352
|
+
lastMessageAt: timestamptz("last_message_at").notNull()
|
|
353
|
+
},
|
|
354
|
+
(table) => [
|
|
355
|
+
primaryKey4({
|
|
356
|
+
name: "junior_conversation_participants_user_root_pk",
|
|
357
|
+
columns: [table.userId, table.rootConversationId]
|
|
358
|
+
}),
|
|
359
|
+
index7("junior_conversation_participants_user_activity_idx").on(
|
|
360
|
+
table.userId,
|
|
361
|
+
table.lastMessageAt.desc()
|
|
362
|
+
),
|
|
363
|
+
index7("junior_conversation_participants_root_idx").on(
|
|
364
|
+
table.rootConversationId
|
|
365
|
+
)
|
|
366
|
+
]
|
|
367
|
+
);
|
|
368
|
+
|
|
308
369
|
// src/db/schema/agent-invocations.ts
|
|
309
370
|
import {
|
|
310
|
-
index as
|
|
371
|
+
index as index8,
|
|
311
372
|
jsonb as jsonb5,
|
|
312
|
-
pgTable as
|
|
313
|
-
primaryKey as
|
|
314
|
-
text as
|
|
373
|
+
pgTable as pgTable10,
|
|
374
|
+
primaryKey as primaryKey5,
|
|
375
|
+
text as text10,
|
|
315
376
|
uniqueIndex as uniqueIndex5
|
|
316
377
|
} from "drizzle-orm/pg-core";
|
|
317
378
|
var AGENT_INVOCATION_MAILBOX_STATUSES = [
|
|
318
379
|
"pending",
|
|
319
380
|
"appended"
|
|
320
381
|
];
|
|
321
|
-
var juniorAgentBindings =
|
|
382
|
+
var juniorAgentBindings = pgTable10(
|
|
322
383
|
"junior_agent_bindings",
|
|
323
384
|
{
|
|
324
|
-
parentConversationId:
|
|
325
|
-
name:
|
|
326
|
-
childConversationId:
|
|
385
|
+
parentConversationId: text10("parent_conversation_id").notNull().references(() => juniorConversations.conversationId),
|
|
386
|
+
name: text10("name").notNull(),
|
|
387
|
+
childConversationId: text10("child_conversation_id").notNull().references(() => juniorConversations.conversationId)
|
|
327
388
|
},
|
|
328
389
|
(table) => [
|
|
329
|
-
|
|
390
|
+
primaryKey5({
|
|
330
391
|
columns: [table.parentConversationId, table.name]
|
|
331
392
|
}),
|
|
332
393
|
uniqueIndex5("junior_agent_bindings_child_idx").on(
|
|
@@ -334,35 +395,35 @@ var juniorAgentBindings = pgTable8(
|
|
|
334
395
|
)
|
|
335
396
|
]
|
|
336
397
|
);
|
|
337
|
-
var juniorAgentInvocations =
|
|
398
|
+
var juniorAgentInvocations = pgTable10(
|
|
338
399
|
"junior_agent_invocations",
|
|
339
400
|
{
|
|
340
|
-
invocationId:
|
|
341
|
-
parentConversationId:
|
|
342
|
-
childConversationId:
|
|
343
|
-
agentName:
|
|
344
|
-
input:
|
|
401
|
+
invocationId: text10("invocation_id").primaryKey(),
|
|
402
|
+
parentConversationId: text10("parent_conversation_id").notNull().references(() => juniorConversations.conversationId),
|
|
403
|
+
childConversationId: text10("child_conversation_id").notNull().references(() => juniorConversations.conversationId),
|
|
404
|
+
agentName: text10("agent_name"),
|
|
405
|
+
input: text10("input").notNull(),
|
|
345
406
|
actor: jsonb5("actor_json").$type().notNull(),
|
|
346
407
|
credentialContext: jsonb5(
|
|
347
408
|
"credential_context_json"
|
|
348
409
|
).$type(),
|
|
349
410
|
source: jsonb5("source_json").$type().notNull(),
|
|
350
411
|
destination: jsonb5("destination_json").$type().notNull(),
|
|
351
|
-
destinationVisibility:
|
|
412
|
+
destinationVisibility: text10(
|
|
352
413
|
"destination_visibility"
|
|
353
414
|
).$type(),
|
|
354
|
-
reasoningLevel:
|
|
355
|
-
status:
|
|
356
|
-
mailboxStatus:
|
|
357
|
-
result:
|
|
358
|
-
errorMessage:
|
|
415
|
+
reasoningLevel: text10("reasoning_level").$type(),
|
|
416
|
+
status: text10("status").$type().notNull(),
|
|
417
|
+
mailboxStatus: text10("mailbox_status").$type().notNull(),
|
|
418
|
+
result: text10("result"),
|
|
419
|
+
errorMessage: text10("error_message"),
|
|
359
420
|
createdAt: timestamptz("created_at").notNull(),
|
|
360
421
|
updatedAt: timestamptz("updated_at").notNull(),
|
|
361
422
|
terminalAt: timestamptz("terminal_at")
|
|
362
423
|
},
|
|
363
424
|
(table) => [
|
|
364
|
-
|
|
365
|
-
|
|
425
|
+
index8("junior_agent_invocations_child_idx").on(table.childConversationId),
|
|
426
|
+
index8("junior_agent_invocations_mailbox_idx").on(
|
|
366
427
|
table.mailboxStatus,
|
|
367
428
|
table.createdAt
|
|
368
429
|
)
|
|
@@ -370,42 +431,42 @@ var juniorAgentInvocations = pgTable8(
|
|
|
370
431
|
);
|
|
371
432
|
|
|
372
433
|
// src/db/schema/location-configurations.ts
|
|
373
|
-
import { pgTable as
|
|
374
|
-
var juniorLocationConfigurations =
|
|
434
|
+
import { pgTable as pgTable11, primaryKey as primaryKey6, text as text11 } from "drizzle-orm/pg-core";
|
|
435
|
+
var juniorLocationConfigurations = pgTable11(
|
|
375
436
|
"junior_location_configurations",
|
|
376
437
|
{
|
|
377
|
-
locationId:
|
|
378
|
-
key:
|
|
379
|
-
value:
|
|
438
|
+
locationId: text11("location_id").notNull().references(() => juniorDestinations.id, { onDelete: "cascade" }),
|
|
439
|
+
key: text11("key").notNull(),
|
|
440
|
+
value: text11("value").notNull(),
|
|
380
441
|
updatedAt: timestamptz("updated_at").notNull(),
|
|
381
|
-
updatedBy:
|
|
382
|
-
source:
|
|
383
|
-
expiresAt:
|
|
442
|
+
updatedBy: text11("updated_by"),
|
|
443
|
+
source: text11("source"),
|
|
444
|
+
expiresAt: text11("expires_at")
|
|
384
445
|
},
|
|
385
|
-
(table) => [
|
|
446
|
+
(table) => [primaryKey6({ columns: [table.locationId, table.key] })]
|
|
386
447
|
);
|
|
387
448
|
|
|
388
449
|
// src/db/schema/event-tasks.ts
|
|
389
|
-
import { bigint, index as
|
|
390
|
-
var juniorEventTasks =
|
|
450
|
+
import { bigint, index as index9, jsonb as jsonb6, pgTable as pgTable12, text as text12 } from "drizzle-orm/pg-core";
|
|
451
|
+
var juniorEventTasks = pgTable12(
|
|
391
452
|
"junior_event_tasks",
|
|
392
453
|
{
|
|
393
|
-
id:
|
|
394
|
-
teamId:
|
|
395
|
-
namespace:
|
|
396
|
-
identifier:
|
|
454
|
+
id: text12("id").primaryKey(),
|
|
455
|
+
teamId: text12("team_id").notNull(),
|
|
456
|
+
namespace: text12("namespace").notNull(),
|
|
457
|
+
identifier: text12("identifier").notNull(),
|
|
397
458
|
createdAtMs: bigint("created_at_ms", { mode: "number" }).notNull(),
|
|
398
459
|
/** Short display title generated from the task instruction. */
|
|
399
|
-
title:
|
|
460
|
+
title: text12("title"),
|
|
400
461
|
task: jsonb6("task_json").$type().notNull()
|
|
401
462
|
},
|
|
402
463
|
(table) => [
|
|
403
|
-
|
|
464
|
+
index9("junior_event_tasks_team_idx").on(
|
|
404
465
|
table.teamId,
|
|
405
466
|
table.createdAtMs,
|
|
406
467
|
table.id
|
|
407
468
|
),
|
|
408
|
-
|
|
469
|
+
index9("junior_event_tasks_match_idx").on(
|
|
409
470
|
table.namespace,
|
|
410
471
|
table.identifier,
|
|
411
472
|
table.createdAtMs,
|
|
@@ -415,18 +476,18 @@ var juniorEventTasks = pgTable10(
|
|
|
415
476
|
);
|
|
416
477
|
|
|
417
478
|
// src/db/schema/stats.ts
|
|
418
|
-
import { date, integer as
|
|
419
|
-
var juniorStats =
|
|
479
|
+
import { date, integer as integer4, pgTable as pgTable13, primaryKey as primaryKey7, text as text13 } from "drizzle-orm/pg-core";
|
|
480
|
+
var juniorStats = pgTable13(
|
|
420
481
|
"junior_stats",
|
|
421
482
|
{
|
|
422
483
|
date: date("date", { mode: "string" }).notNull(),
|
|
423
|
-
namespace:
|
|
424
|
-
metric:
|
|
425
|
-
name:
|
|
426
|
-
count:
|
|
484
|
+
namespace: text13("namespace").notNull(),
|
|
485
|
+
metric: text13("metric").notNull(),
|
|
486
|
+
name: text13("name").notNull(),
|
|
487
|
+
count: integer4("count").notNull().default(0)
|
|
427
488
|
},
|
|
428
489
|
(table) => [
|
|
429
|
-
|
|
490
|
+
primaryKey7({
|
|
430
491
|
name: "junior_stats_date_namespace_metric_name_pk",
|
|
431
492
|
columns: [table.date, table.namespace, table.metric, table.name]
|
|
432
493
|
})
|
|
@@ -439,21 +500,21 @@ import {
|
|
|
439
500
|
bigint as bigint2,
|
|
440
501
|
check,
|
|
441
502
|
foreignKey as foreignKey3,
|
|
442
|
-
index as
|
|
443
|
-
pgTable as
|
|
444
|
-
primaryKey as
|
|
445
|
-
text as
|
|
503
|
+
index as index10,
|
|
504
|
+
pgTable as pgTable14,
|
|
505
|
+
primaryKey as primaryKey8,
|
|
506
|
+
text as text14
|
|
446
507
|
} from "drizzle-orm/pg-core";
|
|
447
|
-
var juniorTaskExecutions =
|
|
508
|
+
var juniorTaskExecutions = pgTable14(
|
|
448
509
|
"junior_task_executions",
|
|
449
510
|
{
|
|
450
|
-
executionId:
|
|
451
|
-
kind:
|
|
452
|
-
namespace:
|
|
453
|
-
taskId:
|
|
454
|
-
conversationId:
|
|
511
|
+
executionId: text14("execution_id").notNull(),
|
|
512
|
+
kind: text14("kind").notNull(),
|
|
513
|
+
namespace: text14("namespace").notNull(),
|
|
514
|
+
taskId: text14("task_id").notNull(),
|
|
515
|
+
conversationId: text14("conversation_id"),
|
|
455
516
|
executedAtMs: bigint2("executed_at_ms", { mode: "number" }).notNull(),
|
|
456
|
-
status:
|
|
517
|
+
status: text14("status").$type().notNull()
|
|
457
518
|
},
|
|
458
519
|
(table) => [
|
|
459
520
|
check(
|
|
@@ -464,7 +525,7 @@ var juniorTaskExecutions = pgTable12(
|
|
|
464
525
|
"junior_task_executions_status_check",
|
|
465
526
|
sql4`${table.status} in ('blocked', 'completed', 'failed')`
|
|
466
527
|
),
|
|
467
|
-
|
|
528
|
+
primaryKey8({
|
|
468
529
|
name: "junior_task_executions_kind_namespace_execution_id_pk",
|
|
469
530
|
columns: [table.kind, table.namespace, table.executionId]
|
|
470
531
|
}),
|
|
@@ -473,17 +534,17 @@ var juniorTaskExecutions = pgTable12(
|
|
|
473
534
|
columns: [table.conversationId],
|
|
474
535
|
foreignColumns: [juniorConversations.conversationId]
|
|
475
536
|
}),
|
|
476
|
-
|
|
537
|
+
index10("junior_task_executions_task_time_idx").on(
|
|
477
538
|
table.kind,
|
|
478
539
|
table.namespace,
|
|
479
540
|
table.taskId,
|
|
480
541
|
table.executedAtMs
|
|
481
542
|
),
|
|
482
|
-
|
|
543
|
+
index10("junior_task_executions_time_kind_idx").on(
|
|
483
544
|
table.executedAtMs,
|
|
484
545
|
table.kind
|
|
485
546
|
),
|
|
486
|
-
|
|
547
|
+
index10("junior_task_executions_conversation_time_idx").on(
|
|
487
548
|
table.conversationId,
|
|
488
549
|
table.executedAtMs
|
|
489
550
|
)
|
|
@@ -492,54 +553,54 @@ var juniorTaskExecutions = pgTable12(
|
|
|
492
553
|
|
|
493
554
|
// src/db/schema/scheduled-tasks.ts
|
|
494
555
|
import { sql as sql5 } from "drizzle-orm";
|
|
495
|
-
import { bigint as bigint3, index as
|
|
496
|
-
var juniorSchedulerTasks =
|
|
556
|
+
import { bigint as bigint3, index as index11, jsonb as jsonb7, pgTable as pgTable15, text as text15 } from "drizzle-orm/pg-core";
|
|
557
|
+
var juniorSchedulerTasks = pgTable15(
|
|
497
558
|
"junior_scheduler_tasks",
|
|
498
559
|
{
|
|
499
|
-
id:
|
|
500
|
-
teamId:
|
|
560
|
+
id: text15("id").primaryKey(),
|
|
561
|
+
teamId: text15("team_id").notNull(),
|
|
501
562
|
// TODO(v0.128.0): Remove after v0.127.x runtimes no longer write this column.
|
|
502
|
-
creatorSlackUserId:
|
|
503
|
-
creatorIdentityId:
|
|
504
|
-
status:
|
|
563
|
+
creatorSlackUserId: text15("creator_slack_user_id"),
|
|
564
|
+
creatorIdentityId: text15("creator_identity_id"),
|
|
565
|
+
status: text15("status").notNull(),
|
|
505
566
|
nextRunAtMs: bigint3("next_run_at_ms", { mode: "number" }),
|
|
506
567
|
runNowAtMs: bigint3("run_now_at_ms", { mode: "number" }),
|
|
507
568
|
createdAtMs: bigint3("created_at_ms", { mode: "number" }).notNull(),
|
|
508
569
|
/** Short display title generated from the task instruction. */
|
|
509
|
-
title:
|
|
570
|
+
title: text15("title"),
|
|
510
571
|
record: jsonb7("record").$type().notNull()
|
|
511
572
|
},
|
|
512
573
|
(table) => [
|
|
513
574
|
// TODO(v0.128.0): Remove with creatorSlackUserId.
|
|
514
|
-
|
|
515
|
-
|
|
575
|
+
index11("junior_scheduler_tasks_creator_idx").on(table.teamId, table.creatorSlackUserId, table.createdAtMs, table.id).where(sql5`${table.status} <> 'deleted'`),
|
|
576
|
+
index11("junior_scheduler_tasks_creator_identity_idx").on(table.creatorIdentityId, table.createdAtMs, table.id).where(
|
|
516
577
|
sql5`${table.status} <> 'deleted' AND ${table.creatorIdentityId} IS NOT NULL`
|
|
517
578
|
),
|
|
518
|
-
|
|
519
|
-
|
|
579
|
+
index11("junior_scheduler_tasks_team_status_idx").on(table.teamId, table.createdAtMs, table.id).where(sql5`${table.status} <> 'deleted'`),
|
|
580
|
+
index11("junior_scheduler_tasks_run_now_due_idx").on(table.runNowAtMs, table.createdAtMs, table.id).where(
|
|
520
581
|
sql5`${table.status} = 'active' AND ${table.runNowAtMs} IS NOT NULL`
|
|
521
582
|
),
|
|
522
|
-
|
|
583
|
+
index11("junior_scheduler_tasks_next_run_due_idx").on(table.nextRunAtMs, table.createdAtMs, table.id).where(
|
|
523
584
|
sql5`${table.status} = 'active' AND ${table.nextRunAtMs} IS NOT NULL`
|
|
524
585
|
)
|
|
525
586
|
]
|
|
526
587
|
);
|
|
527
|
-
var juniorSchedulerRuns =
|
|
588
|
+
var juniorSchedulerRuns = pgTable15(
|
|
528
589
|
"junior_scheduler_runs",
|
|
529
590
|
{
|
|
530
|
-
id:
|
|
531
|
-
taskId:
|
|
532
|
-
status:
|
|
591
|
+
id: text15("id").primaryKey(),
|
|
592
|
+
taskId: text15("task_id").notNull(),
|
|
593
|
+
status: text15("status").notNull(),
|
|
533
594
|
scheduledForMs: bigint3("scheduled_for_ms", { mode: "number" }).notNull(),
|
|
534
595
|
record: jsonb7("record").$type().notNull()
|
|
535
596
|
},
|
|
536
597
|
(table) => [
|
|
537
|
-
|
|
598
|
+
index11("junior_scheduler_runs_task_status_idx").on(
|
|
538
599
|
table.taskId,
|
|
539
600
|
table.status,
|
|
540
601
|
table.scheduledForMs
|
|
541
602
|
),
|
|
542
|
-
|
|
603
|
+
index11("junior_scheduler_runs_status_idx").on(
|
|
543
604
|
table.status,
|
|
544
605
|
table.scheduledForMs
|
|
545
606
|
)
|
|
@@ -548,12 +609,14 @@ var juniorSchedulerRuns = pgTable13(
|
|
|
548
609
|
|
|
549
610
|
// src/db/schema.ts
|
|
550
611
|
var juniorSqlSchema = {
|
|
612
|
+
juniorAttachments,
|
|
551
613
|
juniorConversationAnnotations,
|
|
552
614
|
juniorApiTokens,
|
|
553
615
|
juniorAgentBindings,
|
|
554
616
|
juniorAgentInvocations,
|
|
555
617
|
juniorConversationEvents,
|
|
556
618
|
juniorConversationBindings,
|
|
619
|
+
juniorConversationParticipants,
|
|
557
620
|
juniorConversations,
|
|
558
621
|
juniorLocationConfigurations,
|
|
559
622
|
juniorDestinations,
|
|
@@ -819,10 +882,12 @@ export {
|
|
|
819
882
|
juniorUsers,
|
|
820
883
|
juniorIdentities,
|
|
821
884
|
juniorConversations,
|
|
885
|
+
juniorAttachments,
|
|
822
886
|
juniorConversationAnnotations,
|
|
823
887
|
juniorApiTokens,
|
|
824
888
|
juniorConversationEvents,
|
|
825
889
|
juniorConversationBindings,
|
|
890
|
+
juniorConversationParticipants,
|
|
826
891
|
AGENT_INVOCATION_MAILBOX_STATUSES,
|
|
827
892
|
juniorAgentBindings,
|
|
828
893
|
juniorAgentInvocations,
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
parseSlackChannelId,
|
|
3
3
|
parseSlackMessageTs,
|
|
4
4
|
parseSlackTeamId
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-V7YE4WCP.js";
|
|
6
6
|
import {
|
|
7
7
|
toOptionalString
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-X7W45B5G.js";
|
|
9
9
|
|
|
10
10
|
// src/chat/slack/context.ts
|
|
11
11
|
import { z } from "zod";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
appendAndEnqueueInboundMessage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6CINHXIL.js";
|
|
4
4
|
import {
|
|
5
5
|
ConversationTurnLifecycleService,
|
|
6
6
|
getPersistedSandboxState,
|
|
7
7
|
getPersistedThreadState,
|
|
8
8
|
persistThreadStateById
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TN4LVILT.js";
|
|
10
10
|
import {
|
|
11
11
|
AgentInvocationBusyError,
|
|
12
12
|
AgentInvocationLimitError,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
agentBindingSchema,
|
|
16
16
|
agentInvocationSchema,
|
|
17
17
|
createAgentInvocationSchema
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ZNWRYNCA.js";
|
|
19
19
|
import {
|
|
20
20
|
TurnInputCommitLostError,
|
|
21
21
|
failTurnRecord,
|
|
@@ -26,16 +26,16 @@ import {
|
|
|
26
26
|
isTurnInputCommitLostError,
|
|
27
27
|
openConversationProjection,
|
|
28
28
|
saveTurnCheckpoint
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-3L2PMOSR.js";
|
|
30
30
|
import {
|
|
31
31
|
getConversationEventStore,
|
|
32
32
|
getConversationStore,
|
|
33
33
|
getSqlExecutor
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-IIO5PFZX.js";
|
|
35
35
|
import {
|
|
36
36
|
juniorAgentBindings,
|
|
37
37
|
juniorAgentInvocations
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-AIJRG227.js";
|
|
39
39
|
|
|
40
40
|
// src/chat/agent-invocations/work.ts
|
|
41
41
|
import { z } from "zod";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
toCanonicalInputMessage,
|
|
4
4
|
toCanonicalOutputMessage,
|
|
5
5
|
toGenAiMessagesTraceAttributes
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MJE7XKWP.js";
|
|
7
7
|
import {
|
|
8
8
|
extractGenAiUsageAttributes,
|
|
9
9
|
logException,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
normalizeGenAiFinishReason,
|
|
12
12
|
serializeGenAiAttribute,
|
|
13
13
|
withSpan
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-X7W45B5G.js";
|
|
15
15
|
|
|
16
16
|
// src/chat/services/provider-error.ts
|
|
17
17
|
var ProviderError = class extends Error {
|