@signetai/connector-gemini 0.214.32 → 0.214.34

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 +87 -3
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -35538,20 +35538,84 @@ var IDENTITY_FILES2 = {
35538
35538
  session: "dreaming"
35539
35539
  }
35540
35540
  };
35541
+ var IDENTITY_PRESETS = {
35542
+ minimal: {
35543
+ name: "minimal",
35544
+ description: "AGENTS.md only for normal startup, plus DREAMING.md for dreaming sessions.",
35545
+ startup: [{ path: "AGENTS.md", role: "operating_instructions", budget: 12000 }],
35546
+ special: [{ path: "DREAMING.md", kind: "dreaming", role: "dreaming_prompt", budget: 4000 }]
35547
+ },
35548
+ hermes: {
35549
+ name: "hermes",
35550
+ description: "Hermes-style SOUL.md primary identity with project-context discovery handled by Hermes.",
35551
+ startup: [
35552
+ { path: "SOUL.md", role: "primary_identity", budget: 4000 },
35553
+ { path: "AGENTS.md", role: "project_context", budget: 12000 }
35554
+ ],
35555
+ special: [{ path: "DREAMING.md", kind: "dreaming", role: "dreaming_prompt", budget: 4000 }]
35556
+ },
35557
+ openclaw: {
35558
+ name: "openclaw",
35559
+ description: "OpenClaw-style rich identity stack for character-forward agents.",
35560
+ startup: [
35561
+ { path: "AGENTS.md", role: "operating_instructions", budget: 12000 },
35562
+ { path: "SOUL.md", role: "persona", budget: 4000 },
35563
+ { path: "IDENTITY.md", role: "agent_identity", budget: 2000 },
35564
+ { path: "USER.md", role: "user_profile", budget: 6000 },
35565
+ { path: "MEMORY.md", role: "working_memory", budget: 1e4 }
35566
+ ],
35567
+ special: [
35568
+ { path: "HEARTBEAT.md", kind: "heartbeat", role: "heartbeat_prompt", budget: 4000 },
35569
+ { path: "DREAMING.md", kind: "dreaming", role: "dreaming_prompt", budget: 4000 },
35570
+ { path: "BOOTSTRAP.md", kind: "bootstrap", role: "bootstrap_prompt", budget: 4000 }
35571
+ ]
35572
+ },
35573
+ custom: {
35574
+ name: "custom",
35575
+ description: "User-selected startup files and explicit order.",
35576
+ startup: [{ path: "AGENTS.md", role: "operating_instructions", budget: 12000 }],
35577
+ special: [{ path: "DREAMING.md", kind: "dreaming", role: "dreaming_prompt", budget: 4000 }]
35578
+ }
35579
+ };
35541
35580
  var REQUIRED_IDENTITY_KEYS2 = Object.entries(IDENTITY_FILES2).filter(([, spec]) => !spec.optional).map(([key]) => key);
35542
35581
  var OPTIONAL_IDENTITY_KEYS2 = Object.entries(IDENTITY_FILES2).filter(([, spec]) => spec.optional).map(([key]) => key);
35543
35582
  function hasValidIdentity(basePath) {
35544
35583
  const mode = loadIdentityMode(basePath);
35545
35584
  if (mode !== "managed")
35546
35585
  return true;
35547
- for (const key of REQUIRED_IDENTITY_KEYS2) {
35548
- const spec = IDENTITY_FILES2[key];
35549
- if (!existsSync12(join13(basePath, spec.path))) {
35586
+ for (const path of resolveRequiredIdentityPaths(basePath)) {
35587
+ if (!existsSync12(join13(basePath, path))) {
35550
35588
  return false;
35551
35589
  }
35552
35590
  }
35553
35591
  return true;
35554
35592
  }
35593
+ function resolveRequiredIdentityPaths(basePath) {
35594
+ const legacyRequired = () => REQUIRED_IDENTITY_KEYS2.map((key) => IDENTITY_FILES2[key].path);
35595
+ const agentYaml = join13(basePath, "agent.yaml");
35596
+ if (!existsSync12(agentYaml))
35597
+ return legacyRequired();
35598
+ try {
35599
+ const config = parseSimpleYaml(readFileSync10(agentYaml, "utf-8"));
35600
+ const identity = readRecord(readRecord(config).identity);
35601
+ const configured = readIdentityEntryList(readRecord(identity.startup).load);
35602
+ if (configured.length > 0)
35603
+ return [...new Set(configured.map((entry) => entry.path))];
35604
+ const presetName = typeof identity.preset === "string" ? identity.preset : "";
35605
+ const preset = IDENTITY_PRESETS[presetName];
35606
+ if (preset)
35607
+ return [...new Set(preset.startup.map((entry) => entry.path))];
35608
+ } catch {}
35609
+ return legacyRequired();
35610
+ }
35611
+ function isSafeRelativeIdentityPath(path) {
35612
+ const trimmed = path.trim();
35613
+ if (!trimmed)
35614
+ return false;
35615
+ if (trimmed.startsWith("/") || trimmed.startsWith("~"))
35616
+ return false;
35617
+ return !trimmed.split(/[\\/]/).includes("..");
35618
+ }
35555
35619
  function readRecord(value) {
35556
35620
  return typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
35557
35621
  }
@@ -35584,6 +35648,26 @@ function loadIdentityMode(agentsDir) {
35584
35648
  return "managed";
35585
35649
  }
35586
35650
  }
35651
+ function readIdentityEntry(value) {
35652
+ if (typeof value === "string") {
35653
+ return isSafeRelativeIdentityPath(value) ? { path: value } : null;
35654
+ }
35655
+ const record = readRecord(value);
35656
+ const path = typeof record.path === "string" ? record.path.trim() : "";
35657
+ if (!isSafeRelativeIdentityPath(path))
35658
+ return null;
35659
+ if (record.enabled === false)
35660
+ return null;
35661
+ const role = typeof record.role === "string" ? record.role : undefined;
35662
+ const rawBudget = typeof record.budget === "number" ? record.budget : Number.parseInt(String(record.budget ?? ""), 10);
35663
+ const budget = Number.isFinite(rawBudget) && rawBudget > 0 ? Math.floor(rawBudget) : undefined;
35664
+ return { path, role, budget };
35665
+ }
35666
+ function readIdentityEntryList(value) {
35667
+ if (!Array.isArray(value))
35668
+ return [];
35669
+ return value.map(readIdentityEntry).filter((entry) => entry !== null);
35670
+ }
35587
35671
  var home2 = homedir102();
35588
35672
 
35589
35673
  // src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signetai/connector-gemini",
3
- "version": "0.214.32",
3
+ "version": "0.214.34",
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.214.32",
28
- "@signetai/core": "0.214.32"
27
+ "@signetai/connector-base": "0.214.34",
28
+ "@signetai/core": "0.214.34"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^22.0.0",