@signetai/connector-kimi 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
@@ -16152,6 +16152,241 @@ function up145(db) {
16152
16152
  ON dreaming_evidence_reviews (agent_id, reviewed_at DESC);
16153
16153
  `);
16154
16154
  }
16155
+ function up146(db) {
16156
+ db.exec(`
16157
+ CREATE TABLE IF NOT EXISTS source_import_jobs (
16158
+ id TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK (kind = 'import'), agent_id TEXT NOT NULL,
16159
+ schema_id TEXT NOT NULL, adapter_version INTEGER NOT NULL CHECK (adapter_version = 1),
16160
+ state TEXT NOT NULL CHECK (state IN ('staging','inventorying','queued','running','paused','completed','completed_with_rejections','cancelled','failed')),
16161
+ control_request TEXT CHECK (control_request IN ('pause','resume','retry','cancel') OR control_request IS NULL),
16162
+ generation INTEGER NOT NULL DEFAULT 0, total INTEGER NOT NULL DEFAULT 0, imported INTEGER NOT NULL DEFAULT 0,
16163
+ duplicate INTEGER NOT NULL DEFAULT 0, rejected INTEGER NOT NULL DEFAULT 0, pending INTEGER NOT NULL DEFAULT 0,
16164
+ lease_token TEXT, lease_expires_at TEXT, error TEXT, created_at TEXT NOT NULL DEFAULT (datetime('now')),
16165
+ updated_at TEXT NOT NULL DEFAULT (datetime('now')), started_at TEXT, completed_at TEXT, reconciled_at TEXT
16166
+ );
16167
+ CREATE INDEX IF NOT EXISTS idx_source_import_jobs_agent_state ON source_import_jobs(agent_id, state);
16168
+
16169
+ CREATE TABLE IF NOT EXISTS source_import_files (
16170
+ id TEXT PRIMARY KEY, job_id TEXT NOT NULL REFERENCES source_import_jobs(id) ON DELETE CASCADE,
16171
+ source_id TEXT NOT NULL, agent_id TEXT NOT NULL, ordinal INTEGER NOT NULL, name TEXT NOT NULL,
16172
+ managed_path TEXT NOT NULL, size_bytes INTEGER NOT NULL DEFAULT 0, content_hash TEXT,
16173
+ state TEXT NOT NULL CHECK (state IN ('staging','ready','inventorying','completed','failed')),
16174
+ record_count INTEGER NOT NULL DEFAULT 0, blank_count INTEGER NOT NULL DEFAULT 0, malformed_count INTEGER NOT NULL DEFAULT 0,
16175
+ inventory_version INTEGER NOT NULL DEFAULT 1, checkpoint_ordinal INTEGER NOT NULL DEFAULT 0,
16176
+ checkpoint_byte_offset INTEGER NOT NULL DEFAULT 0, created_at TEXT NOT NULL DEFAULT (datetime('now')), updated_at TEXT NOT NULL DEFAULT (datetime('now')),
16177
+ UNIQUE(job_id, ordinal)
16178
+ );
16179
+ CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state);
16180
+
16181
+ CREATE TABLE IF NOT EXISTS source_import_records (
16182
+ id TEXT PRIMARY KEY, job_id TEXT NOT NULL REFERENCES source_import_jobs(id) ON DELETE CASCADE,
16183
+ file_id TEXT NOT NULL REFERENCES source_import_files(id) ON DELETE CASCADE, source_id TEXT NOT NULL, agent_id TEXT NOT NULL,
16184
+ ordinal INTEGER NOT NULL, line_number INTEGER NOT NULL, byte_offset INTEGER NOT NULL, byte_length INTEGER NOT NULL,
16185
+ raw_hash TEXT NOT NULL, external_identity TEXT, conversation_fingerprint TEXT, status TEXT NOT NULL CHECK (status IN ('pending','imported','duplicate','rejected','cancelled')),
16186
+ canonical_id TEXT, canonical_key TEXT, rejection_code TEXT, attempt_count INTEGER NOT NULL DEFAULT 0,
16187
+ created_at TEXT NOT NULL DEFAULT (datetime('now')), updated_at TEXT NOT NULL DEFAULT (datetime('now')),
16188
+ UNIQUE(file_id, ordinal), UNIQUE(file_id, byte_offset)
16189
+ );
16190
+ CREATE INDEX IF NOT EXISTS idx_source_import_records_job_status ON source_import_records(job_id, status);
16191
+ CREATE INDEX IF NOT EXISTS idx_source_import_records_source_status ON source_import_records(agent_id, source_id, status);
16192
+
16193
+ CREATE TABLE IF NOT EXISTS transcript_import_conversations (
16194
+ agent_id TEXT NOT NULL, external_identity TEXT NOT NULL, canonical_key TEXT NOT NULL,
16195
+ conversation_fingerprint TEXT NOT NULL, canonical_id TEXT NOT NULL, owner_source_id TEXT NOT NULL,
16196
+ owner_record_id TEXT NOT NULL, state TEXT NOT NULL CHECK (state IN ('committing','committed','removed')),
16197
+ content_hash TEXT NOT NULL, harness TEXT NOT NULL, timestamp TEXT NOT NULL,
16198
+ created_at TEXT NOT NULL DEFAULT (datetime('now')), updated_at TEXT NOT NULL DEFAULT (datetime('now')),
16199
+ PRIMARY KEY (agent_id, external_identity), UNIQUE(agent_id, canonical_key)
16200
+ );
16201
+ CREATE INDEX IF NOT EXISTS idx_transcript_import_conversations_source ON transcript_import_conversations(agent_id, owner_source_id);
16202
+
16203
+ CREATE TABLE IF NOT EXISTS source_import_record_attempts (
16204
+ id INTEGER PRIMARY KEY AUTOINCREMENT, agent_id TEXT NOT NULL, job_id TEXT NOT NULL, file_id TEXT NOT NULL,
16205
+ record_id TEXT NOT NULL, generation INTEGER NOT NULL, outcome TEXT NOT NULL, error_code TEXT, created_at TEXT NOT NULL DEFAULT (datetime('now'))
16206
+ );
16207
+ CREATE INDEX IF NOT EXISTS idx_source_import_attempts_record ON source_import_record_attempts(agent_id, record_id, created_at);
16208
+ `);
16209
+ for (const column of ["source_id", "source_record_id", "source_meta_json"]) {
16210
+ const exists = db.prepare("SELECT 1 AS found FROM pragma_table_info('session_transcripts') WHERE name = ?").get(column);
16211
+ if (exists == null)
16212
+ db.exec(`ALTER TABLE session_transcripts ADD COLUMN ${column} TEXT`);
16213
+ }
16214
+ db.exec("CREATE INDEX IF NOT EXISTS idx_session_transcripts_agent_source ON session_transcripts(agent_id, source_id)");
16215
+ }
16216
+ function up147(db) {
16217
+ db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
16218
+ }
16219
+ function up148(db) {
16220
+ const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
16221
+ if (!columns.some((column) => column.name === "source_id")) {
16222
+ db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
16223
+ }
16224
+ }
16225
+ function up149(db) {
16226
+ const addColumn = (table, column, definition) => {
16227
+ const exists = db.prepare("SELECT 1 AS found FROM pragma_table_info(?) WHERE name = ?").get(table, column);
16228
+ if (exists == null)
16229
+ db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
16230
+ };
16231
+ addColumn("source_import_jobs", "duplicate_mode", "TEXT NOT NULL DEFAULT 'skip' CHECK (duplicate_mode IN ('skip','replace','reimport'))");
16232
+ addColumn("source_import_jobs", "next_attempt_at", "TEXT");
16233
+ addColumn("source_import_files", "error", "TEXT");
16234
+ }
16235
+ function addColumnIfMissing28(db, table, column, definition) {
16236
+ const columns = db.prepare(`PRAGMA table_info(${table})`).all();
16237
+ if (!columns.some((row) => row.name === column))
16238
+ db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
16239
+ }
16240
+ function up150(db) {
16241
+ addColumnIfMissing28(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
16242
+ addColumnIfMissing28(db, "dreaming_passes", "head_base_revision", "INTEGER");
16243
+ db.exec("CREATE INDEX IF NOT EXISTS idx_memory_head_revisions_content_hash ON memory_head_revisions(content_hash)");
16244
+ db.exec("CREATE INDEX IF NOT EXISTS idx_memory_md_heads_content_hash ON memory_md_heads(content_hash)");
16245
+ db.exec(`
16246
+ CREATE TRIGGER IF NOT EXISTS dreaming_passes_head_fence_ai
16247
+ AFTER INSERT ON dreaming_passes
16248
+ WHEN NEW.mode = 'incremental-content'
16249
+ BEGIN
16250
+ INSERT OR IGNORE INTO memory_md_heads (agent_id, content, content_hash, revision, updated_at, is_current)
16251
+ VALUES (NEW.agent_id, '', '', 0, datetime('now'), 0);
16252
+ UPDATE dreaming_passes
16253
+ SET head_base_revision = (SELECT revision FROM memory_md_heads WHERE agent_id = NEW.agent_id)
16254
+ WHERE id = NEW.id;
16255
+ END;
16256
+
16257
+ CREATE TRIGGER IF NOT EXISTS memories_head_freshness_au
16258
+ AFTER UPDATE OF content, superseded_by, stale_at, is_deleted, agent_id, visibility, scope, memory_kind ON memories
16259
+ WHEN OLD.content IS NOT NEW.content OR OLD.superseded_by IS NOT NEW.superseded_by
16260
+ OR OLD.stale_at IS NOT NEW.stale_at OR OLD.is_deleted IS NOT NEW.is_deleted
16261
+ 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
16262
+ BEGIN
16263
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
16264
+ WHERE agent_id IN (OLD.agent_id, NEW.agent_id)
16265
+ OR (COALESCE(OLD.visibility, 'global') = 'global' OR COALESCE(NEW.visibility, 'global') = 'global')
16266
+ AND (agent_id IN (SELECT id FROM agents WHERE read_policy = 'shared')
16267
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'group' AND policy_group IN
16268
+ (SELECT policy_group FROM agents WHERE id IN (OLD.agent_id, NEW.agent_id))));
16269
+ END;
16270
+
16271
+ CREATE TRIGGER IF NOT EXISTS memories_head_freshness_ad
16272
+ AFTER DELETE ON memories
16273
+ BEGIN
16274
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
16275
+ WHERE agent_id = OLD.agent_id
16276
+ OR (COALESCE(OLD.visibility, 'global') = 'global'
16277
+ AND (agent_id IN (SELECT id FROM agents WHERE read_policy = 'shared')
16278
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'group' AND policy_group IN
16279
+ (SELECT policy_group FROM agents WHERE id = OLD.agent_id))));
16280
+ END;
16281
+
16282
+ CREATE TRIGGER IF NOT EXISTS agents_head_freshness_ad
16283
+ AFTER DELETE ON agents
16284
+ BEGIN
16285
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
16286
+ WHERE agent_id = OLD.id OR agent_id IN (SELECT id FROM agents WHERE read_policy='group' AND policy_group=OLD.policy_group);
16287
+ END;
16288
+
16289
+ CREATE TRIGGER IF NOT EXISTS agents_head_freshness_au
16290
+ AFTER UPDATE OF read_policy, policy_group ON agents
16291
+ WHEN OLD.read_policy IS NOT NEW.read_policy OR OLD.policy_group IS NOT NEW.policy_group
16292
+ BEGIN
16293
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
16294
+ WHERE agent_id IN (OLD.id, NEW.id)
16295
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'shared')
16296
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'group' AND policy_group IN (OLD.policy_group, NEW.policy_group));
16297
+ END;
16298
+ `);
16299
+ for (const table of ["memory_artifacts", "session_transcripts"]) {
16300
+ const exists = db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name=?").get(table);
16301
+ if (!exists)
16302
+ continue;
16303
+ const hasIsDeleted = db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === "is_deleted");
16304
+ const updateColumns = table === "session_transcripts" ? "content, agent_id, completed_at" : hasIsDeleted ? "content, agent_id, is_deleted" : "content, agent_id";
16305
+ 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" : ""}`;
16306
+ db.exec(`
16307
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_au
16308
+ AFTER UPDATE OF ${updateColumns} ON ${table}
16309
+ WHEN OLD.agent_id IS NOT NEW.agent_id OR ${contentChanged}
16310
+ BEGIN
16311
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
16312
+ WHERE agent_id IN (OLD.agent_id, NEW.agent_id);
16313
+ END;
16314
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_ad
16315
+ AFTER DELETE ON ${table}
16316
+ BEGIN
16317
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id = OLD.agent_id;
16318
+ END;
16319
+ `);
16320
+ }
16321
+ if (db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='session_summaries'").get()) {
16322
+ db.exec(`
16323
+ CREATE TRIGGER IF NOT EXISTS session_summaries_head_freshness_au
16324
+ AFTER UPDATE OF content, source_ref, source_type, depth, agent_id ON session_summaries
16325
+ 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)
16326
+ BEGIN
16327
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id IN (OLD.agent_id, NEW.agent_id);
16328
+ END;
16329
+ CREATE TRIGGER IF NOT EXISTS session_summaries_head_freshness_ad
16330
+ AFTER DELETE ON session_summaries
16331
+ WHEN OLD.depth = 0
16332
+ BEGIN
16333
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id = OLD.agent_id;
16334
+ END;
16335
+ `);
16336
+ }
16337
+ const safetyExists = db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='memory_content_safety'").get();
16338
+ if (safetyExists) {
16339
+ db.exec(`
16340
+ CREATE TRIGGER IF NOT EXISTS memory_content_safety_head_freshness_ai
16341
+ AFTER INSERT ON memory_content_safety
16342
+ WHEN NEW.status IS NOT 'clean' OR NEW.context_eligible IS NOT 1
16343
+ BEGIN
16344
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
16345
+ WHERE agent_id IN (NEW.agent_id)
16346
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy IN ('shared', 'group'));
16347
+ END;
16348
+
16349
+ CREATE TRIGGER IF NOT EXISTS memory_content_safety_head_freshness_au
16350
+ AFTER UPDATE OF context_eligible, agent_id, status ON memory_content_safety
16351
+ 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)
16352
+ 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)
16353
+ BEGIN
16354
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
16355
+ WHERE agent_id IN (OLD.agent_id, NEW.agent_id)
16356
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'shared')
16357
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'group');
16358
+ END;
16359
+ `);
16360
+ }
16361
+ for (const table of ["memory_artifact_tombstones", "imported_source_lifecycle"]) {
16362
+ const exists = db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name=?").get(table);
16363
+ if (!exists)
16364
+ continue;
16365
+ const lifecycleClause = table === "imported_source_lifecycle" ? " WHEN NEW.status = 'unsupported'" : "";
16366
+ const updateColumns = table === "imported_source_lifecycle" ? "agent_id, status" : "agent_id";
16367
+ const lifecycleUpdateClause = table === "imported_source_lifecycle" ? " AND NEW.status = 'unsupported'" : "";
16368
+ 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";
16369
+ db.exec(`
16370
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_ai
16371
+ AFTER INSERT ON ${table}${lifecycleClause}
16372
+ BEGIN
16373
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id = NEW.agent_id;
16374
+ END;
16375
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_au
16376
+ AFTER UPDATE OF ${updateColumns} ON ${table}
16377
+ WHEN ${lifecycleWhen}
16378
+ BEGIN
16379
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
16380
+ WHERE agent_id IN (OLD.agent_id, NEW.agent_id);
16381
+ END;
16382
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_ad
16383
+ AFTER DELETE ON ${table}
16384
+ BEGIN
16385
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id = OLD.agent_id;
16386
+ END;
16387
+ `);
16388
+ }
16389
+ }
16155
16390
  var MIGRATIONS = [
16156
16391
  {
16157
16392
  version: 1,
@@ -17301,6 +17536,60 @@ var MIGRATIONS = [
17301
17536
  name: "dreaming-evidence-reviews",
17302
17537
  up: up145,
17303
17538
  artifacts: { tables: ["dreaming_evidence_reviews"] }
17539
+ },
17540
+ {
17541
+ version: 146,
17542
+ name: "source-transcript-import",
17543
+ up: up146,
17544
+ artifacts: {
17545
+ tables: [
17546
+ "source_import_jobs",
17547
+ "source_import_files",
17548
+ "source_import_records",
17549
+ "transcript_import_conversations",
17550
+ "source_import_record_attempts"
17551
+ ],
17552
+ columns: [
17553
+ { table: "session_transcripts", column: "source_id" },
17554
+ { table: "session_transcripts", column: "source_record_id" },
17555
+ { table: "session_transcripts", column: "source_meta_json" }
17556
+ ]
17557
+ }
17558
+ },
17559
+ {
17560
+ version: 147,
17561
+ name: "source-import-replay-file-slots",
17562
+ up: up147,
17563
+ artifacts: { tables: ["source_import_files"] }
17564
+ },
17565
+ {
17566
+ version: 148,
17567
+ name: "source-import-attempt-provenance",
17568
+ up: up148,
17569
+ artifacts: { columns: [{ table: "source_import_record_attempts", column: "source_id" }] }
17570
+ },
17571
+ {
17572
+ version: 149,
17573
+ name: "transcript-import-state-machine",
17574
+ up: up149,
17575
+ artifacts: {
17576
+ columns: [
17577
+ { table: "source_import_jobs", column: "duplicate_mode" },
17578
+ { table: "source_import_jobs", column: "next_attempt_at" },
17579
+ { table: "source_import_files", column: "error" }
17580
+ ]
17581
+ }
17582
+ },
17583
+ {
17584
+ version: 150,
17585
+ name: "memory-head-freshness",
17586
+ up: up150,
17587
+ artifacts: {
17588
+ columns: [
17589
+ { table: "memory_md_heads", column: "is_current" },
17590
+ { table: "dreaming_passes", column: "head_base_revision" }
17591
+ ]
17592
+ }
17304
17593
  }
17305
17594
  ];
17306
17595
  var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
@@ -29147,7 +29436,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
29147
29436
  return true;
29148
29437
  return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
29149
29438
  }
