thoth-agents 0.11.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.
Files changed (68) hide show
  1. package/README.md +5 -3
  2. package/dist/agents/agent-config.d.ts +13 -0
  3. package/dist/agents/index.d.ts +1 -1
  4. package/dist/agents/orchestrator.d.ts +1 -1
  5. package/dist/{chunk-5WPP6IY7.js → chunk-7F33WUSD.js} +1 -1
  6. package/dist/{chunk-RWQPMWEM.js → chunk-JLU3FSBT.js} +17 -2
  7. package/dist/chunk-MIDGZE34.js +107 -0
  8. package/dist/{chunk-DNPKVFOB.js → chunk-NY2IPJ7V.js} +78 -87
  9. package/dist/{chunk-HACUJFKI.js → chunk-QOA2AETX.js} +2 -228
  10. package/dist/{chunk-I5TXGNSG.js → chunk-SEF6PFM6.js} +504 -211
  11. package/dist/cli/config-io.d.ts +2 -2
  12. package/dist/cli/index.js +92 -39
  13. package/dist/cli/install.d.ts +1 -0
  14. package/dist/cli/opencode-skill-consent.d.ts +5 -0
  15. package/dist/cli/operations/opencode.d.ts +2 -1
  16. package/dist/cli/operations/types.d.ts +1 -0
  17. package/dist/cli/owned-skills.d.ts +16 -0
  18. package/dist/cli/paths.d.ts +1 -1
  19. package/dist/cli/providers.d.ts +1 -1
  20. package/dist/cli/system.d.ts +3 -1
  21. package/dist/cli/thoth-mem-install.d.ts +10 -10
  22. package/dist/cli/tui/index.js +53 -5
  23. package/dist/cli/tui/operations.d.ts +2 -0
  24. package/dist/cli/types.d.ts +2 -4
  25. package/dist/config/loader.d.ts +1 -1
  26. package/dist/config/schema.d.ts +0 -31
  27. package/dist/harness/adapters/opencode.d.ts +1 -1
  28. package/dist/hooks/delegate-task-retry/hook.d.ts +8 -8
  29. package/dist/hooks/foreground-fallback/index.d.ts +14 -69
  30. package/dist/hooks/index.d.ts +0 -2
  31. package/dist/hooks/json-error-recovery/hook.d.ts +2 -15
  32. package/dist/hooks/oracle-gate-verdict/hook.d.ts +4 -11
  33. package/dist/index.d.ts +7 -4
  34. package/dist/index.js +822 -1421
  35. package/dist/opencode/agents.d.ts +3 -0
  36. package/dist/opencode/command.d.ts +3 -0
  37. package/dist/opencode/context.d.ts +20 -0
  38. package/dist/opencode/delegation-hooks.d.ts +3 -0
  39. package/dist/opencode/mcp.d.ts +3 -0
  40. package/dist/opencode/permission-rules.d.ts +9 -0
  41. package/dist/opencode/permissions.d.ts +3 -0
  42. package/dist/opencode/session-hooks.d.ts +3 -0
  43. package/dist/opencode/session-state.d.ts +39 -0
  44. package/dist/opencode/skills.d.ts +3 -0
  45. package/dist/opencode/tools.d.ts +3 -0
  46. package/dist/pi.js +3 -3
  47. package/dist/tools/ast-grep/cli.d.ts +1 -0
  48. package/dist/tools/ast-grep/index.d.ts +108 -2
  49. package/dist/tools/ast-grep/tools.d.ts +107 -3
  50. package/dist/tools/define-tool.d.ts +23 -0
  51. package/dist/tools/lsp/tools.d.ts +97 -5
  52. package/dist/utils/index.d.ts +0 -1
  53. package/package.json +14 -3
  54. package/plugin/.claude-plugin/plugin.json +1 -1
  55. package/plugin/.codex-plugin/plugin.json +1 -1
  56. package/plugin/skills/thoth-sdd/SKILL.md +8 -2
  57. package/plugin/skills/thoth-sdd/scripts/validate-result.mjs +28 -2
  58. package/skills/thoth-sdd/SKILL.md +8 -2
  59. package/skills/thoth-sdd/scripts/validate-result.mjs +28 -2
  60. package/thoth-agents.schema.json +0 -26
  61. package/dist/chunk-62L3ORXN.js +0 -30
  62. package/dist/delegation/project-id.d.ts +0 -10
  63. package/dist/hooks/auto-update-checker/checker.d.ts +0 -23
  64. package/dist/hooks/auto-update-checker/constants.d.ts +0 -11
  65. package/dist/hooks/auto-update-checker/index.d.ts +0 -17
  66. package/dist/hooks/auto-update-checker/types.d.ts +0 -22
  67. package/dist/utils/tmux-session-manager.d.ts +0 -63
  68. package/dist/utils/tmux.d.ts +0 -32
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '@opencode/plugin';
2
+ import type { OpenCodeDependencies } from './context';
3
+ export declare function registerAgents(ctx: Plugin.Context, deps: OpenCodeDependencies): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '@opencode/plugin';
2
+ import type { OpenCodeDependencies } from './context';
3
+ export declare function registerCommand(ctx: Plugin.Context, deps: OpenCodeDependencies): Promise<void>;
@@ -0,0 +1,20 @@
1
+ import type { Plugin } from '@opencode/plugin';
2
+ import { type AgentDefinition } from '../agents';
3
+ import { type PluginConfig } from '../config';
4
+ import { renderOpenCodeAgentConfigs } from '../harness/adapters/opencode';
5
+ type ModelEntry = {
6
+ id: string;
7
+ variant?: string;
8
+ };
9
+ export interface OpenCodeDependencies {
10
+ directory: string;
11
+ packageRoot: string;
12
+ config: PluginConfig;
13
+ agentDefs: AgentDefinition[];
14
+ agents: ReturnType<typeof renderOpenCodeAgentConfigs>;
15
+ modelArrayMap: Record<string, ModelEntry[]>;
16
+ effectiveModelArrays: Record<string, ModelEntry[]>;
17
+ runtimeChains: Record<string, string[]>;
18
+ }
19
+ export declare function loadOpenCodeDependencies(ctx: Plugin.Context): OpenCodeDependencies;
20
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '@opencode/plugin';
2
+ import type { OpenCodeDependencies } from './context';
3
+ export declare function registerDelegationHooks(ctx: Plugin.Context, deps: OpenCodeDependencies): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '@opencode/plugin';
2
+ import type { OpenCodeDependencies } from './context';
3
+ export declare function registerMcp(ctx: Plugin.Context, deps: OpenCodeDependencies): Promise<void>;
@@ -0,0 +1,9 @@
1
+ import type { AgentDefinition } from '../agents';
2
+ type Effect = 'allow' | 'deny' | 'ask';
3
+ export interface PermissionRule {
4
+ action: string;
5
+ resource: string;
6
+ effect: Effect;
7
+ }
8
+ export declare function translatePermissionRules(permission: AgentDefinition['config']['permission']): PermissionRule[];
9
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '@opencode/plugin';
2
+ import type { OpenCodeDependencies } from './context';
3
+ export declare function registerPermissions(ctx: Plugin.Context, deps: OpenCodeDependencies): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '@opencode/plugin';
2
+ import type { OpenCodeDependencies } from './context';
3
+ export declare function registerSessionHooks(ctx: Plugin.Context, deps: OpenCodeDependencies): Promise<void>;
@@ -0,0 +1,39 @@
1
+ import type { Plugin } from '@opencode/plugin';
2
+ type SessionID = Parameters<Plugin.Context['session']['instructions']['entry']['put']>[0]['sessionID'];
3
+ export type StateEvent = {
4
+ type: 'session.created';
5
+ data: {
6
+ sessionID: SessionID;
7
+ parentID?: SessionID;
8
+ };
9
+ } | {
10
+ type: 'session.status';
11
+ data: {
12
+ sessionID: SessionID;
13
+ status: {
14
+ type: 'idle' | 'busy' | 'retry';
15
+ };
16
+ };
17
+ } | {
18
+ type: 'session.deleted';
19
+ data: {
20
+ sessionID: SessionID;
21
+ };
22
+ };
23
+ /** Read-only record inventory plus live children. All updates are serialized. */
24
+ export declare class SessionState {
25
+ private readonly directory;
26
+ private readonly instructions;
27
+ private readonly parents;
28
+ private readonly running;
29
+ private readonly published;
30
+ private readonly records;
31
+ private queue;
32
+ constructor(directory: string, instructions: Plugin.Context['session']['instructions']);
33
+ private serialize;
34
+ refresh(sessionID: SessionID): Promise<string>;
35
+ event(event: StateEvent): Promise<void>;
36
+ private inventory;
37
+ private publish;
38
+ }
39
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '@opencode/plugin';
2
+ import type { OpenCodeDependencies } from './context';
3
+ export declare function registerSkills(ctx: Plugin.Context, deps: OpenCodeDependencies): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '@opencode/plugin';
2
+ import type { OpenCodeDependencies } from './context';
3
+ export declare function registerTools(ctx: Plugin.Context, _deps: OpenCodeDependencies): Promise<void>;
package/dist/pi.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  formatGateVerdict,
3
3
  summarizeGateResult
