@signetai/connector-claude-code 0.216.7 → 0.217.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +601 -23
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -16153,6 +16153,241 @@ function up145(db) {
16153
16153
  ON dreaming_evidence_reviews (agent_id, reviewed_at DESC);
16154
16154
  `);
16155
16155
  }
16156
+ function up146(db) {
16157
+ db.exec(`
16158
+ CREATE TABLE IF NOT EXISTS source_import_jobs (
16159
+ id TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK (kind = 'import'), agent_id TEXT NOT NULL,
16160
+ schema_id TEXT NOT NULL, adapter_version INTEGER NOT NULL CHECK (adapter_version = 1),
16161
+ state TEXT NOT NULL CHECK (state IN ('staging','inventorying','queued','running','paused','completed','completed_with_rejections','cancelled','failed')),
16162
+ control_request TEXT CHECK (control_request IN ('pause','resume','retry','cancel') OR control_request IS NULL),
16163
+ generation INTEGER NOT NULL DEFAULT 0, total INTEGER NOT NULL DEFAULT 0, imported INTEGER NOT NULL DEFAULT 0,
16164
+ duplicate INTEGER NOT NULL DEFAULT 0, rejected INTEGER NOT NULL DEFAULT 0, pending INTEGER NOT NULL DEFAULT 0,
16165
+ lease_token TEXT, lease_expires_at TEXT, error TEXT, created_at TEXT NOT NULL DEFAULT (datetime('now')),
16166
+ updated_at TEXT NOT NULL DEFAULT (datetime('now')), started_at TEXT, completed_at TEXT, reconciled_at TEXT
16167
+ );
16168
+ CREATE INDEX IF NOT EXISTS idx_source_import_jobs_agent_state ON source_import_jobs(agent_id, state);
16169
+
16170
+ CREATE TABLE IF NOT EXISTS source_import_files (
16171
+ id TEXT PRIMARY KEY, job_id TEXT NOT NULL REFERENCES source_import_jobs(id) ON DELETE CASCADE,
16172
+ source_id TEXT NOT NULL, agent_id TEXT NOT NULL, ordinal INTEGER NOT NULL, name TEXT NOT NULL,
16173
+ managed_path TEXT NOT NULL, size_bytes INTEGER NOT NULL DEFAULT 0, content_hash TEXT,
16174
+ state TEXT NOT NULL CHECK (state IN ('staging','ready','inventorying','completed','failed')),
16175
+ record_count INTEGER NOT NULL DEFAULT 0, blank_count INTEGER NOT NULL DEFAULT 0, malformed_count INTEGER NOT NULL DEFAULT 0,
16176
+ inventory_version INTEGER NOT NULL DEFAULT 1, checkpoint_ordinal INTEGER NOT NULL DEFAULT 0,
16177
+ checkpoint_byte_offset INTEGER NOT NULL DEFAULT 0, created_at TEXT NOT NULL DEFAULT (datetime('now')), updated_at TEXT NOT NULL DEFAULT (datetime('now')),
16178
+ UNIQUE(job_id, ordinal)
16179
+ );
16180
+ CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state);
16181
+
16182
+ CREATE TABLE IF NOT EXISTS source_import_records (
16183
+ id TEXT PRIMARY KEY, job_id TEXT NOT NULL REFERENCES source_import_jobs(id) ON DELETE CASCADE,
16184
+ file_id TEXT NOT NULL REFERENCES source_import_files(id) ON DELETE CASCADE, source_id TEXT NOT NULL, agent_id TEXT NOT NULL,
16185
+ ordinal INTEGER NOT NULL, line_number INTEGER NOT NULL, byte_offset INTEGER NOT NULL, byte_length INTEGER NOT NULL,
16186
+ raw_hash TEXT NOT NULL, external_identity TEXT, conversation_fingerprint TEXT, status TEXT NOT NULL CHECK (status IN ('pending','imported','duplicate','rejected','cancelled')),
16187
+ canonical_id TEXT, canonical_key TEXT, rejection_code TEXT, attempt_count INTEGER NOT NULL DEFAULT 0,
16188
+ created_at TEXT NOT NULL DEFAULT (datetime('now')), updated_at TEXT NOT NULL DEFAULT (datetime('now')),
16189
+ UNIQUE(file_id, ordinal), UNIQUE(file_id, byte_offset)
16190
+ );
16191
+ CREATE INDEX IF NOT EXISTS idx_source_import_records_job_status ON source_import_records(job_id, status);
16192
+ CREATE INDEX IF NOT EXISTS idx_source_import_records_source_status ON source_import_records(agent_id, source_id, status);
16193
+
16194
+ CREATE TABLE IF NOT EXISTS transcript_import_conversations (
16195
+ agent_id TEXT NOT NULL, external_identity TEXT NOT NULL, canonical_key TEXT NOT NULL,
16196
+ conversation_fingerprint TEXT NOT NULL, canonical_id TEXT NOT NULL, owner_source_id TEXT NOT NULL,
16197
+ owner_record_id TEXT NOT NULL, state TEXT NOT NULL CHECK (state IN ('committing','committed','removed')),
16198
+ content_hash TEXT NOT NULL, harness TEXT NOT NULL, timestamp TEXT NOT NULL,
16199
+ created_at TEXT NOT NULL DEFAULT (datetime('now')), updated_at TEXT NOT NULL DEFAULT (datetime('now')),
16200
+ PRIMARY KEY (agent_id, external_identity), UNIQUE(agent_id, canonical_key)
16201
+ );
16202
+ CREATE INDEX IF NOT EXISTS idx_transcript_import_conversations_source ON transcript_import_conversations(agent_id, owner_source_id);
16203
+
16204
+ CREATE TABLE IF NOT EXISTS source_import_record_attempts (
16205
+ id INTEGER PRIMARY KEY AUTOINCREMENT, agent_id TEXT NOT NULL, job_id TEXT NOT NULL, file_id TEXT NOT NULL,
16206
+ record_id TEXT NOT NULL, generation INTEGER NOT NULL, outcome TEXT NOT NULL, error_code TEXT, created_at TEXT NOT NULL DEFAULT (datetime('now'))
16207
+ );
16208
+ CREATE INDEX IF NOT EXISTS idx_source_import_attempts_record ON source_import_record_attempts(agent_id, record_id, created_at);
16209
+ `);
16210
+ for (const column of ["source_id", "source_record_id", "source_meta_json"]) {
16211
+ const exists = db.prepare("SELECT 1 AS found FROM pragma_table_info('session_transcripts') WHERE name = ?").get(column);
16212
+ if (exists == null)
16213
+ db.exec(`ALTER TABLE session_transcripts ADD COLUMN ${column} TEXT`);
16214
+ }
16215
+ db.exec("CREATE INDEX IF NOT EXISTS idx_session_transcripts_agent_source ON session_transcripts(agent_id, source_id)");
16216
+ }
16217
+ function up147(db) {
16218
+ db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
16219
+ }
16220
+ function up148(db) {
16221
+ const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
16222
+ if (!columns.some((column) => column.name === "source_id")) {
16223
+ db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
16224
+ }
16225
+ }
16226
+ function up149(db) {
16227
+ const addColumn = (table, column, definition) => {
16228
+ const exists = db.prepare("SELECT 1 AS found FROM pragma_table_info(?) WHERE name = ?").get(table, column);
16229
+ if (exists == null)
16230
+ db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
16231
+ };
16232
+ addColumn("source_import_jobs", "duplicate_mode", "TEXT NOT NULL DEFAULT 'skip' CHECK (duplicate_mode IN ('skip','replace','reimport'))");
16233
+ addColumn("source_import_jobs", "next_attempt_at", "TEXT");
16234
+ addColumn("source_import_files", "error", "TEXT");
16235
+ }
16236
+ function addColumnIfMissing28(db, table, column, definition) {
16237
+ const columns = db.prepare(`PRAGMA table_info(${table})`).all();
16238
+ if (!columns.some((row) => row.name === column))
16239
+ db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
16240
+ }
16241
+ function up150(db) {
16242
+ addColumnIfMissing28(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
16243
+ addColumnIfMissing28(db, "dreaming_passes", "head_base_revision", "INTEGER");
16244
+ db.exec("CREATE INDEX IF NOT EXISTS idx_memory_head_revisions_content_hash ON memory_head_revisions(content_hash)");
16245
+ db.exec("CREATE INDEX IF NOT EXISTS idx_memory_md_heads_content_hash ON memory_md_heads(content_hash)");
16246
+ db.exec(`
16247
+ CREATE TRIGGER IF NOT EXISTS dreaming_passes_head_fence_ai
16248
+ AFTER INSERT ON dreaming_passes
16249
+ WHEN NEW.mode = 'incremental-content'
16250
+ BEGIN
16251
+ INSERT OR IGNORE INTO memory_md_heads (agent_id, content, content_hash, revision, updated_at, is_current)
16252
+ VALUES (NEW.agent_id, '', '', 0, datetime('now'), 0);
16253
+ UPDATE dreaming_passes
16254
+ SET head_base_revision = (SELECT revision FROM memory_md_heads WHERE agent_id = NEW.agent_id)
16255
+ WHERE id = NEW.id;
16256
+ END;
16257
+
16258
+ CREATE TRIGGER IF NOT EXISTS memories_head_freshness_au
16259
+ AFTER UPDATE OF content, superseded_by, stale_at, is_deleted, agent_id, visibility, scope, memory_kind ON memories
16260
+ WHEN OLD.content IS NOT NEW.content OR OLD.superseded_by IS NOT NEW.superseded_by
16261
+ OR OLD.stale_at IS NOT NEW.stale_at OR OLD.is_deleted IS NOT NEW.is_deleted
16262
+ OR OLD.agent_id IS NOT NEW.agent_id OR OLD.visibility IS NOT NEW.visibility OR OLD.scope IS NOT NEW.scope OR OLD.memory_kind IS NOT NEW.memory_kind
16263
+ BEGIN
16264
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
16265
+ WHERE agent_id IN (OLD.agent_id, NEW.agent_id)
16266
+ OR (COALESCE(OLD.visibility, 'global') = 'global' OR COALESCE(NEW.visibility, 'global') = 'global')
16267
+ AND (agent_id IN (SELECT id FROM agents WHERE read_policy = 'shared')
16268
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'group' AND policy_group IN
16269
+ (SELECT policy_group FROM agents WHERE id IN (OLD.agent_id, NEW.agent_id))));
16270
+ END;
16271
+
16272
+ CREATE TRIGGER IF NOT EXISTS memories_head_freshness_ad
16273
+ AFTER DELETE ON memories
16274
+ BEGIN
16275
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
16276
+ WHERE agent_id = OLD.agent_id
16277
+ OR (COALESCE(OLD.visibility, 'global') = 'global'
16278
+ AND (agent_id IN (SELECT id FROM agents WHERE read_policy = 'shared')
16279
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'group' AND policy_group IN
16280
+ (SELECT policy_group FROM agents WHERE id = OLD.agent_id))));
16281
+ END;
16282
+
16283
+ CREATE TRIGGER IF NOT EXISTS agents_head_freshness_ad
16284
+ AFTER DELETE ON agents
16285
+ BEGIN
16286
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
16287
+ WHERE agent_id = OLD.id OR agent_id IN (SELECT id FROM agents WHERE read_policy='group' AND policy_group=OLD.policy_group);
16288
+ END;
16289
+
16290
+ CREATE TRIGGER IF NOT EXISTS agents_head_freshness_au
16291
+ AFTER UPDATE OF read_policy, policy_group ON agents
16292
+ WHEN OLD.read_policy IS NOT NEW.read_policy OR OLD.policy_group IS NOT NEW.policy_group
16293
+ BEGIN
16294
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
16295
+ WHERE agent_id IN (OLD.id, NEW.id)
16296
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'shared')
16297
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'group' AND policy_group IN (OLD.policy_group, NEW.policy_group));
16298
+ END;
16299
+ `);
16300
+ for (const table of ["memory_artifacts", "session_transcripts"]) {
16301
+ const exists = db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name=?").get(table);
16302
+ if (!exists)
16303
+ continue;
16304
+ const hasIsDeleted = db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === "is_deleted");
16305
+ const updateColumns = table === "session_transcripts" ? "content, agent_id, completed_at" : hasIsDeleted ? "content, agent_id, is_deleted" : "content, agent_id";
16306
+ const contentChanged = table === "session_transcripts" ? "OLD.completed_at IS NOT NULL AND (OLD.content IS NOT NEW.content OR NEW.completed_at IS NULL)" : `OLD.content IS NOT NEW.content${hasIsDeleted ? " OR OLD.is_deleted IS NOT NEW.is_deleted" : ""}`;
16307
+ db.exec(`
16308
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_au
16309
+ AFTER UPDATE OF ${updateColumns} ON ${table}
16310
+ WHEN OLD.agent_id IS NOT NEW.agent_id OR ${contentChanged}
16311
+ BEGIN
16312
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
16313
+ WHERE agent_id IN (OLD.agent_id, NEW.agent_id);
16314
+ END;
16315
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_ad
16316
+ AFTER DELETE ON ${table}
16317
+ BEGIN
16318
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id = OLD.agent_id;
16319
+ END;
16320
+ `);
16321
+ }
16322
+ if (db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='session_summaries'").get()) {
16323
+ db.exec(`
16324
+ CREATE TRIGGER IF NOT EXISTS session_summaries_head_freshness_au
16325
+ AFTER UPDATE OF content, source_ref, source_type, depth, agent_id ON session_summaries
16326
+ WHEN OLD.depth = 0 AND (OLD.content IS NOT NEW.content OR OLD.source_ref IS NOT NEW.source_ref OR OLD.source_type IS NOT NEW.source_type OR OLD.depth IS NOT NEW.depth OR OLD.agent_id IS NOT NEW.agent_id)
16327
+ BEGIN
16328
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id IN (OLD.agent_id, NEW.agent_id);
16329
+ END;
16330
+ CREATE TRIGGER IF NOT EXISTS session_summaries_head_freshness_ad
16331
+ AFTER DELETE ON session_summaries
16332
+ WHEN OLD.depth = 0
16333
+ BEGIN
16334
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id = OLD.agent_id;
16335
+ END;
16336
+ `);
16337
+ }
16338
+ const safetyExists = db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='memory_content_safety'").get();
16339
+ if (safetyExists) {
16340
+ db.exec(`
16341
+ CREATE TRIGGER IF NOT EXISTS memory_content_safety_head_freshness_ai
16342
+ AFTER INSERT ON memory_content_safety
16343
+ WHEN NEW.status IS NOT 'clean' OR NEW.context_eligible IS NOT 1
16344
+ BEGIN
16345
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
16346
+ WHERE agent_id IN (NEW.agent_id)
16347
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy IN ('shared', 'group'));
16348
+ END;
16349
+
16350
+ CREATE TRIGGER IF NOT EXISTS memory_content_safety_head_freshness_au
16351
+ AFTER UPDATE OF context_eligible, agent_id, status ON memory_content_safety
16352
+ WHEN (OLD.context_eligible IS NOT NEW.context_eligible OR OLD.agent_id IS NOT NEW.agent_id OR OLD.status IS NOT NEW.status)
16353
+ AND (OLD.status IS NOT 'clean' OR NEW.status IS NOT 'clean' OR OLD.context_eligible IS NOT 1 OR NEW.context_eligible IS NOT 1)
16354
+ BEGIN
16355
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
16356
+ WHERE agent_id IN (OLD.agent_id, NEW.agent_id)
16357
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'shared')
16358
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'group');
16359
+ END;
16360
+ `);
16361
+ }
16362
+ for (const table of ["memory_artifact_tombstones", "imported_source_lifecycle"]) {
16363
+ const exists = db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name=?").get(table);
16364
+ if (!exists)
16365
+ continue;
16366
+ const lifecycleClause = table === "imported_source_lifecycle" ? " WHEN NEW.status = 'unsupported'" : "";
16367
+ const updateColumns = table === "imported_source_lifecycle" ? "agent_id, status" : "agent_id";
16368
+ const lifecycleUpdateClause = table === "imported_source_lifecycle" ? " AND NEW.status = 'unsupported'" : "";
16369
+ const lifecycleWhen = table === "imported_source_lifecycle" ? `(OLD.agent_id IS NOT NEW.agent_id OR OLD.status IS NOT NEW.status)${lifecycleUpdateClause}` : "OLD.agent_id IS NOT NEW.agent_id";
16370
+ db.exec(`
16371
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_ai
16372
+ AFTER INSERT ON ${table}${lifecycleClause}
16373
+ BEGIN
16374
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id = NEW.agent_id;
16375
+ END;
16376
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_au
16377
+ AFTER UPDATE OF ${updateColumns} ON ${table}
16378
+ WHEN ${lifecycleWhen}
16379
+ BEGIN
16380
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
16381
+ WHERE agent_id IN (OLD.agent_id, NEW.agent_id);
16382
+ END;
16383
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_ad
16384
+ AFTER DELETE ON ${table}
16385
+ BEGIN
16386
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id = OLD.agent_id;
16387
+ END;
16388
+ `);
16389
+ }
16390
+ }
16156
16391
  var MIGRATIONS = [
16157
16392
  {
16158
16393
  version: 1,
@@ -17302,6 +17537,60 @@ var MIGRATIONS = [
17302
17537
  name: "dreaming-evidence-reviews",
17303
17538
  up: up145,
17304
17539
  artifacts: { tables: ["dreaming_evidence_reviews"] }
17540
+ },
17541
+ {
17542
+ version: 146,
17543
+ name: "source-transcript-import",
17544
+ up: up146,
17545
+ artifacts: {
17546
+ tables: [
17547
+ "source_import_jobs",
17548
+ "source_import_files",
17549
+ "source_import_records",
17550
+ "transcript_import_conversations",
17551
+ "source_import_record_attempts"
17552
+ ],
17553
+ columns: [
17554
+ { table: "session_transcripts", column: "source_id" },
17555
+ { table: "session_transcripts", column: "source_record_id" },
17556
+ { table: "session_transcripts", column: "source_meta_json" }
17557
+ ]
17558
+ }
17559
+ },
17560
+ {
17561
+ version: 147,
17562
+ name: "source-import-replay-file-slots",
17563
+ up: up147,
17564
+ artifacts: { tables: ["source_import_files"] }
17565
+ },
17566
+ {
17567
+ version: 148,
17568
+ name: "source-import-attempt-provenance",
17569
+ up: up148,
17570
+ artifacts: { columns: [{ table: "source_import_record_attempts", column: "source_id" }] }
17571
+ },
17572
+ {
17573
+ version: 149,
17574
+ name: "transcript-import-state-machine",
17575
+ up: up149,
17576
+ artifacts: {
17577
+ columns: [
17578
+ { table: "source_import_jobs", column: "duplicate_mode" },
17579
+ { table: "source_import_jobs", column: "next_attempt_at" },
17580
+ { table: "source_import_files", column: "error" }
17581
+ ]
17582
+ }
17583
+ },
17584
+ {
17585
+ version: 150,
17586
+ name: "memory-head-freshness",
17587
+ up: up150,
17588
+ artifacts: {
17589
+ columns: [
17590
+ { table: "memory_md_heads", column: "is_current" },
17591
+ { table: "dreaming_passes", column: "head_base_revision" }
17592
+ ]
17593
+ }
17305
17594
  }
17306
17595
  ];
17307
17596
  var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
@@ -29171,7 +29460,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
29171
29460
  return true;
29172
29461
  return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
29173
29462
  }
29174
- function up146(db) {
29463
+ function up151(db) {
29175
29464
  db.exec(`
