@rulemetric/cli 0.6.9 → 0.7.1
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/base-command.js +4 -3
- package/dist/{chunk-SZ7VDCD6.js → chunk-2HK7RGZB.js} +22 -3
- package/dist/chunk-2HK7RGZB.js.map +7 -0
- package/dist/{chunk-RUCSRN7F.js → chunk-2ORJWTNZ.js} +2 -2
- package/dist/{chunk-SLL3OBKN.js → chunk-37LN5O7M.js} +2 -2
- package/dist/chunk-3S7223UR.js +81 -0
- package/dist/chunk-3S7223UR.js.map +7 -0
- package/dist/{chunk-DAJNO4OI.js → chunk-4LYCDS2N.js} +28 -16
- package/dist/chunk-4LYCDS2N.js.map +7 -0
- package/dist/{chunk-UPXIO7CG.js → chunk-4XAWK6S2.js} +8 -8
- package/dist/{chunk-QD6X4L4L.js → chunk-5BAOGNUH.js} +4 -4
- package/dist/chunk-5EDMGK3W.js +39 -0
- package/dist/chunk-5EDMGK3W.js.map +7 -0
- package/dist/{chunk-5ADHO5QF.js → chunk-6NBS5XFS.js} +6 -6
- package/dist/{chunk-BBLTN35F.js → chunk-7DULPSFU.js} +49 -20
- package/dist/chunk-7DULPSFU.js.map +7 -0
- package/dist/chunk-7LVVKQMZ.js +98 -0
- package/dist/chunk-7LVVKQMZ.js.map +7 -0
- package/dist/{chunk-PXVQLD7S.js → chunk-7NNFYWKK.js} +48 -1
- package/dist/chunk-7NNFYWKK.js.map +7 -0
- package/dist/{chunk-DTFXCHHI.js → chunk-DNKSVWMD.js} +4 -4
- package/dist/{chunk-CNMWYYSV.js → chunk-DUJSRBLP.js} +2 -2
- package/dist/chunk-EARWG4EV.js +22 -0
- package/dist/chunk-EARWG4EV.js.map +7 -0
- package/dist/{chunk-6EMZI4Y3.js → chunk-EI5BHWXA.js} +437 -401
- package/dist/chunk-EI5BHWXA.js.map +7 -0
- package/dist/{chunk-HNZLEEG2.js → chunk-EJ3YAFDP.js} +4 -4
- package/dist/{chunk-HNZLEEG2.js.map → chunk-EJ3YAFDP.js.map} +2 -2
- package/dist/{chunk-YSEQWCN4.js → chunk-EYPAAGN5.js} +2 -2
- package/dist/{chunk-JEJ3J5J6.js → chunk-GIUBARWS.js} +2 -2
- package/dist/chunk-GQNJO2P2.js +102 -0
- package/dist/chunk-GQNJO2P2.js.map +7 -0
- package/dist/chunk-ILYDELUE.js +46 -0
- package/dist/chunk-ILYDELUE.js.map +7 -0
- package/dist/chunk-J6QFW4LD.js +55 -0
- package/dist/chunk-J6QFW4LD.js.map +7 -0
- package/dist/{chunk-OTOWLUOJ.js → chunk-JULOLTZS.js} +2 -2
- package/dist/{chunk-DR5WLIOU.js → chunk-KJKBDQ4D.js} +2 -2
- package/dist/{chunk-XN23W5HL.js → chunk-LXKPNATC.js} +93 -7
- package/dist/chunk-LXKPNATC.js.map +7 -0
- package/dist/{chunk-N5A2IQAK.js → chunk-OK3I555A.js} +2 -2
- package/dist/{chunk-XNNOXGP6.js → chunk-OKWCKCPE.js} +38 -19
- package/dist/chunk-OKWCKCPE.js.map +7 -0
- package/dist/{chunk-AHDRN6NE.js → chunk-OO7JDFS4.js} +5 -5
- package/dist/{chunk-N2X35ITW.js → chunk-OQBBVTDG.js} +11 -1
- package/dist/{chunk-N2X35ITW.js.map → chunk-OQBBVTDG.js.map} +2 -2
- package/dist/{chunk-3QH73QOQ.js → chunk-PED7L5GX.js} +2 -2
- package/dist/{chunk-VBGUNFKY.js → chunk-PMI56ED5.js} +5 -5
- package/dist/{chunk-RCMXTLQF.js → chunk-RMTT4KDY.js} +2 -2
- package/dist/{chunk-W4MZXKZ2.js → chunk-UKMLICWS.js} +2 -2
- package/dist/{chunk-3POYC5NA.js → chunk-XK42ZBDE.js} +3 -3
- package/dist/{chunk-ZSGKRCKD.js → chunk-XUV6DDBF.js} +2 -2
- package/dist/{chunk-LAKZUE35.js → chunk-Y3WD5CSW.js} +2 -2
- package/dist/{chunk-3QVMIJUL.js → chunk-YOBA3NAM.js} +5 -5
- package/dist/{chunk-ZRLYHBPN.js → chunk-ZUJBM6HE.js} +20 -2
- package/dist/chunk-ZUJBM6HE.js.map +7 -0
- package/dist/commands/antigravity/backfill.js +5 -4
- package/dist/commands/antigravity/backfill.js.map +1 -1
- package/dist/commands/auth/create-key.js +4 -3
- package/dist/commands/auth/create-key.js.map +1 -1
- package/dist/commands/auth/login.js +13 -9
- package/dist/commands/auth/login.js.map +2 -2
- package/dist/commands/auth/logout.js +4 -3
- package/dist/commands/auth/logout.js.map +1 -1
- package/dist/commands/auth/revoke-key.js +4 -3
- package/dist/commands/auth/revoke-key.js.map +1 -1
- package/dist/commands/auth/signup.js +13 -9
- package/dist/commands/auth/signup.js.map +2 -2
- package/dist/commands/auth/status.js +4 -3
- package/dist/commands/auth/status.js.map +1 -1
- package/dist/commands/catalog/index.js +4 -3
- package/dist/commands/catalog/index.js.map +1 -1
- package/dist/commands/catalog/recommend.js +4 -3
- package/dist/commands/catalog/recommend.js.map +1 -1
- package/dist/commands/convert.js +4 -3
- package/dist/commands/convert.js.map +1 -1
- package/dist/commands/converters.js +4 -3
- package/dist/commands/converters.js.map +1 -1
- package/dist/commands/crons/list.js +4 -3
- package/dist/commands/crons/list.js.map +1 -1
- package/dist/commands/crons/run.js +4 -3
- package/dist/commands/crons/run.js.map +1 -1
- package/dist/commands/dashboard.js +4 -3
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/diagnostics.js +117 -0
- package/dist/commands/diagnostics.js.map +7 -0
- package/dist/commands/eval-targets/create.js +4 -3
- package/dist/commands/eval-targets/create.js.map +1 -1
- package/dist/commands/eval-targets/list.js +4 -3
- package/dist/commands/eval-targets/list.js.map +1 -1
- package/dist/commands/evals/agent.js +41 -20
- package/dist/commands/evals/agent.js.map +2 -2
- package/dist/commands/evals/benchmark.js +5 -4
- package/dist/commands/evals/benchmark.js.map +1 -1
- package/dist/commands/evals/compare.js +4 -3
- package/dist/commands/evals/compare.js.map +1 -1
- package/dist/commands/evals/create.js +4 -3
- package/dist/commands/evals/create.js.map +1 -1
- package/dist/commands/evals/optimize-description.js +4 -3
- package/dist/commands/evals/optimize-description.js.map +1 -1
- package/dist/commands/evals/optimize.js +4 -3
- package/dist/commands/evals/optimize.js.map +1 -1
- package/dist/commands/evals/run.js +4 -3
- package/dist/commands/evals/run.js.map +1 -1
- package/dist/commands/gateway/ensure.js +75 -5
- package/dist/commands/gateway/ensure.js.map +2 -2
- package/dist/commands/hooks/install.js +76 -23
- package/dist/commands/hooks/install.js.map +2 -2
- package/dist/commands/hooks/run.js +4 -3
- package/dist/commands/hooks/run.js.map +1 -1
- package/dist/commands/hooks/uninstall.js +31 -40
- package/dist/commands/hooks/uninstall.js.map +2 -2
- package/dist/commands/import.js +4 -3
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/instructions/create.js +4 -3
- package/dist/commands/instructions/create.js.map +1 -1
- package/dist/commands/instructions/delete.js +4 -3
- package/dist/commands/instructions/delete.js.map +1 -1
- package/dist/commands/instructions/fork.js +4 -3
- package/dist/commands/instructions/fork.js.map +1 -1
- package/dist/commands/instructions/get.js +4 -3
- package/dist/commands/instructions/get.js.map +1 -1
- package/dist/commands/instructions/list.js +4 -3
- package/dist/commands/instructions/list.js.map +1 -1
- package/dist/commands/instructions/promote.js +4 -3
- package/dist/commands/instructions/promote.js.map +1 -1
- package/dist/commands/instructions/pull.js +4 -3
- package/dist/commands/instructions/pull.js.map +1 -1
- package/dist/commands/instructions/upstream.js +4 -3
- package/dist/commands/instructions/upstream.js.map +1 -1
- package/dist/commands/instructions/versions.js +4 -3
- package/dist/commands/instructions/versions.js.map +1 -1
- package/dist/commands/launcher.js +4 -3
- package/dist/commands/launcher.js.map +1 -1
- package/dist/commands/org/current.js +4 -3
- package/dist/commands/org/current.js.map +1 -1
- package/dist/commands/org/list.js +4 -3
- package/dist/commands/org/list.js.map +1 -1
- package/dist/commands/org/switch.js +4 -3
- package/dist/commands/org/switch.js.map +1 -1
- package/dist/commands/packs/add-instruction.js +4 -3
- package/dist/commands/packs/add-instruction.js.map +1 -1
- package/dist/commands/packs/apply.js +4 -3
- package/dist/commands/packs/apply.js.map +1 -1
- package/dist/commands/packs/create.js +4 -3
- package/dist/commands/packs/create.js.map +1 -1
- package/dist/commands/packs/fork.js +4 -3
- package/dist/commands/packs/fork.js.map +1 -1
- package/dist/commands/packs/get.js +4 -3
- package/dist/commands/packs/get.js.map +1 -1
- package/dist/commands/packs/list.js +4 -3
- package/dist/commands/packs/list.js.map +1 -1
- package/dist/commands/packs/remove-instruction.js +4 -3
- package/dist/commands/packs/remove-instruction.js.map +1 -1
- package/dist/commands/proxy/env.js +7 -4
- package/dist/commands/proxy/env.js.map +1 -1
- package/dist/commands/proxy/logs.js +4 -3
- package/dist/commands/proxy/logs.js.map +1 -1
- package/dist/commands/proxy/restart.js +4 -3
- package/dist/commands/proxy/restart.js.map +1 -1
- package/dist/commands/proxy/setup.js +20 -14
- package/dist/commands/proxy/setup.js.map +2 -2
- package/dist/commands/proxy/start.js +29 -15
- package/dist/commands/proxy/start.js.map +2 -2
- package/dist/commands/proxy/status.js +16 -13
- package/dist/commands/proxy/status.js.map +2 -2
- package/dist/commands/proxy/stop.js +21 -12
- package/dist/commands/proxy/stop.js.map +2 -2
- package/dist/commands/research/backfill.js +5 -4
- package/dist/commands/research/backfill.js.map +1 -1
- package/dist/commands/research/tail-transcript.js +5 -4
- package/dist/commands/research/tail-transcript.js.map +1 -1
- package/dist/commands/service/install.js +6 -6
- package/dist/commands/service/status.js +4 -3
- package/dist/commands/service/status.js.map +1 -1
- package/dist/commands/service/uninstall.js +4 -3
- package/dist/commands/service/uninstall.js.map +1 -1
- package/dist/commands/sessions/analyze.js +4 -3
- package/dist/commands/sessions/analyze.js.map +1 -1
- package/dist/commands/sessions/end.js +4 -3
- package/dist/commands/sessions/end.js.map +1 -1
- package/dist/commands/sessions/import.js +4 -3
- package/dist/commands/sessions/import.js.map +1 -1
- package/dist/commands/sessions/list.js +4 -3
- package/dist/commands/sessions/list.js.map +1 -1
- package/dist/commands/sessions/start.js +4 -3
- package/dist/commands/sessions/start.js.map +1 -1
- package/dist/commands/setup.js +10 -6
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/skills/export-approved.js +4 -3
- package/dist/commands/skills/export-approved.js.map +1 -1
- package/dist/commands/skills/install.js +4 -3
- package/dist/commands/skills/install.js.map +1 -1
- package/dist/commands/skills/list.js +4 -3
- package/dist/commands/skills/list.js.map +1 -1
- package/dist/commands/skills/publish.js +4 -3
- package/dist/commands/skills/publish.js.map +1 -1
- package/dist/commands/skills/search.js +4 -3
- package/dist/commands/skills/search.js.map +1 -1
- package/dist/commands/skills/update.js +4 -3
- package/dist/commands/skills/update.js.map +1 -1
- package/dist/commands/suggestions/accept.js +4 -3
- package/dist/commands/suggestions/accept.js.map +1 -1
- package/dist/commands/suggestions/dismiss.js +4 -3
- package/dist/commands/suggestions/dismiss.js.map +1 -1
- package/dist/commands/suggestions/list.js +4 -3
- package/dist/commands/suggestions/list.js.map +1 -1
- package/dist/commands/suggestions/refresh.js +4 -3
- package/dist/commands/suggestions/refresh.js.map +1 -1
- package/dist/dashboard/Dashboard.js +16 -16
- package/dist/dashboard/data.js +2 -2
- package/dist/dashboard/launcher/ActiveJobsList.js +2 -2
- package/dist/dashboard/launcher/LauncherOverlay.js +7 -7
- package/dist/dashboard/launcher/NewLaunchForm.js +2 -2
- package/dist/dashboard/launcher/api.js +2 -2
- package/dist/dashboard/launcher/useLaunchJobs.js +3 -3
- package/dist/lib/active-org-refresh.js +2 -2
- package/dist/lib/agent-loop.js +19 -17
- package/dist/lib/antigravity-transcript.js +2 -2
- package/dist/lib/api-client.js +1 -1
- package/dist/lib/capture-hosts.js +8 -0
- package/dist/lib/capture-hosts.js.map +7 -0
- package/dist/lib/diagnostics.js +12 -0
- package/dist/lib/diagnostics.js.map +7 -0
- package/dist/lib/editor-proxy-pins.js +14 -0
- package/dist/lib/editor-proxy-pins.js.map +7 -0
- package/dist/lib/ensure-api-key.js +3 -3
- package/dist/lib/eval-benchmark.js +2 -2
- package/dist/lib/eval-conversation-handler.js +2 -2
- package/dist/lib/gateway-entry.js +39 -1
- package/dist/lib/gateway-entry.js.map +2 -2
- package/dist/lib/gateway-identity.js +16 -0
- package/dist/lib/gateway-identity.js.map +7 -0
- package/dist/lib/gateway-lifecycle.js +9 -3
- package/dist/lib/gateway.js +3 -1
- package/dist/lib/handlers/cron-suggest-instructions.js +3 -3
- package/dist/lib/handlers/process-announcement.js +3 -3
- package/dist/lib/handlers/process-changelog.js +2 -2
- package/dist/lib/handlers/process-conversation.js +3 -3
- package/dist/lib/handlers/process-eval.js +2 -2
- package/dist/lib/handlers/process-insights.js +2 -2
- package/dist/lib/handlers/process-launch.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/hooks-config.js +18 -1
- package/dist/lib/manual-tasks.js +5 -5
- package/dist/lib/pid-identity.js +14 -0
- package/dist/lib/pid-identity.js.map +7 -0
- package/dist/lib/proxy-respawn.js +12 -0
- package/dist/lib/proxy-respawn.js.map +7 -0
- package/dist/lib/research-client.js +2 -2
- package/dist/lib/setup-steps.js +7 -4
- package/dist/lib/statusline-shim.js +3 -1
- package/dist/lib/telemetry.js +4 -2
- package/dist/lib/terminal-target-heartbeat.js +2 -2
- package/oclif.manifest.json +34 -1
- package/package.json +4 -4
- package/dist/chunk-6EMZI4Y3.js.map +0 -7
- package/dist/chunk-BBLTN35F.js.map +0 -7
- package/dist/chunk-DAJNO4OI.js.map +0 -7
- package/dist/chunk-PXVQLD7S.js.map +0 -7
- package/dist/chunk-SZ7VDCD6.js.map +0 -7
- package/dist/chunk-TX2HKJLA.js +0 -55
- package/dist/chunk-TX2HKJLA.js.map +0 -7
- package/dist/chunk-XN23W5HL.js.map +0 -7
- package/dist/chunk-XNNOXGP6.js.map +0 -7
- package/dist/chunk-ZRLYHBPN.js.map +0 -7
- /package/dist/{chunk-RUCSRN7F.js.map → chunk-2ORJWTNZ.js.map} +0 -0
- /package/dist/{chunk-SLL3OBKN.js.map → chunk-37LN5O7M.js.map} +0 -0
- /package/dist/{chunk-UPXIO7CG.js.map → chunk-4XAWK6S2.js.map} +0 -0
- /package/dist/{chunk-QD6X4L4L.js.map → chunk-5BAOGNUH.js.map} +0 -0
- /package/dist/{chunk-5ADHO5QF.js.map → chunk-6NBS5XFS.js.map} +0 -0
- /package/dist/{chunk-DTFXCHHI.js.map → chunk-DNKSVWMD.js.map} +0 -0
- /package/dist/{chunk-CNMWYYSV.js.map → chunk-DUJSRBLP.js.map} +0 -0
- /package/dist/{chunk-YSEQWCN4.js.map → chunk-EYPAAGN5.js.map} +0 -0
- /package/dist/{chunk-JEJ3J5J6.js.map → chunk-GIUBARWS.js.map} +0 -0
- /package/dist/{chunk-OTOWLUOJ.js.map → chunk-JULOLTZS.js.map} +0 -0
- /package/dist/{chunk-DR5WLIOU.js.map → chunk-KJKBDQ4D.js.map} +0 -0
- /package/dist/{chunk-N5A2IQAK.js.map → chunk-OK3I555A.js.map} +0 -0
- /package/dist/{chunk-AHDRN6NE.js.map → chunk-OO7JDFS4.js.map} +0 -0
- /package/dist/{chunk-3QH73QOQ.js.map → chunk-PED7L5GX.js.map} +0 -0
- /package/dist/{chunk-VBGUNFKY.js.map → chunk-PMI56ED5.js.map} +0 -0
- /package/dist/{chunk-RCMXTLQF.js.map → chunk-RMTT4KDY.js.map} +0 -0
- /package/dist/{chunk-W4MZXKZ2.js.map → chunk-UKMLICWS.js.map} +0 -0
- /package/dist/{chunk-3POYC5NA.js.map → chunk-XK42ZBDE.js.map} +0 -0
- /package/dist/{chunk-ZSGKRCKD.js.map → chunk-XUV6DDBF.js.map} +0 -0
- /package/dist/{chunk-LAKZUE35.js.map → chunk-Y3WD5CSW.js.map} +0 -0
- /package/dist/{chunk-3QVMIJUL.js.map → chunk-YOBA3NAM.js.map} +0 -0
|
@@ -480,137 +480,157 @@ var cliSetupEvents = pgTable15("cli_setup_events", {
|
|
|
480
480
|
index12("idx_cli_setup_events_device").on(table.deviceId, table.createdAt)
|
|
481
481
|
]);
|
|
482
482
|
|
|
483
|
-
// ../../packages/db/dist/schema/tables/
|
|
484
|
-
import { pgTable as pgTable16, text as text16, timestamp as timestamp16, jsonb as jsonb14, uuid as uuid16,
|
|
485
|
-
var
|
|
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({}),
|
|
493
|
-
version: integer7("version").notNull().default(1),
|
|
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()
|
|
497
|
-
}, (table) => [
|
|
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)
|
|
502
|
-
]);
|
|
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()
|
|
513
|
-
}, (table) => [
|
|
514
|
-
index13("idx_evals_target").on(table.evalTargetId)
|
|
515
|
-
]);
|
|
516
|
-
var evalRuns = pgTable16("eval_runs", {
|
|
483
|
+
// ../../packages/db/dist/schema/tables/cli-error-events.js
|
|
484
|
+
import { pgTable as pgTable16, text as text16, integer as integer7, boolean as boolean8, timestamp as timestamp16, jsonb as jsonb14, uuid as uuid16, index as index13 } from "drizzle-orm/pg-core";
|
|
485
|
+
var cliErrorEvents = pgTable16("cli_error_events", {
|
|
517
486
|
id: uuid16("id").primaryKey().defaultRandom(),
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
createdAt: timestamp16("created_at", { withTimezone: true }).defaultNow()
|
|
487
|
+
deviceId: text16("device_id"),
|
|
488
|
+
event: text16("event").notNull(),
|
|
489
|
+
command: text16("command"),
|
|
490
|
+
statusCode: integer7("status_code"),
|
|
491
|
+
message: text16("message"),
|
|
492
|
+
cliVersion: text16("cli_version"),
|
|
493
|
+
os: text16("os"),
|
|
494
|
+
nodeVersion: text16("node_version"),
|
|
495
|
+
proxied: boolean8("proxied"),
|
|
496
|
+
props: jsonb14("props").notNull().default({}),
|
|
497
|
+
createdAt: timestamp16("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
530
498
|
}, (table) => [
|
|
531
|
-
index13("
|
|
532
|
-
index13("
|
|
533
|
-
index13("idx_eval_runs_iteration").on(table.evalTargetId, table.iteration)
|
|
499
|
+
index13("idx_cli_error_events_created").on(table.createdAt),
|
|
500
|
+
index13("idx_cli_error_events_device").on(table.deviceId, table.createdAt)
|
|
534
501
|
]);
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
502
|
+
|
|
503
|
+
// ../../packages/db/dist/schema/tables/eval-targets.js
|
|
504
|
+
import { pgTable as pgTable17, text as text17, timestamp as timestamp17, jsonb as jsonb15, uuid as uuid17, integer as integer8, index as index14 } from "drizzle-orm/pg-core";
|
|
505
|
+
var evalTargets = pgTable17("eval_targets", {
|
|
506
|
+
id: uuid17("id").primaryKey().defaultRandom(),
|
|
507
|
+
userId: uuid17("user_id").notNull(),
|
|
508
|
+
name: text17("name").notNull(),
|
|
509
|
+
type: text17("type").notNull(),
|
|
510
|
+
content: text17("content").notNull(),
|
|
511
|
+
description: text17("description").notNull().default(""),
|
|
512
|
+
metadata: jsonb15("metadata").notNull().default({}),
|
|
513
|
+
version: integer8("version").notNull().default(1),
|
|
514
|
+
parentId: uuid17("parent_id").references(() => evalTargets.id, { onDelete: "set null" }),
|
|
515
|
+
createdAt: timestamp17("created_at", { withTimezone: true }).defaultNow(),
|
|
516
|
+
updatedAt: timestamp17("updated_at", { withTimezone: true }).defaultNow()
|
|
543
517
|
}, (table) => [
|
|
544
|
-
|
|
518
|
+
index14("eval_targets_name_user_idx").on(table.name, table.userId),
|
|
519
|
+
index14("idx_eval_targets_user").on(table.userId),
|
|
520
|
+
index14("idx_eval_targets_type").on(table.type),
|
|
521
|
+
index14("idx_eval_targets_parent").on(table.parentId)
|
|
545
522
|
]);
|
|
546
|
-
|
|
547
|
-
// ../../packages/db/dist/schema/tables/optimization.js
|
|
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", {
|
|
523
|
+
var evals = pgTable17("evals", {
|
|
550
524
|
id: uuid17("id").primaryKey().defaultRandom(),
|
|
551
525
|
evalTargetId: uuid17("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
526
|
+
name: text17("name").notNull(),
|
|
527
|
+
prompt: text17("prompt").notNull(),
|
|
528
|
+
expectedOutput: text17("expected_output").notNull().default(""),
|
|
529
|
+
files: jsonb15("files").notNull().default([]),
|
|
530
|
+
expectations: jsonb15("expectations").notNull().default([]),
|
|
557
531
|
createdAt: timestamp17("created_at", { withTimezone: true }).defaultNow(),
|
|
558
532
|
updatedAt: timestamp17("updated_at", { withTimezone: true }).defaultNow()
|
|
559
533
|
}, (table) => [
|
|
560
|
-
index14("
|
|
561
|
-
index14("idx_trigger_evals_user").on(table.userId)
|
|
534
|
+
index14("idx_evals_target").on(table.evalTargetId)
|
|
562
535
|
]);
|
|
563
|
-
var
|
|
536
|
+
var evalRuns = pgTable17("eval_runs", {
|
|
564
537
|
id: uuid17("id").primaryKey().defaultRandom(),
|
|
538
|
+
evalId: uuid17("eval_id").notNull().references(() => evals.id, { onDelete: "cascade" }),
|
|
565
539
|
evalTargetId: uuid17("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
540
|
+
evalTargetVersion: integer8("eval_target_version").notNull(),
|
|
541
|
+
configuration: text17("configuration").notNull(),
|
|
542
|
+
runNumber: integer8("run_number").notNull().default(1),
|
|
543
|
+
iteration: integer8("iteration").notNull().default(1),
|
|
544
|
+
status: text17("status").notNull().default("completed"),
|
|
545
|
+
outputs: jsonb15("outputs").notNull().default({}),
|
|
546
|
+
timing: jsonb15("timing").notNull().default({}),
|
|
547
|
+
grading: jsonb15("grading").notNull().default({}),
|
|
548
|
+
comparison: jsonb15("comparison"),
|
|
549
|
+
createdAt: timestamp17("created_at", { withTimezone: true }).defaultNow()
|
|
550
|
+
}, (table) => [
|
|
551
|
+
index14("idx_eval_runs_eval").on(table.evalId),
|
|
552
|
+
index14("idx_eval_runs_target").on(table.evalTargetId),
|
|
553
|
+
index14("idx_eval_runs_iteration").on(table.evalTargetId, table.iteration)
|
|
554
|
+
]);
|
|
555
|
+
var benchmarks = pgTable17("benchmarks", {
|
|
556
|
+
id: uuid17("id").primaryKey().defaultRandom(),
|
|
557
|
+
evalTargetId: uuid17("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
|
|
558
|
+
iteration: integer8("iteration").notNull().default(1),
|
|
559
|
+
runSummary: jsonb15("run_summary").notNull().default({}),
|
|
560
|
+
notes: jsonb15("notes").notNull().default([]),
|
|
561
|
+
feedback: jsonb15("feedback"),
|
|
562
|
+
createdAt: timestamp17("created_at", { withTimezone: true }).defaultNow()
|
|
563
|
+
}, (table) => [
|
|
564
|
+
index14("idx_benchmarks_target").on(table.evalTargetId)
|
|
565
|
+
]);
|
|
566
|
+
|
|
567
|
+
// ../../packages/db/dist/schema/tables/optimization.js
|
|
568
|
+
import { pgTable as pgTable18, text as text18, timestamp as timestamp18, jsonb as jsonb16, uuid as uuid18, integer as integer9, index as index15, real } from "drizzle-orm/pg-core";
|
|
569
|
+
var triggerEvals = pgTable18("trigger_evals", {
|
|
570
|
+
id: uuid18("id").primaryKey().defaultRandom(),
|
|
571
|
+
evalTargetId: uuid18("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
|
|
572
|
+
userId: uuid18("user_id").notNull(),
|
|
573
|
+
queries: jsonb16("queries").notNull().default([]),
|
|
574
|
+
status: text18("status").notNull().default("pending_review"),
|
|
575
|
+
trainIndices: integer9("train_indices").array().default([]),
|
|
576
|
+
testIndices: integer9("test_indices").array().default([]),
|
|
577
|
+
createdAt: timestamp18("created_at", { withTimezone: true }).defaultNow(),
|
|
578
|
+
updatedAt: timestamp18("updated_at", { withTimezone: true }).defaultNow()
|
|
579
|
+
}, (table) => [
|
|
580
|
+
index15("idx_trigger_evals_target").on(table.evalTargetId),
|
|
581
|
+
index15("idx_trigger_evals_user").on(table.userId)
|
|
582
|
+
]);
|
|
583
|
+
var optimizationRuns = pgTable18("optimization_runs", {
|
|
584
|
+
id: uuid18("id").primaryKey().defaultRandom(),
|
|
585
|
+
evalTargetId: uuid18("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
|
|
586
|
+
userId: uuid18("user_id").notNull(),
|
|
587
|
+
type: text18("type").notNull(),
|
|
588
|
+
iteration: integer9("iteration").notNull(),
|
|
589
|
+
inputVersion: integer9("input_version").notNull(),
|
|
590
|
+
outputVersion: integer9("output_version"),
|
|
571
591
|
trainScore: real("train_score"),
|
|
572
592
|
testScore: real("test_score"),
|
|
573
|
-
analysis:
|
|
574
|
-
status:
|
|
575
|
-
createdAt:
|
|
593
|
+
analysis: jsonb16("analysis").notNull().default({}),
|
|
594
|
+
status: text18("status").notNull().default("running"),
|
|
595
|
+
createdAt: timestamp18("created_at", { withTimezone: true }).defaultNow()
|
|
576
596
|
}, (table) => [
|
|
577
|
-
|
|
578
|
-
|
|
597
|
+
index15("idx_optimization_runs_target").on(table.evalTargetId),
|
|
598
|
+
index15("idx_optimization_runs_user").on(table.userId)
|
|
579
599
|
]);
|
|
580
600
|
|
|
581
601
|
// ../../packages/db/dist/schema/tables/context-snapshots.js
|
|
582
|
-
import { pgTable as
|
|
583
|
-
var contextSnapshots =
|
|
584
|
-
id:
|
|
585
|
-
sessionId:
|
|
586
|
-
userId:
|
|
587
|
-
sequence:
|
|
588
|
-
provider:
|
|
589
|
-
model:
|
|
590
|
-
systemPrompt:
|
|
591
|
-
injectedInstructions:
|
|
592
|
-
messagesSummary:
|
|
593
|
-
tools:
|
|
602
|
+
import { pgTable as pgTable19, text as text19, timestamp as timestamp19, jsonb as jsonb17, uuid as uuid19, integer as integer10, real as real2, index as index16, uniqueIndex as uniqueIndex7 } from "drizzle-orm/pg-core";
|
|
603
|
+
var contextSnapshots = pgTable19("context_snapshots", {
|
|
604
|
+
id: uuid19("id").primaryKey().defaultRandom(),
|
|
605
|
+
sessionId: uuid19("session_id").references(() => sessions.id, { onDelete: "cascade" }),
|
|
606
|
+
userId: uuid19("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
|
|
607
|
+
sequence: integer10("sequence").notNull().default(0),
|
|
608
|
+
provider: text19("provider").notNull(),
|
|
609
|
+
model: text19("model").notNull(),
|
|
610
|
+
systemPrompt: text19("system_prompt").notNull(),
|
|
611
|
+
injectedInstructions: jsonb17("injected_instructions").notNull().default([]),
|
|
612
|
+
messagesSummary: jsonb17("messages_summary").notNull(),
|
|
613
|
+
tools: jsonb17("tools").notNull().default([]),
|
|
594
614
|
// Deprecated: use content_blobs via tools_hash
|
|
595
|
-
systemHash:
|
|
596
|
-
requestHash:
|
|
597
|
-
toolsHash:
|
|
598
|
-
injectedHash:
|
|
599
|
-
messagesDelta:
|
|
615
|
+
systemHash: text19("system_hash").notNull(),
|
|
616
|
+
requestHash: text19("request_hash").notNull().default(""),
|
|
617
|
+
toolsHash: text19("tools_hash"),
|
|
618
|
+
injectedHash: text19("injected_hash"),
|
|
619
|
+
messagesDelta: jsonb17("messages_delta").default([]),
|
|
600
620
|
// Storage pointer set when messages_delta is offloaded to the snapshot-deltas
|
|
601
621
|
// bucket (Stage 1+). NULL = inline (messages_delta populated) OR pruned (both
|
|
602
622
|
// NULL — see 00101). docs/plans/2026-06-24-messages-delta-object-storage-offload.md
|
|
603
|
-
messagesDeltaRef:
|
|
604
|
-
maxTokens:
|
|
623
|
+
messagesDeltaRef: text19("messages_delta_ref"),
|
|
624
|
+
maxTokens: integer10("max_tokens"),
|
|
605
625
|
temperature: real2("temperature"),
|
|
606
|
-
estimatedTokens:
|
|
607
|
-
capturedAt:
|
|
608
|
-
metadata:
|
|
626
|
+
estimatedTokens: integer10("estimated_tokens"),
|
|
627
|
+
capturedAt: timestamp19("captured_at", { withTimezone: true }).notNull().defaultNow(),
|
|
628
|
+
metadata: jsonb17("metadata").default({})
|
|
609
629
|
}, (table) => [
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
630
|
+
index16("idx_context_snapshots_session").on(table.sessionId),
|
|
631
|
+
index16("idx_context_snapshots_user").on(table.userId),
|
|
632
|
+
index16("idx_context_snapshots_hash").on(table.systemHash),
|
|
633
|
+
index16("idx_context_snapshots_request_hash").on(table.requestHash),
|
|
614
634
|
uniqueIndex7("idx_snapshots_session_request").on(table.sessionId, table.requestHash),
|
|
615
635
|
// Concurrent snapshot POSTs for one session must not reuse a sequence — stops
|
|
616
636
|
// the live duplicate-sequence corruption. Built via migration 00095.
|
|
@@ -620,416 +640,416 @@ var contextSnapshots = pgTable18("context_snapshots", {
|
|
|
620
640
|
// WHERE user_id ORDER BY session_id, captured_at DESC). Matches the ORDER BY so
|
|
621
641
|
// the planner drops the Incremental Sort (the ~11s-max, temp-spill-prone step);
|
|
622
642
|
// verified 60.6ms -> 26.3ms. Built CONCURRENTLY via migration 00106.
|
|
623
|
-
|
|
643
|
+
index16("idx_context_snapshots_user_session_captured").on(table.userId, table.sessionId, table.capturedAt.desc())
|
|
624
644
|
]);
|
|
625
645
|
|
|
626
646
|
// ../../packages/db/dist/schema/tables/content-blobs.js
|
|
627
|
-
import { pgTable as
|
|
628
|
-
var contentBlobs =
|
|
629
|
-
hash:
|
|
630
|
-
contentType:
|
|
631
|
-
content:
|
|
632
|
-
sizeBytes:
|
|
633
|
-
createdAt:
|
|
647
|
+
import { pgTable as pgTable20, text as text20, timestamp as timestamp20, jsonb as jsonb18, integer as integer11, index as index17 } from "drizzle-orm/pg-core";
|
|
648
|
+
var contentBlobs = pgTable20("content_blobs", {
|
|
649
|
+
hash: text20("hash").primaryKey(),
|
|
650
|
+
contentType: text20("content_type").notNull(),
|
|
651
|
+
content: jsonb18("content").notNull(),
|
|
652
|
+
sizeBytes: integer11("size_bytes").notNull().default(0),
|
|
653
|
+
createdAt: timestamp20("created_at", { withTimezone: true }).defaultNow()
|
|
634
654
|
}, (table) => [
|
|
635
|
-
|
|
655
|
+
index17("idx_content_blobs_type").on(table.contentType)
|
|
636
656
|
]);
|
|
637
657
|
|
|
638
658
|
// ../../packages/db/dist/schema/tables/eval-jobs.js
|
|
639
|
-
import { pgTable as
|
|
640
|
-
var evalJobs =
|
|
641
|
-
id: uuid19("id").primaryKey().defaultRandom(),
|
|
642
|
-
userId: uuid19("user_id").notNull(),
|
|
643
|
-
evalTargetId: uuid19("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
|
|
644
|
-
status: text20("status").notNull().default("pending"),
|
|
645
|
-
config: jsonb18("config").notNull().default({}),
|
|
646
|
-
progress: jsonb18("progress").notNull().default({}),
|
|
647
|
-
result: jsonb18("result"),
|
|
648
|
-
error: text20("error"),
|
|
649
|
-
attempts: integer11("attempts").notNull().default(0),
|
|
650
|
-
graphileJobId: bigint2("graphile_job_id", { mode: "number" }),
|
|
651
|
-
taskKind: text20("task_kind"),
|
|
652
|
-
payload: jsonb18("payload"),
|
|
653
|
-
claimedBy: text20("claimed_by"),
|
|
654
|
-
claimedAt: timestamp20("claimed_at", { withTimezone: true }),
|
|
655
|
-
leaseExpiresAt: timestamp20("lease_expires_at", { withTimezone: true }),
|
|
656
|
-
createdAt: timestamp20("created_at", { withTimezone: true }).defaultNow(),
|
|
657
|
-
updatedAt: timestamp20("updated_at", { withTimezone: true }).defaultNow(),
|
|
658
|
-
completedAt: timestamp20("completed_at", { withTimezone: true })
|
|
659
|
-
}, (table) => [
|
|
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)
|
|
664
|
-
]);
|
|
665
|
-
|
|
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", {
|
|
659
|
+
import { pgTable as pgTable21, text as text21, timestamp as timestamp21, jsonb as jsonb19, uuid as uuid20, index as index18, integer as integer12, bigint as bigint2 } from "drizzle-orm/pg-core";
|
|
660
|
+
var evalJobs = pgTable21("eval_jobs", {
|
|
669
661
|
id: uuid20("id").primaryKey().defaultRandom(),
|
|
670
662
|
userId: uuid20("user_id").notNull(),
|
|
671
|
-
|
|
663
|
+
evalTargetId: uuid20("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
|
|
672
664
|
status: text21("status").notNull().default("pending"),
|
|
673
|
-
|
|
674
|
-
|
|
665
|
+
config: jsonb19("config").notNull().default({}),
|
|
666
|
+
progress: jsonb19("progress").notNull().default({}),
|
|
675
667
|
result: jsonb19("result"),
|
|
676
668
|
error: text21("error"),
|
|
677
669
|
attempts: integer12("attempts").notNull().default(0),
|
|
670
|
+
graphileJobId: bigint2("graphile_job_id", { mode: "number" }),
|
|
671
|
+
taskKind: text21("task_kind"),
|
|
672
|
+
payload: jsonb19("payload"),
|
|
678
673
|
claimedBy: text21("claimed_by"),
|
|
679
674
|
claimedAt: timestamp21("claimed_at", { withTimezone: true }),
|
|
680
675
|
leaseExpiresAt: timestamp21("lease_expires_at", { withTimezone: true }),
|
|
681
|
-
createdAt: timestamp21("created_at", { withTimezone: true }).
|
|
682
|
-
updatedAt: timestamp21("updated_at", { withTimezone: true }).
|
|
676
|
+
createdAt: timestamp21("created_at", { withTimezone: true }).defaultNow(),
|
|
677
|
+
updatedAt: timestamp21("updated_at", { withTimezone: true }).defaultNow(),
|
|
683
678
|
completedAt: timestamp21("completed_at", { withTimezone: true })
|
|
684
679
|
}, (table) => [
|
|
685
|
-
index18("
|
|
686
|
-
index18("
|
|
680
|
+
index18("idx_eval_jobs_user").on(table.userId),
|
|
681
|
+
index18("idx_eval_jobs_target").on(table.evalTargetId),
|
|
682
|
+
index18("idx_eval_jobs_status").on(table.status),
|
|
683
|
+
index18("idx_eval_jobs_pending").on(table.userId, table.status)
|
|
687
684
|
]);
|
|
688
685
|
|
|
689
|
-
// ../../packages/db/dist/schema/tables/
|
|
690
|
-
import { pgTable as pgTable22, text as text22, timestamp as timestamp22, jsonb as jsonb20, uuid as uuid21,
|
|
691
|
-
var
|
|
686
|
+
// ../../packages/db/dist/schema/tables/agent-jobs.js
|
|
687
|
+
import { pgTable as pgTable22, text as text22, timestamp as timestamp22, jsonb as jsonb20, uuid as uuid21, integer as integer13, index as index19 } from "drizzle-orm/pg-core";
|
|
688
|
+
var agentJobs = pgTable22("agent_jobs", {
|
|
692
689
|
id: uuid21("id").primaryKey().defaultRandom(),
|
|
693
690
|
userId: uuid21("user_id").notNull(),
|
|
691
|
+
taskKind: text22("task_kind").notNull(),
|
|
694
692
|
status: text22("status").notNull().default("pending"),
|
|
695
|
-
|
|
696
|
-
|
|
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({}),
|
|
693
|
+
payload: jsonb20("payload").notNull(),
|
|
694
|
+
dedupeKey: text22("dedupe_key"),
|
|
702
695
|
result: jsonb20("result"),
|
|
703
696
|
error: text22("error"),
|
|
704
697
|
attempts: integer13("attempts").notNull().default(0),
|
|
705
|
-
graphileJobId: bigint3("graphile_job_id", { mode: "number" }),
|
|
706
|
-
taskKind: text22("task_kind"),
|
|
707
|
-
payload: jsonb20("payload"),
|
|
708
698
|
claimedBy: text22("claimed_by"),
|
|
709
699
|
claimedAt: timestamp22("claimed_at", { withTimezone: true }),
|
|
710
700
|
leaseExpiresAt: timestamp22("lease_expires_at", { withTimezone: true }),
|
|
711
|
-
createdAt: timestamp22("created_at", { withTimezone: true }).defaultNow(),
|
|
712
|
-
updatedAt: timestamp22("updated_at", { withTimezone: true }).defaultNow(),
|
|
701
|
+
createdAt: timestamp22("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
702
|
+
updatedAt: timestamp22("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
713
703
|
completedAt: timestamp22("completed_at", { withTimezone: true })
|
|
714
704
|
}, (table) => [
|
|
715
|
-
index19("
|
|
716
|
-
index19("
|
|
717
|
-
index19("idx_insights_jobs_pending").on(table.userId, table.status),
|
|
718
|
-
index19("idx_insights_jobs_project").on(table.projectId)
|
|
705
|
+
index19("idx_agent_jobs_claim").on(table.userId, table.status, table.taskKind, table.createdAt),
|
|
706
|
+
index19("idx_agent_jobs_dedupe").on(table.userId, table.taskKind, table.dedupeKey)
|
|
719
707
|
]);
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
708
|
+
|
|
709
|
+
// ../../packages/db/dist/schema/tables/insights.js
|
|
710
|
+
import { pgTable as pgTable23, text as text23, timestamp as timestamp23, jsonb as jsonb21, uuid as uuid22, index as index20, uniqueIndex as uniqueIndex8, integer as integer14, bigint as bigint3 } from "drizzle-orm/pg-core";
|
|
711
|
+
var insightsJobs = pgTable23("insights_jobs", {
|
|
712
|
+
id: uuid22("id").primaryKey().defaultRandom(),
|
|
713
|
+
userId: uuid22("user_id").notNull(),
|
|
714
|
+
status: text23("status").notNull().default("pending"),
|
|
715
|
+
projectPath: text23("project_path"),
|
|
716
|
+
// Canonical project identity (project_path-keying fragments one project across
|
|
717
|
+
// worktrees/subdirs/cwds — migration 00104). Nullable: legacy/unlinked rows fall
|
|
718
|
+
// back to project_path. Stamped at enqueue when resolvable.
|
|
719
|
+
projectId: uuid22("project_id").references(() => projects.id, { onDelete: "set null" }),
|
|
720
|
+
config: jsonb21("config").notNull().default({}),
|
|
721
|
+
progress: jsonb21("progress").notNull().default({}),
|
|
722
|
+
result: jsonb21("result"),
|
|
723
|
+
error: text23("error"),
|
|
724
|
+
attempts: integer14("attempts").notNull().default(0),
|
|
725
|
+
graphileJobId: bigint3("graphile_job_id", { mode: "number" }),
|
|
726
|
+
taskKind: text23("task_kind"),
|
|
727
|
+
payload: jsonb21("payload"),
|
|
728
|
+
claimedBy: text23("claimed_by"),
|
|
729
|
+
claimedAt: timestamp23("claimed_at", { withTimezone: true }),
|
|
730
|
+
leaseExpiresAt: timestamp23("lease_expires_at", { withTimezone: true }),
|
|
731
|
+
createdAt: timestamp23("created_at", { withTimezone: true }).defaultNow(),
|
|
732
|
+
updatedAt: timestamp23("updated_at", { withTimezone: true }).defaultNow(),
|
|
733
|
+
completedAt: timestamp23("completed_at", { withTimezone: true })
|
|
727
734
|
}, (table) => [
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
735
|
+
index20("idx_insights_jobs_user").on(table.userId),
|
|
736
|
+
index20("idx_insights_jobs_status").on(table.status),
|
|
737
|
+
index20("idx_insights_jobs_pending").on(table.userId, table.status),
|
|
738
|
+
index20("idx_insights_jobs_project").on(table.projectId)
|
|
731
739
|
]);
|
|
732
|
-
|
|
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", {
|
|
740
|
+
var insightsReports = pgTable23("insights_reports", {
|
|
736
741
|
id: uuid22("id").primaryKey().defaultRandom(),
|
|
737
|
-
userId: uuid22("user_id").notNull()
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
lastUsedAt: timestamp23("last_used_at", { withTimezone: true }),
|
|
742
|
-
expiresAt: timestamp23("expires_at", { withTimezone: true }),
|
|
743
|
-
revokedAt: timestamp23("revoked_at", { withTimezone: true }),
|
|
742
|
+
userId: uuid22("user_id").notNull(),
|
|
743
|
+
projectPath: text23("project_path"),
|
|
744
|
+
data: jsonb21("data").notNull(),
|
|
745
|
+
reportHtml: text23("report_html"),
|
|
744
746
|
createdAt: timestamp23("created_at", { withTimezone: true }).defaultNow()
|
|
745
747
|
}, (table) => [
|
|
746
|
-
index20("
|
|
747
|
-
|
|
748
|
+
index20("idx_insights_user").on(table.userId),
|
|
749
|
+
index20("idx_insights_created").on(table.createdAt),
|
|
750
|
+
uniqueIndex8("idx_insights_user_project").on(table.userId, table.projectPath)
|
|
748
751
|
]);
|
|
749
752
|
|
|
750
|
-
// ../../packages/db/dist/schema/tables/
|
|
751
|
-
import { pgTable as pgTable24, text as text24, timestamp as timestamp24, uuid as uuid23, index as index21 } from "drizzle-orm/pg-core";
|
|
752
|
-
var
|
|
753
|
-
|
|
753
|
+
// ../../packages/db/dist/schema/tables/api-keys.js
|
|
754
|
+
import { pgTable as pgTable24, text as text24, timestamp as timestamp24, uuid as uuid23, index as index21, uniqueIndex as uniqueIndex9 } from "drizzle-orm/pg-core";
|
|
755
|
+
var apiKeys = pgTable24("api_keys", {
|
|
756
|
+
id: uuid23("id").primaryKey().defaultRandom(),
|
|
754
757
|
userId: uuid23("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
+
name: text24("name").notNull(),
|
|
759
|
+
keyHash: text24("key_hash").notNull(),
|
|
760
|
+
keyPrefix: text24("key_prefix").notNull(),
|
|
761
|
+
lastUsedAt: timestamp24("last_used_at", { withTimezone: true }),
|
|
762
|
+
expiresAt: timestamp24("expires_at", { withTimezone: true }),
|
|
763
|
+
revokedAt: timestamp24("revoked_at", { withTimezone: true }),
|
|
758
764
|
createdAt: timestamp24("created_at", { withTimezone: true }).defaultNow()
|
|
759
765
|
}, (table) => [
|
|
760
|
-
index21("
|
|
766
|
+
index21("idx_api_keys_user").on(table.userId),
|
|
767
|
+
uniqueIndex9("idx_api_keys_hash").on(table.keyHash)
|
|
761
768
|
]);
|
|
762
769
|
|
|
763
|
-
// ../../packages/db/dist/schema/tables/
|
|
764
|
-
import { pgTable as pgTable25, text as text25, timestamp as timestamp25,
|
|
765
|
-
var
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
createdAt: timestamp25("created_at", { withTimezone: true }).defaultNow()
|
|
772
|
-
updatedAt: timestamp25("updated_at", { withTimezone: true }).defaultNow()
|
|
770
|
+
// ../../packages/db/dist/schema/tables/extension-auth-codes.js
|
|
771
|
+
import { pgTable as pgTable25, text as text25, timestamp as timestamp25, uuid as uuid24, index as index22 } from "drizzle-orm/pg-core";
|
|
772
|
+
var extensionAuthCodes = pgTable25("extension_auth_codes", {
|
|
773
|
+
code: text25("code").primaryKey(),
|
|
774
|
+
userId: uuid24("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
|
|
775
|
+
editor: text25("editor"),
|
|
776
|
+
email: text25("email"),
|
|
777
|
+
expiresAt: timestamp25("expires_at", { withTimezone: true }).notNull(),
|
|
778
|
+
createdAt: timestamp25("created_at", { withTimezone: true }).defaultNow()
|
|
773
779
|
}, (table) => [
|
|
774
|
-
index22("
|
|
775
|
-
index22("idx_eval_conversations_user").on(table.userId)
|
|
780
|
+
index22("idx_ext_auth_codes_expiry").on(table.expiresAt)
|
|
776
781
|
]);
|
|
777
782
|
|
|
778
|
-
// ../../packages/db/dist/schema/tables/
|
|
779
|
-
import { pgTable as pgTable26,
|
|
780
|
-
var
|
|
783
|
+
// ../../packages/db/dist/schema/tables/eval-conversations.js
|
|
784
|
+
import { pgTable as pgTable26, text as text26, timestamp as timestamp26, jsonb as jsonb22, uuid as uuid25, index as index23 } from "drizzle-orm/pg-core";
|
|
785
|
+
var evalConversations = pgTable26("eval_conversations", {
|
|
781
786
|
id: uuid25("id").primaryKey().defaultRandom(),
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
userId: uuid25("user_id"),
|
|
789
|
-
details: jsonb22("details").notNull().default({}),
|
|
790
|
-
createdAt: timestamp26("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
787
|
+
evalTargetId: uuid25("eval_target_id").notNull().references(() => evalTargets.id, { onDelete: "cascade" }),
|
|
788
|
+
userId: uuid25("user_id").notNull(),
|
|
789
|
+
messages: jsonb22("messages").notNull().default([]),
|
|
790
|
+
status: text26("status").notNull().default("active"),
|
|
791
|
+
createdAt: timestamp26("created_at", { withTimezone: true }).defaultNow(),
|
|
792
|
+
updatedAt: timestamp26("updated_at", { withTimezone: true }).defaultNow()
|
|
791
793
|
}, (table) => [
|
|
792
|
-
index23("
|
|
793
|
-
index23("
|
|
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)
|
|
794
|
+
index23("idx_eval_conversations_target").on(table.evalTargetId),
|
|
795
|
+
index23("idx_eval_conversations_user").on(table.userId)
|
|
797
796
|
]);
|
|
798
797
|
|
|
799
|
-
// ../../packages/db/dist/schema/tables/
|
|
800
|
-
import { pgTable as pgTable27, text as text27,
|
|
801
|
-
var
|
|
798
|
+
// ../../packages/db/dist/schema/tables/security-events.js
|
|
799
|
+
import { pgTable as pgTable27, uuid as uuid26, text as text27, jsonb as jsonb23, timestamp as timestamp27, index as index24 } from "drizzle-orm/pg-core";
|
|
800
|
+
var securityEvents = pgTable27("security_events", {
|
|
802
801
|
id: uuid26("id").primaryKey().defaultRandom(),
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
802
|
+
eventType: text27("event_type").notNull(),
|
|
803
|
+
severity: text27("severity").notNull(),
|
|
804
|
+
category: text27("category").notNull(),
|
|
805
|
+
source: text27("source").notNull(),
|
|
806
|
+
entityType: text27("entity_type"),
|
|
807
|
+
entityId: uuid26("entity_id"),
|
|
808
|
+
userId: uuid26("user_id"),
|
|
809
|
+
details: jsonb23("details").notNull().default({}),
|
|
810
|
+
createdAt: timestamp27("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
809
811
|
}, (table) => [
|
|
810
|
-
index24("
|
|
811
|
-
index24("
|
|
812
|
+
index24("idx_security_events_type").on(table.eventType),
|
|
813
|
+
index24("idx_security_events_user").on(table.userId),
|
|
814
|
+
index24("idx_security_events_created").on(table.createdAt),
|
|
815
|
+
index24("idx_security_events_severity").on(table.severity),
|
|
816
|
+
index24("idx_security_events_source").on(table.source)
|
|
812
817
|
]);
|
|
813
818
|
|
|
814
|
-
// ../../packages/db/dist/schema/tables/
|
|
815
|
-
import { pgTable as pgTable28, text as text28, timestamp as timestamp28,
|
|
816
|
-
var
|
|
819
|
+
// ../../packages/db/dist/schema/tables/tasks.js
|
|
820
|
+
import { pgTable as pgTable28, text as text28, timestamp as timestamp28, uuid as uuid27, index as index25 } from "drizzle-orm/pg-core";
|
|
821
|
+
var tasks = pgTable28("tasks", {
|
|
817
822
|
id: uuid27("id").primaryKey().defaultRandom(),
|
|
818
|
-
|
|
819
|
-
|
|
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(),
|
|
823
|
+
title: text28("title").notNull(),
|
|
824
|
+
description: text28("description"),
|
|
825
825
|
status: text28("status").notNull().default("pending"),
|
|
826
|
-
|
|
827
|
-
submittedBy: uuid27("submitted_by").notNull(),
|
|
828
|
-
reviewedBy: uuid27("reviewed_by"),
|
|
829
|
-
reviewNote: text28("review_note"),
|
|
830
|
-
metadata: jsonb23("metadata"),
|
|
826
|
+
createdBy: uuid27("created_by"),
|
|
831
827
|
createdAt: timestamp28("created_at", { withTimezone: true }).defaultNow(),
|
|
832
828
|
updatedAt: timestamp28("updated_at", { withTimezone: true }).defaultNow()
|
|
829
|
+
}, (table) => [
|
|
830
|
+
index25("tasks_created_by_idx").on(table.createdBy),
|
|
831
|
+
index25("tasks_status_idx").on(table.status)
|
|
832
|
+
]);
|
|
833
|
+
|
|
834
|
+
// ../../packages/db/dist/schema/tables/skill-submissions.js
|
|
835
|
+
import { pgTable as pgTable29, text as text29, timestamp as timestamp29, jsonb as jsonb24, uuid as uuid28 } from "drizzle-orm/pg-core";
|
|
836
|
+
var skillSubmissions = pgTable29("skill_submissions", {
|
|
837
|
+
id: uuid28("id").primaryKey().defaultRandom(),
|
|
838
|
+
skillId: text29("skill_id").notNull(),
|
|
839
|
+
name: text29("name").notNull(),
|
|
840
|
+
description: text29("description").notNull(),
|
|
841
|
+
category: text29("category").notNull(),
|
|
842
|
+
tools: text29("tools").array().notNull(),
|
|
843
|
+
tags: text29("tags").array().default([]),
|
|
844
|
+
content: text29("content").notNull(),
|
|
845
|
+
status: text29("status").notNull().default("pending"),
|
|
846
|
+
// pending | approved | rejected
|
|
847
|
+
submittedBy: uuid28("submitted_by").notNull(),
|
|
848
|
+
reviewedBy: uuid28("reviewed_by"),
|
|
849
|
+
reviewNote: text29("review_note"),
|
|
850
|
+
metadata: jsonb24("metadata"),
|
|
851
|
+
createdAt: timestamp29("created_at", { withTimezone: true }).defaultNow(),
|
|
852
|
+
updatedAt: timestamp29("updated_at", { withTimezone: true }).defaultNow()
|
|
833
853
|
});
|
|
834
854
|
|
|
835
855
|
// ../../packages/db/dist/schema/tables/harness-releases.js
|
|
836
|
-
import { pgTable as
|
|
837
|
-
var harnessReleases =
|
|
838
|
-
id:
|
|
839
|
-
harness:
|
|
856
|
+
import { pgTable as pgTable30, text as text30, timestamp as timestamp30, jsonb as jsonb25, uuid as uuid29, uniqueIndex as uniqueIndex10, index as index26 } from "drizzle-orm/pg-core";
|
|
857
|
+
var harnessReleases = pgTable30("harness_releases", {
|
|
858
|
+
id: uuid29("id").primaryKey().defaultRandom(),
|
|
859
|
+
harness: text30("harness").notNull(),
|
|
840
860
|
// "claude_code", "cursor", "copilot"
|
|
841
|
-
version:
|
|
861
|
+
version: text30("version").notNull(),
|
|
842
862
|
// "v2.1.119"
|
|
843
|
-
publishedAt:
|
|
844
|
-
title:
|
|
863
|
+
publishedAt: timestamp30("published_at", { withTimezone: true }).notNull(),
|
|
864
|
+
title: text30("title"),
|
|
845
865
|
// release name
|
|
846
|
-
body:
|
|
866
|
+
body: text30("body"),
|
|
847
867
|
// raw markdown
|
|
848
|
-
categories:
|
|
868
|
+
categories: jsonb25("categories").default({}),
|
|
849
869
|
// { features: string[], fixes: string[], security: string[] }
|
|
850
|
-
url:
|
|
870
|
+
url: text30("url"),
|
|
851
871
|
// link to release page
|
|
852
|
-
createdAt:
|
|
872
|
+
createdAt: timestamp30("created_at", { withTimezone: true }).defaultNow()
|
|
853
873
|
}, (table) => [
|
|
854
874
|
uniqueIndex10("idx_harness_releases_unique").on(table.harness, table.version),
|
|
855
|
-
|
|
856
|
-
|
|
875
|
+
index26("idx_harness_releases_harness").on(table.harness),
|
|
876
|
+
index26("idx_harness_releases_published").on(table.publishedAt)
|
|
857
877
|
]);
|
|
858
878
|
|
|
859
879
|
// ../../packages/db/dist/schema/tables/notifications.js
|
|
860
|
-
import { pgTable as
|
|
861
|
-
var notifications =
|
|
862
|
-
id:
|
|
863
|
-
userId:
|
|
864
|
-
type:
|
|
865
|
-
title:
|
|
866
|
-
body:
|
|
867
|
-
url:
|
|
868
|
-
sourceTable:
|
|
869
|
-
sourceId:
|
|
870
|
-
metadata:
|
|
871
|
-
readAt:
|
|
872
|
-
createdAt:
|
|
880
|
+
import { pgTable as pgTable31, text as text31, timestamp as timestamp31, jsonb as jsonb26, uuid as uuid30, index as index27, uniqueIndex as uniqueIndex11 } from "drizzle-orm/pg-core";
|
|
881
|
+
var notifications = pgTable31("notifications", {
|
|
882
|
+
id: uuid30("id").primaryKey().defaultRandom(),
|
|
883
|
+
userId: uuid30("user_id").notNull(),
|
|
884
|
+
type: text31("type").notNull(),
|
|
885
|
+
title: text31("title").notNull(),
|
|
886
|
+
body: text31("body"),
|
|
887
|
+
url: text31("url"),
|
|
888
|
+
sourceTable: text31("source_table"),
|
|
889
|
+
sourceId: text31("source_id"),
|
|
890
|
+
metadata: jsonb26("metadata").notNull().default({}),
|
|
891
|
+
readAt: timestamp31("read_at", { withTimezone: true }),
|
|
892
|
+
createdAt: timestamp31("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
873
893
|
}, (table) => [
|
|
874
|
-
|
|
875
|
-
|
|
894
|
+
index27("idx_notifications_user_created").on(table.userId, table.createdAt),
|
|
895
|
+
index27("idx_notifications_user_unread").on(table.userId),
|
|
876
896
|
uniqueIndex11("idx_notifications_source_dedup").on(table.userId, table.sourceTable, table.sourceId)
|
|
877
897
|
]);
|
|
878
898
|
|
|
879
899
|
// ../../packages/db/dist/schema/tables/launch-jobs.js
|
|
880
|
-
import { pgTable as
|
|
881
|
-
var launchJobs =
|
|
882
|
-
id:
|
|
883
|
-
userId:
|
|
884
|
-
tool:
|
|
885
|
-
status:
|
|
886
|
-
config:
|
|
887
|
-
result:
|
|
888
|
-
error:
|
|
889
|
-
attempts:
|
|
900
|
+
import { pgTable as pgTable32, text as text32, timestamp as timestamp32, jsonb as jsonb27, uuid as uuid31, index as index28, integer as integer15, bigint as bigint4 } from "drizzle-orm/pg-core";
|
|
901
|
+
var launchJobs = pgTable32("launch_jobs", {
|
|
902
|
+
id: uuid31("id").primaryKey().defaultRandom(),
|
|
903
|
+
userId: uuid31("user_id").notNull(),
|
|
904
|
+
tool: text32("tool").notNull(),
|
|
905
|
+
status: text32("status").notNull().default("pending"),
|
|
906
|
+
config: jsonb27("config").notNull().default({}),
|
|
907
|
+
result: jsonb27("result"),
|
|
908
|
+
error: text32("error"),
|
|
909
|
+
attempts: integer15("attempts").notNull().default(0),
|
|
890
910
|
graphileJobId: bigint4("graphile_job_id", { mode: "number" }),
|
|
891
|
-
taskKind:
|
|
892
|
-
payload:
|
|
893
|
-
claimedBy:
|
|
894
|
-
claimedAt:
|
|
895
|
-
leaseExpiresAt:
|
|
896
|
-
createdAt:
|
|
897
|
-
updatedAt:
|
|
898
|
-
completedAt:
|
|
899
|
-
runId:
|
|
911
|
+
taskKind: text32("task_kind"),
|
|
912
|
+
payload: jsonb27("payload"),
|
|
913
|
+
claimedBy: text32("claimed_by"),
|
|
914
|
+
claimedAt: timestamp32("claimed_at", { withTimezone: true }),
|
|
915
|
+
leaseExpiresAt: timestamp32("lease_expires_at", { withTimezone: true }),
|
|
916
|
+
createdAt: timestamp32("created_at", { withTimezone: true }).defaultNow(),
|
|
917
|
+
updatedAt: timestamp32("updated_at", { withTimezone: true }).defaultNow(),
|
|
918
|
+
completedAt: timestamp32("completed_at", { withTimezone: true }),
|
|
919
|
+
runId: uuid31("run_id").references(() => agentRuns.id, { onDelete: "set null" })
|
|
900
920
|
}, (table) => [
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
921
|
+
index28("idx_launch_jobs_user").on(table.userId),
|
|
922
|
+
index28("idx_launch_jobs_status").on(table.status),
|
|
923
|
+
index28("idx_launch_jobs_pending").on(table.userId, table.status),
|
|
924
|
+
index28("idx_launch_jobs_run").on(table.runId)
|
|
905
925
|
]);
|
|
906
926
|
|
|
907
927
|
// ../../packages/db/dist/schema/tables/instruction-suggestions.js
|
|
908
|
-
import { pgTable as
|
|
909
|
-
var instructionSuggestions =
|
|
910
|
-
id:
|
|
911
|
-
userId:
|
|
912
|
-
instructionId:
|
|
913
|
-
projectPath:
|
|
928
|
+
import { pgTable as pgTable33, uuid as uuid32, text as text33, real as real3, timestamp as timestamp33, boolean as boolean9, uniqueIndex as uniqueIndex12, index as index29 } from "drizzle-orm/pg-core";
|
|
929
|
+
var instructionSuggestions = pgTable33("instruction_suggestions", {
|
|
930
|
+
id: uuid32("id").primaryKey().defaultRandom(),
|
|
931
|
+
userId: uuid32("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
|
|
932
|
+
instructionId: uuid32("instruction_id").notNull().references(() => instructions.id, { onDelete: "cascade" }),
|
|
933
|
+
projectPath: text33("project_path").notNull(),
|
|
914
934
|
// Canonical project identity (migration 00104). Additive + nullable; the
|
|
915
935
|
// unique index below stays on project_path (NOT NULL) so upserts are
|
|
916
936
|
// unchanged. Readers prefer project_id to aggregate across path variants.
|
|
917
|
-
projectId:
|
|
937
|
+
projectId: uuid32("project_id").references(() => projects.id, { onDelete: "set null" }),
|
|
918
938
|
score: real3("score").notNull(),
|
|
919
|
-
reason:
|
|
920
|
-
generatedAt:
|
|
921
|
-
isStale:
|
|
922
|
-
dismissedAt:
|
|
923
|
-
acceptedAt:
|
|
924
|
-
promotedToInstructionId:
|
|
939
|
+
reason: text33("reason").notNull(),
|
|
940
|
+
generatedAt: timestamp33("generated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
941
|
+
isStale: boolean9("is_stale").notNull().default(false),
|
|
942
|
+
dismissedAt: timestamp33("dismissed_at", { withTimezone: true }),
|
|
943
|
+
acceptedAt: timestamp33("accepted_at", { withTimezone: true }),
|
|
944
|
+
promotedToInstructionId: uuid32("promoted_to_instruction_id").references(() => instructions.id, { onDelete: "set null" })
|
|
925
945
|
}, (table) => [
|
|
926
946
|
uniqueIndex12("idx_instruction_suggestions_user_project_instruction").on(table.userId, table.projectPath, table.instructionId),
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
947
|
+
index29("idx_instruction_suggestions_user_project").on(table.userId, table.projectPath),
|
|
948
|
+
index29("idx_instruction_suggestions_user_proj_id").on(table.userId, table.projectId),
|
|
949
|
+
index29("idx_instruction_suggestions_generated_at").on(table.generatedAt)
|
|
930
950
|
]);
|
|
931
|
-
var instructionSuggestionEvents =
|
|
932
|
-
id:
|
|
933
|
-
suggestionId:
|
|
934
|
-
userId:
|
|
935
|
-
eventType:
|
|
936
|
-
tool:
|
|
937
|
-
sessionId:
|
|
938
|
-
projectPath:
|
|
939
|
-
createdAt:
|
|
951
|
+
var instructionSuggestionEvents = pgTable33("instruction_suggestion_events", {
|
|
952
|
+
id: uuid32("id").primaryKey().defaultRandom(),
|
|
953
|
+
suggestionId: uuid32("suggestion_id").notNull().references(() => instructionSuggestions.id, { onDelete: "cascade" }),
|
|
954
|
+
userId: uuid32("user_id").notNull().references(() => profiles.id, { onDelete: "cascade" }),
|
|
955
|
+
eventType: text33("event_type").notNull(),
|
|
956
|
+
tool: text33("tool"),
|
|
957
|
+
sessionId: uuid32("session_id"),
|
|
958
|
+
projectPath: text33("project_path").notNull(),
|
|
959
|
+
createdAt: timestamp33("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
940
960
|
}, (table) => [
|
|
941
|
-
|
|
942
|
-
|
|
961
|
+
index29("idx_instruction_suggestion_events_suggestion_id").on(table.suggestionId),
|
|
962
|
+
index29("idx_instruction_suggestion_events_user_id").on(table.userId)
|
|
943
963
|
]);
|
|
944
964
|
|
|
945
965
|
// ../../packages/db/dist/schema/tables/model-pricing.js
|
|
946
|
-
import { pgTable as
|
|
947
|
-
var modelPricing =
|
|
948
|
-
provider:
|
|
949
|
-
modelId:
|
|
966
|
+
import { pgTable as pgTable34, text as text34, integer as integer16, numeric, timestamp as timestamp34, index as index30, primaryKey as primaryKey4 } from "drizzle-orm/pg-core";
|
|
967
|
+
var modelPricing = pgTable34("model_pricing", {
|
|
968
|
+
provider: text34("provider").notNull(),
|
|
969
|
+
modelId: text34("model_id").notNull(),
|
|
950
970
|
inputPerM: numeric("input_per_m").notNull(),
|
|
951
971
|
outputPerM: numeric("output_per_m").notNull(),
|
|
952
972
|
cacheReadPerM: numeric("cache_read_per_m").notNull(),
|
|
953
973
|
cacheWrite5mPerM: numeric("cache_write_5m_per_m").notNull(),
|
|
954
974
|
cacheWrite1hPerM: numeric("cache_write_1h_per_m").notNull(),
|
|
955
|
-
contextWindow:
|
|
956
|
-
effectiveFrom:
|
|
957
|
-
effectiveUntil:
|
|
958
|
-
source:
|
|
975
|
+
contextWindow: integer16("context_window"),
|
|
976
|
+
effectiveFrom: timestamp34("effective_from", { withTimezone: true }).notNull(),
|
|
977
|
+
effectiveUntil: timestamp34("effective_until", { withTimezone: true }),
|
|
978
|
+
source: text34("source").notNull()
|
|
959
979
|
}, (table) => [
|
|
960
980
|
primaryKey4({ columns: [table.provider, table.modelId, table.effectiveFrom] }),
|
|
961
|
-
|
|
981
|
+
index30("idx_model_pricing_active").on(table.provider, table.modelId, table.effectiveFrom.desc())
|
|
962
982
|
]);
|
|
963
983
|
|
|
964
984
|
// ../../packages/db/dist/schema/tables/limit-observations.js
|
|
965
|
-
import { pgTable as
|
|
966
|
-
var limitObservations =
|
|
967
|
-
id:
|
|
968
|
-
observedAt:
|
|
969
|
-
provider:
|
|
970
|
-
plan:
|
|
971
|
-
limitType:
|
|
985
|
+
import { pgTable as pgTable35, text as text35, numeric as numeric2, timestamp as timestamp35, uuid as uuid33, jsonb as jsonb28, index as index31 } from "drizzle-orm/pg-core";
|
|
986
|
+
var limitObservations = pgTable35("limit_observations", {
|
|
987
|
+
id: uuid33("id").primaryKey().defaultRandom(),
|
|
988
|
+
observedAt: timestamp35("observed_at", { withTimezone: true }).notNull().defaultNow(),
|
|
989
|
+
provider: text35("provider").notNull(),
|
|
990
|
+
plan: text35("plan").notNull(),
|
|
991
|
+
limitType: text35("limit_type").notNull(),
|
|
972
992
|
value: numeric2("value").notNull(),
|
|
973
|
-
unit:
|
|
974
|
-
comparator:
|
|
975
|
-
resetsAt:
|
|
976
|
-
sourceType:
|
|
977
|
-
sourceUrl:
|
|
978
|
-
sourceEvidence:
|
|
993
|
+
unit: text35("unit").notNull(),
|
|
994
|
+
comparator: text35("comparator").notNull().default("="),
|
|
995
|
+
resetsAt: timestamp35("resets_at", { withTimezone: true }),
|
|
996
|
+
sourceType: text35("source_type").notNull(),
|
|
997
|
+
sourceUrl: text35("source_url"),
|
|
998
|
+
sourceEvidence: jsonb28("source_evidence"),
|
|
979
999
|
confidence: numeric2("confidence").notNull(),
|
|
980
|
-
userId:
|
|
1000
|
+
userId: uuid33("user_id")
|
|
981
1001
|
}, (table) => [
|
|
982
|
-
|
|
983
|
-
|
|
1002
|
+
index31("idx_limit_obs_lookup").on(table.provider, table.plan, table.limitType, table.observedAt.desc()),
|
|
1003
|
+
index31("idx_limit_obs_user").on(table.userId, table.observedAt.desc())
|
|
984
1004
|
]);
|
|
985
1005
|
|
|
986
1006
|
// ../../packages/db/dist/schema/tables/provider-docs-snapshots.js
|
|
987
|
-
import { pgTable as
|
|
988
|
-
var providerDocsSnapshots =
|
|
989
|
-
id:
|
|
990
|
-
fetchedAt:
|
|
991
|
-
provider:
|
|
992
|
-
docUrl:
|
|
993
|
-
contentHash:
|
|
994
|
-
content:
|
|
995
|
-
parseSuccess:
|
|
996
|
-
parseErrors:
|
|
1007
|
+
import { pgTable as pgTable36, text as text36, timestamp as timestamp36, uuid as uuid34, jsonb as jsonb29, boolean as boolean10, uniqueIndex as uniqueIndex13 } from "drizzle-orm/pg-core";
|
|
1008
|
+
var providerDocsSnapshots = pgTable36("provider_docs_snapshots", {
|
|
1009
|
+
id: uuid34("id").primaryKey().defaultRandom(),
|
|
1010
|
+
fetchedAt: timestamp36("fetched_at", { withTimezone: true }).notNull().defaultNow(),
|
|
1011
|
+
provider: text36("provider").notNull(),
|
|
1012
|
+
docUrl: text36("doc_url").notNull(),
|
|
1013
|
+
contentHash: text36("content_hash").notNull(),
|
|
1014
|
+
content: text36("content").notNull(),
|
|
1015
|
+
parseSuccess: boolean10("parse_success").notNull(),
|
|
1016
|
+
parseErrors: jsonb29("parse_errors")
|
|
997
1017
|
}, (table) => [
|
|
998
1018
|
uniqueIndex13("idx_docs_dedup").on(table.provider, table.docUrl, table.contentHash)
|
|
999
1019
|
]);
|
|
1000
1020
|
|
|
1001
1021
|
// ../../packages/db/dist/schema/tables/plan-limits-active.js
|
|
1002
|
-
import { pgTable as
|
|
1003
|
-
var planLimitsActive =
|
|
1004
|
-
provider:
|
|
1005
|
-
plan:
|
|
1006
|
-
limitType:
|
|
1022
|
+
import { pgTable as pgTable37, text as text37, numeric as numeric3, timestamp as timestamp37, uuid as uuid35, primaryKey as primaryKey5, index as index32 } from "drizzle-orm/pg-core";
|
|
1023
|
+
var planLimitsActive = pgTable37("plan_limits_active", {
|
|
1024
|
+
provider: text37("provider").notNull(),
|
|
1025
|
+
plan: text37("plan").notNull(),
|
|
1026
|
+
limitType: text37("limit_type").notNull(),
|
|
1007
1027
|
value: numeric3("value").notNull(),
|
|
1008
|
-
unit:
|
|
1009
|
-
effectiveFrom:
|
|
1010
|
-
effectiveUntil:
|
|
1028
|
+
unit: text37("unit").notNull(),
|
|
1029
|
+
effectiveFrom: timestamp37("effective_from", { withTimezone: true }).notNull(),
|
|
1030
|
+
effectiveUntil: timestamp37("effective_until", { withTimezone: true }),
|
|
1011
1031
|
confidence: numeric3("confidence").notNull(),
|
|
1012
|
-
sourceObservationIds:
|
|
1032
|
+
sourceObservationIds: uuid35("source_observation_ids").array().notNull()
|
|
1013
1033
|
}, (table) => [
|
|
1014
1034
|
primaryKey5({ columns: [table.provider, table.plan, table.limitType, table.effectiveFrom] }),
|
|
1015
|
-
|
|
1035
|
+
index32("idx_plan_limits_lookup").on(table.provider, table.plan, table.limitType, table.effectiveFrom.desc())
|
|
1016
1036
|
]);
|
|
1017
1037
|
|
|
1018
1038
|
// ../../packages/db/dist/schema/tables/alert-dispatches.js
|
|
1019
|
-
import { pgTable as
|
|
1020
|
-
var alertDispatches =
|
|
1021
|
-
id:
|
|
1022
|
-
userId:
|
|
1023
|
-
alertKey:
|
|
1039
|
+
import { pgTable as pgTable38, text as text38, timestamp as timestamp38, uuid as uuid36, jsonb as jsonb30, index as index33 } from "drizzle-orm/pg-core";
|
|
1040
|
+
var alertDispatches = pgTable38("alert_dispatches", {
|
|
1041
|
+
id: uuid36("id").primaryKey().defaultRandom(),
|
|
1042
|
+
userId: uuid36("user_id").notNull(),
|
|
1043
|
+
alertKey: text38("alert_key").notNull(),
|
|
1024
1044
|
// 'soft' | 'approaching' | 'imminent' | 'hit'
|
|
1025
|
-
severity:
|
|
1026
|
-
lastDispatchedAt:
|
|
1045
|
+
severity: text38("severity").notNull(),
|
|
1046
|
+
lastDispatchedAt: timestamp38("last_dispatched_at", { withTimezone: true }).notNull().defaultNow(),
|
|
1027
1047
|
// { used_percentage, resets_at, ... } — snapshot of the input that fired this alert.
|
|
1028
|
-
lastState:
|
|
1048
|
+
lastState: jsonb30("last_state").notNull(),
|
|
1029
1049
|
// 'in_app' | 'vscode' | 'banner'
|
|
1030
|
-
channel:
|
|
1050
|
+
channel: text38("channel").notNull()
|
|
1031
1051
|
}, (table) => [
|
|
1032
|
-
|
|
1052
|
+
index33("idx_alert_user_key").on(table.userId, table.alertKey, table.lastDispatchedAt.desc())
|
|
1033
1053
|
]);
|
|
1034
1054
|
|
|
1035
1055
|
// ../../packages/db/dist/client.js
|
|
@@ -1049,6 +1069,7 @@ __export(schema_exports, {
|
|
|
1049
1069
|
apiKeysRelations: () => apiKeysRelations,
|
|
1050
1070
|
benchmarks: () => benchmarks,
|
|
1051
1071
|
benchmarksRelations: () => benchmarksRelations,
|
|
1072
|
+
cliErrorEvents: () => cliErrorEvents,
|
|
1052
1073
|
cliSetupEvents: () => cliSetupEvents,
|
|
1053
1074
|
contentBlobs: () => contentBlobs,
|
|
1054
1075
|
contextSnapshots: () => contextSnapshots,
|
|
@@ -1371,6 +1392,8 @@ var contextSnapshotsRelations = relations(contextSnapshots, ({ one }) => ({
|
|
|
1371
1392
|
// ../../packages/db/dist/db-load.js
|
|
1372
1393
|
var _inFlight = 0;
|
|
1373
1394
|
var _peak = 0;
|
|
1395
|
+
var _heavyInFlight = 0;
|
|
1396
|
+
var _heavyPeak = 0;
|
|
1374
1397
|
function trackDbOpStart() {
|
|
1375
1398
|
_inFlight++;
|
|
1376
1399
|
if (_inFlight > _peak)
|
|
@@ -1380,6 +1403,15 @@ function trackDbOpEnd() {
|
|
|
1380
1403
|
if (_inFlight > 0)
|
|
1381
1404
|
_inFlight--;
|
|
1382
1405
|
}
|
|
1406
|
+
function trackHeavyDbOpStart() {
|
|
1407
|
+
_heavyInFlight++;
|
|
1408
|
+
if (_heavyInFlight > _heavyPeak)
|
|
1409
|
+
_heavyPeak = _heavyInFlight;
|
|
1410
|
+
}
|
|
1411
|
+
function trackHeavyDbOpEnd() {
|
|
1412
|
+
if (_heavyInFlight > 0)
|
|
1413
|
+
_heavyInFlight--;
|
|
1414
|
+
}
|
|
1383
1415
|
|
|
1384
1416
|
// ../../packages/db/dist/client.js
|
|
1385
1417
|
var _db;
|
|
@@ -1548,7 +1580,7 @@ var READ_ONLY_ENTRY_METHODS = /* @__PURE__ */ new Set([
|
|
|
1548
1580
|
"selectDistinctOn",
|
|
1549
1581
|
"$count"
|
|
1550
1582
|
]);
|
|
1551
|
-
function wrapBuilder(value, readSafe = false, deadlineMs = 0) {
|
|
1583
|
+
function wrapBuilder(value, readSafe = false, deadlineMs = 0, heavyPool = false) {
|
|
1552
1584
|
if (value === null || typeof value !== "object" && typeof value !== "function") {
|
|
1553
1585
|
return value;
|
|
1554
1586
|
}
|
|
@@ -1559,26 +1591,30 @@ function wrapBuilder(value, readSafe = false, deadlineMs = 0) {
|
|
|
1559
1591
|
if (typeof then !== "function")
|
|
1560
1592
|
return then;
|
|
1561
1593
|
return (onFulfilled, onRejected) => {
|
|
1562
|
-
trackDbOpStart
|
|
1594
|
+
const opStart = heavyPool ? trackHeavyDbOpStart : trackDbOpStart;
|
|
1595
|
+
const opEnd = heavyPool ? trackHeavyDbOpEnd : trackDbOpEnd;
|
|
1596
|
+
opStart();
|
|
1563
1597
|
const exec = withDbRetry(() => new Promise((resolve, reject) => then.call(target, resolve, reject)), { retryResets: readSafe });
|
|
1564
1598
|
const guarded = deadlineMs > 0 ? raceWithDeadline(exec, deadlineMs) : exec;
|
|
1565
|
-
return guarded.finally(
|
|
1599
|
+
return guarded.finally(opEnd).then(onFulfilled, onRejected);
|
|
1566
1600
|
};
|
|
1567
1601
|
}
|
|
1568
1602
|
const v = Reflect.get(target, prop, receiver);
|
|
1569
1603
|
if (typeof v === "function") {
|
|
1570
|
-
return (...args) => wrapBuilder(v.apply(target, args), readSafe, deadlineMs);
|
|
1604
|
+
return (...args) => wrapBuilder(v.apply(target, args), readSafe, deadlineMs, heavyPool);
|
|
1571
1605
|
}
|
|
1572
1606
|
return v;
|
|
1573
1607
|
}
|
|
1574
1608
|
});
|
|
1575
1609
|
}
|
|
1576
|
-
function gaugeTransaction(run) {
|
|
1577
|
-
trackDbOpStart
|
|
1610
|
+
function gaugeTransaction(run, heavyPool = false) {
|
|
1611
|
+
const opStart = heavyPool ? trackHeavyDbOpStart : trackDbOpStart;
|
|
1612
|
+
const opEnd = heavyPool ? trackHeavyDbOpEnd : trackDbOpEnd;
|
|
1613
|
+
opStart();
|
|
1578
1614
|
try {
|
|
1579
|
-
return Promise.resolve(run()).finally(
|
|
1615
|
+
return Promise.resolve(run()).finally(opEnd);
|
|
1580
1616
|
} catch (err) {
|
|
1581
|
-
|
|
1617
|
+
opEnd();
|
|
1582
1618
|
throw err;
|
|
1583
1619
|
}
|
|
1584
1620
|
}
|
|
@@ -1603,10 +1639,10 @@ var heavyDb = new Proxy({}, {
|
|
|
1603
1639
|
const value = real4[prop];
|
|
1604
1640
|
if (typeof prop === "string" && RETRY_ENTRY_METHODS.has(prop) && typeof value === "function") {
|
|
1605
1641
|
const readSafe = READ_ONLY_ENTRY_METHODS.has(prop);
|
|
1606
|
-
return (...args) => wrapBuilder(value.apply(real4, args), readSafe);
|
|
1642
|
+
return (...args) => wrapBuilder(value.apply(real4, args), readSafe, 0, true);
|
|
1607
1643
|
}
|
|
1608
1644
|
if (prop === "transaction" && typeof value === "function") {
|
|
1609
|
-
return (...args) => gaugeTransaction(() => value.apply(real4, args));
|
|
1645
|
+
return (...args) => gaugeTransaction(() => value.apply(real4, args), true);
|
|
1610
1646
|
}
|
|
1611
1647
|
return value;
|
|
1612
1648
|
}
|
|
@@ -1623,4 +1659,4 @@ export {
|
|
|
1623
1659
|
getDb,
|
|
1624
1660
|
closeDb
|
|
1625
1661
|
};
|
|
1626
|
-
//# sourceMappingURL=chunk-
|
|
1662
|
+
//# sourceMappingURL=chunk-EI5BHWXA.js.map
|