@signetai/connector-codex 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
@@ -7,7 +7,7 @@ import { basename as basename3, dirname as dirname6, join as join4 } from "node:
7
7
 
8
8
  // ../../../libs/connector-base/dist/index.js
9
9
  import { randomBytes } from "node:crypto";
10
- import { existsSync, readFileSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
10
+ import { existsSync, readFileSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
11
11
  import { dirname as dirname2, isAbsolute, join as join3, relative, sep } from "node:path";
12
12
  import { createRequire } from "node:module";
13
13
  import { dirname, join } from "node:path";
@@ -15706,6 +15706,34 @@ function up135(db) {
15706
15706
  ON memory_head_publications(agent_id, status, revision DESC);
15707
15707
  `);
15708
15708
  }
15709
+ function up136(db) {
15710
+ const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r2) => r2.name));
15711
+ for (const [name, type] of [
15712
+ ["entry_id", "TEXT"],
15713
+ ["entry_text", "TEXT"],
15714
+ ["operation", "TEXT"],
15715
+ ["source_refs_json", "TEXT"],
15716
+ ["supporting_quotes_json", "TEXT"]
15717
+ ]) {
15718
+ if (!cols.has(name))
15719
+ db.exec(`ALTER TABLE memory_head_revisions ADD COLUMN ${name} ${type}`);
15720
+ }
15721
+ db.exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_memory_head_revisions_entry ON memory_head_revisions(agent_id, revision, entry_id)");
15722
+ }
15723
+ function up137(db) {
15724
+ const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r2) => r2.name));
15725
+ for (const [name, type] of [
15726
+ ["head_revision", "INTEGER"],
15727
+ ["head_hash", "TEXT"],
15728
+ ["head_added", "INTEGER NOT NULL DEFAULT 0"],
15729
+ ["head_updated", "INTEGER NOT NULL DEFAULT 0"],
15730
+ ["head_removed", "INTEGER NOT NULL DEFAULT 0"],
15731
+ ["head_deferred", "INTEGER NOT NULL DEFAULT 0"],
15732
+ ["head_no_op", "INTEGER NOT NULL DEFAULT 0"]
15733
+ ])
15734
+ if (!cols.has(name))
15735
+ db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${name} ${type}`);
15736
+ }
15709
15737
  var MIGRATIONS = [
15710
15738
  {
15711
15739
  version: 1,
@@ -16778,6 +16806,23 @@ var MIGRATIONS = [
16778
16806
  name: "memory-head-publication",
16779
16807
  up: up135,
16780
16808
  artifacts: { tables: ["memory_head_publications"] }
16809
+ },
16810
+ {
16811
+ version: 136,
16812
+ name: "memory-head-revisions",
16813
+ up: up136,
16814
+ artifacts: { tables: ["memory_head_revisions"] }
16815
+ },
16816
+ {
16817
+ version: 137,
16818
+ name: "dreaming-head-manifest",
16819
+ up: up137,
16820
+ artifacts: {
16821
+ columns: [
16822
+ { table: "dreaming_passes", column: "head_revision" },
16823
+ { table: "dreaming_passes", column: "head_hash" }
16824
+ ]
16825
+ }
16781
16826
  }
16782
16827
  ];
16783
16828
  var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
@@ -17253,6 +17298,12 @@ class BaseConnector {
17253
17298
  const cleaned = stripSignetBlock(raw);
17254
17299
  if (cleaned === raw)
17255
17300
  return null;
17301
+ const root = realpathSync(basePath);
17302
+ const parent = realpathSync(dirname2(agentsPath));
17303
+ const rel = relative(root, join3(parent, "AGENTS.md"));
17304
+ if (rel.startsWith("..") || isAbsolute(rel)) {
17305
+ throw new Error(`Target path escapes validated root: ${agentsPath}`);
17306
+ }
17256
17307
  const tmp = join3(basePath, `.${randomBytes(6).toString("hex")}.tmp`);
17257
17308
  try {
17258
17309
  writeFileSync(tmp, cleaned, "utf-8");
@@ -28735,7 +28786,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
28735
28786
  return true;
28736
28787
  return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
28737
28788
  }
28738
- function up136(db) {
28789
+ function up138(db) {
28739
28790
  db.exec(`
28740
28791
  CREATE TABLE IF NOT EXISTS schema_migrations (
28741
28792
  version INTEGER PRIMARY KEY,
@@ -29219,7 +29270,7 @@ function addColumnIfMissing52(db, table, column, definition) {
29219
29270
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
29220
29271
  }
29221
29272
  }
29222
- function up137(db) {
29273
+ function up139(db) {
29223
29274
  db.exec(`
29224
29275
  CREATE TABLE IF NOT EXISTS ingestion_jobs (
29225
29276
  id TEXT PRIMARY KEY,
@@ -33060,11 +33111,39 @@ function up1352(db) {
33060
33111
  ON memory_head_publications(agent_id, status, revision DESC);
33061
33112
  `);
33062
33113
  }
33114
+ function up1362(db) {
33115
+ const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r3) => r3.name));
33116
+ for (const [name, type] of [
33117
+ ["entry_id", "TEXT"],
33118
+ ["entry_text", "TEXT"],
33119
+ ["operation", "TEXT"],
33120
+ ["source_refs_json", "TEXT"],
33121
+ ["supporting_quotes_json", "TEXT"]
33122
+ ]) {
33123
+ if (!cols.has(name))
33124
+ db.exec(`ALTER TABLE memory_head_revisions ADD COLUMN ${name} ${type}`);
33125
+ }
33126
+ db.exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_memory_head_revisions_entry ON memory_head_revisions(agent_id, revision, entry_id)");
33127
+ }
33128
+ function up1372(db) {
33129
+ const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r3) => r3.name));
33130
+ for (const [name, type] of [
33131
+ ["head_revision", "INTEGER"],
33132
+ ["head_hash", "TEXT"],
33133
+ ["head_added", "INTEGER NOT NULL DEFAULT 0"],
33134
+ ["head_updated", "INTEGER NOT NULL DEFAULT 0"],
33135
+ ["head_removed", "INTEGER NOT NULL DEFAULT 0"],
33136
+ ["head_deferred", "INTEGER NOT NULL DEFAULT 0"],
33137
+ ["head_no_op", "INTEGER NOT NULL DEFAULT 0"]
33138
+ ])
33139
+ if (!cols.has(name))
33140
+ db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${name} ${type}`);
33141
+ }
33063
33142
  var MIGRATIONS2 = [
33064
33143
  {
33065
33144
  version: 1,
33066
33145
  name: "baseline",
33067
- up: up136,
33146
+ up: up138,
33068
33147
  artifacts: { tables: ["memories", "conversations", "embeddings"] }
33069
33148
  },
33070
33149
  {
@@ -33142,7 +33221,7 @@ var MIGRATIONS2 = [
33142
33221
  {
33143
33222
  version: 13,
33144
33223
  name: "ingestion-tracking",
33145
- up: up137,
33224
+ up: up139,
33146
33225
  artifacts: {
33147
33226
  columns: [
33148
33227
  { table: "memories", column: "source_path" },
@@ -34132,6 +34211,23 @@ var MIGRATIONS2 = [
34132
34211
  name: "memory-head-publication",
34133
34212
  up: up1352,
34134
34213
  artifacts: { tables: ["memory_head_publications"] }
34214
+ },
34215
+ {
34216
+ version: 136,
34217
+ name: "memory-head-revisions",
34218
+ up: up1362,
34219
+ artifacts: { tables: ["memory_head_revisions"] }
34220
+ },
34221
+ {
34222
+ version: 137,
34223
+ name: "dreaming-head-manifest",
34224
+ up: up1372,
34225
+ artifacts: {
34226
+ columns: [
34227
+ { table: "dreaming_passes", column: "head_revision" },
34228
+ { table: "dreaming_passes", column: "head_hash" }
34229
+ ]
34230
+ }
34135
34231
  }
34136
34232
  ];
34137
34233
  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-codex",
3
- "version": "0.207.2",
3
+ "version": "0.208.0",
4
4
  "description": "Signet connector for Codex 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.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",