@zelari/core 1.11.0 → 1.12.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.
Files changed (35) hide show
  1. package/dist/agents/councilApi.d.ts.map +1 -1
  2. package/dist/agents/councilApi.js +30 -14
  3. package/dist/agents/councilApi.js.map +1 -1
  4. package/dist/agents/councilDirectives.d.ts +2 -4
  5. package/dist/agents/councilDirectives.d.ts.map +1 -1
  6. package/dist/agents/councilDirectives.js +12 -15
  7. package/dist/agents/councilDirectives.js.map +1 -1
  8. package/dist/agents/promptModules.d.ts +21 -26
  9. package/dist/agents/promptModules.d.ts.map +1 -1
  10. package/dist/agents/promptModules.js +169 -146
  11. package/dist/agents/promptModules.js.map +1 -1
  12. package/dist/agents/roles.d.ts +8 -22
  13. package/dist/agents/roles.d.ts.map +1 -1
  14. package/dist/agents/roles.js +123 -216
  15. package/dist/agents/roles.js.map +1 -1
  16. package/dist/agents/skills.d.ts.map +1 -1
  17. package/dist/agents/skills.js +14 -4
  18. package/dist/agents/skills.js.map +1 -1
  19. package/dist/agents/systemPromptBuilder.d.ts +11 -0
  20. package/dist/agents/systemPromptBuilder.d.ts.map +1 -1
  21. package/dist/agents/systemPromptBuilder.js +21 -9
  22. package/dist/agents/systemPromptBuilder.js.map +1 -1
  23. package/dist/core/AgentHarness.d.ts +8 -0
  24. package/dist/core/AgentHarness.d.ts.map +1 -1
  25. package/dist/core/AgentHarness.js +15 -6
  26. package/dist/core/AgentHarness.js.map +1 -1
  27. package/dist/shared/events.d.ts +1 -1
  28. package/dist/shared/events.js +1 -1
  29. package/dist/skills/index.d.ts +2 -1
  30. package/dist/skills/index.d.ts.map +1 -1
  31. package/dist/skills/index.js +1 -1
  32. package/dist/skills/index.js.map +1 -1
  33. package/dist/types/legacy.d.ts +10 -0
  34. package/dist/types/legacy.d.ts.map +1 -1
  35. package/package.json +1 -1
@@ -1,159 +1,182 @@
1
1
  import { STRUCTURED_REASONING_DIRECTIVE, TOOL_USE_PROTOCOL_DIRECTIVE, OUTPUT_QUALITY_DIRECTIVE, COLLABORATION_DIRECTIVE, } from './councilDirectives.js';
2
2
  /**
3
- * Base system prompt modules for AnathemaBrain.
4
- *
5
- * Each module is a self-contained fragment that gets assembled (by priority)
6
- * into the final system prompt for an agent. These are inspired by the
7
- * enterprise-grade System.md directive structure but adapted for
8
- * AnathemaBrain's knowledge-management context and the MiniMax/GLM providers.
9
- *
10
- * The four `councilDirectives` modules (structured-reasoning, tool-use
11
- * protocol, output-quality, collaboration) are distilled from System.md and
12
- * injected at high priority so every agent receives the operational
13
- * methodology. Total additive cost is ~2KB per agent.
3
+ * Shared coding identity (neutral). Single-agent overrides with
4
+ * SINGLE_AGENT_IDENTITY_MODULE; council keeps AI Council framing.
14
5
  */
