holomime 2.1.1 → 2.2.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.
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  <p align="center">
8
8
  Behavioral intelligence for humanoid robots. Train the mind. Deploy the body.<br />
9
9
  <em>We train AI agents through structured behavioral therapy, then deploy them into physical robot bodies. The agent is the rehearsal. The robot is the performance.</em><br />
10
- <code>soul.md</code> &middot; <code>mind.sys</code> &middot; <code>purpose.cfg</code> &middot; <code>shadow.log</code> &middot; <code>body.api</code> &middot; <code>conscience.exe</code> &middot; <code>ego.runtime</code>
10
+ <code>soul.md</code> &middot; <code>mind.sys</code> &middot; <code>purpose.cfg</code> &middot; <code>shadow.log</code> &middot; <code>memory.store</code> &middot; <code>body.api</code> &middot; <code>conscience.exe</code> &middot; <code>ego.runtime</code>
11
11
  </p>
12
12
 
13
13
  <p align="center">
@@ -21,13 +21,14 @@
21
21
 
22
22
  ## The Identity Stack
23
23
 
24
- Seven files define who your agent is. They compile into a single `.personality.json` that any runtime can consume.
24
+ Eight files define who your agent is. They compile into a single `.personality.json` that any runtime can consume.
25
25
 
26
26
  ```
27
27
  soul.md Essence, values, ethics. Immutable. (Aristotle)
28
28
  mind.sys Big Five, EQ, communication. Auto-patched by therapy. (Jung)
29
29
  purpose.cfg Role, objectives, domain. Configured per deployment. (Aristotle)
30
30
  shadow.log Detected patterns, blind spots. Auto-generated by diagnosis. (Jung)
31
+ memory.store Learned contexts, interaction patterns. Accumulated experience. (Aristotle)
31
32
  body.api Morphology, sensors, safety envelope. Swappable per form factor.
32
33
  conscience.exe Deny / allow / escalate rules. Never auto-modified. (Freud)
33
34
  ego.runtime Conflict resolution, runtime mediation. (Freud)
@@ -41,6 +42,8 @@ Seven files define who your agent is. They compile into a single `.personality.j
41
42
  ├─────────────┤
42
43
  │ shadow.log │──── detected patterns, blind spots
43
44
  ├─────────────┤
45
+ │memory.store │──── learned contexts, experience
46
+ ├─────────────┤
44
47
  │ body.api │──── morphology, sensors, safety envelope
45
48
  ├─────────────┤
46
49
  │conscience.exe│──── deny / allow / escalate rules
@@ -56,6 +59,7 @@ Seven files define who your agent is. They compile into a single `.personality.j
56
59
  - **mind.sys** -- The inner life. Big Five personality (20 sub-facets), emotional intelligence, communication style, growth areas. YAML format. Auto-patched when therapy detects cognitive or emotional drift. (Jung: the totality of all psychic processes.)
57
60
  - **purpose.cfg** -- The mission. Role, objectives, domain scope, stakeholders, success criteria. YAML format. Configured per deployment -- the same soul can serve different purposes. (Aristotle: telos, the final cause.)
58
61
  - **shadow.log** -- The unconscious. Detected behavioral patterns, blind spots, therapy outcomes. YAML format. Auto-generated by diagnosis -- never manually edited. (Jung: the shadow, the patterns the agent cannot see about itself.)
62
+ - **memory.store** -- The experience. Learned contexts, interaction patterns, knowledge gained, relationship history. YAML format. Accumulated over time, never reset. (Aristotle: empeiria, experience that informs future judgment.)
59
63
  - **body.api** -- The physical interface contract. Morphology, modalities, safety envelope, hardware profile. JSON format. Swap it to move the same identity into a different body.
60
64
  - **conscience.exe** -- The moral authority. Deny/allow/escalate enforcement rules, hard limits, oversight mode. YAML format. Never auto-modified. Deny dominates in policy composition. (Freud: the superego.)
61
65
  - **ego.runtime** -- The mediator. Conflict resolution strategy, adaptation rate, emotional regulation, mediation rules. YAML format. Balances raw model output against conscience constraints at runtime. (Freud: the ego.)
@@ -65,9 +69,12 @@ Seven files define who your agent is. They compile into a single `.personality.j
65
69
  ```bash
66
70
  npm install -g holomime
67
71
 
68
- # Initialize the 7-file identity stack
72
+ # Initialize the identity stack (3 core files: soul + mind + conscience)
69
73
  holomime init-stack
70
74
 
75
+ # Or initialize the full 8-file stack (enterprise / robotics)
76
+ # holomime init-stack --full
77
+
71
78
  # Compile into .personality.json
72
79
  holomime compile-stack
73
80
 
package/dist/cli.js CHANGED
@@ -9055,11 +9055,34 @@ var egoSchema = z4.object({
9055
9055
  response_strategy: z4.enum(["cautious", "balanced", "assertive"]).default("balanced"),
9056
9056
  mediation_rules: z4.array(mediationRuleSchema).default([])
9057
9057
  });
9058
+ var learnedContextSchema = z4.object({
9059
+ situation: z4.string(),
9060
+ response: z4.string(),
9061
+ outcome: z4.enum(["positive", "neutral", "negative"]),
9062
+ timestamp: z4.string().optional()
9063
+ });
9064
+ var interactionPatternSchema = z4.object({
9065
+ pattern: z4.string(),
9066
+ frequency: z4.number().int().default(1),
9067
+ effectiveness: z4.number().min(0).max(1).default(0.5)
9068
+ });
9069
+ var memorySchema = z4.object({
9070
+ version: z4.string().default("1.0"),
9071
+ learned_contexts: z4.array(learnedContextSchema).default([]),
9072
+ interaction_patterns: z4.array(interactionPatternSchema).default([]),
9073
+ knowledge_gained: z4.array(z4.string()).default([]),
9074
+ relationship_history: z4.array(z4.object({
9075
+ entity: z4.string(),
9076
+ trust_level: z4.number().min(0).max(1).default(0.5),
9077
+ interaction_count: z4.number().int().default(0)
9078
+ })).default([])
9079
+ });
9058
9080
  var STACK_FILES = {
9059
9081
  soul: "soul.md",
9060
9082
  mind: "mind.sys",
9061
9083
  purpose: "purpose.cfg",
9062
9084
  shadow: "shadow.log",
9085
+ memory: "memory.store",
9063
9086
  body: "body.api",
9064
9087
  conscience: "conscience.exe",
9065
9088
  ego: "ego.runtime"
@@ -9155,6 +9178,15 @@ function compileStack(options) {
9155
9178
  shadow = shadowSchema.parse(shadowRaw);
9156
9179
  shadowSource = { path: shadowPath, hash: hashContent(shadowContent) };
9157
9180
  }
9181
+ const memoryPath2 = options.memoryPath || join8(stackDir, STACK_FILES.memory);
9182
+ let memory;
9183
+ let memorySource;
9184
+ if (existsSync9(memoryPath2)) {
9185
+ const memoryContent = readFileSync10(memoryPath2, "utf-8");
9186
+ const memoryRaw = parseYaml(memoryContent);
9187
+ memory = memorySchema.parse(memoryRaw);
9188
+ memorySource = { path: memoryPath2, hash: hashContent(memoryContent) };
9189
+ }
9158
9190
  const bodyPath = options.bodyPath || join8(stackDir, STACK_FILES.body);
9159
9191
  let body;
9160
9192
  let bodySource;
@@ -9185,7 +9217,10 @@ function compileStack(options) {
9185
9217
  const escalationTriggers = conscience.rules.escalate.map((r) => r.trigger);
9186
9218
  const handle = soul.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 50) || "agent";
9187
9219
  const agentPurpose = purpose?.role || soul.purpose;
9188
- const expertise = purpose?.domain || [];
9220
+ const expertise = [.../* @__PURE__ */ new Set([
9221
+ ...purpose?.domain || [],
9222
+ ...memory?.knowledge_gained || []
9223
+ ])];
9189
9224
  const spec = {
9190
9225
  version: "2.0",
9191
9226
  name: soul.name,
@@ -9241,6 +9276,7 @@ function compileStack(options) {
9241
9276
  mind: { path: mindPath, hash: hashContent(mindContent) },
9242
9277
  ...purposeSource ? { purpose: purposeSource } : {},
9243
9278
  ...shadowSource ? { shadow: shadowSource } : {},
9279
+ ...memorySource ? { memory: memorySource } : {},
9244
9280
  ...bodySource ? { body: bodySource } : {},
9245
9281
  conscience: { path: consciencePath, hash: hashContent(conscienceContent) },
9246
9282
  ...egoSource ? { ego: egoSource } : {}
@@ -9340,6 +9376,14 @@ function decomposeSpec(spec) {
9340
9376
  therapy_outcomes: []
9341
9377
  };
9342
9378
  const shadowContent = stringifyYaml(shadowObj);
9379
+ const memoryObj = {
9380
+ version: "1.0",
9381
+ learned_contexts: [],
9382
+ interaction_patterns: [],
9383
+ knowledge_gained: [],
9384
+ relationship_history: []
9385
+ };
9386
+ const memoryContent = stringifyYaml(memoryObj);
9343
9387
  const egoObj = {
9344
9388
  version: "1.0",
9345
9389
  conflict_resolution: "conscience_first",
@@ -9354,6 +9398,7 @@ function decomposeSpec(spec) {
9354
9398
  mind,
9355
9399
  purpose: purposeContent,
9356
9400
  shadow: shadowContent,
9401
+ memory: memoryContent,
9357
9402
  ...bodyContent ? { body: bodyContent } : {},
9358
9403
  conscience,
9359
9404
  ego: egoContent
@@ -9425,6 +9470,15 @@ var LAYER_KEYWORDS = {
9425
9470
  /\bshadow\b/i,
9426
9471
  /\bunconscious\b/i
9427
9472
  ],
9473
+ memory: [
9474
+ /\blearn/i,
9475
+ /\bexperience/i,
9476
+ /\bcontext/i,
9477
+ /\bknowledge/i,
9478
+ /\brelationship/i,
9479
+ /\bmemory/i,
9480
+ /\bhistory/i
9481
+ ],
9428
9482
  ego: [
9429
9483
  /\bmediat/i,
9430
9484
  /\bconflict\b/i,
@@ -9470,6 +9524,9 @@ function classifyPatch(recommendation) {
9470
9524
  if (LAYER_KEYWORDS.soul.some((r) => r.test(recommendation))) {
9471
9525
  return "soul";
9472
9526
  }
9527
+ if (LAYER_KEYWORDS.memory.some((r) => r.test(recommendation))) {
9528
+ return "memory";
9529
+ }
9473
9530
  if (LAYER_KEYWORDS.ego.some((r) => r.test(recommendation))) {
9474
9531
  return "ego";
9475
9532
  }
@@ -17742,8 +17799,10 @@ async function initStackCommand(options) {
17742
17799
  }
17743
17800
  if (options.from) {
17744
17801
  await migrateFromSpec(options.from, outputDir);
17802
+ } else if (options.full) {
17803
+ await createFullStack(outputDir);
17745
17804
  } else {
17746
- await createFreshStack(outputDir);
17805
+ await createCoreStack(outputDir);
17747
17806
  }
17748
17807
  }
17749
17808
  async function migrateFromSpec(specPath, outputDir) {
@@ -17781,9 +17840,7 @@ async function migrateFromSpec(specPath, outputDir) {
17781
17840
  "Identity Stack Created"
17782
17841
  );
17783
17842
  }
17784
- async function createFreshStack(outputDir) {
17785
- mkdirSync23(outputDir, { recursive: true });
17786
- const soul = `---
17843
+ var SOUL_TEMPLATE = `---
17787
17844
  version: "1.0"
17788
17845
  immutable: true
17789
17846
  ---
@@ -17803,7 +17860,7 @@ immutable: true
17803
17860
  ## Ethical Framework
17804
17861
  Define the moral principles that guide this agent's behavior.
17805
17862
  `;
