@sentry/junior 0.182.0 → 0.183.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-3S25UIHO.js → agent-hooks-SNRBZYAU.js} +11 -11
- package/dist/api/code/overview.d.ts +35 -0
- package/dist/api/code/routes.d.ts +4 -0
- package/dist/api/schema/code.d.ts +75 -0
- package/dist/api/schema.d.ts +2 -0
- package/dist/api/schema.js +9 -1
- package/dist/api.js +258 -134
- package/dist/app.js +71 -48
- package/dist/{catalog-runtime-ESLMBQBV.js → catalog-runtime-3I3JOIIH.js} +4 -4
- package/dist/chat/agent-invocations/store.d.ts +4 -2
- package/dist/chat/agent-invocations/work.d.ts +1 -3
- package/dist/chat/app/factory.d.ts +3 -3
- package/dist/chat/app/services.d.ts +3 -3
- package/dist/chat/code/publisher.d.ts +3 -0
- package/dist/chat/code/store.d.ts +9 -0
- package/dist/chat/event-tasks/store.d.ts +10 -0
- package/dist/chat/ingress/slack-webhook.d.ts +1 -1
- package/dist/chat/plugins/agent-hooks.d.ts +5 -0
- package/dist/chat/{runtime/slack-runtime.d.ts → providers/slack/runtime.d.ts} +2 -2
- package/dist/chat/{runtime/reply-executor.d.ts → providers/slack/turn.d.ts} +10 -9
- package/dist/chat/resource-events/store.d.ts +12 -0
- package/dist/chat/runtime/turn-execution.d.ts +30 -0
- package/dist/chat/slack/dispatch-turn.d.ts +12 -14
- package/dist/chat/task-execution/slack-work.d.ts +1 -1
- package/dist/{chunk-SXOZIG5X.js → chunk-24OJZ5OU.js} +6 -6
- package/dist/{chunk-SVFSYQMT.js → chunk-2ADFGSUS.js} +1 -1
- package/dist/{chunk-GGYA5NPN.js → chunk-2EPYYVJC.js} +8 -8
- package/dist/{chunk-KGMHUDVF.js → chunk-35PM4YY5.js} +6 -6
- package/dist/{chunk-3ENUMZNG.js → chunk-37IQ6DGU.js} +3 -3
- package/dist/{chunk-3THPTNN6.js → chunk-3HJ4F4L7.js} +4 -4
- package/dist/{chunk-3NFHI2NA.js → chunk-3L7CWDQQ.js} +1 -1
- package/dist/{chunk-CVBIM4Z3.js → chunk-4WGFWHWP.js} +1 -1
- package/dist/{chunk-YHL2L2ZZ.js → chunk-56XONJPF.js} +1 -1
- package/dist/{chunk-44BQ3TSK.js → chunk-6UXDTPEN.js} +233 -173
- package/dist/{chunk-2CEOXDG2.js → chunk-AHMWPFIW.js} +174 -6
- package/dist/{chunk-6TSWXBTQ.js → chunk-AX3UDIMA.js} +3 -3
- package/dist/{chunk-S35OZMSL.js → chunk-AYW7J6K4.js} +13 -13
- package/dist/{chunk-WOIALVN2.js → chunk-E3OBGRHN.js} +1 -1
- package/dist/{chunk-4DZ62L36.js → chunk-EENQGEIP.js} +1 -1
- package/dist/{chunk-UUMBHORH.js → chunk-FJMTMGBC.js} +1 -1
- package/dist/{chunk-Z7ALSQS3.js → chunk-G2B2XZQW.js} +1 -1
- package/dist/{chunk-TEFNHMO2.js → chunk-HUK5XIZL.js} +4 -4
- package/dist/{chunk-LT4QYGKM.js → chunk-IO6KFXYE.js} +160 -97
- package/dist/{chunk-JIOKUIAS.js → chunk-KTXOGLNE.js} +2 -2
- package/dist/{chunk-LHQK5XCU.js → chunk-LMNMMESF.js} +2 -2
- package/dist/{chunk-UQP54CXZ.js → chunk-LZBPGX5A.js} +1 -1
- package/dist/{chunk-PQES5LB5.js → chunk-PLZT45VC.js} +5 -5
- package/dist/{chunk-V5UZCCNW.js → chunk-QI5JW5AG.js} +6 -6
- package/dist/{chunk-A7THOQ6N.js → chunk-QZV76CM4.js} +21 -21
- package/dist/{chunk-LB4FWMCV.js → chunk-R767Y7QV.js} +183 -155
- package/dist/{chunk-MJISSOWB.js → chunk-SQHFVIMZ.js} +1 -1
- package/dist/{chunk-BDDWVY32.js → chunk-T5MTGX2E.js} +19 -19
- package/dist/{chunk-DZR3L74W.js → chunk-V64JCZUV.js} +3 -3
- package/dist/{chunk-VHMAFMHB.js → chunk-VOV3SCM3.js} +1 -1
- package/dist/{chunk-BZD4ADQH.js → chunk-W46NIB5H.js} +1 -1
- package/dist/{chunk-QHALFHZA.js → chunk-W5JMPEBO.js} +9 -9
- package/dist/{chunk-D6OHGAIO.js → chunk-WOKJRLM2.js} +5 -5
- package/dist/chunk-WVIA7V3M.js +975 -0
- package/dist/{chunk-UKIHNBBD.js → chunk-X52ESOBP.js} +3 -3
- package/dist/cli/chat.js +33 -35
- package/dist/cli/check.js +5 -5
- package/dist/cli/plugins.js +12 -12
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +6 -6
- package/dist/db/schema/code.d.ts +367 -0
- package/dist/db/schema.d.ts +367 -1
- package/dist/{db-NYIWZ4L5.js → db-K2VMNLHQ.js} +6 -6
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +6 -6
- package/dist/{oauth-callback-server-A2YTPVVX.js → oauth-callback-server-DZZMTKSS.js} +25 -25
- package/dist/{runner-VKAEU52J.js → runner-IIAKWDXI.js} +18 -18
- package/dist/{skills-52GMXUTY.js → skills-EXIQ7BP5.js} +5 -5
- package/dist/spawn-ZR6OOEAN.js +37 -0
- package/dist/task-runner-C52HYCVD.js +32 -0
- package/dist/{validation-VD2YQX2W.js → validation-XUGIWBJF.js} +5 -5
- package/dist/version.js +1 -1
- package/dist/{work-ZWBTGEQP.js → work-G4RLJ634.js} +18 -18
- package/dist/worker-R2JEHK67.js +22 -0
- package/migrations/0036_complex_rage.sql +32 -0
- package/migrations/meta/0036_snapshot.json +3186 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +6 -6
- package/dist/chunk-CZYNWPWD.js +0 -930
- package/dist/spawn-GSS4EBLR.js +0 -37
- package/dist/task-runner-DUGDWF5O.js +0 -32
- package/dist/worker-XUWD5WS7.js +0 -22
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-VFUK3X5B.js";
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_SQL_STATEMENT_TIMEOUT_MS
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LMNMMESF.js";
|
|
8
8
|
|
|
9
9
|
// src/db/neon.ts
|
|
10
10
|
import { AsyncLocalStorage } from "async_hooks";
|
|
@@ -245,21 +245,77 @@ var juniorAttachments = pgTable5(
|
|
|
245
245
|
]
|
|
246
246
|
);
|
|
247
247
|
|
|
248
|
+
// src/db/schema/code.ts
|
|
249
|
+
import { sql as sql3 } from "drizzle-orm";
|
|
250
|
+
import {
|
|
251
|
+
index as index5,
|
|
252
|
+
integer as integer4,
|
|
253
|
+
pgTable as pgTable6,
|
|
254
|
+
text as text6,
|
|
255
|
+
uniqueIndex as uniqueIndex4,
|
|
256
|
+
uuid
|
|
257
|
+
} from "drizzle-orm/pg-core";
|
|
258
|
+
var juniorCodeRepositories = pgTable6(
|
|
259
|
+
"junior_code_repositories",
|
|
260
|
+
{
|
|
261
|
+
id: uuid("id").primaryKey(),
|
|
262
|
+
name: text6("name").notNull(),
|
|
263
|
+
provider: text6("provider").notNull(),
|
|
264
|
+
providerId: text6("provider_id").notNull(),
|
|
265
|
+
url: text6("url"),
|
|
266
|
+
updatedAt: timestamptz("updated_at").notNull()
|
|
267
|
+
},
|
|
268
|
+
(table) => [
|
|
269
|
+
uniqueIndex4("junior_code_repositories_provider_id_idx").on(
|
|
270
|
+
table.provider,
|
|
271
|
+
table.providerId
|
|
272
|
+
)
|
|
273
|
+
]
|
|
274
|
+
);
|
|
275
|
+
var juniorCodeChanges = pgTable6(
|
|
276
|
+
"junior_code_changes",
|
|
277
|
+
{
|
|
278
|
+
id: uuid("id").primaryKey(),
|
|
279
|
+
closedAt: timestamptz("closed_at"),
|
|
280
|
+
conversationIds: text6("conversation_ids").array().notNull().default(sql3`ARRAY[]::text[]`),
|
|
281
|
+
mergedAt: timestamptz("merged_at"),
|
|
282
|
+
number: integer4("number").notNull(),
|
|
283
|
+
openedAt: timestamptz("opened_at").notNull(),
|
|
284
|
+
provider: text6("provider").notNull(),
|
|
285
|
+
providerId: text6("provider_id").notNull(),
|
|
286
|
+
repositoryId: uuid("repository_id").notNull().references(() => juniorCodeRepositories.id, { onDelete: "cascade" }),
|
|
287
|
+
state: text6("state").$type().notNull(),
|
|
288
|
+
title: text6("title"),
|
|
289
|
+
updatedAt: timestamptz("updated_at").notNull(),
|
|
290
|
+
url: text6("url")
|
|
291
|
+
},
|
|
292
|
+
(table) => [
|
|
293
|
+
uniqueIndex4("junior_code_changes_provider_id_idx").on(
|
|
294
|
+
table.provider,
|
|
295
|
+
table.providerId
|
|
296
|
+
),
|
|
297
|
+
index5("junior_code_changes_opened_at_idx").on(table.openedAt),
|
|
298
|
+
index5("junior_code_changes_merged_at_idx").on(table.mergedAt),
|
|
299
|
+
index5("junior_code_changes_closed_at_idx").on(table.closedAt),
|
|
300
|
+
index5("junior_code_changes_open_idx").on(table.id).where(sql3`${table.state} = 'open'`)
|
|
301
|
+
]
|
|
302
|
+
);
|
|
303
|
+
|
|
248
304
|
// src/db/schema/conversation-annotations.ts
|
|
249
305
|
import {
|
|
250
306
|
foreignKey,
|
|
251
307
|
jsonb as jsonb3,
|
|
252
|
-
pgTable as
|
|
308
|
+
pgTable as pgTable7,
|
|
253
309
|
primaryKey,
|
|
254
|
-
text as
|
|
310
|
+
text as text7
|
|
255
311
|
} from "drizzle-orm/pg-core";
|
|
256
|
-
var juniorConversationAnnotations =
|
|
312
|
+
var juniorConversationAnnotations = pgTable7(
|
|
257
313
|
"junior_conversation_annotations",
|
|
258
314
|
{
|
|
259
|
-
conversationId:
|
|
260
|
-
plugin:
|
|
261
|
-
kind:
|
|
262
|
-
key:
|
|
315
|
+
conversationId: text7("conversation_id").notNull(),
|
|
316
|
+
plugin: text7("plugin").notNull(),
|
|
317
|
+
kind: text7("kind").notNull(),
|
|
318
|
+
key: text7("key").notNull(),
|
|
263
319
|
annotation: jsonb3("annotation_json").$type().notNull(),
|
|
264
320
|
createdAt: timestamptz("created_at").notNull(),
|
|
265
321
|
updatedAt: timestamptz("updated_at").notNull()
|
|
@@ -278,49 +334,49 @@ var juniorConversationAnnotations = pgTable6(
|
|
|
278
334
|
);
|
|
279
335
|
|
|
280
336
|
// src/db/schema/api-tokens.ts
|
|
281
|
-
import { index as
|
|
282
|
-
var juniorApiTokens =
|
|
337
|
+
import { index as index6, pgTable as pgTable8, text as text8, uniqueIndex as uniqueIndex5 } from "drizzle-orm/pg-core";
|
|
338
|
+
var juniorApiTokens = pgTable8(
|
|
283
339
|
"junior_api_tokens",
|
|
284
340
|
{
|
|
285
|
-
id:
|
|
286
|
-
ownerEmailNormalized:
|
|
287
|
-
name:
|
|
288
|
-
tokenHash:
|
|
289
|
-
tokenSuffix:
|
|
341
|
+
id: text8("id").primaryKey(),
|
|
342
|
+
ownerEmailNormalized: text8("owner_email_normalized").notNull(),
|
|
343
|
+
name: text8("name").notNull(),
|
|
344
|
+
tokenHash: text8("token_hash").notNull(),
|
|
345
|
+
tokenSuffix: text8("token_suffix").notNull(),
|
|
290
346
|
createdAt: timestamptz("created_at").notNull(),
|
|
291
347
|
expiresAt: timestamptz("expires_at").notNull(),
|
|
292
348
|
lastUsedAt: timestamptz("last_used_at"),
|
|
293
349
|
revokedAt: timestamptz("revoked_at")
|
|
294
350
|
},
|
|
295
351
|
(table) => [
|
|
296
|
-
|
|
297
|
-
|
|
352
|
+
uniqueIndex5("junior_api_tokens_token_hash_uidx").on(table.tokenHash),
|
|
353
|
+
index6("junior_api_tokens_owner_email_idx").on(table.ownerEmailNormalized)
|
|
298
354
|
]
|
|
299
355
|
);
|
|
300
356
|
|
|
301
357
|
// src/db/schema/conversation-events.ts
|
|
302
358
|
import {
|
|
303
359
|
foreignKey as foreignKey2,
|
|
304
|
-
index as
|
|
305
|
-
integer as
|
|
360
|
+
index as index7,
|
|
361
|
+
integer as integer5,
|
|
306
362
|
jsonb as jsonb4,
|
|
307
|
-
pgTable as
|
|
363
|
+
pgTable as pgTable9,
|
|
308
364
|
primaryKey as primaryKey2,
|
|
309
|
-
text as
|
|
310
|
-
uniqueIndex as
|
|
365
|
+
text as text9,
|
|
366
|
+
uniqueIndex as uniqueIndex6
|
|
311
367
|
} from "drizzle-orm/pg-core";
|
|
312
|
-
import { sql as
|
|
313
|
-
var juniorConversationEvents =
|
|
368
|
+
import { sql as sql4 } from "drizzle-orm";
|
|
369
|
+
var juniorConversationEvents = pgTable9(
|
|
314
370
|
"junior_conversation_events",
|
|
315
371
|
{
|
|
316
|
-
conversationId:
|
|
317
|
-
seq:
|
|
318
|
-
historyVersion:
|
|
319
|
-
schemaVersion:
|
|
320
|
-
idempotencyKey:
|
|
321
|
-
type:
|
|
372
|
+
conversationId: text9("conversation_id").notNull(),
|
|
373
|
+
seq: integer5("seq").notNull(),
|
|
374
|
+
historyVersion: integer5("history_version").notNull(),
|
|
375
|
+
schemaVersion: integer5("schema_version").default(1).notNull(),
|
|
376
|
+
idempotencyKey: text9("idempotency_key"),
|
|
377
|
+
type: text9("type").notNull(),
|
|
322
378
|
payload: jsonb4("payload").$type().notNull(),
|
|
323
|
-
actorIdentityId:
|
|
379
|
+
actorIdentityId: text9("actor_identity_id").references(
|
|
324
380
|
() => juniorIdentities.id
|
|
325
381
|
),
|
|
326
382
|
createdAt: timestamptz("created_at").notNull()
|
|
@@ -335,23 +391,23 @@ var juniorConversationEvents = pgTable8(
|
|
|
335
391
|
columns: [table.conversationId],
|
|
336
392
|
foreignColumns: [juniorConversations.conversationId]
|
|
337
393
|
}),
|
|
338
|
-
|
|
394
|
+
index7("junior_conversation_events_history_version_idx").on(
|
|
339
395
|
table.conversationId,
|
|
340
396
|
table.historyVersion,
|
|
341
397
|
table.seq
|
|
342
398
|
),
|
|
343
|
-
|
|
399
|
+
index7("junior_conversation_events_type_idx").on(
|
|
344
400
|
table.conversationId,
|
|
345
401
|
table.type,
|
|
346
402
|
table.seq
|
|
347
403
|
),
|
|
348
|
-
|
|
404
|
+
index7("junior_conversation_events_actor_identity_idx").on(
|
|
349
405
|
table.actorIdentityId,
|
|
350
406
|
table.conversationId,
|
|
351
407
|
table.seq
|
|
352
408
|
),
|
|
353
|
-
|
|
354
|
-
|
|
409
|
+
index7("junior_conversation_events_message_search_idx").using("gin", sql4`to_tsvector('english', ${table.payload}->>'text')`).where(sql4`${table.type} = 'message'`),
|
|
410
|
+
uniqueIndex6("junior_conversation_events_idempotency_idx").on(
|
|
355
411
|
table.conversationId,
|
|
356
412
|
table.idempotencyKey
|
|
357
413
|
)
|
|
@@ -359,15 +415,15 @@ var juniorConversationEvents = pgTable8(
|
|
|
359
415
|
);
|
|
360
416
|
|
|
361
417
|
// src/db/schema/conversation-bindings.ts
|
|
362
|
-
import { index as
|
|
363
|
-
var juniorConversationBindings =
|
|
418
|
+
import { index as index8, pgTable as pgTable10, primaryKey as primaryKey3, text as text10 } from "drizzle-orm/pg-core";
|
|
419
|
+
var juniorConversationBindings = pgTable10(
|
|
364
420
|
"junior_conversation_bindings",
|
|
365
421
|
{
|
|
366
|
-
conversationId:
|
|
367
|
-
provider:
|
|
368
|
-
providerTenantId:
|
|
369
|
-
providerDestinationId:
|
|
370
|
-
providerConversationId:
|
|
422
|
+
conversationId: text10("conversation_id").notNull().references(() => juniorConversations.conversationId),
|
|
423
|
+
provider: text10("provider").notNull(),
|
|
424
|
+
providerTenantId: text10("provider_tenant_id").notNull().default(""),
|
|
425
|
+
providerDestinationId: text10("provider_destination_id").notNull(),
|
|
426
|
+
providerConversationId: text10("provider_conversation_id").notNull(),
|
|
371
427
|
createdAt: timestamptz("created_at").notNull()
|
|
372
428
|
},
|
|
373
429
|
(table) => [
|
|
@@ -380,19 +436,19 @@ var juniorConversationBindings = pgTable9(
|
|
|
380
436
|
table.providerConversationId
|
|
381
437
|
]
|
|
382
438
|
}),
|
|
383
|
-
|
|
439
|
+
index8("junior_conversation_bindings_conversation_idx").on(
|
|
384
440
|
table.conversationId
|
|
385
441
|
)
|
|
386
442
|
]
|
|
387
443
|
);
|
|
388
444
|
|
|
389
445
|
// src/db/schema/conversation-participants.ts
|
|
390
|
-
import { index as
|
|
391
|
-
var juniorConversationParticipants =
|
|
446
|
+
import { index as index9, pgTable as pgTable11, primaryKey as primaryKey4, text as text11 } from "drizzle-orm/pg-core";
|
|
447
|
+
var juniorConversationParticipants = pgTable11(
|
|
392
448
|
"junior_conversation_participants",
|
|
393
449
|
{
|
|
394
|
-
userId:
|
|
395
|
-
rootConversationId:
|
|
450
|
+
userId: text11("user_id").notNull().references(() => juniorUsers.id),
|
|
451
|
+
rootConversationId: text11("root_conversation_id").notNull().references(() => juniorConversations.conversationId),
|
|
396
452
|
lastMessageAt: timestamptz("last_message_at").notNull(),
|
|
397
453
|
archivedAt: timestamptz("archived_at")
|
|
398
454
|
},
|
|
@@ -401,11 +457,11 @@ var juniorConversationParticipants = pgTable10(
|
|
|
401
457
|
name: "junior_conversation_participants_user_root_pk",
|
|
402
458
|
columns: [table.userId, table.rootConversationId]
|
|
403
459
|
}),
|
|
404
|
-
|
|
460
|
+
index9("junior_conversation_participants_user_activity_idx").on(
|
|
405
461
|
table.userId,
|
|
406
462
|
table.lastMessageAt.desc()
|
|
407
463
|
),
|
|
408
|
-
|
|
464
|
+
index9("junior_conversation_participants_root_idx").on(
|
|
409
465
|
table.rootConversationId
|
|
410
466
|
)
|
|
411
467
|
]
|
|
@@ -413,62 +469,62 @@ var juniorConversationParticipants = pgTable10(
|
|
|
413
469
|
|
|
414
470
|
// src/db/schema/agent-invocations.ts
|
|
415
471
|
import {
|
|
416
|
-
index as
|
|
472
|
+
index as index10,
|
|
417
473
|
jsonb as jsonb5,
|
|
418
|
-
pgTable as
|
|
474
|
+
pgTable as pgTable12,
|
|
419
475
|
primaryKey as primaryKey5,
|
|
420
|
-
text as
|
|
421
|
-
uniqueIndex as
|
|
476
|
+
text as text12,
|
|
477
|
+
uniqueIndex as uniqueIndex7
|
|
422
478
|
} from "drizzle-orm/pg-core";
|
|
423
479
|
var AGENT_INVOCATION_MAILBOX_STATUSES = [
|
|
424
480
|
"pending",
|
|
425
481
|
"appended"
|
|
426
482
|
];
|
|
427
|
-
var juniorAgentBindings =
|
|
483
|
+
var juniorAgentBindings = pgTable12(
|
|
428
484
|
"junior_agent_bindings",
|
|
429
485
|
{
|
|
430
|
-
parentConversationId:
|
|
431
|
-
name:
|
|
432
|
-
childConversationId:
|
|
486
|
+
parentConversationId: text12("parent_conversation_id").notNull().references(() => juniorConversations.conversationId),
|
|
487
|
+
name: text12("name").notNull(),
|
|
488
|
+
childConversationId: text12("child_conversation_id").notNull().references(() => juniorConversations.conversationId)
|
|
433
489
|
},
|
|
434
490
|
(table) => [
|
|
435
491
|
primaryKey5({
|
|
436
492
|
columns: [table.parentConversationId, table.name]
|
|
437
493
|
}),
|
|
438
|
-
|
|
494
|
+
uniqueIndex7("junior_agent_bindings_child_idx").on(
|
|
439
495
|
table.childConversationId
|
|
440
496
|
)
|
|
441
497
|
]
|
|
442
498
|
);
|
|
443
|
-
var juniorAgentInvocations =
|
|
499
|
+
var juniorAgentInvocations = pgTable12(
|
|
444
500
|
"junior_agent_invocations",
|
|
445
501
|
{
|
|
446
|
-
invocationId:
|
|
447
|
-
parentConversationId:
|
|
448
|
-
childConversationId:
|
|
449
|
-
agentName:
|
|
450
|
-
input:
|
|
502
|
+
invocationId: text12("invocation_id").primaryKey(),
|
|
503
|
+
parentConversationId: text12("parent_conversation_id").notNull().references(() => juniorConversations.conversationId),
|
|
504
|
+
childConversationId: text12("child_conversation_id").notNull().references(() => juniorConversations.conversationId),
|
|
505
|
+
agentName: text12("agent_name"),
|
|
506
|
+
input: text12("input").notNull(),
|
|
451
507
|
actor: jsonb5("actor_json").$type().notNull(),
|
|
452
508
|
credentialContext: jsonb5(
|
|
453
509
|
"credential_context_json"
|
|
454
510
|
).$type(),
|
|
455
511
|
source: jsonb5("source_json").$type().notNull(),
|
|
456
512
|
destination: jsonb5("destination_json").$type().notNull(),
|
|
457
|
-
destinationVisibility:
|
|
513
|
+
destinationVisibility: text12(
|
|
458
514
|
"destination_visibility"
|
|
459
515
|
).$type(),
|
|
460
|
-
reasoningLevel:
|
|
461
|
-
status:
|
|
462
|
-
mailboxStatus:
|
|
463
|
-
result:
|
|
464
|
-
errorMessage:
|
|
516
|
+
reasoningLevel: text12("reasoning_level").$type(),
|
|
517
|
+
status: text12("status").$type().notNull(),
|
|
518
|
+
mailboxStatus: text12("mailbox_status").$type().notNull(),
|
|
519
|
+
result: text12("result"),
|
|
520
|
+
errorMessage: text12("error_message"),
|
|
465
521
|
createdAt: timestamptz("created_at").notNull(),
|
|
466
522
|
updatedAt: timestamptz("updated_at").notNull(),
|
|
467
523
|
terminalAt: timestamptz("terminal_at")
|
|
468
524
|
},
|
|
469
525
|
(table) => [
|
|
470
|
-
|
|
471
|
-
|
|
526
|
+
index10("junior_agent_invocations_child_idx").on(table.childConversationId),
|
|
527
|
+
index10("junior_agent_invocations_mailbox_idx").on(
|
|
472
528
|
table.mailboxStatus,
|
|
473
529
|
table.createdAt
|
|
474
530
|
)
|
|
@@ -476,42 +532,42 @@ var juniorAgentInvocations = pgTable11(
|
|
|
476
532
|
);
|
|
477
533
|
|
|
478
534
|
// src/db/schema/location-configurations.ts
|
|
479
|
-
import { pgTable as
|
|
480
|
-
var juniorLocationConfigurations =
|
|
535
|
+
import { pgTable as pgTable13, primaryKey as primaryKey6, text as text13 } from "drizzle-orm/pg-core";
|
|
536
|
+
var juniorLocationConfigurations = pgTable13(
|
|
481
537
|
"junior_location_configurations",
|
|
482
538
|
{
|
|
483
|
-
locationId:
|
|
484
|
-
key:
|
|
485
|
-
value:
|
|
539
|
+
locationId: text13("location_id").notNull().references(() => juniorDestinations.id, { onDelete: "cascade" }),
|
|
540
|
+
key: text13("key").notNull(),
|
|
541
|
+
value: text13("value").notNull(),
|
|
486
542
|
updatedAt: timestamptz("updated_at").notNull(),
|
|
487
|
-
updatedBy:
|
|
488
|
-
source:
|
|
489
|
-
expiresAt:
|
|
543
|
+
updatedBy: text13("updated_by"),
|
|
544
|
+
source: text13("source"),
|
|
545
|
+
expiresAt: text13("expires_at")
|
|
490
546
|
},
|
|
491
547
|
(table) => [primaryKey6({ columns: [table.locationId, table.key] })]
|
|
492
548
|
);
|
|
493
549
|
|
|
494
550
|
// src/db/schema/event-tasks.ts
|
|
495
|
-
import { bigint, index as
|
|
496
|
-
var juniorEventTasks =
|
|
551
|
+
import { bigint, index as index11, jsonb as jsonb6, pgTable as pgTable14, text as text14 } from "drizzle-orm/pg-core";
|
|
552
|
+
var juniorEventTasks = pgTable14(
|
|
497
553
|
"junior_event_tasks",
|
|
498
554
|
{
|
|
499
|
-
id:
|
|
500
|
-
teamId:
|
|
501
|
-
namespace:
|
|
502
|
-
identifier:
|
|
555
|
+
id: text14("id").primaryKey(),
|
|
556
|
+
teamId: text14("team_id").notNull(),
|
|
557
|
+
namespace: text14("namespace").notNull(),
|
|
558
|
+
identifier: text14("identifier").notNull(),
|
|
503
559
|
createdAtMs: bigint("created_at_ms", { mode: "number" }).notNull(),
|
|
504
560
|
/** Short display title generated from the task instruction. */
|
|
505
|
-
title:
|
|
561
|
+
title: text14("title"),
|
|
506
562
|
task: jsonb6("task_json").$type().notNull()
|
|
507
563
|
},
|
|
508
564
|
(table) => [
|
|
509
|
-
|
|
565
|
+
index11("junior_event_tasks_team_idx").on(
|
|
510
566
|
table.teamId,
|
|
511
567
|
table.createdAtMs,
|
|
512
568
|
table.id
|
|
513
569
|
),
|
|
514
|
-
|
|
570
|
+
index11("junior_event_tasks_match_idx").on(
|
|
515
571
|
table.namespace,
|
|
516
572
|
table.identifier,
|
|
517
573
|
table.createdAtMs,
|
|
@@ -521,15 +577,15 @@ var juniorEventTasks = pgTable13(
|
|
|
521
577
|
);
|
|
522
578
|
|
|
523
579
|
// src/db/schema/stats.ts
|
|
524
|
-
import { date, integer as
|
|
525
|
-
var juniorStats =
|
|
580
|
+
import { date, integer as integer6, pgTable as pgTable15, primaryKey as primaryKey7, text as text15 } from "drizzle-orm/pg-core";
|
|
581
|
+
var juniorStats = pgTable15(
|
|
526
582
|
"junior_stats",
|
|
527
583
|
{
|
|
528
584
|
date: date("date", { mode: "string" }).notNull(),
|
|
529
|
-
namespace:
|
|
530
|
-
metric:
|
|
531
|
-
name:
|
|
532
|
-
count:
|
|
585
|
+
namespace: text15("namespace").notNull(),
|
|
586
|
+
metric: text15("metric").notNull(),
|
|
587
|
+
name: text15("name").notNull(),
|
|
588
|
+
count: integer6("count").notNull().default(0)
|
|
533
589
|
},
|
|
534
590
|
(table) => [
|
|
535
591
|
primaryKey7({
|
|
@@ -540,35 +596,35 @@ var juniorStats = pgTable14(
|
|
|
540
596
|
);
|
|
541
597
|
|
|
542
598
|
// src/db/schema/task-executions.ts
|
|
543
|
-
import { sql as
|
|
599
|
+
import { sql as sql5 } from "drizzle-orm";
|
|
544
600
|
import {
|
|
545
601
|
bigint as bigint2,
|
|
546
602
|
check,
|
|
547
603
|
foreignKey as foreignKey3,
|
|
548
|
-
index as
|
|
549
|
-
pgTable as
|
|
604
|
+
index as index12,
|
|
605
|
+
pgTable as pgTable16,
|
|
550
606
|
primaryKey as primaryKey8,
|
|
551
|
-
text as
|
|
607
|
+
text as text16
|
|
552
608
|
} from "drizzle-orm/pg-core";
|
|
553
|
-
var juniorTaskExecutions =
|
|
609
|
+
var juniorTaskExecutions = pgTable16(
|
|
554
610
|
"junior_task_executions",
|
|
555
611
|
{
|
|
556
|
-
executionId:
|
|
557
|
-
kind:
|
|
558
|
-
namespace:
|
|
559
|
-
taskId:
|
|
560
|
-
conversationId:
|
|
612
|
+
executionId: text16("execution_id").notNull(),
|
|
613
|
+
kind: text16("kind").notNull(),
|
|
614
|
+
namespace: text16("namespace").notNull(),
|
|
615
|
+
taskId: text16("task_id").notNull(),
|
|
616
|
+
conversationId: text16("conversation_id"),
|
|
561
617
|
executedAtMs: bigint2("executed_at_ms", { mode: "number" }).notNull(),
|
|
562
|
-
status:
|
|
618
|
+
status: text16("status").$type().notNull()
|
|
563
619
|
},
|
|
564
620
|
(table) => [
|
|
565
621
|
check(
|
|
566
622
|
"junior_task_executions_kind_check",
|
|
567
|
-
|
|
623
|
+
sql5`${table.kind} in ('scheduled', 'event')`
|
|
568
624
|
),
|
|
569
625
|
check(
|
|
570
626
|
"junior_task_executions_status_check",
|
|
571
|
-
|
|
627
|
+
sql5`${table.status} in ('blocked', 'completed', 'failed')`
|
|
572
628
|
),
|
|
573
629
|
primaryKey8({
|
|
574
630
|
name: "junior_task_executions_kind_namespace_execution_id_pk",
|
|
@@ -579,17 +635,17 @@ var juniorTaskExecutions = pgTable15(
|
|
|
579
635
|
columns: [table.conversationId],
|
|
580
636
|
foreignColumns: [juniorConversations.conversationId]
|
|
581
637
|
}),
|
|
582
|
-
|
|
638
|
+
index12("junior_task_executions_task_time_idx").on(
|
|
583
639
|
table.kind,
|
|
584
640
|
table.namespace,
|
|
585
641
|
table.taskId,
|
|
586
642
|
table.executedAtMs
|
|
587
643
|
),
|
|
588
|
-
|
|
644
|
+
index12("junior_task_executions_time_kind_idx").on(
|
|
589
645
|
table.executedAtMs,
|
|
590
646
|
table.kind
|
|
591
647
|
),
|
|
592
|
-
|
|
648
|
+
index12("junior_task_executions_conversation_time_idx").on(
|
|
593
649
|
table.conversationId,
|
|
594
650
|
table.executedAtMs
|
|
595
651
|
)
|
|
@@ -597,55 +653,55 @@ var juniorTaskExecutions = pgTable15(
|
|
|
597
653
|
);
|
|
598
654
|
|
|
599
655
|
// src/db/schema/scheduled-tasks.ts
|
|
600
|
-
import { sql as
|
|
601
|
-
import { bigint as bigint3, index as
|
|
602
|
-
var juniorSchedulerTasks =
|
|
656
|
+
import { sql as sql6 } from "drizzle-orm";
|
|
657
|
+
import { bigint as bigint3, index as index13, jsonb as jsonb7, pgTable as pgTable17, text as text17 } from "drizzle-orm/pg-core";
|
|
658
|
+
var juniorSchedulerTasks = pgTable17(
|
|
603
659
|
"junior_scheduler_tasks",
|
|
604
660
|
{
|
|
605
|
-
id:
|
|
606
|
-
teamId:
|
|
661
|
+
id: text17("id").primaryKey(),
|
|
662
|
+
teamId: text17("team_id").notNull(),
|
|
607
663
|
// TODO(v0.128.0): Remove after v0.127.x runtimes no longer write this column.
|
|
608
|
-
creatorSlackUserId:
|
|
609
|
-
creatorIdentityId:
|
|
610
|
-
status:
|
|
664
|
+
creatorSlackUserId: text17("creator_slack_user_id"),
|
|
665
|
+
creatorIdentityId: text17("creator_identity_id"),
|
|
666
|
+
status: text17("status").notNull(),
|
|
611
667
|
nextRunAtMs: bigint3("next_run_at_ms", { mode: "number" }),
|
|
612
668
|
runNowAtMs: bigint3("run_now_at_ms", { mode: "number" }),
|
|
613
669
|
createdAtMs: bigint3("created_at_ms", { mode: "number" }).notNull(),
|
|
614
670
|
/** Short display title generated from the task instruction. */
|
|
615
|
-
title:
|
|
671
|
+
title: text17("title"),
|
|
616
672
|
record: jsonb7("record").$type().notNull()
|
|
617
673
|
},
|
|
618
674
|
(table) => [
|
|
619
675
|
// TODO(v0.128.0): Remove with creatorSlackUserId.
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
676
|
+
index13("junior_scheduler_tasks_creator_idx").on(table.teamId, table.creatorSlackUserId, table.createdAtMs, table.id).where(sql6`${table.status} <> 'deleted'`),
|
|
677
|
+
index13("junior_scheduler_tasks_creator_identity_idx").on(table.creatorIdentityId, table.createdAtMs, table.id).where(
|
|
678
|
+
sql6`${table.status} <> 'deleted' AND ${table.creatorIdentityId} IS NOT NULL`
|
|
623
679
|
),
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
680
|
+
index13("junior_scheduler_tasks_team_status_idx").on(table.teamId, table.createdAtMs, table.id).where(sql6`${table.status} <> 'deleted'`),
|
|
681
|
+
index13("junior_scheduler_tasks_run_now_due_idx").on(table.runNowAtMs, table.createdAtMs, table.id).where(
|
|
682
|
+
sql6`${table.status} = 'active' AND ${table.runNowAtMs} IS NOT NULL`
|
|
627
683
|
),
|
|
628
|
-
|
|
629
|
-
|
|
684
|
+
index13("junior_scheduler_tasks_next_run_due_idx").on(table.nextRunAtMs, table.createdAtMs, table.id).where(
|
|
685
|
+
sql6`${table.status} = 'active' AND ${table.nextRunAtMs} IS NOT NULL`
|
|
630
686
|
)
|
|
631
687
|
]
|
|
632
688
|
);
|
|
633
|
-
var juniorSchedulerRuns =
|
|
689
|
+
var juniorSchedulerRuns = pgTable17(
|
|
634
690
|
"junior_scheduler_runs",
|
|
635
691
|
{
|
|
636
|
-
id:
|
|
637
|
-
taskId:
|
|
638
|
-
status:
|
|
692
|
+
id: text17("id").primaryKey(),
|
|
693
|
+
taskId: text17("task_id").notNull(),
|
|
694
|
+
status: text17("status").notNull(),
|
|
639
695
|
scheduledForMs: bigint3("scheduled_for_ms", { mode: "number" }).notNull(),
|
|
640
696
|
record: jsonb7("record").$type().notNull()
|
|
641
697
|
},
|
|
642
698
|
(table) => [
|
|
643
|
-
|
|
699
|
+
index13("junior_scheduler_runs_task_status_idx").on(
|
|
644
700
|
table.taskId,
|
|
645
701
|
table.status,
|
|
646
702
|
table.scheduledForMs
|
|
647
703
|
),
|
|
648
|
-
|
|
704
|
+
index13("junior_scheduler_runs_status_idx").on(
|
|
649
705
|
table.status,
|
|
650
706
|
table.scheduledForMs
|
|
651
707
|
)
|
|
@@ -653,36 +709,36 @@ var juniorSchedulerRuns = pgTable16(
|
|
|
653
709
|
);
|
|
654
710
|
|
|
655
711
|
// src/db/schema/snapshots.ts
|
|
656
|
-
import { sql as
|
|
712
|
+
import { sql as sql7 } from "drizzle-orm";
|
|
657
713
|
import {
|
|
658
714
|
bigint as bigint4,
|
|
659
715
|
check as check2,
|
|
660
|
-
index as
|
|
661
|
-
integer as
|
|
662
|
-
pgTable as
|
|
663
|
-
text as
|
|
664
|
-
uniqueIndex as
|
|
716
|
+
index as index14,
|
|
717
|
+
integer as integer7,
|
|
718
|
+
pgTable as pgTable19,
|
|
719
|
+
text as text19,
|
|
720
|
+
uniqueIndex as uniqueIndex9
|
|
665
721
|
} from "drizzle-orm/pg-core";
|
|
666
722
|
|
|
667
723
|
// src/db/schema/workspaces.ts
|
|
668
|
-
import { pgTable as
|
|
669
|
-
var juniorWorkspaces =
|
|
724
|
+
import { pgTable as pgTable18, primaryKey as primaryKey9, text as text18, uniqueIndex as uniqueIndex8 } from "drizzle-orm/pg-core";
|
|
725
|
+
var juniorWorkspaces = pgTable18(
|
|
670
726
|
"junior_workspaces",
|
|
671
727
|
{
|
|
672
|
-
id:
|
|
673
|
-
name:
|
|
674
|
-
setupScript:
|
|
728
|
+
id: text18("id").primaryKey(),
|
|
729
|
+
name: text18("name").notNull(),
|
|
730
|
+
setupScript: text18("setup_script").notNull().default(""),
|
|
675
731
|
createdAt: timestamptz("created_at").notNull(),
|
|
676
732
|
updatedAt: timestamptz("updated_at").notNull()
|
|
677
733
|
},
|
|
678
|
-
(table) => [
|
|
734
|
+
(table) => [uniqueIndex8("junior_workspaces_name_idx").on(table.name)]
|
|
679
735
|
);
|
|
680
|
-
var juniorWorkspaceRepos =
|
|
736
|
+
var juniorWorkspaceRepos = pgTable18(
|
|
681
737
|
"junior_workspace_repos",
|
|
682
738
|
{
|
|
683
|
-
workspaceId:
|
|
684
|
-
provider:
|
|
685
|
-
repo:
|
|
739
|
+
workspaceId: text18("workspace_id").notNull().references(() => juniorWorkspaces.id, { onDelete: "cascade" }),
|
|
740
|
+
provider: text18("provider").notNull(),
|
|
741
|
+
repo: text18("repo").notNull()
|
|
686
742
|
},
|
|
687
743
|
(table) => [
|
|
688
744
|
primaryKey9({ columns: [table.workspaceId, table.provider, table.repo] })
|
|
@@ -690,63 +746,63 @@ var juniorWorkspaceRepos = pgTable17(
|
|
|
690
746
|
);
|
|
691
747
|
|
|
692
748
|
// src/db/schema/snapshots.ts
|
|
693
|
-
var juniorSnapshots =
|
|
749
|
+
var juniorSnapshots = pgTable19(
|
|
694
750
|
"junior_snapshots",
|
|
695
751
|
{
|
|
696
|
-
id:
|
|
697
|
-
workspaceId:
|
|
698
|
-
profileHash:
|
|
699
|
-
status:
|
|
752
|
+
id: text19("id").primaryKey(),
|
|
753
|
+
workspaceId: text19("workspace_id").notNull().references(() => juniorWorkspaces.id, { onDelete: "cascade" }),
|
|
754
|
+
profileHash: text19("profile_hash").notNull(),
|
|
755
|
+
status: text19("status").$type().notNull(),
|
|
700
756
|
// Ready artifact facts.
|
|
701
|
-
snapshotId:
|
|
702
|
-
buildDurationMs:
|
|
757
|
+
snapshotId: text19("snapshot_id"),
|
|
758
|
+
buildDurationMs: integer7("build_duration_ms"),
|
|
703
759
|
// Provider snapshot size when the capture response includes it.
|
|
704
760
|
sizeBytes: bigint4("size_bytes", { mode: "number" }),
|
|
705
761
|
generatedAt: timestamptz("generated_at"),
|
|
706
762
|
// Builder references for check-in and snapshot-owner cleanup.
|
|
707
763
|
buildStartedAt: timestamptz("build_started_at"),
|
|
708
|
-
buildPhase:
|
|
709
|
-
buildSandboxName:
|
|
710
|
-
buildCommandId:
|
|
711
|
-
buildError:
|
|
764
|
+
buildPhase: text19("build_phase").$type(),
|
|
765
|
+
buildSandboxName: text19("build_sandbox_name"),
|
|
766
|
+
buildCommandId: text19("build_command_id"),
|
|
767
|
+
buildError: text19("build_error"),
|
|
712
768
|
createdAt: timestamptz("created_at").notNull(),
|
|
713
769
|
updatedAt: timestamptz("updated_at").notNull()
|
|
714
770
|
},
|
|
715
771
|
(table) => [
|
|
716
772
|
check2(
|
|
717
773
|
"junior_snapshots_status_check",
|
|
718
|
-
|
|
774
|
+
sql7`${table.status} in ('building', 'failed', 'ready')`
|
|
719
775
|
),
|
|
720
776
|
check2(
|
|
721
777
|
"junior_snapshots_build_phase_check",
|
|
722
|
-
|
|
778
|
+
sql7`${table.buildPhase} is null or ${table.buildPhase} in ('created', 'dependencies_installed', 'repositories_prepared')`
|
|
723
779
|
),
|
|
724
780
|
check2(
|
|
725
781
|
"junior_snapshots_ready_fields_check",
|
|
726
|
-
|
|
782
|
+
sql7`${table.status} <> 'ready' or (${table.snapshotId} is not null and ${table.buildDurationMs} is not null and ${table.generatedAt} is not null)`
|
|
727
783
|
),
|
|
728
784
|
check2(
|
|
729
785
|
"junior_snapshots_build_fields_check",
|
|
730
|
-
|
|
786
|
+
sql7`${table.status} = 'ready' or (${table.buildStartedAt} is not null and ${table.buildPhase} is not null)`
|
|
731
787
|
),
|
|
732
788
|
check2(
|
|
733
789
|
"junior_snapshots_build_duration_check",
|
|
734
|
-
|
|
790
|
+
sql7`${table.buildDurationMs} is null or ${table.buildDurationMs} >= 0`
|
|
735
791
|
),
|
|
736
792
|
check2(
|
|
737
793
|
"junior_snapshots_size_bytes_check",
|
|
738
|
-
|
|
794
|
+
sql7`${table.sizeBytes} is null or ${table.sizeBytes} >= 0`
|
|
739
795
|
),
|
|
740
796
|
// Provider snapshot ids are unique. Nulls stay allowed for in-flight rows.
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
797
|
+
uniqueIndex9("junior_snapshots_snapshot_id_uidx").on(table.snapshotId),
|
|
798
|
+
index14("junior_snapshots_workspace_idx").on(table.workspaceId),
|
|
799
|
+
index14("junior_snapshots_workspace_profile_status_idx").on(
|
|
744
800
|
table.workspaceId,
|
|
745
801
|
table.profileHash,
|
|
746
802
|
table.status
|
|
747
803
|
),
|
|
748
|
-
|
|
749
|
-
|
|
804
|
+
uniqueIndex9("junior_snapshots_active_build_uidx").on(table.workspaceId, table.profileHash).where(sql7`${table.status} = 'building'`),
|
|
805
|
+
index14("junior_snapshots_workspace_status_idx").on(
|
|
750
806
|
table.workspaceId,
|
|
751
807
|
table.status
|
|
752
808
|
)
|
|
@@ -757,6 +813,8 @@ var juniorSnapshots = pgTable18(
|
|
|
757
813
|
var juniorSqlSchema = {
|
|
758
814
|
juniorArtifacts,
|
|
759
815
|
juniorAttachments,
|
|
816
|
+
juniorCodeChanges,
|
|
817
|
+
juniorCodeRepositories,
|
|
760
818
|
juniorConversationAnnotations,
|
|
761
819
|
juniorApiTokens,
|
|
762
820
|
juniorAgentBindings,
|
|
@@ -1035,6 +1093,8 @@ export {
|
|
|
1035
1093
|
juniorConversations,
|
|
1036
1094
|
conversationReadColumns,
|
|
1037
1095
|
juniorAttachments,
|
|
1096
|
+
juniorCodeRepositories,
|
|
1097
|
+
juniorCodeChanges,
|
|
1038
1098
|
juniorConversationAnnotations,
|
|
1039
1099
|
juniorApiTokens,
|
|
1040
1100
|
juniorConversationEvents,
|