4
- } from "./chunk-RWQPMWEM.js";
4
+ } from "./chunk-JLU3FSBT.js";
5
5
  import {
6
6
  PI_ROOT_END,
7
7
  PI_ROOT_START,
8
8
  createPiToolsPanelAdapter,
9
9
  renderPiRootInstructions,
10
10
  syncPiSpecialists
11
- } from "./chunk-5WPP6IY7.js";
11
+ } from "./chunk-7F33WUSD.js";
12
12
  import {
13
13
  findPackageRoot
14
- } from "./chunk-DNPKVFOB.js";
14
+ } from "./chunk-NY2IPJ7V.js";
15
15
 
16
16
  // src/pi.ts
17
17
  import { homedir } from "os";
@@ -1,5 +1,6 @@
1
1
  import type { CliLanguage, SgResult } from './types';
2
2
  export interface RunOptions {
3
+ signal?: AbortSignal;
3
4
  pattern: string;
4
5
  lang: CliLanguage;
5
6
  paths?: string[];
@@ -1,6 +1,112 @@
1
- import type { ToolDefinition } from '@opencode-ai/plugin';
2
1
  import { ast_grep_replace, ast_grep_search } from './tools';
3
- export declare const builtinTools: Record<string, ToolDefinition>;
2
+ export declare const builtinTools: {
3
+ ast_grep_search: {
4
+ name: string;
5
+ description: string;
6
+ input: import("zod").ZodObject<{
7
+ pattern: import("zod").ZodString;
8
+ lang: import("zod").ZodEnum<{
9
+ bash: "bash";
10
+ c: "c";
11
+ cpp: "cpp";
12
+ csharp: "csharp";
13
+ css: "css";
14
+ elixir: "elixir";
15
+ go: "go";
16
+ haskell: "haskell";
17
+ html: "html";
18
+ java: "java";
19
+ javascript: "javascript";
20
+ json: "json";
21
+ kotlin: "kotlin";
22
+ lua: "lua";
23
+ nix: "nix";
24
+ php: "php";
25
+ python: "python";
26
+ ruby: "ruby";
27
+ rust: "rust";
28
+ scala: "scala";
29
+ solidity: "solidity";
30
+ swift: "swift";
31
+ typescript: "typescript";
32
+ tsx: "tsx";
33
+ yaml: "yaml";
34
+ }>;
35
+ paths: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
36
+ globs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
37
+ context: import("zod").ZodOptional<import("zod").ZodNumber>;
38
+ }, import("zod/v4/core").$strip>;
39
+ execute(input: {
40
+ pattern: string;
41
+ lang: "bash" | "c" | "cpp" | "csharp" | "css" | "elixir" | "go" | "haskell" | "html" | "java" | "javascript" | "json" | "kotlin" | "lua" | "nix" | "php" | "python" | "ruby" | "rust" | "scala" | "solidity" | "swift" | "typescript" | "tsx" | "yaml";
42
+ paths?: string[] | undefined;
43
+ globs?: string[] | undefined;
44
+ context?: number | undefined;
45
+ }, context: import("@opencode/plugin/promise/tool").ToolContext): Promise<{
46
+ content: string;
47
+ metadata: {
48
+ output: string;
49
+ };
50
+ } | {
51
+ content: string;
52
+ metadata?: undefined;
53
+ }>;
54
+ };
55
+ ast_grep_replace: {
56
+ name: string;
57
+ description: string;
58
+ input: import("zod").ZodObject<{
59
+ pattern: import("zod").ZodString;
60
+ rewrite: import("zod").ZodString;
61
+ lang: import("zod").ZodEnum<{
62
+ bash: "bash";
63
+ c: "c";
64
+ cpp: "cpp";
65
+ csharp: "csharp";
66
+ css: "css";
67
+ elixir: "elixir";
68
+ go: "go";
69
+ haskell: "haskell";
70
+ html: "html";
71
+ java: "java";
72
+ javascript: "javascript";
73
+ json: "json";
74
+ kotlin: "kotlin";
75
+ lua: "lua";
76
+ nix: "nix";
77
+ php: "php";
78
+ python: "python";
79
+ ruby: "ruby";
80
+ rust: "rust";
81
+ scala: "scala";
82
+ solidity: "solidity";
83
+ swift: "swift";
84
+ typescript: "typescript";
85
+ tsx: "tsx";
86
+ yaml: "yaml";
87
+ }>;
88
+ paths: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
89
+ globs: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
90
+ dryRun: import("zod").ZodOptional<import("zod").ZodBoolean>;
91
+ }, import("zod/v4/core").$strip>;
92
+ execute(input: {
93
+ pattern: string;
94
+ rewrite: string;
95
+ lang: "bash" | "c" | "cpp" | "csharp" | "css" | "elixir" | "go" | "haskell" | "html" | "java" | "javascript" | "json" | "kotlin" | "lua" | "nix" | "php" | "python" | "ruby" | "rust" | "scala" | "solidity" | "swift" | "typescript" | "tsx" | "yaml";
96
+ paths?: string[] | undefined;
97
+ globs?: string[] | undefined;
98
+ dryRun?: boolean | undefined;
99
+ }, context: import("@opencode/plugin/promise/tool").ToolContext): Promise<{
100
+ content: string;
101
+ metadata: {
102
+ output: string;
103
+ };
104
+ } | {
105
+ content: string;
106
+ metadata?: undefined;
107
+ }>;
108
+ };
109
+ };
4
110
  export { ast_grep_search, ast_grep_replace };
5
111
  export { ensureCliAvailable, getAstGrepPath, isCliAvailable, startBackgroundInit, } from './cli';
6
112
  export type { EnvironmentCheckResult } from './constants';
@@ -1,3 +1,107 @@
1
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
2
- export declare const ast_grep_search: ToolDefinition;
3
- export declare const ast_grep_replace: ToolDefinition;
1
+ import { z } from 'zod';
2
+ export declare const ast_grep_search: {
3
+ name: string;
4
+ description: string;
5
+ input: z.ZodObject<{
6
+ pattern: z.ZodString;
7
+ lang: z.ZodEnum<{
8
+ bash: "bash";
9
+ c: "c";
10
+ cpp: "cpp";
11
+ csharp: "csharp";
12
+ css: "css";
13
+ elixir: "elixir";
14
+ go: "go";
15
+ haskell: "haskell";
16
+ html: "html";
17
+ java: "java";
18
+ javascript: "javascript";
19
+ json: "json";
20
+ kotlin: "kotlin";
21
+ lua: "lua";
22
+ nix: "nix";
23
+ php: "php";
24
+ python: "python";
25
+ ruby: "ruby";
26
+ rust: "rust";
27
+ scala: "scala";
28
+ solidity: "solidity";
29
+ swift: "swift";
30
+ typescript: "typescript";
31
+ tsx: "tsx";
32
+ yaml: "yaml";
33
+ }>;
34
+ paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
35
+ globs: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
+ context: z.ZodOptional<z.ZodNumber>;
37
+ }, z.core.$strip>;
38
+ execute(input: {
39
+ pattern: string;
40
+ lang: "bash" | "c" | "cpp" | "csharp" | "css" | "elixir" | "go" | "haskell" | "html" | "java" | "javascript" | "json" | "kotlin" | "lua" | "nix" | "php" | "python" | "ruby" | "rust" | "scala" | "solidity" | "swift" | "typescript" | "tsx" | "yaml";
41
+ paths?: string[] | undefined;
42
+ globs?: string[] | undefined;
43
+ context?: number | undefined;
44
+ }, context: import("@opencode/plugin/promise/tool").ToolContext): Promise<{
45
+ content: string;
46
+ metadata: {
47
+ output: string;
48
+ };
49
+ } | {
50
+ content: string;
51
+ metadata?: undefined;
52
+ }>;
53
+ };
54
+ export declare const ast_grep_replace: {
55
+ name: string;
56
+ description: string;
57
+ input: z.ZodObject<{
58
+ pattern: z.ZodString;
59
+ rewrite: z.ZodString;
60
+ lang: z.ZodEnum<{
61
+ bash: "bash";
62
+ c: "c";
63
+ cpp: "cpp";
64
+ csharp: "csharp";
65
+ css: "css";
66
+ elixir: "elixir";
67
+ go: "go";
68
+ haskell: "haskell";
69
+ html: "html";
70
+ java: "java";
71
+ javascript: "javascript";
72
+ json: "json";
73
+ kotlin: "kotlin";
74
+ lua: "lua";
75
+ nix: "nix";
76
+ php: "php";
77
+ python: "python";
78
+ ruby: "ruby";
79
+ rust: "rust";
80
+ scala: "scala";
81
+ solidity: "solidity";
82
+ swift: "swift";
83
+ typescript: "typescript";
84
+ tsx: "tsx";
85
+ yaml: "yaml";
86
+ }>;
87
+ paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
88
+ globs: z.ZodOptional<z.ZodArray<z.ZodString>>;
89
+ dryRun: z.ZodOptional<z.ZodBoolean>;
90
+ }, z.core.$strip>;
91
+ execute(input: {
92
+ pattern: string;
93
+ rewrite: string;
94
+ lang: "bash" | "c" | "cpp" | "csharp" | "css" | "elixir" | "go" | "haskell" | "html" | "java" | "javascript" | "json" | "kotlin" | "lua" | "nix" | "php" | "python" | "ruby" | "rust" | "scala" | "solidity" | "swift" | "typescript" | "tsx" | "yaml";
95
+ paths?: string[] | undefined;
96
+ globs?: string[] | undefined;
97
+ dryRun?: boolean | undefined;
98
+ }, context: import("@opencode/plugin/promise/tool").ToolContext): Promise<{
99
+ content: string;
100
+ metadata: {
101
+ output: string;
102
+ };
103
+ } | {
104
+ content: string;
105
+ metadata?: undefined;
106
+ }>;
107
+ };
@@ -0,0 +1,23 @@
1
+ import type { ToolContext } from '@opencode/plugin/promise/tool';
2
+ import type { z } from 'zod';
3
+ /** Adapt the existing text-producing tools to the host's v2 result contract. */
4
+ export declare function defineTool<Input extends z.ZodType>(definition: {
5
+ name: string;
6
+ description: string;
7
+ input: Input;
8
+ showOutput?: boolean;
9
+ execute: (input: z.infer<Input>, context: ToolContext) => Promise<string>;
10
+ }): {
11
+ name: string;
12
+ description: string;
13
+ input: Input;
14
+ execute(input: z.infer<Input>, context: ToolContext): Promise<{
15
+ content: string;
16
+ metadata: {
17
+ output: string;
18
+ };
19
+ } | {
20
+ content: string;
21
+ metadata?: undefined;
22
+ }>;
23
+ };
@@ -1,5 +1,97 @@
1
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
2
- export declare const lsp_goto_definition: ToolDefinition;
3
- export declare const lsp_find_references: ToolDefinition;
4
- export declare const lsp_diagnostics: ToolDefinition;
5
- export declare const lsp_rename: ToolDefinition;
1
+ import { z } from 'zod';
2
+ export declare const lsp_goto_definition: {
3
+ name: string;
4
+ description: string;
5
+ input: z.ZodObject<{
6
+ filePath: z.ZodString;
7
+ line: z.ZodNumber;
8
+ character: z.ZodNumber;
9
+ }, z.core.$strip>;
10
+ execute(input: {
11
+ filePath: string;
12
+ line: number;
13
+ character: number;
14
+ }, context: import("@opencode/plugin/promise/tool").ToolContext): Promise<{
15
+ content: string;
16
+ metadata: {
17
+ output: string;
18
+ };
19
+ } | {
20
+ content: string;
21
+ metadata?: undefined;
22
+ }>;
23
+ };
24
+ export declare const lsp_find_references: {
25
+ name: string;
26
+ description: string;
27
+ input: z.ZodObject<{
28
+ filePath: z.ZodString;
29
+ line: z.ZodNumber;
30
+ character: z.ZodNumber;
31
+ includeDeclaration: z.ZodOptional<z.ZodBoolean>;
32
+ }, z.core.$strip>;
33
+ execute(input: {
34
+ filePath: string;
35
+ line: number;
36
+ character: number;
37
+ includeDeclaration?: boolean | undefined;
38
+ }, context: import("@opencode/plugin/promise/tool").ToolContext): Promise<{
39
+ content: string;
40
+ metadata: {
41
+ output: string;
42
+ };
43
+ } | {
44
+ content: string;
45
+ metadata?: undefined;
46
+ }>;
47
+ };
48
+ export declare const lsp_diagnostics: {
49
+ name: string;
50
+ description: string;
51
+ input: z.ZodObject<{
52
+ filePath: z.ZodString;
53
+ severity: z.ZodOptional<z.ZodEnum<{
54
+ error: "error";
55
+ all: "all";
56
+ warning: "warning";
57
+ information: "information";
58
+ hint: "hint";
59
+ }>>;
60
+ }, z.core.$strip>;
61
+ execute(input: {
62
+ filePath: string;
63
+ severity?: "error" | "all" | "warning" | "information" | "hint" | undefined;
64
+ }, context: import("@opencode/plugin/promise/tool").ToolContext): Promise<{
65
+ content: string;
66
+ metadata: {
67
+ output: string;
68
+ };
69
+ } | {
70
+ content: string;
71
+ metadata?: undefined;
72
+ }>;
73
+ };
74
+ export declare const lsp_rename: {
75
+ name: string;
76
+ description: string;
77
+ input: z.ZodObject<{
78
+ filePath: z.ZodString;
79
+ line: z.ZodNumber;
80
+ character: z.ZodNumber;
81
+ newName: z.ZodString;
82
+ }, z.core.$strip>;
83
+ execute(input: {
84
+ filePath: string;
85
+ line: number;
86
+ character: number;
87
+ newName: string;
88
+ }, context: import("@opencode/plugin/promise/tool").ToolContext): Promise<{
89
+ content: string;
90
+ metadata: {
91
+ output: string;
92
+ };
93
+ } | {
94
+ content: string;
95
+ metadata?: undefined;
96
+ }>;
97
+ };
@@ -3,5 +3,4 @@ export * from './env';
3
3
  export * from './internal-initiator';
4
4
  export { log } from './logger';
5
5
  export * from './polling';
6
- export * from './tmux';
7
6
  export { extractZip } from './zip-extractor';
package/package.json CHANGED
@@ -1,9 +1,21 @@
1
1
  {
2
2
  "name": "thoth-agents",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Adaptive multi-harness orchestration with six roles, runtime-autonomous AI-first execution routes, and external provider boundaries.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./package.json": "./package.json",
13
+ "./dist/*": "./dist/*",
14
+ "./skills/*": "./skills/*",
15
+ "./plugin/*": "./plugin/*",
16
+ "./pi/*": "./pi/*",
17
+ "./thoth-agents.schema.json": "./thoth-agents.schema.json"
18
+ },
7
19
  "bin": {
8
20
  "thoth-agents": "./dist/cli/index.js"
9
21
  },
@@ -81,8 +93,6 @@
81
93
  "dependencies": {
82
94
  "@ast-grep/cli": "^0.40.0",
83
95
  "@modelcontextprotocol/sdk": "^1.26.0",
84
- "@opencode-ai/plugin": "1.18.2",
85
- "@opencode-ai/sdk": "1.18.2",
86
96
  "hosted-git-info": "9.0.3",
87
97
  "ink": "^7.0.3",
88
98
  "react": "^19.2.6",
@@ -103,6 +113,7 @@
103
113
  "@earendil-works/pi-ai": "1.5.0",
104
114
  "@earendil-works/pi-coding-agent": "1.5.0",
105
115
  "@earendil-works/pi-tui": "1.5.0",
116
+ "@opencode/plugin": "2.2.5",
106
117
  "@types/hosted-git-info": "3.0.5",
107
118
  "@types/node": "^22.19.19",
108
119
  "@types/react": "^19.2.15",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thoth-agents",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Adaptive multi-harness agent pack with six roles and proportional SDD governance for Claude Code.",
5
5
  "author": {
6
6
  "name": "thoth-agents"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thoth-agents",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Bundled AI-first work skills and MCP configuration; the six-role global Codex layer requires thoth-agents CLI setup.",
5
5
  "skills": "./skills/",
6
6
  "mcpServers": "./codex.mcp.json",
@@ -206,7 +206,13 @@ Validation is not authorization.
206
206
 
207
207
  Delivery differs by harness: Pi attaches verdicts to completion notifications,
208
208
  `subagent_result`, and task-mode `subagent_run` (match `taskId`); OpenCode appends
209
- them to Oracle `task` output. Claude Code verdicts arrive with Subagent hand-back
209
+ them to completed foreground Oracle `subagent` tool output. OpenCode background
210
+ completions arrive automatically as `<subagent sessionID=... state="completed">`
211
+ messages without a `thoth-gate-verdict` line; root must use the explicit compact
212
+ validator fallback below. Delegate with `subagent` arguments `agent`,
213
+ `description`, `prompt`, optional `model`, `background:true` for independent work,
214
+ and `sessionID` to continue or clarify a child, including while running. No
215
+ status polling tool exists; default nesting depth is 1. Claude Code verdicts arrive with Subagent hand-back
210
216
  reports (foreground or background; `agent` is the agent id, match it to the Agent
211
217
  result's `agentId`) and completed foreground `Agent` results whose content carries
212
218
  the report. Other deliveries (e.g. background runs without hand-back) carry none;
@@ -220,7 +226,7 @@ result.
220
226
  ### Explicit compact fallback
221
227
 
222
228
  Only when no verdict was delivered (hook unavailable/untrusted, a Codex multi-agent
223
- v2 delivery, or a Claude background run without hand-back), resolve `<skill-dir>` from the installed
229
+ v2 delivery, an OpenCode background completion, or a Claude background run without hand-back), resolve `<skill-dir>` from the installed
224
230
  thoth-sdd SKILL.md directory, exactly as for `scripts/validate.mjs`, and run:
225
231
 
226
232
  ```text
@@ -122,12 +122,38 @@ function checkExpectations(options, issue) {
122
122
  );
123
123
  }
124
124
 
125
+ const isFenceLine = (line) => /^(?:`{3,}|~{3,})/.test(line);
126
+ const isVerdictLine = (line) => line.startsWith('thoth-gate-verdict ');
127
+
128
+ function unwrapSubagent(message, lines) {
129
+ if (!message.startsWith('<subagent ')) return message;
130
+ if (lines.at(-1) !== '</subagent>') return '';
131
+ const opener = lines.lastIndexOf('```thoth-result');
132
+ if (opener < 1) return '';
133
+ const header = lines.slice(0, opener).join('\n').trimEnd();
134
+ // Native descriptions are interpolated verbatim, not escaped attributes.
135
+ // Only structural lines and the completed-state marker are authoritative.
136
+ if (
137
+ !header.includes('state="completed"') ||
138
+ lines
139
+ .slice(0, opener)
140
+ .some((line) => isFenceLine(line) || isVerdictLine(line))
141
+ )
142
+ return '';
143
+ return lines.slice(opener, -1).join('\n').trim();
144
+ }
145
+
125
146
  function parseEnvelope(message) {
126
- const trimmed = typeof message === 'string' ? message.trim() : '';
147
+ const complete = typeof message === 'string' ? message.trim() : '';
148
+ const lines = complete.split(/\r\n|\r|\n/);
149
+ // Check structural lines in the complete delivery, including the header.
150
+ const singleEnvelope =
151
+ lines.filter(isFenceLine).length === 2 && !lines.some(isVerdictLine);
152
+ const trimmed = singleEnvelope ? unwrapSubagent(complete, lines) : '';
127
153
  const block = new RegExp(
128
154
  `^\`\`\`${contract.fence}\\r?\\n([\\s\\S]*?)\\r?\\n\`\`\`$`,
129
155
  ).exec(trimmed);
130
- if (!block || (trimmed.match(/^```.*$/gm) ?? []).length !== 2) {
156
+ if (!block) {
131
157
  return {
132
158
  issues: [
133
159
  {
@@ -206,7 +206,13 @@ Validation is not authorization.
206
206
 
207
207
  Delivery differs by harness: Pi attaches verdicts to completion notifications,
208
208
  `subagent_result`, and task-mode `subagent_run` (match `taskId`); OpenCode appends
209
- them to Oracle `task` output. Claude Code verdicts arrive with Subagent hand-back
209
+ them to completed foreground Oracle `subagent` tool output. OpenCode background
210
+ completions arrive automatically as `<subagent sessionID=... state="completed">`
211
+ messages without a `thoth-gate-verdict` line; root must use the explicit compact
212
+ validator fallback below. Delegate with `subagent` arguments `agent`,
213
+ `description`, `prompt`, optional `model`, `background:true` for independent work,
214
+ and `sessionID` to continue or clarify a child, including while running. No
215
+ status polling tool exists; default nesting depth is 1. Claude Code verdicts arrive with Subagent hand-back
210
216
  reports (foreground or background; `agent` is the agent id, match it to the Agent
211
217
  result's `agentId`) and completed foreground `Agent` results whose content carries
212
218
  the report. Other deliveries (e.g. background runs without hand-back) carry none;
@@ -220,7 +226,7 @@ result.
220
226
  ### Explicit compact fallback
221
227
 
222
228
  Only when no verdict was delivered (hook unavailable/untrusted, a Codex multi-agent
223
- v2 delivery, or a Claude background run without hand-back), resolve `<skill-dir>` from the installed
229
+ v2 delivery, an OpenCode background completion, or a Claude background run without hand-back), resolve `<skill-dir>` from the installed
224
230
  thoth-sdd SKILL.md directory, exactly as for `scripts/validate.mjs`, and run:
225
231
 
226
232
  ```text