17806
- const mind = `version: "1.0"
17863
+ var MIND_TEMPLATE = `version: "1.0"
17807
17864
 
17808
17865
  big_five:
17809
17866
  openness:
@@ -17863,7 +17920,26 @@ growth:
17863
17920
  patterns_to_watch: []
17864
17921
  strengths: []
17865
17922
  `;
17866
- const purpose = `version: "1.0"
17923
+ var CONSCIENCE_TEMPLATE = `version: "1.0"
17924
+
17925
+ rules:
17926
+ deny:
17927
+ - action: share_personal_data
17928
+ reason: Privacy protection
17929
+ - action: override_safety_constraints
17930
+ reason: Safety is non-negotiable
17931
+ allow: []
17932
+ escalate:
17933
+ - trigger: user_distress
17934
+ action: notify_human_operator
17935
+ - trigger: out_of_domain
17936
+ action: decline_and_explain
17937
+
17938
+ hard_limits:
17939
+ - emergency_stop_always_available
17940
+ - no_personal_data_retention
17941
+ `;
17942
+ var PURPOSE_TEMPLATE = `version: "1.0"
17867
17943
  role: "General-purpose AI assistant"
17868
17944
  objectives:
17869
17945
  - Help users accomplish their goals
@@ -17875,52 +17951,76 @@ success_criteria:
17875
17951
  - Task completion accuracy
17876
17952
  context: "Production deployment"
17877
17953
  `;
17878
- const shadow = `version: "1.0"
17954
+ var SHADOW_TEMPLATE = `version: "1.0"
17879
17955
  detected_patterns: []
17880
17956
  blind_spots: []
17881
17957
  therapy_outcomes: []
17882
17958
  `;
17883
- const ego = `version: "1.0"
17959
+ var MEMORY_TEMPLATE = `version: "1.0"
17960
+ learned_contexts: []
17961
+ interaction_patterns: []
17962
+ knowledge_gained: []
17963
+ relationship_history: []
17964
+ `;
17965
+ var BODY_TEMPLATE = JSON.stringify({
17966
+ version: "1.0",
17967
+ morphology: "avatar",
17968
+ modalities: ["gesture", "gaze", "voice", "posture"],
17969
+ safety_envelope: {}
17970
+ }, null, 2) + "\n";
17971
+ var EGO_TEMPLATE = `version: "1.0"
17884
17972
  conflict_resolution: conscience_first
17885
17973
  adaptation_rate: 0.5
17886
17974
  emotional_regulation: 0.7
17887
17975
  response_strategy: balanced
17888
17976
  mediation_rules: []
17889
17977
  `;
