@signetai/connector-kimi 0.207.2 → 0.208.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.
Files changed (2) hide show
  1. package/dist/index.js +101 -5
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { join as join4 } from "node:path";
5
5
 
6
6
  // ../../../libs/connector-base/dist/index.js
7
7
  import { randomBytes } from "node:crypto";
8
- import { existsSync, readFileSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
8
+ import { existsSync, readFileSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
9
9
  import { dirname as dirname2, isAbsolute, join as join3, relative, sep } from "node:path";
10
10
  import { createRequire } from "node:module";
11
11
  import { dirname, join } from "node:path";
@@ -15704,6 +15704,34 @@ function up135(db) {
15704
15704
  ON memory_head_publications(agent_id, status, revision DESC);
15705
15705
  `);
15706
15706
  }
15707
+ function up136(db) {
15708
+ const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r2) => r2.name));
15709
+ for (const [name, type] of [
15710
+ ["entry_id", "TEXT"],
15711
+ ["entry_text", "TEXT"],
15712
+ ["operation", "TEXT"],
15713
+ ["source_refs_json", "TEXT"],
15714
+ ["supporting_quotes_json", "TEXT"]
15715
+ ]) {
15716
+ if (!cols.has(name))
15717
+ db.exec(`ALTER TABLE memory_head_revisions ADD COLUMN ${name} ${type}`);
15718
+ }
15719
+ db.exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_memory_head_revisions_entry ON memory_head_revisions(agent_id, revision, entry_id)");
15720
+ }
15721
+ function up137(db) {
15722
+ const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r2) => r2.name));
15723
+ for (const [name, type] of [
15724
+ ["head_revision", "INTEGER"],
15725
+ ["head_hash", "TEXT"],
15726
+ ["head_added", "INTEGER NOT NULL DEFAULT 0"],
15727
+ ["head_updated", "INTEGER NOT NULL DEFAULT 0"],
15728
+ ["head_removed", "INTEGER NOT NULL DEFAULT 0"],
15729
+ ["head_deferred", "INTEGER NOT NULL DEFAULT 0"],
15730
+ ["head_no_op", "INTEGER NOT NULL DEFAULT 0"]
15731
+ ])
15732
+ if (!cols.has(name))
15733
+ db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${name} ${type}`);
15734
+ }
15707
15735
  var MIGRATIONS = [
15708
15736
  {
15709
15737
  version: 1,
@@ -16776,6 +16804,23 @@ var MIGRATIONS = [
16776
16804
  name: "memory-head-publication",
16777
16805
  up: up135,
16778
16806
  artifacts: { tables: ["memory_head_publications"] }
16807
+ },
16808
+ {
16809
+ version: 136,
16810
+ name: "memory-head-revisions",
16811
+ up: up136,
16812
+ artifacts: { tables: ["memory_head_revisions"] }
16813
+ },
16814
+ {
16815
+ version: 137,
16816
+ name: "dreaming-head-manifest",
16817
+ up: up137,
16818
+ artifacts: {
16819
+ columns: [
16820
+ { table: "dreaming_passes", column: "head_revision" },
16821
+ { table: "dreaming_passes", column: "head_hash" }
16822
+ ]
16823
+ }
16779
16824
  }
16780
16825
  ];
16781
16826
  var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
@@ -17171,6 +17216,12 @@ class BaseConnector {
17171
17216
  const cleaned = stripSignetBlock(raw);
17172
17217
  if (cleaned === raw)
17173
17218
  return null;
17219
+ const root = realpathSync(basePath);
17220
+ const parent = realpathSync(dirname2(agentsPath));
17221
+ const rel = relative(root, join3(parent, "AGENTS.md"));
17222
+ if (rel.startsWith("..") || isAbsolute(rel)) {
17223
+ throw new Error(`Target path escapes validated root: ${agentsPath}`);
17224
+ }
17174
17225
  const tmp = join3(basePath, `.${randomBytes(6).toString("hex")}.tmp`);
17175
17226
  try {
17176
17227
  writeFileSync(tmp, cleaned, "utf-8");
@@ -28616,7 +28667,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
28616
28667
  return true;
28617
28668
  return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
28618
28669
  }
28619
- function up136(db) {
28670
+ function up138(db) {
28620
28671
  db.exec(`
28621
28672
  CREATE TABLE IF NOT EXISTS schema_migrations (
28622
28673
  version INTEGER PRIMARY KEY,
@@ -29100,7 +29151,7 @@ function addColumnIfMissing52(db, table, column, definition) {
29100
29151
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
29101
29152
  }
29102
29153
  }
29103
- function up137(db) {
29154
+ function up139(db) {
29104
29155
  db.exec(`
29105
29156
  CREATE TABLE IF NOT EXISTS ingestion_jobs (
29106
29157
  id TEXT PRIMARY KEY,
@@ -32941,11 +32992,39 @@ function up1352(db) {
32941
32992
  ON memory_head_publications(agent_id, status, revision DESC);
32942
32993
  `);
32943
32994
  }
32995
+ function up1362(db) {
32996
+ const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r3) => r3.name));
32997
+ for (const [name, type] of [
32998
+ ["entry_id", "TEXT"],
32999
+ ["entry_text", "TEXT"],
33000
+ ["operation", "TEXT"],
33001
+ ["source_refs_json", "TEXT"],
33002
+ ["supporting_quotes_json", "TEXT"]
33003
+ ]) {
33004
+ if (!cols.has(name))
33005
+ db.exec(`ALTER TABLE memory_head_revisions ADD COLUMN ${name} ${type}`);
33006
+ }
33007
+ db.exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_memory_head_revisions_entry ON memory_head_revisions(agent_id, revision, entry_id)");
33008
+ }
33009
+ function up1372(db) {
33010
+ const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r3) => r3.name));
33011
+ for (const [name, type] of [
33012
+ ["head_revision", "INTEGER"],
33013
+ ["head_hash", "TEXT"],
33014
+ ["head_added", "INTEGER NOT NULL DEFAULT 0"],
33015
+ ["head_updated", "INTEGER NOT NULL DEFAULT 0"],
33016
+ ["head_removed", "INTEGER NOT NULL DEFAULT 0"],
33017
+ ["head_deferred", "INTEGER NOT NULL DEFAULT 0"],
33018
+ ["head_no_op", "INTEGER NOT NULL DEFAULT 0"]
33019
+ ])
33020
+ if (!cols.has(name))
33021
+ db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${name} ${type}`);
33022
+ }
32944
33023
  var MIGRATIONS2 = [
32945
33024
  {
32946
33025
  version: 1,
32947
33026
  name: "baseline",
32948
- up: up136,
33027
+ up: up138,
32949
33028
  artifacts: { tables: ["memories", "conversations", "embeddings"] }
32950
33029
  },
32951
33030
  {
@@ -33023,7 +33102,7 @@ var MIGRATIONS2 = [
33023
33102
  {
33024
33103
  version: 13,
33025
33104
  name: "ingestion-tracking",
33026
- up: up137,
33105
+ up: up139,
33027
33106
  artifacts: {
33028
33107
  columns: [
33029
33108
  { table: "memories", column: "source_path" },
@@ -34013,6 +34092,23 @@ var MIGRATIONS2 = [
34013
34092
  name: "memory-head-publication",
34014
34093
  up: up1352,
34015
34094
  artifacts: { tables: ["memory_head_publications"] }
34095
+ },
34096
+ {
34097
+ version: 136,
34098
+ name: "memory-head-revisions",
34099
+ up: up1362,
34100
+ artifacts: { tables: ["memory_head_revisions"] }
34101
+ },
34102
+ {
34103
+ version: 137,
34104
+ name: "dreaming-head-manifest",
34105
+ up: up1372,
34106
+ artifacts: {
34107
+ columns: [
34108
+ { table: "dreaming_passes", column: "head_revision" },
34109
+ { table: "dreaming_passes", column: "head_hash" }
34110
+ ]
34111
+ }
34016
34112
  }
34017
34113
  ];
34018
34114
  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.207.2",
3
+ "version": "0.208.0",
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.207.2",
28
- "@signetai/core": "0.207.2"
27
+ "@signetai/connector-base": "0.208.0",
28
+ "@signetai/core": "0.208.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^22.0.0",