29150
- function up146(db) {
29439
+ function up151(db) {
29151
29440
  db.exec(`
29152
29441
  CREATE TABLE IF NOT EXISTS schema_migrations (
29153
29442
  version INTEGER PRIMARY KEY,
@@ -29240,27 +29529,27 @@ function hasColumn26(db, table, column) {
29240
29529
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
29241
29530
  return rows.some((r3) => r3.name === column);
29242
29531
  }
29243
- function addColumnIfMissing28(db, table, column, definition) {
29532
+ function addColumnIfMissing29(db, table, column, definition) {
29244
29533
  if (!hasColumn26(db, table, column)) {
29245
29534
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
29246
29535
  }
29247
29536
  }
29248
29537
  function up210(db) {
29249
- addColumnIfMissing28(db, "memories", "content_hash", "TEXT");
29250
- addColumnIfMissing28(db, "memories", "normalized_content", "TEXT");
29251
- addColumnIfMissing28(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
29252
- addColumnIfMissing28(db, "memories", "deleted_at", "TEXT");
29253
- addColumnIfMissing28(db, "memories", "extraction_status", "TEXT DEFAULT 'none'");
29254
- addColumnIfMissing28(db, "memories", "embedding_model", "TEXT");
29255
- addColumnIfMissing28(db, "memories", "extraction_model", "TEXT");
29256
- addColumnIfMissing28(db, "memories", "update_count", "INTEGER DEFAULT 0");
29257
- addColumnIfMissing28(db, "memories", "who", "TEXT");
29258
- addColumnIfMissing28(db, "memories", "why", "TEXT");
29259
- addColumnIfMissing28(db, "memories", "project", "TEXT");
29260
- addColumnIfMissing28(db, "memories", "pinned", "INTEGER DEFAULT 0");
29261
- addColumnIfMissing28(db, "memories", "importance", "REAL DEFAULT 0.5");
29262
- addColumnIfMissing28(db, "memories", "last_accessed", "TEXT");
29263
- addColumnIfMissing28(db, "memories", "access_count", "INTEGER DEFAULT 0");
29538
+ addColumnIfMissing29(db, "memories", "content_hash", "TEXT");
29539
+ addColumnIfMissing29(db, "memories", "normalized_content", "TEXT");
29540
+ addColumnIfMissing29(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
29541
+ addColumnIfMissing29(db, "memories", "deleted_at", "TEXT");
29542
+ addColumnIfMissing29(db, "memories", "extraction_status", "TEXT DEFAULT 'none'");
29543
+ addColumnIfMissing29(db, "memories", "embedding_model", "TEXT");
29544
+ addColumnIfMissing29(db, "memories", "extraction_model", "TEXT");
29545
+ addColumnIfMissing29(db, "memories", "update_count", "INTEGER DEFAULT 0");
29546
+ addColumnIfMissing29(db, "memories", "who", "TEXT");
29547
+ addColumnIfMissing29(db, "memories", "why", "TEXT");
29548
+ addColumnIfMissing29(db, "memories", "project", "TEXT");
29549
+ addColumnIfMissing29(db, "memories", "pinned", "INTEGER DEFAULT 0");
29550
+ addColumnIfMissing29(db, "memories", "importance", "REAL DEFAULT 0.5");
29551
+ addColumnIfMissing29(db, "memories", "last_accessed", "TEXT");
29552
+ addColumnIfMissing29(db, "memories", "access_count", "INTEGER DEFAULT 0");
29264
29553
  db.exec(`
29265
29554
  CREATE TABLE IF NOT EXISTS memory_history (
29266
29555
  id TEXT PRIMARY KEY,
@@ -29356,7 +29645,7 @@ function up210(db) {
29356
29645
  ON memory_entity_mentions(entity_id);
29357
29646
  `);
29358
29647
  }
29359
- function addColumnIfMissing29(db, table, column, definition) {
29648
+ function addColumnIfMissing210(db, table, column, definition) {
29360
29649
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
29361
29650
  if (rows.some((r3) => r3.name === column))
29362
29651
  return false;
@@ -29364,8 +29653,8 @@ function addColumnIfMissing29(db, table, column, definition) {
29364
29653
  return true;
29365
29654
  }
29366
29655
  function up310(db) {
29367
- addColumnIfMissing29(db, "memories", "why", "TEXT");
29368
- addColumnIfMissing29(db, "memories", "project", "TEXT");
29656
+ addColumnIfMissing210(db, "memories", "why", "TEXT");
29657
+ addColumnIfMissing210(db, "memories", "project", "TEXT");
29369
29658
  db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
29370
29659
  db.exec(`
29371
29660
  UPDATE memories
@@ -29657,7 +29946,7 @@ function up1310(db) {
29657
29946
  addColumnIfMissing52(db, "memories", "source_path", "TEXT");
29658
29947
  addColumnIfMissing52(db, "memories", "source_section", "TEXT");
29659
29948
  }
29660
- function up147(db) {
29949
+ function up1410(db) {
29661
29950
  db.exec(`
29662
29951
  CREATE TABLE IF NOT EXISTS telemetry_events (
29663
29952
  id TEXT PRIMARY KEY,
@@ -33920,11 +34209,246 @@ function up1452(db) {
33920
34209
  ON dreaming_evidence_reviews (agent_id, reviewed_at DESC);
33921
34210
  `);
33922
34211
  }
34212
+ function up1462(db) {
34213
+ db.exec(`
34214
+ CREATE TABLE IF NOT EXISTS source_import_jobs (
34215
+ id TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK (kind = 'import'), agent_id TEXT NOT NULL,
34216
+ schema_id TEXT NOT NULL, adapter_version INTEGER NOT NULL CHECK (adapter_version = 1),
34217
+ state TEXT NOT NULL CHECK (state IN ('staging','inventorying','queued','running','paused','completed','completed_with_rejections','cancelled','failed')),
34218
+ control_request TEXT CHECK (control_request IN ('pause','resume','retry','cancel') OR control_request IS NULL),
34219
+ generation INTEGER NOT NULL DEFAULT 0, total INTEGER NOT NULL DEFAULT 0, imported INTEGER NOT NULL DEFAULT 0,
34220
+ duplicate INTEGER NOT NULL DEFAULT 0, rejected INTEGER NOT NULL DEFAULT 0, pending INTEGER NOT NULL DEFAULT 0,
34221
+ lease_token TEXT, lease_expires_at TEXT, error TEXT, created_at TEXT NOT NULL DEFAULT (datetime('now')),
34222
+ updated_at TEXT NOT NULL DEFAULT (datetime('now')), started_at TEXT, completed_at TEXT, reconciled_at TEXT
34223
+ );
34224
+ CREATE INDEX IF NOT EXISTS idx_source_import_jobs_agent_state ON source_import_jobs(agent_id, state);
34225
+
34226
+ CREATE TABLE IF NOT EXISTS source_import_files (
34227
+ id TEXT PRIMARY KEY, job_id TEXT NOT NULL REFERENCES source_import_jobs(id) ON DELETE CASCADE,
34228
+ source_id TEXT NOT NULL, agent_id TEXT NOT NULL, ordinal INTEGER NOT NULL, name TEXT NOT NULL,
34229
+ managed_path TEXT NOT NULL, size_bytes INTEGER NOT NULL DEFAULT 0, content_hash TEXT,
34230
+ state TEXT NOT NULL CHECK (state IN ('staging','ready','inventorying','completed','failed')),
34231
+ record_count INTEGER NOT NULL DEFAULT 0, blank_count INTEGER NOT NULL DEFAULT 0, malformed_count INTEGER NOT NULL DEFAULT 0,
34232
+ inventory_version INTEGER NOT NULL DEFAULT 1, checkpoint_ordinal INTEGER NOT NULL DEFAULT 0,
34233
+ checkpoint_byte_offset INTEGER NOT NULL DEFAULT 0, created_at TEXT NOT NULL DEFAULT (datetime('now')), updated_at TEXT NOT NULL DEFAULT (datetime('now')),
34234
+ UNIQUE(job_id, ordinal)
34235
+ );
34236
+ CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state);
34237
+
34238
+ CREATE TABLE IF NOT EXISTS source_import_records (
34239
+ id TEXT PRIMARY KEY, job_id TEXT NOT NULL REFERENCES source_import_jobs(id) ON DELETE CASCADE,
34240
+ file_id TEXT NOT NULL REFERENCES source_import_files(id) ON DELETE CASCADE, source_id TEXT NOT NULL, agent_id TEXT NOT NULL,
34241
+ ordinal INTEGER NOT NULL, line_number INTEGER NOT NULL, byte_offset INTEGER NOT NULL, byte_length INTEGER NOT NULL,
34242
+ raw_hash TEXT NOT NULL, external_identity TEXT, conversation_fingerprint TEXT, status TEXT NOT NULL CHECK (status IN ('pending','imported','duplicate','rejected','cancelled')),
34243
+ canonical_id TEXT, canonical_key TEXT, rejection_code TEXT, attempt_count INTEGER NOT NULL DEFAULT 0,
34244
+ created_at TEXT NOT NULL DEFAULT (datetime('now')), updated_at TEXT NOT NULL DEFAULT (datetime('now')),
34245
+ UNIQUE(file_id, ordinal), UNIQUE(file_id, byte_offset)
34246
+ );
34247
+ CREATE INDEX IF NOT EXISTS idx_source_import_records_job_status ON source_import_records(job_id, status);
34248
+ CREATE INDEX IF NOT EXISTS idx_source_import_records_source_status ON source_import_records(agent_id, source_id, status);
34249
+
34250
+ CREATE TABLE IF NOT EXISTS transcript_import_conversations (
34251
+ agent_id TEXT NOT NULL, external_identity TEXT NOT NULL, canonical_key TEXT NOT NULL,
34252
+ conversation_fingerprint TEXT NOT NULL, canonical_id TEXT NOT NULL, owner_source_id TEXT NOT NULL,
34253
+ owner_record_id TEXT NOT NULL, state TEXT NOT NULL CHECK (state IN ('committing','committed','removed')),
34254
+ content_hash TEXT NOT NULL, harness TEXT NOT NULL, timestamp TEXT NOT NULL,
34255
+ created_at TEXT NOT NULL DEFAULT (datetime('now')), updated_at TEXT NOT NULL DEFAULT (datetime('now')),
34256
+ PRIMARY KEY (agent_id, external_identity), UNIQUE(agent_id, canonical_key)
34257
+ );
34258
+ CREATE INDEX IF NOT EXISTS idx_transcript_import_conversations_source ON transcript_import_conversations(agent_id, owner_source_id);
34259
+
34260
+ CREATE TABLE IF NOT EXISTS source_import_record_attempts (
34261
+ id INTEGER PRIMARY KEY AUTOINCREMENT, agent_id TEXT NOT NULL, job_id TEXT NOT NULL, file_id TEXT NOT NULL,
34262
+ record_id TEXT NOT NULL, generation INTEGER NOT NULL, outcome TEXT NOT NULL, error_code TEXT, created_at TEXT NOT NULL DEFAULT (datetime('now'))
34263
+ );
34264
+ CREATE INDEX IF NOT EXISTS idx_source_import_attempts_record ON source_import_record_attempts(agent_id, record_id, created_at);
34265
+ `);
34266
+ for (const column of ["source_id", "source_record_id", "source_meta_json"]) {
34267
+ const exists = db.prepare("SELECT 1 AS found FROM pragma_table_info('session_transcripts') WHERE name = ?").get(column);
34268
+ if (exists == null)
34269
+ db.exec(`ALTER TABLE session_transcripts ADD COLUMN ${column} TEXT`);
34270
+ }
34271
+ db.exec("CREATE INDEX IF NOT EXISTS idx_session_transcripts_agent_source ON session_transcripts(agent_id, source_id)");
34272
+ }
34273
+ function up1472(db) {
34274
+ db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
34275
+ }
34276
+ function up1482(db) {
34277
+ const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
34278
+ if (!columns.some((column) => column.name === "source_id")) {
34279
+ db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
34280
+ }
34281
+ }
34282
+ function up1492(db) {
34283
+ const addColumn = (table, column, definition) => {
34284
+ const exists = db.prepare("SELECT 1 AS found FROM pragma_table_info(?) WHERE name = ?").get(table, column);
34285
+ if (exists == null)
34286
+ db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
34287
+ };
34288
+ addColumn("source_import_jobs", "duplicate_mode", "TEXT NOT NULL DEFAULT 'skip' CHECK (duplicate_mode IN ('skip','replace','reimport'))");
34289
+ addColumn("source_import_jobs", "next_attempt_at", "TEXT");
34290
+ addColumn("source_import_files", "error", "TEXT");
34291
+ }
34292
+ function addColumnIfMissing282(db, table, column, definition) {
34293
+ const columns = db.prepare(`PRAGMA table_info(${table})`).all();
34294
+ if (!columns.some((row) => row.name === column))
34295
+ db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
34296
+ }
34297
+ function up1502(db) {
34298
+ addColumnIfMissing282(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
34299
+ addColumnIfMissing282(db, "dreaming_passes", "head_base_revision", "INTEGER");
34300
+ db.exec("CREATE INDEX IF NOT EXISTS idx_memory_head_revisions_content_hash ON memory_head_revisions(content_hash)");
34301
+ db.exec("CREATE INDEX IF NOT EXISTS idx_memory_md_heads_content_hash ON memory_md_heads(content_hash)");
34302
+ db.exec(`
34303
+ CREATE TRIGGER IF NOT EXISTS dreaming_passes_head_fence_ai
34304
+ AFTER INSERT ON dreaming_passes
34305
+ WHEN NEW.mode = 'incremental-content'
34306
+ BEGIN
34307
+ INSERT OR IGNORE INTO memory_md_heads (agent_id, content, content_hash, revision, updated_at, is_current)
34308
+ VALUES (NEW.agent_id, '', '', 0, datetime('now'), 0);
34309
+ UPDATE dreaming_passes
34310
+ SET head_base_revision = (SELECT revision FROM memory_md_heads WHERE agent_id = NEW.agent_id)
34311
+ WHERE id = NEW.id;
34312
+ END;
34313
+
34314
+ CREATE TRIGGER IF NOT EXISTS memories_head_freshness_au
34315
+ AFTER UPDATE OF content, superseded_by, stale_at, is_deleted, agent_id, visibility, scope, memory_kind ON memories
34316
+ WHEN OLD.content IS NOT NEW.content OR OLD.superseded_by IS NOT NEW.superseded_by
34317
+ OR OLD.stale_at IS NOT NEW.stale_at OR OLD.is_deleted IS NOT NEW.is_deleted
34318
+ 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
34319
+ BEGIN
34320
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
34321
+ WHERE agent_id IN (OLD.agent_id, NEW.agent_id)
34322
+ OR (COALESCE(OLD.visibility, 'global') = 'global' OR COALESCE(NEW.visibility, 'global') = 'global')
34323
+ AND (agent_id IN (SELECT id FROM agents WHERE read_policy = 'shared')
34324
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'group' AND policy_group IN
34325
+ (SELECT policy_group FROM agents WHERE id IN (OLD.agent_id, NEW.agent_id))));
34326
+ END;
34327
+
34328
+ CREATE TRIGGER IF NOT EXISTS memories_head_freshness_ad
34329
+ AFTER DELETE ON memories
34330
+ BEGIN
34331
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
34332
+ WHERE agent_id = OLD.agent_id
34333
+ OR (COALESCE(OLD.visibility, 'global') = 'global'
34334
+ AND (agent_id IN (SELECT id FROM agents WHERE read_policy = 'shared')
34335
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'group' AND policy_group IN
34336
+ (SELECT policy_group FROM agents WHERE id = OLD.agent_id))));
34337
+ END;
34338
+
34339
+ CREATE TRIGGER IF NOT EXISTS agents_head_freshness_ad
34340
+ AFTER DELETE ON agents
34341
+ BEGIN
34342
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
34343
+ WHERE agent_id = OLD.id OR agent_id IN (SELECT id FROM agents WHERE read_policy='group' AND policy_group=OLD.policy_group);
34344
+ END;
34345
+
34346
+ CREATE TRIGGER IF NOT EXISTS agents_head_freshness_au
34347
+ AFTER UPDATE OF read_policy, policy_group ON agents
34348
+ WHEN OLD.read_policy IS NOT NEW.read_policy OR OLD.policy_group IS NOT NEW.policy_group
34349
+ BEGIN
34350
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
34351
+ WHERE agent_id IN (OLD.id, NEW.id)
34352
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'shared')
34353
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'group' AND policy_group IN (OLD.policy_group, NEW.policy_group));
34354
+ END;
34355
+ `);
34356
+ for (const table of ["memory_artifacts", "session_transcripts"]) {
34357
+ const exists = db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name=?").get(table);
34358
+ if (!exists)
34359
+ continue;
34360
+ const hasIsDeleted = db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === "is_deleted");
34361
+ const updateColumns = table === "session_transcripts" ? "content, agent_id, completed_at" : hasIsDeleted ? "content, agent_id, is_deleted" : "content, agent_id";
34362
+ 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" : ""}`;
34363
+ db.exec(`
34364
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_au
34365
+ AFTER UPDATE OF ${updateColumns} ON ${table}
34366
+ WHEN OLD.agent_id IS NOT NEW.agent_id OR ${contentChanged}
34367
+ BEGIN
34368
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
34369
+ WHERE agent_id IN (OLD.agent_id, NEW.agent_id);
34370
+ END;
34371
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_ad
34372
+ AFTER DELETE ON ${table}
34373
+ BEGIN
34374
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id = OLD.agent_id;
34375
+ END;
34376
+ `);
34377
+ }
34378
+ if (db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='session_summaries'").get()) {
34379
+ db.exec(`
34380
+ CREATE TRIGGER IF NOT EXISTS session_summaries_head_freshness_au
34381
+ AFTER UPDATE OF content, source_ref, source_type, depth, agent_id ON session_summaries
34382
+ 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)
34383
+ BEGIN
34384
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id IN (OLD.agent_id, NEW.agent_id);
34385
+ END;
34386
+ CREATE TRIGGER IF NOT EXISTS session_summaries_head_freshness_ad
34387
+ AFTER DELETE ON session_summaries
34388
+ WHEN OLD.depth = 0
34389
+ BEGIN
34390
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id = OLD.agent_id;
34391
+ END;
34392
+ `);
34393
+ }
34394
+ const safetyExists = db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='memory_content_safety'").get();
34395
+ if (safetyExists) {
34396
+ db.exec(`
34397
+ CREATE TRIGGER IF NOT EXISTS memory_content_safety_head_freshness_ai
34398
+ AFTER INSERT ON memory_content_safety
34399
+ WHEN NEW.status IS NOT 'clean' OR NEW.context_eligible IS NOT 1
34400
+ BEGIN
34401
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
34402
+ WHERE agent_id IN (NEW.agent_id)
34403
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy IN ('shared', 'group'));
34404
+ END;
34405
+
34406
+ CREATE TRIGGER IF NOT EXISTS memory_content_safety_head_freshness_au
34407
+ AFTER UPDATE OF context_eligible, agent_id, status ON memory_content_safety
34408
+ 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)
34409
+ 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)
34410
+ BEGIN
34411
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
34412
+ WHERE agent_id IN (OLD.agent_id, NEW.agent_id)
34413
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'shared')
34414
+ OR agent_id IN (SELECT id FROM agents WHERE read_policy = 'group');
34415
+ END;
34416
+ `);
34417
+ }
34418
+ for (const table of ["memory_artifact_tombstones", "imported_source_lifecycle"]) {
34419
+ const exists = db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name=?").get(table);
34420
+ if (!exists)
34421
+ continue;
34422
+ const lifecycleClause = table === "imported_source_lifecycle" ? " WHEN NEW.status = 'unsupported'" : "";
34423
+ const updateColumns = table === "imported_source_lifecycle" ? "agent_id, status" : "agent_id";
34424
+ const lifecycleUpdateClause = table === "imported_source_lifecycle" ? " AND NEW.status = 'unsupported'" : "";
34425
+ 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";
34426
+ db.exec(`
34427
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_ai
34428
+ AFTER INSERT ON ${table}${lifecycleClause}
34429
+ BEGIN
34430
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id = NEW.agent_id;
34431
+ END;
34432
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_au
34433
+ AFTER UPDATE OF ${updateColumns} ON ${table}
34434
+ WHEN ${lifecycleWhen}
34435
+ BEGIN
34436
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0
34437
+ WHERE agent_id IN (OLD.agent_id, NEW.agent_id);
34438
+ END;
34439
+ CREATE TRIGGER IF NOT EXISTS ${table}_head_freshness_ad
34440
+ AFTER DELETE ON ${table}
34441
+ BEGIN
34442
+ UPDATE memory_md_heads SET revision = revision + 1, is_current = 0 WHERE agent_id = OLD.agent_id;
34443
+ END;
34444
+ `);
34445
+ }
34446
+ }
33923
34447
  var MIGRATIONS2 = [
33924
34448
  {
33925
34449
  version: 1,
33926
34450
  name: "baseline",
33927
- up: up146,
34451
+ up: up151,
33928
34452
  artifacts: { tables: ["memories", "conversations", "embeddings"] }
33929
34453
  },
33930
34454
  {
@@ -34013,7 +34537,7 @@ var MIGRATIONS2 = [
34013
34537
  {
34014
34538
  version: 14,
34015
34539
  name: "telemetry",
34016
- up: up147,
34540
+ up: up1410,
34017
34541
  artifacts: { tables: ["telemetry_events"] }
34018
34542
  },
34019
34543
  {
@@ -35069,6 +35593,60 @@ var MIGRATIONS2 = [
35069
35593
  name: "dreaming-evidence-reviews",
35070
35594
  up: up1452,
35071
35595
  artifacts: { tables: ["dreaming_evidence_reviews"] }
35596
+ },
35597
+ {
35598
+ version: 146,
35599
+ name: "source-transcript-import",
35600
+ up: up1462,
35601
+ artifacts: {
35602
+ tables: [
35603
+ "source_import_jobs",
35604
+ "source_import_files",
35605
+ "source_import_records",
35606
+ "transcript_import_conversations",
35607
+ "source_import_record_attempts"
35608
+ ],
35609
+ columns: [
35610
+ { table: "session_transcripts", column: "source_id" },
35611
+ { table: "session_transcripts", column: "source_record_id" },
35612
+ { table: "session_transcripts", column: "source_meta_json" }
35613
+ ]
35614
+ }
35615
+ },
35616
+ {
35617
+ version: 147,
35618
+ name: "source-import-replay-file-slots",
35619
+ up: up1472,
35620
+ artifacts: { tables: ["source_import_files"] }
35621
+ },
35622
+ {
35623
+ version: 148,
35624
+ name: "source-import-attempt-provenance",
35625
+ up: up1482,
35626
+ artifacts: { columns: [{ table: "source_import_record_attempts", column: "source_id" }] }
35627
+ },
35628
+ {
35629
+ version: 149,
35630
+ name: "transcript-import-state-machine",
35631
+ up: up1492,
35632
+ artifacts: {
35633
+ columns: [
35634
+ { table: "source_import_jobs", column: "duplicate_mode" },
35635
+ { table: "source_import_jobs", column: "next_attempt_at" },
35636
+ { table: "source_import_files", column: "error" }
35637
+ ]
35638
+ }
35639
+ },
35640
+ {
35641
+ version: 150,
35642
+ name: "memory-head-freshness",
35643
+ up: up1502,
35644
+ artifacts: {
35645
+ columns: [
35646
+ { table: "memory_md_heads", column: "is_current" },
35647
+ { table: "dreaming_passes", column: "head_base_revision" }
35648
+ ]
35649
+ }
35072
35650
  }
35073
35651
  ];
35074
35652
  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-kimi",
3
- "version": "0.216.7",
3
+ "version": "0.217.3",
4
4
  "description": "Signet connector for Kimi CLI / Kimi Code",
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",