@sentry/junior 0.155.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-AWVTLAV2.js → agent-hooks-CCAR46PQ.js} +10 -10
- package/dist/api/locations/detail.d.ts +1 -0
- package/dist/api/schema/conversation.d.ts +19 -4
- package/dist/api/schema/location.d.ts +1 -0
- package/dist/api/schema/person.d.ts +1 -0
- package/dist/api/schema.js +1 -1
- package/dist/api.js +48 -36
- package/dist/app.js +147 -44
- package/dist/{catalog-runtime-V6YD6KH5.js → catalog-runtime-3SNKYCBG.js} +5 -5
- 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/ingress/bot-mention.d.ts +13 -0
- package/dist/chat/plugins/unfinished-work.d.ts +6 -0
- package/dist/chat/runtime/agent-runner.d.ts +2 -0
- 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 +2 -1
- package/dist/chat/tools/types.d.ts +2 -0
- package/dist/{chunk-V57LZDHN.js → chunk-3FFUC32L.js} +6 -6
- package/dist/{chunk-J2SYI36O.js → chunk-3L2PMOSR.js} +4 -4
- package/dist/{chunk-2AHVM3HK.js → chunk-4ZZDTHFC.js} +10 -8
- package/dist/{chunk-AENPRXCG.js → chunk-53W3LZEW.js} +381 -55
- package/dist/{chunk-ELOTIL5F.js → chunk-6CINHXIL.js} +4 -4
- package/dist/{chunk-37G5HJ2X.js → chunk-6JUU7J2B.js} +4 -4
- package/dist/{chunk-KBT2I5ER.js → chunk-7RAETIYO.js} +6 -6
- package/dist/{chunk-NWSKFYOH.js → chunk-A6WPDFHQ.js} +1 -1
- package/dist/{chunk-773XC7P4.js → chunk-AIJRG227.js} +159 -128
- package/dist/{chunk-APHDJYN7.js → chunk-CK2H7CFO.js} +1 -1
- package/dist/{chunk-Y7ZUBP2K.js → chunk-CN2XSVKF.js} +6 -6
- package/dist/{chunk-TVXAN43I.js → chunk-EDJ64P2P.js} +1 -1
- package/dist/{chunk-XFZLQANQ.js → chunk-GKC43TLS.js} +2 -2
- package/dist/{chunk-UWTXAYBP.js → chunk-GSBPZHLQ.js} +9 -9
- package/dist/{chunk-JJX77MB7.js → chunk-IIO5PFZX.js} +3 -3
- package/dist/{chunk-RQ62VKM7.js → chunk-IZEBHYI4.js} +1 -1
- package/dist/{chunk-J7MWZFFP.js → chunk-JUJR6WTL.js} +4 -4
- package/dist/{chunk-JFZBGFNX.js → chunk-KBGMYLSV.js} +2 -1
- package/dist/{chunk-LQT3SWFA.js → chunk-KCA5MKHU.js} +5 -5
- package/dist/{chunk-SDRJ2LE3.js → chunk-MC57E5U5.js} +1 -1
- package/dist/{chunk-2WLJDM23.js → chunk-MJE7XKWP.js} +1 -1
- package/dist/{chunk-TKJ7277U.js → chunk-NTNU6T2D.js} +2 -2
- package/dist/{chunk-EORR34UB.js → chunk-OGZPRMZA.js} +1 -1
- package/dist/{chunk-NKFRRZIT.js → chunk-OMQJB7YN.js} +19 -18
- package/dist/{chunk-Y6MVGU7L.js → chunk-PMFGVLDU.js} +10 -10
- package/dist/{chunk-KTVHAHUV.js → chunk-SE3D225X.js} +1 -1
- package/dist/{chunk-JIC33O5L.js → chunk-SRJA6QLM.js} +2 -2
- package/dist/{chunk-4K5N6HTX.js → chunk-TN4LVILT.js} +5 -5
- package/dist/{chunk-MLBH7J7J.js → chunk-TNXGMFWV.js} +1 -1
- package/dist/{chunk-RN3AWYEP.js → chunk-WD7SEUZO.js} +1 -1
- package/dist/{chunk-ZLSFOSDK.js → chunk-X5NZQH5U.js} +2 -1
- package/dist/{chunk-7NYEB2TM.js → chunk-X7W45B5G.js} +1 -1
- package/dist/{chunk-CPQBTTI6.js → chunk-ZNWRYNCA.js} +5 -5
- package/dist/cli/chat.js +30 -30
- package/dist/cli/check.js +6 -6
- package/dist/cli/plugins.js +13 -13
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +7 -7
- package/dist/db/schema/attachments.d.ts +178 -0
- package/dist/db/schema.d.ts +179 -1
- package/dist/{db-WT7P56AH.js → db-TYUUKGJX.js} +7 -7
- 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-R2PK2MCA.js → oauth-callback-server-AWVDKPR5.js} +23 -23
- package/dist/{runner-O7YYUIHT.js → runner-JUQXMACC.js} +13 -13
- package/dist/{skills-S6HLQRH7.js → skills-4GZTZX4V.js} +6 -6
- package/dist/spawn-32SSRWU4.js +37 -0
- package/dist/{validation-46WD2OAR.js → validation-DRLNJRND.js} +6 -6
- package/dist/version.js +1 -1
- package/dist/{work-YT5QUBS3.js → work-TGIXRRJY.js} +17 -17
- package/dist/worker-IFXZOYED.js +24 -0
- package/migrations/0027_attachment_storage.sql +16 -0
- package/migrations/meta/0027_snapshot.json +2554 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +5 -4
- package/dist/spawn-B4SBFFA2.js +0 -37
- package/dist/worker-4C5BEDWN.js +0 -24
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
isDmChannel,
|
|
5
5
|
normalizeSlackConversationId,
|
|
6
6
|
withSlackRetries
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NTNU6T2D.js";
|
|
8
8
|
import {
|
|
9
9
|
parseDestination
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IIO5PFZX.js";
|
|
11
11
|
import {
|
|
12
12
|
getStateAdapter
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-MC57E5U5.js";
|
|
14
14
|
import {
|
|
15
15
|
normalizeSlackEmojiName
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GKC43TLS.js";
|
|
17
17
|
import {
|
|
18
18
|
pluginCatalogRuntime
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-EDJ64P2P.js";
|
|
20
20
|
import {
|
|
21
21
|
parseSlackMessageTs,
|
|
22
22
|
parseSlackUserId
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
isRecord,
|
|
26
26
|
logInfo,
|
|
27
27
|
logWarn
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-X7W45B5G.js";
|
|
29
29
|
|
|
30
30
|
// src/chat/slack/outbound.ts
|
|
31
31
|
var MAX_SLACK_MESSAGE_TEXT_CHARS = 4e4;
|
|
@@ -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,33 +250,33 @@ 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(),
|
|
250
|
-
actorIdentityId:
|
|
279
|
+
actorIdentityId: text7("actor_identity_id").references(
|
|
251
280
|
() => juniorIdentities.id
|
|
252
281
|
),
|
|
253
282
|
createdAt: timestamptz("created_at").notNull()
|
|
@@ -262,22 +291,22 @@ var juniorConversationEvents = pgTable6(
|
|
|
262
291
|
columns: [table.conversationId],
|
|
263
292
|
foreignColumns: [juniorConversations.conversationId]
|
|
264
293
|
}),
|
|
265
|
-
|
|
294
|
+
index5("junior_conversation_events_history_version_idx").on(
|
|
266
295
|
table.conversationId,
|
|
267
296
|
table.historyVersion,
|
|
268
297
|
table.seq
|
|
269
298
|
),
|
|
270
|
-
|
|
299
|
+
index5("junior_conversation_events_type_idx").on(
|
|
271
300
|
table.conversationId,
|
|
272
301
|
table.type,
|
|
273
302
|
table.seq
|
|
274
303
|
),
|
|
275
|
-
|
|
304
|
+
index5("junior_conversation_events_actor_identity_idx").on(
|
|
276
305
|
table.actorIdentityId,
|
|
277
306
|
table.conversationId,
|
|
278
307
|
table.seq
|
|
279
308
|
),
|
|
280
|
-
|
|
309
|
+
index5("junior_conversation_events_message_search_idx").using("gin", sql3`to_tsvector('english', ${table.payload}->>'text')`).where(sql3`${table.type} = 'message'`),
|
|
281
310
|
uniqueIndex4("junior_conversation_events_idempotency_idx").on(
|
|
282
311
|
table.conversationId,
|
|
283
312
|
table.idempotencyKey
|
|
@@ -286,15 +315,15 @@ var juniorConversationEvents = pgTable6(
|
|
|
286
315
|
);
|
|
287
316
|
|
|
288
317
|
// src/db/schema/conversation-bindings.ts
|
|
289
|
-
import { index as
|
|
290
|
-
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(
|
|
291
320
|
"junior_conversation_bindings",
|
|
292
321
|
{
|
|
293
|
-
conversationId:
|
|
294
|
-
provider:
|
|
295
|
-
providerTenantId:
|
|
296
|
-
providerDestinationId:
|
|
297
|
-
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(),
|
|
298
327
|
createdAt: timestamptz("created_at").notNull()
|
|
299
328
|
},
|
|
300
329
|
(table) => [
|
|
@@ -307,19 +336,19 @@ var juniorConversationBindings = pgTable7(
|
|
|
307
336
|
table.providerConversationId
|
|
308
337
|
]
|
|
309
338
|
}),
|
|
310
|
-
|
|
339
|
+
index6("junior_conversation_bindings_conversation_idx").on(
|
|
311
340
|
table.conversationId
|
|
312
341
|
)
|
|
313
342
|
]
|
|
314
343
|
);
|
|
315
344
|
|
|
316
345
|
// src/db/schema/conversation-participants.ts
|
|
317
|
-
import { index as
|
|
318
|
-
var juniorConversationParticipants =
|
|
346
|
+
import { index as index7, pgTable as pgTable9, primaryKey as primaryKey4, text as text9 } from "drizzle-orm/pg-core";
|
|
347
|
+
var juniorConversationParticipants = pgTable9(
|
|
319
348
|
"junior_conversation_participants",
|
|
320
349
|
{
|
|
321
|
-
userId:
|
|
322
|
-
rootConversationId:
|
|
350
|
+
userId: text9("user_id").notNull().references(() => juniorUsers.id),
|
|
351
|
+
rootConversationId: text9("root_conversation_id").notNull().references(() => juniorConversations.conversationId),
|
|
323
352
|
lastMessageAt: timestamptz("last_message_at").notNull()
|
|
324
353
|
},
|
|
325
354
|
(table) => [
|
|
@@ -327,11 +356,11 @@ var juniorConversationParticipants = pgTable8(
|
|
|
327
356
|
name: "junior_conversation_participants_user_root_pk",
|
|
328
357
|
columns: [table.userId, table.rootConversationId]
|
|
329
358
|
}),
|
|
330
|
-
|
|
359
|
+
index7("junior_conversation_participants_user_activity_idx").on(
|
|
331
360
|
table.userId,
|
|
332
361
|
table.lastMessageAt.desc()
|
|
333
362
|
),
|
|
334
|
-
|
|
363
|
+
index7("junior_conversation_participants_root_idx").on(
|
|
335
364
|
table.rootConversationId
|
|
336
365
|
)
|
|
337
366
|
]
|
|
@@ -339,23 +368,23 @@ var juniorConversationParticipants = pgTable8(
|
|
|
339
368
|
|
|
340
369
|
// src/db/schema/agent-invocations.ts
|
|
341
370
|
import {
|
|
342
|
-
index as
|
|
371
|
+
index as index8,
|
|
343
372
|
jsonb as jsonb5,
|
|
344
|
-
pgTable as
|
|
373
|
+
pgTable as pgTable10,
|
|
345
374
|
primaryKey as primaryKey5,
|
|
346
|
-
text as
|
|
375
|
+
text as text10,
|
|
347
376
|
uniqueIndex as uniqueIndex5
|
|
348
377
|
} from "drizzle-orm/pg-core";
|
|
349
378
|
var AGENT_INVOCATION_MAILBOX_STATUSES = [
|
|
350
379
|
"pending",
|
|
351
380
|
"appended"
|
|
352
381
|
];
|
|
353
|
-
var juniorAgentBindings =
|
|
382
|
+
var juniorAgentBindings = pgTable10(
|
|
354
383
|
"junior_agent_bindings",
|
|
355
384
|
{
|
|
356
|
-
parentConversationId:
|
|
357
|
-
name:
|
|
358
|
-
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)
|
|
359
388
|
},
|
|
360
389
|
(table) => [
|
|
361
390
|
primaryKey5({
|
|
@@ -366,35 +395,35 @@ var juniorAgentBindings = pgTable9(
|
|
|
366
395
|
)
|
|
367
396
|
]
|
|
368
397
|
);
|
|
369
|
-
var juniorAgentInvocations =
|
|
398
|
+
var juniorAgentInvocations = pgTable10(
|
|
370
399
|
"junior_agent_invocations",
|
|
371
400
|
{
|
|
372
|
-
invocationId:
|
|
373
|
-
parentConversationId:
|
|
374
|
-
childConversationId:
|
|
375
|
-
agentName:
|
|
376
|
-
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(),
|
|
377
406
|
actor: jsonb5("actor_json").$type().notNull(),
|
|
378
407
|
credentialContext: jsonb5(
|
|
379
408
|
"credential_context_json"
|
|
380
409
|
).$type(),
|
|
381
410
|
source: jsonb5("source_json").$type().notNull(),
|
|
382
411
|
destination: jsonb5("destination_json").$type().notNull(),
|
|
383
|
-
destinationVisibility:
|
|
412
|
+
destinationVisibility: text10(
|
|
384
413
|
"destination_visibility"
|
|
385
414
|
).$type(),
|
|
386
|
-
reasoningLevel:
|
|
387
|
-
status:
|
|
388
|
-
mailboxStatus:
|
|
389
|
-
result:
|
|
390
|
-
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"),
|
|
391
420
|
createdAt: timestamptz("created_at").notNull(),
|
|
392
421
|
updatedAt: timestamptz("updated_at").notNull(),
|
|
393
422
|
terminalAt: timestamptz("terminal_at")
|
|
394
423
|
},
|
|
395
424
|
(table) => [
|
|
396
|
-
|
|
397
|
-
|
|
425
|
+
index8("junior_agent_invocations_child_idx").on(table.childConversationId),
|
|
426
|
+
index8("junior_agent_invocations_mailbox_idx").on(
|
|
398
427
|
table.mailboxStatus,
|
|
399
428
|
table.createdAt
|
|
400
429
|
)
|
|
@@ -402,42 +431,42 @@ var juniorAgentInvocations = pgTable9(
|
|
|
402
431
|
);
|
|
403
432
|
|
|
404
433
|
// src/db/schema/location-configurations.ts
|
|
405
|
-
import { pgTable as
|
|
406
|
-
var juniorLocationConfigurations =
|
|
434
|
+
import { pgTable as pgTable11, primaryKey as primaryKey6, text as text11 } from "drizzle-orm/pg-core";
|
|
435
|
+
var juniorLocationConfigurations = pgTable11(
|
|
407
436
|
"junior_location_configurations",
|
|
408
437
|
{
|
|
409
|
-
locationId:
|
|
410
|
-
key:
|
|
411
|
-
value:
|
|
438
|
+
locationId: text11("location_id").notNull().references(() => juniorDestinations.id, { onDelete: "cascade" }),
|
|
439
|
+
key: text11("key").notNull(),
|
|
440
|
+
value: text11("value").notNull(),
|
|
412
441
|
updatedAt: timestamptz("updated_at").notNull(),
|
|
413
|
-
updatedBy:
|
|
414
|
-
source:
|
|
415
|
-
expiresAt:
|
|
442
|
+
updatedBy: text11("updated_by"),
|
|
443
|
+
source: text11("source"),
|
|
444
|
+
expiresAt: text11("expires_at")
|
|
416
445
|
},
|
|
417
446
|
(table) => [primaryKey6({ columns: [table.locationId, table.key] })]
|
|
418
447
|
);
|
|
419
448
|
|
|
420
449
|
// src/db/schema/event-tasks.ts
|
|
421
|
-
import { bigint, index as
|
|
422
|
-
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(
|
|
423
452
|
"junior_event_tasks",
|
|
424
453
|
{
|
|
425
|
-
id:
|
|
426
|
-
teamId:
|
|
427
|
-
namespace:
|
|
428
|
-
identifier:
|
|
454
|
+
id: text12("id").primaryKey(),
|
|
455
|
+
teamId: text12("team_id").notNull(),
|
|
456
|
+
namespace: text12("namespace").notNull(),
|
|
457
|
+
identifier: text12("identifier").notNull(),
|
|
429
458
|
createdAtMs: bigint("created_at_ms", { mode: "number" }).notNull(),
|
|
430
459
|
/** Short display title generated from the task instruction. */
|
|
431
|
-
title:
|
|
460
|
+
title: text12("title"),
|
|
432
461
|
task: jsonb6("task_json").$type().notNull()
|
|
433
462
|
},
|
|
434
463
|
(table) => [
|
|
435
|
-
|
|
464
|
+
index9("junior_event_tasks_team_idx").on(
|
|
436
465
|
table.teamId,
|
|
437
466
|
table.createdAtMs,
|
|
438
467
|
table.id
|
|
439
468
|
),
|
|
440
|
-
|
|
469
|
+
index9("junior_event_tasks_match_idx").on(
|
|
441
470
|
table.namespace,
|
|
442
471
|
table.identifier,
|
|
443
472
|
table.createdAtMs,
|
|
@@ -447,15 +476,15 @@ var juniorEventTasks = pgTable11(
|
|
|
447
476
|
);
|
|
448
477
|
|
|
449
478
|
// src/db/schema/stats.ts
|
|
450
|
-
import { date, integer as
|
|
451
|
-
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(
|
|
452
481
|
"junior_stats",
|
|
453
482
|
{
|
|
454
483
|
date: date("date", { mode: "string" }).notNull(),
|
|
455
|
-
namespace:
|
|
456
|
-
metric:
|
|
457
|
-
name:
|
|
458
|
-
count:
|
|
484
|
+
namespace: text13("namespace").notNull(),
|
|
485
|
+
metric: text13("metric").notNull(),
|
|
486
|
+
name: text13("name").notNull(),
|
|
487
|
+
count: integer4("count").notNull().default(0)
|
|
459
488
|
},
|
|
460
489
|
(table) => [
|
|
461
490
|
primaryKey7({
|
|
@@ -471,21 +500,21 @@ import {
|
|
|
471
500
|
bigint as bigint2,
|
|
472
501
|
check,
|
|
473
502
|
foreignKey as foreignKey3,
|
|
474
|
-
index as
|
|
475
|
-
pgTable as
|
|
503
|
+
index as index10,
|
|
504
|
+
pgTable as pgTable14,
|
|
476
505
|
primaryKey as primaryKey8,
|
|
477
|
-
text as
|
|
506
|
+
text as text14
|
|
478
507
|
} from "drizzle-orm/pg-core";
|
|
479
|
-
var juniorTaskExecutions =
|
|
508
|
+
var juniorTaskExecutions = pgTable14(
|
|
480
509
|
"junior_task_executions",
|
|
481
510
|
{
|
|
482
|
-
executionId:
|
|
483
|
-
kind:
|
|
484
|
-
namespace:
|
|
485
|
-
taskId:
|
|
486
|
-
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"),
|
|
487
516
|
executedAtMs: bigint2("executed_at_ms", { mode: "number" }).notNull(),
|
|
488
|
-
status:
|
|
517
|
+
status: text14("status").$type().notNull()
|
|
489
518
|
},
|
|
490
519
|
(table) => [
|
|
491
520
|
check(
|
|
@@ -505,17 +534,17 @@ var juniorTaskExecutions = pgTable13(
|
|
|
505
534
|
columns: [table.conversationId],
|
|
506
535
|
foreignColumns: [juniorConversations.conversationId]
|
|
507
536
|
}),
|
|
508
|
-
|
|
537
|
+
index10("junior_task_executions_task_time_idx").on(
|
|
509
538
|
table.kind,
|
|
510
539
|
table.namespace,
|
|
511
540
|
table.taskId,
|
|
512
541
|
table.executedAtMs
|
|
513
542
|
),
|
|
514
|
-
|
|
543
|
+
index10("junior_task_executions_time_kind_idx").on(
|
|
515
544
|
table.executedAtMs,
|
|
516
545
|
table.kind
|
|
517
546
|
),
|
|
518
|
-
|
|
547
|
+
index10("junior_task_executions_conversation_time_idx").on(
|
|
519
548
|
table.conversationId,
|
|
520
549
|
table.executedAtMs
|
|
521
550
|
)
|
|
@@ -524,54 +553,54 @@ var juniorTaskExecutions = pgTable13(
|
|
|
524
553
|
|
|
525
554
|
// src/db/schema/scheduled-tasks.ts
|
|
526
555
|
import { sql as sql5 } from "drizzle-orm";
|
|
527
|
-
import { bigint as bigint3, index as
|
|
528
|
-
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(
|
|
529
558
|
"junior_scheduler_tasks",
|
|
530
559
|
{
|
|
531
|
-
id:
|
|
532
|
-
teamId:
|
|
560
|
+
id: text15("id").primaryKey(),
|
|
561
|
+
teamId: text15("team_id").notNull(),
|
|
533
562
|
// TODO(v0.128.0): Remove after v0.127.x runtimes no longer write this column.
|
|
534
|
-
creatorSlackUserId:
|
|
535
|
-
creatorIdentityId:
|
|
536
|
-
status:
|
|
563
|
+
creatorSlackUserId: text15("creator_slack_user_id"),
|
|
564
|
+
creatorIdentityId: text15("creator_identity_id"),
|
|
565
|
+
status: text15("status").notNull(),
|
|
537
566
|
nextRunAtMs: bigint3("next_run_at_ms", { mode: "number" }),
|
|
538
567
|
runNowAtMs: bigint3("run_now_at_ms", { mode: "number" }),
|
|
539
568
|
createdAtMs: bigint3("created_at_ms", { mode: "number" }).notNull(),
|
|
540
569
|
/** Short display title generated from the task instruction. */
|
|
541
|
-
title:
|
|
570
|
+
title: text15("title"),
|
|
542
571
|
record: jsonb7("record").$type().notNull()
|
|
543
572
|
},
|
|
544
573
|
(table) => [
|
|
545
574
|
// TODO(v0.128.0): Remove with creatorSlackUserId.
|
|
546
|
-
|
|
547
|
-
|
|
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(
|
|
548
577
|
sql5`${table.status} <> 'deleted' AND ${table.creatorIdentityId} IS NOT NULL`
|
|
549
578
|
),
|
|
550
|
-
|
|
551
|
-
|
|
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(
|
|
552
581
|
sql5`${table.status} = 'active' AND ${table.runNowAtMs} IS NOT NULL`
|
|
553
582
|
),
|
|
554
|
-
|
|
583
|
+
index11("junior_scheduler_tasks_next_run_due_idx").on(table.nextRunAtMs, table.createdAtMs, table.id).where(
|
|
555
584
|
sql5`${table.status} = 'active' AND ${table.nextRunAtMs} IS NOT NULL`
|
|
556
585
|
)
|
|
557
586
|
]
|
|
558
587
|
);
|
|
559
|
-
var juniorSchedulerRuns =
|
|
588
|
+
var juniorSchedulerRuns = pgTable15(
|
|
560
589
|
"junior_scheduler_runs",
|
|
561
590
|
{
|
|
562
|
-
id:
|
|
563
|
-
taskId:
|
|
564
|
-
status:
|
|
591
|
+
id: text15("id").primaryKey(),
|
|
592
|
+
taskId: text15("task_id").notNull(),
|
|
593
|
+
status: text15("status").notNull(),
|
|
565
594
|
scheduledForMs: bigint3("scheduled_for_ms", { mode: "number" }).notNull(),
|
|
566
595
|
record: jsonb7("record").$type().notNull()
|
|
567
596
|
},
|
|
568
597
|
(table) => [
|
|
569
|
-
|
|
598
|
+
index11("junior_scheduler_runs_task_status_idx").on(
|
|
570
599
|
table.taskId,
|
|
571
600
|
table.status,
|
|
572
601
|
table.scheduledForMs
|
|
573
602
|
),
|
|
574
|
-
|
|
603
|
+
index11("junior_scheduler_runs_status_idx").on(
|
|
575
604
|
table.status,
|
|
576
605
|
table.scheduledForMs
|
|
577
606
|
)
|
|
@@ -580,6 +609,7 @@ var juniorSchedulerRuns = pgTable14(
|
|
|
580
609
|
|
|
581
610
|
// src/db/schema.ts
|
|
582
611
|
var juniorSqlSchema = {
|
|
612
|
+
juniorAttachments,
|
|
583
613
|
juniorConversationAnnotations,
|
|
584
614
|
juniorApiTokens,
|
|
585
615
|
juniorAgentBindings,
|
|
@@ -852,6 +882,7 @@ export {
|
|
|
852
882
|
juniorUsers,
|
|
853
883
|
juniorIdentities,
|
|
854
884
|
juniorConversations,
|
|
885
|
+
juniorAttachments,
|
|
855
886
|
juniorConversationAnnotations,
|
|
856
887
|
juniorApiTokens,
|
|
857
888
|
juniorConversationEvents,
|
|
@@ -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 {
|