thoth-agents 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +339 -0
  3. package/dist/agents/deep.d.ts +2 -0
  4. package/dist/agents/designer.d.ts +2 -0
  5. package/dist/agents/explorer.d.ts +2 -0
  6. package/dist/agents/index.d.ts +8 -0
  7. package/dist/agents/librarian.d.ts +2 -0
  8. package/dist/agents/oracle.d.ts +2 -0
  9. package/dist/agents/orchestrator.d.ts +15 -0
  10. package/dist/agents/prompt-dialects.d.ts +28 -0
  11. package/dist/agents/prompt-sections.d.ts +47 -0
  12. package/dist/agents/prompt-utils.d.ts +25 -0
  13. package/dist/agents/quick.d.ts +2 -0
  14. package/dist/cli/codex-config-io.d.ts +31 -0
  15. package/dist/cli/codex-install.d.ts +41 -0
  16. package/dist/cli/codex-paths.d.ts +29 -0
  17. package/dist/cli/config-io.d.ts +22 -0
  18. package/dist/cli/config-manager.d.ts +4 -0
  19. package/dist/cli/custom-skills.d.ts +48 -0
  20. package/dist/cli/index.d.ts +3 -0
  21. package/dist/cli/index.js +4579 -0
  22. package/dist/cli/install.d.ts +3 -0
  23. package/dist/cli/model-key-normalization.d.ts +1 -0
  24. package/dist/cli/paths.d.ts +21 -0
  25. package/dist/cli/providers.d.ts +120 -0
  26. package/dist/cli/skill-manifest.d.ts +32 -0
  27. package/dist/cli/skills.d.ts +26 -0
  28. package/dist/cli/system.d.ts +6 -0
  29. package/dist/cli/types.d.ts +58 -0
  30. package/dist/config/constants.d.ts +17 -0
  31. package/dist/config/index.d.ts +5 -0
  32. package/dist/config/loader.d.ts +33 -0
  33. package/dist/config/schema.d.ts +279 -0
  34. package/dist/config/utils.d.ts +10 -0
  35. package/dist/delegation/project-id.d.ts +10 -0
  36. package/dist/delegation/types.d.ts +39 -0
  37. package/dist/harness/adapters/codex-surfaces.d.ts +219 -0
  38. package/dist/harness/adapters/codex.d.ts +8 -0
  39. package/dist/harness/adapters/opencode.d.ts +10 -0
  40. package/dist/harness/codex-plugin-paths.d.ts +1 -0
  41. package/dist/harness/core/agent-pack.d.ts +88 -0
  42. package/dist/harness/core/memory-governance.d.ts +33 -0
  43. package/dist/harness/core/sdd.d.ts +100 -0
  44. package/dist/harness/core/skills.d.ts +183 -0
  45. package/dist/harness/generate-codex-plugin.d.ts +9 -0
  46. package/dist/harness/registry.d.ts +6 -0
  47. package/dist/harness/types.d.ts +85 -0
  48. package/dist/harness/writers/codex-plugin-package.d.ts +26 -0
  49. package/dist/harness/writers/codex-toml.d.ts +10 -0
  50. package/dist/harness/writers/skill-layout.d.ts +15 -0
  51. package/dist/hooks/auto-update-checker/cache.d.ts +7 -0
  52. package/dist/hooks/auto-update-checker/checker.d.ts +28 -0
  53. package/dist/hooks/auto-update-checker/constants.d.ts +11 -0
  54. package/dist/hooks/auto-update-checker/index.d.ts +18 -0
  55. package/dist/hooks/auto-update-checker/types.d.ts +23 -0
  56. package/dist/hooks/chat-headers.d.ts +16 -0
  57. package/dist/hooks/delegate-task-retry/guidance.d.ts +2 -0
  58. package/dist/hooks/delegate-task-retry/hook.d.ts +8 -0
  59. package/dist/hooks/delegate-task-retry/index.d.ts +4 -0
  60. package/dist/hooks/delegate-task-retry/patterns.d.ts +11 -0
  61. package/dist/hooks/foreground-fallback/index.d.ts +73 -0
  62. package/dist/hooks/index.d.ts +10 -0
  63. package/dist/hooks/json-error-recovery/hook.d.ts +18 -0
  64. package/dist/hooks/json-error-recovery/index.d.ts +1 -0
  65. package/dist/hooks/phase-reminder/index.d.ts +26 -0
  66. package/dist/hooks/post-read-nudge/index.d.ts +18 -0
  67. package/dist/hooks/skill-sync.d.ts +10 -0
  68. package/dist/hooks/thoth-mem/index.d.ts +46 -0
  69. package/dist/hooks/thoth-mem/protocol.d.ts +7 -0
  70. package/dist/index.d.ts +5 -0
  71. package/dist/index.js +6509 -0
  72. package/dist/mcp/context7.d.ts +7 -0
  73. package/dist/mcp/exa.d.ts +6 -0
  74. package/dist/mcp/grep-app.d.ts +7 -0
  75. package/dist/mcp/index.d.ts +7 -0
  76. package/dist/mcp/thoth.d.ts +3 -0
  77. package/dist/mcp/types.d.ts +12 -0
  78. package/dist/sdd/artifact-governance/artifact-loader.d.ts +55 -0
  79. package/dist/sdd/artifact-governance/index.d.ts +6 -0
  80. package/dist/sdd/artifact-governance/tasks-validator.d.ts +17 -0
  81. package/dist/sdd/artifact-governance/types.d.ts +52 -0
  82. package/dist/thoth/client.d.ts +14 -0
  83. package/dist/thoth/index.d.ts +2 -0
  84. package/dist/tools/ast-grep/cli.d.ts +15 -0
  85. package/dist/tools/ast-grep/constants.d.ts +25 -0
  86. package/dist/tools/ast-grep/downloader.d.ts +5 -0
  87. package/dist/tools/ast-grep/index.d.ts +10 -0
  88. package/dist/tools/ast-grep/tools.d.ts +3 -0
  89. package/dist/tools/ast-grep/types.d.ts +30 -0
  90. package/dist/tools/ast-grep/utils.d.ts +4 -0
  91. package/dist/tools/index.d.ts +2 -0
  92. package/dist/tools/lsp/client.d.ts +42 -0
  93. package/dist/tools/lsp/config-store.d.ts +29 -0
  94. package/dist/tools/lsp/config.d.ts +4 -0
  95. package/dist/tools/lsp/constants.d.ts +25 -0
  96. package/dist/tools/lsp/index.d.ts +4 -0
  97. package/dist/tools/lsp/tools.d.ts +5 -0
  98. package/dist/tools/lsp/types.d.ts +35 -0
  99. package/dist/tools/lsp/utils.d.ts +34 -0
  100. package/dist/utils/agent-variant.d.ts +47 -0
  101. package/dist/utils/env.d.ts +1 -0
  102. package/dist/utils/file-io.d.ts +3 -0
  103. package/dist/utils/frontmatter-yaml.d.ts +4 -0
  104. package/dist/utils/index.d.ts +7 -0
  105. package/dist/utils/internal-initiator.d.ts +6 -0
  106. package/dist/utils/logger.d.ts +1 -0
  107. package/dist/utils/polling.d.ts +21 -0
  108. package/dist/utils/subprocess.d.ts +24 -0
  109. package/dist/utils/tmux-session-manager.d.ts +63 -0
  110. package/dist/utils/tmux.d.ts +32 -0
  111. package/dist/utils/zip-extractor.d.ts +1 -0
  112. package/package.json +81 -0
  113. package/src/skills/_shared/openspec-convention.md +131 -0
  114. package/src/skills/_shared/persistence-contract.md +162 -0
  115. package/src/skills/_shared/thoth-mem-convention.md +124 -0
  116. package/src/skills/executing-plans/SKILL.md +245 -0
  117. package/src/skills/plan-reviewer/SKILL.md +115 -0
  118. package/src/skills/requirements-interview/SKILL.md +212 -0
  119. package/src/skills/sdd-apply/SKILL.md +89 -0
  120. package/src/skills/sdd-archive/SKILL.md +87 -0
  121. package/src/skills/sdd-design/SKILL.md +92 -0
  122. package/src/skills/sdd-init/SKILL.md +148 -0
  123. package/src/skills/sdd-propose/SKILL.md +89 -0
  124. package/src/skills/sdd-spec/SKILL.md +93 -0
  125. package/src/skills/sdd-tasks/SKILL.md +142 -0
  126. package/src/skills/sdd-verify/SKILL.md +99 -0
  127. package/src/skills/thoth-mem-agents/SKILL.md +355 -0
  128. package/thoth-agents.schema.json +470 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,339 @@
