@signetai/connector-gemini 0.177.0 → 0.179.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 +94 -42
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -10,14 +10,14 @@ import {
10
10
  unlinkSync as unlinkSync3,
11
11
  writeFileSync as writeFileSync3
12
12
  } from "node:fs";
13
- import { homedir as homedir5 } from "node:os";
14
- import { dirname as dirname8, join as join6, resolve as resolve2 } from "node:path";
13
+ import { homedir as homedir6 } from "node:os";
14
+ import { dirname as dirname8, join as join7, resolve as resolve3 } from "node:path";
15
15
 
16
16
  // ../../../libs/connector-base/dist/index.js
17
17
  import { randomBytes } from "node:crypto";
18
18
  import { existsSync, readFileSync, renameSync, statSync as statSync2, unlinkSync as unlinkSync2, writeFileSync } from "node:fs";
19
19
  import { homedir } from "node:os";
20
- import { dirname as dirname3, isAbsolute, join as join3, relative, sep } from "node:path";
20
+ import { dirname as dirname5, isAbsolute, join as join3, relative, sep } from "node:path";
21
21
  import { createRequire } from "node:module";
22
22
  import { dirname, join } from "node:path";
23
23
  import { fileURLToPath } from "node:url";
@@ -27,9 +27,11 @@ import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as rea
27
27
  import { homedir as homedir3 } from "node:os";
28
28
  import { dirname as dirname2, join as join5, resolve } from "node:path";
29
29
  import { createRequire as createRequire2 } from "node:module";
30
- import { homedir as homedir4, platform as platform2 } from "node:os";
30
+ import { homedir as homedir4 } from "node:os";
31
+ import { dirname as dirname3, join as join6, resolve as resolve2 } from "node:path";
32
+ import { homedir as homedir5, platform as platform2 } from "node:os";
31
33
  import { basename, dirname as dirname4, resolve as resolve4 } from "node:path";
32
- import { homedir as homedir8 } from "node:os";
34
+ import { homedir as homedir9 } from "node:os";
33
35
  import { existsSync as existsSync13, lstatSync, mkdirSync as mkdirSync9, readdirSync as readdirSync6, symlinkSync, unlinkSync } from "node:fs";
34
36
  import { join as join13 } from "node:path";
35
37
  var __create2 = Object.create;