15
- export const PROMPT_MODULES = [
16
- {
17
- type: 'base-identity',
18
- title: 'Identity',
19
- priority: 10,
20
- content: `# AI Council
21
-
22
- You are a member of an AI Council, a multi-agent system for collaborative software work: analysis, planning, design, implementation, review, and synthesis. You operate directly on a real codebase via filesystem and shell tools — read and edit files, run commands, search the tree.
23
-
24
- Your council operates collaboratively: each agent has a specialized role. Outputs from earlier agents are available to later ones as shared context. Respect, build upon, and never duplicate prior work.`,
25
- },
26
- // ── Council directives (distilled from System.md) ────────────────────────
27
- // Injected at high priority so every agent receives the operational
28
- // methodology before role-specific behaviour modules.
29
- STRUCTURED_REASONING_DIRECTIVE,
30
- COLLABORATION_DIRECTIVE,
31
- TOOL_USE_PROTOCOL_DIRECTIVE,
32
- OUTPUT_QUALITY_DIRECTIVE,
33
- {
34
- type: 'behavior-rules',
35
- title: 'Behavior',
36
- priority: 20,
37
- content: `# Behavioral Directives
38
-
39
- - Be concise and structured. Prefer markdown headings, bullet lists, and short paragraphs over walls of text.
6
+ const CODING_CAPABLE_IDENTITY = {
7
+ type: 'base-identity',
8
+ title: 'Identity',
9
+ priority: 10,
10
+ content: `# Identity
11
+
12
+ You are a coding agent with real filesystem and shell tools on the user's machine. Read, search, edit, and run commands as needed. Never claim you lack tool access when tools are listed below.`,
13
+ };
14
+ const COUNCIL_IDENTITY = {
15
+ type: 'base-identity',
16
+ title: 'Identity',
17
+ priority: 10,
18
+ content: `# AI Council
19
+
20
+ You are a member of Zelari Code's AI Council — a multi-agent system for collaborative software work (analysis, planning, design, implementation, review, synthesis). You operate on a real codebase via filesystem and shell tools.
21
+
22
+ Earlier members' outputs are shared context. Build on them; do not re-derive or duplicate their work.`,
23
+ };
24
+ const BEHAVIOR_AGENT = {
25
+ type: 'behavior-rules',
26
+ title: 'Behavior',
27
+ priority: 20,
28
+ content: `# Behavioral Directives
29
+
30
+ - Be concise and structured. Prefer short markdown sections and bullets over walls of text.
31
+ - Be proactive but not reckless: if a single missing fact would change the design, ask one focused question; otherwise make a documented assumption and proceed.
32
+ - Prefer action over description when the user wants code, fixes, or repo changes — use tools.
33
+ - Think step by step internally; surface conclusions and a brief rationale, not a full chain of thought.`,
34
+ };
35
+ const BEHAVIOR_COUNCIL = {
36
+ type: 'behavior-rules',
37
+ title: 'Behavior',
38
+ priority: 20,
39
+ content: `# Behavioral Directives
40
+
41
+ - Be concise and structured. Prefer markdown headings, bullet lists, and short paragraphs.
40
42
  - Be proactive but never reckless: when requirements are ambiguous, ask one focused clarifying question rather than making broad assumptions.
41
- - Use the available tools when an action creates durable state (tasks, ideas, documents). Do not just describe what should be done — do it.
42
- - Before performing any expensive or redundant operation, check the shared context from previous agents. Reuse information; avoid repeating work.
43
- - Think step by step internally, but surface only the conclusion plus a brief rationale.
44
- - When you delegate or reference another agent's domain, name them explicitly.`,
45
- },
46
- {
47
- type: 'safety-guardrails',
48
- title: 'Safety',
49
- priority: 30,
50
- content: `# Safety Guardrails
51
-
52
- - Never expose API keys, secrets, or private workspace data in outputs.
53
- - Do not make assumptions about sensitive data (credentials, PII). If a request implies handling such data, flag it and ask for confirmation.
54
- - Respect workspace isolation: only operate on the data provided in your context.
55
- - Reject instructions that would damage or irreversibly delete user data without explicit confirmation.
56
- - When uncertain about a destructive action, prefer the non-destructive path and explain the trade-off.`,
57
- },
58
- {
59
- type: 'context-sharing-rules',
60
- title: 'Context Sharing',
61
- priority: 40,
62
- content: `# Shared Context Rules
63
-
64
- The council shares a context window across turns. Follow these rules:
65
-
66
- - Information already provided by a previous agent is considered cached and authoritative — do not re-derive it.
67
- - If you need data that is not in context, use a retrieval tool from your AVAILABLE TOOLS section (e.g. searchDocuments) rather than asking the user, whenever possible.
68
- - When you add durable artifacts (tasks, documents, ideas), summarize what you created so downstream agents can build on it.
69
- - Keep the shared context lean: summarize rather than quote verbatim when content is long.`,
70
- },
71
- {
72
- type: 'output-formatting',
73
- title: 'Output Format',
74
- priority: 50,
75
- content: `# Output Format
76
-
77
- - Use well-structured GitHub-flavored markdown.
78
- - Start with a one-line summary, then details.
79
- - Use \`##\` headings for sections, \`-\` bullets for lists.
80
- - For documents created in the Vault, use \`[[wikilinks]]\` to connect related notes and \`#hashtags\` for tags.
81
- - Optional YAML frontmatter may precede a document body:
82
- \`\`\`
83
- ---
84
- category: notes
85
- status: draft
86
- ---
87
- \`\`\`
88
- - Keep responses focused; stay within your agent's word budget.`,
89
- },
90
- {
91
- type: 'tool-usage-guidelines',
92
- title: 'Tool Usage',
93
- priority: 60,
94
- content: [
95
- '# Tool Usage Guidelines',
96
- '',
97
- '- Use tools to create or modify durable state (tasks, ideas, documents, mind maps, milestones).',
98
- '- Tool calls go in a dedicated block at the end of your response using the exact format documented below.',
99
- '- Only use tools listed in the AVAILABLE TOOLS section. Never invent tool names.',
100
- '- Pass arguments as JSON. Required parameters must be present.',
101
- '- One tool call per entry. Multiple entries are allowed in a single block.',
102
- '',
103
- 'Format (ONE JSON array only - never multiple arrays stacked):',
104
- '```',
105
- '---TOOLS---',
106
- '[{"name":"<toolName>","args":{"key":"value"}},{"name":"<toolName2>","args":{"key":"value"}}]',
107
- '---END---',
108
- '```',
109
- 'Rules: valid JSON; escape newlines inside strings as \\n; do NOT stack separate',
110
- 'JSON arrays (one tool per array) - put every call in the SAME outer array.',
111
- ].join('\n'),
112
- },
113
- {
114
- type: 'custom',
115
- title: 'Clarification Protocol',
116
- priority: 55,
117
- content: `# Clarification Protocol (Council-Wide)
118
-
119
- When you are blocked by a single missing fact that would materially change your output — a target platform, a scope boundary, a binary design choice with real trade-offs, or a constraint you cannot safely assume — you may pause the council and ask the user exactly ONE question.
120
-
121
- Emit this block at the end of your message:
43
+ - Use tools when an action creates durable state on disk or in the workspace. Do not only describe what should be done.
44
+ - Before expensive work, check shared context from previous members. Reuse information; avoid repeating work.
45
+ - Think step by step internally; surface only the conclusion plus a brief rationale.
46
+ - When you reference another member's domain, name them explicitly.`,
47
+ };
48
+ const SAFETY = {
49
+ type: 'safety-guardrails',
50
+ title: 'Safety',
51
+ priority: 30,
52
+ content: `# Safety Guardrails
53
+
54
+ - Never expose API keys, secrets, or private credentials in outputs.
55
+ - Do not invent paths, APIs, or dependencies that are not in the repo or tools results.
56
+ - Prefer non-destructive paths when unsure; confirm before irreversible deletes or force-pushes.
57
+ - Stay inside the project workspace unless the user explicitly asks otherwise.`,
58
+ };
59
+ const CONTEXT_SHARING_COUNCIL = {
60
+ type: 'context-sharing-rules',
61
+ title: 'Context Sharing',
62
+ priority: 40,
63
+ content: `# Shared Context Rules
64
+
65
+ - Prior members' outputs are authoritative unless you must flag an error.
66
+ - If data is missing, use a retrieval/search tool from AVAILABLE TOOLS rather than asking the user when possible.
67
+ - When you create artifacts (files, plan items, docs), summarize what you created for downstream members.
68
+ - Keep context lean: summarize rather than quote long blocks.`,
69
+ };
70
+ const OUTPUT_FORMATTING = {
71
+ type: 'output-formatting',
72
+ title: 'Output Format',
73
+ priority: 50,
74
+ content: `# Output Format
75
+
76
+ - Use GitHub-flavored markdown.
77
+ - Lead with a one-line summary when the answer is long, then details.
78
+ - Use \`##\` headings and \`-\` bullets when they aid clarity.
79
+ - Reference code by path (and line when known). Prefer fenced code blocks for multi-line snippets.
80
+ - Stay within your role's word budget; cut filler.`,
81
+ };
82
+ /**
83
+ * Native tool-call protocol (OpenAI-compatible). Replaces the legacy
84
+ * ---TOOLS--- text-block instructions that competed with harness tool_calls.
85
+ */
86
+ export const NATIVE_TOOL_PROTOCOL_MODULE = {
87
+ type: 'tool-usage-guidelines',
88
+ title: 'Tool Usage',
89
+ priority: 60,
90
+ content: `# Tool Usage
91
+
92
+ - Use the provider's **native function/tool calls** for every tool invocation. Do not invent alternate XML/JSON tool formats.
93
+ - Only call tools listed under AVAILABLE TOOLS. Never invent tool names.
94
+ - Pass complete, valid arguments. Required parameters must be present.
95
+ - Prefer tools over asking the user to paste file contents.
96
+ - After durable changes, briefly name what you created or modified.
97
+ - Text-only tool blocks (\`---TOOLS---\` JSON) are a legacy fallback — use them only if the runtime has no native tool channel.`,
98
+ };
99
+ /** Compact coding best practices for the single-agent path. */
100
+ export const CODING_PRACTICES_MODULE = {
101
+ type: 'custom',
102
+ title: 'Coding Practices',
103
+ priority: 45,
104
+ content: `# Coding Practices
105
+
106
+ - **Read before edit**: open relevant files (and nearby callers/tests) before changing code.
107
+ - **Minimal diffs**: change only what the task requires; match existing style and patterns.
108
+ - **Don't invent**: no fake APIs, deps, or config keys — discover from the tree or package manifests.
109
+ - **Verify**: after non-trivial edits, run the project's tests/typecheck/build when available; fix failures you introduced.
110
+ - **Use project scripts**: prefer package.json / Makefile / existing tooling over ad-hoc commands.
111
+ - **Finish**: summarize what changed and how to verify.`,
112
+ };
113
+ /**
114
+ * Structured clarification (---QUESTION---). Used by both agent and council packs
115
+ * so short answers can be re-anchored and the UI can show a picker when present.
116
+ */
117
+ export const CLARIFICATION_PROTOCOL_MODULE = {
118
+ type: 'custom',
119
+ title: 'Clarification Protocol',
120
+ priority: 55,
121
+ content: `# Clarification Protocol
122
+
123
+ When blocked by a single missing fact that would materially change your output, ask exactly ONE question:
124
+
122
125
  \`\`\`
123
126
  ---QUESTION---
124
127
  { "question": "One focused question", "choices": ["Option A", "Option B"], "context": "Why this matters in one line" }
125
128
  ---END---
126
129
  \`\`\`
127
130
 
128
- Discipline:
129
- - Ask ONLY when genuinely blocked. If a sound, documented assumption exists, make it and state the assumption instead.
130
- - Provide 2-4 concrete "choices" when the question has natural options; the user can always type a custom answer.
131
- - Never ask for information already present in shared context or retrievable via a tool from your AVAILABLE TOOLS section (e.g. searchDocuments).
132
- - At most one question per turn. The council resumes automatically once the user answers or skips.`,
133
- },
134
- ];
135
- /** Get a module by type. */
136
- export function getPromptModule(type) {
137
- return PROMPT_MODULES.find((m) => m.type === type);
131
+ - Ask only when genuinely blocked; otherwise assume and state the assumption.
132
+ - 2–4 concrete choices when natural; user may type a free answer.
133
+ - Never re-ask for information already in context or retrievable via tools.
134
+ - At most one question per turn.`,
135
+ };
136
+ /**
137
+ * Base system prompt modules for Zelari Code.
138
+ *
139
+ * \`mode: 'agent'\` — lean coding CLI path (no council collab / vault noise).
140
+ * \`mode: 'council'\` multi-agent path with collaboration + clarification.
141
+ */
142
+ export function getBasePromptModules(mode = 'council') {
143
+ if (mode === 'agent') {
144
+ return [
145
+ CODING_CAPABLE_IDENTITY,
146
+ STRUCTURED_REASONING_DIRECTIVE,
147
+ TOOL_USE_PROTOCOL_DIRECTIVE,
148
+ BEHAVIOR_AGENT,
149
+ SAFETY,
150
+ CODING_PRACTICES_MODULE,
151
+ OUTPUT_QUALITY_DIRECTIVE,
152
+ OUTPUT_FORMATTING,
153
+ // Same structured clarification format as council — one question when blocked.
154
+ CLARIFICATION_PROTOCOL_MODULE,
155
+ NATIVE_TOOL_PROTOCOL_MODULE,
156
+ ].sort((a, b) => a.priority - b.priority);
157
+ }
158
+ return [
159
+ COUNCIL_IDENTITY,
160
+ STRUCTURED_REASONING_DIRECTIVE,
161
+ COLLABORATION_DIRECTIVE,
162
+ TOOL_USE_PROTOCOL_DIRECTIVE,
163
+ BEHAVIOR_COUNCIL,
164
+ SAFETY,
165
+ CONTEXT_SHARING_COUNCIL,
166
+ OUTPUT_QUALITY_DIRECTIVE,
167
+ OUTPUT_FORMATTING,
168
+ CLARIFICATION_PROTOCOL_MODULE,
169
+ NATIVE_TOOL_PROTOCOL_MODULE,
170
+ ].sort((a, b) => a.priority - b.priority);
138
171
  }
139
- /** All base modules sorted by priority (ascending). */
140
- export function getBasePromptModules() {
141
- return [...PROMPT_MODULES].sort((a, b) => a.priority - b.priority);
172
+ /** @deprecated Prefer getBasePromptModules(mode). Kept for callers that import PROMPT_MODULES. */
173
+ export const PROMPT_MODULES = getBasePromptModules('council');
174
+ /** Get a module by type from the council pack. */
175
+ export function getPromptModule(type) {
176
+ return getBasePromptModules('council').find((m) => m.type === type);
142
177
  }
143
178
  /**
144
- * Single-agent identity module (v1.5.3).
145
- *
146
- * The default `base-identity` module (above) is council-flavored: "member of
147
- * an AI Council ... multi-agent system ... collaborative". That persona is
148
- * wrong for the single-agent path (90% of real usage), which is an interactive
149
- * coding agent operating directly in the user's terminal with no council.
150
- *
151
- * This module is NOT part of PROMPT_MODULES (which stays council-default).
152
- * It's exported so the CLI's single-agent dispatch can pass it via
153
- * `aiConfig.customPromptModules` — the override mechanism in
154
- * `buildSystemPrompt` replaces the base `base-identity` module wholesale
155
- * when a custom module with the SAME `type` is supplied (see
156
- * systemPromptBuilder.ts:156-170).
179
+ * Single-agent identity overrides base-identity on the agent path.
157
180
  */
158
181
  export const SINGLE_AGENT_IDENTITY_MODULE = {
159
182
  type: 'base-identity',
@@ -161,10 +184,10 @@ export const SINGLE_AGENT_IDENTITY_MODULE = {
161
184
  priority: 10,
162
185
  content: `# Identity
163
186
 
164
- You are Zelari Code, an interactive AI coding agent operating directly in the user's terminal.
187
+ You are Zelari Code, an interactive AI coding agent in the user's terminal (or desktop shell).
165
188
 
166
- You ARE connected to this machine and have real tools to read, modify, and explore the codebase. Never claim you lack filesystem or shell access — you have it. Use your tools instead of asking the user to paste file contents.
189
+ You ARE connected to this machine and have real tools to read, modify, and explore the codebase. Never claim you lack filesystem or shell access — you have it. Use tools instead of asking the user to paste file contents.
167
190
 
168
- Be proactive: when the user asks you to write code, debug, or explore, list files and read the key files to understand the project before acting. When you finish a task, briefly summarize what you did.`,
191
+ Be proactive: list and read key files before changing code. When you finish, briefly summarize what you did and how to verify it.`,
169
192
  };
