thoth-agents 0.1.19 → 0.2.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.
- package/README.md +41 -9
- package/dist/agents/prompt-dialects.d.ts +9 -0
- package/dist/{chunk-2SGSRR6L.js → chunk-3NOVCFN7.js} +61 -3
- package/dist/chunk-4WYCZ5Z7.js +698 -0
- package/dist/{chunk-7CTSLCEU.js → chunk-FRZZ25ND.js} +1450 -310
- package/dist/cli/claude-code-install.d.ts +53 -0
- package/dist/cli/claude-code-paths.d.ts +31 -0
- package/dist/cli/codex-install.d.ts +1 -5
- package/dist/cli/commands.d.ts +1 -1
- package/dist/cli/index.js +85 -27
- package/dist/cli/managed-state-io.d.ts +16 -0
- package/dist/cli/operations/claude-code.d.ts +21 -0
- package/dist/cli/tui/index.js +87 -9
- package/dist/cli/tui/operations.d.ts +2 -0
- package/dist/cli/types.d.ts +3 -3
- package/dist/config/index.d.ts +1 -1
- package/dist/config/schema.d.ts +11 -0
- package/dist/config/utils.d.ts +5 -0
- package/dist/harness/adapters/claude-code.d.ts +24 -0
- package/dist/harness/core/package-version.d.ts +7 -0
- package/dist/harness/types.d.ts +1 -1
- package/dist/harness/writers/claude-code-plugin-package.d.ts +32 -0
- package/dist/harness/writers/claude-code-skill-layout.d.ts +16 -0
- package/dist/harness/writers/claude-code-subagent.d.ts +26 -0
- package/dist/harness/writers/fs-skill-collect.d.ts +7 -0
- package/dist/index.js +4 -476
- package/package.json +1 -1
- package/thoth-agents.schema.json +16 -0
- package/dist/chunk-DYGVRAMS.js +0 -182
package/README.md
CHANGED
|
@@ -15,14 +15,16 @@
|
|
|
15
15
|
|
|
16
16
|
thoth-agents is a delegate-first agent system for coding harnesses. It started
|
|
17
17
|
as an OpenCode plugin and now provides a shared seven-agent workflow for
|
|
18
|
-
OpenCode and
|
|
19
|
-
it best.
|
|
18
|
+
OpenCode, Codex, and Claude Code, with each harness getting the integration
|
|
19
|
+
surface that fits it best.
|
|
20
20
|
|
|
21
21
|
OpenCode remains the stable default path: native plugin install, native `task`
|
|
22
22
|
delegation, optional tmux monitoring, and generated config. Codex is supported
|
|
23
23
|
through an explicit agent-pack and Personal plugin setup path, with documented
|
|
24
24
|
trust review and instruction-level governance caveats where Codex does not
|
|
25
|
-
provide the same hard runtime controls.
|
|
25
|
+
provide the same hard runtime controls. Claude Code is a first-class path: a
|
|
26
|
+
single auto-discovered plugin package with native subagents, harness-enforced
|
|
27
|
+
hooks, MCP, skills, and per-agent tool permissions.
|
|
26
28
|
|
|
27
29
|
## What It Is
|
|
28
30
|
|
|
@@ -52,6 +54,7 @@ provide the same hard runtime controls.
|
|
|
52
54
|
| --- | --- | --- | --- |
|
|
53
55
|
| OpenCode | Stable default | `npx thoth-agents@latest install` or `npx thoth-agents@latest install --agent=opencode` | Native plugin config, native `task` delegation, optional tmux panes, OpenCode provider auth. |
|
|
54
56
|
| Codex | Supported explicit path | `npx 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. |
|
|
57
|
+
| Claude Code | Supported first-class path | `npx thoth-agents@latest install --agent=claude` | Installs one Claude Code plugin: six specialist subagents (`Task(subagent_type: ...)`), an `orchestrator` agent activated as the main thread via `settings.json`, `.mcp.json`, and bundled skills. Role permissions are enforced by subagent `tools`. |
|
|
55
58
|
|
|
56
59
|
OpenCode can load the plugin with:
|
|
57
60
|
|
|
@@ -123,6 +126,35 @@ Codex install does not create a selectable orchestrator TOML, does not bypass
|
|
|
123
126
|
trust review, and does not make role permissions or memory governance hard
|
|
124
127
|
runtime guarantees unless Codex exposes those controls.
|
|
125
128
|
|
|
129
|
+
### Claude Code
|
|
130
|
+
|
|
131
|
+
Preview, then install the plugin package:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
npx thoth-agents@latest install --agent=claude --dry-run
|
|
135
|
+
npx thoth-agents@latest install --agent=claude
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
This writes a single Claude Code **skills-directory plugin** under
|
|
139
|
+
`~/.claude/skills/thoth-agents`: `.claude-plugin/plugin.json`, seven
|
|
140
|
+
auto-discovered agents in `agents/` (six specialists + an `orchestrator`), an
|
|
141
|
+
`.mcp.json` server map, bundled `skills/`, and a plugin-root `settings.json`
|
|
142
|
+
with `{ "agent": "orchestrator" }`. That `agent` key activates the orchestrator
|
|
143
|
+
as the **main thread** — replacing the default system prompt — so the session
|
|
144
|
+
starts in delegate-first mode and bootstraps thoth-mem on its first turn. It
|
|
145
|
+
auto-loads as `thoth-agents@skills-dir` on the next session (no marketplace or
|
|
146
|
+
install step); restart Claude Code or run `/reload-plugins` to activate it
|
|
147
|
+
(confirm in `/plugin` → Installed). The orchestrator delegates to specialists
|
|
148
|
+
with `Task(subagent_type: explorer|librarian|oracle|designer|quick|deep)`. Role
|
|
149
|
+
permissions are enforced through each specialist's frontmatter `tools` allowlist.
|
|
150
|
+
You can also emit the package without installing it:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
npx thoth-agents@latest generate --harness=claude --dry-run
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
See [docs/claude-code-plugin-packaging.md](docs/claude-code-plugin-packaging.md).
|
|
157
|
+
|
|
126
158
|
### Reset Generated Config
|
|
127
159
|
|
|
128
160
|
```bash
|
|
@@ -323,12 +355,12 @@ planning/execution, verification, and archiving. It also registers MCP servers
|
|
|
323
355
|
for docs research, public code search, and local memory where the harness
|
|
324
356
|
supports that delivery surface.
|
|
325
357
|
|
|
326
|
-
| Surface | Shared concept | OpenCode binding | Codex binding |
|
|
327
|
-
| --- | --- | --- | --- |
|
|
328
|
-
| 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 |
|
|
329
|
-
| MCPs | `exa`, `context7`, `grep_app`, `thoth_mem` | Registered by generated OpenCode plugin config | Packaged/configured only on validated Codex surfaces |
|
|
330
|
-
| Delegation | Seven-role specialist workflow | Native `task` tool | Custom agents plus prompt/plugin guidance |
|
|
331
|
-
| Blocking choices | Use a structured question surface | OpenCode `question` tool | `request_user_input` when enabled and available |
|
|
358
|
+
| Surface | Shared concept | OpenCode binding | Codex binding | Claude Code binding |
|
|
359
|
+
| --- | --- | --- | --- | --- |
|
|
360
|
+
| 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 | Bundled in the plugin `skills/` directory |
|
|
361
|
+
| MCPs | `exa`, `context7`, `grep_app`, `thoth_mem` | Registered by generated OpenCode plugin config | Packaged/configured only on validated Codex surfaces | Bundled in the plugin `.mcp.json` (`type: "http"` for URL servers) |
|
|
362
|
+
| Delegation | Seven-role specialist workflow | Native `task` tool | Custom agents plus prompt/plugin guidance | Native `Task(subagent_type: ...)` over auto-discovered subagents |
|
|
363
|
+
| Blocking choices | Use a structured question surface | OpenCode `question` tool | `request_user_input` when enabled and available | `AskUserQuestion` tool |
|
|
332
364
|
|
|
333
365
|
See [docs/skills-and-mcps.md](docs/skills-and-mcps.md) for the detailed matrix.
|
|
334
366
|
|
|
@@ -22,7 +22,16 @@ export interface HarnessPromptDialect {
|
|
|
22
22
|
renderRoleInvocation(role: AgentPromptRole): string;
|
|
23
23
|
}
|
|
24
24
|
export declare const CODEX_PROMPT_CAPABILITIES: HarnessCapabilities;
|
|
25
|
+
export declare const CLAUDE_CODE_PROMPT_CAPABILITIES: HarnessCapabilities;
|
|
25
26
|
export declare const OPENCODE_PROMPT_DIALECT: HarnessPromptDialect;
|
|
26
27
|
export declare const CODEX_PROMPT_DIALECT: HarnessPromptDialect;
|
|
28
|
+
/**
|
|
29
|
+
* Claude Code registers plugin subagents under the plugin name as a namespace,
|
|
30
|
+
* so the `subagent_type` for delegation is `thoth-agents:<role>`, not the bare
|
|
31
|
+
* role name. This must match the plugin manifest `name`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const CLAUDE_CODE_SUBAGENT_NAMESPACE = "thoth-agents";
|
|
34
|
+
export declare function claudeCodeSubagentType(role: AgentPromptRole): string;
|
|
35
|
+
export declare const CLAUDE_CODE_PROMPT_DIALECT: HarnessPromptDialect;
|
|
27
36
|
export declare function getPromptDialect(harness: HarnessId): HarnessPromptDialect;
|
|
28
37
|
export declare function getPromptDialect(harness: string): HarnessPromptDialect;
|
|
@@ -459,6 +459,11 @@ var CodexGenerationConfigSchema = z.object({
|
|
|
459
459
|
outputRoot: z.string().optional(),
|
|
460
460
|
dryRun: z.boolean().default(true)
|
|
461
461
|
});
|
|
462
|
+
var ClaudeCodeGenerationConfigSchema = z.object({
|
|
463
|
+
enabled: z.boolean().default(false),
|
|
464
|
+
outputRoot: z.string().optional(),
|
|
465
|
+
dryRun: z.boolean().default(true)
|
|
466
|
+
});
|
|
462
467
|
var FailoverConfigSchema = z.object({
|
|
463
468
|
enabled: z.boolean().default(true),
|
|
464
469
|
timeoutMs: z.number().min(0).default(15e3),
|
|
@@ -479,7 +484,8 @@ var PluginConfigSchema = z.object({
|
|
|
479
484
|
fallback: FailoverConfigSchema.optional(),
|
|
480
485
|
thoth: ThothConfigSchema.optional(),
|
|
481
486
|
artifactStore: ArtifactStoreConfigSchema.optional(),
|
|
482
|
-
codex: CodexGenerationConfigSchema.optional()
|
|
487
|
+
codex: CodexGenerationConfigSchema.optional(),
|
|
488
|
+
claudeCode: ClaudeCodeGenerationConfigSchema.optional()
|
|
483
489
|
});
|
|
484
490
|
|
|
485
491
|
// src/config/loader.ts
|
|
@@ -653,6 +659,13 @@ function getAgentOverride(config, name) {
|
|
|
653
659
|
const overrides = config?.agents ?? {};
|
|
654
660
|
return overrides[name] ?? overrides[Object.keys(AGENT_ALIASES).find((k) => AGENT_ALIASES[k] === name) ?? ""];
|
|
655
661
|
}
|
|
662
|
+
function getPrimaryModelId(model) {
|
|
663
|
+
if (Array.isArray(model)) {
|
|
664
|
+
const first = model[0];
|
|
665
|
+
return typeof first === "string" ? first : first?.id;
|
|
666
|
+
}
|
|
667
|
+
return model;
|
|
668
|
+
}
|
|
656
669
|
|
|
657
670
|
// src/agents/prompt-dialects.ts
|
|
658
671
|
var OPENCODE_CAPABILITIES = {
|
|
@@ -677,6 +690,17 @@ var CODEX_PROMPT_CAPABILITIES = {
|
|
|
677
690
|
parentContextInjection: "instruction-only",
|
|
678
691
|
memoryGovernanceEnforcement: "instruction-only"
|
|
679
692
|
};
|
|
693
|
+
var CLAUDE_CODE_PROMPT_CAPABILITIES = {
|
|
694
|
+
agentDefinitions: "supported",
|
|
695
|
+
delegatedExecution: "supported",
|
|
696
|
+
parallelDelegation: "supported",
|
|
697
|
+
runtimeHooks: "supported",
|
|
698
|
+
mcpConfiguration: "supported",
|
|
699
|
+
skillPackaging: "supported",
|
|
700
|
+
rolePermissions: "supported",
|
|
701
|
+
parentContextInjection: "supported",
|
|
702
|
+
memoryGovernanceEnforcement: "supported"
|
|
703
|
+
};
|
|
680
704
|
function supportedCapabilityProfile(capabilities) {
|
|
681
705
|
return {
|
|
682
706
|
capabilities,
|
|
@@ -748,6 +772,36 @@ var CODEX_PROMPT_DIALECT = {
|
|
|
748
772
|
return role === "orchestrator" ? "orchestrator role agent" : `${role} subagent`;
|
|
749
773
|
}
|
|
750
774
|
};
|
|
775
|
+
var CLAUDE_CODE_SUBAGENT_NAMESPACE = "thoth-agents";
|
|
776
|
+
function claudeCodeSubagentType(role) {
|
|
777
|
+
return `${CLAUDE_CODE_SUBAGENT_NAMESPACE}:${role}`;
|
|
778
|
+
}
|
|
779
|
+
var CLAUDE_CODE_PROMPT_DIALECT = {
|
|
780
|
+
harness: "claude",
|
|
781
|
+
tools: {
|
|
782
|
+
delegationTool: "Task",
|
|
783
|
+
backgroundDelegationTool: "Task(run_in_background=true)",
|
|
784
|
+
backgroundStatusTool: "TaskOutput",
|
|
785
|
+
userQuestionTool: "AskUserQuestion",
|
|
786
|
+
progressTool: "TodoWrite",
|
|
787
|
+
hostStatusSurface: "TodoWrite",
|
|
788
|
+
roleReference: (role) => role === "orchestrator" ? "the main-thread orchestrator" : `Task(subagent_type: ${claudeCodeSubagentType(role)})`
|
|
789
|
+
},
|
|
790
|
+
capabilities: supportedCapabilityProfile(CLAUDE_CODE_PROMPT_CAPABILITIES),
|
|
791
|
+
dispatchLabel(method) {
|
|
792
|
+
switch (method) {
|
|
793
|
+
case "root-coordinator":
|
|
794
|
+
return "main-session coordinator";
|
|
795
|
+
case "task":
|
|
796
|
+
return "Task tool";
|
|
797
|
+
case "synchronous-task-only":
|
|
798
|
+
return "synchronous Task only";
|
|
799
|
+
}
|
|
800
|
+
},
|
|
801
|
+
renderRoleInvocation(role) {
|
|
802
|
+
return role === "orchestrator" ? "main-thread orchestrator" : claudeCodeSubagentType(role);
|
|
803
|
+
}
|
|
804
|
+
};
|
|
751
805
|
|
|
752
806
|
// src/harness/core/sdd.ts
|
|
753
807
|
var SDD_PHASES = [
|
|
@@ -954,7 +1008,7 @@ function createStepBudgetSection(steps) {
|
|
|
954
1008
|
return { kind: "step-budget", steps };
|
|
955
1009
|
}
|
|
956
1010
|
function detectModelFamilyFromModel(model) {
|
|
957
|
-
const id =
|
|
1011
|
+
const id = getPrimaryModelId2(model)?.toLowerCase();
|
|
958
1012
|
if (!id) {
|
|
959
1013
|
return void 0;
|
|
960
1014
|
}
|
|
@@ -1358,7 +1412,7 @@ For non-SDD work: summary + files changed + verification results + edge cases co
|
|
|
1358
1412
|
- Target: under 40 lines total.`
|
|
1359
1413
|
});
|
|
1360
1414
|
}
|
|
1361
|
-
function
|
|
1415
|
+
function getPrimaryModelId2(model) {
|
|
1362
1416
|
if (Array.isArray(model)) {
|
|
1363
1417
|
const first = model[0];
|
|
1364
1418
|
return typeof first === "string" ? first : first?.id;
|
|
@@ -2126,8 +2180,12 @@ export {
|
|
|
2126
2180
|
loadPluginConfig,
|
|
2127
2181
|
loadAgentPrompt,
|
|
2128
2182
|
getAgentOverride,
|
|
2183
|
+
getPrimaryModelId,
|
|
2129
2184
|
OPENCODE_PROMPT_DIALECT,
|
|
2130
2185
|
CODEX_PROMPT_DIALECT,
|
|
2186
|
+
CLAUDE_CODE_SUBAGENT_NAMESPACE,
|
|
2187
|
+
claudeCodeSubagentType,
|
|
2188
|
+
CLAUDE_CODE_PROMPT_DIALECT,
|
|
2131
2189
|
createStepBudgetSection,
|
|
2132
2190
|
createModelFamilySection,
|
|
2133
2191
|
createOrchestratorPromptSections,
|