@signetai/signet-memory-openclaw 0.116.5 → 0.116.7

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 +131 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9693,6 +9693,14 @@ var PIPELINE_PROVIDER_SET = new Set(PIPELINE_PROVIDER_CHOICES);
9693
9693
  var SYNTHESIS_PROVIDER_SET = new Set(SYNTHESIS_PROVIDER_CHOICES);
9694
9694
  var LOCAL_BINDS = new Set(["127.0.0.1", "localhost", "::1", "::ffff:127.0.0.1"]);
9695
9695
  var import_yaml2 = __toESM(require_dist(), 1);
9696
+ function parseSimpleYaml(text) {
9697
+ try {
9698
+ const parsed = import_yaml2.default.parse(text);
9699
+ return typeof parsed === "object" && parsed !== null ? parsed : {};
9700
+ } catch {
9701
+ return {};
9702
+ }
9703
+ }
9696
9704
  var native = null;
9697
9705
  try {
9698
9706
  const esmRequire = createRequire22(import.meta.url);
@@ -9902,8 +9910,10 @@ var IDENTITY_FILES = {
9902
9910
  },
9903
9911
  heartbeat: {
9904
9912
  path: "HEARTBEAT.md",
9905
- description: "Current working state, focus, and blockers",
9906
- optional: true
9913
+ description: "Heartbeat prompt used only for heartbeat/background check sessions",
9914
+ optional: true,
9915
+ context: "session",
9916
+ session: "heartbeat"
9907
9917
  },
9908
9918
  memory: {
9909
9919
  path: "MEMORY.md",
@@ -9918,7 +9928,55 @@ var IDENTITY_FILES = {
9918
9928
  bootstrap: {
9919
9929
  path: "BOOTSTRAP.md",
9920
9930
  description: "Setup ritual (typically deleted after first run)",
9921
- optional: true
9931
+ optional: true,
9932
+ context: "session",
9933
+ session: "bootstrap"
9934
+ },
9935
+ dreaming: {
9936
+ path: "DREAMING.md",
9937
+ description: "Dreaming/reflection prompt used only for dreaming sessions",
9938
+ optional: true,
9939
+ context: "session",
9940
+ session: "dreaming"
9941
+ }
9942
+ };
9943
+ var IDENTITY_PRESETS = {
9944
+ minimal: {
9945
+ name: "minimal",
9946
+ description: "AGENTS.md only for normal startup, plus DREAMING.md for dreaming sessions.",
9947
+ startup: [{ path: "AGENTS.md", role: "operating_instructions", budget: 12000 }],
9948
+ special: [{ path: "DREAMING.md", kind: "dreaming", role: "dreaming_prompt", budget: 4000 }]
9949
+ },
9950
+ hermes: {
9951
+ name: "hermes",
9952
+ description: "Hermes-style SOUL.md primary identity with project-context discovery handled by Hermes.",
9953
+ startup: [
9954
+ { path: "SOUL.md", role: "primary_identity", budget: 4000 },
9955
+ { path: "AGENTS.md", role: "project_context", budget: 12000 }
9956
+ ],
9957
+ special: [{ path: "DREAMING.md", kind: "dreaming", role: "dreaming_prompt", budget: 4000 }]
9958
+ },
9959
+ openclaw: {
9960
+ name: "openclaw",
9961
+ description: "OpenClaw-style rich identity stack for character-forward agents.",
9962
+ startup: [
9963
+ { path: "AGENTS.md", role: "operating_instructions", budget: 12000 },
9964
+ { path: "SOUL.md", role: "persona", budget: 4000 },
9965
+ { path: "IDENTITY.md", role: "agent_identity", budget: 2000 },
9966
+ { path: "USER.md", role: "user_profile", budget: 6000 },
9967
+ { path: "MEMORY.md", role: "working_memory", budget: 1e4 }
9968
+ ],
9969
+ special: [
9970
+ { path: "HEARTBEAT.md", kind: "heartbeat", role: "heartbeat_prompt", budget: 4000 },
9971
+ { path: "DREAMING.md", kind: "dreaming", role: "dreaming_prompt", budget: 4000 },
9972
+ { path: "BOOTSTRAP.md", kind: "bootstrap", role: "bootstrap_prompt", budget: 4000 }
9973
+ ]
9974
+ },
9975
+ custom: {
9976
+ name: "custom",
9977
+ description: "User-selected startup files and explicit order.",
9978
+ startup: [{ path: "AGENTS.md", role: "operating_instructions", budget: 12000 }],
9979
+ special: [{ path: "DREAMING.md", kind: "dreaming", role: "dreaming_prompt", budget: 4000 }]
9922
9980
  }
9923
9981
  };
9924
9982
  var REQUIRED_IDENTITY_KEYS = Object.entries(IDENTITY_FILES).filter(([, spec]) => !spec.optional).map(([key]) => key);
@@ -9930,6 +9988,66 @@ var STATIC_BUDGETS = [
9930
9988
  { file: "USER.md", header: "About Your User", budget: 6000 },
9931
9989
  { file: "MEMORY.md", header: "Working Memory", budget: 1e4 }
9932
9990
  ];
9991
+ var STATIC_HEADER_BY_FILE = {
9992
+ "AGENTS.md": "Agent Instructions",
9993
+ "SOUL.md": "Soul",
9994
+ "IDENTITY.md": "Identity",
9995
+ "USER.md": "About Your User",
9996
+ "MEMORY.md": "Working Memory"
9997
+ };
9998
+ function isSafeRelativeIdentityPath(path) {
9999
+ const trimmed = path.trim();
10000
+ if (!trimmed)
10001
+ return false;
10002
+ if (trimmed.startsWith("/") || trimmed.startsWith("~"))
10003
+ return false;
10004
+ return !trimmed.split(/[\\/]/).includes("..");
10005
+ }
10006
+ function readRecord(value) {
10007
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
10008
+ }
10009
+ function readIdentityEntry(value) {
10010
+ if (typeof value === "string") {
10011
+ return isSafeRelativeIdentityPath(value) ? { path: value } : null;
10012
+ }
10013
+ const record = readRecord(value);
10014
+ const path = typeof record.path === "string" ? record.path.trim() : "";
10015
+ if (!isSafeRelativeIdentityPath(path))
10016
+ return null;
10017
+ if (record.enabled === false)
10018
+ return null;
10019
+ const role = typeof record.role === "string" ? record.role : undefined;
10020
+ const rawBudget = typeof record.budget === "number" ? record.budget : Number.parseInt(String(record.budget ?? ""), 10);
10021
+ const budget = Number.isFinite(rawBudget) && rawBudget > 0 ? Math.floor(rawBudget) : undefined;
10022
+ return { path, role, budget };
10023
+ }
10024
+ function readIdentityEntryList(value) {
10025
+ if (!Array.isArray(value))
10026
+ return [];
10027
+ return value.map(readIdentityEntry).filter((entry) => entry !== null);
10028
+ }
10029
+ function identityHeaderFor(path, role) {
10030
+ const filename = path.split(/[\\/]/).pop() ?? path;
10031
+ return STATIC_HEADER_BY_FILE[filename] ?? role ?? filename.replace(/\.md$/i, "");
10032
+ }
10033
+ function resolveStartupIdentityFiles(agentsDir) {
10034
+ const agentYaml = join10(agentsDir, "agent.yaml");
10035
+ if (!existsSync10(agentYaml))
10036
+ return STATIC_BUDGETS.map(({ file, budget }) => ({ path: file, budget }));
10037
+ try {
10038
+ const config = parseSimpleYaml(readFileSync8(agentYaml, "utf-8"));
10039
+ const identity = readRecord(config.identity);
10040
+ const startup = readRecord(identity.startup);
10041
+ const configured = readIdentityEntryList(startup.load);
10042
+ if (configured.length > 0)
10043
+ return configured;
10044
+ const presetName = typeof identity.preset === "string" ? identity.preset : "";
10045
+ const preset = IDENTITY_PRESETS[presetName];
10046
+ if (preset)
10047
+ return preset.startup;
10048
+ } catch {}
10049
+ return STATIC_BUDGETS.map(({ file, budget }) => ({ path: file, budget }));
10050
+ }
9933
10051
  var STATIC_IDENTITY_OFFLINE_STATUS = "[signet: daemon offline — running with static identity]";
9934
10052
  var STATIC_IDENTITY_SESSION_START_TIMEOUT_STATUS = "[signet: daemon session-start timed out — running with static identity]";
9935
10053
  function resolveSessionStartTimeoutMs(raw) {
@@ -9946,17 +10064,18 @@ function readStaticIdentity(agentsDir, status = STATIC_IDENTITY_OFFLINE_STATUS)
9946
10064
  if (!existsSync10(agentsDir))
9947
10065
  return null;
9948
10066
  const parts = [];
9949
- for (const { file, header, budget } of STATIC_BUDGETS) {
9950
- const path = join10(agentsDir, file);
10067
+ for (const entry of resolveStartupIdentityFiles(agentsDir)) {
10068
+ const path = join10(agentsDir, entry.path);
9951
10069
  if (!existsSync10(path))
9952
10070
  continue;
9953
10071
  try {
9954
10072
  const raw = readFileSync8(path, "utf-8").trim();
9955
10073
  if (!raw)
9956
10074
  continue;
10075
+ const budget = entry.budget ?? STATIC_BUDGETS.find((candidate) => candidate.file === entry.path)?.budget ?? 4000;
9957
10076
  const content = raw.length <= budget ? raw : `${raw.slice(0, budget)}
9958
10077
  [truncated]`;
9959
- parts.push(`## ${header}
10078
+ parts.push(`## ${identityHeaderFor(entry.path, entry.role)}
9960
10079
 
9961
10080
  ${content}`);
9962
10081
  } catch {}
@@ -10823,12 +10942,16 @@ class SignetClient extends SignetClientHelpers {
10823
10942
  async deleteSecret(name) {
10824
10943
  return this.transport.del(`/api/secrets/${name}`);
10825
10944
  }
10826
- async execWithSecrets(command, secrets) {
10945
+ async execWithSecrets(command, secrets, options = {}) {
10827
10946
  return this.transport.post("/api/secrets/exec", {
10828
10947
  command,
10829
- secrets
10948
+ secrets,
10949
+ ...options
10830
10950
  });
10831
10951
  }
10952
+ async getSecretExecJob(jobId) {
10953
+ return this.transport.get(`/api/secrets/exec/${jobId}`);
10954
+ }
10832
10955
  async getOnePasswordStatus() {
10833
10956
  return this.transport.get("/api/secrets/1password/status");
10834
10957
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signetai/signet-memory-openclaw",
3
- "version": "0.116.5",
3
+ "version": "0.116.7",
4
4
  "description": "Signet adapter for OpenClaw — runtime plugin for AI agent memory",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",