1
+ <div align="center">
2
+ <img src="img/team.png" alt="thoth-agents agents" width="420">
3
+ <p><i>Seven specialized agents, one delegate-first workflow across supported harnesses.</i></p>
4
+ <p><b>thoth-agents</b> - Multi-harness orchestration - Thoth-mem persistence - Bundled SDD pipeline</p>
5
+ </div>
6
+
7
+ ---
8
+
9
+ thoth-agents is a delegate-first agent system for coding harnesses. It started
10
+ as an OpenCode plugin and now provides a shared seven-agent workflow for
11
+ OpenCode and Codex, with each harness getting the integration surface that fits
12
+ it best.
13
+
14
+ OpenCode remains the stable default path: native plugin install, native `task`
15
+ delegation, optional tmux monitoring, and generated config. Codex is supported
16
+ through an explicit agent-pack and Personal plugin setup path, with documented
17
+ trust review and instruction-level governance caveats where Codex does not
18
+ provide the same hard runtime controls.
19
+
20
+ ## What It Is
21
+
22
+ - A canonical seven-agent roster: `orchestrator`, `explorer`, `librarian`,
23
+ `oracle`, `designer`, `quick`, and `deep`.
24
+ - A delegate-first operating model that keeps the root coordinator focused on
25
+ decisions while specialists gather evidence, implement, review, and verify.
26
+ - A bundled requirements interview and SDD pipeline for moving from ambiguous
27
+ requests to planned, verified implementation.
28
+ - A thoth-mem integration for durable project memory, SDD artifacts, and
29
+ cross-session recovery.
30
+ - A multi-harness package that preserves OpenCode defaults while adding a
31
+ Codex setup path.
32
+
33
+ ## What It Is Not
34
+
35
+ - It is not a claim that every harness has identical runtime behavior.
36
+ - It is not a replacement for each harness's security, trust, sandbox, or
37
+ approval model.
38
+ - It does not rename the seven roles or require new visual assets.
39
+ - It does not make Codex tmux-aware; tmux integration is scoped to OpenCode
40
+ child `task` sessions.
41
+
42
+ ## Harness Support
43
+
44
+ | Harness | Status | Setup path | Notes |
45
+ | --- | --- | --- | --- |
46
+ | OpenCode | Stable default | `pnpm dlx thoth-agents@latest install` or `install --agent=opencode` | Native plugin config, native `task` delegation, optional tmux panes, OpenCode provider auth. |
47
+ | Codex | Supported explicit path | `pnpm dlx thoth-agents@latest install --agent=codex` | Installs ambient/root guidance, six role subagents, and a Personal plugin source. Requires `/plugins` and `/hooks` trust review. Some governance remains instruction-level. |
48
+
49
+ ## Quick Start
50
+
51
+ ### OpenCode
52
+
53
+ ```bash
54
+ pnpm dlx thoth-agents@latest install
55
+ pnpm dlx thoth-agents@latest install --agent=opencode
56
+ opencode auth login
57
+ opencode
58
+ ```
59
+
60
+ Then ask OpenCode to verify the roster:
61
+
62
+ ```text
63
+ ping all agents
64
+ ```
65
+
66
+ For non-interactive setup:
67
+
68
+ ```bash
69
+ pnpm dlx thoth-agents@latest install --no-tui --tmux=no --skills=yes
70
+ ```
71
+
72
+ ### Codex
73
+
74
+ Review the plan first, then install explicitly:
75
+
76
+ ```bash
77
+ pnpm dlx thoth-agents@latest install --agent=codex --dry-run
78
+ pnpm dlx thoth-agents@latest install --agent=codex
79
+ ```
80
+
81
+ Restart Codex and review plugin/hook trust:
82
+
83
+ ```text
84
+ /plugins
85
+ /hooks
86
+ ```
87
+
88
+ Codex install does not create a selectable orchestrator TOML, does not bypass
89
+ trust review, and does not make role permissions or memory governance hard
90
+ runtime guarantees unless Codex exposes those controls.
91
+
92
+ ### Reset Generated Config
93
+
94
+ ```bash
95
+ pnpm dlx thoth-agents@latest install --reset
96
+ ```
97
+
98
+ ## Seven-Agent Roster
99
+
100
+ The delegate-first philosophy is simple: the `orchestrator` coordinates while
101
+ specialists execute. Shared concepts are the same across harnesses, but the
102
+ dispatch mechanism is harness-bound. In OpenCode, specialists are launched with
103
+ the native `task` tool. In Codex, the installed role agents and plugin-bundled
104
+ skills provide the closest supported workflow, with some behavior enforced by
105
+ instructions rather than hard runtime APIs.
106
+
107
+ ### Primary Agent
108
+
109
+ <table width="100%">
110
+ <tr>
111
+ <td width="100%" valign="top">
112
+ <img src="img/orchestrator.png" width="100%" alt="Orchestrator">
113
+ <br>
114
+ <b>Orchestrator</b>
115
+ <br>
116
+ <i>Root coordinator and sole primary agent.</i>
117
+ <br><br>
118
+ <b>Role:</b> The root coordinator. Handles delegation, sequencing, memory ownership, requirements routing, and SDD progress tracking. Does not read or modify source files directly when running as the root coordinator.
119
+ <br>
120
+ <b>Mode:</b> primary, non-mutating
121
+ <br>
122
+ <b>Dispatch:</b> sync coordinator
123
+ <br>
124
+ <b>Recommended:</b>
125
+ <br>
126
+ <code>anthropic/claude-opus-4-6</code> - <code>openai/gpt-5.4</code> - <code>kimi-for-coding/k2p5</code>
127
+ <br>
128
+ <b>Personality:</b> Autonomous deep coordinator; owns decisions and works through specialists.
129
+ </td>
130
+ </tr>
131
+ </table>
132
+
133
+ ### Specialist Subagents
134
+
135
+ <table width="100%">
136
+ <tr>
137
+ <td width="33%" valign="top">
138
+ <img src="img/explorer.png" width="100%" alt="Explorer">
139
+ <br>
140
+ <b>Explorer</b>
141
+ <br>
142
+ <i>Fast local discovery.</i>
143
+ <br><br>
144
+ <b>Role:</b> Local codebase discovery and navigation. Finds files, symbols, references, constraints, and verification targets.
145
+ <br>
146
+ <b>Mode:</b> read-only
147
+ <br>
148
+ <b>Dispatch:</b> harness-bound specialist dispatch
149
+ <br>
150
+ <b>Recommended:</b>
151
+ <br>
152
+ <code>Grok Code Fast</code> - <code>openai/gpt-5.4-nano</code> - <code>anthropic/claude-haiku-4-5</code>
153
+ </td>
154
+ <td width="33%" valign="top">
155
+ <img src="img/librarian.png" width="100%" alt="Librarian">
156
+ <br>
157
+ <b>Librarian</b>
158
+ <br>
159
+ <i>External docs and examples.</i>
160
+ <br><br>
161
+ <b>Role:</b> External docs and API research. Validates version-specific behavior with official docs or public examples.
162
+ <br>
163
+ <b>Mode:</b> read-only
164
+ <br>
165
+ <b>Dispatch:</b> harness-bound specialist dispatch
166
+ <br>
167
+ <b>Recommended:</b>
168
+ <br>
169
+ <code>openai/gpt-5.4</code> - <code>anthropic/claude-sonnet-4-6</code> - <code>google/gemini-3.1-pro-preview</code>
170
+ </td>
171
+ <td width="33%" valign="top">
172
+ <img src="img/oracle.png" width="100%" alt="Oracle">
173
+ <br>
174
+ <b>Oracle</b>
175
+ <br>
176
+ <i>Deep review and diagnosis.</i>
177
+ <br><br>
178
+ <b>Role:</b> Strategic advisor for debugging, architecture review, code review, security/correctness risk, and SDD plan review.
179
+ <br>
180
+ <b>Mode:</b> read-only
181
+ <br>
182
+ <b>Dispatch:</b> synchronous advisory specialist
183
+ <br>
184
+ <b>Recommended:</b>
185
+ <br>
186
+ <code>openai/gpt-5.4</code> - <code>anthropic/claude-opus-4-6</code> - <code>opencode-go/glm-5</code>
187
+ </td>
188
+ </tr>
189
+ <tr>
190
+ <td width="33%" valign="top">
191
+ <img src="img/designer.png" width="100%" alt="Designer">
192
+ <br>
193
+ <b>Designer</b>
194
+ <br>
195
+ <i>UI, UX, frontend, and visual QA.</i>
196
+ <br><br>
197
+ <b>Role:</b> User-facing design and implementation. Owns visual decisions, browser checks, screenshots, and UX quality.
198
+ <br>
199
+ <b>Mode:</b> write-capable
200
+ <br>
201
+ <b>Dispatch:</b> synchronous implementation specialist
202
+ <br>
203
+ <b>Recommended:</b>
204
+ <br>
205
+ <code>google/gemini-3.1-pro-preview</code> - <code>opencode-go/glm-5</code> - <code>kimi-for-coding/k2p5</code>
206
+ </td>
207
+ <td width="33%" valign="top">
208
+ <img src="img/quick.png" width="100%" alt="Quick">
209
+ <br>
210
+ <b>Quick</b>
211
+ <br>
212
+ <i>Fast bounded implementation.</i>
213
+ <br><br>
214
+ <b>Role:</b> Narrow, mechanical, low-risk edits where the approach is already clear.
215
+ <br>
216
+ <b>Mode:</b> write-capable
217
+ <br>
218
+ <b>Dispatch:</b> synchronous implementation specialist
219
+ <br>
220
+ <b>Recommended:</b>
221
+ <br>
222
+ <code>openai/gpt-5.4-mini</code> - <code>anthropic/claude-haiku-4-5</code> - <code>google/gemini-3-flash-preview</code>
223
+ </td>
224
+ <td width="33%" valign="top">
225
+ <img src="img/deep.png" width="100%" alt="Deep">
226
+ <br>
227
+ <b>Deep</b>
228
+ <br>
229
+ <i>Thorough implementation and verification.</i>
230
+ <br><br>
231
+ <b>Role:</b> Correctness-critical, multi-file, edge-case-heavy implementation and verification.
232
+ <br>
233
+ <b>Mode:</b> write-capable
234
+ <br>
235
+ <b>Dispatch:</b> synchronous implementation specialist
236
+ <br>
237
+ <b>Recommended:</b>
238
+ <br>
239
+ <code>openai/gpt-5.4</code> - <code>anthropic/claude-opus-4-6</code> - <code>google/gemini-3.1-pro-preview</code>
240
+ </td>
241
+ </tr>
242
+ </table>
243
+
244
+ ## SDD And Memory
245
+
246
+ The bundled requirements interview is the front door for open-ended work. It
247
+ clarifies intent, assesses scope, asks for user approval when needed, and routes
248
+ work into direct implementation, accelerated SDD, or full SDD.
249
+
250
+ ```text
251
+ propose -> [spec || design] -> tasks -> apply -> verify -> archive
252
+ ```
253
+
254
+ For moderate work, the accelerated path usually runs `propose -> tasks`. For
255
+ high-risk or high-complexity work, the full path adds specification and design
256
+ artifacts before task execution.
257
+
258
+ Artifacts can be persisted in four modes:
259
+
260
+ | Mode | Writes to | Cost | Use when |
261
+ | --- | --- | --- | --- |
262
+ | `thoth-mem` | Memory only | Low | Fast iteration without repo planning files |
263
+ | `openspec` | `openspec/` files only | Medium | Reviewable planning artifacts in the repo |
264
+ | `hybrid` | Both | High | Maximum durability; default |
265
+ | `none` | Neither | Lowest | Ephemeral iterations, no persistence |
266
+
267
+ Thoth-mem is the local memory MCP used for durable observations, architectural
268
+ decisions, SDD artifacts, and session summaries. The core retrieval pattern is:
269
+
270
+ 1. `mem_search` for compact candidate records
271
+ 2. `mem_timeline` for chronological context
272
+ 3. `mem_get_observation` for the full selected record
273
+
274
+ ## Skills And MCPs
275
+
276
+ thoth-agents ships bundled skills for requirements discovery, plan review, SDD
277
+ planning/execution, verification, and archiving. It also registers MCP servers
278
+ for docs research, public code search, and local memory where the harness
279
+ supports that delivery surface.
280
+
281
+ | Surface | Shared concept | OpenCode binding | Codex binding |
282
+ | --- | --- | --- | --- |
283
+ | Skills | Requirements, SDD, review, execution workflows | Copied into the OpenCode skills directory when `--skills=yes` | Packaged as plugin-bundled skills for the Personal plugin source |
284
+ | MCPs | `exa`, `context7`, `grep_app`, `thoth_mem` | Registered by generated OpenCode plugin config | Packaged/configured only on validated Codex surfaces |
285
+ | Delegation | Seven-role specialist workflow | Native `task` tool | Custom agents plus prompt/plugin guidance |
286
+ | Blocking choices | Use a structured question surface | OpenCode `question` tool | `request_user_input` when enabled and available |
287
+
288
+ See [docs/skills-and-mcps.md](docs/skills-and-mcps.md) for the detailed matrix.
289
+
290
+ ## Documentation
291
+
292
+ - [Installation](docs/installation.md): OpenCode default setup, explicit Codex
293
+ setup, non-interactive installs, reset behavior, and troubleshooting.
294
+ - [Codex Install](docs/codex-install.md): Codex targets, backups, dry-run
295
+ behavior, trust review, and limitations.
296
+ - [Quick Reference](docs/quick-reference.md): Agent roster, SDD flow, memory,
297
+ delegation, tmux, and key config fields.
298
+ - [Skills and MCPs](docs/skills-and-mcps.md): Bundled skills, MCP servers, and
299
+ harness delivery surfaces.
300
+ - [Provider Configurations](docs/provider-configurations.md): OpenCode provider
301
+ presets, fallback chains, and Codex customization cross-links.
302
+ - [Tmux Integration](docs/tmux-integration.md): OpenCode-scoped live pane
303
+ monitoring for delegated `task` sessions.
304
+ - [SDD Pipeline](docs/sdd-pipeline.md): Planning and execution workflow details.
305
+ - [Codex Plugin Packaging](docs/codex-plugin-packaging.md): Codex plugin package
306
+ layout and packaging boundaries.
307
+ - [Codex Surface Validation](docs/codex-surface-validation.md): Validated,
308
+ unknown, and unsupported Codex generation surfaces.
309
+ - [Codex Model Customization](docs/codex-model-customization.md): Codex role
310
+ model defaults and customization limits.
311
+
312
+ ## Development
313
+
314
+ The OpenCode integration targets `@opencode-ai/plugin` and
315
+ `@opencode-ai/sdk` v1.4.7. The repository also contains Codex adapter and
316
+ packaging code for the multi-harness install path.
317
+
318
+ Use Node.js `>=22.13` with Corepack-managed `pnpm@11.2.2`:
319
+
320
+ ```bash
321
+ corepack enable
322
+ corepack prepare pnpm@11.2.2 --activate
323
+ pnpm install
324
+ ```
325
+
326
+ | Command | Purpose |
327
+ | --- | --- |
328
+ | `pnpm run build` | Build TypeScript into `dist/` and generate declarations/schema |
329
+ | `pnpm run typecheck` | Run TypeScript type checking without emit |
330
+ | `pnpm test` | Run the Vitest suite |
331
+ | `pnpm run lint` | Run Biome linter |
332
+ | `pnpm run format` | Run Biome formatter |
333
+ | `pnpm run check` | Run Biome check with auto-fix |
334
+ | `pnpm run check:ci` | Run Biome check without writes |
335
+ | `pnpm run dev` | Build and launch the OpenCode plugin in local dev mode |
336
+
337
+ ## License
338
+
339
+ MIT
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createDeepAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createDesignerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createExplorerAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,8 @@
1
+ import type { AgentConfig as SDKAgentConfig } from '@opencode-ai/sdk/v2';
2
+ import { type PluginConfig, SUBAGENT_NAMES } from '../config';
3
+ import { type AgentDefinition } from './orchestrator';
4
+ export type { AgentDefinition } from './orchestrator';
5
+ export type SubagentName = (typeof SUBAGENT_NAMES)[number];
6
+ export declare function isSubagent(name: string): name is SubagentName;
7
+ export declare function createAgents(config?: PluginConfig): AgentDefinition[];
8
+ export declare function getAgentConfigs(config?: PluginConfig): Record<string, SDKAgentConfig>;
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createLibrarianAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createOracleAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,15 @@
1
+ import type { AgentConfig } from '@opencode-ai/sdk/v2';
2
+ export interface AgentDefinition {
3
+ name: string;
4
+ description?: string;
5
+ config: AgentConfig;
6
+ /** Priority-ordered model entries for runtime fallback resolution. */
7
+ _modelArray?: Array<{
8
+ id: string;
9
+ variant?: string;
10
+ }>;
11
+ }
12
+ export declare function createOrchestratorAgent(model?: string | Array<string | {
13
+ id: string;
14
+ variant?: string;
15
+ }>, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,28 @@
1
+ import type { AgentDispatchMethod, AgentRoleName } from '../harness/core/agent-pack';
2
+ import type { HarnessCapabilities, HarnessId } from '../harness/types';
3
+ export type AgentPromptRole = AgentRoleName;
4
+ export interface ToolNomenclature {
5
+ delegationTool: string;
6
+ backgroundDelegationTool?: string;
7
+ backgroundStatusTool?: string;
8
+ userQuestionTool: string;
9
+ progressTool: string;
10
+ hostStatusSurface?: string;
11
+ roleReference(role: AgentPromptRole): string;
12
+ }
13
+ export interface CapabilityProfile {
14
+ capabilities: HarnessCapabilities;
15
+ renderCapabilityDisclosure(capability: keyof HarnessCapabilities): string | undefined;
16
+ }
17
+ export interface HarnessPromptDialect {
18
+ harness: HarnessId;
19
+ tools: ToolNomenclature;
20
+ capabilities: CapabilityProfile;
21
+ dispatchLabel(method: AgentDispatchMethod): string;
22
+ renderRoleInvocation(role: AgentPromptRole): string;
23
+ }
24
+ export declare const CODEX_PROMPT_CAPABILITIES: HarnessCapabilities;
25
+ export declare const OPENCODE_PROMPT_DIALECT: HarnessPromptDialect;
26
+ export declare const CODEX_PROMPT_DIALECT: HarnessPromptDialect;
27
+ export declare function getPromptDialect(harness: HarnessId): HarnessPromptDialect;
28
+ export declare function getPromptDialect(harness: string): HarnessPromptDialect;
@@ -0,0 +1,47 @@
1
+ import type { AgentPromptRole, HarnessPromptDialect } from './prompt-dialects';
2
+ import type { ModelEntry } from './prompt-utils';
3
+ type ModelFamily = 'openai' | 'claude' | 'gemini' | 'kimi' | 'glm';
4
+ export type SemanticMemoryAccess = 'base' | 'readonly' | 'writable';
5
+ export interface QuestionProtocolSection {
6
+ kind: 'question-protocol';
7
+ toolConcept: 'userQuestion';
8
+ }
9
+ export interface SubagentRulesSection {
10
+ kind: 'subagent-rules';
11
+ memoryAccess: SemanticMemoryAccess;
12
+ progressConcept: 'progress';
13
+ userQuestionConcept: 'userQuestion';
14
+ }
15
+ export interface ResponseBudgetSection {
16
+ kind: 'response-budget';
17
+ }
18
+ export interface StepBudgetSection {
19
+ kind: 'step-budget';
20
+ steps: number;
21
+ }
22
+ export interface ModelFamilySection {
23
+ kind: 'model-family';
24
+ role: AgentPromptRole;
25
+ family: ModelFamily;
26
+ }
27
+ export interface RoleTextSection {
28
+ kind: 'role-text';
29
+ template: string;
30
+ }
31
+ export type PromptSection = QuestionProtocolSection | SubagentRulesSection | ResponseBudgetSection | StepBudgetSection | ModelFamilySection | RoleTextSection;
32
+ export type RolePromptSection = PromptSection;
33
+ export interface PromptSectionRenderer<TSection extends PromptSection> {
34
+ render(section: TSection, dialect: HarnessPromptDialect): string;
35
+ }
36
+ export declare function createQuestionProtocolSection(): QuestionProtocolSection;
37
+ export declare function createSubagentRulesSection(memoryAccess?: SemanticMemoryAccess): SubagentRulesSection;
38
+ export declare function createResponseBudgetSection(): ResponseBudgetSection;
39
+ export declare function createStepBudgetSection(steps?: number): StepBudgetSection | undefined;
40
+ export declare function detectModelFamilyFromModel(model?: string | ModelEntry[]): ModelFamily | undefined;
41
+ export declare function createModelFamilySection(role: AgentPromptRole, model?: string | ModelEntry[]): ModelFamilySection | undefined;
42
+ export declare function createOrchestratorPromptSections(): RolePromptSection[];
43
+ export declare function createReadOnlySpecialistPromptSections(role: Extract<AgentPromptRole, 'explorer' | 'librarian' | 'oracle'>): RolePromptSection[];
44
+ export declare function createWriteCapableSpecialistPromptSections(role: Extract<AgentPromptRole, 'designer' | 'quick' | 'deep'>): RolePromptSection[];
45
+ export declare function renderPromptSection(section: PromptSection, dialect: HarnessPromptDialect): string;
46
+ export declare function renderRolePrompt(sections: RolePromptSection[], dialect: HarnessPromptDialect): string;
47
+ export {};
@@ -0,0 +1,25 @@
1
+ import { type AgentPromptRole } from './prompt-dialects';
2
+ export type { AgentPromptRole, CapabilityProfile, HarnessPromptDialect, ToolNomenclature, } from './prompt-dialects';
3
+ export type { ModelFamilySection, PromptSection, PromptSectionRenderer, QuestionProtocolSection, ResponseBudgetSection, RolePromptSection, RoleTextSection, SemanticMemoryAccess, StepBudgetSection, SubagentRulesSection, } from './prompt-sections';
4
+ interface ComposeAgentPromptOptions {
5
+ basePrompt: string;
6
+ customPrompt?: string;
7
+ customAppendPrompt?: string;
8
+ placeholders?: Record<string, string | number | undefined>;
9
+ }
10
+ type ModelFamily = 'openai' | 'claude' | 'gemini' | 'kimi' | 'glm';
11
+ export type ModelEntry = string | {
12
+ id: string;
13
+ variant?: string;
14
+ };
15
+ export declare const QUESTION_PROTOCOL: string;
16
+ export declare const SUBAGENT_RULES: string;
17
+ export declare const SUBAGENT_RULES_READONLY: string;
18
+ export declare const SUBAGENT_RULES_WRITABLE: string;
19
+ export declare const RESPONSE_BUDGET: string;
20
+ export declare function appendPromptSections(...sections: Array<string | undefined>): string;
21
+ export declare function detectModelFamily(model?: string | ModelEntry[]): ModelFamily | undefined;
22
+ export declare function getStepBudgetPromptSection(steps?: number): string | undefined;
23
+ export declare function getModelFamilyPromptSection(role: AgentPromptRole, model?: string | ModelEntry[]): string | undefined;
24
+ export declare function replacePromptPlaceholders(template: string, placeholders?: Record<string, string | number | undefined>): string;
25
+ export declare function composeAgentPrompt({ basePrompt, customPrompt, customAppendPrompt, placeholders, }: ComposeAgentPromptOptions): string;
@@ -0,0 +1,2 @@
1
+ import type { AgentDefinition } from './orchestrator';
2
+ export declare function createQuickAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
@@ -0,0 +1,31 @@
1
+ type TomlScalar = string | boolean | number;
2
+ type TomlArray = TomlScalar[];
3
+ interface TomlTable {
4
+ [key: string]: TomlValue;
5
+ }
6
+ type TomlValue = TomlScalar | TomlArray | TomlTable;
7
+ export type CodexTomlDocument = TomlTable;
8
+ export interface CodexConfigMergeResult {
9
+ success: boolean;
10
+ configPath: string;
11
+ backupPath?: string;
12
+ changed: boolean;
13
+ diffSummary: string[];
14
+ warnings: string[];
15
+ error?: string;
16
+ }
17
+ export declare function parseCodexToml(content: string): CodexTomlDocument;
18
+ export declare function renderCodexTomlDocument(document: CodexTomlDocument): string;
19
+ export declare function mergeCodexManagedConfig(document: CodexTomlDocument, options: {
20
+ pluginId?: string;
21
+ }): {
22
+ content: string;
23
+ diffSummary: string[];
24
+ warnings: string[];
25
+ };
26
+ export declare function writeCodexConfigMerge(options: {
27
+ configPath: string;
28
+ dryRun?: boolean;
29
+ pluginId?: string;
30
+ }): CodexConfigMergeResult;
31
+ export {};
@@ -0,0 +1,41 @@
1
+ import type { CodexInstallScope, CodexRoleName } from './codex-paths';
2
+ export { CODEX_ROLE_NAMES } from './codex-paths';
3
+ export type CodexSetupAction = 'merge-managed-block' | 'write-role-toml' | 'write-managed-model-state' | 'refresh-package' | 'merge-marketplace' | 'merge-toml' | 'diagnose-only';
4
+ export type CodexTargetKind = 'root-instructions' | 'role-subagent-toml' | 'managed-model-state' | 'user-config' | 'plugin-package' | 'personal-plugin-source' | 'personal-marketplace' | 'diagnostic';
5
+ export interface CodexInstallConfig {
6
+ dryRun?: boolean;
7
+ reset: boolean;
8
+ scope: CodexInstallScope;
9
+ projectRoot: string;
10
+ homeDir?: string;
11
+ codexHome?: string;
12
+ packageRoot?: string;
13
+ pluginId?: string;
14
+ }
15
+ export interface CodexSetupPlanItem {
16
+ kind: CodexTargetKind;
17
+ action: CodexSetupAction;
18
+ targetPath: string;
19
+ description: string;
20
+ requiresBackup: boolean;
21
+ content?: string;
22
+ role?: CodexRoleName;
23
+ }
24
+ export interface CodexSetupPlan {
25
+ dryRun: boolean;
26
+ reset: boolean;
27
+ items: CodexSetupPlanItem[];
28
+ diagnostics: string[];
29
+ disclaimers: string[];
30
+ configPath: string;
31
+ pluginId?: string;
32
+ }
33
+ export interface CodexApplyResult {
34
+ success: boolean;
35
+ changed: string[];
36
+ diagnostics: string[];
37
+ error?: string;
38
+ }
39
+ export declare function buildCodexSetupPlan(config: CodexInstallConfig): CodexSetupPlan;
40
+ export declare function formatCodexSetupPlan(plan: CodexSetupPlan): string;
41
+ export declare function applyCodexSetup(plan: CodexSetupPlan): CodexApplyResult;
@@ -0,0 +1,29 @@
1
+ export type CodexInstallScope = 'project' | 'user';
2
+ export type CodexRoleName = 'explorer' | 'librarian' | 'oracle' | 'designer' | 'quick' | 'deep';
3
+ export declare const CODEX_ROLE_NAMES: readonly ["explorer", "librarian", "oracle", "designer", "quick", "deep"];
4
+ export interface CodexTargetResolverOptions {
5
+ scope: CodexInstallScope;
6
+ projectRoot: string;
7
+ homeDir?: string;
8
+ codexHome?: string;
9
+ }
10
+ export interface CodexResolvedTargets {
11
+ scope: CodexInstallScope;
12
+ codexHome: string;
13
+ configPath: string;
14
+ rootInstructionsPath: string;
15
+ roleAgentPaths: {
16
+ role: CodexRoleName;
17
+ path: string;
18
+ }[];
19
+ managedModelsPath: string;
20
+ skillsDir: string;
21
+ packageRoot: string;
22
+ personalPluginRoot: string;
23
+ personalMarketplacePath: string;
24
+ }
25
+ export declare function getCodexHome(options?: {
26
+ homeDir?: string;
27
+ codexHome?: string;
28
+ }): string;
29
+ export declare function resolveCodexTargets(options: CodexTargetResolverOptions): CodexResolvedTargets;
@@ -0,0 +1,22 @@
1
+ import type { ConfigMergeResult, DetectedConfig, InstallConfig, OpenCodeConfig } from './types';
2
+ /**
3
+ * Strip JSON comments (single-line // and multi-line) and trailing commas for JSONC support.
4
+ */
5
+ export declare function stripJsonComments(json: string): string;
6
+ export declare function parseConfigFile(path: string): {
7
+ config: OpenCodeConfig | null;
8
+ error?: string;
9
+ };
10
+ export declare function parseConfig(path: string): {
11
+ config: OpenCodeConfig | null;
12
+ error?: string;
13
+ };
14
+ /**
15
+ * Write config to file atomically.
16
+ */
17
+ export declare function writeConfig(configPath: string, config: OpenCodeConfig): void;
18
+ export declare function addPluginToOpenCodeConfig(): Promise<ConfigMergeResult>;
19
+ export declare function writeLiteConfig(installConfig: InstallConfig, targetPath?: string): ConfigMergeResult;
20
+ export declare function disableDefaultAgents(): ConfigMergeResult;
21
+ export declare function canModifyOpenCodeConfig(): boolean;
22
+ export declare function detectCurrentConfig(): DetectedConfig;
@@ -0,0 +1,4 @@
1
+ export * from './config-io';
2
+ export * from './paths';
3
+ export * from './providers';
4
+ export * from './system';