@ainyc/canonry 1.48.4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/assets/index.html CHANGED
@@ -12,8 +12,8 @@
12
12
  <link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
13
13
  <link rel="apple-touch-icon" href="./apple-touch-icon.png" />
14
14
  <title>Canonry</title>
15
- <script type="module" crossorigin src="./assets/index-CVk23m8J.js"></script>
16
- <link rel="stylesheet" crossorigin href="./assets/index--ev1Bjls.css">
15
+ <script type="module" crossorigin src="./assets/index-DnlDoqE-.js"></script>
16
+ <link rel="stylesheet" crossorigin href="./assets/index-yF1fs-OW.css">
17
17
  </head>
18
18
  <body>
19
19
  <div id="root"></div>
@@ -16,6 +16,7 @@ import { drizzle } from "drizzle-orm/better-sqlite3";
16
16
  // ../db/src/schema.ts
17
17
  var schema_exports = {};
18
18
  __export(schema_exports, {
19
+ agentSessions: () => agentSessions,
19
20
  apiKeys: () => apiKeys,
20
21
  auditLog: () => auditLog,
21
22
  bingConnections: () => bingConnections,
@@ -410,6 +411,20 @@ var healthSnapshots = sqliteTable("health_snapshots", {
410
411
  index("idx_health_snapshots_run").on(table.runId),
411
412
  index("idx_health_snapshots_created").on(table.createdAt)
412
413
  ]);
414
+ var agentSessions = sqliteTable("agent_sessions", {
415
+ id: text("id").primaryKey(),
416
+ projectId: text("project_id").notNull().unique().references(() => projects.id, { onDelete: "cascade" }),
417
+ systemPrompt: text("system_prompt").notNull(),
418
+ modelProvider: text("model_provider").notNull(),
419
+ modelId: text("model_id").notNull(),
420
+ messages: text("messages").notNull().default("[]"),
421
+ followUpQueue: text("follow_up_queue").notNull().default("[]"),
422
+ createdAt: text("created_at").notNull(),
423
+ updatedAt: text("updated_at").notNull()
424
+ }, (table) => [
425
+ index("idx_agent_sessions_project").on(table.projectId),
426
+ index("idx_agent_sessions_updated").on(table.updatedAt)
427
+ ]);
413
428
 
414
429
  // ../db/src/client.ts
415
430
  function createClient(databasePath) {
@@ -851,7 +866,7 @@ var MIGRATIONS = [
851
866
  `DROP INDEX IF EXISTS idx_bing_coverage_snap_project_date`,
852
867
  `CREATE UNIQUE INDEX IF NOT EXISTS idx_bing_coverage_snap_project_date_unique ON bing_coverage_snapshots(project_id, date)`,
853
868
  // v35: Add missing index for query_snapshots createdAt for time-series filtering
854
- `CREATE INDEX IF NOT EXISTS idx_snapshots_created_at ON query_snapshots(created_at)`
869
+ `CREATE INDEX IF NOT EXISTS idx_snapshots_created_at ON query_snapshots(created_at)`,
855
870
  // v36: Transaction handling and SQL injection review: verified all strings use SQLite ? binding via Drizzle.
856
871
  // No changes required for parameterization.
857
872
  // v37: The legacy credential columns (private_key on ga_connections; access_token,
@@ -860,6 +875,26 @@ var MIGRATIONS = [
860
875
  // read the rows, persist them to config.yaml, and only then drop the columns
861
876
  // so a failed config write doesn't permanently lose credentials. Keeping the
862
877
  // DROPs as raw SQL here would race with that read.
878
+ // v38: Aero session registry — one rolling session per project.
879
+ `CREATE TABLE IF NOT EXISTS agent_sessions (
880
+ id TEXT PRIMARY KEY,
881
+ project_id TEXT NOT NULL UNIQUE REFERENCES projects(id) ON DELETE CASCADE,
882
+ system_prompt TEXT NOT NULL,
883
+ model_provider TEXT NOT NULL,
884
+ model_id TEXT NOT NULL,
885
+ messages TEXT NOT NULL DEFAULT '[]',
886
+ follow_up_queue TEXT NOT NULL DEFAULT '[]',
887
+ created_at TEXT NOT NULL,
888
+ updated_at TEXT NOT NULL
889
+ )`,
890
+ `CREATE INDEX IF NOT EXISTS idx_agent_sessions_project ON agent_sessions(project_id)`,
891
+ `CREATE INDEX IF NOT EXISTS idx_agent_sessions_updated ON agent_sessions(updated_at)`,
892
+ // v39: Align Aero provider IDs with sweep naming — anthropic→claude, google→gemini.
893
+ // Old rows predating the rename would fail to rehydrate because the canonical
894
+ // registry no longer recognizes 'anthropic'/'google'. Safe to re-run: the
895
+ // UPDATE is a no-op once the rename has been applied.
896
+ `UPDATE agent_sessions SET model_provider = 'claude' WHERE model_provider = 'anthropic'`,
897
+ `UPDATE agent_sessions SET model_provider = 'gemini' WHERE model_provider = 'google'`
863
898
  ];
864
899
  function isDuplicateColumnError(err) {
865
900
  if (!(err instanceof Error)) return false;
@@ -1389,6 +1424,7 @@ export {
1389
1424
  usageCounters,
1390
1425
  insights,
1391
1426
  healthSnapshots,
1427
+ agentSessions,
1392
1428
  createClient,
1393
1429
  parseJsonColumn,
1394
1430
  extractLegacyCredentials,