@rulemetric/cli 0.6.2 → 0.6.4
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/{chunk-MUOUV5LY.js → chunk-3QVMIJUL.js} +2 -2
- package/dist/{chunk-6TPJGYFF.js → chunk-5ADHO5QF.js} +2 -2
- package/dist/{chunk-QNSVCSHG.js → chunk-6EMZI4Y3.js} +391 -374
- package/dist/chunk-6EMZI4Y3.js.map +7 -0
- package/dist/{chunk-VIYUIQHW.js → chunk-AHDRN6NE.js} +2 -2
- package/dist/{chunk-CVMRMSV4.js → chunk-BBLTN35F.js} +4 -4
- package/dist/{chunk-IPOO4IGF.js → chunk-CNMWYYSV.js} +2 -2
- package/dist/{chunk-OTPC2LXW.js → chunk-DAJNO4OI.js} +7 -2
- package/dist/{chunk-OTPC2LXW.js.map → chunk-DAJNO4OI.js.map} +2 -2
- package/dist/{chunk-3AEVHOTS.js → chunk-HNZLEEG2.js} +6 -2
- package/dist/chunk-HNZLEEG2.js.map +7 -0
- package/dist/chunk-TX2HKJLA.js +55 -0
- package/dist/chunk-TX2HKJLA.js.map +7 -0
- package/dist/{chunk-TXHL3AUA.js → chunk-XNNOXGP6.js} +2 -2
- package/dist/commands/auth/login.js +6 -2
- package/dist/commands/auth/login.js.map +2 -2
- package/dist/commands/auth/signup.js +6 -2
- package/dist/commands/auth/signup.js.map +2 -2
- package/dist/commands/evals/agent.js +5 -5
- package/dist/commands/gateway/ensure.js +1 -1
- package/dist/commands/hooks/install.js +5 -1
- package/dist/commands/hooks/install.js.map +2 -2
- package/dist/commands/hooks/uninstall.js +1 -1
- package/dist/commands/proxy/env.js +1 -1
- package/dist/commands/proxy/status.js +1 -1
- package/dist/commands/service/install.js +4 -0
- package/dist/commands/service/install.js.map +2 -2
- package/dist/commands/setup.js +2 -2
- package/dist/lib/agent-loop.js +5 -5
- package/dist/lib/ensure-api-key.js +2 -1
- package/dist/lib/gateway-lifecycle.js +1 -1
- package/dist/lib/handlers/process-announcement.js +2 -2
- package/dist/lib/handlers/process-changelog.js +2 -2
- package/dist/lib/handlers/process-run-cleanup.js +2 -2
- package/dist/lib/handlers/process-session-goal.js +2 -2
- package/dist/lib/manual-tasks.js +2 -2
- package/dist/lib/setup-steps.js +2 -2
- package/dist/lib/telemetry.js +14 -0
- package/dist/lib/telemetry.js.map +7 -0
- package/oclif.manifest.json +1 -1
- package/package.json +5 -5
- package/dist/chunk-3AEVHOTS.js.map +0 -7
- package/dist/chunk-QNSVCSHG.js.map +0 -7
- /package/dist/{chunk-MUOUV5LY.js.map → chunk-3QVMIJUL.js.map} +0 -0
- /package/dist/{chunk-6TPJGYFF.js.map → chunk-5ADHO5QF.js.map} +0 -0
- /package/dist/{chunk-VIYUIQHW.js.map → chunk-AHDRN6NE.js.map} +0 -0
- /package/dist/{chunk-CVMRMSV4.js.map → chunk-BBLTN35F.js.map} +0 -0
- /package/dist/{chunk-IPOO4IGF.js.map → chunk-CNMWYYSV.js.map} +0 -0
- /package/dist/{chunk-TXHL3AUA.js.map → chunk-XNNOXGP6.js.map} +0 -0
|
@@ -464,137 +464,153 @@ var workerConnections = pgTable14("worker_connections", {
|
|
|
464
464
|
index11("idx_worker_connections_type").on(table.userId, table.workerType)
|
|
465
465
|
]);
|
|
466
466
|
|
|
467
|
-
// ../../packages/db/dist/schema/tables/
|
|
468
|
-
import { pgTable as pgTable15, text as text15, timestamp as timestamp15, jsonb as jsonb13, uuid as uuid15,
|
|
469
|
-
var
|
|
467
|
+
// ../../packages/db/dist/schema/tables/cli-setup-events.js
|
|
468
|
+
import { pgTable as pgTable15, text as text15, timestamp as timestamp15, jsonb as jsonb13, uuid as uuid15, index as index12 } from "drizzle-orm/pg-core";
|
|
469
|
+
var cliSetupEvents = pgTable15("cli_setup_events", {
|
|
470
470
|
id: uuid15("id").primaryKey().defaultRandom(),
|
|
471
471
|
userId: uuid15("user_id").notNull(),
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
472
|
+
deviceId: text15("device_id").notNull(),
|
|
473
|
+
event: text15("event").notNull(),
|
|
474
|
+
cliVersion: text15("cli_version"),
|
|
475
|
+
os: text15("os"),
|
|
476
|
+
props: jsonb13("props").notNull().default({}),
|
|
477
|
+
createdAt: timestamp15("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
478
|
+
}, (table) => [
|
|
479
|
+
index12("idx_cli_setup_events_user").on(table.userId, table.createdAt),
|
|
480
|
+
index12("idx_cli_setup_events_device").on(table.deviceId, table.createdAt)
|
|
481
|
+
]);
|
|
482
|
+
|
|
483
|
+
// ../../packages/db/dist/schema/tables/eval-targets.js
|
|
484
|
+
import { pgTable as pgTable16, text as text16, timestamp as timestamp16, jsonb as jsonb14, uuid as uuid16, integer as integer7, index as index13 } from "drizzle-orm/pg-core";
|
|
485
|
+
var evalTargets = pgTable16("eval_targets", {
|
|
486
|
+
id: uuid16("id").primaryKey().defaultRandom(),
|
|
487
|
+
userId: uuid16("user_id").notNull(),
|
|
488
|
+
name: text16("name").notNull(),
|
|
489
|
+
type: text16("type").notNull(),
|
|
490
|
+
content: text16("content").notNull(),
|
|
491
|
+
description: text16("description").notNull().default(""),
|
|
492
|
+
metadata: jsonb14("metadata").notNull().default({}),
|
|
477
493
|
version: integer7("version").notNull().default(1),
|
|
478
|
-
parentId:
|
|
479
|
-
createdAt:
|
|
480
|
-
updatedAt:
|
|
494
|
+
parentId: uuid16("parent_id").references(() => evalTargets.id, { onDelete: "set null" }),
|
|
495
|
+
createdAt: timestamp16("created_at", { withTimezone: true }).defaultNow(),
|
|
496
|
+
updatedAt: timestamp16("updated_at", { withTimezone: true }).defaultNow()
|
|
481
497
|
}, (table) => [
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
498
|
+
index13("eval_targets_name_user_idx").on(table.name, table.userId),
|
|
499
|
+
index13("idx_eval_targets_user").on(table.userId),
|
|
500
|
+
index13("idx_eval_targets_type").on(table.type),
|
|
501
|
+
index13("idx_eval_targets_parent").on(table.parentId)
|
|
486
502
|
]);
|
|
487
|
-
var evals =
|
|
488
|
-
id:
|
|
489
|
-
evalTargetId:
|
|
490
|
-
name:
|
|
491
|
-
prompt:
|
|
492
|
-
expectedOutput:
|
|
493
|
-
files:
|
|
494
|
-
expectations:
|
|
495
|
-
createdAt:
|
|
496
|
-
updatedAt:
|
|
503
|
+
var evals = pgTable16("evals", {
|
|
504
|
+
id: uuid16("id").primaryKey().defaultRandom(),
|
|
505
|
+
evalTargetId: uuid16("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
|
|
506
|
+
name: text16("name").notNull(),
|
|
507
|
+
prompt: text16("prompt").notNull(),
|
|
508
|
+
expectedOutput: text16("expected_output").notNull().default(""),
|
|
509
|
+
files: jsonb14("files").notNull().default([]),
|
|
510
|
+
expectations: jsonb14("expectations").notNull().default([]),
|
|
511
|
+
createdAt: timestamp16("created_at", { withTimezone: true }).defaultNow(),
|
|
512
|
+
updatedAt: timestamp16("updated_at", { withTimezone: true }).defaultNow()
|
|
497
513
|
}, (table) => [
|
|
498
|
-
|
|
514
|
+
index13("idx_evals_target").on(table.evalTargetId)
|
|
499
515
|
]);
|
|
500
|
-
var evalRuns =
|
|
501
|
-
id:
|
|
502
|
-
evalId:
|
|
503
|
-
evalTargetId:
|
|
516
|
+
var evalRuns = pgTable16("eval_runs", {
|
|
517
|
+
id: uuid16("id").primaryKey().defaultRandom(),
|
|
518
|
+
evalId: uuid16("eval_id").notNull().references(() => evals.id, { onDelete: "cascade" }),
|
|
519
|
+
evalTargetId: uuid16("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
|
|
504
520
|
evalTargetVersion: integer7("eval_target_version").notNull(),
|
|
505
|
-
configuration:
|
|
521
|
+
configuration: text16("configuration").notNull(),
|
|
506
522
|
runNumber: integer7("run_number").notNull().default(1),
|
|
507
523
|
iteration: integer7("iteration").notNull().default(1),
|
|
508
|
-
status:
|
|
509
|
-
outputs:
|
|
510
|
-
timing:
|
|
511
|
-
grading:
|
|
512
|
-
comparison:
|
|
513
|
-
createdAt:
|
|
524
|
+
status: text16("status").notNull().default("completed"),
|
|
525
|
+
outputs: jsonb14("outputs").notNull().default({}),
|
|
526
|
+
timing: jsonb14("timing").notNull().default({}),
|
|
527
|
+
grading: jsonb14("grading").notNull().default({}),
|
|
528
|
+
comparison: jsonb14("comparison"),
|
|
529
|
+
createdAt: timestamp16("created_at", { withTimezone: true }).defaultNow()
|
|
514
530
|
}, (table) => [
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
531
|
+
index13("idx_eval_runs_eval").on(table.evalId),
|
|
532
|
+
index13("idx_eval_runs_target").on(table.evalTargetId),
|
|
533
|
+
index13("idx_eval_runs_iteration").on(table.evalTargetId, table.iteration)
|
|
518
534
|
]);
|
|
519
|
-
var benchmarks =
|
|
520
|
-
id:
|
|
521
|
-
evalTargetId:
|
|
535
|
+
var benchmarks = pgTable16("benchmarks", {
|
|
536
|
+
id: uuid16("id").primaryKey().defaultRandom(),
|
|
537
|
+
evalTargetId: uuid16("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
|
|
522
538
|
iteration: integer7("iteration").notNull().default(1),
|
|
523
|
-
runSummary:
|
|
524
|
-
notes:
|
|
525
|
-
feedback:
|
|
526
|
-
createdAt:
|
|
539
|
+
runSummary: jsonb14("run_summary").notNull().default({}),
|
|
540
|
+
notes: jsonb14("notes").notNull().default([]),
|
|
541
|
+
feedback: jsonb14("feedback"),
|
|
542
|
+
createdAt: timestamp16("created_at", { withTimezone: true }).defaultNow()
|
|
527
543
|
}, (table) => [
|
|
528
|
-
|
|
544
|
+
index13("idx_benchmarks_target").on(table.evalTargetId)
|
|
529
545
|
]);
|
|
530
546
|
|
|
531
547
|
// ../../packages/db/dist/schema/tables/optimization.js
|
|
532
|
-
import { pgTable as
|
|
533
|
-
var triggerEvals =
|
|
534
|
-
id:
|
|
535
|
-
evalTargetId:
|
|
536
|
-
userId:
|
|
537
|
-
queries:
|
|
538
|
-
status:
|
|
548
|
+
import { pgTable as pgTable17, text as text17, timestamp as timestamp17, jsonb as jsonb15, uuid as uuid17, integer as integer8, index as index14, real } from "drizzle-orm/pg-core";
|
|
549
|
+
var triggerEvals = pgTable17("trigger_evals", {
|
|
550
|
+
id: uuid17("id").primaryKey().defaultRandom(),
|
|
551
|
+
evalTargetId: uuid17("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
|
|
552
|
+
userId: uuid17("user_id").notNull(),
|
|
553
|
+
queries: jsonb15("queries").notNull().default([]),
|
|
554
|
+
status: text17("status").notNull().default("pending_review"),
|
|
539
555
|
trainIndices: integer8("train_indices").array().default([]),
|
|
540
556
|
testIndices: integer8("test_indices").array().default([]),
|
|
541
|
-
createdAt:
|
|
542
|
-
updatedAt:
|
|
557
|
+
createdAt: timestamp17("created_at", { withTimezone: true }).defaultNow(),
|
|
558
|
+
updatedAt: timestamp17("updated_at", { withTimezone: true }).defaultNow()
|
|
543
559
|
}, (table) => [
|
|
544
|
-
|
|
545
|
-
|
|
560
|
+
index14("idx_trigger_evals_target").on(table.evalTargetId),
|
|
561
|
+
index14("idx_trigger_evals_user").on(table.userId)
|
|
546
562
|
]);
|
|
547
|
-
var optimizationRuns =
|
|
548
|
-
id:
|
|
549
|
-
evalTargetId:
|
|
550
|
-
userId:
|
|
551
|
-
type:
|
|
563
|
+
var optimizationRuns = pgTable17("optimization_runs", {
|
|
564
|
+
id: uuid17("id").primaryKey().defaultRandom(),
|
|
565
|
+
evalTargetId: uuid17("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
|
|
566
|
+
userId: uuid17("user_id").notNull(),
|
|
567
|
+
type: text17("type").notNull(),
|
|
552
568
|
iteration: integer8("iteration").notNull(),
|
|
553
569
|
inputVersion: integer8("input_version").notNull(),
|
|
554
570
|
outputVersion: integer8("output_version"),
|
|
555
571
|
trainScore: real("train_score"),
|
|
556
572
|
testScore: real("test_score"),
|
|
557
|
-
analysis:
|
|
558
|
-
status:
|
|
559
|
-
createdAt:
|
|
573
|
+
analysis: jsonb15("analysis").notNull().default({}),
|
|
574
|
+
status: text17("status").notNull().default("running"),
|
|
575
|
+
createdAt: timestamp17("created_at", { withTimezone: true }).defaultNow()
|
|
560
576
|
}, (table) => [
|
|
561
|
-
|
|
562
|
-
|
|
577
|
+
index14("idx_optimization_runs_target").on(table.evalTargetId),
|
|
578
|
+
index14("idx_optimization_runs_user").on(table.userId)
|
|
563
579
|
]);
|
|
564
580
|
|
|
565
581
|
// ../../packages/db/dist/schema/tables/context-snapshots.js
|
|
566
|
-
import { pgTable as
|
|
567
|
-
var contextSnapshots =
|
|
568
|
-
id:
|
|
569
|
-
sessionId:
|
|
570
|
-
userId:
|
|
582
|
+
import { pgTable as pgTable18, text as text18, timestamp as timestamp18, jsonb as jsonb16, uuid as uuid18, integer as integer9, real as real2, index as index15, uniqueIndex as uniqueIndex7 } from "drizzle-orm/pg-core";
|
|
583
|
+
var contextSnapshots = pgTable18("context_snapshots", {
|
|
584
|
+
id: uuid18("id").primaryKey().defaultRandom(),
|
|
585
|
+
sessionId: uuid18("session_id").references(() => sessions.id, { onDelete: "cascade" }),
|
|
586
|
+
userId: uuid18("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
|
|
571
587
|
sequence: integer9("sequence").notNull().default(0),
|
|
572
|
-
provider:
|
|
573
|
-
model:
|
|
574
|
-
systemPrompt:
|
|
575
|
-
injectedInstructions:
|
|
576
|
-
messagesSummary:
|
|
577
|
-
tools:
|
|
588
|
+
provider: text18("provider").notNull(),
|
|
589
|
+
model: text18("model").notNull(),
|
|
590
|
+
systemPrompt: text18("system_prompt").notNull(),
|
|
591
|
+
injectedInstructions: jsonb16("injected_instructions").notNull().default([]),
|
|
592
|
+
messagesSummary: jsonb16("messages_summary").notNull(),
|
|
593
|
+
tools: jsonb16("tools").notNull().default([]),
|
|
578
594
|
// Deprecated: use content_blobs via tools_hash
|
|
579
|
-
systemHash:
|
|
580
|
-
requestHash:
|
|
581
|
-
toolsHash:
|
|
582
|
-
injectedHash:
|
|
583
|
-
messagesDelta:
|
|
595
|
+
systemHash: text18("system_hash").notNull(),
|
|
596
|
+
requestHash: text18("request_hash").notNull().default(""),
|
|
597
|
+
toolsHash: text18("tools_hash"),
|
|
598
|
+
injectedHash: text18("injected_hash"),
|
|
599
|
+
messagesDelta: jsonb16("messages_delta").default([]),
|
|
584
600
|
// Storage pointer set when messages_delta is offloaded to the snapshot-deltas
|
|
585
601
|
// bucket (Stage 1+). NULL = inline (messages_delta populated) OR pruned (both
|
|
586
602
|
// NULL — see 00101). docs/plans/2026-06-24-messages-delta-object-storage-offload.md
|
|
587
|
-
messagesDeltaRef:
|
|
603
|
+
messagesDeltaRef: text18("messages_delta_ref"),
|
|
588
604
|
maxTokens: integer9("max_tokens"),
|
|
589
605
|
temperature: real2("temperature"),
|
|
590
606
|
estimatedTokens: integer9("estimated_tokens"),
|
|
591
|
-
capturedAt:
|
|
592
|
-
metadata:
|
|
607
|
+
capturedAt: timestamp18("captured_at", { withTimezone: true }).notNull().defaultNow(),
|
|
608
|
+
metadata: jsonb16("metadata").default({})
|
|
593
609
|
}, (table) => [
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
610
|
+
index15("idx_context_snapshots_session").on(table.sessionId),
|
|
611
|
+
index15("idx_context_snapshots_user").on(table.userId),
|
|
612
|
+
index15("idx_context_snapshots_hash").on(table.systemHash),
|
|
613
|
+
index15("idx_context_snapshots_request_hash").on(table.requestHash),
|
|
598
614
|
uniqueIndex7("idx_snapshots_session_request").on(table.sessionId, table.requestHash),
|
|
599
615
|
// Concurrent snapshot POSTs for one session must not reuse a sequence — stops
|
|
600
616
|
// the live duplicate-sequence corruption. Built via migration 00095.
|
|
@@ -604,416 +620,416 @@ var contextSnapshots = pgTable17("context_snapshots", {
|
|
|
604
620
|
// WHERE user_id ORDER BY session_id, captured_at DESC). Matches the ORDER BY so
|
|
605
621
|
// the planner drops the Incremental Sort (the ~11s-max, temp-spill-prone step);
|
|
606
622
|
// verified 60.6ms -> 26.3ms. Built CONCURRENTLY via migration 00106.
|
|
607
|
-
|
|
623
|
+
index15("idx_context_snapshots_user_session_captured").on(table.userId, table.sessionId, table.capturedAt.desc())
|
|
608
624
|
]);
|
|
609
625
|
|
|
610
626
|
// ../../packages/db/dist/schema/tables/content-blobs.js
|
|
611
|
-
import { pgTable as
|
|
612
|
-
var contentBlobs =
|
|
613
|
-
hash:
|
|
614
|
-
contentType:
|
|
615
|
-
content:
|
|
627
|
+
import { pgTable as pgTable19, text as text19, timestamp as timestamp19, jsonb as jsonb17, integer as integer10, index as index16 } from "drizzle-orm/pg-core";
|
|
628
|
+
var contentBlobs = pgTable19("content_blobs", {
|
|
629
|
+
hash: text19("hash").primaryKey(),
|
|
630
|
+
contentType: text19("content_type").notNull(),
|
|
631
|
+
content: jsonb17("content").notNull(),
|
|
616
632
|
sizeBytes: integer10("size_bytes").notNull().default(0),
|
|
617
|
-
createdAt:
|
|
633
|
+
createdAt: timestamp19("created_at", { withTimezone: true }).defaultNow()
|
|
618
634
|
}, (table) => [
|
|
619
|
-
|
|
635
|
+
index16("idx_content_blobs_type").on(table.contentType)
|
|
620
636
|
]);
|
|
621
637
|
|
|
622
638
|
// ../../packages/db/dist/schema/tables/eval-jobs.js
|
|
623
|
-
import { pgTable as
|
|
624
|
-
var evalJobs =
|
|
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"),
|
|
629
|
-
config: jsonb17("config").notNull().default({}),
|
|
630
|
-
progress: jsonb17("progress").notNull().default({}),
|
|
631
|
-
result: jsonb17("result"),
|
|
632
|
-
error: text19("error"),
|
|
633
|
-
attempts: integer11("attempts").notNull().default(0),
|
|
634
|
-
graphileJobId: bigint2("graphile_job_id", { mode: "number" }),
|
|
635
|
-
taskKind: text19("task_kind"),
|
|
636
|
-
payload: jsonb17("payload"),
|
|
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 })
|
|
643
|
-
}, (table) => [
|
|
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)
|
|
648
|
-
]);
|
|
649
|
-
|
|
650
|
-
// ../../packages/db/dist/schema/tables/agent-jobs.js
|
|
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", {
|
|
639
|
+
import { pgTable as pgTable20, text as text20, timestamp as timestamp20, jsonb as jsonb18, uuid as uuid19, index as index17, integer as integer11, bigint as bigint2 } from "drizzle-orm/pg-core";
|
|
640
|
+
var evalJobs = pgTable20("eval_jobs", {
|
|
653
641
|
id: uuid19("id").primaryKey().defaultRandom(),
|
|
654
642
|
userId: uuid19("user_id").notNull(),
|
|
655
|
-
|
|
643
|
+
evalTargetId: uuid19("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
|
|
656
644
|
status: text20("status").notNull().default("pending"),
|
|
657
|
-
|
|
658
|
-
|
|
645
|
+
config: jsonb18("config").notNull().default({}),
|
|
646
|
+
progress: jsonb18("progress").notNull().default({}),
|
|
659
647
|
result: jsonb18("result"),
|
|
660
648
|
error: text20("error"),
|
|
661
|
-
attempts:
|
|
649
|
+
attempts: integer11("attempts").notNull().default(0),
|
|
650
|
+
graphileJobId: bigint2("graphile_job_id", { mode: "number" }),
|
|
651
|
+
taskKind: text20("task_kind"),
|
|
652
|
+
payload: jsonb18("payload"),
|
|
662
653
|
claimedBy: text20("claimed_by"),
|
|
663
654
|
claimedAt: timestamp20("claimed_at", { withTimezone: true }),
|
|
664
655
|
leaseExpiresAt: timestamp20("lease_expires_at", { withTimezone: true }),
|
|
665
|
-
createdAt: timestamp20("created_at", { withTimezone: true }).
|
|
666
|
-
updatedAt: timestamp20("updated_at", { withTimezone: true }).
|
|
656
|
+
createdAt: timestamp20("created_at", { withTimezone: true }).defaultNow(),
|
|
657
|
+
updatedAt: timestamp20("updated_at", { withTimezone: true }).defaultNow(),
|
|
667
658
|
completedAt: timestamp20("completed_at", { withTimezone: true })
|
|
668
659
|
}, (table) => [
|
|
669
|
-
index17("
|
|
670
|
-
index17("
|
|
660
|
+
index17("idx_eval_jobs_user").on(table.userId),
|
|
661
|
+
index17("idx_eval_jobs_target").on(table.evalTargetId),
|
|
662
|
+
index17("idx_eval_jobs_status").on(table.status),
|
|
663
|
+
index17("idx_eval_jobs_pending").on(table.userId, table.status)
|
|
671
664
|
]);
|
|
672
665
|
|
|
673
|
-
// ../../packages/db/dist/schema/tables/
|
|
674
|
-
import { pgTable as pgTable21, text as text21, timestamp as timestamp21, jsonb as jsonb19, uuid as uuid20,
|
|
675
|
-
var
|
|
666
|
+
// ../../packages/db/dist/schema/tables/agent-jobs.js
|
|
667
|
+
import { pgTable as pgTable21, text as text21, timestamp as timestamp21, jsonb as jsonb19, uuid as uuid20, integer as integer12, index as index18 } from "drizzle-orm/pg-core";
|
|
668
|
+
var agentJobs = pgTable21("agent_jobs", {
|
|
676
669
|
id: uuid20("id").primaryKey().defaultRandom(),
|
|
677
670
|
userId: uuid20("user_id").notNull(),
|
|
671
|
+
taskKind: text21("task_kind").notNull(),
|
|
678
672
|
status: text21("status").notNull().default("pending"),
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
// worktrees/subdirs/cwds — migration 00104). Nullable: legacy/unlinked rows fall
|
|
682
|
-
// back to project_path. Stamped at enqueue when resolvable.
|
|
683
|
-
projectId: uuid20("project_id").references(() => projects.id, { onDelete: "set null" }),
|
|
684
|
-
config: jsonb19("config").notNull().default({}),
|
|
685
|
-
progress: jsonb19("progress").notNull().default({}),
|
|
673
|
+
payload: jsonb19("payload").notNull(),
|
|
674
|
+
dedupeKey: text21("dedupe_key"),
|
|
686
675
|
result: jsonb19("result"),
|
|
687
676
|
error: text21("error"),
|
|
688
|
-
attempts:
|
|
689
|
-
graphileJobId: bigint3("graphile_job_id", { mode: "number" }),
|
|
690
|
-
taskKind: text21("task_kind"),
|
|
691
|
-
payload: jsonb19("payload"),
|
|
677
|
+
attempts: integer12("attempts").notNull().default(0),
|
|
692
678
|
claimedBy: text21("claimed_by"),
|
|
693
679
|
claimedAt: timestamp21("claimed_at", { withTimezone: true }),
|
|
694
680
|
leaseExpiresAt: timestamp21("lease_expires_at", { withTimezone: true }),
|
|
695
|
-
createdAt: timestamp21("created_at", { withTimezone: true }).defaultNow(),
|
|
696
|
-
updatedAt: timestamp21("updated_at", { withTimezone: true }).defaultNow(),
|
|
681
|
+
createdAt: timestamp21("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
682
|
+
updatedAt: timestamp21("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
697
683
|
completedAt: timestamp21("completed_at", { withTimezone: true })
|
|
698
684
|
}, (table) => [
|
|
699
|
-
index18("
|
|
700
|
-
index18("
|
|
701
|
-
index18("idx_insights_jobs_pending").on(table.userId, table.status),
|
|
702
|
-
index18("idx_insights_jobs_project").on(table.projectId)
|
|
685
|
+
index18("idx_agent_jobs_claim").on(table.userId, table.status, table.taskKind, table.createdAt),
|
|
686
|
+
index18("idx_agent_jobs_dedupe").on(table.userId, table.taskKind, table.dedupeKey)
|
|
703
687
|
]);
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
688
|
+
|
|
689
|
+
// ../../packages/db/dist/schema/tables/insights.js
|
|
690
|
+
import { pgTable as pgTable22, text as text22, timestamp as timestamp22, jsonb as jsonb20, uuid as uuid21, index as index19, uniqueIndex as uniqueIndex8, integer as integer13, bigint as bigint3 } from "drizzle-orm/pg-core";
|
|
691
|
+
var insightsJobs = pgTable22("insights_jobs", {
|
|
692
|
+
id: uuid21("id").primaryKey().defaultRandom(),
|
|
693
|
+
userId: uuid21("user_id").notNull(),
|
|
694
|
+
status: text22("status").notNull().default("pending"),
|
|
695
|
+
projectPath: text22("project_path"),
|
|
696
|
+
// Canonical project identity (project_path-keying fragments one project across
|
|
697
|
+
// worktrees/subdirs/cwds — migration 00104). Nullable: legacy/unlinked rows fall
|
|
698
|
+
// back to project_path. Stamped at enqueue when resolvable.
|
|
699
|
+
projectId: uuid21("project_id").references(() => projects.id, { onDelete: "set null" }),
|
|
700
|
+
config: jsonb20("config").notNull().default({}),
|
|
701
|
+
progress: jsonb20("progress").notNull().default({}),
|
|
702
|
+
result: jsonb20("result"),
|
|
703
|
+
error: text22("error"),
|
|
704
|
+
attempts: integer13("attempts").notNull().default(0),
|
|
705
|
+
graphileJobId: bigint3("graphile_job_id", { mode: "number" }),
|
|
706
|
+
taskKind: text22("task_kind"),
|
|
707
|
+
payload: jsonb20("payload"),
|
|
708
|
+
claimedBy: text22("claimed_by"),
|
|
709
|
+
claimedAt: timestamp22("claimed_at", { withTimezone: true }),
|
|
710
|
+
leaseExpiresAt: timestamp22("lease_expires_at", { withTimezone: true }),
|
|
711
|
+
createdAt: timestamp22("created_at", { withTimezone: true }).defaultNow(),
|
|
712
|
+
updatedAt: timestamp22("updated_at", { withTimezone: true }).defaultNow(),
|
|
713
|
+
completedAt: timestamp22("completed_at", { withTimezone: true })
|
|
711
714
|
}, (table) => [
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
+
index19("idx_insights_jobs_user").on(table.userId),
|
|
716
|
+
index19("idx_insights_jobs_status").on(table.status),
|
|
717
|
+
index19("idx_insights_jobs_pending").on(table.userId, table.status),
|
|
718
|
+
index19("idx_insights_jobs_project").on(table.projectId)
|
|
715
719
|
]);
|
|
716
|
-
|
|
717
|
-
// ../../packages/db/dist/schema/tables/api-keys.js
|
|
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
|
+
var insightsReports = pgTable22("insights_reports", {
|
|
720
721
|
id: uuid21("id").primaryKey().defaultRandom(),
|
|
721
|
-
userId: uuid21("user_id").notNull()
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
lastUsedAt: timestamp22("last_used_at", { withTimezone: true }),
|
|
726
|
-
expiresAt: timestamp22("expires_at", { withTimezone: true }),
|
|
727
|
-
revokedAt: timestamp22("revoked_at", { withTimezone: true }),
|
|
722
|
+
userId: uuid21("user_id").notNull(),
|
|
723
|
+
projectPath: text22("project_path"),
|
|
724
|
+
data: jsonb20("data").notNull(),
|
|
725
|
+
reportHtml: text22("report_html"),
|
|
728
726
|
createdAt: timestamp22("created_at", { withTimezone: true }).defaultNow()
|
|
729
727
|
}, (table) => [
|
|
730
|
-
index19("
|
|
731
|
-
|
|
728
|
+
index19("idx_insights_user").on(table.userId),
|
|
729
|
+
index19("idx_insights_created").on(table.createdAt),
|
|
730
|
+
uniqueIndex8("idx_insights_user_project").on(table.userId, table.projectPath)
|
|
732
731
|
]);
|
|
733
732
|
|
|
734
|
-
// ../../packages/db/dist/schema/tables/
|
|
735
|
-
import { pgTable as pgTable23, text as text23, timestamp as timestamp23, uuid as uuid22, index as index20 } from "drizzle-orm/pg-core";
|
|
736
|
-
var
|
|
737
|
-
|
|
733
|
+
// ../../packages/db/dist/schema/tables/api-keys.js
|
|
734
|
+
import { pgTable as pgTable23, text as text23, timestamp as timestamp23, uuid as uuid22, index as index20, uniqueIndex as uniqueIndex9 } from "drizzle-orm/pg-core";
|
|
735
|
+
var apiKeys = pgTable23("api_keys", {
|
|
736
|
+
id: uuid22("id").primaryKey().defaultRandom(),
|
|
738
737
|
userId: uuid22("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
738
|
+
name: text23("name").notNull(),
|
|
739
|
+
keyHash: text23("key_hash").notNull(),
|
|
740
|
+
keyPrefix: text23("key_prefix").notNull(),
|
|
741
|
+
lastUsedAt: timestamp23("last_used_at", { withTimezone: true }),
|
|
742
|
+
expiresAt: timestamp23("expires_at", { withTimezone: true }),
|
|
743
|
+
revokedAt: timestamp23("revoked_at", { withTimezone: true }),
|
|
742
744
|
createdAt: timestamp23("created_at", { withTimezone: true }).defaultNow()
|
|
743
745
|
}, (table) => [
|
|
744
|
-
index20("
|
|
746
|
+
index20("idx_api_keys_user").on(table.userId),
|
|
747
|
+
uniqueIndex9("idx_api_keys_hash").on(table.keyHash)
|
|
745
748
|
]);
|
|
746
749
|
|
|
747
|
-
// ../../packages/db/dist/schema/tables/
|
|
748
|
-
import { pgTable as pgTable24, text as text24, timestamp as timestamp24,
|
|
749
|
-
var
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
createdAt: timestamp24("created_at", { withTimezone: true }).defaultNow()
|
|
756
|
-
updatedAt: timestamp24("updated_at", { withTimezone: true }).defaultNow()
|
|
750
|
+
// ../../packages/db/dist/schema/tables/extension-auth-codes.js
|
|
751
|
+
import { pgTable as pgTable24, text as text24, timestamp as timestamp24, uuid as uuid23, index as index21 } from "drizzle-orm/pg-core";
|
|
752
|
+
var extensionAuthCodes = pgTable24("extension_auth_codes", {
|
|
753
|
+
code: text24("code").primaryKey(),
|
|
754
|
+
userId: uuid23("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
|
|
755
|
+
editor: text24("editor"),
|
|
756
|
+
email: text24("email"),
|
|
757
|
+
expiresAt: timestamp24("expires_at", { withTimezone: true }).notNull(),
|
|
758
|
+
createdAt: timestamp24("created_at", { withTimezone: true }).defaultNow()
|
|
757
759
|
}, (table) => [
|
|
758
|
-
index21("
|
|
759
|
-
index21("idx_eval_conversations_user").on(table.userId)
|
|
760
|
+
index21("idx_ext_auth_codes_expiry").on(table.expiresAt)
|
|
760
761
|
]);
|
|
761
762
|
|
|
762
|
-
// ../../packages/db/dist/schema/tables/
|
|
763
|
-
import { pgTable as pgTable25,
|
|
764
|
-
var
|
|
763
|
+
// ../../packages/db/dist/schema/tables/eval-conversations.js
|
|
764
|
+
import { pgTable as pgTable25, text as text25, timestamp as timestamp25, jsonb as jsonb21, uuid as uuid24, index as index22 } from "drizzle-orm/pg-core";
|
|
765
|
+
var evalConversations = pgTable25("eval_conversations", {
|
|
765
766
|
id: uuid24("id").primaryKey().defaultRandom(),
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
userId: uuid24("user_id"),
|
|
773
|
-
details: jsonb21("details").notNull().default({}),
|
|
774
|
-
createdAt: timestamp25("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
767
|
+
evalTargetId: uuid24("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
|
|
768
|
+
userId: uuid24("user_id").notNull(),
|
|
769
|
+
messages: jsonb21("messages").notNull().default([]),
|
|
770
|
+
status: text25("status").notNull().default("active"),
|
|
771
|
+
createdAt: timestamp25("created_at", { withTimezone: true }).defaultNow(),
|
|
772
|
+
updatedAt: timestamp25("updated_at", { withTimezone: true }).defaultNow()
|
|
775
773
|
}, (table) => [
|
|
776
|
-
index22("
|
|
777
|
-
index22("
|
|
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)
|
|
774
|
+
index22("idx_eval_conversations_target").on(table.evalTargetId),
|
|
775
|
+
index22("idx_eval_conversations_user").on(table.userId)
|
|
781
776
|
]);
|
|
782
777
|
|
|
783
|
-
// ../../packages/db/dist/schema/tables/
|
|
784
|
-
import { pgTable as pgTable26, text as text26,
|
|
785
|
-
var
|
|
778
|
+
// ../../packages/db/dist/schema/tables/security-events.js
|
|
779
|
+
import { pgTable as pgTable26, uuid as uuid25, text as text26, jsonb as jsonb22, timestamp as timestamp26, index as index23 } from "drizzle-orm/pg-core";
|
|
780
|
+
var securityEvents = pgTable26("security_events", {
|
|
786
781
|
id: uuid25("id").primaryKey().defaultRandom(),
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
782
|
+
eventType: text26("event_type").notNull(),
|
|
783
|
+
severity: text26("severity").notNull(),
|
|
784
|
+
category: text26("category").notNull(),
|
|
785
|
+
source: text26("source").notNull(),
|
|
786
|
+
entityType: text26("entity_type"),
|
|
787
|
+
entityId: uuid25("entity_id"),
|
|
788
|
+
userId: uuid25("user_id"),
|
|
789
|
+
details: jsonb22("details").notNull().default({}),
|
|
790
|
+
createdAt: timestamp26("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
793
791
|
}, (table) => [
|
|
794
|
-
index23("
|
|
795
|
-
index23("
|
|
792
|
+
index23("idx_security_events_type").on(table.eventType),
|
|
793
|
+
index23("idx_security_events_user").on(table.userId),
|
|
794
|
+
index23("idx_security_events_created").on(table.createdAt),
|
|
795
|
+
index23("idx_security_events_severity").on(table.severity),
|
|
796
|
+
index23("idx_security_events_source").on(table.source)
|
|
796
797
|
]);
|
|
797
798
|
|
|
798
|
-
// ../../packages/db/dist/schema/tables/
|
|
799
|
-
import { pgTable as pgTable27, text as text27, timestamp as timestamp27,
|
|
800
|
-
var
|
|
799
|
+
// ../../packages/db/dist/schema/tables/tasks.js
|
|
800
|
+
import { pgTable as pgTable27, text as text27, timestamp as timestamp27, uuid as uuid26, index as index24 } from "drizzle-orm/pg-core";
|
|
801
|
+
var tasks = pgTable27("tasks", {
|
|
801
802
|
id: uuid26("id").primaryKey().defaultRandom(),
|
|
802
|
-
|
|
803
|
-
|
|
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(),
|
|
803
|
+
title: text27("title").notNull(),
|
|
804
|
+
description: text27("description"),
|
|
809
805
|
status: text27("status").notNull().default("pending"),
|
|
810
|
-
|
|
811
|
-
submittedBy: uuid26("submitted_by").notNull(),
|
|
812
|
-
reviewedBy: uuid26("reviewed_by"),
|
|
813
|
-
reviewNote: text27("review_note"),
|
|
814
|
-
metadata: jsonb22("metadata"),
|
|
806
|
+
createdBy: uuid26("created_by"),
|
|
815
807
|
createdAt: timestamp27("created_at", { withTimezone: true }).defaultNow(),
|
|
816
808
|
updatedAt: timestamp27("updated_at", { withTimezone: true }).defaultNow()
|
|
809
|
+
}, (table) => [
|
|
810
|
+
index24("tasks_created_by_idx").on(table.createdBy),
|
|
811
|
+
index24("tasks_status_idx").on(table.status)
|
|
812
|
+
]);
|
|
813
|
+
|
|
814
|
+
// ../../packages/db/dist/schema/tables/skill-submissions.js
|
|
815
|
+
import { pgTable as pgTable28, text as text28, timestamp as timestamp28, jsonb as jsonb23, uuid as uuid27 } from "drizzle-orm/pg-core";
|
|
816
|
+
var skillSubmissions = pgTable28("skill_submissions", {
|
|
817
|
+
id: uuid27("id").primaryKey().defaultRandom(),
|
|
818
|
+
skillId: text28("skill_id").notNull(),
|
|
819
|
+
name: text28("name").notNull(),
|
|
820
|
+
description: text28("description").notNull(),
|
|
821
|
+
category: text28("category").notNull(),
|
|
822
|
+
tools: text28("tools").array().notNull(),
|
|
823
|
+
tags: text28("tags").array().default([]),
|
|
824
|
+
content: text28("content").notNull(),
|
|
825
|
+
status: text28("status").notNull().default("pending"),
|
|
826
|
+
// pending | approved | rejected
|
|
827
|
+
submittedBy: uuid27("submitted_by").notNull(),
|
|
828
|
+
reviewedBy: uuid27("reviewed_by"),
|
|
829
|
+
reviewNote: text28("review_note"),
|
|
830
|
+
metadata: jsonb23("metadata"),
|
|
831
|
+
createdAt: timestamp28("created_at", { withTimezone: true }).defaultNow(),
|
|
832
|
+
updatedAt: timestamp28("updated_at", { withTimezone: true }).defaultNow()
|
|
817
833
|
});
|
|
818
834
|
|
|
819
835
|
// ../../packages/db/dist/schema/tables/harness-releases.js
|
|
820
|
-
import { pgTable as
|
|
821
|
-
var harnessReleases =
|
|
822
|
-
id:
|
|
823
|
-
harness:
|
|
836
|
+
import { pgTable as pgTable29, text as text29, timestamp as timestamp29, jsonb as jsonb24, uuid as uuid28, uniqueIndex as uniqueIndex10, index as index25 } from "drizzle-orm/pg-core";
|
|
837
|
+
var harnessReleases = pgTable29("harness_releases", {
|
|
838
|
+
id: uuid28("id").primaryKey().defaultRandom(),
|
|
839
|
+
harness: text29("harness").notNull(),
|
|
824
840
|
// "claude_code", "cursor", "copilot"
|
|
825
|
-
version:
|
|
841
|
+
version: text29("version").notNull(),
|
|
826
842
|
// "v2.1.119"
|
|
827
|
-
publishedAt:
|
|
828
|
-
title:
|
|
843
|
+
publishedAt: timestamp29("published_at", { withTimezone: true }).notNull(),
|
|
844
|
+
title: text29("title"),
|
|
829
845
|
// release name
|
|
830
|
-
body:
|
|
846
|
+
body: text29("body"),
|
|
831
847
|
// raw markdown
|
|
832
|
-
categories:
|
|
848
|
+
categories: jsonb24("categories").default({}),
|
|
833
849
|
// { features: string[], fixes: string[], security: string[] }
|
|
834
|
-
url:
|
|
850
|
+
url: text29("url"),
|
|
835
851
|
// link to release page
|
|
836
|
-
createdAt:
|
|
852
|
+
createdAt: timestamp29("created_at", { withTimezone: true }).defaultNow()
|
|
837
853
|
}, (table) => [
|
|
838
854
|
uniqueIndex10("idx_harness_releases_unique").on(table.harness, table.version),
|
|
839
|
-
|
|
840
|
-
|
|
855
|
+
index25("idx_harness_releases_harness").on(table.harness),
|
|
856
|
+
index25("idx_harness_releases_published").on(table.publishedAt)
|
|
841
857
|
]);
|
|
842
858
|
|
|
843
859
|
// ../../packages/db/dist/schema/tables/notifications.js
|
|
844
|
-
import { pgTable as
|
|
845
|
-
var notifications =
|
|
846
|
-
id:
|
|
847
|
-
userId:
|
|
848
|
-
type:
|
|
849
|
-
title:
|
|
850
|
-
body:
|
|
851
|
-
url:
|
|
852
|
-
sourceTable:
|
|
853
|
-
sourceId:
|
|
854
|
-
metadata:
|
|
855
|
-
readAt:
|
|
856
|
-
createdAt:
|
|
860
|
+
import { pgTable as pgTable30, text as text30, timestamp as timestamp30, jsonb as jsonb25, uuid as uuid29, index as index26, uniqueIndex as uniqueIndex11 } from "drizzle-orm/pg-core";
|
|
861
|
+
var notifications = pgTable30("notifications", {
|
|
862
|
+
id: uuid29("id").primaryKey().defaultRandom(),
|
|
863
|
+
userId: uuid29("user_id").notNull(),
|
|
864
|
+
type: text30("type").notNull(),
|
|
865
|
+
title: text30("title").notNull(),
|
|
866
|
+
body: text30("body"),
|
|
867
|
+
url: text30("url"),
|
|
868
|
+
sourceTable: text30("source_table"),
|
|
869
|
+
sourceId: text30("source_id"),
|
|
870
|
+
metadata: jsonb25("metadata").notNull().default({}),
|
|
871
|
+
readAt: timestamp30("read_at", { withTimezone: true }),
|
|
872
|
+
createdAt: timestamp30("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
857
873
|
}, (table) => [
|
|
858
|
-
|
|
859
|
-
|
|
874
|
+
index26("idx_notifications_user_created").on(table.userId, table.createdAt),
|
|
875
|
+
index26("idx_notifications_user_unread").on(table.userId),
|
|
860
876
|
uniqueIndex11("idx_notifications_source_dedup").on(table.userId, table.sourceTable, table.sourceId)
|
|
861
877
|
]);
|
|
862
878
|
|
|
863
879
|
// ../../packages/db/dist/schema/tables/launch-jobs.js
|
|
864
|
-
import { pgTable as
|
|
865
|
-
var launchJobs =
|
|
866
|
-
id:
|
|
867
|
-
userId:
|
|
868
|
-
tool:
|
|
869
|
-
status:
|
|
870
|
-
config:
|
|
871
|
-
result:
|
|
872
|
-
error:
|
|
880
|
+
import { pgTable as pgTable31, text as text31, timestamp as timestamp31, jsonb as jsonb26, uuid as uuid30, index as index27, integer as integer14, bigint as bigint4 } from "drizzle-orm/pg-core";
|
|
881
|
+
var launchJobs = pgTable31("launch_jobs", {
|
|
882
|
+
id: uuid30("id").primaryKey().defaultRandom(),
|
|
883
|
+
userId: uuid30("user_id").notNull(),
|
|
884
|
+
tool: text31("tool").notNull(),
|
|
885
|
+
status: text31("status").notNull().default("pending"),
|
|
886
|
+
config: jsonb26("config").notNull().default({}),
|
|
887
|
+
result: jsonb26("result"),
|
|
888
|
+
error: text31("error"),
|
|
873
889
|
attempts: integer14("attempts").notNull().default(0),
|
|
874
890
|
graphileJobId: bigint4("graphile_job_id", { mode: "number" }),
|
|
875
|
-
taskKind:
|
|
876
|
-
payload:
|
|
877
|
-
claimedBy:
|
|
878
|
-
claimedAt:
|
|
879
|
-
leaseExpiresAt:
|
|
880
|
-
createdAt:
|
|
881
|
-
updatedAt:
|
|
882
|
-
completedAt:
|
|
883
|
-
runId:
|
|
891
|
+
taskKind: text31("task_kind"),
|
|
892
|
+
payload: jsonb26("payload"),
|
|
893
|
+
claimedBy: text31("claimed_by"),
|
|
894
|
+
claimedAt: timestamp31("claimed_at", { withTimezone: true }),
|
|
895
|
+
leaseExpiresAt: timestamp31("lease_expires_at", { withTimezone: true }),
|
|
896
|
+
createdAt: timestamp31("created_at", { withTimezone: true }).defaultNow(),
|
|
897
|
+
updatedAt: timestamp31("updated_at", { withTimezone: true }).defaultNow(),
|
|
898
|
+
completedAt: timestamp31("completed_at", { withTimezone: true }),
|
|
899
|
+
runId: uuid30("run_id").references(() => agentRuns.id, { onDelete: "set null" })
|
|
884
900
|
}, (table) => [
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
901
|
+
index27("idx_launch_jobs_user").on(table.userId),
|
|
902
|
+
index27("idx_launch_jobs_status").on(table.status),
|
|
903
|
+
index27("idx_launch_jobs_pending").on(table.userId, table.status),
|
|
904
|
+
index27("idx_launch_jobs_run").on(table.runId)
|
|
889
905
|
]);
|
|
890
906
|
|
|
891
907
|
// ../../packages/db/dist/schema/tables/instruction-suggestions.js
|
|
892
|
-
import { pgTable as
|
|
893
|
-
var instructionSuggestions =
|
|
894
|
-
id:
|
|
895
|
-
userId:
|
|
896
|
-
instructionId:
|
|
897
|
-
projectPath:
|
|
908
|
+
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";
|
|
909
|
+
var instructionSuggestions = pgTable32("instruction_suggestions", {
|
|
910
|
+
id: uuid31("id").primaryKey().defaultRandom(),
|
|
911
|
+
userId: uuid31("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
|
|
912
|
+
instructionId: uuid31("instruction_id").notNull().references(() => instructions.id, { onDelete: "cascade" }),
|
|
913
|
+
projectPath: text32("project_path").notNull(),
|
|
898
914
|
// Canonical project identity (migration 00104). Additive + nullable; the
|
|
899
915
|
// unique index below stays on project_path (NOT NULL) so upserts are
|
|
900
916
|
// unchanged. Readers prefer project_id to aggregate across path variants.
|
|
901
|
-
projectId:
|
|
917
|
+
projectId: uuid31("project_id").references(() => projects.id, { onDelete: "set null" }),
|
|
902
918
|
score: real3("score").notNull(),
|
|
903
|
-
reason:
|
|
904
|
-
generatedAt:
|
|
919
|
+
reason: text32("reason").notNull(),
|
|
920
|
+
generatedAt: timestamp32("generated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
905
921
|
isStale: boolean8("is_stale").notNull().default(false),
|
|
906
|
-
dismissedAt:
|
|
907
|
-
acceptedAt:
|
|
908
|
-
promotedToInstructionId:
|
|
922
|
+
dismissedAt: timestamp32("dismissed_at", { withTimezone: true }),
|
|
923
|
+
acceptedAt: timestamp32("accepted_at", { withTimezone: true }),
|
|
924
|
+
promotedToInstructionId: uuid31("promoted_to_instruction_id").references(() => instructions.id, { onDelete: "set null" })
|
|
909
925
|
}, (table) => [
|
|
910
926
|
uniqueIndex12("idx_instruction_suggestions_user_project_instruction").on(table.userId, table.projectPath, table.instructionId),
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
927
|
+
index28("idx_instruction_suggestions_user_project").on(table.userId, table.projectPath),
|
|
928
|
+
index28("idx_instruction_suggestions_user_proj_id").on(table.userId, table.projectId),
|
|
929
|
+
index28("idx_instruction_suggestions_generated_at").on(table.generatedAt)
|
|
914
930
|
]);
|
|
915
|
-
var instructionSuggestionEvents =
|
|
916
|
-
id:
|
|
917
|
-
suggestionId:
|
|
918
|
-
userId:
|
|
919
|
-
eventType:
|
|
920
|
-
tool:
|
|
921
|
-
sessionId:
|
|
922
|
-
projectPath:
|
|
923
|
-
createdAt:
|
|
931
|
+
var instructionSuggestionEvents = pgTable32("instruction_suggestion_events", {
|
|
932
|
+
id: uuid31("id").primaryKey().defaultRandom(),
|
|
933
|
+
suggestionId: uuid31("suggestion_id").notNull().references(() => instructionSuggestions.id, { onDelete: "cascade" }),
|
|
934
|
+
userId: uuid31("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
|
|
935
|
+
eventType: text32("event_type").notNull(),
|
|
936
|
+
tool: text32("tool"),
|
|
937
|
+
sessionId: uuid31("session_id"),
|
|
938
|
+
projectPath: text32("project_path").notNull(),
|
|
939
|
+
createdAt: timestamp32("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
924
940
|
}, (table) => [
|
|
925
|
-
|
|
926
|
-
|
|
941
|
+
index28("idx_instruction_suggestion_events_suggestion_id").on(table.suggestionId),
|
|
942
|
+
index28("idx_instruction_suggestion_events_user_id").on(table.userId)
|
|
927
943
|
]);
|
|
928
944
|
|
|
929
945
|
// ../../packages/db/dist/schema/tables/model-pricing.js
|
|
930
|
-
import { pgTable as
|
|
931
|
-
var modelPricing =
|
|
932
|
-
provider:
|
|
933
|
-
modelId:
|
|
946
|
+
import { pgTable as pgTable33, text as text33, integer as integer15, numeric, timestamp as timestamp33, index as index29, primaryKey as primaryKey4 } from "drizzle-orm/pg-core";
|
|
947
|
+
var modelPricing = pgTable33("model_pricing", {
|
|
948
|
+
provider: text33("provider").notNull(),
|
|
949
|
+
modelId: text33("model_id").notNull(),
|
|
934
950
|
inputPerM: numeric("input_per_m").notNull(),
|
|
935
951
|
outputPerM: numeric("output_per_m").notNull(),
|
|
936
952
|
cacheReadPerM: numeric("cache_read_per_m").notNull(),
|
|
937
953
|
cacheWrite5mPerM: numeric("cache_write_5m_per_m").notNull(),
|
|
938
954
|
cacheWrite1hPerM: numeric("cache_write_1h_per_m").notNull(),
|
|
939
955
|
contextWindow: integer15("context_window"),
|
|
940
|
-
effectiveFrom:
|
|
941
|
-
effectiveUntil:
|
|
942
|
-
source:
|
|
956
|
+
effectiveFrom: timestamp33("effective_from", { withTimezone: true }).notNull(),
|
|
957
|
+
effectiveUntil: timestamp33("effective_until", { withTimezone: true }),
|
|
958
|
+
source: text33("source").notNull()
|
|
943
959
|
}, (table) => [
|
|
944
960
|
primaryKey4({ columns: [table.provider, table.modelId, table.effectiveFrom] }),
|
|
945
|
-
|
|
961
|
+
index29("idx_model_pricing_active").on(table.provider, table.modelId, table.effectiveFrom.desc())
|
|
946
962
|
]);
|
|
947
963
|
|
|
948
964
|
// ../../packages/db/dist/schema/tables/limit-observations.js
|
|
949
|
-
import { pgTable as
|
|
950
|
-
var limitObservations =
|
|
951
|
-
id:
|
|
952
|
-
observedAt:
|
|
953
|
-
provider:
|
|
954
|
-
plan:
|
|
955
|
-
limitType:
|
|
965
|
+
import { pgTable as pgTable34, text as text34, numeric as numeric2, timestamp as timestamp34, uuid as uuid32, jsonb as jsonb27, index as index30 } from "drizzle-orm/pg-core";
|
|
966
|
+
var limitObservations = pgTable34("limit_observations", {
|
|
967
|
+
id: uuid32("id").primaryKey().defaultRandom(),
|
|
968
|
+
observedAt: timestamp34("observed_at", { withTimezone: true }).notNull().defaultNow(),
|
|
969
|
+
provider: text34("provider").notNull(),
|
|
970
|
+
plan: text34("plan").notNull(),
|
|
971
|
+
limitType: text34("limit_type").notNull(),
|
|
956
972
|
value: numeric2("value").notNull(),
|
|
957
|
-
unit:
|
|
958
|
-
comparator:
|
|
959
|
-
resetsAt:
|
|
960
|
-
sourceType:
|
|
961
|
-
sourceUrl:
|
|
962
|
-
sourceEvidence:
|
|
973
|
+
unit: text34("unit").notNull(),
|
|
974
|
+
comparator: text34("comparator").notNull().default("="),
|
|
975
|
+
resetsAt: timestamp34("resets_at", { withTimezone: true }),
|
|
976
|
+
sourceType: text34("source_type").notNull(),
|
|
977
|
+
sourceUrl: text34("source_url"),
|
|
978
|
+
sourceEvidence: jsonb27("source_evidence"),
|
|
963
979
|
confidence: numeric2("confidence").notNull(),
|
|
964
|
-
userId:
|
|
980
|
+
userId: uuid32("user_id")
|
|
965
981
|
}, (table) => [
|
|
966
|
-
|
|
967
|
-
|
|
982
|
+
index30("idx_limit_obs_lookup").on(table.provider, table.plan, table.limitType, table.observedAt.desc()),
|
|
983
|
+
index30("idx_limit_obs_user").on(table.userId, table.observedAt.desc())
|
|
968
984
|
]);
|
|
969
985
|
|
|
970
986
|
// ../../packages/db/dist/schema/tables/provider-docs-snapshots.js
|
|
971
|
-
import { pgTable as
|
|
972
|
-
var providerDocsSnapshots =
|
|
973
|
-
id:
|
|
974
|
-
fetchedAt:
|
|
975
|
-
provider:
|
|
976
|
-
docUrl:
|
|
977
|
-
contentHash:
|
|
978
|
-
content:
|
|
987
|
+
import { pgTable as pgTable35, text as text35, timestamp as timestamp35, uuid as uuid33, jsonb as jsonb28, boolean as boolean9, uniqueIndex as uniqueIndex13 } from "drizzle-orm/pg-core";
|
|
988
|
+
var providerDocsSnapshots = pgTable35("provider_docs_snapshots", {
|
|
989
|
+
id: uuid33("id").primaryKey().defaultRandom(),
|
|
990
|
+
fetchedAt: timestamp35("fetched_at", { withTimezone: true }).notNull().defaultNow(),
|
|
991
|
+
provider: text35("provider").notNull(),
|
|
992
|
+
docUrl: text35("doc_url").notNull(),
|
|
993
|
+
contentHash: text35("content_hash").notNull(),
|
|
994
|
+
content: text35("content").notNull(),
|
|
979
995
|
parseSuccess: boolean9("parse_success").notNull(),
|
|
980
|
-
parseErrors:
|
|
996
|
+
parseErrors: jsonb28("parse_errors")
|
|
981
997
|
}, (table) => [
|
|
982
998
|
uniqueIndex13("idx_docs_dedup").on(table.provider, table.docUrl, table.contentHash)
|
|
983
999
|
]);
|
|
984
1000
|
|
|
985
1001
|
// ../../packages/db/dist/schema/tables/plan-limits-active.js
|
|
986
|
-
import { pgTable as
|
|
987
|
-
var planLimitsActive =
|
|
988
|
-
provider:
|
|
989
|
-
plan:
|
|
990
|
-
limitType:
|
|
1002
|
+
import { pgTable as pgTable36, text as text36, numeric as numeric3, timestamp as timestamp36, uuid as uuid34, primaryKey as primaryKey5, index as index31 } from "drizzle-orm/pg-core";
|
|
1003
|
+
var planLimitsActive = pgTable36("plan_limits_active", {
|
|
1004
|
+
provider: text36("provider").notNull(),
|
|
1005
|
+
plan: text36("plan").notNull(),
|
|
1006
|
+
limitType: text36("limit_type").notNull(),
|
|
991
1007
|
value: numeric3("value").notNull(),
|
|
992
|
-
unit:
|
|
993
|
-
effectiveFrom:
|
|
994
|
-
effectiveUntil:
|
|
1008
|
+
unit: text36("unit").notNull(),
|
|
1009
|
+
effectiveFrom: timestamp36("effective_from", { withTimezone: true }).notNull(),
|
|
1010
|
+
effectiveUntil: timestamp36("effective_until", { withTimezone: true }),
|
|
995
1011
|
confidence: numeric3("confidence").notNull(),
|
|
996
|
-
sourceObservationIds:
|
|
1012
|
+
sourceObservationIds: uuid34("source_observation_ids").array().notNull()
|
|
997
1013
|
}, (table) => [
|
|
998
1014
|
primaryKey5({ columns: [table.provider, table.plan, table.limitType, table.effectiveFrom] }),
|
|
999
|
-
|
|
1015
|
+
index31("idx_plan_limits_lookup").on(table.provider, table.plan, table.limitType, table.effectiveFrom.desc())
|
|
1000
1016
|
]);
|
|
1001
1017
|
|
|
1002
1018
|
// ../../packages/db/dist/schema/tables/alert-dispatches.js
|
|
1003
|
-
import { pgTable as
|
|
1004
|
-
var alertDispatches =
|
|
1005
|
-
id:
|
|
1006
|
-
userId:
|
|
1007
|
-
alertKey:
|
|
1019
|
+
import { pgTable as pgTable37, text as text37, timestamp as timestamp37, uuid as uuid35, jsonb as jsonb29, index as index32 } from "drizzle-orm/pg-core";
|
|
1020
|
+
var alertDispatches = pgTable37("alert_dispatches", {
|
|
1021
|
+
id: uuid35("id").primaryKey().defaultRandom(),
|
|
1022
|
+
userId: uuid35("user_id").notNull(),
|
|
1023
|
+
alertKey: text37("alert_key").notNull(),
|
|
1008
1024
|
// 'soft' | 'approaching' | 'imminent' | 'hit'
|
|
1009
|
-
severity:
|
|
1010
|
-
lastDispatchedAt:
|
|
1025
|
+
severity: text37("severity").notNull(),
|
|
1026
|
+
lastDispatchedAt: timestamp37("last_dispatched_at", { withTimezone: true }).notNull().defaultNow(),
|
|
1011
1027
|
// { used_percentage, resets_at, ... } — snapshot of the input that fired this alert.
|
|
1012
|
-
lastState:
|
|
1028
|
+
lastState: jsonb29("last_state").notNull(),
|
|
1013
1029
|
// 'in_app' | 'vscode' | 'banner'
|
|
1014
|
-
channel:
|
|
1030
|
+
channel: text37("channel").notNull()
|
|
1015
1031
|
}, (table) => [
|
|
1016
|
-
|
|
1032
|
+
index32("idx_alert_user_key").on(table.userId, table.alertKey, table.lastDispatchedAt.desc())
|
|
1017
1033
|
]);
|
|
1018
1034
|
|
|
1019
1035
|
// ../../packages/db/dist/client.js
|
|
@@ -1033,6 +1049,7 @@ __export(schema_exports, {
|
|
|
1033
1049
|
apiKeysRelations: () => apiKeysRelations,
|
|
1034
1050
|
benchmarks: () => benchmarks,
|
|
1035
1051
|
benchmarksRelations: () => benchmarksRelations,
|
|
1052
|
+
cliSetupEvents: () => cliSetupEvents,
|
|
1036
1053
|
contentBlobs: () => contentBlobs,
|
|
1037
1054
|
contextSnapshots: () => contextSnapshots,
|
|
1038
1055
|
contextSnapshotsRelations: () => contextSnapshotsRelations,
|
|
@@ -1606,4 +1623,4 @@ export {
|
|
|
1606
1623
|
getDb,
|
|
1607
1624
|
closeDb
|
|
1608
1625
|
};
|
|
1609
|
-
//# sourceMappingURL=chunk-
|
|
1626
|
+
//# sourceMappingURL=chunk-6EMZI4Y3.js.map
|