29176
29465
  CREATE TABLE IF NOT EXISTS schema_migrations (
29177
29466
  version INTEGER PRIMARY KEY,
@@ -29264,27 +29553,27 @@ function hasColumn26(db, table, column) {
29264
29553
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
29265
29554
  return rows.some((r3) => r3.name === column);
29266
29555
  }
29267
- function addColumnIfMissing28(db, table, column, definition) {
29556
+ function addColumnIfMissing29(db, table, column, definition) {
29268
29557
  if (!hasColumn26(db, table, column)) {
29269
29558
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
29270
29559
  }
29271
29560
  }
29272
29561
  function up210(db) {
29273
- addColumnIfMissing28(db, "memories", "content_hash", "TEXT");
29274
- addColumnIfMissing28(db, "memories", "normalized_content", "TEXT");
29275
- addColumnIfMissing28(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
29276
- addColumnIfMissing28(db, "memories", "deleted_at", "TEXT");
29277
- addColumnIfMissing28(db, "memories", "extraction_status", "TEXT DEFAULT 'none'");
29278
- addColumnIfMissing28(db, "memories", "embedding_model", "TEXT");
29279
- addColumnIfMissing28(db, "memories", "extraction_model", "TEXT");
29280
- addColumnIfMissing28(db, "memories", "update_count", "INTEGER DEFAULT 0");
29281
- addColumnIfMissing28(db, "memories", "who", "TEXT");
29282
- addColumnIfMissing28(db, "memories", "why", "TEXT");
29283
- addColumnIfMissing28(db, "memories", "project", "TEXT");
29284
- addColumnIfMissing28(db, "memories", "pinned", "INTEGER DEFAULT 0");
29285
- addColumnIfMissing28(db, "memories", "importance", "REAL DEFAULT 0.5");
29286
- addColumnIfMissing28(db, "memories", "last_accessed", "TEXT");
29287
- addColumnIfMissing28(db, "memories", "access_count", "INTEGER DEFAULT 0");
29562
+ addColumnIfMissing29(db, "memories", "content_hash", "TEXT");
29563
+ addColumnIfMissing29(db, "memories", "normalized_content", "TEXT");
29564
+ addColumnIfMissing29(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
29565
+ addColumnIfMissing29(db, "memories", "deleted_at", "TEXT");
29566
+ addColumnIfMissing29(db, "memories", "extraction_status", "TEXT DEFAULT 'none'");
29567
+ addColumnIfMissing29(db, "memories", "embedding_model", "TEXT");
29568
+ addColumnIfMissing29(db, "memories", "extraction_model", "TEXT");
29569
+ addColumnIfMissing29(db, "memories", "update_count", "INTEGER DEFAULT 0");
29570
+ addColumnIfMissing29(db, "memories", "who", "TEXT");
29571
+ addColumnIfMissing29(db, "memories", "why", "TEXT");
29572
+ addColumnIfMissing29(db, "memories", "project", "TEXT");
29573
+ addColumnIfMissing29(db, "memories", "pinned", "INTEGER DEFAULT 0");
29574
+ addColumnIfMissing29(db, "memories", "importance", "REAL DEFAULT 0.5");
29575
+ addColumnIfMissing29(db, "memories", "last_accessed", "TEXT");
29576
+ addColumnIfMissing29(db, "memories", "access_count", "INTEGER DEFAULT 0");
29288
29577
  db.exec(`
29289
29578
  CREATE TABLE IF NOT EXISTS memory_history (
29290
29579
  id TEXT PRIMARY KEY,
@@ -29380,7 +29669,7 @@ function up210(db) {
29380
29669
  ON memory_entity_mentions(entity_id);
29381
29670
  `);
29382
29671
  }
29383
- function addColumnIfMissing29(db, table, column, definition) {
29672
+ function addColumnIfMissing210(db, table, column, definition) {
29384
29673
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
29385
29674
  if (rows.some((r3) => r3.name === column))
29386
29675
  return false;
@@ -29388,8 +29677,8 @@ function addColumnIfMissing29(db, table, column, definition) {
29388
29677
  return true;
29389
29678
  }
29390
29679
  function up310(db) {
29391
- addColumnIfMissing29(db, "memories", "why", "TEXT");
29392
- addColumnIfMissing29(db, "memories", "project", "TEXT");
29680
+ addColumnIfMissing210(db, "memories", "why", "TEXT");
29681
+ addColumnIfMissing210(db, "memories", "project", "TEXT");
29393
29682
  db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
29394
29683
  db.exec(`
29395
29684
  UPDATE memories
@@ -29681,7 +29970,7 @@ function up1310(db) {
29681
29970
  addColumnIfMissing52(db, "memories", "source_path", "TEXT");
29682
29971
  addColumnIfMissing52(db, "memories", "source_section", "TEXT");
29683
29972
  }
29684
- function up147(db) {
29973
+ function up1410(db) {
29685
29974
  db.exec(`
29686
29975
  CREATE TABLE IF NOT EXISTS telemetry_events (
29687
29976
  id TEXT PRIMARY KEY,
@@ -33944,11 +34233,246 @@ function up1452(db) {
33944
34233
  ON dreaming_evidence_reviews (agent_id, reviewed_at DESC);
33945
34234
  `);
33946
34235
  }
34236
+ function up1462(db) {
34237
+ db.exec(`
34238
+ CREATE TABLE IF NOT EXISTS source_import_jobs (
34239
+ id TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK (kind = 'import'), agent_id TEXT NOT NULL,
34240
+ schema_id TEXT NOT NULL, adapter_version INTEGER NOT NULL CHECK (adapter_version = 1),
34241
+ state TEXT NOT NULL CHECK (state IN ('staging','inventorying','queued','running','paused','completed','completed_with_rejections','cancelled','failed')),
34242
+ control_request TEXT CHECK (control_request IN ('pause','resume','retry','cancel') OR control_request IS NULL),
34243
+ generation INTEGER NOT NULL DEFAULT 0, total INTEGER NOT NULL DEFAULT 0, imported INTEGER NOT NULL DEFAULT 0,
34244
+ duplicate INTEGER NOT NULL DEFAULT 0, rejected INTEGER NOT NULL DEFAULT 0, pending INTEGER NOT NULL DEFAULT 0,
34245
+ lease_token TEXT, lease_expires_at TEXT, error TEXT, created_at TEXT NOT NULL DEFAULT (datetime('now')),
34246
+ updated_at TEXT NOT NULL DEFAULT (datetime('now')), started_at TEXT, completed_at TEXT, reconciled_at TEXT
34247
+ );
34248
+ CREATE INDEX IF NOT EXISTS idx_source_import_jobs_agent_state ON source_import_jobs(agent_id, state);
34249
+
34250
+ CREATE TABLE IF NOT EXISTS source_import_files (
34251
+ id TEXT PRIMARY KEY, job_id TEXT NOT NULL REFERENCES source_import_jobs(id) ON DELETE CASCADE,
34252
+ source_id TEXT NOT NULL, agent_id TEXT NOT NULL, ordinal INTEGER NOT NULL, name TEXT NOT NULL,
34253
+ managed_path TEXT NOT NULL, size_bytes INTEGER NOT NULL DEFAULT 0, content_hash TEXT,
34254
+ state TEXT NOT NULL CHECK (state IN ('staging','ready','inventorying','completed','failed')),
34255
+ record_count INTEGER NOT NULL DEFAULT 0, blank_count INTEGER NOT NULL DEFAULT 0, malformed_count INTEGER NOT NULL DEFAULT 0,
34256
+ inventory_version INTEGER NOT NULL DEFAULT 1, checkpoint_ordinal INTEGER NOT NULL DEFAULT 0,
34257
+ checkpoint_byte_offset INTEGER NOT NULL DEFAULT 0, created_at TEXT NOT NULL DEFAULT (datetime('now')), updated_at TEXT NOT NULL DEFAULT (datetime('now')),
34258
+ UNIQUE(job_id, ordinal)
34259
+ );
34260
+ CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state);
34261
+
34262
+ CREATE TABLE IF NOT EXISTS source_import_records (
34263
+ id TEXT PRIMARY KEY, job_id TEXT NOT NULL REFERENCES source_import_jobs(id) ON DELETE CASCADE,
34264
+ file_id TEXT NOT NULL REFERENCES source_import_files(id) ON DELETE CASCADE, source_id TEXT NOT NULL, agent_id TEXT NOT NULL,
34265
+ ordinal INTEGER NOT NULL, line_number INTEGER NOT NULL, byte_offset INTEGER NOT NULL, byte_length INTEGER NOT NULL,
34266
+ raw_hash TEXT NOT NULL, external_identity TEXT, conversation_fingerprint TEXT, status TEXT NOT NULL CHECK (status IN ('pending','imported','duplicate','rejected','cancelled')),
34267
+ canonical_id TEXT, canonical_key TEXT, rejection_code TEXT, attempt_count INTEGER NOT NULL DEFAULT 0,
34268
+ created_at TEXT NOT NULL DEFAULT (datetime('now')), updated_at TEXT NOT NULL DEFAULT (datetime('now')),
34269
+ UNIQUE(file_id, ordinal), UNIQUE(file_id, byte_offset)
34270
+ );
34271
+ CREATE INDEX IF NOT EXISTS idx_source_import_records_job_status ON source_import_records(job_id, status);
34272
+ CREATE INDEX IF NOT EXISTS idx_source_import_records_source_status ON source_import_records(agent_id, source_id, status);
34273
+
34274
+ CREATE TABLE IF NOT EXISTS transcript_import_conversations (
34275
+ agent_id TEXT NOT NULL, external_identity TEXT NOT NULL, canonical_key TEXT NOT NULL,
34276
+ conversation_fingerprint TEXT NOT NULL, canonical_id TEXT NOT NULL, owner_source_id TEXT NOT NULL,
34277
+ owner_record_id TEXT NOT NULL, state TEXT NOT NULL CHECK (state IN ('committing','committed','removed')),
34278
+ content_hash TEXT NOT NULL, harness TEXT NOT NULL, timestamp TEXT NOT NULL,
34279
+ created_at TEXT NOT NULL DEFAULT (datetime('now')), updated_at TEXT NOT NULL DEFAULT (datetime('now')),
34280
+ PRIMARY KEY (agent_id, external_identity), UNIQUE(agent_id, canonical_key)
34281
+ );
34282
+ CREATE INDEX IF NOT EXISTS idx_transcript_import_conversations_source ON transcript_import_conversations(agent_id, owner_source_id);
34283
+
34284
+ CREATE TABLE IF NOT EXISTS source_import_record_attempts (
34285
+ id INTEGER PRIMARY KEY AUTOINCREMENT, agent_id TEXT NOT NULL, job_id TEXT NOT NULL, file_id TEXT NOT NULL,
34286
+ record_id TEXT NOT NULL, generation INTEGER NOT NULL, outcome TEXT NOT NULL, error_code TEXT, created_at TEXT NOT NULL DEFAULT (datetime('now'))
34287
+ );
34288
+ CREATE INDEX IF NOT EXISTS idx_source_import_attempts_record ON source_import_record_attempts(agent_id, record_id, created_at);
34289
+ `);
34290
+ for (const column of ["source_id", "source_record_id", "source_meta_json"]) {
34291
+ const exists = db.prepare("SELECT 1 AS found FROM pragma_table_info('session_transcripts') WHERE name = ?").get(column);
34292
+ if (exists == null)
34293
+ db.exec(`ALTER TABLE session_transcripts ADD COLUMN ${column} TEXT`);
34294
+ }
34295
+ db.exec("CREATE INDEX IF NOT EXISTS idx_session_transcripts_agent_source ON session_transcripts(agent_id, source_id)");
34296
+ }
34297
+ function up1472(db) {
34298
+ db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
34299
+ }
34300
+ function up1482(db) {
34301
+ const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
34302
+ if (!columns.some((column) => column.name === "source_id")) {
34303
+ db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
34304
+ }
34305
+ }
34306
+ function up1492(db) {
34307
+ const addColumn = (table, column, definition) => {
34308
+ const exists = db.prepare("SELECT 1 AS found FROM pragma_table_info(?) WHERE name = ?").get(table, column);
34309
+ if (exists == null)
34310
+ db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
34311
+ };
34312
+ addColumn("source_import_jobs", "duplicate_mode", "TEXT NOT NULL DEFAULT 'skip' CHECK (duplicate_mode IN ('skip','replace','reimport'))");
34313
+ addColumn("source_import_jobs", "next_attempt_at", "TEXT");
34314
+ addColumn("source_import_files", "error", "TEXT");
34315
+ }
34316
+ function addColumnIfMissing282(db, table, column, definition) {
34317
+ const columns = db.prepare(`PRAGMA table_info(${table})`).all();
34318
+ if (!columns.some((row) => row.name === column))
34319
+ db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
34320
+ }
34321
+ function up1502(db) {
34322
+ addColumnIfMissing282(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
34323
+ addColumnIfMissing282(db, "dreaming_passes", "head_base_revision", "INTEGER");
34324
+ db.exec("CREATE INDEX IF NOT EXISTS idx_memory_head_revisions_content_hash ON memory_head_revisions(content_hash)");
34325
+ db.exec("CREATE INDEX IF NOT EXISTS idx_memory_md_heads_content_hash ON memory_md_heads(content_hash)");
34326
+ db.exec(`
34327
+ CREATE TRIGGER IF NOT EXISTS dreaming_passes_head_fence_ai
34328
+ AFTER INSERT ON dreaming_passes
34329
+ WHEN NEW.mode = 'incremental-content'
34330
+ BEGIN
34331
+ INSERT OR IGNORE INTO memory_md_heads (agent_id, content, content_hash, revision, updated_at, is_current)
34332
+ VALUES (NEW.agent_id, '', '', 0, datetime('now'), 0);
34333
+ UPDATE dreaming_passes
34334
+ SET head_base_revision = (SELECT revision FROM memory_md_heads WHERE agent_id = NEW.agent_id)
34335
+ WHERE id = NEW.id;
34336
+ END;
34337
+
34338
+ CREATE TRIGGER IF NOT EXISTS memories_head_freshness_au
34339
+ AFTER UPDATE OF content, superseded_by, stale_at, is_deleted, agent_id, visibility, scope, memory_kind ON memories
34340
+ WHEN OLD.content IS NOT NEW.content OR OLD.superseded_by IS NOT NEW.superseded_by
34341
+ OR OLD.stale_at IS NOT NEW.stale_at OR OLD.is_deleted IS NOT NEW.is_deleted
34342
+ OR OLD.agent_id IS NOT NEW.agent_id OR OLD.visibility IS NOT NEW.visibility OR OLD.scope IS NOT NEW.scope OR OLD.memory_kind IS NOT NEW.memory_kind
34343
+ BEGIN
34344
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
34345
+ WHERE agent_id IN (OLD.agent_id, NEW.agent_id)
34346
+ OR (COALESCE(OLD.visibility, 'global') = 'global' OR COALESCE(NEW.visibility, 'global') = 'global')
34347
+ AND (agent_id IN (SELECT id FROM agents WHERE read_policy = 'shared')
34348
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'group' AND policy_group IN
34349
+ (SELECT policy_group FROM agents WHERE id IN (OLD.agent_id, NEW.agent_id))));
34350
+ END;
34351
+
34352
+ CREATE TRIGGER IF NOT EXISTS memories_head_freshness_ad
34353
+ AFTER DELETE ON memories
34354
+ BEGIN
34355
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
34356
+ WHERE agent_id = OLD.agent_id
34357
+ OR (COALESCE(OLD.visibility, 'global') = 'global'
34358
+ AND (agent_id IN (SELECT id FROM agents WHERE read_policy = 'shared')
34359
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'group' AND policy_group IN
34360
+ (SELECT policy_group FROM agents WHERE id = OLD.agent_id))));
34361
+ END;
34362
+
34363
+ CREATE TRIGGER IF NOT EXISTS agents_head_freshness_ad
34364
+ AFTER DELETE ON agents
34365
+ BEGIN
34366
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
34367
+ WHERE agent_id = OLD.id OR agent_id IN (SELECT id FROM agents WHERE read_policy='group' AND policy_group=OLD.policy_group);
34368
+ END;
34369
+
34370
+ CREATE TRIGGER IF NOT EXISTS agents_head_freshness_au
34371
+ AFTER UPDATE OF read_policy, policy_group ON agents
34372
+ WHEN OLD.read_policy IS NOT NEW.read_policy OR OLD.policy_group IS NOT NEW.policy_group
34373
+ BEGIN
34374
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
34375
+ WHERE agent_id IN (OLD.id, NEW.id)
34376
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'shared')
34377
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'group' AND policy_group IN (OLD.policy_group, NEW.policy_group));
34378
+ END;
34379
+ `);
34380
+ for (const table of ["memory_artifacts", "session_transcripts"]) {
34381
+ const exists = db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name=?").get(table);
34382
+ if (!exists)
34383
+ continue;
34384
+ const hasIsDeleted = db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === "is_deleted");
34385
+ const updateColumns = table === "session_transcripts" ? "content, agent_id, completed_at" : hasIsDeleted ? "content, agent_id, is_deleted" : "content, agent_id";
34386
+ const contentChanged = table === "session_transcripts" ? "OLD.completed_at IS NOT NULL AND (OLD.content IS NOT NEW.content OR NEW.completed_at IS NULL)" : `OLD.content IS NOT NEW.content${hasIsDeleted ? " OR OLD.is_deleted IS NOT NEW.is_deleted" : ""}`;
34387
+ db.exec(`
34388
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_au
34389
+ AFTER UPDATE OF ${updateColumns} ON ${table}
34390
+ WHEN OLD.agent_id IS NOT NEW.agent_id OR ${contentChanged}
34391
+ BEGIN
34392
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
34393
+ WHERE agent_id IN (OLD.agent_id, NEW.agent_id);
34394
+ END;
34395
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_ad
34396
+ AFTER DELETE ON ${table}
34397
+ BEGIN
34398
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id = OLD.agent_id;
34399
+ END;
34400
+ `);
34401
+ }
34402
+ if (db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='session_summaries'").get()) {
34403
+ db.exec(`
34404
+ CREATE TRIGGER IF NOT EXISTS session_summaries_head_freshness_au
34405
+ AFTER UPDATE OF content, source_ref, source_type, depth, agent_id ON session_summaries
34406
+ WHEN OLD.depth = 0 AND (OLD.content IS NOT NEW.content OR OLD.source_ref IS NOT NEW.source_ref OR OLD.source_type IS NOT NEW.source_type OR OLD.depth IS NOT NEW.depth OR OLD.agent_id IS NOT NEW.agent_id)
34407
+ BEGIN
34408
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id IN (OLD.agent_id, NEW.agent_id);
34409
+ END;
34410
+ CREATE TRIGGER IF NOT EXISTS session_summaries_head_freshness_ad
34411
+ AFTER DELETE ON session_summaries
34412
+ WHEN OLD.depth = 0
34413
+ BEGIN
34414
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id = OLD.agent_id;
34415
+ END;
34416
+ `);
34417
+ }
34418
+ const safetyExists = db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='memory_content_safety'").get();
34419
+ if (safetyExists) {
34420
+ db.exec(`
34421
+ CREATE TRIGGER IF NOT EXISTS memory_content_safety_head_freshness_ai
34422
+ AFTER INSERT ON memory_content_safety
34423
+ WHEN NEW.status IS NOT 'clean' OR NEW.context_eligible IS NOT 1
34424
+ BEGIN
34425
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
34426
+ WHERE agent_id IN (NEW.agent_id)
34427
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy IN ('shared', 'group'));
34428
+ END;
34429
+
34430
+ CREATE TRIGGER IF NOT EXISTS memory_content_safety_head_freshness_au
34431
+ AFTER UPDATE OF context_eligible, agent_id, status ON memory_content_safety
34432
+ WHEN (OLD.context_eligible IS NOT NEW.context_eligible OR OLD.agent_id IS NOT NEW.agent_id OR OLD.status IS NOT NEW.status)
34433
+ AND (OLD.status IS NOT 'clean' OR NEW.status IS NOT 'clean' OR OLD.context_eligible IS NOT 1 OR NEW.context_eligible IS NOT 1)
34434
+ BEGIN
34435
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
34436
+ WHERE agent_id IN (OLD.agent_id, NEW.agent_id)
34437
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'shared')
34438
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'group');
34439
+ END;
34440
+ `);
34441
+ }
34442
+ for (const table of ["memory_artifact_tombstones", "imported_source_lifecycle"]) {
34443
+ const exists = db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name=?").get(table);
34444
+ if (!exists)
34445
+ continue;
34446
+ const lifecycleClause = table === "imported_source_lifecycle" ? " WHEN NEW.status = 'unsupported'" : "";
34447
+ const updateColumns = table === "imported_source_lifecycle" ? "agent_id, status" : "agent_id";
34448
+ const lifecycleUpdateClause = table === "imported_source_lifecycle" ? " AND NEW.status = 'unsupported'" : "";
34449
+ const lifecycleWhen = table === "imported_source_lifecycle" ? `(OLD.agent_id IS NOT NEW.agent_id OR OLD.status IS NOT NEW.status)${lifecycleUpdateClause}` : "OLD.agent_id IS NOT NEW.agent_id";
34450
+ db.exec(`
34451
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_ai
34452
+ AFTER INSERT ON ${table}${lifecycleClause}
34453
+ BEGIN
34454
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id = NEW.agent_id;
34455
+ END;
34456
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_au
34457
+ AFTER UPDATE OF ${updateColumns} ON ${table}
34458
+ WHEN ${lifecycleWhen}
34459
+ BEGIN
34460
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
34461
+ WHERE agent_id IN (OLD.agent_id, NEW.agent_id);
34462
+ END;
34463
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_ad
34464
+ AFTER DELETE ON ${table}
34465
+ BEGIN
34466
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id = OLD.agent_id;
34467
+ END;
34468
+ `);
34469
+ }
34470
+ }
33947
34471
  var MIGRATIONS2 = [
33948
34472
  {
33949
34473
  version: 1,
33950
34474
  name: "baseline",
33951
- up: up146,
34475
+ up: up151,
33952
34476
  artifacts: { tables: ["memories", "conversations", "embeddings"] }
33953
34477
  },
33954
34478
  {
@@ -34037,7 +34561,7 @@ var MIGRATIONS2 = [
34037
34561
  {
34038
34562
  version: 14,
34039
34563
  name: "telemetry",
34040
- up: up147,
34564
+ up: up1410,
34041
34565
  artifacts: { tables: ["telemetry_events"] }
34042
34566
  },
34043
34567
  {
@@ -35093,6 +35617,60 @@ var MIGRATIONS2 = [
35093
35617
  name: "dreaming-evidence-reviews",
35094
35618
  up: up1452,
35095
35619
  artifacts: { tables: ["dreaming_evidence_reviews"] }
35620
+ },
35621
+ {
35622
+ version: 146,
35623
+ name: "source-transcript-import",
35624
+ up: up1462,
35625
+ artifacts: {
35626
+ tables: [
35627
+ "source_import_jobs",
35628
+ "source_import_files",
35629
+ "source_import_records",
35630
+ "transcript_import_conversations",
35631
+ "source_import_record_attempts"
35632
+ ],
35633
+ columns: [
35634
+ { table: "session_transcripts", column: "source_id" },
35635
+ { table: "session_transcripts", column: "source_record_id" },
35636
+ { table: "session_transcripts", column: "source_meta_json" }
35637
+ ]
35638
+ }
35639
+ },
35640
+ {
35641
+ version: 147,
35642
+ name: "source-import-replay-file-slots",
35643
+ up: up1472,
35644
+ artifacts: { tables: ["source_import_files"] }
35645
+ },
35646
+ {
35647
+ version: 148,
35648
+ name: "source-import-attempt-provenance",
35649
+ up: up1482,
35650
+ artifacts: { columns: [{ table: "source_import_record_attempts", column: "source_id" }] }
35651
+ },
35652
+ {
35653
+ version: 149,
35654
+ name: "transcript-import-state-machine",
35655
+ up: up1492,
35656
+ artifacts: {
35657
+ columns: [
35658
+ { table: "source_import_jobs", column: "duplicate_mode" },
35659
+ { table: "source_import_jobs", column: "next_attempt_at" },
35660
+ { table: "source_import_files", column: "error" }
35661
+ ]
35662
+ }
35663
+ },
35664
+ {
35665
+ version: 150,
35666
+ name: "memory-head-freshness",
35667
+ up: up1502,
35668
+ artifacts: {
35669
+ columns: [
35670
+ { table: "memory_md_heads", column: "is_current" },
35671
+ { table: "dreaming_passes", column: "head_base_revision" }
35672
+ ]
35673
+ }
35096
35674
  }
35097
35675
  ];
35098
35676
  var LATEST_SCHEMA_VERSION2 = MIGRATIONS2[MIGRATIONS2.length - 1]?.version ?? 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signetai/connector-claude-code",
3
- "version": "0.216.7",
3
+ "version": "0.217.3",
4
4
  "description": "Signet connector for Claude Code (Anthropic CLI)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -24,8 +24,8 @@
24
24
  "typecheck": "tsc --noEmit"
25
25
  },
26
26
  "dependencies": {
27
- "@signetai/connector-base": "0.216.7",
28
- "@signetai/core": "0.216.7"
27
+ "@signetai/connector-base": "0.217.3",
28
+ "@signetai/core": "0.217.3"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^22.0.0",