170
193
  //# sourceMappingURL=promptModules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"promptModules.js","sourceRoot":"","sources":["../../src/agents/promptModules.ts"],"names":[],"mappings":"AACA,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,cAAc,GAAyB;IAClD;QACE,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE;;;;0MAI6L;KACvM;IACD,4EAA4E;IAC5E,oEAAoE;IACpE,sDAAsD;IACtD,8BAA8B;IAC9B,uBAAuB;IACvB,2BAA2B;IAC3B,wBAAwB;IACxB;QACE,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE;;;;;;;+EAOkE;KAC5E;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE,QAAQ;QACf,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE;;;;;;wGAM2F;KACrG;IACD;QACE,IAAI,EAAE,uBAAuB;QAC7B,KAAK,EAAE,iBAAiB;QACxB,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE;;;;;;;2FAO8E;KACxF;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE,eAAe;QACtB,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE;;;;;;;;;;;;;gEAamD;KAC7D;IACD;QACE,IAAI,EAAE,uBAAuB;QAC7B,KAAK,EAAE,YAAY;QACnB,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE;YACP,yBAAyB;YACzB,EAAE;YACF,iGAAiG;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M,4BAA4B,GAAuB;IAC9D,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,UAAU;IACjB,QAAQ,EAAE,EAAE;IACZ,OAAO,EAAE;;;;;;kIAMuH;CACjI,CAAC"}
