@signetai/connector-forge 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
@@ -35667,20 +35667,84 @@ var IDENTITY_FILES2 = {
35667
35667
  session: "dreaming"
35668
35668
  }
35669
35669
  };
35670
+ var IDENTITY_PRESETS = {
35671
+ minimal: {
35672
+ name: "minimal",
35673
+ description: "AGENTS.md only for normal startup, plus DREAMING.md for dreaming sessions.",
35674
+ startup: [{ path: "AGENTS.md", role: "operating_instructions", budget: 12000 }],
35675
+ special: [{ path: "DREAMING.md", kind: "dreaming", role: "dreaming_prompt", budget: 4000 }]
35676
+ },
35677
+ hermes: {
35678
+ name: "hermes",
35679
+ description: "Hermes-style SOUL.md primary identity with project-context discovery handled by Hermes.",
35680
+ startup: [
35681
+ { path: "SOUL.md", role: "primary_identity", budget: 4000 },
35682
+ { path: "AGENTS.md", role: "project_context", budget: 12000 }
35683
+ ],
35684
+ special: [{ path: "DREAMING.md", kind: "dreaming", role: "dreaming_prompt", budget: 4000 }]
35685
+ },
35686
+ openclaw: {
35687
+ name: "openclaw",
35688
+ description: "OpenClaw-style rich identity stack for character-forward agents.",
35689
+ startup: [
35690
+ { path: "AGENTS.md", role: "operating_instructions", budget: 12000 },
35691
+ { path: "SOUL.md", role: "persona", budget: 4000 },
35692
+ { path: "IDENTITY.md", role: "agent_identity", budget: 2000 },
35693
+ { path: "USER.md", role: "user_profile", budget: 6000 },
35694
+ { path: "MEMORY.md", role: "working_memory", budget: 1e4 }
35695
+ ],
35696
+ special: [
35697
+ { path: "HEARTBEAT.md", kind: "heartbeat", role: "heartbeat_prompt", budget: 4000 },
35698
+ { path: "DREAMING.md", kind: "dreaming", role: "dreaming_prompt", budget: 4000 },
35699
+ { path: "BOOTSTRAP.md", kind: "bootstrap", role: "bootstrap_prompt", budget: 4000 }
35700
+ ]
35701
+ },
35702
+ custom: {
35703
+ name: "custom",
35704
+ description: "User-selected startup files and explicit order.",
35705
+ startup: [{ path: "AGENTS.md", role: "operating_instructions", budget: 12000 }],
35706
+ special: [{ path: "DREAMING.md", kind: "dreaming", role: "dreaming_prompt", budget: 4000 }]
35707
+ }
35708
+ };
35670
35709
  var REQUIRED_IDENTITY_KEYS2 = Object.entries(IDENTITY_FILES2).filter(([, spec]) => !spec.optional).map(([key]) => key);
35671
35710
  var OPTIONAL_IDENTITY_KEYS2 = Object.entries(IDENTITY_FILES2).filter(([, spec]) => spec.optional).map(([key]) => key);
35672
35711
  function hasValidIdentity(basePath) {
35673
35712
  const mode = loadIdentityMode(basePath);
35674
35713
  if (mode !== "managed")
35675
35714
  return true;
35676
- for (const key of REQUIRED_IDENTITY_KEYS2) {
35677
- const spec = IDENTITY_FILES2[key];
35678
- if (!existsSync12(join13(basePath, spec.path))) {
35715
+ for (const path of resolveRequiredIdentityPaths(basePath)) {
35716
+ if (!existsSync12(join13(basePath, path))) {
35679
35717
  return false;
35680
35718
  }
35681
35719
  }
35682
35720
  return true;
35683
35721
  }
35722
+ function resolveRequiredIdentityPaths(basePath) {
35723
+ const legacyRequired = () => REQUIRED_IDENTITY_KEYS2.map((key) => IDENTITY_FILES2[key].path);
35724
+ const agentYaml = join13(basePath, "agent.yaml");
35725
+ if (!existsSync12(agentYaml))
35726
+ return legacyRequired();
35727
+ try {
35728
+ const config = parseSimpleYaml(readFileSync10(agentYaml, "utf-8"));
35729
+ const identity = readRecord(readRecord(config).identity);
35730
+ const configured = readIdentityEntryList(readRecord(identity.startup).load);
35731
+ if (configured.length > 0)
35732
+ return [...new Set(configured.map((entry) => entry.path))];
35733
+ const presetName = typeof identity.preset === "string" ? identity.preset : "";
35734
+ const preset = IDENTITY_PRESETS[presetName];
35735
+ if (preset)
35736
+ return [...new Set(preset.startup.map((entry) => entry.path))];
35737
+ } catch {}
35738
+ return legacyRequired();
35739
+ }
35740
+ function isSafeRelativeIdentityPath(path) {
35741
+ const trimmed = path.trim();
35742
+ if (!trimmed)
35743
+ return false;
35744
+ if (trimmed.startsWith("/") || trimmed.startsWith("~"))
35745
+ return false;
35746
+ return !trimmed.split(/[\\/]/).includes("..");
35747
+ }
35684
35748
  function readRecord(value) {
35685
35749
  return typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
35686
35750
  }
@@ -35713,6 +35777,26 @@ function loadIdentityMode(agentsDir) {
35713
35777
  return "managed";
35714
35778
  }
35715
35779
  }
35780
+ function readIdentityEntry(value) {
35781
+ if (typeof value === "string") {
35782
+ return isSafeRelativeIdentityPath(value) ? { path: value } : null;
35783
+ }
35784
+ const record = readRecord(value);
35785
+ const path = typeof record.path === "string" ? record.path.trim() : "";
35786
+ if (!isSafeRelativeIdentityPath(path))
35787
+ return null;
35788
+ if (record.enabled === false)
35789
+ return null;
35790
+ const role = typeof record.role === "string" ? record.role : undefined;
35791
+ const rawBudget = typeof record.budget === "number" ? record.budget : Number.parseInt(String(record.budget ?? ""), 10);
35792
+ const budget = Number.isFinite(rawBudget) && rawBudget > 0 ? Math.floor(rawBudget) : undefined;
35793
+ return { path, role, budget };
35794
+ }
35795
+ function readIdentityEntryList(value) {
35796
+ if (!Array.isArray(value))
35797
+ return [];
35798
+ return value.map(readIdentityEntry).filter((entry) => entry !== null);
35799
+ }
35716
35800
  var home2 = homedir102();
35717
35801
 
35718
35802
  // src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signetai/connector-forge",
3
- "version": "0.214.32",
3
+ "version": "0.214.34",
4
4
  "description": "Signet connector for ForgeCode - installs MCP, identity, and skills integration",
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",