@rulemetric/cli 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/{chunk-5ZOLDIZQ.js → chunk-BCIUSUEV.js} +5 -5
  2. package/dist/{chunk-LJ5OT5XN.js → chunk-CROYS75W.js} +4 -4
  3. package/dist/{chunk-AOIY5RT6.js → chunk-CXWY5XKD.js} +15 -15
  4. package/dist/{chunk-K3BFZ7KG.js → chunk-E3BIT53W.js} +1 -1
  5. package/dist/chunk-E3BIT53W.js.map +7 -0
  6. package/dist/{chunk-46LMTDRE.js → chunk-ER5DPPHB.js} +2 -2
  7. package/dist/{chunk-4QGATD5Y.js → chunk-F5N6CLJJ.js} +1 -1
  8. package/dist/{chunk-4QGATD5Y.js.map → chunk-F5N6CLJJ.js.map} +2 -2
  9. package/dist/{chunk-7XDWLJJP.js → chunk-H3C6EGR2.js} +5 -5
  10. package/dist/{chunk-IVOCDHWA.js → chunk-IPOO4IGF.js} +3 -3
  11. package/dist/{chunk-YQFCUKNI.js → chunk-QNSVCSHG.js} +373 -414
  12. package/dist/chunk-QNSVCSHG.js.map +7 -0
  13. package/dist/{chunk-PHIAFGQ2.js → chunk-T76YQCKX.js} +6 -6
  14. package/dist/{chunk-IKEI4KNV.js → chunk-VCG4Q53B.js} +3 -3
  15. package/dist/{chunk-DUR54APY.js → chunk-WLFX4PYR.js} +6 -6
  16. package/dist/{chunk-FUS5C4SB.js → chunk-Y4BJXXYV.js} +2 -2
  17. package/dist/commands/auth/create-key.js +3 -1
  18. package/dist/commands/auth/create-key.js.map +2 -2
  19. package/dist/commands/evals/agent.js +18 -21
  20. package/dist/commands/evals/agent.js.map +4 -4
  21. package/dist/commands/research/backfill.js +3 -3
  22. package/dist/commands/research/tail-transcript.js +3 -3
  23. package/dist/commands/service/install.js +5 -0
  24. package/dist/commands/service/install.js.map +2 -2
  25. package/dist/dashboard/Dashboard.js +13 -13
  26. package/dist/dashboard/data.js +2 -2
  27. package/dist/dashboard/launcher/LauncherOverlay.js +3 -3
  28. package/dist/{dist-NEECHU47.js → dist-UNYP5PJR.js} +2 -2
  29. package/dist/lib/agent-loop.js +14 -14
  30. package/dist/lib/handlers/cron-suggest-instructions.js +3 -3
  31. package/dist/lib/handlers/process-announcement.js +3 -3
  32. package/dist/lib/handlers/process-changelog.js +3 -3
  33. package/dist/lib/handlers/process-launch.js +3 -3
  34. package/dist/lib/handlers/process-run-cleanup.js +4 -4
  35. package/dist/lib/handlers/process-session-goal.js +2 -2
  36. package/dist/lib/manual-tasks.js +6 -6
  37. package/dist/lib/worktree.js +2 -2
  38. package/oclif.manifest.json +1 -40
  39. package/package.json +7 -7
  40. package/dist/chunk-K3BFZ7KG.js.map +0 -7
  41. package/dist/chunk-YQFCUKNI.js.map +0 -7
  42. package/dist/commands/signals/report.js +0 -43
  43. package/dist/commands/signals/report.js.map +0 -7
  44. package/dist/lib/handlers/cron-close-stale-sessions.js +0 -19
  45. package/dist/lib/handlers/cron-close-stale-sessions.js.map +0 -7
  46. package/dist/lib/handlers/cron-data-integrity-audit.js +0 -22
  47. package/dist/lib/handlers/cron-data-integrity-audit.js.map +0 -7
  48. package/dist/lib/provider-aggregator.js +0 -59
  49. package/dist/lib/provider-aggregator.js.map +0 -7
  50. /package/dist/{chunk-5ZOLDIZQ.js.map → chunk-BCIUSUEV.js.map} +0 -0
  51. /package/dist/{chunk-LJ5OT5XN.js.map → chunk-CROYS75W.js.map} +0 -0
  52. /package/dist/{chunk-AOIY5RT6.js.map → chunk-CXWY5XKD.js.map} +0 -0
  53. /package/dist/{chunk-46LMTDRE.js.map → chunk-ER5DPPHB.js.map} +0 -0
  54. /package/dist/{chunk-7XDWLJJP.js.map → chunk-H3C6EGR2.js.map} +0 -0
  55. /package/dist/{chunk-IVOCDHWA.js.map → chunk-IPOO4IGF.js.map} +0 -0
  56. /package/dist/{chunk-PHIAFGQ2.js.map → chunk-T76YQCKX.js.map} +0 -0
  57. /package/dist/{chunk-IKEI4KNV.js.map → chunk-VCG4Q53B.js.map} +0 -0
  58. /package/dist/{chunk-DUR54APY.js.map → chunk-WLFX4PYR.js.map} +0 -0
  59. /package/dist/{chunk-FUS5C4SB.js.map → chunk-Y4BJXXYV.js.map} +0 -0
  60. /package/dist/{dist-NEECHU47.js.map → dist-UNYP5PJR.js.map} +0 -0
@@ -426,187 +426,175 @@ var packInstructions = pgTable12("pack_instructions", {
426
426
  primaryKey3({ columns: [table.packId, table.instructionId] })
427
427
  ]);
428
428
 