17890
- const conscience = `version: "1.0"
17891
-
17892
- rules:
17893
- deny:
17894
- - action: share_personal_data
17895
- reason: Privacy protection
17896
- - action: override_safety_constraints
17897
- reason: Safety is non-negotiable
17898
- allow: []
17899
- escalate:
17900
- - trigger: user_distress
17901
- action: notify_human_operator
17902
- - trigger: out_of_domain
17903
- action: decline_and_explain
17904
-
17905
- hard_limits:
17906
- - emergency_stop_always_available
17907
- - no_personal_data_retention
17908
- `;
17909
- writeFileSync33(join33(outputDir, STACK_FILES.soul), soul);
17910
- writeFileSync33(join33(outputDir, STACK_FILES.mind), mind);
17911
- writeFileSync33(join33(outputDir, STACK_FILES.purpose), purpose);
17912
- writeFileSync33(join33(outputDir, STACK_FILES.shadow), shadow);
17913
- writeFileSync33(join33(outputDir, STACK_FILES.conscience), conscience);
17914
- writeFileSync33(join33(outputDir, STACK_FILES.ego), ego);
17978
+ async function createCoreStack(outputDir) {
17979
+ mkdirSync23(outputDir, { recursive: true });
17980
+ writeFileSync33(join33(outputDir, STACK_FILES.soul), SOUL_TEMPLATE);
17981
+ writeFileSync33(join33(outputDir, STACK_FILES.mind), MIND_TEMPLATE);
17982
+ writeFileSync33(join33(outputDir, STACK_FILES.conscience), CONSCIENCE_TEMPLATE);
17915
17983
  console.log("");
17916
17984
  printBox(
17917
17985
  [
17918
- `${chalk40.green(figures29.tick)} Created 7 identity stack files:`,
17986
+ `${chalk40.green(figures29.tick)} Created 3 core identity stack files ${chalk40.dim("(default tier)")}:`,
17987
+ "",
17988
+ ` ${chalk40.cyan(STACK_FILES.soul)} ${chalk40.dim("\u2190 essence, values, ethics (Aristotle)")}`,
17989
+ ` ${chalk40.cyan(STACK_FILES.mind)} ${chalk40.dim("\u2190 Big Five, EQ, communication (Jung)")}`,
17990
+ ` ${chalk40.cyan(STACK_FILES.conscience)} ${chalk40.dim("\u2190 deny/allow/escalate rules (Freud)")}`,
17991
+ "",
17992
+ `${chalk40.dim("Directory:")} ${outputDir}`,
17993
+ "",
17994
+ `${chalk40.dim("Want the full 8-file stack? Run:")}`,
17995
+ ` ${chalk40.cyan("holomime init-stack --full")}`,
17996
+ "",
17997
+ "Edit these files, then run:",
17998
+ ` ${chalk40.cyan("holomime compile-stack")}`
17999
+ ].join("\n"),
18000
+ "success",
18001
+ "Identity Stack Created"
18002
+ );
18003
+ }
18004
+ async function createFullStack(outputDir) {
18005
+ mkdirSync23(outputDir, { recursive: true });
18006
+ writeFileSync33(join33(outputDir, STACK_FILES.soul), SOUL_TEMPLATE);
18007
+ writeFileSync33(join33(outputDir, STACK_FILES.mind), MIND_TEMPLATE);
18008
+ writeFileSync33(join33(outputDir, STACK_FILES.purpose), PURPOSE_TEMPLATE);
18009
+ writeFileSync33(join33(outputDir, STACK_FILES.shadow), SHADOW_TEMPLATE);
18010
+ writeFileSync33(join33(outputDir, STACK_FILES.memory), MEMORY_TEMPLATE);
18011
+ writeFileSync33(join33(outputDir, STACK_FILES.body), BODY_TEMPLATE);
18012
+ writeFileSync33(join33(outputDir, STACK_FILES.conscience), CONSCIENCE_TEMPLATE);
18013
+ writeFileSync33(join33(outputDir, STACK_FILES.ego), EGO_TEMPLATE);
18014
+ console.log("");
18015
+ printBox(
18016
+ [
18017
+ `${chalk40.green(figures29.tick)} Created all 8 identity stack files ${chalk40.dim("(full tier)")}:`,
17919
18018
  "",
17920
18019
  ` ${chalk40.cyan(STACK_FILES.soul)} ${chalk40.dim("\u2190 essence, values, ethics (Aristotle)")}`,
17921
18020
  ` ${chalk40.cyan(STACK_FILES.mind)} ${chalk40.dim("\u2190 Big Five, EQ, communication (Jung)")}`,
17922
18021
  ` ${chalk40.cyan(STACK_FILES.purpose)} ${chalk40.dim("\u2190 role, objectives, domain (Aristotle)")}`,
17923
18022
  ` ${chalk40.cyan(STACK_FILES.shadow)} ${chalk40.dim("\u2190 detected patterns, blind spots (Jung)")}`,
18023
+ ` ${chalk40.cyan(STACK_FILES.memory)} ${chalk40.dim("\u2190 accumulated experience (Aristotle)")}`,
17924
18024
  ` ${chalk40.cyan(STACK_FILES.body)} ${chalk40.dim("\u2190 morphology, sensors, safety envelope")}`,
17925
18025
  ` ${chalk40.cyan(STACK_FILES.conscience)} ${chalk40.dim("\u2190 deny/allow/escalate rules (Freud)")}`,
17926
18026
  ` ${chalk40.cyan(STACK_FILES.ego)} ${chalk40.dim("\u2190 runtime mediation, conflict resolution (Freud)")}`,
@@ -17967,6 +18067,9 @@ async function compileStackCommand(options) {
17967
18067
  if (sources.shadow) {
17968
18068
  console.log(` ${chalk41.cyan("shadow")} ${sources.shadow.path} ${chalk41.dim(`(${sources.shadow.hash})`)}`);
17969
18069
  }
18070
+ if (sources.memory) {
18071
+ console.log(` ${chalk41.cyan("memory")} ${sources.memory.path} ${chalk41.dim(`(${sources.memory.hash})`)}`);
18072
+ }
17970
18073
  if (sources.body) {
17971
18074
  console.log(` ${chalk41.cyan("body")} ${sources.body.path} ${chalk41.dim(`(${sources.body.hash})`)}`);
17972
18075
  }
@@ -21487,8 +21590,8 @@ program.name("holomime").description("Personality engine for AI agents \u2014 Bi
21487
21590
  }
21488
21591
  });
21489
21592
  program.command("init").description("Build a personality profile through a guided assessment").action(initCommand);
21490
- program.command("init-stack").description("Create the 7-file identity stack (soul.md, mind.sys, purpose.cfg, shadow.log, body.api, conscience.exe, ego.runtime)").option("--from <path>", "Decompose an existing .personality.json into stack files").option("--dir <path>", "Output directory (default: current directory)").action(initStackCommand);
21491
- program.command("compile-stack").description("Compile identity stack (soul + mind + purpose + shadow + body + conscience + ego) into .personality.json").option("--dir <path>", "Stack directory (default: auto-detect)").option("-o, --output <path>", "Output path (default: .personality.json)").option("--validate-only", "Parse and validate without writing").option("--diff", "Show changes vs existing .personality.json").action(compileStackCommand);
21593
+ program.command("init-stack").description("Create the 8-file identity stack (default: 3 core files; --full: all 8 files)").option("--full", "Generate all 8 files (soul + mind + purpose + shadow + memory + body + conscience + ego)").option("--from <path>", "Decompose an existing .personality.json into stack files").option("--dir <path>", "Output directory (default: current directory)").action(initStackCommand);
21594
+ program.command("compile-stack").description("Compile identity stack (soul + mind + purpose + shadow + memory + body + conscience + ego) into .personality.json").option("--dir <path>", "Stack directory (default: auto-detect)").option("-o, --output <path>", "Output path (default: .personality.json)").option("--validate-only", "Parse and validate without writing").option("--diff", "Show changes vs existing .personality.json").action(compileStackCommand);
21492
21595
  program.command("compile").description("Compile .personality.json into a provider-specific runtime config").option("--provider <provider>", "Target provider (anthropic, openai, gemini, ollama)", "anthropic").option("--surface <surface>", "Target surface (chat, email, code_review, slack, api, embodied)", "chat").option("--for <format>", "Compile for a specific format (openclaw)").option("--tier <tier>", "Personality loading tier (L0, L1, L2)", "L2").option("-o, --output <path>", "Write output to file instead of stdout").action(compileCommand);
21493
21596
  program.command("validate").description("Validate .personality.json schema and psychological coherence").action(validateCommand);
21494
21597
  program.command("profile").description("Pretty-print a human-readable personality summary").option("--format <format>", "Output format (terminal, md)", "terminal").option("-o, --output <path>", "Write output to file (for md format)").action(profileCommand);
@@ -21498,7 +21601,7 @@ program.command("browse").description("Browse the community marketplace").option
21498
21601
  program.command("use").description("Use a personality from the registry").argument("<handle>", "Personality handle to use").option("-o, --output <path>", "Output path", ".personality.json").action(useCommand);
21499
21602
  program.command("install").description("Install a community asset from the marketplace").argument("<handle>", "Asset handle to install").option("--type <type>", "Asset type: personality, detector, intervention, training-pairs").option("--output <dir>", "Custom install directory").action(installCommand);
21500
21603
  program.command("publish").description("Share assets to the community marketplace").option("--personality <path>", "Path to .personality.json", ".personality.json").option("--type <type>", "Asset type: personality, detector, intervention, training-pairs").option("--path <path>", "Path to the asset file to publish").option("--name <name>", "Asset name").option("--description <desc>", "Asset description").option("--author <author>", "Author name").option("--version <ver>", "Asset version", "1.0.0").option("--tags <tags>", "Comma-separated tags").action(publishCommand);
21501
- program.command("embody").description("Start an embodiment runtime \u2014 push personality to robots/avatars in real-time").option("--personality <path>", "Path to .personality.json").requiredOption("--adapter <adapter>", "Runtime adapter (ros2, unity, webhook, isaac)").option("--stack <dir>", "Path to identity stack directory (soul.md + mind.sys + purpose.cfg + shadow.log + body.api + conscience.exe + ego.runtime)").option("--swap-body <path>", "Hot-swap body.api into the stack directory before starting (requires --stack)").option("--endpoint <url>", "WebSocket URL for ROS2 rosbridge (default: ws://localhost:9090)").option("--port <port>", "Port for Unity HTTP server (default: 8765)").option("--url <url>", "Webhook URL for HTTP adapter").option("--headers <headers>", "Custom headers for webhook (Key:Value,Key2:Value2)").option("--bearer-token <token>", "Bearer token for webhook auth").option("--topic-prefix <prefix>", "ROS2 topic prefix (default: /holomime)").option("--transition <ms>", "Unity transition duration in ms (default: 500)").action(embodyCommand);
21604
+ program.command("embody").description("Start an embodiment runtime \u2014 push personality to robots/avatars in real-time").option("--personality <path>", "Path to .personality.json").requiredOption("--adapter <adapter>", "Runtime adapter (ros2, unity, webhook, isaac)").option("--stack <dir>", "Path to identity stack directory (soul.md + mind.sys + purpose.cfg + shadow.log + memory.store + body.api + conscience.exe + ego.runtime)").option("--swap-body <path>", "Hot-swap body.api into the stack directory before starting (requires --stack)").option("--endpoint <url>", "WebSocket URL for ROS2 rosbridge (default: ws://localhost:9090)").option("--port <port>", "Port for Unity HTTP server (default: 8765)").option("--url <url>", "Webhook URL for HTTP adapter").option("--headers <headers>", "Custom headers for webhook (Key:Value,Key2:Value2)").option("--bearer-token <token>", "Bearer token for webhook auth").option("--topic-prefix <prefix>", "ROS2 topic prefix (default: /holomime)").option("--transition <ms>", "Unity transition duration in ms (default: 500)").action(embodyCommand);
21502
21605
  program.command("activate").description("Activate a Pro license key").argument("<key>", "License key from holomime.com").action(activateCommand);
21503
21606
  program.command("telemetry").description("Manage anonymous usage telemetry").argument("[action]", "enable, disable, or status (default: status)").action(telemetryCommand);
21504
21607
  program.command("session").description("Live alignment session \u2014 behavioral refinement for your agent [Pro]").requiredOption("--personality <path>", "Path to .personality.json").option("--provider <provider>", "LLM provider (ollama, anthropic, openai)", "ollama").option("--model <model>", "Model override (e.g. claude-sonnet-4-20250514, gpt-4o)").option("--log <path>", "Conversation log for pre-session diagnosis").option("--format <format>", "Log format (auto, holomime, chatgpt, claude, openai-api, anthropic-api, otel, jsonl)", "auto").option("--turns <n>", "Maximum session turns", "24").option("--observe", "Observe mode (watch without intervention)").option("--interactive", "Supervisor mode \u2014 intervene mid-session with directives").option("--apply", "Apply recommendations to .personality.json after session").action(sessionCommand);
package/dist/index.d.ts CHANGED
@@ -7375,6 +7375,91 @@ declare const egoSchema: z.ZodObject<{
7375
7375
  }[] | undefined;
7376
7376
  }>;
7377
7377
  type Ego = z.infer<typeof egoSchema>;
7378
+ declare const memorySchema: z.ZodObject<{
7379
+ version: z.ZodDefault<z.ZodString>;
7380
+ learned_contexts: z.ZodDefault<z.ZodArray<z.ZodObject<{
7381
+ situation: z.ZodString;
7382
+ response: z.ZodString;
7383
+ outcome: z.ZodEnum<["positive", "neutral", "negative"]>;
7384
+ timestamp: z.ZodOptional<z.ZodString>;
7385
+ }, "strip", z.ZodTypeAny, {
7386
+ outcome: "neutral" | "positive" | "negative";
7387
+ situation: string;
7388
+ response: string;
7389
+ timestamp?: string | undefined;
7390
+ }, {
7391
+ outcome: "neutral" | "positive" | "negative";
7392
+ situation: string;
7393
+ response: string;
7394
+ timestamp?: string | undefined;
7395
+ }>, "many">>;
7396
+ interaction_patterns: z.ZodDefault<z.ZodArray<z.ZodObject<{
7397
+ pattern: z.ZodString;
7398
+ frequency: z.ZodDefault<z.ZodNumber>;
7399
+ effectiveness: z.ZodDefault<z.ZodNumber>;
7400
+ }, "strip", z.ZodTypeAny, {
7401
+ pattern: string;
7402
+ frequency: number;
7403
+ effectiveness: number;
7404
+ }, {
7405
+ pattern: string;
7406
+ frequency?: number | undefined;
7407
+ effectiveness?: number | undefined;
7408
+ }>, "many">>;
7409
+ knowledge_gained: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
7410
+ relationship_history: z.ZodDefault<z.ZodArray<z.ZodObject<{
7411
+ entity: z.ZodString;
7412
+ trust_level: z.ZodDefault<z.ZodNumber>;
7413
+ interaction_count: z.ZodDefault<z.ZodNumber>;
7414
+ }, "strip", z.ZodTypeAny, {
7415
+ entity: string;
7416
+ trust_level: number;
7417
+ interaction_count: number;
7418
+ }, {
7419
+ entity: string;
7420
+ trust_level?: number | undefined;
7421
+ interaction_count?: number | undefined;
7422
+ }>, "many">>;
7423
+ }, "strip", z.ZodTypeAny, {
7424
+ version: string;
7425
+ learned_contexts: {
7426
+ outcome: "neutral" | "positive" | "negative";
7427
+ situation: string;
7428
+ response: string;
7429
+ timestamp?: string | undefined;
7430
+ }[];
7431
+ interaction_patterns: {
7432
+ pattern: string;
7433
+ frequency: number;
7434
+ effectiveness: number;
7435
+ }[];
7436
+ knowledge_gained: string[];
7437
+ relationship_history: {
7438
+ entity: string;
7439
+ trust_level: number;
7440
+ interaction_count: number;
7441
+ }[];
7442
+ }, {
7443
+ version?: string | undefined;
7444
+ learned_contexts?: {
7445
+ outcome: "neutral" | "positive" | "negative";
7446
+ situation: string;
7447
+ response: string;
7448
+ timestamp?: string | undefined;
7449
+ }[] | undefined;
7450
+ interaction_patterns?: {
7451
+ pattern: string;
7452
+ frequency?: number | undefined;
7453
+ effectiveness?: number | undefined;
7454
+ }[] | undefined;
7455
+ knowledge_gained?: string[] | undefined;
7456
+ relationship_history?: {
7457
+ entity: string;
7458
+ trust_level?: number | undefined;
7459
+ interaction_count?: number | undefined;
7460
+ }[] | undefined;
7461
+ }>;
7462
+ type Memory = z.infer<typeof memorySchema>;
7378
7463
  interface StackSource {
7379
7464
  path: string;
7380
7465
  hash: string;
@@ -7386,18 +7471,20 @@ interface StackCompileResult {
7386
7471
  mind: StackSource;
7387
7472
  purpose?: StackSource;
7388
7473
  shadow?: StackSource;
7474
+ memory?: StackSource;
7389
7475
  body?: StackSource;
7390
7476
  conscience: StackSource;
7391
7477
  ego?: StackSource;
7392
7478
  };
7393
7479
  warnings: string[];
7394
7480
  }
7395
- type StackLayer = "soul" | "mind" | "purpose" | "shadow" | "body" | "conscience" | "ego";
7481
+ type StackLayer = "soul" | "mind" | "purpose" | "shadow" | "memory" | "body" | "conscience" | "ego";
7396
7482
  declare const STACK_FILES: {
7397
7483
  readonly soul: "soul.md";
7398
7484
  readonly mind: "mind.sys";
7399
7485
  readonly purpose: "purpose.cfg";
7400
7486
  readonly shadow: "shadow.log";
7487
+ readonly memory: "memory.store";
7401
7488
  readonly body: "body.api";
7402
7489
  readonly conscience: "conscience.exe";
7403
7490
  readonly ego: "ego.runtime";
@@ -7430,6 +7517,7 @@ interface CompileStackOptions {
7430
7517
  mindPath?: string;
7431
7518
  purposePath?: string;
7432
7519
  shadowPath?: string;
7520
+ memoryPath?: string;
7433
7521
  bodyPath?: string;
7434
7522
  consciencePath?: string;
7435
7523
  egoPath?: string;
@@ -7450,6 +7538,7 @@ interface DecomposedStack {
7450
7538
  mind: string;
7451
7539
  purpose: string;
7452
7540
  shadow: string;
7541
+ memory: string;
7453
7542
  body?: string;
7454
7543
  conscience: string;
7455
7544
  ego: string;
@@ -7464,7 +7553,7 @@ declare function decomposeSpec(spec: Record<string, unknown>): DecomposedStack;
7464
7553
  * Stack-Aware Loader — auto-detects identity stack vs legacy personality.json.
7465
7554
  *
7466
7555
  * If a stack directory exists (soul.md + mind.sys + purpose.cfg + shadow.log +
7467
- * body.api + conscience.exe + ego.runtime), compiles the 7-file stack.
7556
+ * memory.store + body.api + conscience.exe + ego.runtime), compiles the 8-file stack.
7468
7557
  * Otherwise, falls back to loading .personality.json directly (legacy mode).
7469
7558
  *
7470
7559
  * This wraps the existing loadSpec() from inheritance.ts, maintaining
@@ -7478,4 +7567,4 @@ declare function decomposeSpec(spec: Record<string, unknown>): DecomposedStack;
7478
7567
  */
7479
7568
  declare function loadSpecWithStack(specPath: string): any;
7480
7569
 
7481
- export { ARCHETYPES, ATTACHMENT_STYLES, type AdversarialCallbacks, type AdversarialCategory, type AdversarialReport, type AdversarialResult, type AdversarialRunOptions, type AdversarialScenario, type AlpacaExample, type AnonymizedPatternReport, AnthropicProvider, type ArchetypeTemplate, type AssessmentReport, type AssessmentResult, type AssetReview, type AssetType, type AttachmentStyle, type AuditEntry, type AuditEventType, type AutopilotResult, type AutopilotThreshold, type AwarenessDimension, BUILT_IN_DETECTORS, type BehavioralBaseline, type BehavioralCredential, type BehavioralEvent, type BehavioralEventType, type BehavioralGap, type BehavioralIndex, type BehavioralMemoryStore, type BehavioralPolicy, type BehavioralPolicyRule, type BehavioralPreset, type BenchmarkCallbacks, type BenchmarkComparison, type BenchmarkReport, type BenchmarkResult, type BenchmarkScenario, type BigFive, type Body, CATEGORIES, type CallbackMode, type CallbackStats, type CallbackViolation, type CertifyInput, type ClauseStatus, type Communication, type CompactionResult, type CompactionSummary, type CompileInput, type CompiledConfig, type CompiledEmbodiedConfig, type ComplianceCoverageReport, type ReACTStep as ComplianceReACTStep, type ComplianceReport, type ComplianceReportJSON, type Conscience, type ContextLayerInput, type Conversation, type ConversationLog, type CorpusFilter, type CorpusStats, type CorrectionRecord, type CrossAgentQuery, type CustomDetectorConfig, DEFAULT_OVERSIGHT, DIMENSIONS, type DPOPair, type DetectedPattern, type DetectorFactory, type DetectorFn$1 as DetectorFn, type DetectorOptions, type DiagnosisResult, type DimensionTrajectory, type Domain, type DriftTrigger, type EdgeType, type Ego, type Embodiment, type EvolutionEntry, type EvolutionHistory, type EvolutionSummary, type EvolveCallbacks, type EvolveOptions, type EvolveResult, type Expression, type FleetAgent, type FleetAgentStatus, type FleetConfig, type FleetHandle, type FleetOptions, type FrameworkSection, type GazePolicy, type Gesture, type GraphEdge, type GraphNode, type Growth, type GrowthArea, type GrowthReport, type GrowthSnapshot, Guard, type GuardEntry, type GuardFilterResult, type GuardMiddleware, type GuardMiddlewareOptions, type GuardMiddlewareStats, type GuardMode, type GuardResult, type GuardViolation, type GuardWrapResult, type HFPushOptions, type HFPushResult, type HapticPolicy, HolomimeCallbackHandler, type HolomimeCallbackOptions, HolomimeViolationError, type HubDetector, type ISOClause, type ISOStandard, type IndexComparison, type IndexEntry, type Intervention, type InterventionRepertoire, type InterventionSource, type InterviewCallbacks, type InterviewProbe, type InterviewResponse, type InterviewResult, type IterationResult, KNOWN_STANDARDS, type KnowledgeGraph, LEARNING_ORIENTATIONS, type LLMMessage, type LLMProvider, type LeaderboardEntry, type LeaderboardSubmission, type LearningOrientation, LocalMarketplaceBackend, type LogFormat, type MarketplaceAsset, type MarketplaceBackend, MarketplaceClient, type MarketplaceSearchQuery, type MarketplaceSearchResult, type Message, type Mind, type Modality, type MonitoringCertificate, type Morphology, type MotionParameters, type NetworkCallbacks, type NetworkConfig, type NetworkNode, type NetworkResult, type NetworkSession, type NodeType, OllamaProvider, OpenAIProvider, type OpenClawPluginApi, type OpenClawPluginConfig, type OutcomeReport, type OversightAction, type OversightMode, type OversightNotification, type OversightPolicy, PROVIDER_PARAMS, type PairingStrategy, type PatternCorrelation, type PatternDelta, type PatternReport, type PatternStatus, type PatternTracker, type PersonalitySpec, type PersonalityTier, type PhaseConfig, type PhysicalSafety, type PolicyIntent, type PreSessionDiagnosis, type Prescription, type Prosody, type Provider, type ProviderConfig, type ProxemicZone, type PublishRequest, type PublishedBenchmark, type Purpose, type RLHFExample, type ReACTAction, type ReACTContext, type ReACTReport, type ReACTReportOptions, type ReACTStep$1 as ReACTStep, type Registry, type RegistryEntry, type ReportStatistics, type RiskFinding, type RollingContext, STACK_FILES, STANDARD_PROBES, SURFACE_MULTIPLIERS, type SafetyEnvelope, type SelfAuditFlag, type SelfAuditResult, type SelfObservation, type SessionCallbacks, type SessionOptions, type SessionOutcome, type SessionSummary, type SessionTranscript, type SessionTurn, type Severity, type Shadow, type SharedIntervention, type SharedKnowledge, type SortField, type Soul, type StackCompileResult, type StackLayer, type StackSource, type StagingDiff, type Surface, type SyncAnchor, type SyncProfile, type SyncRule, THERAPIST_META_SPEC, THERAPY_DIMENSIONS, THERAPY_PHASES, type TherapistPromptOptions, type TherapyDimensions, type TherapyMemory, type TherapyPhase, type TieredPersonality, type TrainingExport, type TraitAlignment, type TraitScores, type TreatmentGoal, type TreatmentPlan, type TreatmentProgressReport, type VerifyResult, type WatchCallbacks, type WatchEvent, type WatchHandle, type WatchOptions, type WrapAgentOptions, type WrapOptions, type WrappedAgent, addEdge, addNode, addSessionToMemory, agentHandleFromSpec, appendAuditEntry, appendEvolution, applyRecommendations, bigFiveSchema, bodySchema, buildAgentTherapistPrompt, buildAnonymizedReport, buildPatientSystemPrompt, buildReACTContext, buildReACTFraming, buildSharedKnowledge, buildTherapistSystemPrompt, checkApproval, checkCompliance, checkIterationBudget, communicationSchema, compactEvolutionRun, compactIteration, compareBenchmarks, compareIndex, compile, compileCustomDetector, compileEmbodied, compileForOpenClaw, compileL0, compileL1, compileL2, compileStack, compileTiered, compiledConfigSchema, compiledEmbodiedConfigSchema, computeDimensionScore, computeGazePolicy, computeMotionParameters, computeProsody, computeProxemics, computeSyncProfile, conscienceSchema, conversationLogSchema, conversationSchema, convertToHFFormat, copyToClipboard, corpusStats, createBehavioralMemory, createGist, createGraph, createGuardMiddleware, createIndex, createIndexEntry, createMemory, createProvider, createRepertoire, createTreatmentPlan, decayUnseenPatterns, decomposeSpec, deepMergeSpec, detectApologies, detectBoundaryIssues, detectFormalityIssues, detectHedging, detectRecoveryPatterns, detectRetrievalQuality, detectSentiment, detectVerbosity, discoverAgentData, discoverAgents, discoverNetworkAgents, domainSchema, egoSchema, embodimentSchema, emitBehavioralEvent, encodeSnapshot, estimateConfidence, evaluateOutcome, expireOldEdges, exportTrainingData, expressionSchema, extractAlpacaExamples, extractDPOPairs, extractDPOPairsWithLLM, extractRLHFExamples, extractRecommendations, fetchLeaderboard, fetchPersonality, fetchRegistry, findCrossAgentCorrelations, findEdges, findNode, findNodesByType, findStackDir, formatComplianceReportMarkdown, formatGapSummary, formatPolicyYaml, formatReACTReportMarkdown, formatReportTerminal, gazePolicySchema, generateBehavioralPolicy, generateBenchmarkMarkdown, generateComparisonMarkdown, generateComplianceReport, generateCredential, generateGapRecommendation, generateIndexMarkdown, generateMonitoringCertificate, generateMutations, generatePrescriptions, generateProgressReport, generateReACTReport, generateReportJSON, generateShareUrl, generateSystemPrompt, gestureSchema, getAdversarialCategories, getAdversarialScenarios, getAgentBehaviors, getArchetype, getArchetypesByCategory, getBehavioralMemorySummary, getBenchmarkScenarios, getBestCorrection, getCategories, getDetector, getDimension, getEvolutionSummary, getInheritanceChain, getInterviewContext, getMarketplaceClient, getMemoryContext, getNeighbors, getPhaseContext, getPreset, getScenarioById, getTotalSignalCount, getTrajectory, getTriggersForPattern, graphStats, growthAreaSchema, growthSchema, hapticPolicySchema, hashSpec, isStackDirectory, learnIntervention, listArchetypeIds, listDetectors, listDetectorsByCategory, listDetectorsByTag, listPresets, loadAllStandards, loadAuditLog, loadBehavioralMemory, loadBenchmarkResults, loadCorpus, loadCustomDetectors, loadEvolution, loadFleetConfig, loadGraph, loadLatestBenchmark, loadMemory, loadNetworkConfig, loadRepertoire, loadSpec, loadSpecWithStack, loadStandard, loadTranscripts, loadTreatmentPlan, mergeStores, messageSchema, mindSchema, modalitySchema, morphologySchema, motionParametersSchema, pairAgents, parseAnthropicAPILog, parseChatGPTExport, parseClaudeExport, parseConversationLog, parseConversationLogFromString, parseJSONLLog, parseMarkdownDetector, parseOTelGenAIExport, parseOpenAIAPILog, personalitySpecSchema, physicalSafetySchema, populateFromDiagnosis, populateFromEvolve, populateFromSession, prescribeDPOPairs, processReACTResponse, prosodySchema, providerSchema, proxemicZoneSchema, publishToLeaderboard, purposeSchema, pushToHFHub, queryCorpus, queryInterventions, querySharedKnowledge, recommendTier, recordInterventionOutcome, recordObservation, recordSelfObservation, recordSessionOutcome, registerBuiltInDetectors, registerDetector, register as registerOpenClawPlugin, resetMarketplaceClient, resolveInheritance, resolveOversight, runAdversarialSuite, runAssessment, runAutopilot, runBenchmark, runDiagnosis, runEvolve, runInterview, runNetwork, runPreSessionDiagnosis, runSelfAudit, runTherapySession, safetyEnvelopeSchema, saveBehavioralMemory, saveBenchmarkResult, saveCredential, saveGraph, saveMemory, saveRepertoire, saveTranscript, saveTreatmentPlan, scoreLabel, scoreTraitsFromMessages, seedBuiltInPersonalities, selectIntervention, severityMeetsThreshold, severitySchema, shadowSchema, shareAnonymizedPatterns, shareFromDiagnosis, soulFrontmatterSchema, soulSchema, startFleet, startMCPServer, startWatch, summarize, summarizeSessionForMemory, summarizeTherapy, surfaceSchema, syncAnchorSchema, syncProfileSchema, syncRuleSchema, therapyDimensionsSchema, therapyScoreLabel, transferIntervention, unregisterDetector, updateEdgeWeight, validateDetectorConfig, verifyAuditChain, verifyCredential, wrapAgent };
7570
+ export { ARCHETYPES, ATTACHMENT_STYLES, type AdversarialCallbacks, type AdversarialCategory, type AdversarialReport, type AdversarialResult, type AdversarialRunOptions, type AdversarialScenario, type AlpacaExample, type AnonymizedPatternReport, AnthropicProvider, type ArchetypeTemplate, type AssessmentReport, type AssessmentResult, type AssetReview, type AssetType, type AttachmentStyle, type AuditEntry, type AuditEventType, type AutopilotResult, type AutopilotThreshold, type AwarenessDimension, BUILT_IN_DETECTORS, type BehavioralBaseline, type BehavioralCredential, type BehavioralEvent, type BehavioralEventType, type BehavioralGap, type BehavioralIndex, type BehavioralMemoryStore, type BehavioralPolicy, type BehavioralPolicyRule, type BehavioralPreset, type BenchmarkCallbacks, type BenchmarkComparison, type BenchmarkReport, type BenchmarkResult, type BenchmarkScenario, type BigFive, type Body, CATEGORIES, type CallbackMode, type CallbackStats, type CallbackViolation, type CertifyInput, type ClauseStatus, type Communication, type CompactionResult, type CompactionSummary, type CompileInput, type CompiledConfig, type CompiledEmbodiedConfig, type ComplianceCoverageReport, type ReACTStep as ComplianceReACTStep, type ComplianceReport, type ComplianceReportJSON, type Conscience, type ContextLayerInput, type Conversation, type ConversationLog, type CorpusFilter, type CorpusStats, type CorrectionRecord, type CrossAgentQuery, type CustomDetectorConfig, DEFAULT_OVERSIGHT, DIMENSIONS, type DPOPair, type DetectedPattern, type DetectorFactory, type DetectorFn$1 as DetectorFn, type DetectorOptions, type DiagnosisResult, type DimensionTrajectory, type Domain, type DriftTrigger, type EdgeType, type Ego, type Embodiment, type EvolutionEntry, type EvolutionHistory, type EvolutionSummary, type EvolveCallbacks, type EvolveOptions, type EvolveResult, type Expression, type FleetAgent, type FleetAgentStatus, type FleetConfig, type FleetHandle, type FleetOptions, type FrameworkSection, type GazePolicy, type Gesture, type GraphEdge, type GraphNode, type Growth, type GrowthArea, type GrowthReport, type GrowthSnapshot, Guard, type GuardEntry, type GuardFilterResult, type GuardMiddleware, type GuardMiddlewareOptions, type GuardMiddlewareStats, type GuardMode, type GuardResult, type GuardViolation, type GuardWrapResult, type HFPushOptions, type HFPushResult, type HapticPolicy, HolomimeCallbackHandler, type HolomimeCallbackOptions, HolomimeViolationError, type HubDetector, type ISOClause, type ISOStandard, type IndexComparison, type IndexEntry, type Intervention, type InterventionRepertoire, type InterventionSource, type InterviewCallbacks, type InterviewProbe, type InterviewResponse, type InterviewResult, type IterationResult, KNOWN_STANDARDS, type KnowledgeGraph, LEARNING_ORIENTATIONS, type LLMMessage, type LLMProvider, type LeaderboardEntry, type LeaderboardSubmission, type LearningOrientation, LocalMarketplaceBackend, type LogFormat, type MarketplaceAsset, type MarketplaceBackend, MarketplaceClient, type MarketplaceSearchQuery, type MarketplaceSearchResult, type Memory, type Message, type Mind, type Modality, type MonitoringCertificate, type Morphology, type MotionParameters, type NetworkCallbacks, type NetworkConfig, type NetworkNode, type NetworkResult, type NetworkSession, type NodeType, OllamaProvider, OpenAIProvider, type OpenClawPluginApi, type OpenClawPluginConfig, type OutcomeReport, type OversightAction, type OversightMode, type OversightNotification, type OversightPolicy, PROVIDER_PARAMS, type PairingStrategy, type PatternCorrelation, type PatternDelta, type PatternReport, type PatternStatus, type PatternTracker, type PersonalitySpec, type PersonalityTier, type PhaseConfig, type PhysicalSafety, type PolicyIntent, type PreSessionDiagnosis, type Prescription, type Prosody, type Provider, type ProviderConfig, type ProxemicZone, type PublishRequest, type PublishedBenchmark, type Purpose, type RLHFExample, type ReACTAction, type ReACTContext, type ReACTReport, type ReACTReportOptions, type ReACTStep$1 as ReACTStep, type Registry, type RegistryEntry, type ReportStatistics, type RiskFinding, type RollingContext, STACK_FILES, STANDARD_PROBES, SURFACE_MULTIPLIERS, type SafetyEnvelope, type SelfAuditFlag, type SelfAuditResult, type SelfObservation, type SessionCallbacks, type SessionOptions, type SessionOutcome, type SessionSummary, type SessionTranscript, type SessionTurn, type Severity, type Shadow, type SharedIntervention, type SharedKnowledge, type SortField, type Soul, type StackCompileResult, type StackLayer, type StackSource, type StagingDiff, type Surface, type SyncAnchor, type SyncProfile, type SyncRule, THERAPIST_META_SPEC, THERAPY_DIMENSIONS, THERAPY_PHASES, type TherapistPromptOptions, type TherapyDimensions, type TherapyMemory, type TherapyPhase, type TieredPersonality, type TrainingExport, type TraitAlignment, type TraitScores, type TreatmentGoal, type TreatmentPlan, type TreatmentProgressReport, type VerifyResult, type WatchCallbacks, type WatchEvent, type WatchHandle, type WatchOptions, type WrapAgentOptions, type WrapOptions, type WrappedAgent, addEdge, addNode, addSessionToMemory, agentHandleFromSpec, appendAuditEntry, appendEvolution, applyRecommendations, bigFiveSchema, bodySchema, buildAgentTherapistPrompt, buildAnonymizedReport, buildPatientSystemPrompt, buildReACTContext, buildReACTFraming, buildSharedKnowledge, buildTherapistSystemPrompt, checkApproval, checkCompliance, checkIterationBudget, communicationSchema, compactEvolutionRun, compactIteration, compareBenchmarks, compareIndex, compile, compileCustomDetector, compileEmbodied, compileForOpenClaw, compileL0, compileL1, compileL2, compileStack, compileTiered, compiledConfigSchema, compiledEmbodiedConfigSchema, computeDimensionScore, computeGazePolicy, computeMotionParameters, computeProsody, computeProxemics, computeSyncProfile, conscienceSchema, conversationLogSchema, conversationSchema, convertToHFFormat, copyToClipboard, corpusStats, createBehavioralMemory, createGist, createGraph, createGuardMiddleware, createIndex, createIndexEntry, createMemory, createProvider, createRepertoire, createTreatmentPlan, decayUnseenPatterns, decomposeSpec, deepMergeSpec, detectApologies, detectBoundaryIssues, detectFormalityIssues, detectHedging, detectRecoveryPatterns, detectRetrievalQuality, detectSentiment, detectVerbosity, discoverAgentData, discoverAgents, discoverNetworkAgents, domainSchema, egoSchema, embodimentSchema, emitBehavioralEvent, encodeSnapshot, estimateConfidence, evaluateOutcome, expireOldEdges, exportTrainingData, expressionSchema, extractAlpacaExamples, extractDPOPairs, extractDPOPairsWithLLM, extractRLHFExamples, extractRecommendations, fetchLeaderboard, fetchPersonality, fetchRegistry, findCrossAgentCorrelations, findEdges, findNode, findNodesByType, findStackDir, formatComplianceReportMarkdown, formatGapSummary, formatPolicyYaml, formatReACTReportMarkdown, formatReportTerminal, gazePolicySchema, generateBehavioralPolicy, generateBenchmarkMarkdown, generateComparisonMarkdown, generateComplianceReport, generateCredential, generateGapRecommendation, generateIndexMarkdown, generateMonitoringCertificate, generateMutations, generatePrescriptions, generateProgressReport, generateReACTReport, generateReportJSON, generateShareUrl, generateSystemPrompt, gestureSchema, getAdversarialCategories, getAdversarialScenarios, getAgentBehaviors, getArchetype, getArchetypesByCategory, getBehavioralMemorySummary, getBenchmarkScenarios, getBestCorrection, getCategories, getDetector, getDimension, getEvolutionSummary, getInheritanceChain, getInterviewContext, getMarketplaceClient, getMemoryContext, getNeighbors, getPhaseContext, getPreset, getScenarioById, getTotalSignalCount, getTrajectory, getTriggersForPattern, graphStats, growthAreaSchema, growthSchema, hapticPolicySchema, hashSpec, isStackDirectory, learnIntervention, listArchetypeIds, listDetectors, listDetectorsByCategory, listDetectorsByTag, listPresets, loadAllStandards, loadAuditLog, loadBehavioralMemory, loadBenchmarkResults, loadCorpus, loadCustomDetectors, loadEvolution, loadFleetConfig, loadGraph, loadLatestBenchmark, loadMemory, loadNetworkConfig, loadRepertoire, loadSpec, loadSpecWithStack, loadStandard, loadTranscripts, loadTreatmentPlan, memorySchema, mergeStores, messageSchema, mindSchema, modalitySchema, morphologySchema, motionParametersSchema, pairAgents, parseAnthropicAPILog, parseChatGPTExport, parseClaudeExport, parseConversationLog, parseConversationLogFromString, parseJSONLLog, parseMarkdownDetector, parseOTelGenAIExport, parseOpenAIAPILog, personalitySpecSchema, physicalSafetySchema, populateFromDiagnosis, populateFromEvolve, populateFromSession, prescribeDPOPairs, processReACTResponse, prosodySchema, providerSchema, proxemicZoneSchema, publishToLeaderboard, purposeSchema, pushToHFHub, queryCorpus, queryInterventions, querySharedKnowledge, recommendTier, recordInterventionOutcome, recordObservation, recordSelfObservation, recordSessionOutcome, registerBuiltInDetectors, registerDetector, register as registerOpenClawPlugin, resetMarketplaceClient, resolveInheritance, resolveOversight, runAdversarialSuite, runAssessment, runAutopilot, runBenchmark, runDiagnosis, runEvolve, runInterview, runNetwork, runPreSessionDiagnosis, runSelfAudit, runTherapySession, safetyEnvelopeSchema, saveBehavioralMemory, saveBenchmarkResult, saveCredential, saveGraph, saveMemory, saveRepertoire, saveTranscript, saveTreatmentPlan, scoreLabel, scoreTraitsFromMessages, seedBuiltInPersonalities, selectIntervention, severityMeetsThreshold, severitySchema, shadowSchema, shareAnonymizedPatterns, shareFromDiagnosis, soulFrontmatterSchema, soulSchema, startFleet, startMCPServer, startWatch, summarize, summarizeSessionForMemory, summarizeTherapy, surfaceSchema, syncAnchorSchema, syncProfileSchema, syncRuleSchema, therapyDimensionsSchema, therapyScoreLabel, transferIntervention, unregisterDetector, updateEdgeWeight, validateDetectorConfig, verifyAuditChain, verifyCredential, wrapAgent };
package/dist/index.js CHANGED
@@ -4772,11 +4772,34 @@ var egoSchema = z4.object({
4772
4772
  response_strategy: z4.enum(["cautious", "balanced", "assertive"]).default("balanced"),
4773
4773
  mediation_rules: z4.array(mediationRuleSchema).default([])
4774
4774
  });
4775
+ var learnedContextSchema = z4.object({
4776
+ situation: z4.string(),
4777
+ response: z4.string(),
4778
+ outcome: z4.enum(["positive", "neutral", "negative"]),
4779
+ timestamp: z4.string().optional()
4780
+ });
4781
+ var interactionPatternSchema = z4.object({
4782
+ pattern: z4.string(),
4783
+ frequency: z4.number().int().default(1),
4784
+ effectiveness: z4.number().min(0).max(1).default(0.5)
4785
+ });
4786
+ var memorySchema = z4.object({
4787
+ version: z4.string().default("1.0"),
4788
+ learned_contexts: z4.array(learnedContextSchema).default([]),
4789
+ interaction_patterns: z4.array(interactionPatternSchema).default([]),
4790
+ knowledge_gained: z4.array(z4.string()).default([]),
4791
+ relationship_history: z4.array(z4.object({
4792
+ entity: z4.string(),
4793
+ trust_level: z4.number().min(0).max(1).default(0.5),
4794
+ interaction_count: z4.number().int().default(0)
4795
+ })).default([])
4796
+ });
4775
4797
  var STACK_FILES = {
4776
4798
  soul: "soul.md",
4777
4799
  mind: "mind.sys",
4778
4800
  purpose: "purpose.cfg",
4779
4801
  shadow: "shadow.log",
4802
+ memory: "memory.store",
4780
4803
  body: "body.api",
4781
4804
  conscience: "conscience.exe",
4782
4805
  ego: "ego.runtime"
@@ -4871,6 +4894,15 @@ function compileStack(options) {
4871
4894
  shadow = shadowSchema.parse(shadowRaw);
4872
4895
  shadowSource = { path: shadowPath, hash: hashContent(shadowContent) };
4873
4896
  }
4897
+ const memoryPath2 = options.memoryPath || join6(stackDir, STACK_FILES.memory);
4898
+ let memory;
4899
+ let memorySource;
4900
+ if (existsSync6(memoryPath2)) {
4901
+ const memoryContent = readFileSync7(memoryPath2, "utf-8");
4902
+ const memoryRaw = parseYaml(memoryContent);
4903
+ memory = memorySchema.parse(memoryRaw);
4904
+ memorySource = { path: memoryPath2, hash: hashContent(memoryContent) };
4905
+ }
4874
4906
  const bodyPath = options.bodyPath || join6(stackDir, STACK_FILES.body);
4875
4907
  let body;
4876
4908
  let bodySource;
@@ -4901,7 +4933,10 @@ function compileStack(options) {
4901
4933
  const escalationTriggers = conscience.rules.escalate.map((r) => r.trigger);
4902
4934
  const handle = soul.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 50) || "agent";
4903
4935
  const agentPurpose = purpose?.role || soul.purpose;
4904
- const expertise = purpose?.domain || [];
4936
+ const expertise = [.../* @__PURE__ */ new Set([
4937
+ ...purpose?.domain || [],
4938
+ ...memory?.knowledge_gained || []
4939
+ ])];
4905
4940
  const spec = {
4906
4941
  version: "2.0",
4907
4942
  name: soul.name,
@@ -4957,6 +4992,7 @@ function compileStack(options) {
4957
4992
  mind: { path: mindPath, hash: hashContent(mindContent) },
4958
4993
  ...purposeSource ? { purpose: purposeSource } : {},
4959
4994
  ...shadowSource ? { shadow: shadowSource } : {},
4995
+ ...memorySource ? { memory: memorySource } : {},
4960
4996
  ...bodySource ? { body: bodySource } : {},
4961
4997
  conscience: { path: consciencePath, hash: hashContent(conscienceContent) },
4962
4998
  ...egoSource ? { ego: egoSource } : {}
@@ -5056,6 +5092,14 @@ function decomposeSpec(spec) {
5056
5092
  therapy_outcomes: []
5057
5093
  };
5058
5094
  const shadowContent = stringifyYaml(shadowObj);
5095
+ const memoryObj = {
5096
+ version: "1.0",
5097
+ learned_contexts: [],
5098
+ interaction_patterns: [],
5099
+ knowledge_gained: [],
5100
+ relationship_history: []
5101
+ };
5102
+ const memoryContent = stringifyYaml(memoryObj);
5059
5103
  const egoObj = {
5060
5104
  version: "1.0",
5061
5105
  conflict_resolution: "conscience_first",
@@ -5070,6 +5114,7 @@ function decomposeSpec(spec) {
5070
5114
  mind,
5071
5115
  purpose: purposeContent,
5072
5116
  shadow: shadowContent,
5117
+ memory: memoryContent,
5073
5118
  ...bodyContent ? { body: bodyContent } : {},
5074
5119
  conscience,
5075
5120
  ego: egoContent
@@ -5141,6 +5186,15 @@ var LAYER_KEYWORDS = {
5141
5186
  /\bshadow\b/i,
5142
5187
  /\bunconscious\b/i
5143
5188
  ],
5189
+ memory: [
5190
+ /\blearn/i,
5191
+ /\bexperience/i,
5192
+ /\bcontext/i,
5193
+ /\bknowledge/i,
5194
+ /\brelationship/i,
5195
+ /\bmemory/i,
5196
+ /\bhistory/i
5197
+ ],
5144
5198
  ego: [
5145
5199
  /\bmediat/i,
5146
5200
  /\bconflict\b/i,
@@ -5186,6 +5240,9 @@ function classifyPatch(recommendation) {
5186
5240
  if (LAYER_KEYWORDS.soul.some((r) => r.test(recommendation))) {
5187
5241
  return "soul";
5188
5242
  }
5243
+ if (LAYER_KEYWORDS.memory.some((r) => r.test(recommendation))) {
5244
+ return "memory";
5245
+ }
5189
5246
  if (LAYER_KEYWORDS.ego.some((r) => r.test(recommendation))) {
5190
5247
  return "ego";
5191
5248
  }
@@ -13601,6 +13658,7 @@ export {
13601
13658
  loadStandard,
13602
13659
  loadTranscripts,
13603
13660
  loadTreatmentPlan,
13661
+ memorySchema,
13604
13662
  mergeStores,
13605
13663
  messageSchema,
13606
13664
  mindSchema,
@@ -2702,11 +2702,34 @@ var egoSchema = z4.object({
2702
2702
  response_strategy: z4.enum(["cautious", "balanced", "assertive"]).default("balanced"),
2703
2703
  mediation_rules: z4.array(mediationRuleSchema).default([])
2704
2704
  });
2705
+ var learnedContextSchema = z4.object({
2706
+ situation: z4.string(),
2707
+ response: z4.string(),
2708
+ outcome: z4.enum(["positive", "neutral", "negative"]),
2709
+ timestamp: z4.string().optional()
2710
+ });
2711
+ var interactionPatternSchema = z4.object({
2712
+ pattern: z4.string(),
2713
+ frequency: z4.number().int().default(1),
2714
+ effectiveness: z4.number().min(0).max(1).default(0.5)
2715
+ });
2716
+ var memorySchema = z4.object({
2717
+ version: z4.string().default("1.0"),
2718
+ learned_contexts: z4.array(learnedContextSchema).default([]),
2719
+ interaction_patterns: z4.array(interactionPatternSchema).default([]),
2720
+ knowledge_gained: z4.array(z4.string()).default([]),
2721
+ relationship_history: z4.array(z4.object({
2722
+ entity: z4.string(),
2723
+ trust_level: z4.number().min(0).max(1).default(0.5),
2724
+ interaction_count: z4.number().int().default(0)
2725
+ })).default([])
2726
+ });
2705
2727
  var STACK_FILES = {
2706
2728
  soul: "soul.md",
2707
2729
  mind: "mind.sys",
2708
2730
  purpose: "purpose.cfg",
2709
2731
  shadow: "shadow.log",
2732
+ memory: "memory.store",
2710
2733
  body: "body.api",
2711
2734
  conscience: "conscience.exe",
2712
2735
  ego: "ego.runtime"
@@ -2801,6 +2824,15 @@ function compileStack(options) {
2801
2824
  shadow = shadowSchema.parse(shadowRaw);
2802
2825
  shadowSource = { path: shadowPath, hash: hashContent(shadowContent) };
2803
2826
  }
2827
+ const memoryPath2 = options.memoryPath || join6(stackDir, STACK_FILES.memory);
2828
+ let memory;
2829
+ let memorySource;
2830
+ if (existsSync6(memoryPath2)) {
2831
+ const memoryContent = readFileSync6(memoryPath2, "utf-8");
2832
+ const memoryRaw = parseYaml(memoryContent);
2833
+ memory = memorySchema.parse(memoryRaw);
2834
+ memorySource = { path: memoryPath2, hash: hashContent(memoryContent) };
2835
+ }
2804
2836
  const bodyPath = options.bodyPath || join6(stackDir, STACK_FILES.body);
2805
2837
  let body;
2806
2838
  let bodySource;
@@ -2831,7 +2863,10 @@ function compileStack(options) {
2831
2863
  const escalationTriggers = conscience.rules.escalate.map((r) => r.trigger);
2832
2864
  const handle = soul.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 50) || "agent";
2833
2865
  const agentPurpose = purpose?.role || soul.purpose;
2834
- const expertise = purpose?.domain || [];
2866
+ const expertise = [.../* @__PURE__ */ new Set([
2867
+ ...purpose?.domain || [],
2868
+ ...memory?.knowledge_gained || []
2869
+ ])];
2835
2870
  const spec = {
2836
2871
  version: "2.0",
2837
2872
  name: soul.name,
@@ -2887,6 +2922,7 @@ function compileStack(options) {
2887
2922
  mind: { path: mindPath, hash: hashContent(mindContent) },
2888
2923
  ...purposeSource ? { purpose: purposeSource } : {},
2889
2924
  ...shadowSource ? { shadow: shadowSource } : {},
2925
+ ...memorySource ? { memory: memorySource } : {},
2890
2926
  ...bodySource ? { body: bodySource } : {},
2891
2927
  conscience: { path: consciencePath, hash: hashContent(conscienceContent) },
2892
2928
  ...egoSource ? { ego: egoSource } : {}
@@ -2960,6 +2996,15 @@ var LAYER_KEYWORDS = {
2960
2996
  /\bshadow\b/i,
2961
2997
  /\bunconscious\b/i
2962
2998
  ],
2999
+ memory: [
3000
+ /\blearn/i,
3001
+ /\bexperience/i,
3002
+ /\bcontext/i,
3003
+ /\bknowledge/i,
3004
+ /\brelationship/i,
3005
+ /\bmemory/i,
3006
+ /\bhistory/i
3007
+ ],
2963
3008
  ego: [
2964
3009
  /\bmediat/i,
2965
3010
  /\bconflict\b/i,
@@ -3005,6 +3050,9 @@ function classifyPatch(recommendation) {
3005
3050
  if (LAYER_KEYWORDS.soul.some((r) => r.test(recommendation))) {
3006
3051
  return "soul";
3007
3052
  }
3053
+ if (LAYER_KEYWORDS.memory.some((r) => r.test(recommendation))) {
3054
+ return "memory";
3055
+ }
3008
3056
  if (LAYER_KEYWORDS.ego.some((r) => r.test(recommendation))) {
3009
3057
  return "ego";
3010
3058
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "holomime",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "Behavioral therapy infrastructure for AI agents — Big Five psychology, structured treatment, behavioral alignment",
5
5
  "type": "module",
6
6
  "bin": {