@zcy2nn/agent-forge 1.0.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 (189) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +266 -0
  3. package/agent-forge.schema.json +675 -0
  4. package/dist/agents/council.d.ts +27 -0
  5. package/dist/agents/councillor.d.ts +2 -0
  6. package/dist/agents/implementer.d.ts +2 -0
  7. package/dist/agents/index.d.ts +30 -0
  8. package/dist/agents/orchestrator.d.ts +30 -0
  9. package/dist/agents/researcher.d.ts +2 -0
  10. package/dist/agents/reviewer.d.ts +2 -0
  11. package/dist/cli/config-io.d.ts +24 -0
  12. package/dist/cli/config-manager.d.ts +4 -0
  13. package/dist/cli/custom-skills.d.ts +29 -0
  14. package/dist/cli/doctor.d.ts +38 -0
  15. package/dist/cli/index.d.ts +2 -0
  16. package/dist/cli/index.js +1932 -0
  17. package/dist/cli/install.d.ts +2 -0
  18. package/dist/cli/migration.d.ts +46 -0
  19. package/dist/cli/model-key-normalization.d.ts +1 -0
  20. package/dist/cli/paths.d.ts +35 -0
  21. package/dist/cli/providers.d.ts +99 -0
  22. package/dist/cli/skills.d.ts +52 -0
  23. package/dist/cli/system.d.ts +6 -0
  24. package/dist/cli/types.d.ts +40 -0
  25. package/dist/config/agent-mcps.d.ts +15 -0
  26. package/dist/config/constants.d.ts +28 -0
  27. package/dist/config/council-schema.d.ts +127 -0
  28. package/dist/config/index.d.ts +5 -0
  29. package/dist/config/loader.d.ts +57 -0
  30. package/dist/config/runtime-preset.d.ts +12 -0
  31. package/dist/config/schema.d.ts +371 -0
  32. package/dist/config/utils.d.ts +15 -0
  33. package/dist/council/council-manager.d.ts +49 -0
  34. package/dist/council/index.d.ts +1 -0
  35. package/dist/divoom/council.gif +0 -0
  36. package/dist/divoom/designer.gif +0 -0
  37. package/dist/divoom/explorer.gif +0 -0
  38. package/dist/divoom/fixer.gif +0 -0
  39. package/dist/divoom/input.gif +0 -0
  40. package/dist/divoom/intro.gif +0 -0
  41. package/dist/divoom/librarian.gif +0 -0
  42. package/dist/divoom/manager.d.ts +57 -0
  43. package/dist/divoom/oracle.gif +0 -0
  44. package/dist/divoom/orchestrator.gif +0 -0
  45. package/dist/hooks/apply-patch/codec.d.ts +7 -0
  46. package/dist/hooks/apply-patch/errors.d.ts +25 -0
  47. package/dist/hooks/apply-patch/execution-context.d.ts +27 -0
  48. package/dist/hooks/apply-patch/index.d.ts +15 -0
  49. package/dist/hooks/apply-patch/matching.d.ts +26 -0
  50. package/dist/hooks/apply-patch/operations.d.ts +3 -0
  51. package/dist/hooks/apply-patch/patch.d.ts +2 -0
  52. package/dist/hooks/apply-patch/prepared-changes.d.ts +17 -0
  53. package/dist/hooks/apply-patch/resolution.d.ts +19 -0
  54. package/dist/hooks/apply-patch/rewrite.d.ts +7 -0
  55. package/dist/hooks/apply-patch/test-helpers.d.ts +6 -0
  56. package/dist/hooks/apply-patch/types.d.ts +80 -0
  57. package/dist/hooks/auto-update-checker/cache.d.ts +11 -0
  58. package/dist/hooks/auto-update-checker/checker.d.ts +32 -0
  59. package/dist/hooks/auto-update-checker/constants.d.ts +11 -0
  60. package/dist/hooks/auto-update-checker/index.d.ts +18 -0
  61. package/dist/hooks/auto-update-checker/types.d.ts +22 -0
  62. package/dist/hooks/chat-headers.d.ts +16 -0
  63. package/dist/hooks/delegate-task-retry/guidance.d.ts +2 -0
  64. package/dist/hooks/delegate-task-retry/hook.d.ts +8 -0
  65. package/dist/hooks/delegate-task-retry/index.d.ts +4 -0
  66. package/dist/hooks/delegate-task-retry/patterns.d.ts +11 -0
  67. package/dist/hooks/filter-available-skills/index.d.ts +32 -0
  68. package/dist/hooks/foreground-fallback/index.d.ts +72 -0
  69. package/dist/hooks/image-hook.d.ts +19 -0
  70. package/dist/hooks/index.d.ts +13 -0
  71. package/dist/hooks/json-error-recovery/hook.d.ts +18 -0
  72. package/dist/hooks/json-error-recovery/index.d.ts +1 -0
  73. package/dist/hooks/phase-reminder/index.d.ts +26 -0
  74. package/dist/hooks/post-file-tool-nudge/index.d.ts +19 -0
  75. package/dist/hooks/task-session-manager/index.d.ts +52 -0
  76. package/dist/hooks/todo-continuation/index.d.ts +53 -0
  77. package/dist/hooks/todo-continuation/todo-hygiene.d.ts +35 -0
  78. package/dist/index.d.ts +5 -0
  79. package/dist/index.js +32981 -0
  80. package/dist/interview/dashboard.d.ts +62 -0
  81. package/dist/interview/document.d.ts +25 -0
  82. package/dist/interview/helpers.d.ts +10 -0
  83. package/dist/interview/index.d.ts +1 -0
  84. package/dist/interview/manager.d.ts +35 -0
  85. package/dist/interview/parser.d.ts +11 -0
  86. package/dist/interview/prompts.d.ts +7 -0
  87. package/dist/interview/server.d.ts +13 -0
  88. package/dist/interview/service.d.ts +34 -0
  89. package/dist/interview/types.d.ts +96 -0
  90. package/dist/interview/ui.d.ts +12 -0
  91. package/dist/mcp/context7.d.ts +6 -0
  92. package/dist/mcp/grep-app.d.ts +6 -0
  93. package/dist/mcp/index.d.ts +8 -0
  94. package/dist/mcp/types.d.ts +12 -0
  95. package/dist/mcp/websearch.d.ts +9 -0
  96. package/dist/multiplexer/factory.d.ts +26 -0
  97. package/dist/multiplexer/index.d.ts +9 -0
  98. package/dist/multiplexer/session-manager.d.ts +53 -0
  99. package/dist/multiplexer/tmux/index.d.ts +22 -0
  100. package/dist/multiplexer/types.d.ts +54 -0
  101. package/dist/multiplexer/zellij/index.d.ts +34 -0
  102. package/dist/tools/ast-grep/cli.d.ts +15 -0
  103. package/dist/tools/ast-grep/constants.d.ts +25 -0
  104. package/dist/tools/ast-grep/downloader.d.ts +5 -0
  105. package/dist/tools/ast-grep/index.d.ts +10 -0
  106. package/dist/tools/ast-grep/tools.d.ts +3 -0
  107. package/dist/tools/ast-grep/types.d.ts +30 -0
  108. package/dist/tools/ast-grep/utils.d.ts +4 -0
  109. package/dist/tools/council.d.ts +10 -0
  110. package/dist/tools/index.d.ts +6 -0
  111. package/dist/tools/preset-manager.d.ts +27 -0
  112. package/dist/tools/skill.d.ts +9 -0
  113. package/dist/tools/smartfetch/binary.d.ts +3 -0
  114. package/dist/tools/smartfetch/cache.d.ts +6 -0
  115. package/dist/tools/smartfetch/constants.d.ts +12 -0
  116. package/dist/tools/smartfetch/index.d.ts +3 -0
  117. package/dist/tools/smartfetch/network.d.ts +38 -0
  118. package/dist/tools/smartfetch/secondary-model.d.ts +28 -0
  119. package/dist/tools/smartfetch/tool.d.ts +3 -0
  120. package/dist/tools/smartfetch/types.d.ts +122 -0
  121. package/dist/tools/smartfetch/utils.d.ts +18 -0
  122. package/dist/tui-state.d.ts +15 -0
  123. package/dist/tui.d.ts +8 -0
  124. package/dist/tui.js +248 -0
  125. package/dist/utils/agent-variant.d.ts +63 -0
  126. package/dist/utils/compat.d.ts +30 -0
  127. package/dist/utils/env.d.ts +1 -0
  128. package/dist/utils/index.d.ts +9 -0
  129. package/dist/utils/internal-initiator.d.ts +6 -0
  130. package/dist/utils/logger.d.ts +8 -0
  131. package/dist/utils/polling.d.ts +21 -0
  132. package/dist/utils/session-manager.d.ts +55 -0
  133. package/dist/utils/session.d.ts +74 -0
  134. package/dist/utils/subagent-depth.d.ts +35 -0
  135. package/dist/utils/system-collapse.d.ts +6 -0
  136. package/dist/utils/task.d.ts +4 -0
  137. package/dist/utils/zip-extractor.d.ts +1 -0
  138. package/package.json +104 -0
  139. package/src/skills/brainstorming/SKILL.md +177 -0
  140. package/src/skills/brainstorming/scripts/frame-template.html +214 -0
  141. package/src/skills/brainstorming/scripts/helper.js +88 -0
  142. package/src/skills/brainstorming/scripts/server.cjs +354 -0
  143. package/src/skills/brainstorming/scripts/start-server.sh +148 -0
  144. package/src/skills/brainstorming/scripts/stop-server.sh +56 -0
  145. package/src/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  146. package/src/skills/brainstorming/visual-companion.md +279 -0
  147. package/src/skills/codemap/README.md +59 -0
  148. package/src/skills/codemap/SKILL.md +163 -0
  149. package/src/skills/codemap/codemap.md +36 -0
  150. package/src/skills/codemap/scripts/codemap.mjs +483 -0
  151. package/src/skills/codemap/scripts/codemap.test.ts +129 -0
  152. package/src/skills/codemap.md +40 -0
  153. package/src/skills/dispatching-parallel-agents/SKILL.md +193 -0
  154. package/src/skills/executing-plans/SKILL.md +78 -0
  155. package/src/skills/finishing-a-development-branch/SKILL.md +211 -0
  156. package/src/skills/receiving-code-review/SKILL.md +224 -0
  157. package/src/skills/requesting-code-review/SKILL.md +113 -0
  158. package/src/skills/requesting-code-review/code-reviewer.md +146 -0
  159. package/src/skills/simplify/README.md +19 -0
  160. package/src/skills/simplify/SKILL.md +138 -0
  161. package/src/skills/simplify/codemap.md +36 -0
  162. package/src/skills/subagent-driven-development/SKILL.md +288 -0
  163. package/src/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
  164. package/src/skills/subagent-driven-development/implementer-prompt.md +113 -0
  165. package/src/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  166. package/src/skills/systematic-debugging/CREATION-LOG.md +119 -0
  167. package/src/skills/systematic-debugging/SKILL.md +308 -0
  168. package/src/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  169. package/src/skills/systematic-debugging/condition-based-waiting.md +115 -0
  170. package/src/skills/systematic-debugging/defense-in-depth.md +122 -0
  171. package/src/skills/systematic-debugging/find-polluter.sh +63 -0
  172. package/src/skills/systematic-debugging/root-cause-tracing.md +169 -0
  173. package/src/skills/systematic-debugging/test-academic.md +14 -0
  174. package/src/skills/systematic-debugging/test-pressure-1.md +58 -0
  175. package/src/skills/systematic-debugging/test-pressure-2.md +68 -0
  176. package/src/skills/systematic-debugging/test-pressure-3.md +69 -0
  177. package/src/skills/test-driven-development/SKILL.md +383 -0
  178. package/src/skills/test-driven-development/testing-anti-patterns.md +299 -0
  179. package/src/skills/using-git-worktrees/SKILL.md +226 -0
  180. package/src/skills/verification-before-completion/SKILL.md +147 -0
  181. package/src/skills/writing-plans/SKILL.md +165 -0
  182. package/src/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  183. package/src/skills/writing-skills/SKILL.md +666 -0
  184. package/src/skills/writing-skills/anthropic-best-practices.md +1150 -0
  185. package/src/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  186. package/src/skills/writing-skills/graphviz-conventions.dot +172 -0
  187. package/src/skills/writing-skills/persuasion-principles.md +187 -0
  188. package/src/skills/writing-skills/render-graphs.js +168 -0
  189. package/src/skills/writing-skills/testing-skills-with-subagents.md +384 -0