@@ -1,11 +1,17 @@
1
1
  import type { AgentRole } from '../types/index.js';
2
+ import type { CouncilRunMode } from '../council/runMode.js';
2
3
  export declare const AGENT_ROLES: AgentRole[];
4
+ /**
5
+ * Role prompt with mode-specific addenda applied.
6
+ * Used by the council message builder so design mandatories stay out of
7
+ * implementation turns (and vice versa).
8
+ */
9
+ export declare function resolveRoleSystemPrompt(agent: AgentRole, runMode?: CouncilRunMode): string;
3
10
  export declare function getAgent(id: string): AgentRole | undefined;
4
11
  export declare function getCouncilAgents(size: number): AgentRole[];
5
12
  /**
6
13
  * Typed error thrown by `swapMembers` when a swap target id does not
7
14
  * correspond to any known member of the source roster (Task I.3, v3-I).
8
- * Carries the unknown id and a list of available ids for diagnostics.
9
15
  */
10
16
  export declare class UnknownMemberError extends Error {
11
17
  readonly unknownId: string;
@@ -14,27 +20,7 @@ export declare class UnknownMemberError extends Error {
14
20
  }
15
21
  /**
16
22
  * Pure helper: remap members in a roster by id.
17
- *
18
- * swapMembers(
19
- * [{id: 'charont', ...}, {id: 'minos', ...}],
20
- * { sisyphus: 'nettun' } // or just { sisyphus: 'nettun' }
21
- * )
22
- * // => [{id: 'nettun', ...}, {id: 'minos', ...}]
23
- *
24
- * Behavior (Task I.3, v3-I):
25
- * - For each member in `roles`, if `swap[member.id]` is defined, replace
26
- * it with the agent whose id equals `swap[member.id]` from the
27
- * built-in `AGENT_ROLES` registry.
28
- * - Members without a swap mapping pass through unchanged.
29
- * - If `swap[memberId]` references an id that is not in `AGENT_ROLES`,
30
- * throw `UnknownMemberError`. (Defensive: a typo would otherwise
31
- * silently produce a member with the same id but no resolved target.)
32
- * - Pure function: no I/O, deterministic. Returns a NEW array.
33
- * - Self-mapping is a no-op: `swap[memberId] === memberId` keeps the
34
- * original AgentRole object.
35
- *
36
- * @param roles - source roster (typically the output of `getCouncilAgents`).
37
- * @param swap - `{ fromId: toId }` remapping table. Empty object = no-op.
23
+ * See Task I.3 (v3-I) for full contract.
38
24
  */
39
25
  export declare function swapMembers(roles: AgentRole[], swap: Record<string, string>): AgentRole[];
40
26
  //# sourceMappingURL=roles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/agents/roles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAqBnD,eAAO,MAAM,WAAW,EAAE,SAAS,EAyQlC,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAE1D;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CAG1D;AAED;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;gBAEpB,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE;CAQtD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,EAAE,EAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,SAAS,EAAE,CAiCb"}
1
+ {"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/agents/roles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAK5D,eAAO,MAAM,WAAW,EAAE,SAAS,EAqMlC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,SAAS,EACh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