@signetai/connector-hermes-agent 0.227.1 → 0.228.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 +409 -133
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // ../../../platform/core/dist/index.js
2
2
  import { createRequire } from "node:module";
3
- import { dirname, join } from "node:path";
3
+ import { dirname, join, resolve } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import {
6
6
  execFile as nodeExecFile,
@@ -12,15 +12,16 @@ import {
12
12
  import { promisify } from "node:util";
13
13
  import { createHash } from "node:crypto";
14
14
  import { homedir as homedir2 } from "node:os";
15
- import { join as join2, resolve } from "node:path";
15
+ import { join as join2, resolve as resolve2 } from "node:path";
16
+ import { constants as fsConstants } from "node:fs";
16
17
  import { createRequire as createRequire2 } from "node:module";
17
18
  import { homedir as homedir5 } from "node:os";
18
- import { dirname as dirname5, join as join9, resolve as resolve3 } from "node:path";
19
+ import { dirname as dirname6, join as join14, resolve as resolve8 } from "node:path";
19
20
  import { homedir as homedir6, platform as platform2 } from "node:os";
20
- import { basename, dirname as dirname6, resolve as resolve5 } from "node:path";
21
- import { existsSync as existsSync12, readFileSync as readFileSync9, realpathSync, statSync as statSync7 } from "node:fs";
21
+ import { basename, dirname as dirname7, resolve as resolve9 } from "node:path";
22
+ import { existsSync as existsSync16, readFileSync as readFileSync13, realpathSync, statSync as statSync8 } from "node:fs";
22
23
  import { homedir as homedir7 } from "node:os";
23
- import { dirname as dirname7, join as join12 } from "node:path";
24
+ import { dirname as dirname8, join as join16 } from "node:path";
24
25
  import { homedir as homedir8 } from "node:os";
25
26
  var __create = Object.create;
26
27
  var __getProtoOf = Object.getPrototypeOf;
@@ -15903,6 +15904,102 @@ function up159(db) {
15903
15904
  ON memories(agent_id, memory_kind);
15904
15905
  `);
15905
15906
  }
15907
+ var ledgerColumns = [
15908
+ "key",
15909
+ "agent_id",
15910
+ "workspace_id",
15911
+ "file_name",
15912
+ "status",
15913
+ "original_path",
15914
+ "sha256",
15915
+ "size_bytes",
15916
+ "request_fingerprint",
15917
+ "source_id",
15918
+ "lease_token",
15919
+ "lease_expires_at",
15920
+ "attempt_count",
15921
+ "error",
15922
+ "created_at",
15923
+ "updated_at"
15924
+ ];
15925
+ function columns(db, table) {
15926
+ return new Set(db.prepare(`PRAGMA table_info(${table})`).all().map((row) => String(row.name)));
15927
+ }
15928
+ function addMissingColumns(db, table, definitions) {
15929
+ const present = columns(db, table);
15930
+ for (const definition of definitions) {
15931
+ const name = definition.split(" ", 1)[0];
15932
+ if (!present.has(name))
15933
+ db.exec(`ALTER TABLE ${table} ADD COLUMN ${definition}`);
15934
+ }
15935
+ }
15936
+ function rebuildLedgerWithoutGlobalKeyPrimaryKey(db) {
15937
+ const keyInfo = db.prepare("PRAGMA table_info(import_admission_ledger)").all().find((row) => row.name === "key");
15938
+ if (!keyInfo || Number(keyInfo.pk) === 0)
15939
+ return;
15940
+ const savepoint = "migration_158_rebuild_ledger";
15941
+ db.exec(`SAVEPOINT ${savepoint}`);
15942
+ try {
15943
+ db.exec(`
15944
+ CREATE TABLE import_admission_ledger_v158 (
15945
+ key TEXT NOT NULL, agent_id TEXT NOT NULL DEFAULT '', workspace_id TEXT NOT NULL DEFAULT '',
15946
+ file_name TEXT NOT NULL, status TEXT NOT NULL CHECK (status IN ('pending','processing','imported','duplicate','failed','quarantined','original_unavailable')),
15947
+ original_path TEXT NOT NULL, sha256 TEXT NOT NULL, size_bytes INTEGER NOT NULL,
15948
+ request_fingerprint TEXT NOT NULL DEFAULT '', source_id TEXT, lease_token TEXT, lease_expires_at TEXT,
15949
+ attempt_count INTEGER NOT NULL DEFAULT 0, error TEXT, created_at TEXT NOT NULL, updated_at TEXT NOT NULL
15950
+ );
15951
+ INSERT INTO import_admission_ledger_v158 (${ledgerColumns.join(",")})
15952
+ SELECT ${ledgerColumns.join(",")} FROM import_admission_ledger;
15953
+ DROP TABLE import_admission_ledger;
15954
+ ALTER TABLE import_admission_ledger_v158 RENAME TO import_admission_ledger;
15955
+ `);
15956
+ db.exec(`RELEASE ${savepoint}`);
15957
+ } catch (error) {
15958
+ try {
15959
+ db.exec(`ROLLBACK TO SAVEPOINT ${savepoint}`);
15960
+ } finally {
15961
+ try {
15962
+ db.exec(`RELEASE ${savepoint}`);
15963
+ } catch {}
15964
+ }
15965
+ throw error;
15966
+ }
15967
+ }
15968
+ function up160(db) {
15969
+ db.exec(`
15970
+ CREATE TABLE IF NOT EXISTS import_admission_ledger (
15971
+ key TEXT NOT NULL, agent_id TEXT NOT NULL, workspace_id TEXT NOT NULL DEFAULT '', file_name TEXT NOT NULL,
15972
+ status TEXT NOT NULL CHECK (status IN ('pending','processing','imported','duplicate','failed','quarantined','original_unavailable')),
15973
+ original_path TEXT NOT NULL, sha256 TEXT NOT NULL, size_bytes INTEGER NOT NULL,
15974
+ request_fingerprint TEXT NOT NULL DEFAULT '', source_id TEXT, lease_token TEXT, lease_expires_at TEXT,
15975
+ attempt_count INTEGER NOT NULL DEFAULT 0, error TEXT, created_at TEXT NOT NULL, updated_at TEXT NOT NULL
15976
+ );
15977
+ CREATE TABLE IF NOT EXISTS import_admission_events (
15978
+ id INTEGER PRIMARY KEY AUTOINCREMENT, admission_key TEXT NOT NULL, agent_id TEXT NOT NULL DEFAULT '',
15979
+ workspace_id TEXT NOT NULL DEFAULT '', event TEXT NOT NULL, created_at TEXT NOT NULL
15980
+ );
15981
+ `);
15982
+ addMissingColumns(db, "import_admission_ledger", [
15983
+ "agent_id TEXT NOT NULL DEFAULT ''",
15984
+ "workspace_id TEXT NOT NULL DEFAULT ''",
15985
+ "request_fingerprint TEXT NOT NULL DEFAULT ''",
15986
+ "source_id TEXT",
15987
+ "lease_token TEXT",
15988
+ "lease_expires_at TEXT",
15989
+ "attempt_count INTEGER NOT NULL DEFAULT 0",
15990
+ "error TEXT"
15991
+ ]);
15992
+ addMissingColumns(db, "import_admission_events", [
15993
+ "agent_id TEXT NOT NULL DEFAULT ''",
15994
+ "workspace_id TEXT NOT NULL DEFAULT ''"
15995
+ ]);
15996
+ rebuildLedgerWithoutGlobalKeyPrimaryKey(db);
15997
+ db.exec(`
15998
+ CREATE UNIQUE INDEX IF NOT EXISTS uq_import_admission_scope_key ON import_admission_ledger(key, agent_id, workspace_id);
15999
+ CREATE INDEX IF NOT EXISTS idx_import_admission_status ON import_admission_ledger(agent_id, workspace_id, status, updated_at);
16000
+ CREATE INDEX IF NOT EXISTS idx_import_admission_events_key ON import_admission_events(admission_key, agent_id, workspace_id, id);
16001
+ `);
16002
+ }
15906
16003
  var MIGRATIONS = [
15907
16004
  {
15908
16005
  version: 1,
@@ -17191,6 +17288,18 @@ var MIGRATIONS = [
17191
17288
  version: 159,
17192
17289
  name: "retire-obsolete-invocation-ledger",
17193
17290
  up: up5
17291
+ },
17292
+ {
17293
+ version: 160,
17294
+ name: "import-admission-ledger",
17295
+ up: up160,
17296
+ artifacts: {
17297
+ tables: ["import_admission_ledger", "import_admission_events"],
17298
+ indexes: ["idx_import_admission_status", "idx_import_admission_events_key"],
17299
+ columns: [
17300
+ ...["workspace_id", "request_fingerprint", "source_id", "lease_token", "lease_expires_at", "attempt_count"].map((column) => ({ table: "import_admission_ledger", column }))
17301
+ ]
17302
+ }
17194
17303
  }
17195
17304
  ];
17196
17305
  var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
@@ -17205,30 +17314,17 @@ function expandHome(p2, home = homedir2()) {
17205
17314
  return join2(home, p2.slice(2));
17206
17315
  return p2;
17207
17316
  }
17208
- var STATES = new Set([
17209
- "found",
17210
- "missing",
17211
- "locked",
17212
- "unavailable",
17213
- "permission-denied",
17214
- "corrupt",
17215
- "unsupported"
17216
- ]);
17217
- var mutation = Promise.resolve();
17218
- var LOOPBACK_HOST = "127.0.0.1";
17219
- var LOCAL_BINDS = new Set([LOOPBACK_HOST, "localhost", "::1", "::ffff:127.0.0.1"]);
17220
- var import_yaml2 = __toESM(require_dist(), 1);
17221
- var native = null;
17222
- try {
17223
- const esmRequire = createRequire2(import.meta.url);
17224
- native = esmRequire("@signet/native");
17225
- } catch {}
17226
- var GRAPHIQ_DEFAULT_INSTALL_DIR = join9(homedir5(), ".local", "bin");
17227
17317
  var SIGNET_SOURCE_CHECKOUT_DIRNAME = "signetai";
17228
17318
  var SIGNET_GIT_ALLOWED_DIRECTORIES = ["skills", "tools", "dreaming"];
17229
17319
  var SIGNET_GIT_PROTECTED_PATHS = [
17230
17320
  ".daemon",
17321
+ ".secrets",
17231
17322
  ".shadow",
17323
+ "cache",
17324
+ "data",
17325
+ "files",
17326
+ "runtime",
17327
+ "workspace-layout.json",
17232
17328
  "node_modules",
17233
17329
  ":(glob)**/node_modules/**",
17234
17330
  `${SIGNET_SOURCE_CHECKOUT_DIRNAME}`,
@@ -17267,7 +17363,13 @@ var SIGNET_GIT_TRACKED_PATHS = [
17267
17363
  ];
17268
17364
  var SIGNET_GITIGNORE_PROTECTED_PATTERNS = [
17269
17365
  ".daemon/",
17366
+ ".secrets/",
17270
17367
  ".shadow/",
17368
+ "cache/",
17369
+ "data/",
17370
+ "files/",
17371
+ "runtime/",
17372
+ "workspace-layout.json",
17271
17373
  "node_modules/",
17272
17374
  `${SIGNET_SOURCE_CHECKOUT_DIRNAME}/`,
17273
17375
  "memory/memories.db*",
@@ -17287,17 +17389,53 @@ var SIGNET_GITIGNORE_PROTECTED_PATTERNS = [
17287
17389
  "*.sqlite",
17288
17390
  "*.sqlite3"
17289
17391
  ];
17392
+ var DESCRIPTOR_ROOT = process.platform === "linux" ? "/proc/self/fd" : process.platform === "darwin" ? "/dev/fd" : undefined;
17393
+ var DIRECTORY_FLAGS = fsConstants.O_RDONLY | (fsConstants.O_DIRECTORY ?? 0) | (fsConstants.O_NOFOLLOW ?? 0);
17394
+ var FILE_FLAGS = fsConstants.O_RDONLY | (fsConstants.O_NOFOLLOW ?? 0) | (fsConstants.O_NONBLOCK ?? 0);
17395
+ var NOFOLLOW = fsConstants.O_NOFOLLOW ?? 0;
17396
+ var PROTECTION_COMPONENT_IDS = [
17397
+ "root-authored",
17398
+ "skills",
17399
+ "managed-originals",
17400
+ "sqlite",
17401
+ "transcripts",
17402
+ "external-sources",
17403
+ "runtime",
17404
+ "filesystem-cache",
17405
+ "secrets"
17406
+ ];
17407
+ var ORDER = new Map(PROTECTION_COMPONENT_IDS.map((id, index) => [id, index]));
17408
+ var BLOCKING = new Set(["missing", "stale", "degraded"]);
17409
+ var STATES = new Set([
17410
+ "found",
17411
+ "missing",
17412
+ "locked",
17413
+ "unavailable",
17414
+ "permission-denied",
17415
+ "corrupt",
17416
+ "unsupported"
17417
+ ]);
17418
+ var mutation = Promise.resolve();
17419
+ var LOOPBACK_HOST = "127.0.0.1";
17420
+ var LOCAL_BINDS = new Set([LOOPBACK_HOST, "localhost", "::1", "::ffff:127.0.0.1"]);
17421
+ var import_yaml2 = __toESM(require_dist(), 1);
17422
+ var native = null;
17423
+ try {
17424
+ const esmRequire = createRequire2(import.meta.url);
17425
+ native = esmRequire("@signet/native");
17426
+ } catch {}
17427
+ var GRAPHIQ_DEFAULT_INSTALL_DIR = join14(homedir5(), ".local", "bin");
17290
17428
  var DEFAULT_DISCORD_DESKTOP_CACHE_PATH = defaultDiscordDesktopCachePath();
17291
17429
  var DEFAULT_GITHUB_RESOURCE_TYPES = ["issues", "pulls", "discussions", "docs"];
17292
17430
  var VALID_GITHUB_RESOURCE_TYPES = new Set(DEFAULT_GITHUB_RESOURCE_TYPES);
17293
17431
  function defaultDiscordDesktopCachePath() {
17294
17432
  switch (platform2()) {
17295
17433
  case "darwin":
17296
- return resolve5(homedir6(), "Library", "Application Support", "discord");
17434
+ return resolve9(homedir6(), "Library", "Application Support", "discord");
17297
17435
  case "win32":
17298
- return resolve5(process.env.APPDATA || resolve5(homedir6(), "AppData", "Roaming"), "discord");
17436
+ return resolve9(process.env.APPDATA || resolve9(homedir6(), "AppData", "Roaming"), "discord");
17299
17437
  default:
17300
- return resolve5(process.env.XDG_CONFIG_HOME || resolve5(homedir6(), ".config"), "discord");
17438
+ return resolve9(process.env.XDG_CONFIG_HOME || resolve9(homedir6(), ".config"), "discord");
17301
17439
  }
17302
17440
  }
17303
17441
  var IDENTITY_FILES = {
@@ -17360,27 +17498,27 @@ function userHome() {
17360
17498
  }
17361
17499
  function resolveHermesHomePath() {
17362
17500
  const hermesHome = process.env.HERMES_HOME?.trim();
17363
- return hermesHome || join12(userHome(), ".hermes");
17501
+ return hermesHome || join16(userHome(), ".hermes");
17364
17502
  }
17365
17503
  function hermesAgentCandidateDirs() {
17366
17504
  const home = userHome();
17367
17505
  const hermesHome = resolveHermesHomePath();
17368
17506
  return [
17369
17507
  hermesHome,
17370
- join12(hermesHome, "hermes-agent"),
17371
- join12(home, "hermes-agent"),
17372
- join12(home, ".local", "share", "hermes-agent"),
17373
- join12(home, "src", "hermes-agent"),
17508
+ join16(hermesHome, "hermes-agent"),
17509
+ join16(home, "hermes-agent"),
17510
+ join16(home, ".local", "share", "hermes-agent"),
17511
+ join16(home, "src", "hermes-agent"),
17374
17512
  "/opt/hermes-agent"
17375
17513
  ];
17376
17514
  }
17377
17515
  function resolveHermesRepoPath() {
17378
17516
  const hermesRepo = process.env.HERMES_REPO?.trim();
17379
- if (hermesRepo && existsSync12(join12(hermesRepo, "plugins", "memory"))) {
17517
+ if (hermesRepo && existsSync16(join16(hermesRepo, "plugins", "memory"))) {
17380
17518
  return hermesRepo;
17381
17519
  }
17382
17520
  for (const base of hermesAgentCandidateDirs()) {
17383
- if (existsSync12(join12(base, "plugins", "memory")))
17521
+ if (existsSync16(join16(base, "plugins", "memory")))
17384
17522
  return base;
17385
17523
  }
17386
17524
  try {
@@ -17390,8 +17528,8 @@ function resolveHermesRepoPath() {
17390
17528
  timeout: 3000
17391
17529
  }).trim();
17392
17530
  if (hermesPath) {
17393
- const repoDir = dirname7(realpathSync(hermesPath));
17394
- if (existsSync12(join12(repoDir, "plugins", "memory")))
17531
+ const repoDir = dirname8(realpathSync(hermesPath));
17532
+ if (existsSync16(join16(repoDir, "plugins", "memory")))
17395
17533
  return repoDir;
17396
17534
  }
17397
17535
  } catch {}
@@ -17407,7 +17545,7 @@ import {
17407
17545
  existsSync as existsSync2,
17408
17546
  fstatSync,
17409
17547
  ftruncateSync,
17410
- lstatSync as lstatSync2,
17548
+ lstatSync,
17411
17549
  mkdirSync,
17412
17550
  openSync,
17413
17551
  readFileSync as readFileSync2,
@@ -17416,7 +17554,7 @@ import {
17416
17554
  writeSync
17417
17555
  } from "node:fs";
17418
17556
  import { homedir } from "node:os";
17419
- import { dirname as dirname8, isAbsolute as isAbsolute2, join as join6, relative as relative2, resolve as resolvePath, sep as sep2 } from "node:path";
17557
+ import { dirname as dirname5, isAbsolute as isAbsolute2, join as join6, relative as relative2, resolve as resolvePath, sep as sep2 } from "node:path";
17420
17558
  import { fileURLToPath as fileURLToPath3 } from "node:url";
17421
17559
 
17422
17560
  // ../../../libs/connector-base/dist/index.js
@@ -17424,7 +17562,7 @@ import { randomBytes } from "node:crypto";
17424
17562
  import { existsSync, readFileSync, realpathSync as realpathSync2, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
17425
17563
  import { dirname as dirname2, isAbsolute, join as join3, relative, sep } from "node:path";
17426
17564
  import { createRequire as createRequire3 } from "node:module";
17427
- import { dirname as dirname3, join as join4 } from "node:path";
17565
+ import { dirname as dirname3, join as join4, resolve as resolve3 } from "node:path";
17428
17566
  import { fileURLToPath as fileURLToPath2 } from "node:url";
17429
17567
  import {
17430
17568
  execFile as nodeExecFile2,
@@ -17435,14 +17573,15 @@ import {
17435
17573
  } from "node:child_process";
17436
17574
  import { promisify as promisify2 } from "node:util";
17437
17575
  import { createHash as createHash2 } from "node:crypto";
17576
+ import { constants as fsConstants2 } from "node:fs";
17438
17577
  import { createRequire as createRequire22 } from "node:module";
17439
17578
  import { homedir as homedir52 } from "node:os";
17440
- import { dirname as dirname52, join as join92, resolve as resolve32 } from "node:path";
17579
+ import { dirname as dirname62, join as join142, resolve as resolve82 } from "node:path";
17441
17580
  import { homedir as homedir62, platform as platform22 } from "node:os";
17442
- import { basename as basename2, dirname as dirname62, resolve as resolve52 } from "node:path";
17581
+ import { basename as basename2, dirname as dirname72, resolve as resolve92 } from "node:path";
17443
17582
  import { homedir as homedir82 } from "node:os";
17444
- import { existsSync as existsSync14, lstatSync, mkdirSync as mkdirSync8, readdirSync as readdirSync6, symlinkSync, unlinkSync as unlinkSync2 } from "node:fs";
17445
- import { join as join14 } from "node:path";
17583
+ import { existsSync as existsSync18, lstatSync as lstatSync3, mkdirSync as mkdirSync10, readdirSync as readdirSync9, symlinkSync as symlinkSync2, unlinkSync as unlinkSync2 } from "node:fs";
17584
+ import { join as join18 } from "node:path";
17446
17585
  var __create2 = Object.create;
17447
17586
  var __getProtoOf2 = Object.getPrototypeOf;
17448
17587
  var __defProp2 = Object.defineProperty;
@@ -28008,7 +28147,7 @@ var DAEMON_DERIVED_MEMORY_SOURCE_TYPES2 = [
28008
28147
  "checkpoint",
28009
28148
  "dreaming"
28010
28149
  ];
28011
- function up160(db) {
28150
+ function up161(db) {
28012
28151
  const hasColumn26 = (table, column) => {
28013
28152
  const statement = db.prepare(`SELECT 1 FROM pragma_table_info('${table}') WHERE name = ?`);
28014
28153
  try {
@@ -28075,8 +28214,8 @@ function up210(db) {
28075
28214
  `);
28076
28215
  }
28077
28216
  function addColumnIfMissing30(db, column, definition) {
28078
- const columns = db.prepare("PRAGMA table_info(transcript_capture_jobs)").all();
28079
- if (columns.some((row) => row.name === column))
28217
+ const columns2 = db.prepare("PRAGMA table_info(transcript_capture_jobs)").all();
28218
+ if (columns2.some((row) => row.name === column))
28080
28219
  return;
28081
28220
  db.exec(`ALTER TABLE transcript_capture_jobs ADD COLUMN ${column} ${definition}`);
28082
28221
  }
@@ -28957,8 +29096,8 @@ function up252(db) {
28957
29096
  addColumnIfMissing82(db, "session_memories", "structural_density", "INTEGER");
28958
29097
  }
28959
29098
  function up262(db) {
28960
- const columns = db.prepare("PRAGMA table_info(session_checkpoints)").all();
28961
- const columnNames = new Set(columns.flatMap((column) => typeof column.name === "string" ? [column.name] : []));
29099
+ const columns2 = db.prepare("PRAGMA table_info(session_checkpoints)").all();
29100
+ const columnNames = new Set(columns2.flatMap((column) => typeof column.name === "string" ? [column.name] : []));
28962
29101
  if (!columnNames.has("focal_entity_ids")) {
28963
29102
  db.exec("ALTER TABLE session_checkpoints ADD COLUMN focal_entity_ids TEXT");
28964
29103
  }
@@ -31270,8 +31409,8 @@ function up972(db) {
31270
31409
  `);
31271
31410
  }
31272
31411
  function up982(db) {
31273
- const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
31274
- if (!columns.some((column) => column.name === "evidence_cursor")) {
31412
+ const columns2 = db.prepare("PRAGMA table_info(dreaming_state)").all();
31413
+ if (!columns2.some((column) => column.name === "evidence_cursor")) {
31275
31414
  db.exec("ALTER TABLE dreaming_state ADD COLUMN evidence_cursor TEXT");
31276
31415
  }
31277
31416
  }
@@ -31315,8 +31454,8 @@ function up1012(db) {
31315
31454
  db.exec("DROP TABLE IF EXISTS ingestion_jobs");
31316
31455
  }
31317
31456
  function up1022(db) {
31318
- const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
31319
- if (!columns.some((column) => column.name === "last_failure_at")) {
31457
+ const columns2 = db.prepare("PRAGMA table_info(dreaming_state)").all();
31458
+ if (!columns2.some((column) => column.name === "last_failure_at")) {
31320
31459
  db.exec("ALTER TABLE dreaming_state ADD COLUMN last_failure_at TEXT");
31321
31460
  }
31322
31461
  db.exec("UPDATE dreaming_state SET last_failure_at = updated_at WHERE consecutive_failures > 0 AND last_failure_at IS NULL");
@@ -31359,11 +31498,11 @@ function up1042(db) {
31359
31498
  `);
31360
31499
  }
31361
31500
  function up1052(db) {
31362
- const columns = db.prepare("PRAGMA table_info(dreaming_passes)").all();
31363
- if (!columns.some((column) => column.name === "evidence_window_json")) {
31501
+ const columns2 = db.prepare("PRAGMA table_info(dreaming_passes)").all();
31502
+ if (!columns2.some((column) => column.name === "evidence_window_json")) {
31364
31503
  db.exec("ALTER TABLE dreaming_passes ADD COLUMN evidence_window_json TEXT");
31365
31504
  }
31366
- if (!columns.some((column) => column.name === "runbook_json")) {
31505
+ if (!columns2.some((column) => column.name === "runbook_json")) {
31367
31506
  db.exec("ALTER TABLE dreaming_passes ADD COLUMN runbook_json TEXT");
31368
31507
  }
31369
31508
  }
@@ -31802,8 +31941,8 @@ function hasTable42(db, table) {
31802
31941
  return db.prepare("SELECT 1 AS present FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
31803
31942
  }
31804
31943
  function addColumnIfMissing262(db, table, column, definition) {
31805
- const columns = db.prepare(`PRAGMA table_info(${table})`).all();
31806
- if (columns.some((row) => row.name === column))
31944
+ const columns2 = db.prepare(`PRAGMA table_info(${table})`).all();
31945
+ if (columns2.some((row) => row.name === column))
31807
31946
  return;
31808
31947
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
31809
31948
  }
@@ -31815,8 +31954,8 @@ function hashTranscript2(content) {
31815
31954
  return createHash2("sha256").update(content, "utf8").digest("hex");
31816
31955
  }
31817
31956
  function backfillTranscriptHashes2(db) {
31818
- const columns = tableColumns2(db, "session_transcripts");
31819
- if (!columns.has("content_hash") || !columns.has("content"))
31957
+ const columns2 = tableColumns2(db, "session_transcripts");
31958
+ if (!columns2.has("content_hash") || !columns2.has("content"))
31820
31959
  return;
31821
31960
  const rows = db.prepare("SELECT session_key, agent_id, content FROM session_transcripts WHERE content_hash IS NULL").all();
31822
31961
  const update = db.prepare("UPDATE session_transcripts SET content_hash = ? WHERE agent_id = ? AND session_key = ? AND content_hash IS NULL");
@@ -31842,8 +31981,8 @@ function laterTimestamp2(current, candidate) {
31842
31981
  }
31843
31982
  return candidate > current ? candidate : current;
31844
31983
  }
31845
- function isCompletionBoundary2(job, columns) {
31846
- return columns.has("trigger") && job.trigger === "session_end" || columns.has("boundary_reason") && COMPLETION_BOUNDARY_REASONS2.has(job.boundary_reason ?? "");
31984
+ function isCompletionBoundary2(job, columns2) {
31985
+ return columns2.has("trigger") && job.trigger === "session_end" || columns2.has("boundary_reason") && COMPLETION_BOUNDARY_REASONS2.has(job.boundary_reason ?? "");
31847
31986
  }
31848
31987
  function mergeTranscriptContent2(current, next) {
31849
31988
  if (current.length === 0)
@@ -32091,8 +32230,8 @@ function up1262(db) {
32091
32230
  `);
32092
32231
  }
32093
32232
  function up1272(db) {
32094
- const columns = db.prepare("PRAGMA table_info(dreaming_evidence_exclusions)").all();
32095
- const names = new Set(columns.map((column) => column.name));
32233
+ const columns2 = db.prepare("PRAGMA table_info(dreaming_evidence_exclusions)").all();
32234
+ const names = new Set(columns2.map((column) => column.name));
32096
32235
  if (!names.has("failure_class")) {
32097
32236
  db.exec("ALTER TABLE dreaming_evidence_exclusions ADD COLUMN failure_class TEXT NOT NULL DEFAULT 'unknown' CHECK (failure_class IN ('incomplete_transcript', 'source_projection', 'scope_mismatch', 'quote_mismatch', 'unknown'))");
32098
32237
  }
@@ -32504,8 +32643,8 @@ function up1382(db) {
32504
32643
  CREATE INDEX IF NOT EXISTS idx_memory_head_revision_entries_entry
32505
32644
  ON memory_head_revision_entries(agent_id, entry_id, revision DESC);
32506
32645
  `);
32507
- const columns = db.prepare("PRAGMA table_info(memory_md_heads)").all();
32508
- const names = new Set(columns.map((column) => String(column.name)));
32646
+ const columns2 = db.prepare("PRAGMA table_info(memory_md_heads)").all();
32647
+ const names = new Set(columns2.map((column) => String(column.name)));
32509
32648
  if (!names.has("revision_id"))
32510
32649
  db.exec("ALTER TABLE memory_md_heads ADD COLUMN revision_id TEXT");
32511
32650
  if (!names.has("pass_id"))
@@ -32931,13 +33070,13 @@ function up1462(db) {
32931
33070
  `);
32932
33071
  }
32933
33072
  function up1472(db) {
32934
- const columns = db.prepare("PRAGMA table_info(source_sync_checkpoints)").all();
32935
- if (!columns.some((column) => column.name === "frontier")) {
33073
+ const columns2 = db.prepare("PRAGMA table_info(source_sync_checkpoints)").all();
33074
+ if (!columns2.some((column) => column.name === "frontier")) {
32936
33075
  db.exec("ALTER TABLE source_sync_checkpoints ADD COLUMN frontier TEXT");
32937
33076
  }
32938
33077
  }
32939
33078
  function up1482(db) {
32940
- const columns = new Set(db.prepare("PRAGMA table_info(embedding_index_state)").all().map((row) => row.name).filter((name) => typeof name === "string"));
33079
+ const columns2 = new Set(db.prepare("PRAGMA table_info(embedding_index_state)").all().map((row) => row.name).filter((name) => typeof name === "string"));
32941
33080
  const additions = [
32942
33081
  ["migration_phase", "TEXT"],
32943
33082
  ["progress_staged", "INTEGER NOT NULL DEFAULT 0"],
@@ -32948,7 +33087,7 @@ function up1482(db) {
32948
33087
  ["provider_endpoint", "TEXT"]
32949
33088
  ];
32950
33089
  for (const [name, definition] of additions) {
32951
- if (!columns.has(name))
33090
+ if (!columns2.has(name))
32952
33091
  db.exec(`ALTER TABLE embedding_index_state ADD COLUMN ${name} ${definition}`);
32953
33092
  }
32954
33093
  db.exec(`
@@ -32972,8 +33111,8 @@ function up1482(db) {
32972
33111
  }
32973
33112
  }
32974
33113
  function up1492(db) {
32975
- const columns = new Set(db.prepare("PRAGMA table_info(memory_jobs)").all().map((row) => row.name).filter((name) => typeof name === "string"));
32976
- if (!columns.has("lease_token")) {
33114
+ const columns2 = new Set(db.prepare("PRAGMA table_info(memory_jobs)").all().map((row) => row.name).filter((name) => typeof name === "string"));
33115
+ if (!columns2.has("lease_token")) {
32977
33116
  db.exec("ALTER TABLE memory_jobs ADD COLUMN lease_token TEXT");
32978
33117
  }
32979
33118
  }
@@ -33066,8 +33205,8 @@ function up1522(db) {
33066
33205
  db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
33067
33206
  }
33068
33207
  function up1532(db) {
33069
- const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
33070
- if (!columns.some((column) => column.name === "source_id")) {
33208
+ const columns2 = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
33209
+ if (!columns2.some((column) => column.name === "source_id")) {
33071
33210
  db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
33072
33211
  }
33073
33212
  }
@@ -33088,8 +33227,8 @@ function up1542(db) {
33088
33227
  addColumn("source_import_files", "error", "TEXT");
33089
33228
  }
33090
33229
  function addColumnIfMissing292(db, table, column, definition) {
33091
- const columns = db.prepare(`PRAGMA table_info(${table})`).all();
33092
- if (!columns.some((row) => row.name === column))
33230
+ const columns2 = db.prepare(`PRAGMA table_info(${table})`).all();
33231
+ if (!columns2.some((row) => row.name === column))
33093
33232
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
33094
33233
  }
33095
33234
  function up1552(db) {
@@ -33289,8 +33428,8 @@ function up1572(db) {
33289
33428
  `);
33290
33429
  }
33291
33430
  function up1582(db) {
33292
- const columns = new Set(db.prepare("PRAGMA table_info(embedding_repair_checkpoints)").all().map((row) => row.name));
33293
- if (!columns.has("profile_fingerprint")) {
33431
+ const columns2 = new Set(db.prepare("PRAGMA table_info(embedding_repair_checkpoints)").all().map((row) => row.name));
33432
+ if (!columns2.has("profile_fingerprint")) {
33294
33433
  db.exec("ALTER TABLE embedding_repair_checkpoints ADD COLUMN profile_fingerprint TEXT");
33295
33434
  }
33296
33435
  db.exec(`
@@ -33309,6 +33448,102 @@ function up1592(db) {
33309
33448
  ON memories(agent_id, memory_kind);
33310
33449
  `);
33311
33450
  }
33451
+ var ledgerColumns2 = [
33452
+ "key",
33453
+ "agent_id",
33454
+ "workspace_id",
33455
+ "file_name",
33456
+ "status",
33457
+ "original_path",
33458
+ "sha256",
33459
+ "size_bytes",
33460
+ "request_fingerprint",
33461
+ "source_id",
33462
+ "lease_token",
33463
+ "lease_expires_at",
33464
+ "attempt_count",
33465
+ "error",
33466
+ "created_at",
33467
+ "updated_at"
33468
+ ];
33469
+ function columns2(db, table) {
33470
+ return new Set(db.prepare(`PRAGMA table_info(${table})`).all().map((row) => String(row.name)));
33471
+ }
33472
+ function addMissingColumns2(db, table, definitions) {
33473
+ const present = columns2(db, table);
33474
+ for (const definition of definitions) {
33475
+ const name = definition.split(" ", 1)[0];
33476
+ if (!present.has(name))
33477
+ db.exec(`ALTER TABLE ${table} ADD COLUMN ${definition}`);
33478
+ }
33479
+ }
33480
+ function rebuildLedgerWithoutGlobalKeyPrimaryKey2(db) {
33481
+ const keyInfo = db.prepare("PRAGMA table_info(import_admission_ledger)").all().find((row) => row.name === "key");
33482
+ if (!keyInfo || Number(keyInfo.pk) === 0)
33483
+ return;
33484
+ const savepoint = "migration_158_rebuild_ledger";
33485
+ db.exec(`SAVEPOINT ${savepoint}`);
33486
+ try {
33487
+ db.exec(`
33488
+ CREATE TABLE import_admission_ledger_v158 (
33489
+ key TEXT NOT NULL, agent_id TEXT NOT NULL DEFAULT '', workspace_id TEXT NOT NULL DEFAULT '',
33490
+ file_name TEXT NOT NULL, status TEXT NOT NULL CHECK (status IN ('pending','processing','imported','duplicate','failed','quarantined','original_unavailable')),
33491
+ original_path TEXT NOT NULL, sha256 TEXT NOT NULL, size_bytes INTEGER NOT NULL,
33492
+ request_fingerprint TEXT NOT NULL DEFAULT '', source_id TEXT, lease_token TEXT, lease_expires_at TEXT,
33493
+ attempt_count INTEGER NOT NULL DEFAULT 0, error TEXT, created_at TEXT NOT NULL, updated_at TEXT NOT NULL
33494
+ );
33495
+ INSERT INTO import_admission_ledger_v158 (${ledgerColumns2.join(",")})
33496
+ SELECT ${ledgerColumns2.join(",")} FROM import_admission_ledger;
33497
+ DROP TABLE import_admission_ledger;
33498
+ ALTER TABLE import_admission_ledger_v158 RENAME TO import_admission_ledger;
33499
+ `);
33500
+ db.exec(`RELEASE ${savepoint}`);
33501
+ } catch (error) {
33502
+ try {
33503
+ db.exec(`ROLLBACK TO SAVEPOINT ${savepoint}`);
33504
+ } finally {
33505
+ try {
33506
+ db.exec(`RELEASE ${savepoint}`);
33507
+ } catch {}
33508
+ }
33509
+ throw error;
33510
+ }
33511
+ }
33512
+ function up1602(db) {
33513
+ db.exec(`
33514
+ CREATE TABLE IF NOT EXISTS import_admission_ledger (
33515
+ key TEXT NOT NULL, agent_id TEXT NOT NULL, workspace_id TEXT NOT NULL DEFAULT '', file_name TEXT NOT NULL,
33516
+ status TEXT NOT NULL CHECK (status IN ('pending','processing','imported','duplicate','failed','quarantined','original_unavailable')),
33517
+ original_path TEXT NOT NULL, sha256 TEXT NOT NULL, size_bytes INTEGER NOT NULL,
33518
+ request_fingerprint TEXT NOT NULL DEFAULT '', source_id TEXT, lease_token TEXT, lease_expires_at TEXT,
33519
+ attempt_count INTEGER NOT NULL DEFAULT 0, error TEXT, created_at TEXT NOT NULL, updated_at TEXT NOT NULL
33520
+ );
33521
+ CREATE TABLE IF NOT EXISTS import_admission_events (
33522
+ id INTEGER PRIMARY KEY AUTOINCREMENT, admission_key TEXT NOT NULL, agent_id TEXT NOT NULL DEFAULT '',
33523
+ workspace_id TEXT NOT NULL DEFAULT '', event TEXT NOT NULL, created_at TEXT NOT NULL
33524
+ );
33525
+ `);
33526
+ addMissingColumns2(db, "import_admission_ledger", [
33527
+ "agent_id TEXT NOT NULL DEFAULT ''",
33528
+ "workspace_id TEXT NOT NULL DEFAULT ''",
33529
+ "request_fingerprint TEXT NOT NULL DEFAULT ''",
33530
+ "source_id TEXT",
33531
+ "lease_token TEXT",
33532
+ "lease_expires_at TEXT",
33533
+ "attempt_count INTEGER NOT NULL DEFAULT 0",
33534
+ "error TEXT"
33535
+ ]);
33536
+ addMissingColumns2(db, "import_admission_events", [
33537
+ "agent_id TEXT NOT NULL DEFAULT ''",
33538
+ "workspace_id TEXT NOT NULL DEFAULT ''"
33539
+ ]);
33540
+ rebuildLedgerWithoutGlobalKeyPrimaryKey2(db);
33541
+ db.exec(`
33542
+ CREATE UNIQUE INDEX IF NOT EXISTS uq_import_admission_scope_key ON import_admission_ledger(key, agent_id, workspace_id);
33543
+ CREATE INDEX IF NOT EXISTS idx_import_admission_status ON import_admission_ledger(agent_id, workspace_id, status, updated_at);
33544
+ CREATE INDEX IF NOT EXISTS idx_import_admission_events_key ON import_admission_events(admission_key, agent_id, workspace_id, id);
33545
+ `);
33546
+ }
33312
33547
  var MIGRATIONS2 = [
33313
33548
  {
33314
33549
  version: 1,
@@ -34513,7 +34748,7 @@ var MIGRATIONS2 = [
34513
34748
  {
34514
34749
  version: 151,
34515
34750
  name: "transcript-import-bytes",
34516
- up: up160,
34751
+ up: up161,
34517
34752
  artifacts: {
34518
34753
  tables: [
34519
34754
  "source_import_chunks",
@@ -34597,6 +34832,18 @@ var MIGRATIONS2 = [
34597
34832
  version: 159,
34598
34833
  name: "retire-obsolete-invocation-ledger",
34599
34834
  up: up510
34835
+ },
34836
+ {
34837
+ version: 160,
34838
+ name: "import-admission-ledger",
34839
+ up: up1602,
34840
+ artifacts: {
34841
+ tables: ["import_admission_ledger", "import_admission_events"],
34842
+ indexes: ["idx_import_admission_status", "idx_import_admission_events_key"],
34843
+ columns: [
34844
+ ...["workspace_id", "request_fingerprint", "source_id", "lease_token", "lease_expires_at", "attempt_count"].map((column) => ({ table: "import_admission_ledger", column }))
34845
+ ]
34846
+ }
34600
34847
  }
34601
34848
  ];
34602
34849
  var LATEST_SCHEMA_VERSION2 = MIGRATIONS2[MIGRATIONS2.length - 1]?.version ?? 0;
@@ -34604,30 +34851,17 @@ var NETWORK_FILESYSTEM_TYPES2 = new Set(["afpfs", "nfs", "smbfs", "webdav"]);
34604
34851
  var __filename22 = fileURLToPath2(import.meta.url);
34605
34852
  var __dirname22 = dirname3(__filename22);
34606
34853
  var import_yaml3 = __toESM2(require_dist2(), 1);
34607
- var STATES2 = new Set([
34608
- "found",
34609
- "missing",
34610
- "locked",
34611
- "unavailable",
34612
- "permission-denied",
34613
- "corrupt",
34614
- "unsupported"
34615
- ]);
34616
- var mutation2 = Promise.resolve();
34617
- var LOOPBACK_HOST2 = "127.0.0.1";
34618
- var LOCAL_BINDS2 = new Set([LOOPBACK_HOST2, "localhost", "::1", "::ffff:127.0.0.1"]);
34619
- var import_yaml22 = __toESM2(require_dist2(), 1);
34620
- var native2 = null;
34621
- try {
34622
- const esmRequire = createRequire22(import.meta.url);
34623
- native2 = esmRequire("@signet/native");
34624
- } catch {}
34625
- var GRAPHIQ_DEFAULT_INSTALL_DIR2 = join92(homedir52(), ".local", "bin");
34626
34854
  var SIGNET_SOURCE_CHECKOUT_DIRNAME2 = "signetai";
34627
34855
  var SIGNET_GIT_ALLOWED_DIRECTORIES2 = ["skills", "tools", "dreaming"];
34628
34856
  var SIGNET_GIT_PROTECTED_PATHS2 = [
34629
34857
  ".daemon",
34858
+ ".secrets",
34630
34859
  ".shadow",
34860
+ "cache",
34861
+ "data",
34862
+ "files",
34863
+ "runtime",
34864
+ "workspace-layout.json",
34631
34865
  "node_modules",
34632
34866
  ":(glob)**/node_modules/**",
34633
34867
  `${SIGNET_SOURCE_CHECKOUT_DIRNAME2}`,
@@ -34666,7 +34900,13 @@ var SIGNET_GIT_TRACKED_PATHS2 = [
34666
34900
  ];
34667
34901
  var SIGNET_GITIGNORE_PROTECTED_PATTERNS2 = [
34668
34902
  ".daemon/",
34903
+ ".secrets/",
34669
34904
  ".shadow/",
34905
+ "cache/",
34906
+ "data/",
34907
+ "files/",
34908
+ "runtime/",
34909
+ "workspace-layout.json",
34670
34910
  "node_modules/",
34671
34911
  `${SIGNET_SOURCE_CHECKOUT_DIRNAME2}/`,
34672
34912
  "memory/memories.db*",
@@ -34686,17 +34926,53 @@ var SIGNET_GITIGNORE_PROTECTED_PATTERNS2 = [
34686
34926
  "*.sqlite",
34687
34927
  "*.sqlite3"
34688
34928
  ];
34929
+ var DESCRIPTOR_ROOT2 = process.platform === "linux" ? "/proc/self/fd" : process.platform === "darwin" ? "/dev/fd" : undefined;
34930
+ var DIRECTORY_FLAGS2 = fsConstants2.O_RDONLY | (fsConstants2.O_DIRECTORY ?? 0) | (fsConstants2.O_NOFOLLOW ?? 0);
34931
+ var FILE_FLAGS2 = fsConstants2.O_RDONLY | (fsConstants2.O_NOFOLLOW ?? 0) | (fsConstants2.O_NONBLOCK ?? 0);
34932
+ var NOFOLLOW2 = fsConstants2.O_NOFOLLOW ?? 0;
34933
+ var PROTECTION_COMPONENT_IDS2 = [
34934
+ "root-authored",
34935
+ "skills",
34936
+ "managed-originals",
34937
+ "sqlite",
34938
+ "transcripts",
34939
+ "external-sources",
34940
+ "runtime",
34941
+ "filesystem-cache",
34942
+ "secrets"
34943
+ ];
34944
+ var ORDER2 = new Map(PROTECTION_COMPONENT_IDS2.map((id, index) => [id, index]));
34945
+ var BLOCKING2 = new Set(["missing", "stale", "degraded"]);
34946
+ var STATES2 = new Set([
34947
+ "found",
34948
+ "missing",
34949
+ "locked",
34950
+ "unavailable",
34951
+ "permission-denied",
34952
+ "corrupt",
34953
+ "unsupported"
34954
+ ]);
34955
+ var mutation2 = Promise.resolve();
34956
+ var LOOPBACK_HOST2 = "127.0.0.1";
34957
+ var LOCAL_BINDS2 = new Set([LOOPBACK_HOST2, "localhost", "::1", "::ffff:127.0.0.1"]);
34958
+ var import_yaml22 = __toESM2(require_dist2(), 1);
34959
+ var native2 = null;
34960
+ try {
34961
+ const esmRequire = createRequire22(import.meta.url);
34962
+ native2 = esmRequire("@signet/native");
34963
+ } catch {}
34964
+ var GRAPHIQ_DEFAULT_INSTALL_DIR2 = join142(homedir52(), ".local", "bin");
34689
34965
  var DEFAULT_DISCORD_DESKTOP_CACHE_PATH2 = defaultDiscordDesktopCachePath2();
34690
34966
  var DEFAULT_GITHUB_RESOURCE_TYPES2 = ["issues", "pulls", "discussions", "docs"];
34691
34967
  var VALID_GITHUB_RESOURCE_TYPES2 = new Set(DEFAULT_GITHUB_RESOURCE_TYPES2);
34692
34968
  function defaultDiscordDesktopCachePath2() {
34693
34969
  switch (platform22()) {
34694
34970
  case "darwin":
34695
- return resolve52(homedir62(), "Library", "Application Support", "discord");
34971
+ return resolve92(homedir62(), "Library", "Application Support", "discord");
34696
34972
  case "win32":
34697
- return resolve52(process.env.APPDATA || resolve52(homedir62(), "AppData", "Roaming"), "discord");
34973
+ return resolve92(process.env.APPDATA || resolve92(homedir62(), "AppData", "Roaming"), "discord");
34698
34974
  default:
34699
- return resolve52(process.env.XDG_CONFIG_HOME || resolve52(homedir62(), ".config"), "discord");
34975
+ return resolve92(process.env.XDG_CONFIG_HOME || resolve92(homedir62(), ".config"), "discord");
34700
34976
  }
34701
34977
  }
34702
34978
  var IDENTITY_FILES2 = {
@@ -34756,7 +35032,7 @@ var REQUIRED_IDENTITY_KEYS2 = Object.entries(IDENTITY_FILES2).filter(([, spec])
34756
35032
  var OPTIONAL_IDENTITY_KEYS2 = Object.entries(IDENTITY_FILES2).filter(([, spec]) => spec.optional).map(([key]) => key);
34757
35033
  function linkDirSync(target, path) {
34758
35034
  const type = process.platform === "win32" ? "junction" : "dir";
34759
- symlinkSync(target, path, type);
35035
+ symlinkSync2(target, path, type);
34760
35036
  }
34761
35037
  function symlinkSkills(sourceDir, targetDir, options = {}) {
34762
35038
  const result = {
@@ -34764,19 +35040,19 @@ function symlinkSkills(sourceDir, targetDir, options = {}) {
34764
35040
  skipped: [],
34765
35041
  errors: []
34766
35042
  };
34767
- if (!existsSync14(sourceDir)) {
35043
+ if (!existsSync18(sourceDir)) {
34768
35044
  return result;
34769
35045
  }
34770
- const targetParent = join14(targetDir, "..");
34771
- if (!existsSync14(targetParent)) {
34772
- mkdirSync8(targetParent, { recursive: true });
35046
+ const targetParent = join18(targetDir, "..");
35047
+ if (!existsSync18(targetParent)) {
35048
+ mkdirSync10(targetParent, { recursive: true });
34773
35049
  }
34774
- if (!existsSync14(targetDir)) {
34775
- mkdirSync8(targetDir, { recursive: true });
35050
+ if (!existsSync18(targetDir)) {
35051
+ mkdirSync10(targetDir, { recursive: true });
34776
35052
  }
34777
35053
  let entries;
34778
35054
  try {
34779
- entries = readdirSync6(sourceDir);
35055
+ entries = readdirSync9(sourceDir);
34780
35056
  } catch (e) {
34781
35057
  result.errors.push({
34782
35058
  path: sourceDir,
@@ -34785,10 +35061,10 @@ function symlinkSkills(sourceDir, targetDir, options = {}) {
34785
35061
  return result;
34786
35062
  }
34787
35063
  for (const entry of entries) {
34788
- const srcPath = join14(sourceDir, entry);
34789
- const destPath = join14(targetDir, entry);
35064
+ const srcPath = join18(sourceDir, entry);
35065
+ const destPath = join18(targetDir, entry);
34790
35066
  try {
34791
- const src = lstatSync(srcPath);
35067
+ const src = lstatSync3(srcPath);
34792
35068
  if (src.isSymbolicLink() || !src.isDirectory()) {
34793
35069
  result.skipped.push(srcPath);
34794
35070
  continue;
@@ -34801,7 +35077,7 @@ function symlinkSkills(sourceDir, targetDir, options = {}) {
34801
35077
  continue;
34802
35078
  }
34803
35079
  try {
34804
- const destStat = lstatSync(destPath);
35080
+ const destStat = lstatSync3(destPath);
34805
35081
  if (destStat.isSymbolicLink()) {
34806
35082
  if (!options.dryRun) {
34807
35083
  unlinkSync2(destPath);
@@ -34953,7 +35229,7 @@ function resolveSignetApiKey() {
34953
35229
  }
34954
35230
 
34955
35231
  // src/index.ts
34956
- var __dirname3 = dirname8(fileURLToPath3(import.meta.url));
35232
+ var __dirname3 = dirname5(fileURLToPath3(import.meta.url));
34957
35233
  function getPluginSourceDir() {
34958
35234
  const fromDist = join6(__dirname3, "..", "hermes-plugin");
34959
35235
  if (existsSync2(fromDist))
@@ -34989,21 +35265,21 @@ var REQUIRED_TOOL_NAMES = [
34989
35265
  "recall",
34990
35266
  "remember"
34991
35267
  ];
34992
- var DESCRIPTOR_ROOT = process.platform === "linux" ? "/proc/self/fd" : process.platform === "darwin" ? "/dev/fd" : null;
34993
- var DESCRIPTOR_WRITES_SUPPORTED = DESCRIPTOR_ROOT !== null && typeof constants.O_DIRECTORY === "number" && typeof constants.O_NOFOLLOW === "number";
35268
+ var DESCRIPTOR_ROOT3 = process.platform === "linux" ? "/proc/self/fd" : process.platform === "darwin" ? "/dev/fd" : null;
35269
+ var DESCRIPTOR_WRITES_SUPPORTED = DESCRIPTOR_ROOT3 !== null && typeof constants.O_DIRECTORY === "number" && typeof constants.O_NOFOLLOW === "number";
34994
35270
  var DESCRIPTOR_WRITE_UNAVAILABLE_ERROR = "Targeted Hermes profile writes require descriptor-backed no-follow filesystem support";
34995
35271
  function pathEntryExists(path) {
34996
35272
  try {
34997
- lstatSync2(path);
35273
+ lstatSync(path);
34998
35274
  return true;
34999
35275
  } catch {
35000
35276
  return false;
35001
35277
  }
35002
35278
  }
35003
35279
  function descriptorPath(fd) {
35004
- if (DESCRIPTOR_ROOT === null)
35280
+ if (DESCRIPTOR_ROOT3 === null)
35005
35281
  throw new Error(DESCRIPTOR_WRITE_UNAVAILABLE_ERROR);
35006
- return join6(DESCRIPTOR_ROOT, String(fd));
35282
+ return join6(DESCRIPTOR_ROOT3, String(fd));
35007
35283
  }
35008
35284
  function isPathWithin(root, candidate) {
35009
35285
  const rel = relative2(root, candidate);
@@ -35060,7 +35336,7 @@ function getPythonCandidates() {
35060
35336
  ];
35061
35337
  }
35062
35338
  function runSecureEntryOperation(parentFd, parentPath, name, expectedDev, expectedIno, operation) {
35063
- if (DESCRIPTOR_ROOT === null)
35339
+ if (DESCRIPTOR_ROOT3 === null)
35064
35340
  throw new Error(DESCRIPTOR_WRITE_UNAVAILABLE_ERROR);
35065
35341
  const errors = [];
35066
35342
  for (const candidate of getPythonCandidates()) {
@@ -35073,7 +35349,7 @@ function runSecureEntryOperation(parentFd, parentPath, name, expectedDev, expect
35073
35349
  operation,
35074
35350
  name,
35075
35351
  parentPath,
35076
- DESCRIPTOR_ROOT
35352
+ DESCRIPTOR_ROOT3
35077
35353
  ], {
35078
35354
  encoding: "utf-8",
35079
35355
  stdio: ["ignore", "pipe", "pipe", parentFd],
@@ -35114,7 +35390,7 @@ function ensureContainedDirectory(directory, targetRoot) {
35114
35390
  let existing = absoluteDirectory;
35115
35391
  const missing = [];
35116
35392
  while (!pathEntryExists(existing)) {
35117
- const parent = dirname8(existing);
35393
+ const parent = dirname5(existing);
35118
35394
  if (parent === existing)
35119
35395
  throw new Error(`Hermes target directory has no existing ancestor: ${directory}`);
35120
35396
  missing.unshift(existing.slice(parent.length + 1));
@@ -35159,7 +35435,7 @@ function writeContainedFile(targetPath, content, targetRoot) {
35159
35435
  throw new Error(DESCRIPTOR_WRITE_UNAVAILABLE_ERROR);
35160
35436
  }
35161
35437
  const rootPath = resolvePath(targetRoot);
35162
- ensureContainedDirectory(dirname8(safePath), targetRoot);
35438
+ ensureContainedDirectory(dirname5(safePath), targetRoot);
35163
35439
  const relativePath = relative2(rootPath, safePath);
35164
35440
  if (!relativePath || relativePath.startsWith("..") || isAbsolute2(relativePath)) {
35165
35441
  throw new Error(`Hermes target file escapes validated root: ${targetPath}`);
@@ -35192,7 +35468,7 @@ function writeContainedFile(targetPath, content, targetRoot) {
35192
35468
  const filePath = join6(descriptorPath(parentFd), fileName);
35193
35469
  let existingFileIdentity;
35194
35470
  try {
35195
- const existing = lstatSync2(filePath);
35471
+ const existing = lstatSync(filePath);
35196
35472
  if (existing.isSymbolicLink()) {
35197
35473
  throw new Error(`Hermes target file is symlinked and cannot be used for writes: ${targetPath}`);
35198
35474
  }
@@ -35239,12 +35515,12 @@ function rejectSymlinkedPathComponents(path, root, targetPath) {
35239
35515
  }
35240
35516
  let current = path;
35241
35517
  while (true) {
35242
- if (lstatSync2(current).isSymbolicLink()) {
35518
+ if (lstatSync(current).isSymbolicLink()) {
35243
35519
  throw new Error(`Hermes target path is symlinked and cannot be used for writes: ${targetPath}`);
35244
35520
  }
35245
35521
  if (current === root)
35246
35522
  return;
35247
- const parent = dirname8(current);
35523
+ const parent = dirname5(current);
35248
35524
  if (parent === current)
35249
35525
  throw new Error(`Hermes target path escapes validated root: ${targetPath}`);
35250
35526
  current = parent;
@@ -35253,7 +35529,7 @@ function rejectSymlinkedPathComponents(path, root, targetPath) {
35253
35529
  function resolveContainedWritePath(targetPath, targetRoot) {
35254
35530
  let rootPath = resolvePath(targetRoot);
35255
35531
  while (!pathEntryExists(rootPath)) {
35256
- const parent = dirname8(rootPath);
35532
+ const parent = dirname5(rootPath);
35257
35533
  if (parent === rootPath)
35258
35534
  throw new Error(`Hermes target root does not exist: ${targetRoot}`);
35259
35535
  rootPath = parent;
@@ -35265,7 +35541,7 @@ function resolveContainedWritePath(targetPath, targetRoot) {
35265
35541
  let existing = resolvePath(targetPath);
35266
35542
  const missing = [];
35267
35543
  while (!pathEntryExists(existing)) {
35268
- const parent = dirname8(existing);
35544
+ const parent = dirname5(existing);
35269
35545
  if (parent === existing)
35270
35546
  throw new Error(`Hermes target path does not have an existing ancestor: ${targetPath}`);
35271
35547
  missing.unshift(existing.slice(parent.length + 1));
@@ -35301,7 +35577,7 @@ function removeDirectoryContentsNoFollow(directoryFd, expectedDirectoryPath) {
35301
35577
  }
35302
35578
  continue;
35303
35579
  }
35304
- const childIdentity = lstatSync2(childPath);
35580
+ const childIdentity = lstatSync(childPath);
35305
35581
  removeEntryNoFollow(directoryFd, expectedDirectoryPath, entry.name, childIdentity.dev, childIdentity.ino, false);
35306
35582
  }
35307
35583
  }
@@ -35389,7 +35665,7 @@ function removeContainedFile(targetPath, targetRoot) {
35389
35665
  closeDirectory(parentFd);
35390
35666
  parentFd = childFd;
35391
35667
  }
35392
- const targetFile = lstatSync2(join6(descriptorPath(parentFd), fileName));
35668
+ const targetFile = lstatSync(join6(descriptorPath(parentFd), fileName));
35393
35669
  removeEntryNoFollow(parentFd, expected, fileName, targetFile.dev, targetFile.ino, false);
35394
35670
  } finally {
35395
35671
  closeDirectory(parentFd);
@@ -35558,7 +35834,7 @@ function writeProviderBackup(hermesHome, configPath, providerKind, previousProvi
35558
35834
  previousProvider,
35559
35835
  createdAt: new Date().toISOString()
35560
35836
  };
35561
- ensureTargetDirectory(dirname8(backupPath), targetRoot);
35837
+ ensureTargetDirectory(dirname5(backupPath), targetRoot);
35562
35838
  writeTargetFile(backupPath, `${JSON.stringify(backup, null, 2)}
35563
35839
  `, targetRoot);
35564
35840
  return backupPath;
@@ -35648,7 +35924,7 @@ function configureProvider(hermesHome, warnings, targetRoot) {
35648
35924
  }
35649
35925
  if (!changed)
35650
35926
  return { configPath: null, backupPath: null };
35651
- ensureTargetDirectory(dirname8(configPath), targetRoot);
35927
+ ensureTargetDirectory(dirname5(configPath), targetRoot);
35652
35928
  writeTargetFile(configPath, `${lines.join(`
35653
35929
  `).replace(/\n+$/g, "")}
35654
35930
  `, targetRoot);
@@ -35670,7 +35946,7 @@ function configureProvider(hermesHome, warnings, targetRoot) {
35670
35946
  lines.push("");
35671
35947
  lines.push("memory:", " provider: signet");
35672
35948
  }
35673
- ensureTargetDirectory(dirname8(configPath), targetRoot);
35949
+ ensureTargetDirectory(dirname5(configPath), targetRoot);
35674
35950
  writeTargetFile(configPath, `${lines.join(`
35675
35951
  `).replace(/\n+$/g, "")}
35676
35952
  `, targetRoot);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signetai/connector-hermes-agent",
3
- "version": "0.227.1",
3
+ "version": "0.228.0",
4
4
  "description": "Signet connector for Hermes Agent — installs Signet as a pluggable memory provider",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -25,8 +25,8 @@
25
25
  "typecheck": "tsc --noEmit"
26
26
  },
27
27
  "dependencies": {
28
- "@signetai/connector-base": "0.227.1",
29
- "@signetai/core": "0.227.1"
28
+ "@signetai/connector-base": "0.228.0",
29
+ "@signetai/core": "0.228.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "^22.0.0",