@@ -0,0 +1,371 @@
1
+ import { z } from 'zod';
2
+ declare const FALLBACK_AGENT_NAMES: readonly ["orchestrator", "researcher", "reviewer", "implementer"];
3
+ declare const MANUAL_AGENT_NAMES: readonly ["orchestrator", "researcher", "reviewer", "implementer"];
4
+ export declare const ProviderModelIdSchema: z.ZodString;
5
+ export declare const ManualAgentPlanSchema: z.ZodObject<{
6
+ primary: z.ZodString;
7
+ fallback1: z.ZodString;
8
+ fallback2: z.ZodString;
9
+ fallback3: z.ZodString;
10
+ }, z.core.$strip>;
11
+ export declare const ManualPlanSchema: z.ZodObject<{
12
+ orchestrator: z.ZodObject<{
13
+ primary: z.ZodString;
14
+ fallback1: z.ZodString;
15
+ fallback2: z.ZodString;
16
+ fallback3: z.ZodString;
17
+ }, z.core.$strip>;
18
+ researcher: z.ZodObject<{
19
+ primary: z.ZodString;
20
+ fallback1: z.ZodString;
21
+ fallback2: z.ZodString;
22
+ fallback3: z.ZodString;
23
+ }, z.core.$strip>;
24
+ reviewer: z.ZodObject<{
25
+ primary: z.ZodString;
26
+ fallback1: z.ZodString;
27
+ fallback2: z.ZodString;
28
+ fallback3: z.ZodString;
29
+ }, z.core.$strip>;
30
+ implementer: z.ZodObject<{
31
+ primary: z.ZodString;
32
+ fallback1: z.ZodString;
33
+ fallback2: z.ZodString;
34
+ fallback3: z.ZodString;
35
+ }, z.core.$strip>;
36
+ }, z.core.$strict>;
37
+ export type ManualAgentName = (typeof MANUAL_AGENT_NAMES)[number];
38
+ export type ManualAgentPlan = z.infer<typeof ManualAgentPlanSchema>;
39
+ export type ManualPlan = z.infer<typeof ManualPlanSchema>;
40
+ export type FallbackAgentName = (typeof FALLBACK_AGENT_NAMES)[number];
41
+ export declare const AgentOverrideConfigSchema: z.ZodObject<{
42
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
43
+ id: z.ZodString;
44
+ variant: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>]>>]>>;
46
+ temperature: z.ZodOptional<z.ZodNumber>;
47
+ variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
48
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
49
+ mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
50
+ prompt: z.ZodOptional<z.ZodString>;
51
+ orchestratorPrompt: z.ZodOptional<z.ZodString>;
52
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
53
+ displayName: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strict>;
55
+ export declare const MultiplexerTypeSchema: z.ZodEnum<{
56
+ auto: "auto";
57
+ tmux: "tmux";
58
+ zellij: "zellij";
59
+ none: "none";
60
+ }>;
61
+ export type MultiplexerType = z.infer<typeof MultiplexerTypeSchema>;
62
+ export declare const MultiplexerLayoutSchema: z.ZodEnum<{
63
+ "main-horizontal": "main-horizontal";
64
+ "main-vertical": "main-vertical";
65
+ tiled: "tiled";
66
+ "even-horizontal": "even-horizontal";
67
+ "even-vertical": "even-vertical";
68
+ }>;
69
+ export type MultiplexerLayout = z.infer<typeof MultiplexerLayoutSchema>;
70
+ export declare const TmuxLayoutSchema: z.ZodEnum<{
71
+ "main-horizontal": "main-horizontal";
72
+ "main-vertical": "main-vertical";
73
+ tiled: "tiled";
74
+ "even-horizontal": "even-horizontal";
75
+ "even-vertical": "even-vertical";
76
+ }>;
77
+ export type TmuxLayout = MultiplexerLayout;
78
+ export declare const MultiplexerConfigSchema: z.ZodObject<{
79
+ type: z.ZodDefault<z.ZodEnum<{
80
+ auto: "auto";
81
+ tmux: "tmux";
82
+ zellij: "zellij";
83
+ none: "none";
84
+ }>>;
85
+ layout: z.ZodDefault<z.ZodEnum<{
86
+ "main-horizontal": "main-horizontal";
87
+ "main-vertical": "main-vertical";
88
+ tiled: "tiled";
89
+ "even-horizontal": "even-horizontal";
90
+ "even-vertical": "even-vertical";
91
+ }>>;
92
+ main_pane_size: z.ZodDefault<z.ZodNumber>;
93
+ }, z.core.$strip>;
94
+ export type MultiplexerConfig = z.infer<typeof MultiplexerConfigSchema>;
95
+ export declare const TmuxConfigSchema: z.ZodObject<{
96
+ enabled: z.ZodDefault<z.ZodBoolean>;
97
+ layout: z.ZodDefault<z.ZodEnum<{
98
+ "main-horizontal": "main-horizontal";
99
+ "main-vertical": "main-vertical";
100
+ tiled: "tiled";
101
+ "even-horizontal": "even-horizontal";
102
+ "even-vertical": "even-vertical";
103
+ }>>;
104
+ main_pane_size: z.ZodDefault<z.ZodNumber>;
105
+ }, z.core.$strip>;
106
+ export type TmuxConfig = z.infer<typeof TmuxConfigSchema>;
107
+ export type AgentOverrideConfig = z.infer<typeof AgentOverrideConfigSchema>;
108
+ /** Normalized model entry with optional per-model variant. */
109
+ export type ModelEntry = {
110
+ id: string;
111
+ variant?: string;
112
+ };
113
+ export declare const PresetSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
114
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
115
+ id: z.ZodString;
116
+ variant: z.ZodOptional<z.ZodString>;
117
+ }, z.core.$strip>]>>]>>;
118
+ temperature: z.ZodOptional<z.ZodNumber>;
119
+ variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
120
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
121
+ mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
122
+ prompt: z.ZodOptional<z.ZodString>;
123
+ orchestratorPrompt: z.ZodOptional<z.ZodString>;
124
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
125
+ displayName: z.ZodOptional<z.ZodString>;
126
+ }, z.core.$strict>>;
127
+ export type Preset = z.infer<typeof PresetSchema>;
128
+ export declare const WebsearchConfigSchema: z.ZodObject<{
129
+ provider: z.ZodDefault<z.ZodEnum<{
130
+ exa: "exa";
131
+ tavily: "tavily";
132
+ }>>;
133
+ }, z.core.$strip>;
134
+ export type WebsearchConfig = z.infer<typeof WebsearchConfigSchema>;
135
+ export declare const McpNameSchema: z.ZodEnum<{
136
+ websearch: "websearch";
137
+ context7: "context7";
138
+ grep_app: "grep_app";
139
+ }>;
140
+ export type McpName = z.infer<typeof McpNameSchema>;
141
+ export declare const InterviewConfigSchema: z.ZodObject<{
142
+ maxQuestions: z.ZodDefault<z.ZodNumber>;
143
+ outputFolder: z.ZodDefault<z.ZodString>;
144
+ autoOpenBrowser: z.ZodDefault<z.ZodBoolean>;
145
+ port: z.ZodDefault<z.ZodNumber>;
146
+ dashboard: z.ZodDefault<z.ZodBoolean>;
147
+ }, z.core.$strip>;
148
+ export type InterviewConfig = z.infer<typeof InterviewConfigSchema>;
149
+ export declare const SessionManagerConfigSchema: z.ZodObject<{
150
+ maxSessionsPerAgent: z.ZodDefault<z.ZodNumber>;
151
+ readContextMinLines: z.ZodDefault<z.ZodNumber>;
152
+ readContextMaxFiles: z.ZodDefault<z.ZodNumber>;
153
+ }, z.core.$strip>;
154
+ export type SessionManagerConfig = z.infer<typeof SessionManagerConfigSchema>;
155
+ export declare const DivoomConfigSchema: z.ZodObject<{
156
+ enabled: z.ZodDefault<z.ZodBoolean>;
157
+ python: z.ZodDefault<z.ZodString>;
158
+ script: z.ZodDefault<z.ZodString>;
159
+ size: z.ZodDefault<z.ZodNumber>;
160
+ fps: z.ZodDefault<z.ZodNumber>;
161
+ speed: z.ZodDefault<z.ZodNumber>;
162
+ maxFrames: z.ZodDefault<z.ZodNumber>;
163
+ posterizeBits: z.ZodDefault<z.ZodNumber>;
164
+ gifs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
165
+ }, z.core.$strip>;
166
+ export type DivoomConfig = z.infer<typeof DivoomConfigSchema>;
167
+ export declare const TodoContinuationConfigSchema: z.ZodObject<{
168
+ maxContinuations: z.ZodDefault<z.ZodNumber>;
169
+ cooldownMs: z.ZodDefault<z.ZodNumber>;
170
+ autoEnable: z.ZodDefault<z.ZodBoolean>;
171
+ autoEnableThreshold: z.ZodDefault<z.ZodNumber>;
172
+ }, z.core.$strip>;
173
+ export type TodoContinuationConfig = z.infer<typeof TodoContinuationConfigSchema>;
174
+ export declare const FailoverConfigSchema: z.ZodObject<{
175
+ enabled: z.ZodDefault<z.ZodBoolean>;
176
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
177
+ retryDelayMs: z.ZodDefault<z.ZodNumber>;
178
+ chains: z.ZodDefault<z.ZodObject<{
179
+ orchestrator: z.ZodOptional<z.ZodArray<z.ZodString>>;
180
+ researcher: z.ZodOptional<z.ZodArray<z.ZodString>>;
181
+ reviewer: z.ZodOptional<z.ZodArray<z.ZodString>>;
182
+ implementer: z.ZodOptional<z.ZodArray<z.ZodString>>;
183
+ }, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
184
+ retry_on_empty: z.ZodDefault<z.ZodBoolean>;
185
+ }, z.core.$strip>;
186
+ export type FailoverConfig = z.infer<typeof FailoverConfigSchema>;
187
+ export declare const PluginConfigSchema: z.ZodObject<{
188
+ preset: z.ZodOptional<z.ZodString>;
189
+ setDefaultAgent: z.ZodOptional<z.ZodBoolean>;
190
+ scoringEngineVersion: z.ZodOptional<z.ZodEnum<{
191
+ v1: "v1";
192
+ "v2-shadow": "v2-shadow";
193
+ v2: "v2";
194
+ }>>;
195
+ balanceProviderUsage: z.ZodOptional<z.ZodBoolean>;
196
+ autoUpdate: z.ZodOptional<z.ZodBoolean>;
197
+ manualPlan: z.ZodOptional<z.ZodObject<{
198
+ orchestrator: z.ZodObject<{
199
+ primary: z.ZodString;
200
+ fallback1: z.ZodString;
201
+ fallback2: z.ZodString;
202
+ fallback3: z.ZodString;
203
+ }, z.core.$strip>;
204
+ researcher: z.ZodObject<{
205
+ primary: z.ZodString;
206
+ fallback1: z.ZodString;
207
+ fallback2: z.ZodString;
208
+ fallback3: z.ZodString;
209
+ }, z.core.$strip>;
210
+ reviewer: z.ZodObject<{
211
+ primary: z.ZodString;
212
+ fallback1: z.ZodString;
213
+ fallback2: z.ZodString;
214
+ fallback3: z.ZodString;
215
+ }, z.core.$strip>;
216
+ implementer: z.ZodObject<{
217
+ primary: z.ZodString;
218
+ fallback1: z.ZodString;
219
+ fallback2: z.ZodString;
220
+ fallback3: z.ZodString;
221
+ }, z.core.$strip>;
222
+ }, z.core.$strict>>;
223
+ presets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
224
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
225
+ id: z.ZodString;
226
+ variant: z.ZodOptional<z.ZodString>;
227
+ }, z.core.$strip>]>>]>>;
228
+ temperature: z.ZodOptional<z.ZodNumber>;
229
+ variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
230
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
231
+ mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
232
+ prompt: z.ZodOptional<z.ZodString>;
233
+ orchestratorPrompt: z.ZodOptional<z.ZodString>;
234
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
235
+ displayName: z.ZodOptional<z.ZodString>;
236
+ }, z.core.$strict>>>>;
237
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
238
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
239
+ id: z.ZodString;
240
+ variant: z.ZodOptional<z.ZodString>;
241
+ }, z.core.$strip>]>>]>>;
242
+ temperature: z.ZodOptional<z.ZodNumber>;
243
+ variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
244
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
245
+ mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
246
+ prompt: z.ZodOptional<z.ZodString>;
247
+ orchestratorPrompt: z.ZodOptional<z.ZodString>;
248
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
249
+ displayName: z.ZodOptional<z.ZodString>;
250
+ }, z.core.$strict>>>;
251
+ disabled_agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
252
+ disabled_mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
253
+ multiplexer: z.ZodOptional<z.ZodObject<{
254
+ type: z.ZodDefault<z.ZodEnum<{
255
+ auto: "auto";
256
+ tmux: "tmux";
257
+ zellij: "zellij";
258
+ none: "none";
259
+ }>>;
260
+ layout: z.ZodDefault<z.ZodEnum<{
261
+ "main-horizontal": "main-horizontal";
262
+ "main-vertical": "main-vertical";
263
+ tiled: "tiled";
264
+ "even-horizontal": "even-horizontal";
265
+ "even-vertical": "even-vertical";
266
+ }>>;
267
+ main_pane_size: z.ZodDefault<z.ZodNumber>;
268
+ }, z.core.$strip>>;
269
+ tmux: z.ZodOptional<z.ZodObject<{
270
+ enabled: z.ZodDefault<z.ZodBoolean>;
271
+ layout: z.ZodDefault<z.ZodEnum<{
272
+ "main-horizontal": "main-horizontal";
273
+ "main-vertical": "main-vertical";
274
+ tiled: "tiled";
275
+ "even-horizontal": "even-horizontal";
276
+ "even-vertical": "even-vertical";
277
+ }>>;
278
+ main_pane_size: z.ZodDefault<z.ZodNumber>;
279
+ }, z.core.$strip>>;
280
+ websearch: z.ZodOptional<z.ZodObject<{
281
+ provider: z.ZodDefault<z.ZodEnum<{
282
+ exa: "exa";
283
+ tavily: "tavily";
284
+ }>>;
285
+ }, z.core.$strip>>;
286
+ interview: z.ZodOptional<z.ZodObject<{
287
+ maxQuestions: z.ZodDefault<z.ZodNumber>;
288
+ outputFolder: z.ZodDefault<z.ZodString>;
289
+ autoOpenBrowser: z.ZodDefault<z.ZodBoolean>;
290
+ port: z.ZodDefault<z.ZodNumber>;
291
+ dashboard: z.ZodDefault<z.ZodBoolean>;
292
+ }, z.core.$strip>>;
293
+ sessionManager: z.ZodOptional<z.ZodObject<{
294
+ maxSessionsPerAgent: z.ZodDefault<z.ZodNumber>;
295
+ readContextMinLines: z.ZodDefault<z.ZodNumber>;
296
+ readContextMaxFiles: z.ZodDefault<z.ZodNumber>;
297
+ }, z.core.$strip>>;
298
+ divoom: z.ZodOptional<z.ZodObject<{
299
+ enabled: z.ZodDefault<z.ZodBoolean>;
300
+ python: z.ZodDefault<z.ZodString>;
301
+ script: z.ZodDefault<z.ZodString>;
302
+ size: z.ZodDefault<z.ZodNumber>;
303
+ fps: z.ZodDefault<z.ZodNumber>;
304
+ speed: z.ZodDefault<z.ZodNumber>;
305
+ maxFrames: z.ZodDefault<z.ZodNumber>;
306
+ posterizeBits: z.ZodDefault<z.ZodNumber>;
307
+ gifs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
308
+ }, z.core.$strip>>;
309
+ todoContinuation: z.ZodOptional<z.ZodObject<{
310
+ maxContinuations: z.ZodDefault<z.ZodNumber>;
311
+ cooldownMs: z.ZodDefault<z.ZodNumber>;
312
+ autoEnable: z.ZodDefault<z.ZodBoolean>;
313
+ autoEnableThreshold: z.ZodDefault<z.ZodNumber>;
314
+ }, z.core.$strip>>;
315
+ fallback: z.ZodOptional<z.ZodObject<{
316
+ enabled: z.ZodDefault<z.ZodBoolean>;
317
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
318
+ retryDelayMs: z.ZodDefault<z.ZodNumber>;
319
+ chains: z.ZodDefault<z.ZodObject<{
320
+ orchestrator: z.ZodOptional<z.ZodArray<z.ZodString>>;
321
+ researcher: z.ZodOptional<z.ZodArray<z.ZodString>>;
322
+ reviewer: z.ZodOptional<z.ZodArray<z.ZodString>>;
323
+ implementer: z.ZodOptional<z.ZodArray<z.ZodString>>;
324
+ }, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
325
+ retry_on_empty: z.ZodDefault<z.ZodBoolean>;
326
+ }, z.core.$strip>>;
327
+ council: z.ZodOptional<z.ZodPipe<z.ZodObject<{
328
+ presets: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>, z.ZodTransform<Record<string, {
329
+ model: string;
330
+ variant?: string | undefined;
331
+ prompt?: string | undefined;
332
+ }>, Record<string, Record<string, unknown>>>>>;
333
+ timeout: z.ZodDefault<z.ZodNumber>;
334
+ default_preset: z.ZodDefault<z.ZodString>;
335
+ councillor_execution_mode: z.ZodDefault<z.ZodEnum<{
336
+ parallel: "parallel";
337
+ serial: "serial";
338
+ }>>;
339
+ councillor_retries: z.ZodDefault<z.ZodNumber>;
340
+ master: z.ZodOptional<z.ZodUnknown>;
341
+ master_timeout: z.ZodOptional<z.ZodUnknown>;
342
+ master_fallback: z.ZodOptional<z.ZodUnknown>;
343
+ }, z.core.$strip>, z.ZodTransform<{
344
+ presets: Record<string, Record<string, {
345
+ model: string;
346
+ variant?: string | undefined;
347
+ prompt?: string | undefined;
348
+ }>>;
349
+ timeout: number;
350
+ default_preset: string;
351
+ councillor_execution_mode: "parallel" | "serial";
352
+ councillor_retries: number;
353
+ _deprecated: string[] | undefined;
354
+ _legacyMasterModel: string | undefined;
355
+ }, {
356
+ presets: Record<string, Record<string, {
357
+ model: string;
358
+ variant?: string | undefined;
359
+ prompt?: string | undefined;
360
+ }>>;
361
+ timeout: number;
362
+ default_preset: string;
363
+ councillor_execution_mode: "parallel" | "serial";
364
+ councillor_retries: number;
365
+ master?: unknown;
366
+ master_timeout?: unknown;
367
+ master_fallback?: unknown;
368
+ }>>>;
369
+ }, z.core.$strip>;
370
+ export type PluginConfig = z.infer<typeof PluginConfigSchema>;
371
+ export type { AgentName } from './constants';
@@ -0,0 +1,15 @@
1
+ import type { AgentOverrideConfig, PluginConfig } from './schema';
2
+ /**
3
+ * Get agent override config by name.
4
+ *
5
+ * @param config - The plugin configuration
6
+ * @param name - The agent name
7
+ * @returns The agent-specific override configuration if found
8
+ */
9
+ export declare function getAgentOverride(config: PluginConfig | undefined, name: string): AgentOverrideConfig | undefined;
10
+ /**
11
+ * Get custom agent names declared in config.agents.
12
+ *
13
+ * Custom agents are unknown keys that are not built-in agent names.
14
+ */
15
+ export declare function getCustomAgentNames(config: PluginConfig | undefined): string[];
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Council Manager
3
+ *
4
+ * Orchestrates multi-LLM council sessions: launches councillors in
5
+ * parallel and collects their results for the council agent to synthesize.
6
+ */
7
+ import type { PluginInput } from '@opencode-ai/plugin';
8
+ import type { PluginConfig } from '../config';
9
+ import type { CouncilResult } from '../config/council-schema';
10
+ import type { SubagentDepthTracker } from '../utils/subagent-depth';
11
+ export declare class CouncilManager {
12
+ private client;
13
+ private directory;
14
+ private config?;
15
+ private depthTracker?;
16
+ private tmuxEnabled;
17
+ private deprecatedFields?;
18
+ private legacyMasterModel?;
19
+ constructor(ctx: PluginInput, config?: PluginConfig, depthTracker?: SubagentDepthTracker, tmuxEnabled?: boolean);
20
+ /** Return deprecated config fields detected during parsing (for tool warnings). */
21
+ getDeprecatedFields(): string[] | undefined;
22
+ /** Return the legacy master.model if it was used as fallback. */
23
+ getLegacyMasterModel(): string | undefined;
24
+ /**
25
+ * Run a full council session.
26
+ *
27
+ * 1. Look up the preset
28
+ * 2. Launch all councillors in parallel
29
+ * 3. Collect results (respecting timeout)
30
+ * 4. Return formatted councillor results for synthesis
31
+ */
32
+ runCouncil(prompt: string, presetName: string | undefined, parentSessionId: string): Promise<CouncilResult>;
33
+ /**
34
+ * Inject a start notification into the parent session so the user
35
+ * sees immediate feedback while councillors are spinning up.
36
+ */
37
+ private sendStartNotification;
38
+ /**
39
+ * Run a single agent session: create → register → prompt → extract → cleanup.
40
+ */
41
+ private runAgentSession;
42
+ private runCouncillors;
43
+ /**
44
+ * Run a single councillor with retry logic for empty responses.
45
+ * Only retries on "Empty response from provider" errors — timeouts
46
+ * and other failures are returned immediately.
47
+ */
48
+ private runCouncillorWithRetry;
49
+ }
@@ -0,0 +1 @@
1
+ export { CouncilManager } from './council-manager';
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,57 @@
1
+ import type { DivoomConfig } from '../config';
2
+ export type DivoomSenderCall = {
3
+ command: string;
4
+ args: string[];
5
+ };
6
+ export type DivoomSender = (call: DivoomSenderCall) => Promise<void> | void;
7
+ type DivoomManagerOptions = {
8
+ assetDir?: string | null;
9
+ sender?: DivoomSender;
10
+ };
11
+ export declare function getDivoomOutDir(homeDir?: string): string;
12
+ export declare class DivoomManager {
13
+ private sender;
14
+ private assetDir;
15
+ private config;
16
+ private parentStates;
17
+ private pendingUserInputs;
18
+ private orchestratorBusy;
19
+ private latestRequestedGifPath?;
20
+ private lastGifPath?;
21
+ private sendQueue;
22
+ constructor(config?: Partial<DivoomConfig>, sender?: DivoomSender, options?: DivoomManagerOptions);
23
+ onPluginLoad(): void;
24
+ onTaskStart(input: {
25
+ parentSessionId?: string;
26
+ callId?: string;
27
+ args?: unknown;
28
+ }): void;
29
+ onTaskEnd(input: {
30
+ parentSessionId?: string;
31
+ callId?: string;
32
+ }): void;
33
+ onUserInputRequired(input: {
34
+ sessionId?: string;
35
+ requestId?: string;
36
+ }): void;
37
+ onUserInputResolved(input: {
38
+ sessionId?: string;
39
+ requestId?: string;
40
+ }): void;
41
+ onOrchestratorStatus(input: {
42
+ sessionId?: string;
43
+ status?: string;
44
+ isOrchestrator?: boolean;
45
+ }): void;
46
+ onSessionDeleted(input: {
47
+ sessionId?: string;
48
+ isOrchestrator?: boolean;
49
+ }): void;
50
+ private render;
51
+ private getParentState;
52
+ private show;
53
+ flush(): Promise<void>;
54
+ private clearLatestIfCurrent;
55
+ }
56
+ export declare function createDivoomManager(config?: Partial<DivoomConfig>): DivoomManager;
57
+ export {};
Binary file
Binary file
@@ -0,0 +1,7 @@
1
+ import type { ParsedPatch } from './types';
2
+ export declare function normalizeUnicode(text: string): string;
3
+ export declare function stripHeredoc(input: string): string;
4
+ export declare function normalizePatchText(patchText: string): string;
5
+ export declare function parsePatch(patchText: string): ParsedPatch;
6
+ export declare function parsePatchStrict(patchText: string): ParsedPatch;
7
+ export declare function formatPatch(patch: ParsedPatch): string;
@@ -0,0 +1,25 @@
1
+ import type { ApplyPatchErrorCode, ApplyPatchErrorKind } from './types';
2
+ export declare class ApplyPatchError extends Error {
3
+ readonly kind: ApplyPatchErrorKind;
4
+ readonly code: ApplyPatchErrorCode;
5
+ readonly cause?: unknown;
6
+ constructor(kind: ApplyPatchErrorKind, code: ApplyPatchErrorCode, message: string, options?: {
7
+ cause?: unknown;
8
+ });
9
+ }
10
+ export declare function getErrorMessage(error: unknown): string;
11
+ export declare function createApplyPatchBlockedError(message: string, cause?: unknown): ApplyPatchError;
12
+ export declare function createApplyPatchValidationError(message: string, cause?: unknown): ApplyPatchError;
13
+ export declare function createApplyPatchVerificationError(message: string, cause?: unknown): ApplyPatchError;
14
+ export declare function createApplyPatchInternalError(message: string, cause?: unknown): ApplyPatchError;
15
+ export declare function isApplyPatchError(error: unknown): error is ApplyPatchError;
16
+ export declare function isApplyPatchBlockedError(error: unknown): boolean;
17
+ export declare function isApplyPatchValidationError(error: unknown): boolean;
18
+ export declare function isApplyPatchVerificationError(error: unknown): boolean;
19
+ export declare function isApplyPatchInternalError(error: unknown): boolean;
20
+ export declare function getApplyPatchErrorDetails(error: unknown): {
21
+ kind: ApplyPatchErrorKind;
22
+ code: ApplyPatchErrorCode;
23
+ message: string;
24
+ } | undefined;
25
+ export declare function ensureApplyPatchError(error: unknown, context: string): ApplyPatchError;
@@ -0,0 +1,27 @@
1
+ import { resolveUpdateChunksFromText } from './resolution';
2
+ import type { ApplyPatchRuntimeOptions, PatchHunk, UpdatePatchHunk } from './types';
3
+ export type PreparedFileState = {
4
+ exists: false;
5
+ derived: boolean;
6
+ } | {
7
+ exists: true;
8
+ text: string;
9
+ mode?: number;
10
+ derived: boolean;
11
+ };
12
+ export type PatchExecutionContext = {
13
+ hunks: PatchHunk[];
14
+ pathsNormalized: boolean;
15
+ staged: Map<string, PreparedFileState>;
16
+ getPreparedFileState: (filePath: string, verb: 'update' | 'delete') => Promise<PreparedFileState>;
17
+ assertPreparedPathMissing: (filePath: string, verb: 'add' | 'move') => Promise<void>;
18
+ };
19
+ export type ResolvedPreparedUpdate = {
20
+ resolved: Awaited<ReturnType<typeof resolveUpdateChunksFromText>>['resolved'];
21
+ nextText: string;
22
+ };
23
+ export declare function isMissingPathError(error: unknown): boolean;
24
+ export declare function parseValidatedPatch(patchText: string): PatchHunk[];
25
+ export declare function createPatchExecutionContext(root: string, patchText: string, worktree?: string): Promise<PatchExecutionContext>;
26
+ export declare function resolvePreparedUpdate(filePath: string, currentText: string, hunk: UpdatePatchHunk, cfg: ApplyPatchRuntimeOptions): ResolvedPreparedUpdate;
27
+ export declare function stageAddedText(contents: string): string;
@@ -0,0 +1,15 @@
1
+ import type { PluginInput } from '@opencode-ai/plugin';
2
+ interface ToolExecuteBeforeInput {
3
+ tool: string;
4
+ directory?: string;
5
+ }
6
+ interface ToolExecuteBeforeOutput {
7
+ args?: {
8
+ patchText?: unknown;
9
+ [key: string]: unknown;
10
+ };
11
+ }
12
+ export declare function createApplyPatchHook(ctx: PluginInput): {
13
+ 'tool.execute.before': (input: ToolExecuteBeforeInput, output: ToolExecuteBeforeOutput) => Promise<void>;
14
+ };
15
+ export {};
@@ -0,0 +1,26 @@
1
+ import type { LineComparator, MatchComparatorName, RescueResult, SeekHit } from './types';
2
+ export type PreparedAutoRescueTarget = {
3
+ exact: string;
4
+ unicode: string;
5
+ trimEnd: string;
6
+ unicodeTrimEnd: string;
7
+ };
8
+ export declare function equalExact(a: string, b: string): boolean;
9
+ export declare function equalUnicodeExact(a: string, b: string): boolean;
10
+ export declare function equalTrimEnd(a: string, b: string): boolean;
11
+ export declare function equalUnicodeTrimEnd(a: string, b: string): boolean;
12
+ export declare function equalTrim(a: string, b: string): boolean;
13
+ export declare function equalUnicodeTrim(a: string, b: string): boolean;
14
+ export declare const autoRescueComparators: LineComparator[];
15
+ export declare function prepareAutoRescueTarget(target: string): PreparedAutoRescueTarget;
16
+ export declare function matchPreparedAutoRescueComparator(candidate: string, target: PreparedAutoRescueTarget): MatchComparatorName | undefined;
17
+ export declare const permissiveComparators: LineComparator[];
18
+ export declare function seekMatch(lines: string[], pattern: string[], start: number, eof?: boolean): SeekHit | undefined;
19
+ export declare function seek(lines: string[], pattern: string[], start: number, eof?: boolean): number;
20
+ export declare function list(lines: string[], pattern: string[], start: number, same: LineComparator): number[];
21
+ export declare function sameRescueLine(a: string, b: string): boolean;
22
+ export declare function prefix(old_lines: string[], new_lines: string[]): number;
23
+ export declare function suffix(old_lines: string[], new_lines: string[], prefixLength: number): number;
24
+ export declare function rescueByPrefixSuffix(lines: string[], old_lines: string[], new_lines: string[], start: number): RescueResult;
25
+ export declare function score(a: string[], b: string[]): number;
26
+ export declare function rescueByLcs(lines: string[], old_lines: string[], new_lines: string[], start: number): RescueResult;
@@ -0,0 +1,3 @@
1
+ export { parseValidatedPatch } from './execution-context';
2
+ export { applyPreparedChanges, preparePatchChanges } from './prepared-changes';
3
+ export { rewritePatch, rewritePatchText } from './rewrite';
@@ -0,0 +1,2 @@
1
+ export { parsePatch } from './codec';
2
+ export { preparePatchChanges, rewritePatch, rewritePatchText, } from './operations';
@@ -0,0 +1,17 @@
1
+ import type { ApplyPatchRuntimeOptions, PreparedChange } from './types';
2
+ export declare function preparePatchChanges(root: string, patchText: string, cfg: ApplyPatchRuntimeOptions, worktree?: string): Promise<PreparedChange[]>;
3
+ /**
4
+ * Internal best-effort helper that applies the output of
5
+ * `preparePatchChanges()`: it snapshots all touched paths first and uses
6
+ * temp + rename for writes to regular files. It is not a universal multi-file
7
+ * transaction and is not perfect against concurrent external interference,
8
+ * but it avoids leaving silent partial states on normal apply failures.
9
+ *
10
+ * Contract: although it is exported for local tests/helpers, its expected
11
+ * input is the already prepared output of `preparePatchChanges()`. If it
12
+ * receives manual arrays, it revalidates the basic shape
13
+ * (types/text/normalized absolute paths) and filesystem invariants: it
14
+ * rejects updates/deletes/moves whose source does not exist, and add/move
15
+ * operations whose destination is already occupied.
16
+ */
17
+ export declare function applyPreparedChanges(changes: PreparedChange[]): Promise<void>;