holomime 2.1.0 → 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/dist/index.js CHANGED
@@ -4772,16 +4772,38 @@ 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"
4783
4806
  };
4784
- var psycheSchema = mindSchema;
4785
4807
 
4786
4808
  // src/core/stack-compiler.ts
4787
4809
  import { readFileSync as readFileSync7, existsSync as existsSync6 } from "fs";
@@ -4872,6 +4894,15 @@ function compileStack(options) {
4872
4894
  shadow = shadowSchema.parse(shadowRaw);
4873
4895
  shadowSource = { path: shadowPath, hash: hashContent(shadowContent) };
4874
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
+ }
4875
4906
  const bodyPath = options.bodyPath || join6(stackDir, STACK_FILES.body);
4876
4907
  let body;
4877
4908
  let bodySource;
@@ -4902,7 +4933,10 @@ function compileStack(options) {
4902
4933
  const escalationTriggers = conscience.rules.escalate.map((r) => r.trigger);
4903
4934
  const handle = soul.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 50) || "agent";
4904
4935
  const agentPurpose = purpose?.role || soul.purpose;
4905
- const expertise = purpose?.domain || [];
4936
+ const expertise = [.../* @__PURE__ */ new Set([
4937
+ ...purpose?.domain || [],
4938
+ ...memory?.knowledge_gained || []
4939
+ ])];
4906
4940
  const spec = {
4907
4941
  version: "2.0",
4908
4942
  name: soul.name,
@@ -4958,6 +4992,7 @@ function compileStack(options) {
4958
4992
  mind: { path: mindPath, hash: hashContent(mindContent) },
4959
4993
  ...purposeSource ? { purpose: purposeSource } : {},
4960
4994
  ...shadowSource ? { shadow: shadowSource } : {},
4995
+ ...memorySource ? { memory: memorySource } : {},
4961
4996
  ...bodySource ? { body: bodySource } : {},
4962
4997
  conscience: { path: consciencePath, hash: hashContent(conscienceContent) },
4963
4998
  ...egoSource ? { ego: egoSource } : {}
@@ -5057,6 +5092,14 @@ function decomposeSpec(spec) {
5057
5092
  therapy_outcomes: []
5058
5093
  };
5059
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);
5060
5103
  const egoObj = {
5061
5104
  version: "1.0",
5062
5105
  conflict_resolution: "conscience_first",
@@ -5071,6 +5114,7 @@ function decomposeSpec(spec) {
5071
5114
  mind,
5072
5115
  purpose: purposeContent,
5073
5116
  shadow: shadowContent,
5117
+ memory: memoryContent,
5074
5118
  ...bodyContent ? { body: bodyContent } : {},
5075
5119
  conscience,
5076
5120
  ego: egoContent
@@ -5142,6 +5186,15 @@ var LAYER_KEYWORDS = {
5142
5186
  /\bshadow\b/i,
5143
5187
  /\bunconscious\b/i
5144
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
+ ],
5145
5198
  ego: [
5146
5199
  /\bmediat/i,
5147
5200
  /\bconflict\b/i,
@@ -5187,6 +5240,9 @@ function classifyPatch(recommendation) {
5187
5240
  if (LAYER_KEYWORDS.soul.some((r) => r.test(recommendation))) {
5188
5241
  return "soul";
5189
5242
  }
5243
+ if (LAYER_KEYWORDS.memory.some((r) => r.test(recommendation))) {
5244
+ return "memory";
5245
+ }
5190
5246
  if (LAYER_KEYWORDS.ego.some((r) => r.test(recommendation))) {
5191
5247
  return "ego";
5192
5248
  }
@@ -11398,7 +11454,6 @@ function checkClause(spec, clause) {
11398
11454
  }
11399
11455
  break;
11400
11456
  }
11401
- case "psyche":
11402
11457
  case "mind": {
11403
11458
  const hasBigFive = !!s.big_five;
11404
11459
  const hasTherapy = !!s.therapy_dimensions;
@@ -11567,9 +11622,9 @@ function generateRecommendations(reports) {
11567
11622
  `Define core values and purpose in soul.md for ${report.standard} clauses ${clauseIds}`
11568
11623
  );
11569
11624
  break;
11570
- case "psyche":
11625
+ case "mind":
11571
11626
  recommendations.push(
11572
- `Configure Big Five traits and therapy dimensions in psyche.sys for ${report.standard} clauses ${clauseIds}`
11627
+ `Configure Big Five traits and therapy dimensions in mind.sys for ${report.standard} clauses ${clauseIds}`
11573
11628
  );
11574
11629
  break;
11575
11630
  case "conscience":
@@ -13603,6 +13658,7 @@ export {
13603
13658
  loadStandard,
13604
13659
  loadTranscripts,
13605
13660
  loadTreatmentPlan,
13661
+ memorySchema,
13606
13662
  mergeStores,
13607
13663
  messageSchema,
13608
13664
  mindSchema,
@@ -13629,7 +13685,6 @@ export {
13629
13685
  prosodySchema,
13630
13686
  providerSchema,
13631
13687
  proxemicZoneSchema,
13632
- psycheSchema,
13633
13688
  publishToLeaderboard,
13634
13689
  purposeSchema,
13635
13690
  pushToHFHub,
@@ -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.0",
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": {