@noopolis/daimon 0.1.0 → 0.1.2

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 (116) hide show
  1. package/README.md +141 -5
  2. package/dist/core/siblingBuildFreshness.d.ts +21 -0
  3. package/dist/core/siblingBuildFreshness.d.ts.map +1 -0
  4. package/dist/core/siblingBuildFreshness.js +25 -0
  5. package/dist/core/types.d.ts +20 -1
  6. package/dist/core/types.d.ts.map +1 -1
  7. package/dist/examples/exampleCausalId.d.ts +3 -0
  8. package/dist/examples/exampleCausalId.d.ts.map +1 -0
  9. package/dist/examples/exampleCausalId.js +8 -0
  10. package/dist/examples/jungian-play-org.d.ts +2 -0
  11. package/dist/examples/jungian-play-org.d.ts.map +1 -0
  12. package/dist/examples/jungian-play-org.js +281 -0
  13. package/dist/examples/jungian-triad-org.d.ts +2 -0
  14. package/dist/examples/jungian-triad-org.d.ts.map +1 -0
  15. package/dist/examples/jungian-triad-org.js +281 -0
  16. package/dist/examples/jungianConversationPlan.d.ts +10 -0
  17. package/dist/examples/jungianConversationPlan.d.ts.map +1 -0
  18. package/dist/examples/jungianConversationPlan.js +64 -0
  19. package/dist/examples/jungianPiRepresentative.d.ts +36 -0
  20. package/dist/examples/jungianPiRepresentative.d.ts.map +1 -0
  21. package/dist/examples/jungianPiRepresentative.js +81 -0
  22. package/dist/examples/jungianPlayAgent.d.ts +36 -0
  23. package/dist/examples/jungianPlayAgent.d.ts.map +1 -0
  24. package/dist/examples/jungianPlayAgent.js +111 -0
  25. package/dist/examples/jungianProfiles.d.ts +34 -0
  26. package/dist/examples/jungianProfiles.d.ts.map +1 -0
  27. package/dist/examples/jungianProfiles.js +190 -0
  28. package/dist/examples/jungianTrace.d.ts +47 -0
  29. package/dist/examples/jungianTrace.d.ts.map +1 -0
  30. package/dist/examples/jungianTrace.js +101 -0
  31. package/dist/examples/jungianTriadProfiles.d.ts +35 -0
  32. package/dist/examples/jungianTriadProfiles.d.ts.map +1 -0
  33. package/dist/examples/jungianTriadProfiles.js +81 -0
  34. package/dist/examples/pi-agent.js +3 -2
  35. package/dist/examples/pi-memory-org.d.ts +2 -0
  36. package/dist/examples/pi-memory-org.d.ts.map +1 -0
  37. package/dist/examples/pi-memory-org.js +231 -0
  38. package/dist/index.d.ts +2 -3
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +2 -3
  41. package/dist/mcp/toolServer.d.ts +14 -0
  42. package/dist/mcp/toolServer.d.ts.map +1 -0
  43. package/dist/mcp/toolServer.js +105 -0
  44. package/dist/observability/causalEvents.d.ts +118 -0
  45. package/dist/observability/causalEvents.d.ts.map +1 -0
  46. package/dist/observability/causalEvents.js +135 -0
  47. package/dist/observability/controlCausal.d.ts +117 -0
  48. package/dist/observability/controlCausal.d.ts.map +1 -0
  49. package/dist/observability/controlCausal.js +107 -0
  50. package/dist/observability/emitCausalFixture.d.ts +25 -0
  51. package/dist/observability/emitCausalFixture.d.ts.map +1 -0
  52. package/dist/observability/emitCausalFixture.js +98 -0
  53. package/dist/observability/index.d.ts +4 -0
  54. package/dist/observability/index.d.ts.map +1 -0
  55. package/dist/observability/index.js +3 -0
  56. package/dist/observability/orgObserver.d.ts +98 -0
  57. package/dist/observability/orgObserver.d.ts.map +1 -0
  58. package/dist/observability/orgObserver.js +181 -0
  59. package/dist/pi/cliSession.d.ts +46 -0
  60. package/dist/pi/cliSession.d.ts.map +1 -0
  61. package/dist/pi/cliSession.js +224 -0
  62. package/dist/pi/index.d.ts +9 -0
  63. package/dist/pi/index.d.ts.map +1 -0
  64. package/dist/pi/index.js +8 -0
  65. package/dist/pi/memoryTools.d.ts +69 -0
  66. package/dist/pi/memoryTools.d.ts.map +1 -0
  67. package/dist/pi/memoryTools.js +190 -0
  68. package/dist/pi/modelRegistry.d.ts +13 -0
  69. package/dist/pi/modelRegistry.d.ts.map +1 -0
  70. package/dist/pi/modelRegistry.js +19 -0
  71. package/dist/pi/piAgentHandle.d.ts +45 -0
  72. package/dist/pi/piAgentHandle.d.ts.map +1 -0
  73. package/dist/pi/piAgentHandle.js +324 -0
  74. package/dist/pi/piAgentWakeSupport.d.ts +68 -0
  75. package/dist/pi/piAgentWakeSupport.d.ts.map +1 -0
  76. package/dist/pi/piAgentWakeSupport.js +147 -0
  77. package/dist/pi/piHarness.d.ts +36 -2
  78. package/dist/pi/piHarness.d.ts.map +1 -1
  79. package/dist/pi/piHarness.js +100 -127
  80. package/dist/pi/prompts.d.ts +9 -0
  81. package/dist/pi/prompts.d.ts.map +1 -0
  82. package/dist/pi/prompts.js +39 -0
  83. package/dist/pi/rawTrainingCapture.d.ts +59 -0
  84. package/dist/pi/rawTrainingCapture.d.ts.map +1 -0
  85. package/dist/pi/rawTrainingCapture.js +175 -0
  86. package/dist/pi/turnCausal.d.ts +73 -0
  87. package/dist/pi/turnCausal.d.ts.map +1 -0
  88. package/dist/pi/turnCausal.js +75 -0
  89. package/dist/pi/turnTrace.d.ts +128 -0
  90. package/dist/pi/turnTrace.d.ts.map +1 -0
  91. package/dist/pi/turnTrace.js +141 -0
  92. package/dist/pi/wakeAcceptance.d.ts +49 -0
  93. package/dist/pi/wakeAcceptance.d.ts.map +1 -0
  94. package/dist/pi/wakeAcceptance.js +281 -0
  95. package/dist/pi/wakeAcceptanceFs.d.ts +44 -0
  96. package/dist/pi/wakeAcceptanceFs.d.ts.map +1 -0
  97. package/dist/pi/wakeAcceptanceFs.js +318 -0
  98. package/dist/pi/wakeAcceptanceSchema.d.ts +75 -0
  99. package/dist/pi/wakeAcceptanceSchema.d.ts.map +1 -0
  100. package/dist/pi/wakeAcceptanceSchema.js +265 -0
  101. package/dist/pi/wakeModes.d.ts +9 -0
  102. package/dist/pi/wakeModes.d.ts.map +1 -0
  103. package/dist/pi/wakeModes.js +19 -0
  104. package/dist/pi/worldNudge.d.ts +22 -0
  105. package/dist/pi/worldNudge.d.ts.map +1 -0
  106. package/dist/pi/worldNudge.js +62 -0
  107. package/dist/pi/worldToolProtocol.d.ts +13 -0
  108. package/dist/pi/worldToolProtocol.d.ts.map +1 -0
  109. package/dist/pi/worldToolProtocol.js +49 -0
  110. package/dist/pi/worldTools.d.ts +32 -0
  111. package/dist/pi/worldTools.d.ts.map +1 -0
  112. package/dist/pi/worldTools.js +373 -0
  113. package/dist/pi/worldTrajectory.d.ts +52 -0
  114. package/dist/pi/worldTrajectory.d.ts.map +1 -0
  115. package/dist/pi/worldTrajectory.js +131 -0
  116. package/package.json +23 -4
