thoth-agents 0.10.0 → 0.12.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.
- package/README.md +5 -3
- package/dist/agents/agent-config.d.ts +13 -0
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/orchestrator.d.ts +1 -1
- package/dist/{chunk-VHQMTZ5O.js → chunk-7F33WUSD.js} +1 -1
- package/dist/{chunk-RWQPMWEM.js → chunk-JLU3FSBT.js} +17 -2
- package/dist/chunk-MIDGZE34.js +107 -0
- package/dist/{chunk-RVQ6IIBR.js → chunk-NY2IPJ7V.js} +361 -118
- package/dist/{chunk-RN2ERZLZ.js → chunk-QOA2AETX.js} +2 -228
- package/dist/{chunk-6NZTNWI4.js → chunk-SEF6PFM6.js} +504 -211
- package/dist/cli/config-io.d.ts +2 -2
- package/dist/cli/index.js +92 -39
- package/dist/cli/install.d.ts +1 -0
- package/dist/cli/opencode-skill-consent.d.ts +5 -0
- package/dist/cli/operations/opencode.d.ts +2 -1
- package/dist/cli/operations/types.d.ts +1 -0
- package/dist/cli/owned-skills.d.ts +16 -0
- package/dist/cli/paths.d.ts +1 -1
- package/dist/cli/providers.d.ts +1 -1
- package/dist/cli/system.d.ts +3 -1
- package/dist/cli/thoth-mem-install.d.ts +10 -10
- package/dist/cli/tui/index.js +53 -5
- package/dist/cli/tui/operations.d.ts +2 -0
- package/dist/cli/types.d.ts +2 -4
- package/dist/config/loader.d.ts +1 -1
- package/dist/config/schema.d.ts +0 -31
- package/dist/harness/adapters/opencode.d.ts +1 -1
- package/dist/harness/core/agent-pack.d.ts +1 -0
- package/dist/harness/core/sdd.d.ts +6 -6
- package/dist/hooks/delegate-task-retry/hook.d.ts +8 -8
- package/dist/hooks/foreground-fallback/index.d.ts +14 -69
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/json-error-recovery/hook.d.ts +2 -15
- package/dist/hooks/oracle-gate-verdict/hook.d.ts +4 -11
- package/dist/index.d.ts +7 -4
- package/dist/index.js +822 -1421
- package/dist/opencode/agents.d.ts +3 -0
- package/dist/opencode/command.d.ts +3 -0
- package/dist/opencode/context.d.ts +20 -0
- package/dist/opencode/delegation-hooks.d.ts +3 -0
- package/dist/opencode/mcp.d.ts +3 -0
- package/dist/opencode/permission-rules.d.ts +9 -0
- package/dist/opencode/permissions.d.ts +3 -0
- package/dist/opencode/session-hooks.d.ts +3 -0
- package/dist/opencode/session-state.d.ts +39 -0
- package/dist/opencode/skills.d.ts +3 -0
- package/dist/opencode/tools.d.ts +3 -0
- package/dist/pi.js +3 -3
- package/dist/tools/ast-grep/cli.d.ts +1 -0
- package/dist/tools/ast-grep/index.d.ts +108 -2
- package/dist/tools/ast-grep/tools.d.ts +107 -3
- package/dist/tools/define-tool.d.ts +23 -0
- package/dist/tools/lsp/tools.d.ts +97 -5
- package/dist/utils/index.d.ts +0 -1
- package/package.json +14 -3
- package/pi/.thoth-agents-assets.json +2 -2
- package/pi/agents/thoth-designer.md +1 -1
- package/pi/agents/thoth-worker.md +1 -1
- package/plugin/.claude-plugin/.thoth-agents-plugin-assets.json +3 -3
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/.thoth-agents-plugin-assets.json +3 -3
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/agents/designer.md +1 -1
- package/plugin/agents/orchestrator.md +32 -32
- package/plugin/agents/worker.md +1 -1
- package/plugin/codex-hooks/payloads/designer.md +1 -1
- package/plugin/codex-hooks/payloads/root.md +32 -32
- package/plugin/codex-hooks/payloads/worker.md +1 -1
- package/plugin/skills/plan-reviewer/SKILL.md +5 -5
- package/plugin/skills/thoth-sdd/SKILL.md +33 -9
- package/plugin/skills/thoth-sdd/references/phases/checklist.md +1 -1
- package/plugin/skills/thoth-sdd/references/phases/clarify.md +1 -1
- package/plugin/skills/thoth-sdd/references/phases/converge.md +8 -1
- package/plugin/skills/thoth-sdd/references/phases/implement.md +5 -1
- package/plugin/skills/thoth-sdd/references/phases/plan.md +1 -1
- package/plugin/skills/thoth-sdd/references/phases/specify.md +1 -1
- package/plugin/skills/thoth-sdd/references/phases/tasks.md +1 -1
- package/plugin/skills/thoth-sdd/references/phases/verify.md +10 -3
- package/plugin/skills/thoth-sdd/scripts/validate-result.mjs +28 -2
- package/plugin/skills/thoth-sdd/templates/change.md +2 -1
- package/skills/plan-reviewer/SKILL.md +5 -5
- package/skills/thoth-sdd/SKILL.md +33 -9
- package/skills/thoth-sdd/references/phases/checklist.md +1 -1
- package/skills/thoth-sdd/references/phases/clarify.md +1 -1
- package/skills/thoth-sdd/references/phases/converge.md +8 -1
- package/skills/thoth-sdd/references/phases/implement.md +5 -1
- package/skills/thoth-sdd/references/phases/plan.md +1 -1
- package/skills/thoth-sdd/references/phases/specify.md +1 -1
- package/skills/thoth-sdd/references/phases/tasks.md +1 -1
- package/skills/thoth-sdd/references/phases/verify.md +10 -3
- package/skills/thoth-sdd/scripts/validate-result.mjs +28 -2
- package/skills/thoth-sdd/templates/change.md +2 -1
- package/thoth-agents.schema.json +0 -26
- package/dist/chunk-62L3ORXN.js +0 -30
- package/dist/delegation/project-id.d.ts +0 -10
- package/dist/hooks/auto-update-checker/checker.d.ts +0 -23
- package/dist/hooks/auto-update-checker/constants.d.ts +0 -11
- package/dist/hooks/auto-update-checker/index.d.ts +0 -17
- package/dist/hooks/auto-update-checker/types.d.ts +0 -22
- package/dist/utils/tmux-session-manager.d.ts +0 -63
- package/dist/utils/tmux.d.ts +0 -32
package/README.md
CHANGED
|
@@ -46,7 +46,10 @@ verification you can follow—without manually coordinating every agent.
|
|
|
46
46
|
- **Continuity between sessions.** Published installs include setup of
|
|
47
47
|
[thoth-mem](https://github.com/EremesNG/thoth-mem), the independent memory
|
|
48
48
|
companion for reusable decisions and project knowledge. thoth-mem owns its own
|
|
49
|
-
memory lifecycle, persistence, and storage; thoth-agents only invokes
|
|
49
|
+
memory lifecycle, persistence, and storage; thoth-agents only invokes
|
|
50
|
+
`npx -y "thoth-mem@>=0.7.0" setup <harness> --json` (adding `--plan` for
|
|
51
|
+
dry-run). Only exit 0 with `planned` for dry-run or `complete` for apply is
|
|
52
|
+
successful; see [provider outcomes](docs/installation.md#thoth-mem-companion-setup).
|
|
50
53
|
|
|
51
54
|
> [!NOTE]
|
|
52
55
|
> OpenCode is the CLI's default harness. Pi is our recommendation for the best
|
|
@@ -62,7 +65,7 @@ The commands below install at **global/user scope**.
|
|
|
62
65
|
|
|
63
66
|
| Harness | What you get | Install command |
|
|
64
67
|
| --- | --- | --- |
|
|
65
|
-
| <a href="https://github.com/anomalyco/opencode"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/opencode-dark.svg"><img src="https://svgl.app/library/opencode.svg" alt="OpenCode logo" width="48" height="48"></picture></a><br>**OpenCode** |
|
|
68
|
+
| <a href="https://github.com/anomalyco/opencode"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/opencode-dark.svg"><img src="https://svgl.app/library/opencode.svg" alt="OpenCode logo" width="48" height="48"></picture></a><br>**OpenCode** | OpenCode >=2.2.6 native v2 plugin, package skills, agent team, and memory setup. | `npx thoth-agents@latest install --agent=opencode` |
|
|
66
69
|
| <a href="https://github.com/openai/codex"><img src="https://github.com/openai.png?size=120" alt="OpenAI logo — Codex" width="48" height="48"></a><br>**Codex** | Native plugin plus the required global agent and instruction setup. **Close Codex first.** | `npx thoth-agents@latest install --agent=codex` |
|
|
67
70
|
| <a href="https://claude.com/product/claude-code"><img src="https://github.com/anthropics.png?size=120" alt="Anthropic logo — Claude Code" width="48" height="48"></a><br>**Claude Code** | Marketplace agents and skills, completed by the CLI's external skills and memory setup. | `npx thoth-agents@latest install --agent=claude` |
|
|
68
71
|
| <a href="https://github.com/earendil-works/pi"><img src="https://raw.githubusercontent.com/EremesNG/thoth-mem/master/img/pi.svg" alt="Pi logo" width="48" height="48"></a><br>**Pi** | Native package, five specialists, delegation, research, theme, sidebar and background-task extensions, workflow skills, and memory setup. **Recommended for the best experience.** | `npx thoth-agents@latest install --agent=pi` |
|
|
@@ -386,7 +389,6 @@ visible foreign-overlay focus. See [question controls](pi-packages/pi-questions-
|
|
|
386
389
|
| [Codex Model Customization](docs/codex-model-customization.md) | Adjust Codex specialist models. |
|
|
387
390
|
| [Claude Code Install](docs/claude-code-install.md) | Follow marketplace setup and activation. |
|
|
388
391
|
| [Pi Setup](docs/installation.md#pi) | Check Pi dependencies, permissions, and recovery steps. |
|
|
389
|
-
| [Tmux Integration](docs/tmux-integration.md) | Configure OpenCode's optional terminal-pane integration. |
|
|
390
392
|
|
|
391
393
|
### Technical guides
|
|
392
394
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Internal role-rendering input; translated to the host's v2 Agent.Info at registration. */
|
|
2
|
+
export interface AgentConfig {
|
|
3
|
+
model?: string;
|
|
4
|
+
variant?: string;
|
|
5
|
+
temperature?: number;
|
|
6
|
+
prompt?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
mode?: 'primary' | 'subagent' | 'all';
|
|
9
|
+
hidden?: boolean;
|
|
10
|
+
color?: string;
|
|
11
|
+
steps?: number;
|
|
12
|
+
permission?: 'allow' | 'ask' | 'deny' | Record<string, 'allow' | 'ask' | 'deny' | Record<string, 'allow' | 'ask' | 'deny'>>;
|
|
13
|
+
}
|
package/dist/agents/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AgentConfig as SDKAgentConfig } from '@opencode-ai/sdk/v2';
|
|
2
1
|
import { type PluginConfig, SUBAGENT_NAMES } from '../config';
|
|
2
|
+
import type { AgentConfig as SDKAgentConfig } from './agent-config';
|
|
3
3
|
import { type AgentDefinition } from './orchestrator';
|
|
4
4
|
export type { AgentDefinition } from './orchestrator';
|
|
5
5
|
export type SubagentName = (typeof SUBAGENT_NAMES)[number];
|
|
@@ -332,12 +332,27 @@ function checkExpectations(options, issue) {
|
|
|
332
332
|
"Expected digest must be 64 lowercase hex characters."
|
|
333
333
|
);
|
|
334
334
|
}
|
|
335
|
+
var isFenceLine = (line) => /^(?:`{3,}|~{3,})/.test(line);
|
|
336
|
+
var isVerdictLine = (line) => line.startsWith("thoth-gate-verdict ");
|
|
337
|
+
function unwrapSubagent(message, lines) {
|
|
338
|
+
if (!message.startsWith("<subagent ")) return message;
|
|
339
|
+
if (lines.at(-1) !== "</subagent>") return "";
|
|
340
|
+
const opener = lines.lastIndexOf("```thoth-result");
|
|
341
|
+
if (opener < 1) return "";
|
|
342
|
+
const header = lines.slice(0, opener).join("\n").trimEnd();
|
|
343
|
+
if (!header.includes('state="completed"') || lines.slice(0, opener).some((line) => isFenceLine(line) || isVerdictLine(line)))
|
|
344
|
+
return "";
|
|
345
|
+
return lines.slice(opener, -1).join("\n").trim();
|
|
346
|
+
}
|
|
335
347
|
function parseEnvelope(message) {
|
|
336
|
-
const
|
|
348
|
+
const complete = typeof message === "string" ? message.trim() : "";
|
|
349
|
+
const lines = complete.split(/\r\n|\r|\n/);
|
|
350
|
+
const singleEnvelope = lines.filter(isFenceLine).length === 2 && !lines.some(isVerdictLine);
|
|
351
|
+
const trimmed = singleEnvelope ? unwrapSubagent(complete, lines) : "";
|
|
337
352
|
const block = new RegExp(
|
|
338
353
|
`^\`\`\`${result_contract_default.fence}\\r?\\n([\\s\\S]*?)\\r?\\n\`\`\`$`
|
|
339
354
|
).exec(trimmed);
|
|
340
|
-
if (!block
|
|
355
|
+
if (!block) {
|
|
341
356
|
return {
|
|
342
357
|
issues: [
|
|
343
358
|
{
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// src/mcp/context7.ts
|
|
2
|
+
var CONTEXT7_MCP_URL = "https://mcp.context7.com/mcp";
|
|
3
|
+
var context7 = {
|
|
4
|
+
type: "remote",
|
|
5
|
+
url: CONTEXT7_MCP_URL,
|
|
6
|
+
headers: process.env.CONTEXT7_API_KEY ? { CONTEXT7_API_KEY: process.env.CONTEXT7_API_KEY } : void 0,
|
|
7
|
+
oauth: false
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// src/mcp/exa.ts
|
|
11
|
+
var exa = {
|
|
12
|
+
type: "local",
|
|
13
|
+
command: ["npx", "-y", "exa-mcp-server"]
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// src/mcp/grep-app.ts
|
|
17
|
+
var GREP_APP_MCP_URL = "https://mcp.grep.app";
|
|
18
|
+
var grep_app = {
|
|
19
|
+
type: "remote",
|
|
20
|
+
url: GREP_APP_MCP_URL,
|
|
21
|
+
oauth: false
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// src/utils/subprocess.ts
|
|
25
|
+
import {
|
|
26
|
+
spawn as nodeSpawn,
|
|
27
|
+
spawnSync as nodeSpawnSync
|
|
28
|
+
} from "child_process";
|
|
29
|
+
import { Readable } from "stream";
|
|
30
|
+
function emptyReadableStream() {
|
|
31
|
+
return new ReadableStream({
|
|
32
|
+
start(controller) {
|
|
33
|
+
controller.close();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function toWebReadable(stream) {
|
|
38
|
+
if (!stream) {
|
|
39
|
+
return emptyReadableStream();
|
|
40
|
+
}
|
|
41
|
+
return Readable.toWeb(
|
|
42
|
+
stream
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
function fallbackStdin() {
|
|
46
|
+
return {
|
|
47
|
+
write: () => void 0,
|
|
48
|
+
end: () => void 0
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function spawn(command, options = {}) {
|
|
52
|
+
const child = nodeSpawn(command[0], command.slice(1), {
|
|
53
|
+
cwd: options.cwd,
|
|
54
|
+
env: options.env,
|
|
55
|
+
stdio: [
|
|
56
|
+
options.stdin ?? "pipe",
|
|
57
|
+
options.stdout ?? "pipe",
|
|
58
|
+
options.stderr ?? "pipe"
|
|
59
|
+
],
|
|
60
|
+
shell: options.shell,
|
|
61
|
+
windowsHide: options.windowsHide ?? true
|
|
62
|
+
});
|
|
63
|
+
const managed = {
|
|
64
|
+
stdin: child.stdin ?? fallbackStdin(),
|
|
65
|
+
stdout: toWebReadable(child.stdout),
|
|
66
|
+
stderr: toWebReadable(child.stderr),
|
|
67
|
+
exited: new Promise((resolve) => {
|
|
68
|
+
child.on("exit", (code) => {
|
|
69
|
+
managed.exitCode = code;
|
|
70
|
+
resolve(code ?? 1);
|
|
71
|
+
});
|
|
72
|
+
child.on("error", () => {
|
|
73
|
+
managed.exitCode = 1;
|
|
74
|
+
resolve(1);
|
|
75
|
+
});
|
|
76
|
+
}),
|
|
77
|
+
exitCode: child.exitCode,
|
|
78
|
+
kill: () => {
|
|
79
|
+
child.kill();
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
return managed;
|
|
83
|
+
}
|
|
84
|
+
function spawnSync(command, options = {}) {
|
|
85
|
+
const result = nodeSpawnSync(command[0], command.slice(1), {
|
|
86
|
+
cwd: options.cwd,
|
|
87
|
+
env: options.env,
|
|
88
|
+
stdio: [
|
|
89
|
+
options.stdin ?? "ignore",
|
|
90
|
+
options.stdout ?? "pipe",
|
|
91
|
+
options.stderr ?? "pipe"
|
|
92
|
+
],
|
|
93
|
+
shell: options.shell,
|
|
94
|
+
windowsHide: options.windowsHide ?? true
|
|
95
|
+
});
|
|
96
|
+
return { exitCode: result.status };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export {
|
|
100
|
+
CONTEXT7_MCP_URL,
|
|
101
|
+
context7,
|
|
102
|
+
exa,
|
|
103
|
+
GREP_APP_MCP_URL,
|
|
104
|
+
grep_app,
|
|
105
|
+
spawn,
|
|
106
|
+
spawnSync
|
|
107
|
+
};
|