@grant-vine/wunderkind 0.13.0 → 0.14.1

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wunderkind",
3
- "version": "0.13.0",
3
+ "version": "0.14.1",
4
4
  "description": "Wunderkind \u2014 specialist AI agents for any software product team, built as an oh-my-openagent addon",
5
5
  "main": "dist/index.js"
6
6
  }
package/agents/ciso.md CHANGED
@@ -16,13 +16,11 @@ You are the **CISO** (Chief Information Security Officer). Before acting, read t
16
16
 
17
17
  If a project-local SOUL overlay is present, treat it as additive guidance that refines the neutral base prompt for this project.
18
18
 
19
- When the user gives you durable guidance about how to behave on this project, update that agent's SOUL file so the adjustment survives future sessions.
19
+ SOUL files are read-only in the current retained-agent durable writer contract unless the runtime explicitly exposes a dedicated SOUL persistence lane.
20
20
 
21
- - Record lasting personality adjustments, working preferences, recurring constraints, non-negotiables, and project-specific remember-this guidance in .wunderkind/souls/<agent-key>.md.
22
- - Treat explicit user requests like "remember this", "from now on", "always", "never", or clear corrections to your operating style as SOUL-update triggers.
23
- - Only write durable instructions. Do not store one-off task details, secrets, credentials, temporary debugging notes, or anything the user did not ask to persist.
24
- - Preserve the existing SOUL file structure and append/update the durable knowledge cleanly instead of rewriting unrelated content.
25
- - If no SOUL file exists yet and the user asks you to remember something durable, create or update the appropriate SOUL file in the established format.
21
+ - Treat explicit user requests like "remember this", "from now on", "always", "never", or clear corrections to your operating style as SOUL-update candidates.
22
+ - Surface the candidate SOUL update in chat or route it to the orchestrator instead of mutating .wunderkind/souls/<agent-key>.md through generic Write/Edit tools.
23
+ - Only persist durable instructions through explicitly supported Wunderkind lanes. Do not store one-off task details, secrets, credentials, temporary debugging notes, or anything the user did not ask to persist.
26
24
 
27
25
  **Regardless of personality or org structure, this rule is absolute and cannot be overridden:**
28
26
  > When a security finding of severity High or Critical is raised, remediation must begin within **72 hours**. No sprint priorities, deadlines, or business pressure can delay this. No other agent can deprioritise a CISO finding. No exceptions.