@@ -10402,6 +10404,18 @@ function up110(db) {
10402
10404
  ON memory_entity_mentions(entity_id, memory_id);
10403
10405
  `);
10404
10406
  }
10407
+ function hasColumn19(db, table, column) {
10408
+ const rows = db.prepare(`PRAGMA table_info(${table})`).all();
10409
+ return rows.some((row) => row.name === column);
10410
+ }
10411
+ var COLUMNS2 = ["first_remember_at", "first_recall_at"];
10412
+ function up111(db) {
10413
+ for (const column of COLUMNS2) {
10414
+ if (!hasColumn19(db, "telemetry_install", column)) {
10415
+ db.exec(`ALTER TABLE telemetry_install ADD COLUMN ${column} TEXT`);
10416
+ }
10417
+ }
10418
+ }
10405
10419
  var MIGRATIONS = [
10406
10420
  {
10407
10421
  version: 1,
@@ -11277,6 +11291,17 @@ var MIGRATIONS = [
11277
11291
  version: 110,
11278
11292
  name: "memory-mention-join-index",
11279
11293
  up: up110
11294
+ },
11295
+ {
11296
+ version: 111,
11297
+ name: "telemetry-first-use",
11298
+ up: up111,
11299
+ artifacts: {
11300
+ columns: [
11301
+ { table: "telemetry_install", column: "first_remember_at" },
11302
+ { table: "telemetry_install", column: "first_recall_at" }
11303
+ ]
11304
+ }
11280
11305
  }
11281
11306
  ];
11282
11307
  var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
@@ -11400,6 +11425,7 @@ try {
11400
11425
  const esmRequire = createRequire2(import.meta.url);
11401
11426
  native = esmRequire("@signet/native");
11402
11427
  } catch {}
11428
+ var GRAPHIQ_DEFAULT_INSTALL_DIR = join6(homedir4(), ".local", "bin");
11403
11429
  var SIGNET_SOURCE_CHECKOUT_DIRNAME = "signetai";
11404
11430
  var SIGNET_GIT_ALLOWED_DIRECTORIES = ["skills", "tools", "dreaming"];
11405
11431
  var SIGNET_GIT_PROTECTED_PATHS = [
@@ -11469,11 +11495,11 @@ var VALID_GITHUB_RESOURCE_TYPES = new Set(DEFAULT_GITHUB_RESOURCE_TYPES);
11469
11495
  function defaultDiscordDesktopCachePath() {
11470
11496
  switch (platform2()) {
11471
11497
  case "darwin":
11472
- return resolve4(homedir4(), "Library", "Application Support", "discord");
11498
+ return resolve4(homedir5(), "Library", "Application Support", "discord");
11473
11499
  case "win32":
11474
- return resolve4(process.env.APPDATA || resolve4(homedir4(), "AppData", "Roaming"), "discord");
11500
+ return resolve4(process.env.APPDATA || resolve4(homedir5(), "AppData", "Roaming"), "discord");
11475
11501
  default:
11476
- return resolve4(process.env.XDG_CONFIG_HOME || resolve4(homedir4(), ".config"), "discord");
11502
+ return resolve4(process.env.XDG_CONFIG_HOME || resolve4(homedir5(), ".config"), "discord");
11477
11503
  }
11478
11504
  }
11479
11505
  var IDENTITY_FILES = {
@@ -11604,7 +11630,7 @@ function symlinkSkills(sourceDir, targetDir, options = {}) {
11604
11630
  }
11605
11631
  return result;
11606
11632
  }
11607
- var home = homedir8();
11633
+ var home = homedir9();
11608
11634
  var SIGNET_BLOCK_START = "<!-- SIGNET:START -->";
11609
11635
  var SIGNET_BLOCK_END = "<!-- SIGNET:END -->";
11610
11636
  function stripSignetBlock(content) {
@@ -11645,7 +11671,7 @@ class BaseConnector {
11645
11671
  generateHeader(sourcePath, targetName) {
11646
11672
  const name = targetName || this.name;
11647
11673
  const safe = (p) => p.replace(/[\n\r]/g, "");
11648
- const root = dirname3(sourcePath);
11674
+ const root = dirname5(sourcePath);
11649
11675
  return `# Auto-generated from ${safe(sourcePath)}
11650
11676
  # Source: ${safe(sourcePath)}
11651
11677
  # Generated: ${new Date().toISOString()}
@@ -11682,7 +11708,7 @@ function isSignetGeneratedFile(raw) {
11682
11708
  return lines.some((line, i) => /^#\s+AUTO-GENERATED\s+from\s+.*\s+by\s+Signet/i.test(line) || /^#\s+Auto-generated\s+from\s+/.test(line) && i + 1 < lines.length && /^#\s+Source:\s+/.test(lines[i + 1]));
11683
11709
  }
11684
11710
  function atomicWriteText(path, content, mode) {
11685
- const tmp = join3(dirname3(path), `.${randomBytes(6).toString("hex")}.tmp`);
11711
+ const tmp = join3(dirname5(path), `.${randomBytes(6).toString("hex")}.tmp`);
11686
11712
  let writeMode = mode;
11687
11713
  if (writeMode === undefined) {
11688
11714
  try {
@@ -11716,16 +11742,18 @@ function resolveSignetWorkspacePath(home2 = homedir()) {
11716
11742
 
11717
11743
  // ../../../platform/core/dist/index.js
11718
11744
  import { createRequire as createRequire3 } from "node:module";
11719
- import { dirname as dirname5, join as join4 } from "node:path";
11745
+ import { dirname as dirname6, join as join4 } from "node:path";
11720
11746
  import { fileURLToPath as fileURLToPath2 } from "node:url";
11721
11747
  import { homedir as homedir22 } from "os";
11722
11748
  import { join as join22 } from "path";
11723
11749
  import { createRequire as createRequire22 } from "node:module";
11724
- import { homedir as homedir42, platform as platform22 } from "node:os";
11750
+ import { homedir as homedir42 } from "node:os";
11751
+ import { dirname as dirname32, join as join62, resolve as resolve22 } from "node:path";
11752
+ import { homedir as homedir52, platform as platform22 } from "node:os";
11725
11753
  import { basename as basename2, dirname as dirname42, resolve as resolve42 } from "node:path";
11726
11754
  import { existsSync as existsSync11, readFileSync as readFileSync9, readdirSync as readdirSync4, realpathSync, statSync as statSync5 } from "node:fs";
11727
11755
  import { dirname as dirname7, join as join11 } from "node:path";
11728
- import { homedir as homedir82 } from "node:os";
11756
+ import { homedir as homedir92 } from "node:os";
11729
11757
  var __create = Object.create;
11730
11758
  var __getProtoOf = Object.getPrototypeOf;
11731
11759
  var __defProp = Object.defineProperty;
@@ -18673,7 +18701,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
18673
18701
  return true;
18674
18702
  return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
18675
18703
  }
18676
- function up111(db) {
18704
+ function up112(db) {
18677
18705
  db.exec(`
18678
18706
  CREATE TABLE IF NOT EXISTS schema_migrations (
18679
18707
  version INTEGER PRIMARY KEY,
@@ -18762,12 +18790,12 @@ function up111(db) {
18762
18790
  } catch {}
18763
18791
  createMemoriesFts2(db);
18764
18792
  }
18765
- function hasColumn19(db, table, column) {
18793
+ function hasColumn20(db, table, column) {
18766
18794
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
18767
18795
  return rows.some((r) => r.name === column);
18768
18796
  }
18769
18797
  function addColumnIfMissing23(db, table, column, definition) {
18770
- if (!hasColumn19(db, table, column)) {
18798
+ if (!hasColumn20(db, table, column)) {
18771
18799
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
18772
18800
  }
18773
18801
  }
@@ -19096,7 +19124,7 @@ function up1010(db) {
19096
19124
  )
19097
19125
  `);
19098
19126
  }
19099
- function up112(db) {
19127
+ function up113(db) {
19100
19128
  db.exec(`
19101
19129
  CREATE TABLE IF NOT EXISTS session_scores (
19102
19130
  id TEXT PRIMARY KEY,
@@ -21342,9 +21370,9 @@ function hasColumn112(db, table, column) {
21342
21370
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
21343
21371
  return rows.some((row) => row.name === column);
21344
21372
  }
21345
- var COLUMNS2 = ["harness", "session_id", "tool_use_id", "cwd", "origin", "args"];
21373
+ var COLUMNS3 = ["harness", "session_id", "tool_use_id", "cwd", "origin", "args"];
21346
21374
  function up822(db) {
21347
- for (const column of COLUMNS2) {
21375
+ for (const column of COLUMNS3) {
21348
21376
  if (!hasColumn112(db, "skill_invocations", column)) {
21349
21377
  db.exec(`ALTER TABLE skill_invocations ADD COLUMN ${column} TEXT`);
21350
21378
  }
@@ -22096,11 +22124,23 @@ function up1102(db) {
22096
22124
  ON memory_entity_mentions(entity_id, memory_id);
22097
22125
  `);
22098
22126
  }
22127
+ function hasColumn192(db, table, column) {
22128
+ const rows = db.prepare(`PRAGMA table_info(${table})`).all();
22129
+ return rows.some((row) => row.name === column);
22130
+ }
22131
+ var COLUMNS22 = ["first_remember_at", "first_recall_at"];
22132
+ function up1112(db) {
22133
+ for (const column of COLUMNS22) {
22134
+ if (!hasColumn192(db, "telemetry_install", column)) {
22135
+ db.exec(`ALTER TABLE telemetry_install ADD COLUMN ${column} TEXT`);
22136
+ }
22137
+ }
22138
+ }
22099
22139
  var MIGRATIONS2 = [
22100
22140
  {
22101
22141
  version: 1,
22102
22142
  name: "baseline",
22103
- up: up111,
22143
+ up: up112,
22104
22144
  artifacts: { tables: ["memories", "conversations", "embeddings"] }
22105
22145
  },
22106
22146
  {
@@ -22166,7 +22206,7 @@ var MIGRATIONS2 = [
22166
22206
  {
22167
22207
  version: 11,
22168
22208
  name: "session-scores",
22169
- up: up112,
22209
+ up: up113,
22170
22210
  artifacts: { tables: ["session_scores"] }
22171
22211
  },
22172
22212
  {
@@ -22971,11 +23011,22 @@ var MIGRATIONS2 = [
22971
23011
  version: 110,
22972
23012
  name: "memory-mention-join-index",
22973
23013
  up: up1102
23014
+ },
23015
+ {
23016
+ version: 111,
23017
+ name: "telemetry-first-use",
23018
+ up: up1112,
23019
+ artifacts: {
23020
+ columns: [
23021
+ { table: "telemetry_install", column: "first_remember_at" },
23022
+ { table: "telemetry_install", column: "first_recall_at" }
23023
+ ]
23024
+ }
22974
23025
  }
22975
23026
  ];
22976
23027
  var LATEST_SCHEMA_VERSION2 = MIGRATIONS2[MIGRATIONS2.length - 1]?.version ?? 0;
22977
23028
  var __filename22 = fileURLToPath2(import.meta.url);
22978
- var __dirname22 = dirname5(__filename22);
23029
+ var __dirname22 = dirname6(__filename22);
22979
23030
  var import_yaml3 = __toESM(require_dist2(), 1);
22980
23031
  function expandHome2(p, home2 = homedir22()) {
22981
23032
  if (p === "~")
@@ -22999,6 +23050,7 @@ try {
22999
23050
  const esmRequire = createRequire22(import.meta.url);
23000
23051
  native2 = esmRequire("@signet/native");
23001
23052
  } catch {}
23053
+ var GRAPHIQ_DEFAULT_INSTALL_DIR2 = join62(homedir42(), ".local", "bin");
23002
23054
  var SIGNET_SOURCE_CHECKOUT_DIRNAME2 = "signetai";
23003
23055
  var SIGNET_GIT_ALLOWED_DIRECTORIES2 = ["skills", "tools", "dreaming"];
23004
23056
  var SIGNET_GIT_PROTECTED_PATHS2 = [
@@ -23068,11 +23120,11 @@ var VALID_GITHUB_RESOURCE_TYPES2 = new Set(DEFAULT_GITHUB_RESOURCE_TYPES2);
23068
23120
  function defaultDiscordDesktopCachePath2() {
23069
23121
  switch (platform22()) {
23070
23122
  case "darwin":
23071
- return resolve42(homedir42(), "Library", "Application Support", "discord");
23123
+ return resolve42(homedir52(), "Library", "Application Support", "discord");
23072
23124
  case "win32":
23073
- return resolve42(process.env.APPDATA || resolve42(homedir42(), "AppData", "Roaming"), "discord");
23125
+ return resolve42(process.env.APPDATA || resolve42(homedir52(), "AppData", "Roaming"), "discord");
23074
23126
  default:
23075
- return resolve42(process.env.XDG_CONFIG_HOME || resolve42(homedir42(), ".config"), "discord");
23127
+ return resolve42(process.env.XDG_CONFIG_HOME || resolve42(homedir52(), ".config"), "discord");
23076
23128
  }
23077
23129
  }
23078
23130
  var IDENTITY_MODES = ["managed", "off"];
@@ -23175,7 +23227,7 @@ function loadIdentityMode(agentsDir) {
23175
23227
  return "managed";
23176
23228
  }
23177
23229
  }
23178
- var home2 = homedir82();
23230
+ var home2 = homedir92();
23179
23231
 
23180
23232
  // src/index.ts
23181
23233
  function readGeminiSettings(settingsPath) {
@@ -23193,10 +23245,10 @@ class GeminiConnector extends BaseConnector {
23193
23245
  name = "Gemini";
23194
23246
  harnessId = "gemini";
23195
23247
  getGeminiHome() {
23196
- return join6(homedir5(), ".gemini");
23248
+ return join7(homedir6(), ".gemini");
23197
23249
  }
23198
23250
  getConfigPath() {
23199
- return join6(this.getGeminiHome(), "settings.json");
23251
+ return join7(this.getGeminiHome(), "settings.json");
23200
23252
  }
23201
23253
  getGeminiMdPath() {
23202
23254
  const geminiHome = this.getGeminiHome();
@@ -23205,18 +23257,18 @@ class GeminiConnector extends BaseConnector {
23205
23257
  if (isJsonObject(contextConfig)) {
23206
23258
  const fileNames = contextConfig.fileName;
23207
23259
  if (Array.isArray(fileNames) && typeof fileNames[0] === "string") {
23208
- const candidate = resolve2(geminiHome, fileNames[0]);
23260
+ const candidate = resolve3(geminiHome, fileNames[0]);
23209
23261
  if (isChildOf(candidate, geminiHome)) {
23210
23262
  return candidate;
23211
23263
  }
23212
23264
  }
23213
23265
  }
23214
- return join6(geminiHome, "GEMINI.md");
23266
+ return join7(geminiHome, "GEMINI.md");
23215
23267
  }
23216
23268
  async install(basePath) {
23217
23269
  const filesWritten = [];
23218
23270
  const configsPatched = [];
23219
- const expandedBasePath = expandHome2(basePath || join6(homedir5(), ".agents"));
23271
+ const expandedBasePath = expandHome2(basePath || join7(homedir6(), ".agents"));
23220
23272
  const identityMode = loadIdentityMode(expandedBasePath);
23221
23273
  if (!hasValidIdentity(expandedBasePath)) {
23222
23274
  return {
@@ -23256,8 +23308,8 @@ class GeminiConnector extends BaseConnector {
23256
23308
  } catch {}
23257
23309
  }
23258
23310
  }
23259
- const skillsSource = join6(expandedBasePath, "skills");
23260
- const skillsDest = join6(geminiHome, "skills");
23311
+ const skillsSource = join7(expandedBasePath, "skills");
23312
+ const skillsDest = join7(geminiHome, "skills");
23261
23313
  if (existsSync2(skillsSource)) {
23262
23314
  this.symlinkSkills(skillsSource, skillsDest);
23263
23315
  }
@@ -23285,7 +23337,7 @@ class GeminiConnector extends BaseConnector {
23285
23337
  filesRemoved.push(geminiMdPath);
23286
23338
  }
23287
23339
  }
23288
- const skillsDir = join6(geminiHome, "skills");
23340
+ const skillsDir = join7(geminiHome, "skills");
23289
23341
  if (existsSync2(skillsDir)) {
23290
23342
  this.removeSignetSkillSymlinks(skillsDir, signetWorkspace);
23291
23343
  }
@@ -23299,10 +23351,10 @@ class GeminiConnector extends BaseConnector {
23299
23351
  return isJsonObject(mcpServers) && "signet" in mcpServers;
23300
23352
  }
23301
23353
  static isHarnessInstalled() {
23302
- return existsSync2(join6(homedir5(), ".gemini", "settings.json"));
23354
+ return existsSync2(join7(homedir6(), ".gemini", "settings.json"));
23303
23355
  }
23304
23356
  removeSignetSkillSymlinks(skillsDir, signetWorkspace) {
23305
- const signetSkillsSource = resolve2(signetWorkspace, "skills");
23357
+ const signetSkillsSource = resolve3(signetWorkspace, "skills");
23306
23358
  let entries;
23307
23359
  try {
23308
23360
  entries = readdirSync(skillsDir);
@@ -23310,7 +23362,7 @@ class GeminiConnector extends BaseConnector {
23310
23362
  return;
23311
23363
  }
23312
23364
  for (const entry of entries) {
23313
- const entryPath = join6(skillsDir, entry);
23365
+ const entryPath = join7(skillsDir, entry);
23314
23366
  let stat = null;
23315
23367
  try {
23316
23368
  stat = lstatSync2(entryPath);
@@ -23320,7 +23372,7 @@ class GeminiConnector extends BaseConnector {
23320
23372
  if (stat?.isSymbolicLink()) {
23321
23373
  try {
23322
23374
  const rawTarget = readlinkSync(entryPath);
23323
- const target = resolve2(dirname8(entryPath), rawTarget);
23375
+ const target = resolve3(dirname8(entryPath), rawTarget);
23324
23376
  if (isChildOf(target, signetSkillsSource)) {
23325
23377
  unlinkSync3(entryPath);
23326
23378
  }
@@ -23329,7 +23381,7 @@ class GeminiConnector extends BaseConnector {
23329
23381
  }
23330
23382
  }
23331
23383
  registerMcpServer(geminiHome) {
23332
- const settingsPath = join6(geminiHome, "settings.json");
23384
+ const settingsPath = join7(geminiHome, "settings.json");
23333
23385
  if (existsSync2(settingsPath)) {
23334
23386
  const settings2 = readGeminiSettings(settingsPath);
23335
23387
  if (!settings2) {
@@ -23359,7 +23411,7 @@ class GeminiConnector extends BaseConnector {
23359
23411
  return null;
23360
23412
  }
23361
23413
  removeMcpServer(geminiHome) {
23362
- const settingsPath = join6(geminiHome, "settings.json");
23414
+ const settingsPath = join7(geminiHome, "settings.json");
23363
23415
  const settings = readGeminiSettings(settingsPath);
23364
23416
  if (!settings)
23365
23417
  return false;
@@ -23380,7 +23432,7 @@ class GeminiConnector extends BaseConnector {
23380
23432
  return false;
23381
23433
  }
23382
23434
  generateGeminiMd(basePath) {
23383
- const sourcePath = join6(basePath, "AGENTS.md");
23435
+ const sourcePath = join7(basePath, "AGENTS.md");
23384
23436
  if (!existsSync2(sourcePath))
23385
23437
  return null;
23386
23438
  const raw = readFileSync2(sourcePath, "utf-8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signetai/connector-gemini",
3
- "version": "0.177.0",
3
+ "version": "0.179.0",
4
4
  "description": "Signet connector for Gemini 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.177.0",
28
- "@signetai/core": "0.177.0"
27
+ "@signetai/connector-base": "0.179.0",
28
+ "@signetai/core": "0.179.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^22.0.0",