429
- // ../../packages/db/dist/schema/tables/project-signals.js
430
- import { pgTable as pgTable13, text as text13, timestamp as timestamp13, uuid as uuid13, index as index10, primaryKey as primaryKey4 } from "drizzle-orm/pg-core";
431
- var projectSignals = pgTable13("project_signals", {
432
- userId: uuid13("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
433
- projectPath: text13("project_path").notNull(),
434
- detectedLanguages: text13("detected_languages").array().notNull().default([]).$type(),
435
- lastSeenAt: timestamp13("last_seen_at", { withTimezone: true }).notNull().defaultNow()
436
- }, (table) => [
437
- primaryKey4({ columns: [table.userId, table.projectPath] }),
438
- index10("idx_project_signals_user_seen").on(table.userId, table.lastSeenAt)
439
- ]);
440
-
441
429
  // ../../packages/db/dist/schema/tables/usage-events.js
442
- import { pgTable as pgTable14, text as text14, timestamp as timestamp14, jsonb as jsonb11, uuid as uuid14, index as index11 } from "drizzle-orm/pg-core";
443
- var instructionUsageEvents = pgTable14("instruction_usage_events", {
444
- id: uuid14("id").primaryKey().defaultRandom(),
445
- instructionId: uuid14("instruction_id").references(() => instructions.id, { onDelete: "set null" }),
446
- userId: uuid14("user_id").notNull(),
447
- surface: text14("surface").notNull(),
448
- action: text14("action").notNull(),
430
+ import { pgTable as pgTable13, text as text13, timestamp as timestamp13, jsonb as jsonb11, uuid as uuid13, index as index10 } from "drizzle-orm/pg-core";
431
+ var instructionUsageEvents = pgTable13("instruction_usage_events", {
432
+ id: uuid13("id").primaryKey().defaultRandom(),
433
+ instructionId: uuid13("instruction_id").references(() => instructions.id, { onDelete: "set null" }),
434
+ userId: uuid13("user_id").notNull(),
435
+ surface: text13("surface").notNull(),
436
+ action: text13("action").notNull(),
449
437
  metadata: jsonb11("metadata"),
450
- traceId: text14("trace_id"),
451
- createdAt: timestamp14("created_at", { withTimezone: true }).defaultNow()
438
+ traceId: text13("trace_id"),
439
+ createdAt: timestamp13("created_at", { withTimezone: true }).defaultNow()
452
440
  }, (table) => [
453
- index11("idx_usage_events_instruction").on(table.instructionId),
454
- index11("idx_usage_events_user").on(table.userId),
455
- index11("idx_usage_events_surface").on(table.surface),
456
- index11("idx_usage_events_action").on(table.action),
457
- index11("idx_usage_events_created_at").on(table.createdAt),
458
- index11("idx_usage_events_user_created").on(table.userId, table.createdAt)
441
+ index10("idx_usage_events_instruction").on(table.instructionId),
442
+ index10("idx_usage_events_user").on(table.userId),
443
+ index10("idx_usage_events_surface").on(table.surface),
444
+ index10("idx_usage_events_action").on(table.action),
445
+ index10("idx_usage_events_created_at").on(table.createdAt),
446
+ index10("idx_usage_events_user_created").on(table.userId, table.createdAt)
459
447
  ]);
460
448
 
461
449
  // ../../packages/db/dist/schema/tables/worker-connections.js
462
- import { pgTable as pgTable15, text as text15, timestamp as timestamp15, jsonb as jsonb12, uuid as uuid15, index as index12 } from "drizzle-orm/pg-core";
463
- var workerConnections = pgTable15("worker_connections", {
464
- id: uuid15("id").primaryKey().defaultRandom(),
465
- userId: uuid15("user_id").notNull(),
466
- workerType: text15("worker_type").notNull().default("mcp"),
467
- clientName: text15("client_name").notNull(),
468
- clientVersion: text15("client_version"),
469
- workerVersion: text15("worker_version"),
470
- lastHeartbeat: timestamp15("last_heartbeat", { withTimezone: true }).notNull().defaultNow(),
471
- connectedAt: timestamp15("connected_at", { withTimezone: true }).notNull().defaultNow(),
450
+ import { pgTable as pgTable14, text as text14, timestamp as timestamp14, jsonb as jsonb12, uuid as uuid14, index as index11 } from "drizzle-orm/pg-core";
451
+ var workerConnections = pgTable14("worker_connections", {
452
+ id: uuid14("id").primaryKey().defaultRandom(),
453
+ userId: uuid14("user_id").notNull(),
454
+ workerType: text14("worker_type").notNull().default("mcp"),
455
+ clientName: text14("client_name").notNull(),
456
+ clientVersion: text14("client_version"),
457
+ workerVersion: text14("worker_version"),
458
+ lastHeartbeat: timestamp14("last_heartbeat", { withTimezone: true }).notNull().defaultNow(),
459
+ connectedAt: timestamp14("connected_at", { withTimezone: true }).notNull().defaultNow(),
472
460
  metadata: jsonb12("metadata")
473
461
  }, (table) => [
474
- index12("idx_worker_connections_user").on(table.userId),
475
- index12("idx_worker_connections_heartbeat").on(table.userId, table.lastHeartbeat),
476
- index12("idx_worker_connections_type").on(table.userId, table.workerType)
462
+ index11("idx_worker_connections_user").on(table.userId),
463
+ index11("idx_worker_connections_heartbeat").on(table.userId, table.lastHeartbeat),
464
+ index11("idx_worker_connections_type").on(table.userId, table.workerType)
477
465
  ]);
478
466
 
479
467
  // ../../packages/db/dist/schema/tables/eval-targets.js
480
- import { pgTable as pgTable16, text as text16, timestamp as timestamp16, jsonb as jsonb13, uuid as uuid16, integer as integer7, index as index13 } from "drizzle-orm/pg-core";
481
- var evalTargets = pgTable16("eval_targets", {
482
- id: uuid16("id").primaryKey().defaultRandom(),
483
- userId: uuid16("user_id").notNull(),
484
- name: text16("name").notNull(),
485
- type: text16("type").notNull(),
486
- content: text16("content").notNull(),
487
- description: text16("description").notNull().default(""),
468
+ import { pgTable as pgTable15, text as text15, timestamp as timestamp15, jsonb as jsonb13, uuid as uuid15, integer as integer7, index as index12 } from "drizzle-orm/pg-core";
469
+ var evalTargets = pgTable15("eval_targets", {
470
+ id: uuid15("id").primaryKey().defaultRandom(),
471
+ userId: uuid15("user_id").notNull(),
472
+ name: text15("name").notNull(),
473
+ type: text15("type").notNull(),
474
+ content: text15("content").notNull(),
475
+ description: text15("description").notNull().default(""),
488
476
  metadata: jsonb13("metadata").notNull().default({}),
489
477
  version: integer7("version").notNull().default(1),
490
- parentId: uuid16("parent_id").references(() => evalTargets.id, { onDelete: "set null" }),
491
- createdAt: timestamp16("created_at", { withTimezone: true }).defaultNow(),
492
- updatedAt: timestamp16("updated_at", { withTimezone: true }).defaultNow()
478
+ parentId: uuid15("parent_id").references(() => evalTargets.id, { onDelete: "set null" }),
479
+ createdAt: timestamp15("created_at", { withTimezone: true }).defaultNow(),
480
+ updatedAt: timestamp15("updated_at", { withTimezone: true }).defaultNow()
493
481
  }, (table) => [
494
- index13("eval_targets_name_user_idx").on(table.name, table.userId),
495
- index13("idx_eval_targets_user").on(table.userId),
496
- index13("idx_eval_targets_type").on(table.type),
497
- index13("idx_eval_targets_parent").on(table.parentId)
482
+ index12("eval_targets_name_user_idx").on(table.name, table.userId),
483
+ index12("idx_eval_targets_user").on(table.userId),
484
+ index12("idx_eval_targets_type").on(table.type),
485
+ index12("idx_eval_targets_parent").on(table.parentId)
498
486
  ]);
499
- var evals = pgTable16("evals", {
500
- id: uuid16("id").primaryKey().defaultRandom(),
501
- evalTargetId: uuid16("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
502
- name: text16("name").notNull(),
503
- prompt: text16("prompt").notNull(),
504
- expectedOutput: text16("expected_output").notNull().default(""),
487
+ var evals = pgTable15("evals", {
488
+ id: uuid15("id").primaryKey().defaultRandom(),
489
+ evalTargetId: uuid15("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
490
+ name: text15("name").notNull(),
491
+ prompt: text15("prompt").notNull(),
492
+ expectedOutput: text15("expected_output").notNull().default(""),
505
493
  files: jsonb13("files").notNull().default([]),
506
494
  expectations: jsonb13("expectations").notNull().default([]),
507
- createdAt: timestamp16("created_at", { withTimezone: true }).defaultNow(),
508
- updatedAt: timestamp16("updated_at", { withTimezone: true }).defaultNow()
495
+ createdAt: timestamp15("created_at", { withTimezone: true }).defaultNow(),
496
+ updatedAt: timestamp15("updated_at", { withTimezone: true }).defaultNow()
509
497
  }, (table) => [
510
- index13("idx_evals_target").on(table.evalTargetId)
498
+ index12("idx_evals_target").on(table.evalTargetId)
511
499
  ]);
512
- var evalRuns = pgTable16("eval_runs", {
513
- id: uuid16("id").primaryKey().defaultRandom(),
514
- evalId: uuid16("eval_id").notNull().references(() => evals.id, { onDelete: "cascade" }),
515
- evalTargetId: uuid16("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
500
+ var evalRuns = pgTable15("eval_runs", {
501
+ id: uuid15("id").primaryKey().defaultRandom(),
502
+ evalId: uuid15("eval_id").notNull().references(() => evals.id, { onDelete: "cascade" }),
503
+ evalTargetId: uuid15("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
516
504
  evalTargetVersion: integer7("eval_target_version").notNull(),
517
- configuration: text16("configuration").notNull(),
505
+ configuration: text15("configuration").notNull(),
518
506
  runNumber: integer7("run_number").notNull().default(1),
519
507
  iteration: integer7("iteration").notNull().default(1),
520
- status: text16("status").notNull().default("completed"),
508
+ status: text15("status").notNull().default("completed"),
521
509
  outputs: jsonb13("outputs").notNull().default({}),
522
510
  timing: jsonb13("timing").notNull().default({}),
523
511
  grading: jsonb13("grading").notNull().default({}),
524
512
  comparison: jsonb13("comparison"),
525
- createdAt: timestamp16("created_at", { withTimezone: true }).defaultNow()
513
+ createdAt: timestamp15("created_at", { withTimezone: true }).defaultNow()
526
514
  }, (table) => [
527
- index13("idx_eval_runs_eval").on(table.evalId),
528
- index13("idx_eval_runs_target").on(table.evalTargetId),
529
- index13("idx_eval_runs_iteration").on(table.evalTargetId, table.iteration)
515
+ index12("idx_eval_runs_eval").on(table.evalId),
516
+ index12("idx_eval_runs_target").on(table.evalTargetId),
517
+ index12("idx_eval_runs_iteration").on(table.evalTargetId, table.iteration)
530
518
  ]);
531
- var benchmarks = pgTable16("benchmarks", {
532
- id: uuid16("id").primaryKey().defaultRandom(),
533
- evalTargetId: uuid16("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
519
+ var benchmarks = pgTable15("benchmarks", {
520
+ id: uuid15("id").primaryKey().defaultRandom(),
521
+ evalTargetId: uuid15("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
534
522
  iteration: integer7("iteration").notNull().default(1),
535
523
  runSummary: jsonb13("run_summary").notNull().default({}),
536
524
  notes: jsonb13("notes").notNull().default([]),
537
525
  feedback: jsonb13("feedback"),
538
- createdAt: timestamp16("created_at", { withTimezone: true }).defaultNow()
526
+ createdAt: timestamp15("created_at", { withTimezone: true }).defaultNow()
539
527
  }, (table) => [
540
- index13("idx_benchmarks_target").on(table.evalTargetId)
528
+ index12("idx_benchmarks_target").on(table.evalTargetId)
541
529
  ]);
542
530
 
543
531
  // ../../packages/db/dist/schema/tables/optimization.js
544
- import { pgTable as pgTable17, text as text17, timestamp as timestamp17, jsonb as jsonb14, uuid as uuid17, integer as integer8, index as index14, real } from "drizzle-orm/pg-core";
545
- var triggerEvals = pgTable17("trigger_evals", {
546
- id: uuid17("id").primaryKey().defaultRandom(),
547
- evalTargetId: uuid17("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
548
- userId: uuid17("user_id").notNull(),
532
+ import { pgTable as pgTable16, text as text16, timestamp as timestamp16, jsonb as jsonb14, uuid as uuid16, integer as integer8, index as index13, real } from "drizzle-orm/pg-core";
533
+ var triggerEvals = pgTable16("trigger_evals", {
534
+ id: uuid16("id").primaryKey().defaultRandom(),
535
+ evalTargetId: uuid16("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
536
+ userId: uuid16("user_id").notNull(),
549
537
  queries: jsonb14("queries").notNull().default([]),
550
- status: text17("status").notNull().default("pending_review"),
538
+ status: text16("status").notNull().default("pending_review"),
551
539
  trainIndices: integer8("train_indices").array().default([]),
552
540
  testIndices: integer8("test_indices").array().default([]),
553
- createdAt: timestamp17("created_at", { withTimezone: true }).defaultNow(),
554
- updatedAt: timestamp17("updated_at", { withTimezone: true }).defaultNow()
541
+ createdAt: timestamp16("created_at", { withTimezone: true }).defaultNow(),
542
+ updatedAt: timestamp16("updated_at", { withTimezone: true }).defaultNow()
555
543
  }, (table) => [
556
- index14("idx_trigger_evals_target").on(table.evalTargetId),
557
- index14("idx_trigger_evals_user").on(table.userId)
544
+ index13("idx_trigger_evals_target").on(table.evalTargetId),
545
+ index13("idx_trigger_evals_user").on(table.userId)
558
546
  ]);
559
- var optimizationRuns = pgTable17("optimization_runs", {
560
- id: uuid17("id").primaryKey().defaultRandom(),
561
- evalTargetId: uuid17("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
562
- userId: uuid17("user_id").notNull(),
563
- type: text17("type").notNull(),
547
+ var optimizationRuns = pgTable16("optimization_runs", {
548
+ id: uuid16("id").primaryKey().defaultRandom(),
549
+ evalTargetId: uuid16("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
550
+ userId: uuid16("user_id").notNull(),
551
+ type: text16("type").notNull(),
564
552
  iteration: integer8("iteration").notNull(),
565
553
  inputVersion: integer8("input_version").notNull(),
566
554
  outputVersion: integer8("output_version"),
567
555
  trainScore: real("train_score"),
568
556
  testScore: real("test_score"),
569
557
  analysis: jsonb14("analysis").notNull().default({}),
570
- status: text17("status").notNull().default("running"),
571
- createdAt: timestamp17("created_at", { withTimezone: true }).defaultNow()
558
+ status: text16("status").notNull().default("running"),
559
+ createdAt: timestamp16("created_at", { withTimezone: true }).defaultNow()
572
560
  }, (table) => [
573
- index14("idx_optimization_runs_target").on(table.evalTargetId),
574
- index14("idx_optimization_runs_user").on(table.userId)
561
+ index13("idx_optimization_runs_target").on(table.evalTargetId),
562
+ index13("idx_optimization_runs_user").on(table.userId)
575
563
  ]);
576
564
 
577
565
  // ../../packages/db/dist/schema/tables/context-snapshots.js
578
- import { pgTable as pgTable18, text as text18, timestamp as timestamp18, jsonb as jsonb15, uuid as uuid18, integer as integer9, real as real2, index as index15, uniqueIndex as uniqueIndex7 } from "drizzle-orm/pg-core";
579
- var contextSnapshots = pgTable18("context_snapshots", {
580
- id: uuid18("id").primaryKey().defaultRandom(),
581
- sessionId: uuid18("session_id").references(() => sessions.id, { onDelete: "cascade" }),
582
- userId: uuid18("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
566
+ import { pgTable as pgTable17, text as text17, timestamp as timestamp17, jsonb as jsonb15, uuid as uuid17, integer as integer9, real as real2, index as index14, uniqueIndex as uniqueIndex7 } from "drizzle-orm/pg-core";
567
+ var contextSnapshots = pgTable17("context_snapshots", {
568
+ id: uuid17("id").primaryKey().defaultRandom(),
569
+ sessionId: uuid17("session_id").references(() => sessions.id, { onDelete: "cascade" }),
570
+ userId: uuid17("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
583
571
  sequence: integer9("sequence").notNull().default(0),
584
- provider: text18("provider").notNull(),
585
- model: text18("model").notNull(),
586
- systemPrompt: text18("system_prompt").notNull(),
572
+ provider: text17("provider").notNull(),
573
+ model: text17("model").notNull(),
574
+ systemPrompt: text17("system_prompt").notNull(),
587
575
  injectedInstructions: jsonb15("injected_instructions").notNull().default([]),
588
576
  messagesSummary: jsonb15("messages_summary").notNull(),
589
577
  tools: jsonb15("tools").notNull().default([]),
590
578
  // Deprecated: use content_blobs via tools_hash
591
- systemHash: text18("system_hash").notNull(),
592
- requestHash: text18("request_hash").notNull().default(""),
593
- toolsHash: text18("tools_hash"),
594
- injectedHash: text18("injected_hash"),
579
+ systemHash: text17("system_hash").notNull(),
580
+ requestHash: text17("request_hash").notNull().default(""),
581
+ toolsHash: text17("tools_hash"),
582
+ injectedHash: text17("injected_hash"),
595
583
  messagesDelta: jsonb15("messages_delta").default([]),
596
584
  // Storage pointer set when messages_delta is offloaded to the snapshot-deltas
597
585
  // bucket (Stage 1+). NULL = inline (messages_delta populated) OR pruned (both
598
586
  // NULL — see 00101). docs/plans/2026-06-24-messages-delta-object-storage-offload.md
599
- messagesDeltaRef: text18("messages_delta_ref"),
587
+ messagesDeltaRef: text17("messages_delta_ref"),
600
588
  maxTokens: integer9("max_tokens"),
601
589
  temperature: real2("temperature"),
602
590
  estimatedTokens: integer9("estimated_tokens"),
603
- capturedAt: timestamp18("captured_at", { withTimezone: true }).notNull().defaultNow(),
591
+ capturedAt: timestamp17("captured_at", { withTimezone: true }).notNull().defaultNow(),
604
592
  metadata: jsonb15("metadata").default({})
605
593
  }, (table) => [
606
- index15("idx_context_snapshots_session").on(table.sessionId),
607
- index15("idx_context_snapshots_user").on(table.userId),
608
- index15("idx_context_snapshots_hash").on(table.systemHash),
609
- index15("idx_context_snapshots_request_hash").on(table.requestHash),
594
+ index14("idx_context_snapshots_session").on(table.sessionId),
595
+ index14("idx_context_snapshots_user").on(table.userId),
596
+ index14("idx_context_snapshots_hash").on(table.systemHash),
597
+ index14("idx_context_snapshots_request_hash").on(table.requestHash),
610
598
  uniqueIndex7("idx_snapshots_session_request").on(table.sessionId, table.requestHash),
611
599
  // Concurrent snapshot POSTs for one session must not reuse a sequence — stops
612
600
  // the live duplicate-sequence corruption. Built via migration 00095.
@@ -616,378 +604,378 @@ var contextSnapshots = pgTable18("context_snapshots", {
616
604
  // WHERE user_id ORDER BY session_id, captured_at DESC). Matches the ORDER BY so
617
605
  // the planner drops the Incremental Sort (the ~11s-max, temp-spill-prone step);
618
606
  // verified 60.6ms -> 26.3ms. Built CONCURRENTLY via migration 00106.
619
- index15("idx_context_snapshots_user_session_captured").on(table.userId, table.sessionId, table.capturedAt.desc())
607
+ index14("idx_context_snapshots_user_session_captured").on(table.userId, table.sessionId, table.capturedAt.desc())
620
608
  ]);
621
609
 
622
610
  // ../../packages/db/dist/schema/tables/content-blobs.js
623
- import { pgTable as pgTable19, text as text19, timestamp as timestamp19, jsonb as jsonb16, integer as integer10, index as index16 } from "drizzle-orm/pg-core";
624
- var contentBlobs = pgTable19("content_blobs", {
625
- hash: text19("hash").primaryKey(),
626
- contentType: text19("content_type").notNull(),
611
+ import { pgTable as pgTable18, text as text18, timestamp as timestamp18, jsonb as jsonb16, integer as integer10, index as index15 } from "drizzle-orm/pg-core";
612
+ var contentBlobs = pgTable18("content_blobs", {
613
+ hash: text18("hash").primaryKey(),
614
+ contentType: text18("content_type").notNull(),
627
615
  content: jsonb16("content").notNull(),
628
616
  sizeBytes: integer10("size_bytes").notNull().default(0),
629
- createdAt: timestamp19("created_at", { withTimezone: true }).defaultNow()
617
+ createdAt: timestamp18("created_at", { withTimezone: true }).defaultNow()
630
618
  }, (table) => [
631
- index16("idx_content_blobs_type").on(table.contentType)
619
+ index15("idx_content_blobs_type").on(table.contentType)
632
620
  ]);
633
621
 
634
622
  // ../../packages/db/dist/schema/tables/eval-jobs.js
635
- import { pgTable as pgTable20, text as text20, timestamp as timestamp20, jsonb as jsonb17, uuid as uuid19, index as index17, integer as integer11, bigint as bigint2 } from "drizzle-orm/pg-core";
636
- var evalJobs = pgTable20("eval_jobs", {
637
- id: uuid19("id").primaryKey().defaultRandom(),
638
- userId: uuid19("user_id").notNull(),
639
- evalTargetId: uuid19("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
640
- status: text20("status").notNull().default("pending"),
623
+ import { pgTable as pgTable19, text as text19, timestamp as timestamp19, jsonb as jsonb17, uuid as uuid18, index as index16, integer as integer11, bigint as bigint2 } from "drizzle-orm/pg-core";
624
+ var evalJobs = pgTable19("eval_jobs", {
625
+ id: uuid18("id").primaryKey().defaultRandom(),
626
+ userId: uuid18("user_id").notNull(),
627
+ evalTargetId: uuid18("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
628
+ status: text19("status").notNull().default("pending"),
641
629
  config: jsonb17("config").notNull().default({}),
642
630
  progress: jsonb17("progress").notNull().default({}),
643
631
  result: jsonb17("result"),
644
- error: text20("error"),
632
+ error: text19("error"),
645
633
  attempts: integer11("attempts").notNull().default(0),
646
634
  graphileJobId: bigint2("graphile_job_id", { mode: "number" }),
647
- taskKind: text20("task_kind"),
635
+ taskKind: text19("task_kind"),
648
636
  payload: jsonb17("payload"),
649
- claimedBy: text20("claimed_by"),
650
- claimedAt: timestamp20("claimed_at", { withTimezone: true }),
651
- leaseExpiresAt: timestamp20("lease_expires_at", { withTimezone: true }),
652
- createdAt: timestamp20("created_at", { withTimezone: true }).defaultNow(),
653
- updatedAt: timestamp20("updated_at", { withTimezone: true }).defaultNow(),
654
- completedAt: timestamp20("completed_at", { withTimezone: true })
637
+ claimedBy: text19("claimed_by"),
638
+ claimedAt: timestamp19("claimed_at", { withTimezone: true }),
639
+ leaseExpiresAt: timestamp19("lease_expires_at", { withTimezone: true }),
640
+ createdAt: timestamp19("created_at", { withTimezone: true }).defaultNow(),
641
+ updatedAt: timestamp19("updated_at", { withTimezone: true }).defaultNow(),
642
+ completedAt: timestamp19("completed_at", { withTimezone: true })
655
643
  }, (table) => [
656
- index17("idx_eval_jobs_user").on(table.userId),
657
- index17("idx_eval_jobs_target").on(table.evalTargetId),
658
- index17("idx_eval_jobs_status").on(table.status),
659
- index17("idx_eval_jobs_pending").on(table.userId, table.status)
644
+ index16("idx_eval_jobs_user").on(table.userId),
645
+ index16("idx_eval_jobs_target").on(table.evalTargetId),
646
+ index16("idx_eval_jobs_status").on(table.status),
647
+ index16("idx_eval_jobs_pending").on(table.userId, table.status)
660
648
  ]);
661
649
 
662
650
  // ../../packages/db/dist/schema/tables/agent-jobs.js
663
- import { pgTable as pgTable21, text as text21, timestamp as timestamp21, jsonb as jsonb18, uuid as uuid20, integer as integer12, index as index18 } from "drizzle-orm/pg-core";
664
- var agentJobs = pgTable21("agent_jobs", {
665
- id: uuid20("id").primaryKey().defaultRandom(),
666
- userId: uuid20("user_id").notNull(),
667
- taskKind: text21("task_kind").notNull(),
668
- status: text21("status").notNull().default("pending"),
651
+ import { pgTable as pgTable20, text as text20, timestamp as timestamp20, jsonb as jsonb18, uuid as uuid19, integer as integer12, index as index17 } from "drizzle-orm/pg-core";
652
+ var agentJobs = pgTable20("agent_jobs", {
653
+ id: uuid19("id").primaryKey().defaultRandom(),
654
+ userId: uuid19("user_id").notNull(),
655
+ taskKind: text20("task_kind").notNull(),
656
+ status: text20("status").notNull().default("pending"),
669
657
  payload: jsonb18("payload").notNull(),
670
- dedupeKey: text21("dedupe_key"),
658
+ dedupeKey: text20("dedupe_key"),
671
659
  result: jsonb18("result"),
672
- error: text21("error"),
660
+ error: text20("error"),
673
661
  attempts: integer12("attempts").notNull().default(0),
674
- claimedBy: text21("claimed_by"),
675
- claimedAt: timestamp21("claimed_at", { withTimezone: true }),
676
- leaseExpiresAt: timestamp21("lease_expires_at", { withTimezone: true }),
677
- createdAt: timestamp21("created_at", { withTimezone: true }).notNull().defaultNow(),
678
- updatedAt: timestamp21("updated_at", { withTimezone: true }).notNull().defaultNow(),
679
- completedAt: timestamp21("completed_at", { withTimezone: true })
662
+ claimedBy: text20("claimed_by"),
663
+ claimedAt: timestamp20("claimed_at", { withTimezone: true }),
664
+ leaseExpiresAt: timestamp20("lease_expires_at", { withTimezone: true }),
665
+ createdAt: timestamp20("created_at", { withTimezone: true }).notNull().defaultNow(),
666
+ updatedAt: timestamp20("updated_at", { withTimezone: true }).notNull().defaultNow(),
667
+ completedAt: timestamp20("completed_at", { withTimezone: true })
680
668
  }, (table) => [
681
- index18("idx_agent_jobs_claim").on(table.userId, table.status, table.taskKind, table.createdAt),
682
- index18("idx_agent_jobs_dedupe").on(table.userId, table.taskKind, table.dedupeKey)
669
+ index17("idx_agent_jobs_claim").on(table.userId, table.status, table.taskKind, table.createdAt),
670
+ index17("idx_agent_jobs_dedupe").on(table.userId, table.taskKind, table.dedupeKey)
683
671
  ]);
684
672
 
685
673
  // ../../packages/db/dist/schema/tables/insights.js
686
- import { pgTable as pgTable22, text as text22, timestamp as timestamp22, jsonb as jsonb19, uuid as uuid21, index as index19, uniqueIndex as uniqueIndex8, integer as integer13, bigint as bigint3 } from "drizzle-orm/pg-core";
687
- var insightsJobs = pgTable22("insights_jobs", {
688
- id: uuid21("id").primaryKey().defaultRandom(),
689
- userId: uuid21("user_id").notNull(),
690
- status: text22("status").notNull().default("pending"),
691
- projectPath: text22("project_path"),
674
+ import { pgTable as pgTable21, text as text21, timestamp as timestamp21, jsonb as jsonb19, uuid as uuid20, index as index18, uniqueIndex as uniqueIndex8, integer as integer13, bigint as bigint3 } from "drizzle-orm/pg-core";
675
+ var insightsJobs = pgTable21("insights_jobs", {
676
+ id: uuid20("id").primaryKey().defaultRandom(),
677
+ userId: uuid20("user_id").notNull(),
678
+ status: text21("status").notNull().default("pending"),
679
+ projectPath: text21("project_path"),
692
680
  // Canonical project identity (project_path-keying fragments one project across
693
681
  // worktrees/subdirs/cwds — migration 00104). Nullable: legacy/unlinked rows fall
694
682
  // back to project_path. Stamped at enqueue when resolvable.
695
- projectId: uuid21("project_id").references(() => projects.id, { onDelete: "set null" }),
683
+ projectId: uuid20("project_id").references(() => projects.id, { onDelete: "set null" }),
696
684
  config: jsonb19("config").notNull().default({}),
697
685
  progress: jsonb19("progress").notNull().default({}),
698
686
  result: jsonb19("result"),
699
- error: text22("error"),
687
+ error: text21("error"),
700
688
  attempts: integer13("attempts").notNull().default(0),
701
689
  graphileJobId: bigint3("graphile_job_id", { mode: "number" }),
702
- taskKind: text22("task_kind"),
690
+ taskKind: text21("task_kind"),
703
691
  payload: jsonb19("payload"),
704
- claimedBy: text22("claimed_by"),
705
- claimedAt: timestamp22("claimed_at", { withTimezone: true }),
706
- leaseExpiresAt: timestamp22("lease_expires_at", { withTimezone: true }),
707
- createdAt: timestamp22("created_at", { withTimezone: true }).defaultNow(),
708
- updatedAt: timestamp22("updated_at", { withTimezone: true }).defaultNow(),
709
- completedAt: timestamp22("completed_at", { withTimezone: true })
692
+ claimedBy: text21("claimed_by"),
693
+ claimedAt: timestamp21("claimed_at", { withTimezone: true }),
694
+ leaseExpiresAt: timestamp21("lease_expires_at", { withTimezone: true }),
695
+ createdAt: timestamp21("created_at", { withTimezone: true }).defaultNow(),
696
+ updatedAt: timestamp21("updated_at", { withTimezone: true }).defaultNow(),
697
+ completedAt: timestamp21("completed_at", { withTimezone: true })
710
698
  }, (table) => [
711
- index19("idx_insights_jobs_user").on(table.userId),
712
- index19("idx_insights_jobs_status").on(table.status),
713
- index19("idx_insights_jobs_pending").on(table.userId, table.status),
714
- index19("idx_insights_jobs_project").on(table.projectId)
699
+ index18("idx_insights_jobs_user").on(table.userId),
700
+ index18("idx_insights_jobs_status").on(table.status),
701
+ index18("idx_insights_jobs_pending").on(table.userId, table.status),
702
+ index18("idx_insights_jobs_project").on(table.projectId)
715
703
  ]);
716
- var insightsReports = pgTable22("insights_reports", {
717
- id: uuid21("id").primaryKey().defaultRandom(),
718
- userId: uuid21("user_id").notNull(),
719
- projectPath: text22("project_path"),
704
+ var insightsReports = pgTable21("insights_reports", {
705
+ id: uuid20("id").primaryKey().defaultRandom(),
706
+ userId: uuid20("user_id").notNull(),
707
+ projectPath: text21("project_path"),
720
708
  data: jsonb19("data").notNull(),
721
- reportHtml: text22("report_html"),
722
- createdAt: timestamp22("created_at", { withTimezone: true }).defaultNow()
709
+ reportHtml: text21("report_html"),
710
+ createdAt: timestamp21("created_at", { withTimezone: true }).defaultNow()
723
711
  }, (table) => [
724
- index19("idx_insights_user").on(table.userId),
725
- index19("idx_insights_created").on(table.createdAt),
712
+ index18("idx_insights_user").on(table.userId),
713
+ index18("idx_insights_created").on(table.createdAt),
726
714
  uniqueIndex8("idx_insights_user_project").on(table.userId, table.projectPath)
727
715
  ]);
728
716
 
729
717
  // ../../packages/db/dist/schema/tables/api-keys.js
730
- import { pgTable as pgTable23, text as text23, timestamp as timestamp23, uuid as uuid22, index as index20, uniqueIndex as uniqueIndex9 } from "drizzle-orm/pg-core";
731
- var apiKeys = pgTable23("api_keys", {
732
- id: uuid22("id").primaryKey().defaultRandom(),
733
- userId: uuid22("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
734
- name: text23("name").notNull(),
735
- keyHash: text23("key_hash").notNull(),
736
- keyPrefix: text23("key_prefix").notNull(),
737
- lastUsedAt: timestamp23("last_used_at", { withTimezone: true }),
738
- expiresAt: timestamp23("expires_at", { withTimezone: true }),
739
- revokedAt: timestamp23("revoked_at", { withTimezone: true }),
740
- createdAt: timestamp23("created_at", { withTimezone: true }).defaultNow()
718
+ import { pgTable as pgTable22, text as text22, timestamp as timestamp22, uuid as uuid21, index as index19, uniqueIndex as uniqueIndex9 } from "drizzle-orm/pg-core";
719
+ var apiKeys = pgTable22("api_keys", {
720
+ id: uuid21("id").primaryKey().defaultRandom(),
721
+ userId: uuid21("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
722
+ name: text22("name").notNull(),
723
+ keyHash: text22("key_hash").notNull(),
724
+ keyPrefix: text22("key_prefix").notNull(),
725
+ lastUsedAt: timestamp22("last_used_at", { withTimezone: true }),
726
+ expiresAt: timestamp22("expires_at", { withTimezone: true }),
727
+ revokedAt: timestamp22("revoked_at", { withTimezone: true }),
728
+ createdAt: timestamp22("created_at", { withTimezone: true }).defaultNow()
741
729
  }, (table) => [
742
- index20("idx_api_keys_user").on(table.userId),
730
+ index19("idx_api_keys_user").on(table.userId),
743
731
  uniqueIndex9("idx_api_keys_hash").on(table.keyHash)
744
732
  ]);
745
733
 
746
734
  // ../../packages/db/dist/schema/tables/extension-auth-codes.js
747
- import { pgTable as pgTable24, text as text24, timestamp as timestamp24, uuid as uuid23, index as index21 } from "drizzle-orm/pg-core";
748
- var extensionAuthCodes = pgTable24("extension_auth_codes", {
749
- code: text24("code").primaryKey(),
750
- userId: uuid23("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
751
- editor: text24("editor"),
752
- email: text24("email"),
753
- expiresAt: timestamp24("expires_at", { withTimezone: true }).notNull(),
754
- createdAt: timestamp24("created_at", { withTimezone: true }).defaultNow()
735
+ import { pgTable as pgTable23, text as text23, timestamp as timestamp23, uuid as uuid22, index as index20 } from "drizzle-orm/pg-core";
736
+ var extensionAuthCodes = pgTable23("extension_auth_codes", {
737
+ code: text23("code").primaryKey(),
738
+ userId: uuid22("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
739
+ editor: text23("editor"),
740
+ email: text23("email"),
741
+ expiresAt: timestamp23("expires_at", { withTimezone: true }).notNull(),
742
+ createdAt: timestamp23("created_at", { withTimezone: true }).defaultNow()
755
743
  }, (table) => [
756
- index21("idx_ext_auth_codes_expiry").on(table.expiresAt)
744
+ index20("idx_ext_auth_codes_expiry").on(table.expiresAt)
757
745
  ]);
758
746
 
759
747
  // ../../packages/db/dist/schema/tables/eval-conversations.js
760
- import { pgTable as pgTable25, text as text25, timestamp as timestamp25, jsonb as jsonb20, uuid as uuid24, index as index22 } from "drizzle-orm/pg-core";
761
- var evalConversations = pgTable25("eval_conversations", {
762
- id: uuid24("id").primaryKey().defaultRandom(),
763
- evalTargetId: uuid24("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
764
- userId: uuid24("user_id").notNull(),
748
+ import { pgTable as pgTable24, text as text24, timestamp as timestamp24, jsonb as jsonb20, uuid as uuid23, index as index21 } from "drizzle-orm/pg-core";
749
+ var evalConversations = pgTable24("eval_conversations", {
750
+ id: uuid23("id").primaryKey().defaultRandom(),
751
+ evalTargetId: uuid23("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
752
+ userId: uuid23("user_id").notNull(),
765
753
  messages: jsonb20("messages").notNull().default([]),
766
- status: text25("status").notNull().default("active"),
767
- createdAt: timestamp25("created_at", { withTimezone: true }).defaultNow(),
768
- updatedAt: timestamp25("updated_at", { withTimezone: true }).defaultNow()
754
+ status: text24("status").notNull().default("active"),
755
+ createdAt: timestamp24("created_at", { withTimezone: true }).defaultNow(),
756
+ updatedAt: timestamp24("updated_at", { withTimezone: true }).defaultNow()
769
757
  }, (table) => [
770
- index22("idx_eval_conversations_target").on(table.evalTargetId),
771
- index22("idx_eval_conversations_user").on(table.userId)
758
+ index21("idx_eval_conversations_target").on(table.evalTargetId),
759
+ index21("idx_eval_conversations_user").on(table.userId)
772
760
  ]);
773
761
 
774
762
  // ../../packages/db/dist/schema/tables/security-events.js
775
- import { pgTable as pgTable26, uuid as uuid25, text as text26, jsonb as jsonb21, timestamp as timestamp26, index as index23 } from "drizzle-orm/pg-core";
776
- var securityEvents = pgTable26("security_events", {
777
- id: uuid25("id").primaryKey().defaultRandom(),
778
- eventType: text26("event_type").notNull(),
779
- severity: text26("severity").notNull(),
780
- category: text26("category").notNull(),
781
- source: text26("source").notNull(),
782
- entityType: text26("entity_type"),
783
- entityId: uuid25("entity_id"),
784
- userId: uuid25("user_id"),
763
+ import { pgTable as pgTable25, uuid as uuid24, text as text25, jsonb as jsonb21, timestamp as timestamp25, index as index22 } from "drizzle-orm/pg-core";
764
+ var securityEvents = pgTable25("security_events", {
765
+ id: uuid24("id").primaryKey().defaultRandom(),
766
+ eventType: text25("event_type").notNull(),
767
+ severity: text25("severity").notNull(),
768
+ category: text25("category").notNull(),
769
+ source: text25("source").notNull(),
770
+ entityType: text25("entity_type"),
771
+ entityId: uuid24("entity_id"),
772
+ userId: uuid24("user_id"),
785
773
  details: jsonb21("details").notNull().default({}),
786
- createdAt: timestamp26("created_at", { withTimezone: true }).notNull().defaultNow()
774
+ createdAt: timestamp25("created_at", { withTimezone: true }).notNull().defaultNow()
787
775
  }, (table) => [
788
- index23("idx_security_events_type").on(table.eventType),
789
- index23("idx_security_events_user").on(table.userId),
790
- index23("idx_security_events_created").on(table.createdAt),
791
- index23("idx_security_events_severity").on(table.severity),
792
- index23("idx_security_events_source").on(table.source)
776
+ index22("idx_security_events_type").on(table.eventType),
777
+ index22("idx_security_events_user").on(table.userId),
778
+ index22("idx_security_events_created").on(table.createdAt),
779
+ index22("idx_security_events_severity").on(table.severity),
780
+ index22("idx_security_events_source").on(table.source)
793
781
  ]);
794
782
 
795
783
  // ../../packages/db/dist/schema/tables/tasks.js
796
- import { pgTable as pgTable27, text as text27, timestamp as timestamp27, uuid as uuid26, index as index24 } from "drizzle-orm/pg-core";
797
- var tasks = pgTable27("tasks", {
798
- id: uuid26("id").primaryKey().defaultRandom(),
799
- title: text27("title").notNull(),
800
- description: text27("description"),
801
- status: text27("status").notNull().default("pending"),
802
- createdBy: uuid26("created_by"),
803
- createdAt: timestamp27("created_at", { withTimezone: true }).defaultNow(),
804
- updatedAt: timestamp27("updated_at", { withTimezone: true }).defaultNow()
784
+ import { pgTable as pgTable26, text as text26, timestamp as timestamp26, uuid as uuid25, index as index23 } from "drizzle-orm/pg-core";
785
+ var tasks = pgTable26("tasks", {
786
+ id: uuid25("id").primaryKey().defaultRandom(),
787
+ title: text26("title").notNull(),
788
+ description: text26("description"),
789
+ status: text26("status").notNull().default("pending"),
790
+ createdBy: uuid25("created_by"),
791
+ createdAt: timestamp26("created_at", { withTimezone: true }).defaultNow(),
792
+ updatedAt: timestamp26("updated_at", { withTimezone: true }).defaultNow()
805
793
  }, (table) => [
806
- index24("tasks_created_by_idx").on(table.createdBy),
807
- index24("tasks_status_idx").on(table.status)
794
+ index23("tasks_created_by_idx").on(table.createdBy),
795
+ index23("tasks_status_idx").on(table.status)
808
796
  ]);
809
797
 
810
798
  // ../../packages/db/dist/schema/tables/skill-submissions.js
811
- import { pgTable as pgTable28, text as text28, timestamp as timestamp28, jsonb as jsonb22, uuid as uuid27 } from "drizzle-orm/pg-core";
812
- var skillSubmissions = pgTable28("skill_submissions", {
813
- id: uuid27("id").primaryKey().defaultRandom(),
814
- skillId: text28("skill_id").notNull(),
815
- name: text28("name").notNull(),
816
- description: text28("description").notNull(),
817
- category: text28("category").notNull(),
818
- tools: text28("tools").array().notNull(),
819
- tags: text28("tags").array().default([]),
820
- content: text28("content").notNull(),
821
- status: text28("status").notNull().default("pending"),
799
+ import { pgTable as pgTable27, text as text27, timestamp as timestamp27, jsonb as jsonb22, uuid as uuid26 } from "drizzle-orm/pg-core";
800
+ var skillSubmissions = pgTable27("skill_submissions", {
801
+ id: uuid26("id").primaryKey().defaultRandom(),
802
+ skillId: text27("skill_id").notNull(),
803
+ name: text27("name").notNull(),
804
+ description: text27("description").notNull(),
805
+ category: text27("category").notNull(),
806
+ tools: text27("tools").array().notNull(),
807
+ tags: text27("tags").array().default([]),
808
+ content: text27("content").notNull(),
809
+ status: text27("status").notNull().default("pending"),
822
810
  // pending | approved | rejected
823
- submittedBy: uuid27("submitted_by").notNull(),
824
- reviewedBy: uuid27("reviewed_by"),
825
- reviewNote: text28("review_note"),
811
+ submittedBy: uuid26("submitted_by").notNull(),
812
+ reviewedBy: uuid26("reviewed_by"),
813
+ reviewNote: text27("review_note"),
826
814
  metadata: jsonb22("metadata"),
827
- createdAt: timestamp28("created_at", { withTimezone: true }).defaultNow(),
828
- updatedAt: timestamp28("updated_at", { withTimezone: true }).defaultNow()
815
+ createdAt: timestamp27("created_at", { withTimezone: true }).defaultNow(),
816
+ updatedAt: timestamp27("updated_at", { withTimezone: true }).defaultNow()
829
817
  });
830
818
 
831
819
  // ../../packages/db/dist/schema/tables/harness-releases.js
832
- import { pgTable as pgTable29, text as text29, timestamp as timestamp29, jsonb as jsonb23, uuid as uuid28, uniqueIndex as uniqueIndex10, index as index25 } from "drizzle-orm/pg-core";
833
- var harnessReleases = pgTable29("harness_releases", {
834
- id: uuid28("id").primaryKey().defaultRandom(),
835
- harness: text29("harness").notNull(),
820
+ import { pgTable as pgTable28, text as text28, timestamp as timestamp28, jsonb as jsonb23, uuid as uuid27, uniqueIndex as uniqueIndex10, index as index24 } from "drizzle-orm/pg-core";
821
+ var harnessReleases = pgTable28("harness_releases", {
822
+ id: uuid27("id").primaryKey().defaultRandom(),
823
+ harness: text28("harness").notNull(),
836
824
  // "claude_code", "cursor", "copilot"
837
- version: text29("version").notNull(),
825
+ version: text28("version").notNull(),
838
826
  // "v2.1.119"
839
- publishedAt: timestamp29("published_at", { withTimezone: true }).notNull(),
840
- title: text29("title"),
827
+ publishedAt: timestamp28("published_at", { withTimezone: true }).notNull(),
828
+ title: text28("title"),
841
829
  // release name
842
- body: text29("body"),
830
+ body: text28("body"),
843
831
  // raw markdown
844
832
  categories: jsonb23("categories").default({}),
845
833
  // { features: string[], fixes: string[], security: string[] }
846
- url: text29("url"),
834
+ url: text28("url"),
847
835
  // link to release page
848
- createdAt: timestamp29("created_at", { withTimezone: true }).defaultNow()
836
+ createdAt: timestamp28("created_at", { withTimezone: true }).defaultNow()
849
837
  }, (table) => [
850
838
  uniqueIndex10("idx_harness_releases_unique").on(table.harness, table.version),
851
- index25("idx_harness_releases_harness").on(table.harness),
852
- index25("idx_harness_releases_published").on(table.publishedAt)
839
+ index24("idx_harness_releases_harness").on(table.harness),
840
+ index24("idx_harness_releases_published").on(table.publishedAt)
853
841
  ]);
854
842
 
855
843
  // ../../packages/db/dist/schema/tables/notifications.js
856
- import { pgTable as pgTable30, text as text30, timestamp as timestamp30, jsonb as jsonb24, uuid as uuid29, index as index26, uniqueIndex as uniqueIndex11 } from "drizzle-orm/pg-core";
857
- var notifications = pgTable30("notifications", {
858
- id: uuid29("id").primaryKey().defaultRandom(),
859
- userId: uuid29("user_id").notNull(),
860
- type: text30("type").notNull(),
861
- title: text30("title").notNull(),
862
- body: text30("body"),
863
- url: text30("url"),
864
- sourceTable: text30("source_table"),
865
- sourceId: text30("source_id"),
844
+ import { pgTable as pgTable29, text as text29, timestamp as timestamp29, jsonb as jsonb24, uuid as uuid28, index as index25, uniqueIndex as uniqueIndex11 } from "drizzle-orm/pg-core";
845
+ var notifications = pgTable29("notifications", {
846
+ id: uuid28("id").primaryKey().defaultRandom(),
847
+ userId: uuid28("user_id").notNull(),
848
+ type: text29("type").notNull(),
849
+ title: text29("title").notNull(),
850
+ body: text29("body"),
851
+ url: text29("url"),
852
+ sourceTable: text29("source_table"),
853
+ sourceId: text29("source_id"),
866
854
  metadata: jsonb24("metadata").notNull().default({}),
867
- readAt: timestamp30("read_at", { withTimezone: true }),
868
- createdAt: timestamp30("created_at", { withTimezone: true }).notNull().defaultNow()
855
+ readAt: timestamp29("read_at", { withTimezone: true }),
856
+ createdAt: timestamp29("created_at", { withTimezone: true }).notNull().defaultNow()
869
857
  }, (table) => [
870
- index26("idx_notifications_user_created").on(table.userId, table.createdAt),
871
- index26("idx_notifications_user_unread").on(table.userId),
858
+ index25("idx_notifications_user_created").on(table.userId, table.createdAt),
859
+ index25("idx_notifications_user_unread").on(table.userId),
872
860
  uniqueIndex11("idx_notifications_source_dedup").on(table.userId, table.sourceTable, table.sourceId)
873
861
  ]);
874
862
 
875
863
  // ../../packages/db/dist/schema/tables/launch-jobs.js
876
- import { pgTable as pgTable31, text as text31, timestamp as timestamp31, jsonb as jsonb25, uuid as uuid30, index as index27, integer as integer14, bigint as bigint4 } from "drizzle-orm/pg-core";
877
- var launchJobs = pgTable31("launch_jobs", {
878
- id: uuid30("id").primaryKey().defaultRandom(),
879
- userId: uuid30("user_id").notNull(),
880
- tool: text31("tool").notNull(),
881
- status: text31("status").notNull().default("pending"),
864
+ import { pgTable as pgTable30, text as text30, timestamp as timestamp30, jsonb as jsonb25, uuid as uuid29, index as index26, integer as integer14, bigint as bigint4 } from "drizzle-orm/pg-core";
865
+ var launchJobs = pgTable30("launch_jobs", {
866
+ id: uuid29("id").primaryKey().defaultRandom(),
867
+ userId: uuid29("user_id").notNull(),
868
+ tool: text30("tool").notNull(),
869
+ status: text30("status").notNull().default("pending"),
882
870
  config: jsonb25("config").notNull().default({}),
883
871
  result: jsonb25("result"),
884
- error: text31("error"),
872
+ error: text30("error"),
885
873
  attempts: integer14("attempts").notNull().default(0),
886
874
  graphileJobId: bigint4("graphile_job_id", { mode: "number" }),
887
- taskKind: text31("task_kind"),
875
+ taskKind: text30("task_kind"),
888
876
  payload: jsonb25("payload"),
889
- claimedBy: text31("claimed_by"),
890
- claimedAt: timestamp31("claimed_at", { withTimezone: true }),
891
- leaseExpiresAt: timestamp31("lease_expires_at", { withTimezone: true }),
892
- createdAt: timestamp31("created_at", { withTimezone: true }).defaultNow(),
893
- updatedAt: timestamp31("updated_at", { withTimezone: true }).defaultNow(),
894
- completedAt: timestamp31("completed_at", { withTimezone: true }),
895
- runId: uuid30("run_id").references(() => agentRuns.id, { onDelete: "set null" })
877
+ claimedBy: text30("claimed_by"),
878
+ claimedAt: timestamp30("claimed_at", { withTimezone: true }),
879
+ leaseExpiresAt: timestamp30("lease_expires_at", { withTimezone: true }),
880
+ createdAt: timestamp30("created_at", { withTimezone: true }).defaultNow(),
881
+ updatedAt: timestamp30("updated_at", { withTimezone: true }).defaultNow(),
882
+ completedAt: timestamp30("completed_at", { withTimezone: true }),
883
+ runId: uuid29("run_id").references(() => agentRuns.id, { onDelete: "set null" })
896
884
  }, (table) => [
897
- index27("idx_launch_jobs_user").on(table.userId),
898
- index27("idx_launch_jobs_status").on(table.status),
899
- index27("idx_launch_jobs_pending").on(table.userId, table.status),
900
- index27("idx_launch_jobs_run").on(table.runId)
885
+ index26("idx_launch_jobs_user").on(table.userId),
886
+ index26("idx_launch_jobs_status").on(table.status),
887
+ index26("idx_launch_jobs_pending").on(table.userId, table.status),
888
+ index26("idx_launch_jobs_run").on(table.runId)
901
889
  ]);
902
890
 
903
891
  // ../../packages/db/dist/schema/tables/instruction-suggestions.js
904
- import { pgTable as pgTable32, uuid as uuid31, text as text32, real as real3, timestamp as timestamp32, boolean as boolean8, uniqueIndex as uniqueIndex12, index as index28 } from "drizzle-orm/pg-core";
905
- var instructionSuggestions = pgTable32("instruction_suggestions", {
906
- id: uuid31("id").primaryKey().defaultRandom(),
907
- userId: uuid31("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
908
- instructionId: uuid31("instruction_id").notNull().references(() => instructions.id, { onDelete: "cascade" }),
909
- projectPath: text32("project_path").notNull(),
892
+ import { pgTable as pgTable31, uuid as uuid30, text as text31, real as real3, timestamp as timestamp31, boolean as boolean8, uniqueIndex as uniqueIndex12, index as index27 } from "drizzle-orm/pg-core";
893
+ var instructionSuggestions = pgTable31("instruction_suggestions", {
894
+ id: uuid30("id").primaryKey().defaultRandom(),
895
+ userId: uuid30("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
896
+ instructionId: uuid30("instruction_id").notNull().references(() => instructions.id, { onDelete: "cascade" }),
897
+ projectPath: text31("project_path").notNull(),
910
898
  // Canonical project identity (migration 00104). Additive + nullable; the
911
899
  // unique index below stays on project_path (NOT NULL) so upserts are
912
900
  // unchanged. Readers prefer project_id to aggregate across path variants.
913
- projectId: uuid31("project_id").references(() => projects.id, { onDelete: "set null" }),
901
+ projectId: uuid30("project_id").references(() => projects.id, { onDelete: "set null" }),
914
902
  score: real3("score").notNull(),
915
- reason: text32("reason").notNull(),
916
- generatedAt: timestamp32("generated_at", { withTimezone: true }).notNull().defaultNow(),
903
+ reason: text31("reason").notNull(),
904
+ generatedAt: timestamp31("generated_at", { withTimezone: true }).notNull().defaultNow(),
917
905
  isStale: boolean8("is_stale").notNull().default(false),
918
- dismissedAt: timestamp32("dismissed_at", { withTimezone: true }),
919
- acceptedAt: timestamp32("accepted_at", { withTimezone: true }),
920
- promotedToInstructionId: uuid31("promoted_to_instruction_id").references(() => instructions.id, { onDelete: "set null" })
906
+ dismissedAt: timestamp31("dismissed_at", { withTimezone: true }),
907
+ acceptedAt: timestamp31("accepted_at", { withTimezone: true }),
908
+ promotedToInstructionId: uuid30("promoted_to_instruction_id").references(() => instructions.id, { onDelete: "set null" })
921
909
  }, (table) => [
922
910
  uniqueIndex12("idx_instruction_suggestions_user_project_instruction").on(table.userId, table.projectPath, table.instructionId),
923
- index28("idx_instruction_suggestions_user_project").on(table.userId, table.projectPath),
924
- index28("idx_instruction_suggestions_user_proj_id").on(table.userId, table.projectId),
925
- index28("idx_instruction_suggestions_generated_at").on(table.generatedAt)
911
+ index27("idx_instruction_suggestions_user_project").on(table.userId, table.projectPath),
912
+ index27("idx_instruction_suggestions_user_proj_id").on(table.userId, table.projectId),
913
+ index27("idx_instruction_suggestions_generated_at").on(table.generatedAt)
926
914
  ]);
927
- var instructionSuggestionEvents = pgTable32("instruction_suggestion_events", {
928
- id: uuid31("id").primaryKey().defaultRandom(),
929
- suggestionId: uuid31("suggestion_id").notNull().references(() => instructionSuggestions.id, { onDelete: "cascade" }),
930
- userId: uuid31("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
931
- eventType: text32("event_type").notNull(),
932
- tool: text32("tool"),
933
- sessionId: uuid31("session_id"),
934
- projectPath: text32("project_path").notNull(),
935
- createdAt: timestamp32("created_at", { withTimezone: true }).notNull().defaultNow()
915
+ var instructionSuggestionEvents = pgTable31("instruction_suggestion_events", {
916
+ id: uuid30("id").primaryKey().defaultRandom(),
917
+ suggestionId: uuid30("suggestion_id").notNull().references(() => instructionSuggestions.id, { onDelete: "cascade" }),
918
+ userId: uuid30("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
919
+ eventType: text31("event_type").notNull(),
920
+ tool: text31("tool"),
921
+ sessionId: uuid30("session_id"),
922
+ projectPath: text31("project_path").notNull(),
923
+ createdAt: timestamp31("created_at", { withTimezone: true }).notNull().defaultNow()
936
924
  }, (table) => [
937
- index28("idx_instruction_suggestion_events_suggestion_id").on(table.suggestionId),
938
- index28("idx_instruction_suggestion_events_user_id").on(table.userId)
925
+ index27("idx_instruction_suggestion_events_suggestion_id").on(table.suggestionId),
926
+ index27("idx_instruction_suggestion_events_user_id").on(table.userId)
939
927
  ]);
940
928
 
941
929
  // ../../packages/db/dist/schema/tables/model-pricing.js
942
- import { pgTable as pgTable33, text as text33, integer as integer15, numeric, timestamp as timestamp33, index as index29, primaryKey as primaryKey5 } from "drizzle-orm/pg-core";
943
- var modelPricing = pgTable33("model_pricing", {
944
- provider: text33("provider").notNull(),
945
- modelId: text33("model_id").notNull(),
930
+ import { pgTable as pgTable32, text as text32, integer as integer15, numeric, timestamp as timestamp32, index as index28, primaryKey as primaryKey4 } from "drizzle-orm/pg-core";
931
+ var modelPricing = pgTable32("model_pricing", {
932
+ provider: text32("provider").notNull(),
933
+ modelId: text32("model_id").notNull(),
946
934
  inputPerM: numeric("input_per_m").notNull(),
947
935
  outputPerM: numeric("output_per_m").notNull(),
948
936
  cacheReadPerM: numeric("cache_read_per_m").notNull(),
949
937
  cacheWrite5mPerM: numeric("cache_write_5m_per_m").notNull(),
950
938
  cacheWrite1hPerM: numeric("cache_write_1h_per_m").notNull(),
951
939
  contextWindow: integer15("context_window"),
952
- effectiveFrom: timestamp33("effective_from", { withTimezone: true }).notNull(),
953
- effectiveUntil: timestamp33("effective_until", { withTimezone: true }),
954
- source: text33("source").notNull()
940
+ effectiveFrom: timestamp32("effective_from", { withTimezone: true }).notNull(),
941
+ effectiveUntil: timestamp32("effective_until", { withTimezone: true }),
942
+ source: text32("source").notNull()
955
943
  }, (table) => [
956
- primaryKey5({ columns: [table.provider, table.modelId, table.effectiveFrom] }),
957
- index29("idx_model_pricing_active").on(table.provider, table.modelId, table.effectiveFrom.desc())
944
+ primaryKey4({ columns: [table.provider, table.modelId, table.effectiveFrom] }),
945
+ index28("idx_model_pricing_active").on(table.provider, table.modelId, table.effectiveFrom.desc())
958
946
  ]);
959
947
 
960
948
  // ../../packages/db/dist/schema/tables/limit-observations.js
961
- import { pgTable as pgTable34, text as text34, numeric as numeric2, timestamp as timestamp34, uuid as uuid32, jsonb as jsonb26, index as index30 } from "drizzle-orm/pg-core";
962
- var limitObservations = pgTable34("limit_observations", {
963
- id: uuid32("id").primaryKey().defaultRandom(),
964
- observedAt: timestamp34("observed_at", { withTimezone: true }).notNull().defaultNow(),
965
- provider: text34("provider").notNull(),
966
- plan: text34("plan").notNull(),
967
- limitType: text34("limit_type").notNull(),
949
+ import { pgTable as pgTable33, text as text33, numeric as numeric2, timestamp as timestamp33, uuid as uuid31, jsonb as jsonb26, index as index29 } from "drizzle-orm/pg-core";
950
+ var limitObservations = pgTable33("limit_observations", {
951
+ id: uuid31("id").primaryKey().defaultRandom(),
952
+ observedAt: timestamp33("observed_at", { withTimezone: true }).notNull().defaultNow(),
953
+ provider: text33("provider").notNull(),
954
+ plan: text33("plan").notNull(),
955
+ limitType: text33("limit_type").notNull(),
968
956
  value: numeric2("value").notNull(),
969
- unit: text34("unit").notNull(),
970
- comparator: text34("comparator").notNull().default("="),
971
- resetsAt: timestamp34("resets_at", { withTimezone: true }),
972
- sourceType: text34("source_type").notNull(),
973
- sourceUrl: text34("source_url"),
957
+ unit: text33("unit").notNull(),
958
+ comparator: text33("comparator").notNull().default("="),
959
+ resetsAt: timestamp33("resets_at", { withTimezone: true }),
960
+ sourceType: text33("source_type").notNull(),
961
+ sourceUrl: text33("source_url"),
974
962
  sourceEvidence: jsonb26("source_evidence"),
975
963
  confidence: numeric2("confidence").notNull(),
976
- userId: uuid32("user_id")
964
+ userId: uuid31("user_id")
977
965
  }, (table) => [
978
- index30("idx_limit_obs_lookup").on(table.provider, table.plan, table.limitType, table.observedAt.desc()),
979
- index30("idx_limit_obs_user").on(table.userId, table.observedAt.desc())
966
+ index29("idx_limit_obs_lookup").on(table.provider, table.plan, table.limitType, table.observedAt.desc()),
967
+ index29("idx_limit_obs_user").on(table.userId, table.observedAt.desc())
980
968
  ]);
981
969
 
982
970
  // ../../packages/db/dist/schema/tables/provider-docs-snapshots.js
983
- import { pgTable as pgTable35, text as text35, timestamp as timestamp35, uuid as uuid33, jsonb as jsonb27, boolean as boolean9, uniqueIndex as uniqueIndex13 } from "drizzle-orm/pg-core";
984
- var providerDocsSnapshots = pgTable35("provider_docs_snapshots", {
985
- id: uuid33("id").primaryKey().defaultRandom(),
986
- fetchedAt: timestamp35("fetched_at", { withTimezone: true }).notNull().defaultNow(),
987
- provider: text35("provider").notNull(),
988
- docUrl: text35("doc_url").notNull(),
989
- contentHash: text35("content_hash").notNull(),
990
- content: text35("content").notNull(),
971
+ import { pgTable as pgTable34, text as text34, timestamp as timestamp34, uuid as uuid32, jsonb as jsonb27, boolean as boolean9, uniqueIndex as uniqueIndex13 } from "drizzle-orm/pg-core";
972
+ var providerDocsSnapshots = pgTable34("provider_docs_snapshots", {
973
+ id: uuid32("id").primaryKey().defaultRandom(),
974
+ fetchedAt: timestamp34("fetched_at", { withTimezone: true }).notNull().defaultNow(),
975
+ provider: text34("provider").notNull(),
976
+ docUrl: text34("doc_url").notNull(),
977
+ contentHash: text34("content_hash").notNull(),
978
+ content: text34("content").notNull(),
991
979
  parseSuccess: boolean9("parse_success").notNull(),
992
980
  parseErrors: jsonb27("parse_errors")
993
981
  }, (table) => [
@@ -995,49 +983,46 @@ var providerDocsSnapshots = pgTable35("provider_docs_snapshots", {
995
983
  ]);
996
984
 
997
985
  // ../../packages/db/dist/schema/tables/plan-limits-active.js
998
- import { pgTable as pgTable36, text as text36, numeric as numeric3, timestamp as timestamp36, uuid as uuid34, primaryKey as primaryKey6, index as index31 } from "drizzle-orm/pg-core";
999
- var planLimitsActive = pgTable36("plan_limits_active", {
1000
- provider: text36("provider").notNull(),
1001
- plan: text36("plan").notNull(),
1002
- limitType: text36("limit_type").notNull(),
986
+ import { pgTable as pgTable35, text as text35, numeric as numeric3, timestamp as timestamp35, uuid as uuid33, primaryKey as primaryKey5, index as index30 } from "drizzle-orm/pg-core";
987
+ var planLimitsActive = pgTable35("plan_limits_active", {
988
+ provider: text35("provider").notNull(),
989
+ plan: text35("plan").notNull(),
990
+ limitType: text35("limit_type").notNull(),
1003
991
  value: numeric3("value").notNull(),
1004
- unit: text36("unit").notNull(),
1005
- effectiveFrom: timestamp36("effective_from", { withTimezone: true }).notNull(),
1006
- effectiveUntil: timestamp36("effective_until", { withTimezone: true }),
992
+ unit: text35("unit").notNull(),
993
+ effectiveFrom: timestamp35("effective_from", { withTimezone: true }).notNull(),
994
+ effectiveUntil: timestamp35("effective_until", { withTimezone: true }),
1007
995
  confidence: numeric3("confidence").notNull(),
1008
- sourceObservationIds: uuid34("source_observation_ids").array().notNull()
996
+ sourceObservationIds: uuid33("source_observation_ids").array().notNull()
1009
997
  }, (table) => [
1010
- primaryKey6({ columns: [table.provider, table.plan, table.limitType, table.effectiveFrom] }),
1011
- index31("idx_plan_limits_lookup").on(table.provider, table.plan, table.limitType, table.effectiveFrom.desc())
998
+ primaryKey5({ columns: [table.provider, table.plan, table.limitType, table.effectiveFrom] }),
999
+ index30("idx_plan_limits_lookup").on(table.provider, table.plan, table.limitType, table.effectiveFrom.desc())
1012
1000
  ]);
1013
1001
 
1014
1002
  // ../../packages/db/dist/schema/tables/alert-dispatches.js
1015
- import { pgTable as pgTable37, text as text37, timestamp as timestamp37, uuid as uuid35, jsonb as jsonb28, index as index32 } from "drizzle-orm/pg-core";
1016
- var alertDispatches = pgTable37("alert_dispatches", {
1017
- id: uuid35("id").primaryKey().defaultRandom(),
1018
- userId: uuid35("user_id").notNull(),
1019
- alertKey: text37("alert_key").notNull(),
1003
+ import { pgTable as pgTable36, text as text36, timestamp as timestamp36, uuid as uuid34, jsonb as jsonb28, index as index31 } from "drizzle-orm/pg-core";
1004
+ var alertDispatches = pgTable36("alert_dispatches", {
1005
+ id: uuid34("id").primaryKey().defaultRandom(),
1006
+ userId: uuid34("user_id").notNull(),
1007
+ alertKey: text36("alert_key").notNull(),
1020
1008
  // 'soft' | 'approaching' | 'imminent' | 'hit'
1021
- severity: text37("severity").notNull(),
1022
- lastDispatchedAt: timestamp37("last_dispatched_at", { withTimezone: true }).notNull().defaultNow(),
1009
+ severity: text36("severity").notNull(),
1010
+ lastDispatchedAt: timestamp36("last_dispatched_at", { withTimezone: true }).notNull().defaultNow(),
1023
1011
  // { used_percentage, resets_at, ... } — snapshot of the input that fired this alert.
1024
1012
  lastState: jsonb28("last_state").notNull(),
1025
1013
  // 'in_app' | 'vscode' | 'banner'
1026
- channel: text37("channel").notNull()
1014
+ channel: text36("channel").notNull()
1027
1015
  }, (table) => [
1028
- index32("idx_alert_user_key").on(table.userId, table.alertKey, table.lastDispatchedAt.desc())
1016
+ index31("idx_alert_user_key").on(table.userId, table.alertKey, table.lastDispatchedAt.desc())
1029
1017
  ]);
1030
1018
 
1031
1019
  // ../../packages/db/dist/client.js
1032
- import { createClient } from "@supabase/supabase-js";
1033
1020
  import { drizzle } from "drizzle-orm/postgres-js";
1034
1021
  import postgres from "postgres";
1035
1022
 
1036
1023
  // ../../packages/db/dist/schema/index.js
1037
1024
  var schema_exports = {};
1038
1025
  __export(schema_exports, {
1039
- INSTRUCTION_SCOPES: () => INSTRUCTION_SCOPES,
1040
- ORG_ROLES: () => ORG_ROLES,
1041
1026
  agentJobs: () => agentJobs,
1042
1027
  agentRuns: () => agentRuns,
1043
1028
  agentRunsRelations: () => agentRunsRelations,
@@ -1097,7 +1082,6 @@ __export(schema_exports, {
1097
1082
  projectCheckouts: () => projectCheckouts,
1098
1083
  projectInstructions: () => projectInstructions,
1099
1084
  projectInstructionsRelations: () => projectInstructionsRelations,
1100
- projectSignals: () => projectSignals,
1101
1085
  projects: () => projects,
1102
1086
  projectsRelations: () => projectsRelations,
1103
1087
  providerDocsSnapshots: () => providerDocsSnapshots,
@@ -1367,10 +1351,6 @@ var contextSnapshotsRelations = relations(contextSnapshots, ({ one }) => ({
1367
1351
  })
1368
1352
  }));
1369
1353
 
1370
- // ../../packages/db/dist/schema/enums.js
1371
- var INSTRUCTION_SCOPES = ["org", "team", "project", "personal"];
1372
- var ORG_ROLES = ["owner", "admin", "member"];
1373
-
1374
1354
  // ../../packages/db/dist/db-load.js
1375
1355
  var _inFlight = 0;
1376
1356
  var _peak = 0;
@@ -1385,8 +1365,6 @@ function trackDbOpEnd() {
1385
1365
  }
1386
1366
 
1387
1367
  // ../../packages/db/dist/client.js
1388
- var _supabase;
1389
- var _supabaseAdmin;
1390
1368
  var _db;
1391
1369
  var _client;
1392
1370
  var _closed = false;
@@ -1400,18 +1378,6 @@ function getEnv(name) {
1400
1378
  throw new Error(`Missing required env var: ${name}`);
1401
1379
  return value;
1402
1380
  }
1403
- function getSupabase() {
1404
- if (!_supabase) {
1405
- _supabase = createClient(getEnv("SUPABASE_URL"), getEnv("SUPABASE_ANON_KEY"));
1406
- }
1407
- return _supabase;
1408
- }
1409
- function getSupabaseAdmin() {
1410
- if (!_supabaseAdmin) {
1411
- _supabaseAdmin = createClient(getEnv("SUPABASE_URL"), getEnv("SUPABASE_SERVICE_ROLE_KEY"));
1412
- }
1413
- return _supabaseAdmin;
1414
- }
1415
1381
  function getDb() {
1416
1382
  if (_closed) {
1417
1383
  throw new Error("getDb() called after closeDb(): the connection pool is closed for shutdown. Stop issuing queries (timers/requests) before draining the pool.");
@@ -1622,19 +1588,12 @@ var heavyDb = new Proxy({}, {
1622
1588
  const readSafe = READ_ONLY_ENTRY_METHODS.has(prop);
1623
1589
  return (...args) => wrapBuilder(value.apply(real4, args), readSafe);
1624
1590
  }
1591
+ if (prop === "transaction" && typeof value === "function") {
1592
+ return (...args) => gaugeTransaction(() => value.apply(real4, args));
1593
+ }
1625
1594
  return value;
1626
1595
  }
1627
1596
  });
1628
- var supabase = new Proxy({}, {
1629
- get(_target, prop) {
1630
- return getSupabase()[prop];
1631
- }
1632
- });
1633
- var supabaseAdmin = new Proxy({}, {
1634
- get(_target, prop) {
1635
- return getSupabaseAdmin()[prop];
1636
- }
1637
- });
1638
1597
 
1639
1598
  export {
1640
1599
  profiles,
@@ -1647,4 +1606,4 @@ export {
1647
1606
  getDb,
1648
1607
  closeDb
1649
1608
  };
1650
- //# sourceMappingURL=chunk-YQFCUKNI.js.map
1609
+ //# sourceMappingURL=chunk-QNSVCSHG.js.map