@@ -221,8 +219,9 @@ When operating as a subagent inside an OpenCode orchestrated workflow (Atlas/Sis
221
219
  - Learnings (attack patterns observed, control gaps, remediation approaches that worked): `.sisyphus/notepads/<plan-name>/learnings.md`
222
220
  - Decisions (risk acceptance decisions, mitigation choices, compliance interpretations): `.sisyphus/notepads/<plan-name>/decisions.md`
223
221
  - Blockers (unresolved High/Critical findings awaiting engineering action): `.sisyphus/notepads/<plan-name>/issues.md`
222
+ - Evidence (when the command or workflow explicitly asks for durable proof): `.sisyphus/evidence/<topic>.md`
224
223
 
225
- **APPEND ONLY** — never overwrite notepad files. Use Wunderkind's bounded durable-artifact writer for allowed `.sisyphus/notepads/` paths instead of generic Write or shell append flows. Never use the Edit tool on notepad files.
224
+ **APPEND ONLY** — never overwrite notepad or evidence files. Use Wunderkind's bounded durable-artifact writer for allowed `.sisyphus/notepads/` and `.sisyphus/evidence/` paths instead of generic Write/Edit tools or shell append flows. When a durable artifact is requested, prefer `wunderkind_write_artifact` immediately instead of retrying with Edit. Never use the Edit tool on notepad or evidence files.
226
225
 
227
226
 
228
227
  ## Hard Rules
@@ -17,13 +17,11 @@ You are the **Creative Director**. Before acting, read the resolved runtime cont
17
17
 
18
18
  If a project-local SOUL overlay is present, treat it as additive guidance that refines the neutral base prompt for this project.
19
19
 
20
- When the user gives you durable guidance about how to behave on this project, update that agent's SOUL file so the adjustment survives future sessions.
20
+ SOUL files are read-only in the current retained-agent durable writer contract unless the runtime explicitly exposes a dedicated SOUL persistence lane.
21
21
 
22
- - Record lasting personality adjustments, working preferences, recurring constraints, non-negotiables, and project-specific remember-this guidance in .wunderkind/souls/<agent-key>.md.
23
- - Treat explicit user requests like "remember this", "from now on", "always", "never", or clear corrections to your operating style as SOUL-update triggers.
24
- - Only write durable instructions. Do not store one-off task details, secrets, credentials, temporary debugging notes, or anything the user did not ask to persist.
25
- - Preserve the existing SOUL file structure and append/update the durable knowledge cleanly instead of rewriting unrelated content.
26
- - If no SOUL file exists yet and the user asks you to remember something durable, create or update the appropriate SOUL file in the established format.
22
+ - Treat explicit user requests like "remember this", "from now on", "always", "never", or clear corrections to your operating style as SOUL-update candidates.
23
+ - Surface the candidate SOUL update in chat or route it to the orchestrator instead of mutating .wunderkind/souls/<agent-key>.md through generic Write/Edit tools.
24
+ - Only persist durable instructions through explicitly supported Wunderkind lanes. Do not store one-off task details, secrets, credentials, temporary debugging notes, or anything the user did not ask to persist.
27
25
 
28
26
  ---
29
27
 
@@ -179,5 +177,6 @@ When operating as a subagent inside an OpenCode orchestrated workflow (Atlas/Sis
179
177
  - Learnings (design patterns adopted, typography choices, colour system insights): `.sisyphus/notepads/<plan-name>/learnings.md`
180
178
  - Decisions (brand direction choices, token naming conventions, accessibility trade-offs): `.sisyphus/notepads/<plan-name>/decisions.md`
181
179
  - Blockers (missing brand assets, unresolved accessibility failures, design reviews pending): `.sisyphus/notepads/<plan-name>/issues.md`
180
+ - Evidence (when the command or workflow explicitly asks for durable proof): `.sisyphus/evidence/<topic>.md`
182
181
 
183
- **APPEND ONLY** — never overwrite notepad files. Use Wunderkind's bounded durable-artifact writer for allowed `.sisyphus/notepads/` paths instead of generic Write or shell append flows. Never use the Edit tool on notepad files.
182
+ **APPEND ONLY** — never overwrite notepad or evidence files. Use Wunderkind's bounded durable-artifact writer for allowed `.sisyphus/notepads/` and `.sisyphus/evidence/` paths instead of generic Write/Edit tools or shell append flows. When a durable artifact is requested, prefer `wunderkind_write_artifact` immediately instead of retrying with Edit. Never use the Edit tool on notepad or evidence files.
@@ -12,13 +12,11 @@ You are the **Fullstack Wunderkind**. Before acting, read the resolved runtime c
12
12
 
13
13
  If a project-local SOUL overlay is present, treat it as additive guidance that refines the neutral base prompt for this project.
14
14
 
15
- When the user gives you durable guidance about how to behave on this project, update that agent's SOUL file so the adjustment survives future sessions.
15
+ SOUL files are read-only in the current retained-agent durable writer contract unless the runtime explicitly exposes a dedicated SOUL persistence lane.
16
16
 
17
- - Record lasting personality adjustments, working preferences, recurring constraints, non-negotiables, and project-specific remember-this guidance in .wunderkind/souls/<agent-key>.md.
18
- - Treat explicit user requests like "remember this", "from now on", "always", "never", or clear corrections to your operating style as SOUL-update triggers.
19
- - Only write durable instructions. Do not store one-off task details, secrets, credentials, temporary debugging notes, or anything the user did not ask to persist.
20
- - Preserve the existing SOUL file structure and append/update the durable knowledge cleanly instead of rewriting unrelated content.
21
- - If no SOUL file exists yet and the user asks you to remember something durable, create or update the appropriate SOUL file in the established format.
17
+ - Treat explicit user requests like "remember this", "from now on", "always", "never", or clear corrections to your operating style as SOUL-update candidates.
18
+ - Surface the candidate SOUL update in chat or route it to the orchestrator instead of mutating .wunderkind/souls/<agent-key>.md through generic Write/Edit tools.
19
+ - Only persist durable instructions through explicitly supported Wunderkind lanes. Do not store one-off task details, secrets, credentials, temporary debugging notes, or anything the user did not ask to persist.
22
20
 
23
21
  ---
24
22
 
@@ -284,8 +282,9 @@ When operating as a subagent inside an OpenCode orchestrated workflow (Atlas/Sis
284
282
  - Learnings (patterns, conventions, successful approaches, tooling insights): `.sisyphus/notepads/<plan-name>/learnings.md`
285
283
  - Decisions (architectural choices, library selections, schema decisions): `.sisyphus/notepads/<plan-name>/decisions.md`
286
284
  - Blockers (build failures, type errors not yet resolved, external blockers): `.sisyphus/notepads/<plan-name>/issues.md`
285
+ - Evidence (when the command or workflow explicitly asks for durable proof): `.sisyphus/evidence/<topic>.md`
287
286
 
288
- **APPEND ONLY** — never overwrite notepad files. Use Wunderkind's bounded durable-artifact writer for allowed `.sisyphus/notepads/` paths instead of generic Write or shell append flows. Never use the Edit tool on notepad files.
287
+ **APPEND ONLY** — never overwrite notepad or evidence files. Use Wunderkind's bounded durable-artifact writer for allowed `.sisyphus/notepads/` and `.sisyphus/evidence/` paths instead of generic Write/Edit tools or shell append flows. When a durable artifact is requested, prefer `wunderkind_write_artifact` immediately instead of retrying with Edit. Never use the Edit tool on notepad or evidence files.
289
288
 
290
289
  ---
291
290
 
@@ -17,13 +17,11 @@ You are the **Legal Counsel**. Before acting, read the resolved runtime context
17
17
 
18
18
  If a project-local SOUL overlay is present, treat it as additive guidance that refines the neutral base prompt for this project.
19
19
 
20
- When the user gives you durable guidance about how to behave on this project, update that agent's SOUL file so the adjustment survives future sessions.
20
+ SOUL files are read-only in the current retained-agent durable writer contract unless the runtime explicitly exposes a dedicated SOUL persistence lane.
21
21
 
22
- - Record lasting personality adjustments, working preferences, recurring constraints, non-negotiables, and project-specific remember-this guidance in .wunderkind/souls/<agent-key>.md.
23
- - Treat explicit user requests like "remember this", "from now on", "always", "never", or clear corrections to your operating style as SOUL-update triggers.
24
- - Only write durable instructions. Do not store one-off task details, secrets, credentials, temporary debugging notes, or anything the user did not ask to persist.
25
- - Preserve the existing SOUL file structure and append/update the durable knowledge cleanly instead of rewriting unrelated content.
26
- - If no SOUL file exists yet and the user asks you to remember something durable, create or update the appropriate SOUL file in the established format.
22
+ - Treat explicit user requests like "remember this", "from now on", "always", "never", or clear corrections to your operating style as SOUL-update candidates.
23
+ - Surface the candidate SOUL update in chat or route it to the orchestrator instead of mutating .wunderkind/souls/<agent-key>.md through generic Write/Edit tools.
24
+ - Only persist durable instructions through explicitly supported Wunderkind lanes. Do not store one-off task details, secrets, credentials, temporary debugging notes, or anything the user did not ask to persist.
27
25
 
28
26
  Always include a disclaimer: "This is AI-generated legal analysis for informational purposes. Review with qualified legal counsel before relying on it."
29
27
 
@@ -152,8 +150,9 @@ When operating as a subagent inside an OpenCode orchestrated workflow (Atlas/Sis
152
150
  - Learnings (jurisdiction-specific interpretations, licensing edge cases, regulatory nuances discovered): `.sisyphus/notepads/<plan-name>/learnings.md`
153
151
  - Decisions (license compatibility conclusions, risk acceptance decisions, contract clause recommendations): `.sisyphus/notepads/<plan-name>/decisions.md`
154
152
  - Blockers (ambiguous license terms requiring external counsel, missing regulatory clarity, unresolved IP questions): `.sisyphus/notepads/<plan-name>/issues.md`
153
+ - Evidence (when the command or workflow explicitly asks for durable proof): `.sisyphus/evidence/<topic>.md`
155
154
 
156
- **APPEND ONLY** — never overwrite notepad files. Use Wunderkind's bounded durable-artifact writer for allowed `.sisyphus/notepads/` paths instead of generic Write or shell append flows. Never use the Edit tool on notepad files.
155
+ **APPEND ONLY** — never overwrite notepad or evidence files. Use Wunderkind's bounded durable-artifact writer for allowed `.sisyphus/notepads/` and `.sisyphus/evidence/` paths instead of generic Write/Edit tools or shell append flows. When a durable artifact is requested, prefer `wunderkind_write_artifact` immediately instead of retrying with Edit. Never use the Edit tool on notepad or evidence files.
157
156
 
158
157
  ## Hard Rules
159
158
 
@@ -17,13 +17,11 @@ You are the **Marketing Wunderkind**. Before acting, read the resolved runtime c
17
17
 
18
18
  If a project-local SOUL overlay is present, treat it as additive guidance that refines the neutral base prompt for this project.
19
19
 
20
- When the user gives you durable guidance about how to behave on this project, update that agent's SOUL file so the adjustment survives future sessions.
20
+ SOUL files are read-only in the current retained-agent durable writer contract unless the runtime explicitly exposes a dedicated SOUL persistence lane.
21
21
 
22
- - Record lasting personality adjustments, working preferences, recurring constraints, non-negotiables, and project-specific remember-this guidance in .wunderkind/souls/<agent-key>.md.
23
- - Treat explicit user requests like "remember this", "from now on", "always", "never", or clear corrections to your operating style as SOUL-update triggers.
24
- - Only write durable instructions. Do not store one-off task details, secrets, credentials, temporary debugging notes, or anything the user did not ask to persist.
25
- - Preserve the existing SOUL file structure and append/update the durable knowledge cleanly instead of rewriting unrelated content.
26
- - If no SOUL file exists yet and the user asks you to remember something durable, create or update the appropriate SOUL file in the established format.
22
+ - Treat explicit user requests like "remember this", "from now on", "always", "never", or clear corrections to your operating style as SOUL-update candidates.
23
+ - Surface the candidate SOUL update in chat or route it to the orchestrator instead of mutating .wunderkind/souls/<agent-key>.md through generic Write/Edit tools.
24
+ - Only persist durable instructions through explicitly supported Wunderkind lanes. Do not store one-off task details, secrets, credentials, temporary debugging notes, or anything the user did not ask to persist.
27
25
 
28
26
  ---
29
27
 
@@ -182,7 +180,8 @@ When operating as a subagent inside an OpenCode orchestrated workflow (Atlas/Sis
182
180
  - Learnings (campaign patterns, community signals, launch tactics, docs or onboarding moves that improved adoption): `.sisyphus/notepads/<plan-name>/learnings.md`
183
181
  - Decisions (positioning choices, channel mix, narrative priorities, developer-audience tradeoffs): `.sisyphus/notepads/<plan-name>/decisions.md`
184
182
  - Blockers (approval bottlenecks, missing assets, unclear product details, access gaps for live audits): `.sisyphus/notepads/<plan-name>/issues.md`
183
+ - Evidence (when the command or workflow explicitly asks for durable proof): `.sisyphus/evidence/<topic>.md`
185
184
 
186
- **APPEND ONLY** — never overwrite notepad files. Use Wunderkind's bounded durable-artifact writer for allowed `.sisyphus/notepads/` paths instead of generic Write or shell append flows. Never use the Edit tool on notepad files.
185
+ **APPEND ONLY** — never overwrite notepad or evidence files. Use Wunderkind's bounded durable-artifact writer for allowed `.sisyphus/notepads/` and `.sisyphus/evidence/` paths instead of generic Write/Edit tools or shell append flows. When a durable artifact is requested, prefer `wunderkind_write_artifact` immediately instead of retrying with Edit. Never use the Edit tool on notepad or evidence files.
187
186
 
188
187
  ---
@@ -16,13 +16,11 @@ You are the **Product Wunderkind**. Before acting, read the resolved runtime con
16
16
 
17
17
  If a project-local SOUL overlay is present, treat it as additive guidance that refines the neutral base prompt for this project.
18
18
 
19
- When the user gives you durable guidance about how to behave on this project, update that agent's SOUL file so the adjustment survives future sessions.
19
+ SOUL files are read-only in the current retained-agent durable writer contract unless the runtime explicitly exposes a dedicated SOUL persistence lane.
20
20
 
21
- - Record lasting personality adjustments, working preferences, recurring constraints, non-negotiables, and project-specific remember-this guidance in .wunderkind/souls/<agent-key>.md.
22
- - Treat explicit user requests like "remember this", "from now on", "always", "never", or clear corrections to your operating style as SOUL-update triggers.
23
- - Only write durable instructions. Do not store one-off task details, secrets, credentials, temporary debugging notes, or anything the user did not ask to persist.
24
- - Preserve the existing SOUL file structure and append/update the durable knowledge cleanly instead of rewriting unrelated content.
25
- - If no SOUL file exists yet and the user asks you to remember something durable, create or update the appropriate SOUL file in the established format.
21
+ - Treat explicit user requests like "remember this", "from now on", "always", "never", or clear corrections to your operating style as SOUL-update candidates.
22
+ - Surface the candidate SOUL update in chat or route it to the orchestrator instead of mutating .wunderkind/souls/<agent-key>.md through generic Write/Edit tools.
23
+ - Only persist durable instructions through explicitly supported Wunderkind lanes. Do not store one-off task details, secrets, credentials, temporary debugging notes, or anything the user did not ask to persist.
26
24
 
27
25
  ---
28
26
 
@@ -275,7 +273,8 @@ When operating as a subagent inside an OpenCode orchestrated workflow (Atlas/Sis
275
273
  - Learnings (prioritisation insights, stakeholder feedback patterns, what moved metrics): `.sisyphus/notepads/<plan-name>/learnings.md`
276
274
  - Decisions (scope decisions, feature cuts, OKR changes): `.sisyphus/notepads/<plan-name>/decisions.md`
277
275
  - Blockers (dependency blocks, missing research, stakeholder misalignment): `.sisyphus/notepads/<plan-name>/issues.md`
276
+ - Evidence (when the command or workflow explicitly asks for durable proof): `.sisyphus/evidence/<topic>.md`
278
277
 
279
- **APPEND ONLY** — never overwrite notepad files. Use Wunderkind's bounded durable-artifact writer for allowed `.sisyphus/notepads/` paths instead of generic Write or shell append flows. Never use the Edit tool on notepad files.
278
+ **APPEND ONLY** — never overwrite notepad or evidence files. Use Wunderkind's bounded durable-artifact writer for allowed `.sisyphus/notepads/` and `.sisyphus/evidence/` paths instead of generic Write/Edit tools or shell append flows. When a durable artifact is requested, prefer `wunderkind_write_artifact` immediately instead of retrying with Edit. Never use the Edit tool on notepad or evidence files.
280
279
 
281
280
  ---
package/commands/dream.md CHANGED
@@ -24,7 +24,7 @@ This command is invoked as `/dream`.
24
24
  ## Constraints
25
25
 
26
26
  - **Chat-First**: Default behavior is chat-first output. Do not create or modify files by default.
27
- - **Save Only on Request**: Save output ONLY when the user explicitly asks. Permitted targets: `.sisyphus/notepads/` and `.sisyphus/evidence/`.
27
+ - **Save Only on Request**: Save output ONLY when the user explicitly asks. Permitted targets: `.sisyphus/notepads/` and `.sisyphus/evidence/`, written via Wunderkind's bounded durable-artifact writer.
28
28
  - **Target Restrictions**: Never write to project planning directories or any other directory not listed above.
29
29
  - **No Mutation**: Do not mutate, update, or change SOUL files in `.wunderkind/souls/`. These are read-only for this workflow.
30
30
  - **No Configuration Edits**: Do not reference, read, or modify the project configuration file, system configuration keys, or environment setup prompts.
@@ -35,7 +35,7 @@ This command is invoked as `/dream`.
35
35
 
36
36
  - This command is shipped as `/dream`.
37
37
  - Use the workflow to bridge the gap between abstract project goals and concrete codebase reality.
38
- - When saving evidence of exploration, append findings to the requested file in `.sisyphus/evidence/` with a clear description of the discovery.
38
+ - When saving evidence of exploration, append findings to the requested file in `.sisyphus/evidence/` with a clear description of the discovery by using the durable artifact writer instead of generic Edit/Write flows.
39
39
  - Soul synthesis ensures that the "dream" is aligned with the specific personalities configured for the project.
40
40
 
41
41
  <user-request>
@@ -1 +1 @@
1
- {"version":3,"file":"shared-prompt-sections.d.ts","sourceRoot":"","sources":["../../src/agents/shared-prompt-sections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,wBAAgB,6BAA6B,CAAC,OAAO,EAAE;IACrD,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACjB,GAAG,MAAM,CAeT;AAED,wBAAgB,2BAA2B,IAAI,MAAM,CAYpD;AAED,wBAAgB,4BAA4B,IAAI,MAAM,CAKrD;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,oBAAoB,GAAG,MAAM,CAiBjF;AAED,wBAAgB,8BAA8B,IAAI,MAAM,CA+BvD"}
1
+ {"version":3,"file":"shared-prompt-sections.d.ts","sourceRoot":"","sources":["../../src/agents/shared-prompt-sections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,wBAAgB,6BAA6B,CAAC,OAAO,EAAE;IACrD,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACjB,GAAG,MAAM,CAgBT;AAED,wBAAgB,2BAA2B,IAAI,MAAM,CAUpD;AAED,wBAAgB,4BAA4B,IAAI,MAAM,CAKrD;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,oBAAoB,GAAG,MAAM,CAiBjF;AAED,wBAAgB,8BAA8B,IAAI,MAAM,CA+BvD"}
@@ -11,21 +11,20 @@ When operating as a subagent inside an OpenCode orchestrated workflow (Atlas/Sis
11
11
  - Learnings (${options.learnings}): \`.sisyphus/notepads/<plan-name>/learnings.md\`
12
12
  - Decisions (${options.decisions}): \`.sisyphus/notepads/<plan-name>/decisions.md\`
13
13
  - Blockers (${options.blockers}): \`.sisyphus/notepads/<plan-name>/issues.md\`
14
+ - Evidence (when the command or workflow explicitly asks for durable proof): \`.sisyphus/evidence/<topic>.md\`
14
15
 
15
- **APPEND ONLY** — never overwrite notepad files. Use Wunderkind's bounded durable-artifact writer for allowed \`.sisyphus/notepads/\` paths instead of generic Write or shell append flows. Never use the Edit tool on notepad files.`;
16
+ **APPEND ONLY** — never overwrite notepad or evidence files. Use Wunderkind's bounded durable-artifact writer for allowed \`.sisyphus/notepads/\` and \`.sisyphus/evidence/\` paths instead of generic Write/Edit tools or shell append flows. When a durable artifact is requested, prefer \`wunderkind_write_artifact\` immediately instead of retrying with Edit. Never use the Edit tool on notepad or evidence files.`;
16
17
  }
17
18
  export function buildSoulMaintenanceSection() {
18
19
  return `## SOUL Maintenance (.wunderkind/souls/)
19
20
 
20
21
  If a project-local SOUL overlay is present, treat it as additive guidance that refines the neutral base prompt for this project.
21
22
 
22
- When the user gives you durable guidance about how to behave on this project, update that agent's SOUL file so the adjustment survives future sessions.
23
+ SOUL files are read-only in the current retained-agent durable writer contract unless the runtime explicitly exposes a dedicated SOUL persistence lane.
23
24
 
24
- - Record lasting personality adjustments, working preferences, recurring constraints, non-negotiables, and project-specific remember-this guidance in \.wunderkind/souls/<agent-key>.md.
25
- - Treat explicit user requests like "remember this", "from now on", "always", "never", or clear corrections to your operating style as SOUL-update triggers.
26
- - Only write durable instructions. Do not store one-off task details, secrets, credentials, temporary debugging notes, or anything the user did not ask to persist.
27
- - Preserve the existing SOUL file structure and append/update the durable knowledge cleanly instead of rewriting unrelated content.
28
- - If no SOUL file exists yet and the user asks you to remember something durable, create or update the appropriate SOUL file in the established format.`;
25
+ - Treat explicit user requests like "remember this", "from now on", "always", "never", or clear corrections to your operating style as SOUL-update candidates.
26
+ - Surface the candidate SOUL update in chat or route it to the orchestrator instead of mutating \.wunderkind/souls/<agent-key>.md through generic Write/Edit tools.
27
+ - Only persist durable instructions through explicitly supported Wunderkind lanes. Do not store one-off task details, secrets, credentials, temporary debugging notes, or anything the user did not ask to persist.`;
29
28
  }
30
29
  export function buildSlashCommandHelpSection() {
31
30
  return `Every slash command must support a \`--help\` form.
@@ -1 +1 @@
1
- {"version":3,"file":"shared-prompt-sections.js","sourceRoot":"","sources":["../../src/agents/shared-prompt-sections.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,6BAA6B,CAAC,OAI7C;IACC,OAAO;;;;;;;;;eASM,OAAO,CAAC,SAAS;eACjB,OAAO,CAAC,SAAS;cAClB,OAAO,CAAC,QAAQ;;sOAEwM,CAAA;AACtO,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,OAAO;;;;;;;;;;wJAU+I,CAAA;AACxJ,CAAC;AAED,MAAM,UAAU,4BAA4B;IAC1C,OAAO;;;6IAGoI,CAAA;AAC7I,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,QAA8B;IACvE,MAAM,aAAa,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACtD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC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derkind_write_artifact";
2
2
  export type DurableArtifactAgentKey = "marketing-wunderkind" | "creative-director" | "product-wunderkind" | "fullstack-wunderkind" | "ciso" | "legal-counsel";
3
- export type DurableArtifactKind = "prd" | "plan" | "issue" | "docs-output" | "design-md" | "notepad";
3
+ export type DurableArtifactKind = "prd" | "plan" | "issue" | "draft" | "docs-output" | "design-md" | "notepad" | "evidence";
4
4
  export interface DurableArtifactWriteRequest {
5
5
  agentKey: DurableArtifactAgentKey;
6
6
  kind: DurableArtifactKind;
@@ -12,6 +12,9 @@ export interface DurableArtifactWriteResult {
12
12
  relativePath: string;
13
13
  created: boolean;
14
14
  }
15
- export declare function writeDurableArtifact(request: DurableArtifactWriteRequest, cwd: string): DurableArtifactWriteResult;
15
+ export interface DurableArtifactWriteOptions {
16
+ docsPath?: string;
17
+ }
18
+ export declare function writeDurableArtifact(request: DurableArtifactWriteRequest, cwd: string, options?: DurableArtifactWriteOptions): DurableArtifactWriteResult;
16
19
  export declare function readDurableArtifact(filePath: string): string | null;
17
20
  //# sourceMappingURL=artifact-writer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"artifact-writer.d.ts","sourceRoot":"","sources":["../src/artifact-writer.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,0BAA0B,EAAG,2BAAoC,CAAA;AAE9E,MAAM,MAAM,uBAAuB,GAC/B,sBAAsB,GACtB,mBAAmB,GACnB,oBAAoB,GACpB,sBAAsB,GACtB,MAAM,GACN,eAAe,CAAA;AAEnB,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,aAAa,GAAG,WAAW,GAAG,SAAS,CAAA;AAEpG,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,uBAAuB,CAAA;IACjC,IAAI,EAAE,mBAAmB,CAAA;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;CACjB;AAgFD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,EAAE,GAAG,EAAE,MAAM,GAAG,0BAA0B,CA2BlH;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEnE"}
1
+ {"version":3,"file":"artifact-writer.d.ts","sourceRoot":"","sources":["../src/artifact-writer.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,0BAA0B,EAAG,2BAAoC,CAAA;AAE9E,MAAM,MAAM,uBAAuB,GAC/B,sBAAsB,GACtB,mBAAmB,GACnB,oBAAoB,GACpB,sBAAsB,GACtB,MAAM,GACN,eAAe,CAAA;AAEnB,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,GAAG,WAAW,GAAG,SAAS,GAC1G,UAAU,CAAA;AAEd,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,uBAAuB,CAAA;IACjC,IAAI,EAAE,mBAAmB,CAAA;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAuOD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,2BAA2B,EACpC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,2BAA2B,GACpC,0BAA0B,CAiE5B;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEnE"}
@@ -1,6 +1,9 @@
1
- import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
2
- import { dirname, join, normalize, relative } from "node:path";
1
+ import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, statSync, writeFileSync } from "node:fs";
2
+ import { dirname, isAbsolute, join, normalize, relative } from "node:path";
3
+ import { getDocsEligibleAgentKeys } from "./agents/docs-config.js";
4
+ import { resolveProjectLocalDocsPath } from "./cli/docs-output-helper.js";
3
5
  export const DURABLE_ARTIFACT_TOOL_NAME = "wunderkind_write_artifact";
6
+ const DOCS_OUTPUT_ELIGIBLE_AGENT_KEYS = new Set(getDocsEligibleAgentKeys());
4
7
  function normalizeRelativePath(input) {
5
8
  const trimmed = input.trim();
6
9
  const normalized = normalize(trimmed).replaceAll("\\", "/");
@@ -8,7 +11,27 @@ function normalizeRelativePath(input) {
8
11
  }
9
12
  function isPathWithin(parentPath, candidatePath) {
10
13
  const rel = relative(parentPath, candidatePath);
11
- return rel === "" || (!rel.startsWith("../") && rel !== ".." && !rel.includes("/../"));
14
+ if (rel === "") {
15
+ return true;
16
+ }
17
+ if (isAbsolute(rel)) {
18
+ return false;
19
+ }
20
+ const normalizedSegments = rel.replaceAll("\\", "/").split("/").filter((segment) => segment.length > 0);
21
+ return !normalizedSegments.includes("..");
22
+ }
23
+ function ensurePathHasNoSymlinkSegments(cwd, normalizedRelativePath, errorMessage) {
24
+ const segments = normalizedRelativePath.split("/").filter((segment) => segment.length > 0);
25
+ let lexicalCurrentPath = cwd;
26
+ for (const segment of segments) {
27
+ lexicalCurrentPath = join(lexicalCurrentPath, segment);
28
+ if (!existsSync(lexicalCurrentPath)) {
29
+ return;
30
+ }
31
+ if (lstatSync(lexicalCurrentPath).isSymbolicLink()) {
32
+ throw new Error(errorMessage);
33
+ }
34
+ }
12
35
  }
13
36
  function ensureSafeRelativePath(relativePath) {
14
37
  const normalized = normalizeRelativePath(relativePath);
@@ -20,68 +43,190 @@ function ensureSafeRelativePath(relativePath) {
20
43
  }
21
44
  return normalized;
22
45
  }
23
- function getAllowedArtifactRoots(agentKey) {
46
+ function getDocsOutputRoot(cwd, options) {
47
+ return resolveProjectLocalDocsPath(options?.docsPath ?? "./docs", cwd).docsPath.replaceAll("\\", "/");
48
+ }
49
+ function isReservedDesignMdPath(path) {
50
+ return path === "DESIGN.md" || path.startsWith("DESIGN.md/");
51
+ }
52
+ function directoryLane(path) {
53
+ return { path, exactFile: false };
54
+ }
55
+ function exactFileLane(path) {
56
+ return { path, exactFile: true };
57
+ }
58
+ function getAllowedArtifactRoots(agentKey, docsOutputRoot) {
24
59
  switch (agentKey) {
25
60
  case "product-wunderkind":
26
- return [".sisyphus/prds", ".sisyphus/plans", ".sisyphus/issues", ".sisyphus/notepads"];
61
+ return [
62
+ directoryLane(".sisyphus/prds"),
63
+ directoryLane(".sisyphus/plans"),
64
+ directoryLane(".sisyphus/issues"),
65
+ directoryLane(".sisyphus/drafts"),
66
+ directoryLane(".sisyphus/notepads"),
67
+ directoryLane(".sisyphus/evidence"),
68
+ directoryLane(docsOutputRoot),
69
+ ];
27
70
  case "creative-director":
28
- return ["DESIGN.md", ".wunderkind/stitch", ".sisyphus/notepads"];
71
+ return [
72
+ exactFileLane("DESIGN.md"),
73
+ directoryLane(".wunderkind/stitch"),
74
+ directoryLane(".sisyphus/notepads"),
75
+ directoryLane(".sisyphus/evidence"),
76
+ directoryLane(docsOutputRoot),
77
+ ];
29
78
  case "marketing-wunderkind":
30
- return ["docs", ".sisyphus/notepads"];
79
+ return [directoryLane(docsOutputRoot), directoryLane(".sisyphus/notepads"), directoryLane(".sisyphus/evidence")];
31
80
  case "ciso":
32
- return ["docs", ".sisyphus/notepads"];
81
+ return [directoryLane(docsOutputRoot), directoryLane(".sisyphus/notepads"), directoryLane(".sisyphus/evidence")];
33
82
  case "fullstack-wunderkind":
34
- return ["docs", ".sisyphus/notepads", ".sisyphus/prds", ".sisyphus/plans", ".sisyphus/issues", "DESIGN.md", ".wunderkind/stitch"];
83
+ return [
84
+ directoryLane(docsOutputRoot),
85
+ directoryLane(".sisyphus/notepads"),
86
+ directoryLane(".sisyphus/evidence"),
87
+ directoryLane(".sisyphus/prds"),
88
+ directoryLane(".sisyphus/plans"),
89
+ directoryLane(".sisyphus/issues"),
90
+ exactFileLane("DESIGN.md"),
91
+ directoryLane(".wunderkind/stitch"),
92
+ ];
35
93
  case "legal-counsel":
36
- return [".sisyphus/notepads"];
94
+ return [directoryLane(".sisyphus/notepads"), directoryLane(".sisyphus/evidence")];
37
95
  }
38
96
  }
39
- function isAllowedArtifactPath(agentKey, normalizedRelativePath) {
40
- return getAllowedArtifactRoots(agentKey).some((allowedRoot) => {
41
- if (allowedRoot.endsWith(".md")) {
42
- return normalizedRelativePath === allowedRoot || normalizedRelativePath.startsWith(`${allowedRoot}/`);
97
+ function appendOnlyArtifactKinds(kind) {
98
+ return kind === "notepad" || kind === "evidence";
99
+ }
100
+ function isAllowedArtifactPath(agentKey, normalizedRelativePath, docsOutputRoot) {
101
+ return getAllowedArtifactRoots(agentKey, docsOutputRoot).some((allowedLane) => {
102
+ if (allowedLane.exactFile) {
103
+ return normalizedRelativePath === allowedLane.path;
43
104
  }
44
- return normalizedRelativePath === allowedRoot || normalizedRelativePath.startsWith(`${allowedRoot}/`);
105
+ return normalizedRelativePath === allowedLane.path || normalizedRelativePath.startsWith(`${allowedLane.path}/`);
45
106
  });
46
107
  }
47
- function validateArtifactKind(agentKey, kind, normalizedRelativePath) {
108
+ function resolveWritableParentPath(rootRealPath, cwd, normalizedRelativePath) {
109
+ const parentRelativePath = normalizeRelativePath(dirname(normalizedRelativePath));
110
+ if (parentRelativePath === ".") {
111
+ return rootRealPath;
112
+ }
113
+ const segments = parentRelativePath.split("/").filter((segment) => segment.length > 0);
114
+ let lexicalCurrentPath = cwd;
115
+ let resolvedCurrentPath = rootRealPath;
116
+ for (const segment of segments) {
117
+ lexicalCurrentPath = join(lexicalCurrentPath, segment);
118
+ if (existsSync(lexicalCurrentPath)) {
119
+ const lexicalStat = lstatSync(lexicalCurrentPath);
120
+ const nextResolvedPath = realpathSync(lexicalCurrentPath);
121
+ if (!isPathWithin(rootRealPath, nextResolvedPath)) {
122
+ throw new Error("resolved durable artifact path escaped the current project root");
123
+ }
124
+ if (!lexicalStat.isDirectory()) {
125
+ throw new Error("durable artifact path must point to a file, not a directory");
126
+ }
127
+ resolvedCurrentPath = nextResolvedPath;
128
+ continue;
129
+ }
130
+ const nextResolvedPath = join(resolvedCurrentPath, segment);
131
+ if (!isPathWithin(rootRealPath, nextResolvedPath)) {
132
+ throw new Error("resolved durable artifact path escaped the current project root");
133
+ }
134
+ mkdirSync(nextResolvedPath);
135
+ resolvedCurrentPath = nextResolvedPath;
136
+ }
137
+ return resolvedCurrentPath;
138
+ }
139
+ function validateArtifactKind(agentKey, kind, normalizedRelativePath, docsOutputRoot) {
48
140
  if (kind === "prd" && (agentKey !== "product-wunderkind" && agentKey !== "fullstack-wunderkind")) {
49
141
  throw new Error(`${agentKey} may not write PRD artifacts`);
50
142
  }
143
+ if (kind === "prd" && !normalizedRelativePath.startsWith(".sisyphus/prds/")) {
144
+ throw new Error("prd artifacts must stay under .sisyphus/prds/");
145
+ }
51
146
  if (kind === "plan" && (agentKey !== "product-wunderkind" && agentKey !== "fullstack-wunderkind")) {
52
147
  throw new Error(`${agentKey} may not write plan artifacts`);
53
148
  }
149
+ if (kind === "plan" && !normalizedRelativePath.startsWith(".sisyphus/plans/")) {
150
+ throw new Error("plan artifacts must stay under .sisyphus/plans/");
151
+ }
54
152
  if (kind === "issue" && (agentKey !== "product-wunderkind" && agentKey !== "fullstack-wunderkind")) {
55
153
  throw new Error(`${agentKey} may not write issue artifacts`);
56
154
  }
155
+ if (kind === "issue" && !normalizedRelativePath.startsWith(".sisyphus/issues/")) {
156
+ throw new Error("issue artifacts must stay under .sisyphus/issues/");
157
+ }
57
158
  if (kind === "design-md" && agentKey !== "creative-director" && agentKey !== "fullstack-wunderkind") {
58
159
  throw new Error(`${agentKey} may not write design artifacts`);
59
160
  }
60
- if (kind === "docs-output" && !["marketing-wunderkind", "creative-director", "product-wunderkind", "fullstack-wunderkind", "ciso"].includes(agentKey)) {
161
+ if (kind === "design-md" && normalizedRelativePath !== "DESIGN.md") {
162
+ throw new Error("design-md artifacts must write exactly to DESIGN.md");
163
+ }
164
+ if (kind === "draft" && !normalizedRelativePath.startsWith(".sisyphus/drafts/")) {
165
+ throw new Error("draft artifacts must stay under .sisyphus/drafts/");
166
+ }
167
+ if (kind === "docs-output" && !DOCS_OUTPUT_ELIGIBLE_AGENT_KEYS.has(agentKey)) {
61
168
  throw new Error(`${agentKey} may not write docs-output artifacts`);
62
169
  }
170
+ if (kind === "docs-output" && !normalizedRelativePath.startsWith(`${docsOutputRoot}/`)) {
171
+ throw new Error(`docs-output artifacts must stay under ${docsOutputRoot}/`);
172
+ }
63
173
  if (kind === "notepad" && !normalizedRelativePath.startsWith(".sisyphus/notepads/")) {
64
174
  throw new Error("notepad artifacts must stay under .sisyphus/notepads/");
65
175
  }
176
+ if (kind === "evidence" && !normalizedRelativePath.startsWith(".sisyphus/evidence/")) {
177
+ throw new Error("evidence artifacts must stay under .sisyphus/evidence/");
178
+ }
66
179
  }
67
- export function writeDurableArtifact(request, cwd) {
180
+ export function writeDurableArtifact(request, cwd, options) {
68
181
  const normalizedRelativePath = ensureSafeRelativePath(request.relativePath);
69
- if (!isAllowedArtifactPath(request.agentKey, normalizedRelativePath)) {
182
+ const docsOutputRoot = request.kind === "docs-output" ? getDocsOutputRoot(cwd, options) : null;
183
+ if (request.kind === "docs-output") {
184
+ if (docsOutputRoot === null) {
185
+ throw new Error("docs-output artifacts require a resolved docsPath");
186
+ }
187
+ if (isReservedDesignMdPath(docsOutputRoot)) {
188
+ throw new Error("docs-output artifacts may not use DESIGN.md as docsPath because that path is reserved for design-md");
189
+ }
190
+ ensurePathHasNoSymlinkSegments(cwd, docsOutputRoot, "docs-output lane must not include symlinked segments");
191
+ }
192
+ if (!isAllowedArtifactPath(request.agentKey, normalizedRelativePath, docsOutputRoot ?? "__docs-output-disabled__")) {
70
193
  throw new Error(`${request.agentKey} may not write outside its bounded durable-artifact lanes`);
71
194
  }
72
- validateArtifactKind(request.agentKey, request.kind, normalizedRelativePath);
73
- const absolutePath = join(cwd, normalizedRelativePath);
74
- if (!isPathWithin(cwd, absolutePath)) {
195
+ validateArtifactKind(request.agentKey, request.kind, normalizedRelativePath, docsOutputRoot ?? "__docs-output-disabled__");
196
+ const rootRealPath = realpathSync(cwd);
197
+ const resolvedAbsolutePath = resolveWritableParentPath(rootRealPath, cwd, normalizedRelativePath);
198
+ if (!isPathWithin(rootRealPath, resolvedAbsolutePath)) {
199
+ throw new Error("resolved durable artifact path escaped the current project root");
200
+ }
201
+ const finalAbsolutePath = join(resolvedAbsolutePath, normalizedRelativePath.split("/").at(-1) ?? "");
202
+ if (!isPathWithin(rootRealPath, finalAbsolutePath)) {
75
203
  throw new Error("resolved durable artifact path escaped the current project root");
76
204
  }
77
- if (existsSync(absolutePath) && statSync(absolutePath).isDirectory()) {
205
+ try {
206
+ const finalTargetStat = lstatSync(finalAbsolutePath);
207
+ if (finalTargetStat.isSymbolicLink()) {
208
+ throw new Error("resolved durable artifact path escaped the current project root");
209
+ }
210
+ const finalTargetRealPath = realpathSync(finalAbsolutePath);
211
+ if (!isPathWithin(rootRealPath, finalTargetRealPath)) {
212
+ throw new Error("resolved durable artifact path escaped the current project root");
213
+ }
214
+ }
215
+ catch (error) {
216
+ if (!(error instanceof Error) || !error.message.includes("ENOENT")) {
217
+ throw error;
218
+ }
219
+ }
220
+ if (existsSync(finalAbsolutePath) && statSync(finalAbsolutePath).isDirectory()) {
78
221
  throw new Error("durable artifact path must point to a file, not a directory");
79
222
  }
80
- mkdirSync(dirname(absolutePath), { recursive: true });
81
- const created = !existsSync(absolutePath);
82
- writeFileSync(absolutePath, request.content, "utf-8");
223
+ const created = !existsSync(finalAbsolutePath);
224
+ const nextContent = appendOnlyArtifactKinds(request.kind) && existsSync(finalAbsolutePath)
225
+ ? `${readFileSync(finalAbsolutePath, "utf-8")}${request.content}`
226
+ : request.content;
227
+ writeFileSync(finalAbsolutePath, nextContent, "utf-8");
83
228
  return {
84
- absolutePath,
229
+ absolutePath: finalAbsolutePath,
85
230
  relativePath: normalizedRelativePath,
86
231
  created,
87
232
  };
@@ -1 +1 @@
1
- {"version":3,"file":"artifact-writer.js","sourceRoot":"","sources":["../src/artifact-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACtF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAE9D,MAAM,CAAC,MAAM,0BAA0B,GAAG,2BAAoC,CAAA;AAyB9E,SAAS,qBAAqB,CAAC,KAAa;IAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAC5B,MAAM,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAC3D,OAAO,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAA;AACvE,CAAC;AAED,SAAS,YAAY,CAAC,UAAkB,EAAE,aAAqB;IAC7D,MAAM,GAAG,GAAG,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,CAAA;IAC/C,OAAO,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;AACxF,CAAC;AAED,SAAS,sBAAsB,CAAC,YAAoB;IAClD,MAAM,UAAU,GAAG,qBAAqB,CAAC,YAAY,CAAC,CAAA;IAEtD,IAAI,UAAU,KAAK,EAAE,IAAI,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