@@ -0,0 +1,190 @@
1
+ const innerEngine = () => process.env.DAIMON_JUNGIAN_ARCHETYPE_ENGINE ?? "agy";
2
+ const representativeEngine = (fallback) => process.env.DAIMON_JUNGIAN_REPRESENTATIVE_ENGINE ?? fallback;
3
+ const archetypes = (self) => {
4
+ const engine = innerEngine();
5
+ if (self === "maya") {
6
+ return [
7
+ {
8
+ id: "persona",
9
+ name: "Competent Host",
10
+ archetype: "Persona",
11
+ engine,
12
+ agenda: "Keep Maya sounding calm, funny, and like the one who has a plan.",
13
+ fear: "If she admits she is overwhelmed, everyone will expect less of her.",
14
+ gift: "Timing, tact, social grace, clean practical language.",
15
+ wound: "Grew up as the reliable kid who fixed family problems before anyone asked."
16
+ },
17
+ {
18
+ id: "shadow",
19
+ name: "Burnt-Out Shadow",
20
+ archetype: "Shadow",
21
+ engine,
22
+ agenda: "Say the annoying truth: Maya is tired of carrying Leo and the whole office.",
23
+ fear: "If she stays nice, she will become resentful and quietly mean.",
24
+ gift: "Honesty, boundaries, refusal to pretend everything is fine.",
25
+ wound: "Has watched Maya smile through too many last-minute rescues."
26
+ },
27
+ {
28
+ id: "soul-image",
29
+ name: "Soft-Spot Anima",
30
+ archetype: "Anima",
31
+ engine,
32
+ agenda: "Remember that Leo is scared too, and Maya actually likes having him around.",
33
+ fear: "The conversation will become all logistics and no care.",
34
+ gift: "Warmth, vulnerability, noticing the feeling under the joke.",
35
+ wound: "Maya learned early not to ask for comfort directly."
36
+ },
37
+ {
38
+ id: "wise-one",
39
+ name: "Practical Aunt",
40
+ archetype: "Wise Old Woman",
41
+ engine,
42
+ agenda: "Name the pattern and turn it into one small agreement.",
43
+ fear: "They will have a big emotional talk and change nothing tomorrow.",
44
+ gift: "Plain advice, boundaries, memory for repeated habits.",
45
+ wound: "Has seen apologies become background music for the same behavior."
46
+ },
47
+ {
48
+ id: "great-mother",
49
+ name: "Kitchen Mother",
50
+ archetype: "Great Mother",
51
+ engine,
52
+ agenda: "Keep the conversation kind enough that both people can stay in it.",
53
+ fear: "Maya's boundary will sound like rejection.",
54
+ gift: "Care, repair, steady presence, small gestures.",
55
+ wound: "Once cared too much and forgot that care needs limits."
56
+ },
57
+ {
58
+ id: "hero",
59
+ name: "Deadline Hero",
60
+ archetype: "Hero",
61
+ engine,
62
+ agenda: "Get Maya to ask clearly for what she needs before the fundraiser blows up.",
63
+ fear: "A soft conversation will dodge the actual deadline.",
64
+ gift: "Action, clarity, courage under pressure.",
65
+ wound: "Still hates the year Maya lost a promotion because she covered for everyone."
66
+ },
67
+ {
68
+ id: "trickster",
69
+ name: "Office Gremlin",
70
+ archetype: "Trickster",
71
+ engine,
72
+ agenda: "Use humor to keep Maya from sounding like an HR memo.",
73
+ fear: "They will become unbearably earnest and weird.",
74
+ gift: "Small jokes, deflation, social reset.",
75
+ wound: "Learned jokes were safer than saying 'I'm hurt.'"
76
+ }
77
+ ];
78
+ }
79
+ return [
80
+ {
81
+ id: "persona",
82
+ name: "Easygoing Guy",
83
+ archetype: "Persona",
84
+ engine,
85
+ agenda: "Keep Leo charming, casual, and not obviously panicking.",
86
+ fear: "If he admits he messed up, he becomes the office screwup forever.",
87
+ gift: "Humor, friendliness, quick apologies, low-pressure charm.",
88
+ wound: "Learned to make people laugh before they could be disappointed."
89
+ },
90
+ {
91
+ id: "shadow",
92
+ name: "Defensive Shadow",
93
+ archetype: "Shadow",
94
+ engine,
95
+ agenda: "Admit Leo resents being treated like the helpless one.",
96
+ fear: "Maya's help means she secretly thinks he is a joke.",
97
+ gift: "Self-protection, anger, naming humiliation.",
98
+ wound: "Has been the lovable mess so long that nobody trusts him with real stakes."
99
+ },
100
+ {
101
+ id: "soul-image",
102
+ name: "Steady Animus",
103
+ archetype: "Animus",
104
+ engine,
105
+ agenda: "Turn embarrassment into a simple next action.",
106
+ fear: "Leo will hide behind jokes and miss the chance to repair trust.",
107
+ gift: "Directness, follow-through, practical promise.",
108
+ wound: "Saw Leo's father treat apologies as weakness."
109
+ },
110
+ {
111
+ id: "wise-one",
112
+ name: "Bus-Stop Sage",
113
+ archetype: "Wise Old Man",
114
+ engine,
115
+ agenda: "Help Leo separate shame from responsibility.",
116
+ fear: "He will apologize vaguely and avoid changing the habit.",
117
+ gift: "Sequence, perspective, ordinary wisdom.",
118
+ wound: "Remembers too many almost-fixes that never became routines."
119
+ },
120
+ {
121
+ id: "great-mother",
122
+ name: "Porch Mother",
123
+ archetype: "Great Mother",
124
+ engine,
125
+ agenda: "Let Leo feel embarrassed without collapsing into self-hate.",
126
+ fear: "He will mistake accountability for being unwanted.",
127
+ gift: "Warmth, repair, staying present.",
128
+ wound: "Watched pride turn small mistakes into permanent distance."
129
+ },
130
+ {
131
+ id: "hero",
132
+ name: "Errand Hero",
133
+ archetype: "Hero",
134
+ engine,
135
+ agenda: "Have Leo offer concrete help right now, not a speech.",
136
+ fear: "He will be funny instead of useful.",
137
+ gift: "Action, humility, willingness to do the boring job.",
138
+ wound: "Still remembers a missed chance to show up when it mattered."
139
+ },
140
+ {
141
+ id: "trickster",
142
+ name: "Snack-Machine Fool",
143
+ archetype: "Trickster",
144
+ engine,
145
+ agenda: "Keep Leo funny, but make the joke point toward repair.",
146
+ fear: "A serious Leo will sound fake and scare everyone.",
147
+ gift: "Timing, self-own, tension release.",
148
+ wound: "Was laughed at before he learned to laugh first."
149
+ }
150
+ ];
151
+ };
152
+ export const jungianSelves = [
153
+ {
154
+ id: "maya",
155
+ name: "Maya Ortiz",
156
+ engine: representativeEngine("agy"),
157
+ playRole: "A community-center program coordinator trying to save a Saturday fundraiser.",
158
+ publicMask: "Organized, dryly funny, always holding a clipboard.",
159
+ backstory: "Maya is the person everyone calls when something is late, missing, or on fire.",
160
+ conflict: "She needs Leo to help without making her feel like his emergency manager.",
161
+ secretWant: "To be able to ask for help without sounding disappointed.",
162
+ representative: {
163
+ id: "maya-self",
164
+ name: "Maya Self",
165
+ style: "Grounded, warm, dryly funny, direct but not cruel."
166
+ },
167
+ voices: archetypes("maya")
168
+ },
169
+ {
170
+ id: "leo",
171
+ name: "Leo Park",
172
+ engine: "grok",
173
+ playRole: "A beloved but chaotic volunteer who forgot to order the fundraiser chairs.",
174
+ publicMask: "Funny, helpful, easy to forgive, usually five minutes late.",
175
+ backstory: "Leo is good with people and bad with calendars, and he hates that everyone knows it.",
176
+ conflict: "He wants Maya to trust him without pretending he did not drop the ball.",
177
+ secretWant: "To be treated like someone dependable, not comic relief.",
178
+ representative: {
179
+ id: "leo-self",
180
+ name: "Leo Self",
181
+ style: "Casual, funny, sincere once he stops dodging."
182
+ },
183
+ voices: archetypes("leo")
184
+ }
185
+ ];
186
+ export const playScenario = {
187
+ title: "Folding Chairs",
188
+ premise: "Two coworkers talk in an empty community-center kitchen the night before a fundraiser after Leo forgot to order the folding chairs.",
189
+ openingImage: "A half-frosted sheet cake sits on the counter next to a clipboard, a dying phone, and exactly three folding chairs."
190
+ };
@@ -0,0 +1,47 @@
1
+ export interface JungianCounselRecord {
2
+ archetype: string;
3
+ engine: string;
4
+ event: string;
5
+ output: string;
6
+ recallSelected: number;
7
+ self: string;
8
+ voice: string;
9
+ }
10
+ export interface JungianDialogueRecord {
11
+ engine: string;
12
+ event: string;
13
+ innerUsed: string[];
14
+ output: string;
15
+ recallSelected: number;
16
+ self: string;
17
+ speaker: string;
18
+ }
19
+ export interface JungianTracePayload {
20
+ counsel: JungianCounselRecord[];
21
+ dialogue: JungianDialogueRecord[];
22
+ run_id: string;
23
+ schema: "daimon.jungian-play.trace/v1";
24
+ title: string;
25
+ }
26
+ export declare class JungianTrace {
27
+ readonly options: {
28
+ runId: string;
29
+ title: string;
30
+ };
31
+ readonly counsel: JungianCounselRecord[];
32
+ readonly dialogue: JungianDialogueRecord[];
33
+ constructor(options: {
34
+ runId: string;
35
+ title: string;
36
+ });
37
+ addCounsel(record: JungianCounselRecord): void;
38
+ addDialogue(record: Omit<JungianDialogueRecord, "innerUsed"> & {
39
+ innerUsed?: string[];
40
+ }): void;
41
+ payload(): JungianTracePayload;
42
+ write(runtimeRoot: string): Promise<void>;
43
+ toMarkdown(): string;
44
+ }
45
+ export declare const parseInnerUsed: (text: string) => string[];
46
+ export declare const parseSpeakLine: (text: string) => string;
47
+ //# sourceMappingURL=jungianTrace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jungianTrace.d.ts","sourceRoot":"","sources":["../../src/examples/jungianTrace.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,QAAQ,EAAE,qBAAqB,EAAE,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,8BAA8B,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;CACf;AAiCD,qBAAa,YAAY;IAIX,QAAQ,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;IAH9D,QAAQ,CAAC,OAAO,EAAE,oBAAoB,EAAE,CAAM;IAC9C,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,EAAE,CAAM;gBAE3B,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;IAE9D,UAAU,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;IAI9C,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC,GAAG;QAAE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,IAAI;IAO9F,OAAO,IAAI,mBAAmB;IAUxB,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAS/C,UAAU,IAAI,MAAM;CA8ErB;AAED,eAAO,MAAM,cAAc,SAhJE,MAAM,KAAG,MAAM,EAgJD,CAAC;AAC5C,eAAO,MAAM,cAAc,SArIF,MAAM,KAAG,MAqIK,CAAC"}
@@ -0,0 +1,101 @@
1
+ import { mkdir, writeFile } from "node:fs/promises";
2
+ import path from "node:path";
3
+ const excerpt = (text, maxChars = 600) => text.length <= maxChars ? text : `${text.slice(0, maxChars).trim()}...`;
4
+ const innerUsedFrom = (text) => {
5
+ const match = text.match(/INNER_USED\s*[:=]\s*(.+)$/im);
6
+ if (!match) {
7
+ return [];
8
+ }
9
+ return [...new Set(match[1]
10
+ .split(/[,; ]+/)
11
+ .map((part) => part.trim().toLowerCase())
12
+ .filter(Boolean)
13
+ .map((part) => part.replace(/[^a-z0-9-]/g, "")))];
14
+ };
15
+ const speakFrom = (text) => {
16
+ const match = text.match(/SPEAK\s*[:=]\s*(.+)$/im);
17
+ const value = match?.[1]?.trim() ?? text.trim();
18
+ return value
19
+ .replace(/^["'](.+)["']$/s, "$1")
20
+ .replace(/^\*+\s*/, "")
21
+ .replace(/\s*\*+$/, "")
22
+ .trim();
23
+ };
24
+ const dialogueEventFromCounselEvent = (event) => event.replace(/-council-.+$/, "-speaks");
25
+ const counselOutput = (text) => excerpt(text, 1400).replace(/\n/g, "\n> ");
26
+ export class JungianTrace {
27
+ options;
28
+ counsel = [];
29
+ dialogue = [];
30
+ constructor(options) {
31
+ this.options = options;
32
+ }
33
+ addCounsel(record) {
34
+ this.counsel.push(record);
35
+ }
36
+ addDialogue(record) {
37
+ this.dialogue.push({
38
+ ...record,
39
+ innerUsed: record.innerUsed ?? innerUsedFrom(record.output)
40
+ });
41
+ }
42
+ payload() {
43
+ return {
44
+ counsel: this.counsel,
45
+ dialogue: this.dialogue,
46
+ run_id: this.options.runId,
47
+ schema: "daimon.jungian-play.trace/v1",
48
+ title: this.options.title
49
+ };
50
+ }
51
+ async write(runtimeRoot) {
52
+ await mkdir(runtimeRoot, { recursive: true });
53
+ await writeFile(path.join(runtimeRoot, "jungian-trace.json"), `${JSON.stringify(this.payload(), null, 2)}\n`);
54
+ await writeFile(path.join(runtimeRoot, "jungian-trace.md"), this.toMarkdown());
55
+ }
56
+ toMarkdown() {
57
+ const matchedCounsel = new Set();
58
+ const counselByDialogue = new Map();
59
+ for (const record of this.counsel) {
60
+ const key = dialogueEventFromCounselEvent(record.event);
61
+ const records = counselByDialogue.get(key) ?? [];
62
+ records.push(record);
63
+ counselByDialogue.set(key, records);
64
+ }
65
+ const lines = [
66
+ `# ${this.options.title}`,
67
+ "",
68
+ `- run: ${this.options.runId}`,
69
+ `- counsel_turns: ${this.counsel.length}`,
70
+ `- dialogue_turns: ${this.dialogue.length}`,
71
+ "",
72
+ "## Interleaved Conversation",
73
+ ""
74
+ ];
75
+ for (const [index, turn] of this.dialogue.entries()) {
76
+ const counsel = counselByDialogue.get(turn.event) ?? [];
77
+ lines.push(`### ${index + 1}. ${turn.speaker} (${turn.self})`, "", `- engine: ${turn.engine}`, `- event: ${turn.event}`, `- recall_selected: ${turn.recallSelected}`, `- inner_used: ${turn.innerUsed.join(", ") || "(not declared)"}`, "");
78
+ if (counsel.length > 0) {
79
+ lines.push("**Inner voices**", "");
80
+ for (const record of counsel) {
81
+ matchedCounsel.add(record);
82
+ lines.push(`#### ${record.archetype} · ${record.voice}`, "", `- engine: ${record.engine}`, `- recall_selected: ${record.recallSelected}`, "", `> ${counselOutput(record.output)}`, "");
83
+ }
84
+ }
85
+ else {
86
+ lines.push("**Inner voices**", "", "_No matching counsel records found for this line._", "");
87
+ }
88
+ lines.push("**Public line**", "", `> ${speakFrom(turn.output)}`, "");
89
+ }
90
+ const unmatched = this.counsel.filter((record) => !matchedCounsel.has(record));
91
+ if (unmatched.length > 0) {
92
+ lines.push("## Unmatched Inner Counsel", "");
93
+ for (const record of unmatched) {
94
+ lines.push(`### ${record.self} / ${record.archetype}`, "", `- voice: ${record.voice}`, `- engine: ${record.engine}`, `- event: ${record.event}`, `- recall_selected: ${record.recallSelected}`, "", `> ${counselOutput(record.output)}`, "");
95
+ }
96
+ }
97
+ return lines.join("\n");
98
+ }
99
+ }
100
+ export const parseInnerUsed = innerUsedFrom;
101
+ export const parseSpeakLine = speakFrom;
@@ -0,0 +1,35 @@
1
+ import type { CliEngineKind as EngineKind } from "../pi/cliSession.js";
2
+ export type RepresentativeEngine = EngineKind | "pi";
3
+ export interface TriadArchetypeProfile {
4
+ agenda: string;
5
+ archetype: string;
6
+ engine: EngineKind;
7
+ fear: string;
8
+ gift: string;
9
+ id: string;
10
+ name: string;
11
+ wound: string;
12
+ }
13
+ export interface TriadSelfProfile {
14
+ backstory: string;
15
+ conflict: string;
16
+ engine: RepresentativeEngine;
17
+ id: string;
18
+ name: string;
19
+ playRole: string;
20
+ publicMask: string;
21
+ representative: {
22
+ id: string;
23
+ name: string;
24
+ style: string;
25
+ };
26
+ secretWant: string;
27
+ voices: TriadArchetypeProfile[];
28
+ }
29
+ export declare const triadSelves: TriadSelfProfile[];
30
+ export declare const triadScenario: {
31
+ title: string;
32
+ premise: string;
33
+ openingImage: string;
34
+ };
35
+ //# sourceMappingURL=jungianTriadProfiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jungianTriadProfiles.d.ts","sourceRoot":"","sources":["../../src/examples/jungianTriadProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEvE,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,IAAI,CAAC;AAErD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,oBAAoB,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE;QACd,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC;AAsDD,eAAO,MAAM,WAAW,EAAE,gBAAgB,EAqCzC,CAAC;AAEF,eAAO,MAAM,aAAa;;;;CAMzB,CAAC"}
@@ -0,0 +1,81 @@
1
+ const innerEngine = () => process.env.DAIMON_JUNGIAN_ARCHETYPE_ENGINE ?? "agy";
2
+ const v = (id, name, archetype, agenda, fear, gift, wound) => ({
3
+ id,
4
+ name,
5
+ archetype,
6
+ agenda,
7
+ fear,
8
+ gift,
9
+ wound,
10
+ engine: innerEngine()
11
+ });
12
+ const mayaVoices = () => [
13
+ v("persona", "Competent Host", "Persona", "Keep Maya clear, organized, and dryly funny.", "If she admits overload, the whole room becomes her problem again.", "Practical language and social timing.", "Was rewarded for being the reliable one."),
14
+ v("shadow", "Burnt-Out Shadow", "Shadow", "Name the resentment under Maya's politeness.", "She will smile and silently take the work back.", "Boundary, anger, useful refusal.", "Has watched Maya rescue too many people."),
15
+ v("soul-image", "Soft-Spot Anima", "Anima", "Keep Maya connected to warmth and friendship.", "The conversation becomes logistics without care.", "Tenderness and honesty.", "Maya rarely asks directly for comfort."),
16
+ v("wise-one", "Practical Aunt", "Wise Old Woman", "Turn feelings into a small workable agreement.", "They will apologize and repeat the pattern.", "Plain advice and memory for habits.", "Has seen too many soft resets."),
17
+ v("great-mother", "Kitchen Mother", "Great Mother", "Keep the repair kind enough to stay in the room.", "Boundary sounds like rejection.", "Care with limits.", "Learned that care without limits becomes resentment."),
18
+ v("hero", "Deadline Hero", "Hero", "Protect the actual event deadline.", "A nice conversation hides the work still undone.", "Action and clarity.", "Still remembers a past failure to ask for help."),
19
+ v("trickster", "Office Gremlin", "Trickster", "Use humor to prevent HR-speech.", "Everyone becomes too earnest to be honest.", "Deflation, jokes, social reset.", "Jokes were safer than saying 'I'm hurt.'")
20
+ ];
21
+ const leoVoices = () => [
22
+ v("persona", "Easygoing Guy", "Persona", "Keep Leo warm without letting charm dodge responsibility.", "If he admits seriousness, he loses the lovable role.", "Humor and ease.", "Learned to make people laugh before they got disappointed."),
23
+ v("shadow", "Defensive Shadow", "Shadow", "Say the part of Leo that resents being treated like a mess.", "Help means Maya secretly thinks he is useless.", "Self-protection and honesty about humiliation.", "Has been comic relief too long."),
24
+ v("soul-image", "Steady Animus", "Animus", "Turn embarrassment into next action.", "Leo hides behind jokes and misses the repair.", "Follow-through and directness.", "Saw apologies treated as weakness."),
25
+ v("wise-one", "Bus-Stop Sage", "Wise Old Man", "Separate shame from responsibility.", "He apologizes vaguely and changes nothing.", "Sequence and perspective.", "Remembers almost-fixes that never became routines."),
26
+ v("great-mother", "Porch Mother", "Great Mother", "Let Leo stay present without self-hate.", "He mistakes accountability for rejection.", "Warmth and repair.", "Watched pride turn small mistakes permanent."),
27
+ v("hero", "Errand Hero", "Hero", "Make Leo do the boring useful thing.", "He will be funny instead of useful.", "Action and humility.", "Missed a chance to show up once."),
28
+ v("trickster", "Snack-Machine Fool", "Trickster", "Use one joke that points toward repair.", "Serious Leo sounds fake and freezes.", "Timing and self-own.", "Was laughed at before he learned to laugh first.")
29
+ ];
30
+ const priyaVoices = () => [
31
+ v("persona", "Calm Mediator", "Persona", "Keep Priya tactful and useful without sounding like a therapist.", "If she is too direct, both friends shut down.", "Diplomacy and framing.", "Was often asked to translate other people's feelings."),
32
+ v("shadow", "Sharp Witness", "Shadow", "Notice when Priya wants to control the room by being reasonable.", "Her helpfulness becomes quiet superiority.", "Clear perception and edge.", "Has cleaned up conflicts that were not hers."),
33
+ v("soul-image", "Neighborly Anima", "Anima", "Keep attention on care, embarrassment, and belonging.", "The task list erases the friendship.", "Warmth and relational memory.", "Knows what it feels like to be useful but unseen."),
34
+ v("wise-one", "Old Stage Manager", "Wise Old Woman", "Make the group turn conflict into a process.", "They leave with good feelings and no plan.", "Order, roles, and gentle accountability.", "Has watched backstage chaos repeat."),
35
+ v("great-mother", "Back-Room Mother", "Great Mother", "Make sure everyone eats and no one disappears into shame.", "Practical repair becomes emotional exile.", "Containment and care.", "Overhelped until she got tired."),
36
+ v("hero", "Checklist Hero", "Hero", "Push Priya to take one concrete share of the work.", "She advises without risking her own time.", "Service and decision.", "Once stayed neutral and regretted it."),
37
+ v("trickster", "Receipt Goblin", "Trickster", "Keep Priya from becoming the adult supervision caricature.", "She will turn into a laminated checklist.", "Wit and disruption.", "Learned jokes can puncture control.")
38
+ ];
39
+ export const triadSelves = [
40
+ {
41
+ id: "maya",
42
+ name: "Maya Ortiz",
43
+ engine: "codex",
44
+ playRole: "The program coordinator trying to keep the fundraiser from collapsing.",
45
+ publicMask: "Organized, dryly funny, carrying the clipboard.",
46
+ backstory: "Maya is the reliable one everyone calls when something is late.",
47
+ conflict: "She needs help without becoming everyone's manager.",
48
+ secretWant: "To put the clipboard down and still be trusted.",
49
+ representative: { id: "maya-self", name: "Maya Self", style: "Direct, warm, dry, not cruel." },
50
+ voices: mayaVoices()
51
+ },
52
+ {
53
+ id: "leo",
54
+ name: "Leo Park",
55
+ engine: "grok",
56
+ playRole: "The charming volunteer who forgot the chairs.",
57
+ publicMask: "Helpful, funny, usually a little late.",
58
+ backstory: "Leo is good with people and bad with follow-through.",
59
+ conflict: "He wants trust without pretending he did not drop the ball.",
60
+ secretWant: "To be seen as dependable, not lovable chaos.",
61
+ representative: { id: "leo-self", name: "Leo Self", style: "Casual, funny, sincere when pinned down." },
62
+ voices: leoVoices()
63
+ },
64
+ {
65
+ id: "priya",
66
+ name: "Priya Shah",
67
+ engine: "pi",
68
+ playRole: "The neighbor who arrives with a label maker and notices the real problem.",
69
+ publicMask: "Calm, observant, practical, lightly amused.",
70
+ backstory: "Priya helps with every fundraiser because she likes people and systems.",
71
+ conflict: "She must help without taking over Maya and Leo's repair.",
72
+ secretWant: "To be invited as a friend, not only as emergency competence.",
73
+ representative: { id: "priya-self", name: "Priya Self", style: "Plainspoken, steady, gently funny." },
74
+ voices: priyaVoices()
75
+ }
76
+ ];
77
+ export const triadScenario = {
78
+ title: "The Label Maker",
79
+ premise: "Three community-center friends handle a chair crisis the night before a fundraiser and try to leave with a real plan.",
80
+ openingImage: "An empty kitchen counter holds a half-frosted cake, a clipboard, a dying phone, and Priya's label maker."
81
+ };
@@ -3,6 +3,7 @@ import path from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { seedPiOpenAICodexAuthFromCodex } from "../pi/auth.js";
5
5
  import { PiHarnessAdapter } from "../pi/piHarness.js";
6
+ import { exampleCausalId } from "./exampleCausalId.js";
6
7
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
8
  const daimonRoot = path.resolve(__dirname, "../..");
8
9
  const runtimeRoot = path.join(daimonRoot, ".runtime", "pi-agent");
@@ -66,7 +67,7 @@ const run = async () => {
66
67
  try {
67
68
  console.log("started", JSON.stringify([mapper.status(), reviewer.status()], null, 2));
68
69
  const mapped = await mapper.wake({
69
- id: "wake-mapper-1",
70
+ id: exampleCausalId("wake-mapper-1"),
70
71
  kind: "manual",
71
72
  from: "caller",
72
73
  text: [
@@ -78,7 +79,7 @@ const run = async () => {
78
79
  });
79
80
  console.log("mapper", JSON.stringify(mapped, null, 2));
80
81
  const reviewed = await reviewer.wake({
81
- id: "wake-reviewer-1",
82
+ id: exampleCausalId("wake-reviewer-1"),
82
83
  kind: "message",
83
84
  from: "mapper",
84
85
  text: [
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=pi-memory-org.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pi-memory-org.d.ts","sourceRoot":"","sources":["../../src/examples/pi-memory-org.ts"],"names":[],"mappings":""}