thoth-agents 0.3.9 → 0.3.11
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/.claude-plugin/marketplace.json +1 -1
- package/dist/agents/prompt-dialects.d.ts +3 -0
- package/dist/{chunk-MY2GIOOH.js → chunk-CB3EBA7H.js} +4 -1
- package/dist/{chunk-2TLT6WWY.js → chunk-GIUU6FNE.js} +340 -296
- package/dist/{chunk-XEEYNMPC.js → chunk-ZEAAWBF2.js} +28 -83
- package/dist/cli/index.js +3 -3
- package/dist/cli/tui/index.js +2 -2
- package/dist/config/constants.d.ts +3 -3
- package/dist/harness/adapters/claude-code.d.ts +8 -0
- package/dist/harness/adapters/codex-surfaces.d.ts +2 -2
- package/dist/harness/core/agent-pack.d.ts +38 -3
- package/dist/harness/core/sdd.d.ts +9 -8
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/plugin/.claude-plugin/.thoth-agents-plugin-assets.json +7 -7
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/agents/deep.md +10 -31
- package/plugin/agents/designer.md +10 -31
- package/plugin/agents/explorer.md +10 -30
- package/plugin/agents/librarian.md +10 -30
- package/plugin/agents/oracle.md +10 -30
- package/plugin/agents/orchestrator.md +39 -31
- package/plugin/agents/quick.md +10 -31
- package/plugin/skills/thoth-archive/SKILL.md +7 -0
- package/plugin/skills/thoth-archive/scripts/archive.mjs +58 -84
- package/plugin/skills/thoth-sdd/SKILL.md +13 -1
- package/plugin/skills/thoth-sdd/references/phases/implement.md +33 -6
- package/plugin/skills/thoth-sdd/references/phases/specify.md +12 -1
- package/plugin/skills/thoth-sdd/scripts/durable-deltas.mjs +158 -0
- package/plugin/skills/thoth-sdd/scripts/validate.mjs +67 -28
- package/plugin/skills/thoth-sdd/templates/spec.md +9 -1
- package/skills/thoth-archive/SKILL.md +7 -0
- package/skills/thoth-archive/scripts/archive.mjs +58 -84
- package/skills/thoth-sdd/SKILL.md +13 -1
- package/skills/thoth-sdd/references/phases/implement.md +33 -6
- package/skills/thoth-sdd/references/phases/specify.md +12 -1
- package/skills/thoth-sdd/scripts/durable-deltas.mjs +158 -0
- package/skills/thoth-sdd/scripts/validate.mjs +67 -28
- package/skills/thoth-sdd/templates/spec.md +9 -1
|
@@ -28,13 +28,14 @@ import {
|
|
|
28
28
|
isValidPackageVersion,
|
|
29
29
|
loadAgentPrompt,
|
|
30
30
|
parseConfig,
|
|
31
|
+
renderAgentRoutingDescription,
|
|
31
32
|
renderPromptSection,
|
|
32
33
|
renderRolePrompt,
|
|
33
34
|
resolveExecutingPackageVersion,
|
|
34
35
|
updateOpenCodeMainConfig,
|
|
35
36
|
writeConfig,
|
|
36
37
|
writeLiteConfig
|
|
37
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-GIUU6FNE.js";
|
|
38
39
|
|
|
39
40
|
// src/cli/codex-paths.ts
|
|
40
41
|
import { homedir } from "os";
|
|
@@ -120,62 +121,6 @@ function renderConfiguredRolePrompt({
|
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
// src/harness/core/memory-governance.ts
|
|
123
|
-
function roleRules(role) {
|
|
124
|
-
const sharedRules = [
|
|
125
|
-
"thoth-mem remains an external provider; its installed provider guidance is authoritative for memory operations and thoth-agents does not prescribe the mechanism.",
|
|
126
|
-
"Provider-dependent use requires parent-scoped authorization with the stable root session identity or explicit unavailable state and project supplied by dispatch.",
|
|
127
|
-
"The MEMORY authorization is none, recall, or observe: none forbids provider work, recall permits bounded reads, and observe additionally permits one bounded durable observation under the delegated scope.",
|
|
128
|
-
"Only authorized context may be used, and the delegate must report missing, stale, contradictory, or insufficient context instead of guessing.",
|
|
129
|
-
"Memory authorization never changes workspace permissions or grants control of root lifecycle and real-user-intent ownership.",
|
|
130
|
-
"A handoff must keep accepted scope, decisions, permissions, and artifacts plus bounded memory context available to the authorized delegate.",
|
|
131
|
-
"Completion continuity is a provider-confirmed semantic summary outcome owned by the root.",
|
|
132
|
-
"Missing capability evidence is reported as degraded or unsupported and never as successful persistence or recovery.",
|
|
133
|
-
"openspec/ is the canonical SDD store; do not mirror spec.md, plan.md, tasks.md, verification reports, or archive reports into provider memory.",
|
|
134
|
-
"Do not invent a consumer fallback or silently change the selected persistence mode."
|
|
135
|
-
];
|
|
136
|
-
if (role.name === "orchestrator") {
|
|
137
|
-
return [
|
|
138
|
-
...sharedRules,
|
|
139
|
-
"The root coordinator owns authorization, root lifecycle, real-user-intent handling, and semantic completion outcomes.",
|
|
140
|
-
"Dispatch task and authorization context without embedding secrets, raw transcripts, or irrelevant context."
|
|
141
|
-
];
|
|
142
|
-
}
|
|
143
|
-
if (role.mode === "read-only") {
|
|
144
|
-
return [
|
|
145
|
-
...sharedRules,
|
|
146
|
-
"For a read-only workspace role, observe may authorize a durable provider observation but does not authorize workspace mutation.",
|
|
147
|
-
"Root lifecycle ownership never transfers to this delegate."
|
|
148
|
-
];
|
|
149
|
-
}
|
|
150
|
-
return [
|
|
151
|
-
...sharedRules,
|
|
152
|
-
"For a write-capable workspace role, provider observations still require observe authorization and the delegated parent scope.",
|
|
153
|
-
"Root lifecycle ownership never transfers to this delegate."
|
|
154
|
-
];
|
|
155
|
-
}
|
|
156
|
-
function getRoleMemoryGovernance(role) {
|
|
157
|
-
return {
|
|
158
|
-
role: role.name,
|
|
159
|
-
workspaceMode: role.mode,
|
|
160
|
-
requiresParentContext: role.name !== "orchestrator",
|
|
161
|
-
availableAuthorizations: ["none", "recall", "observe"],
|
|
162
|
-
ownsRootLifecycle: role.name === "orchestrator",
|
|
163
|
-
rules: roleRules(role)
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
function renderMemoryGovernanceInstructions(role, dialect) {
|
|
167
|
-
const governance = getRoleMemoryGovernance(role);
|
|
168
|
-
const harnessRules = dialect ? [
|
|
169
|
-
`- Harness wording: use ${dialect.renderRoleInvocation("orchestrator")} as the memory owner and \`${dialect.tools.userQuestionTool}\` for blocking memory-context questions.`,
|
|
170
|
-
`- Progress ownership remains with the coordinator; report memory-governance verification for tracking in ${dialect.tools.progressTool}.`
|
|
171
|
-
] : [];
|
|
172
|
-
return [
|
|
173
|
-
"External thoth-mem provider memory governance:",
|
|
174
|
-
...governance.rules.map((rule) => `- ${rule}`),
|
|
175
|
-
...harnessRules,
|
|
176
|
-
`- Runtime enforcement: ${role.name === "orchestrator" ? "root-owned outcomes" : "instruction-level unless the target harness validates per-agent memory controls"}.`
|
|
177
|
-
].join("\n");
|
|
178
|
-
}
|
|
179
124
|
function memoryGovernanceDiagnostics(input) {
|
|
180
125
|
const diagnostics = [];
|
|
181
126
|
if (input.permissionControls !== "supported") {
|
|
@@ -448,12 +393,13 @@ var CODEX_SURFACES = [
|
|
|
448
393
|
target: "permission-control",
|
|
449
394
|
status: "unsupported",
|
|
450
395
|
fields: [
|
|
451
|
-
"
|
|
396
|
+
"conditional agent_type selection",
|
|
397
|
+
"role-prefixed fallback",
|
|
452
398
|
"per-role permission enforcement",
|
|
453
399
|
"per-agent tool allow/deny equivalent to OpenCode permissions"
|
|
454
400
|
],
|
|
455
401
|
diagnosticCode: "codex.permission.memory.enforcement_gap",
|
|
456
|
-
summary: "
|
|
402
|
+
summary: "Static packages cannot guarantee active-runtime named-role selection: use collaboration.spawn_agent agent_type when exposed, otherwise the bounded role-prefixed fallback is instruction-only; per-role permission enforcement and OpenCode-style MCP/tool deny maps are not validated.",
|
|
457
403
|
evidence: "Codex approvals/security docs cover sandbox and approval policies, not exact OpenCode per-agent permission maps.",
|
|
458
404
|
fallback: "instruction-only"
|
|
459
405
|
},
|
|
@@ -1109,7 +1055,7 @@ function codexRuntimeGuidance() {
|
|
|
1109
1055
|
"- The ambient Codex session is the adaptive root; no orchestrator child TOML is generated.",
|
|
1110
1056
|
"- Delegate with `collaboration.spawn_agent` only when the root determines that specialization, context isolation, review, or independent parallel work creates a net gain.",
|
|
1111
1057
|
"- Collaboration tools are direct tools and must not be called from inside `functions.exec`.",
|
|
1112
|
-
"-
|
|
1058
|
+
"- When the active `collaboration.spawn_agent` schema exposes `agent_type`, set it to the selected canonical role. When it does not, use a role-prefixed `task_name` plus a self-contained bounded envelope; that fallback is instruction-only.",
|
|
1113
1059
|
"- Keep maximum depth 1: children do not delegate. Use one writer per mutable surface and parallelize only independent work.",
|
|
1114
1060
|
"- A `collaboration.wait_agent` timeout is nonterminal; inspect `collaboration.list_agents` for the same task before rerouting or interrupting it.",
|
|
1115
1061
|
"- Use `request_user_input` only for blocking material choices and always omit `autoResolutionMs` entirely.",
|
|
@@ -1121,15 +1067,8 @@ function codexRuntimeGuidance() {
|
|
|
1121
1067
|
function codexRoleInstructions(role) {
|
|
1122
1068
|
return [
|
|
1123
1069
|
"<role-operational-contract>",
|
|
1124
|
-
`- Role: ${role.name}`,
|
|
1125
|
-
`- Mode: ${role.mode}`,
|
|
1126
|
-
`- Scope: ${role.scope}`,
|
|
1127
|
-
`- Responsibility: ${role.responsibility}`,
|
|
1128
|
-
"- Use request_user_input for local blocking decisions.",
|
|
1129
1070
|
"- Permissions, memory governance, runtime hooks, and provider-per-agent controls are instruction-level unless the active Codex runtime documents stronger enforcement.",
|
|
1130
1071
|
`- ${role.name} runs as a Codex custom-agent TOML entry; the orchestrator remains the ambient Codex root session, not a generated role TOML.`,
|
|
1131
|
-
...role.toolGovernance.map((rule) => `- ${rule}`),
|
|
1132
|
-
...role.verification.map((rule) => `- ${rule}`),
|
|
1133
1072
|
"</role-operational-contract>"
|
|
1134
1073
|
].join("\n");
|
|
1135
1074
|
}
|
|
@@ -1142,8 +1081,7 @@ function roleInstructions(role, config) {
|
|
|
1142
1081
|
config,
|
|
1143
1082
|
model
|
|
1144
1083
|
}),
|
|
1145
|
-
codexRoleInstructions(role)
|
|
1146
|
-
renderMemoryGovernanceInstructions(role, CODEX_PROMPT_DIALECT)
|
|
1084
|
+
codexRoleInstructions(role)
|
|
1147
1085
|
].join("\n\n");
|
|
1148
1086
|
}
|
|
1149
1087
|
function renderCodexRootInstructions(config) {
|
|
@@ -1189,7 +1127,7 @@ function renderAgentArtifacts({ config }) {
|
|
|
1189
1127
|
surfaceId: "project-agent-toml",
|
|
1190
1128
|
values: {
|
|
1191
1129
|
name: role.name,
|
|
1192
|
-
description: role
|
|
1130
|
+
description: renderAgentRoutingDescription(role),
|
|
1193
1131
|
developer_instructions: roleInstructions(role, config),
|
|
1194
1132
|
...model ? { model } : {},
|
|
1195
1133
|
...effort ? { model_reasoning_effort: effort } : {},
|
|
@@ -2005,6 +1943,15 @@ var CLAUDE_CODE_SUBAGENT_DEFAULT_MODELS = {
|
|
|
2005
1943
|
quick: "haiku",
|
|
2006
1944
|
deep: "sonnet"
|
|
2007
1945
|
};
|
|
1946
|
+
var CLAUDE_CODE_SUBAGENT_DEFAULT_EFFORTS = {
|
|
1947
|
+
explorer: "low",
|
|
1948
|
+
quick: "low",
|
|
1949
|
+
designer: "medium",
|
|
1950
|
+
deep: "medium",
|
|
1951
|
+
librarian: "high",
|
|
1952
|
+
oracle: "high"
|
|
1953
|
+
};
|
|
1954
|
+
var CLAUDE_CODE_EFFORTS = /* @__PURE__ */ new Set(["low", "medium", "high", "max"]);
|
|
2008
1955
|
function isClaudeCodeSubagentName(name) {
|
|
2009
1956
|
return name in CLAUDE_CODE_SUBAGENT_DEFAULT_MODELS;
|
|
2010
1957
|
}
|
|
@@ -2014,20 +1961,18 @@ function getClaudeCodeAgentModel(role, config) {
|
|
|
2014
1961
|
if (override && isClaudeCodeModel(override)) return override;
|
|
2015
1962
|
return CLAUDE_CODE_SUBAGENT_DEFAULT_MODELS[role.name];
|
|
2016
1963
|
}
|
|
1964
|
+
function getClaudeCodeAgentEffort(role, config) {
|
|
1965
|
+
if (!isClaudeCodeSubagentName(role.name)) return void 0;
|
|
1966
|
+
const configured = config?.agents?.[role.name]?.variant;
|
|
1967
|
+
return configured && CLAUDE_CODE_EFFORTS.has(configured) ? configured : CLAUDE_CODE_SUBAGENT_DEFAULT_EFFORTS[role.name];
|
|
1968
|
+
}
|
|
2017
1969
|
function claudeCodeRoleInstructions(role) {
|
|
2018
1970
|
return [
|
|
2019
1971
|
"<role-operational-contract>",
|
|
2020
|
-
`- Role: ${role.name}`,
|
|
2021
|
-
`- Mode: ${role.mode}`,
|
|
2022
|
-
`- Scope: ${role.scope}`,
|
|
2023
|
-
`- Responsibility: ${role.responsibility}`,
|
|
2024
|
-
"- Use AskUserQuestion for local blocking decisions.",
|
|
2025
1972
|
`- ${role.name} runs as an auto-discovered Claude Code plugin subagent invoked via Agent(subagent_type: ${claudeCodeSubagentType(role.name)}); plugin subagents are namespaced with the plugin name. The orchestrator is the main Claude Code session.`,
|
|
2026
1973
|
...role.mode === "read-only" ? [
|
|
2027
1974
|
"- Write and Edit are denied in frontmatter while all other inherited tools, including MCP tools, remain available."
|
|
2028
1975
|
] : [],
|
|
2029
|
-
...role.toolGovernance.map((rule) => `- ${rule}`),
|
|
2030
|
-
...role.verification.map((rule) => `- ${rule}`),
|
|
2031
1976
|
"</role-operational-contract>"
|
|
2032
1977
|
].join("\n");
|
|
2033
1978
|
}
|
|
@@ -2040,8 +1985,7 @@ function roleInstructions2(role, config) {
|
|
|
2040
1985
|
config,
|
|
2041
1986
|
model
|
|
2042
1987
|
}),
|
|
2043
|
-
claudeCodeRoleInstructions(role)
|
|
2044
|
-
renderMemoryGovernanceInstructions(role, CLAUDE_CODE_PROMPT_DIALECT)
|
|
1988
|
+
claudeCodeRoleInstructions(role)
|
|
2045
1989
|
].join("\n\n");
|
|
2046
1990
|
}
|
|
2047
1991
|
function renderClaudeCodeRootInstructions(config) {
|
|
@@ -2111,8 +2055,9 @@ function renderSubagentArtifacts(config) {
|
|
|
2111
2055
|
)) {
|
|
2112
2056
|
const content = renderClaudeCodeSubagent({
|
|
2113
2057
|
name: role.name,
|
|
2114
|
-
description: role
|
|
2058
|
+
description: renderAgentRoutingDescription(role),
|
|
2115
2059
|
model: getClaudeCodeAgentModel(role, config),
|
|
2060
|
+
effort: getClaudeCodeAgentEffort(role, config),
|
|
2116
2061
|
...role.mode === "read-only" ? { disallowedTools: "Write, Edit" } : {},
|
|
2117
2062
|
instructions: roleInstructions2(role, config)
|
|
2118
2063
|
});
|
|
@@ -6714,7 +6659,7 @@ var CODEX_DOCUMENTED_EFFORTS2 = /* @__PURE__ */ new Set([
|
|
|
6714
6659
|
"max",
|
|
6715
6660
|
"ultra"
|
|
6716
6661
|
]);
|
|
6717
|
-
var
|
|
6662
|
+
var CLAUDE_CODE_EFFORTS2 = ["low", "medium", "high", "xhigh", "max"];
|
|
6718
6663
|
function parseOpenCodeModels(output) {
|
|
6719
6664
|
const seen = /* @__PURE__ */ new Set();
|
|
6720
6665
|
const options = [];
|
|
@@ -6747,7 +6692,7 @@ function writableEfforts(harness, option) {
|
|
|
6747
6692
|
}
|
|
6748
6693
|
if (harness === "claude") {
|
|
6749
6694
|
return option.efforts.filter(
|
|
6750
|
-
(effort) =>
|
|
6695
|
+
(effort) => CLAUDE_CODE_EFFORTS2.includes(effort)
|
|
6751
6696
|
);
|
|
6752
6697
|
}
|
|
6753
6698
|
return option.efforts.filter(
|
|
@@ -6798,7 +6743,7 @@ var CLAUDE_CODE_MODEL_OPTIONS = [
|
|
|
6798
6743
|
}
|
|
6799
6744
|
].map((option) => ({
|
|
6800
6745
|
...option,
|
|
6801
|
-
efforts: option.id === "inherit" ? [] : [...
|
|
6746
|
+
efforts: option.id === "inherit" ? [] : [...CLAUDE_CODE_EFFORTS2],
|
|
6802
6747
|
source: "manual"
|
|
6803
6748
|
}));
|
|
6804
6749
|
async function getModelOptions(harness) {
|
package/dist/cli/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
getOpenCodeVersion,
|
|
5
5
|
isOpenCodeInstalled,
|
|
6
6
|
opencodeAdapter
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-CB3EBA7H.js";
|
|
8
8
|
import {
|
|
9
9
|
CODEX_ROLE_NAMES,
|
|
10
10
|
REQUIRED_SKILLS,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
listOperationHarnesses,
|
|
48
48
|
normalizeEffortSelection,
|
|
49
49
|
syncOpenCodeOwnedSkills
|
|
50
|
-
} from "../chunk-
|
|
50
|
+
} from "../chunk-ZEAAWBF2.js";
|
|
51
51
|
import {
|
|
52
52
|
ALL_AGENT_NAMES,
|
|
53
53
|
detectCurrentConfig,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
resolveExecutingPackageVersion,
|
|
59
59
|
updateOpenCodeMainConfig,
|
|
60
60
|
writeLiteConfig
|
|
61
|
-
} from "../chunk-
|
|
61
|
+
} from "../chunk-GIUU6FNE.js";
|
|
62
62
|
|
|
63
63
|
// src/cli/index.ts
|
|
64
64
|
import { pathToFileURL } from "url";
|
package/dist/cli/tui/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
defaultTuiOperations,
|
|
3
3
|
effortChoicesForModel,
|
|
4
4
|
listOperationHarnesses
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-ZEAAWBF2.js";
|
|
6
|
+
import "../../chunk-GIUU6FNE.js";
|
|
7
7
|
|
|
8
8
|
// src/cli/tui/index.tsx
|
|
9
9
|
import { render } from "ink";
|
|
@@ -11,11 +11,11 @@ export declare const CONFIRMED_OPENAI_SUBAGENT_PRESET: {
|
|
|
11
11
|
};
|
|
12
12
|
readonly librarian: {
|
|
13
13
|
readonly model: "gpt-5.6-luna";
|
|
14
|
-
readonly effort: "
|
|
14
|
+
readonly effort: "high";
|
|
15
15
|
};
|
|
16
16
|
readonly oracle: {
|
|
17
17
|
readonly model: "gpt-5.6-sol";
|
|
18
|
-
readonly effort: "
|
|
18
|
+
readonly effort: "high";
|
|
19
19
|
};
|
|
20
20
|
readonly designer: {
|
|
21
21
|
readonly model: "gpt-5.6-sol";
|
|
@@ -23,7 +23,7 @@ export declare const CONFIRMED_OPENAI_SUBAGENT_PRESET: {
|
|
|
23
23
|
};
|
|
24
24
|
readonly quick: {
|
|
25
25
|
readonly model: "gpt-5.6-luna";
|
|
26
|
-
readonly effort: "
|
|
26
|
+
readonly effort: "low";
|
|
27
27
|
};
|
|
28
28
|
readonly deep: {
|
|
29
29
|
readonly model: "gpt-5.6-sol";
|
|
@@ -13,6 +13,14 @@ export declare const CLAUDE_CODE_SUBAGENT_DEFAULT_MODELS: {
|
|
|
13
13
|
readonly quick: "haiku";
|
|
14
14
|
readonly deep: "sonnet";
|
|
15
15
|
};
|
|
16
|
+
export declare const CLAUDE_CODE_SUBAGENT_DEFAULT_EFFORTS: {
|
|
17
|
+
readonly explorer: "low";
|
|
18
|
+
readonly quick: "low";
|
|
19
|
+
readonly designer: "medium";
|
|
20
|
+
readonly deep: "medium";
|
|
21
|
+
readonly librarian: "high";
|
|
22
|
+
readonly oracle: "high";
|
|
23
|
+
};
|
|
16
24
|
/**
|
|
17
25
|
* The orchestrator system prompt body. This is the system prompt of the
|
|
18
26
|
* `orchestrator` plugin agent, which the plugin `settings.json` activates as the
|
|
@@ -170,9 +170,9 @@ export declare const CODEX_SURFACES: readonly [{
|
|
|
170
170
|
readonly id: "per-agent-runtime-permissions";
|
|
171
171
|
readonly target: "permission-control";
|
|
172
172
|
readonly status: "unsupported";
|
|
173
|
-
readonly fields: ["
|
|
173
|
+
readonly fields: ["conditional agent_type selection", "role-prefixed fallback", "per-role permission enforcement", "per-agent tool allow/deny equivalent to OpenCode permissions"];
|
|
174
174
|
readonly diagnosticCode: "codex.permission.memory.enforcement_gap";
|
|
175
|
-
readonly summary: "
|
|
175
|
+
readonly summary: "Static packages cannot guarantee active-runtime named-role selection: use collaboration.spawn_agent agent_type when exposed, otherwise the bounded role-prefixed fallback is instruction-only; per-role permission enforcement and OpenCode-style MCP/tool deny maps are not validated.";
|
|
176
176
|
readonly evidence: "Codex approvals/security docs cover sandbox and approval policies, not exact OpenCode per-agent permission maps.";
|
|
177
177
|
readonly fallback: "instruction-only";
|
|
178
178
|
}, {
|
|
@@ -8,6 +8,9 @@ export interface AgentRoleContract {
|
|
|
8
8
|
canMutateWorkspace: boolean;
|
|
9
9
|
scope: string;
|
|
10
10
|
responsibility: string;
|
|
11
|
+
useWhen: string[];
|
|
12
|
+
doNotUseWhen: string[];
|
|
13
|
+
escalateWhen: string[];
|
|
11
14
|
writeScope?: string[];
|
|
12
15
|
toolGovernance: string[];
|
|
13
16
|
verification: string[];
|
|
@@ -15,8 +18,18 @@ export interface AgentRoleContract {
|
|
|
15
18
|
export interface OrchestrationPolicy {
|
|
16
19
|
maxDelegationDepth: number;
|
|
17
20
|
singleWriter: boolean;
|
|
21
|
+
implementationOwnership: ImplementationOwnershipPolicy;
|
|
18
22
|
rules: string[];
|
|
19
23
|
}
|
|
24
|
+
export type ImplementationOwner = 'orchestrator' | 'designer' | 'quick' | 'deep';
|
|
25
|
+
export interface ImplementationOwnershipPolicy {
|
|
26
|
+
eligibleOwners: ImplementationOwner[];
|
|
27
|
+
routeIndependent: boolean;
|
|
28
|
+
delegationBenefits: string[];
|
|
29
|
+
rootContinuityBenefits: string[];
|
|
30
|
+
userDirection: string;
|
|
31
|
+
insufficientSignals: string[];
|
|
32
|
+
}
|
|
20
33
|
export interface AgentPackContract {
|
|
21
34
|
roles: AgentRoleContract[];
|
|
22
35
|
orchestrationPolicy: OrchestrationPolicy;
|
|
@@ -29,9 +42,12 @@ export declare const AGENT_ROLES: readonly [{
|
|
|
29
42
|
readonly mode: "adaptive-root";
|
|
30
43
|
readonly dispatch: "root-coordinator";
|
|
31
44
|
readonly canMutateWorkspace: true;
|
|
32
|
-
readonly scope: "requirements, SDD coordination, routing, bounded
|
|
33
|
-
readonly responsibility: "Keep
|
|
34
|
-
readonly
|
|
45
|
+
readonly scope: "requirements, SDD coordination, routing, bounded implementation, decisions, and synthesis";
|
|
46
|
+
readonly responsibility: "Keep requirements, decisions, sequential SDD coordination, and final synthesis in the root thread; evaluate implementation ownership independently in every route and implement directly or delegate according to explicit user direction and demonstrated net gain.";
|
|
47
|
+
readonly useWhen: ["Coordinate requirements, governed artifacts, routing, and synthesis.", "Implement an accepted mutable surface in any route when accumulated context and continuity outweigh delegation overhead."];
|
|
48
|
+
readonly doNotUseWhen: ["Not for independent plan review or final verification."];
|
|
49
|
+
readonly escalateWhen: ["Delegate implementation when specialization, context isolation, or independent bounded work creates a demonstrated net gain; then select designer, quick, or deep by task shape."];
|
|
50
|
+
readonly toolGovernance: ["may inspect and edit the accepted bounded implementation surface in every route, but every verification is delegated to oracle", "loads the matching thoth-sdd phase contract on demand instead of carrying every phase protocol in its prompt", "owns governed coordination writes under openspec/ and uses append-only tasks.md updates during convergence", "delegates independent or specialist work only when it produces a net gain", "keeps requirements, decisions, and final synthesis in the root thread"];
|
|
35
51
|
readonly verification: ["delegates selected plan-review and every verify phase to oracle; plan review stays optional and final verification stays mandatory", "consolidates summarized evidence returned by child agents"];
|
|
36
52
|
}, {
|
|
37
53
|
readonly name: "explorer";
|
|
@@ -40,6 +56,9 @@ export declare const AGENT_ROLES: readonly [{
|
|
|
40
56
|
readonly canMutateWorkspace: false;
|
|
41
57
|
readonly scope: "local repository discovery";
|
|
42
58
|
readonly responsibility: "Resolve broad or uncertain repository questions and return distilled evidence.";
|
|
59
|
+
readonly useWhen: ["Repository ownership or behavior is broad or uncertain."];
|
|
60
|
+
readonly doNotUseWhen: ["Not for implementation, edits, or known narrow questions."];
|
|
61
|
+
readonly escalateWhen: ["Send external evidence to librarian and mutation scope to root."];
|
|
43
62
|
readonly toolGovernance: ["uses read, search, and code-navigation tools only", "does not mutate files or delegate further"];
|
|
44
63
|
readonly verification: ["reports inspected paths, confidence, and remaining gaps"];
|
|
45
64
|
}, {
|
|
@@ -49,6 +68,9 @@ export declare const AGENT_ROLES: readonly [{
|
|
|
49
68
|
readonly canMutateWorkspace: false;
|
|
50
69
|
readonly scope: "authoritative external research with local confirmation when needed";
|
|
51
70
|
readonly responsibility: "Gather current authoritative evidence and separate documented facts from inference.";
|
|
71
|
+
readonly useWhen: ["Current authoritative external evidence is required."];
|
|
72
|
+
readonly doNotUseWhen: ["Not for implementation, edits, or purely local discovery."];
|
|
73
|
+
readonly escalateWhen: ["Report contradictory or insufficient sources to root."];
|
|
52
74
|
readonly toolGovernance: ["uses research and read-only local tools", "does not mutate files or delegate further"];
|
|
53
75
|
readonly verification: ["provides direct sources for substantive external claims"];
|
|
54
76
|
}, {
|
|
@@ -58,6 +80,9 @@ export declare const AGENT_ROLES: readonly [{
|
|
|
58
80
|
readonly canMutateWorkspace: false;
|
|
59
81
|
readonly scope: "diagnosis, architecture, optional plan review, and independent verification";
|
|
60
82
|
readonly responsibility: "Independently review plans when the user requests it and perform every implementation verification, exposing correctness risks and judging whether results satisfy their contracts.";
|
|
83
|
+
readonly useWhen: ["Selected plan review, diagnosis, or final verification needs independent judgment."];
|
|
84
|
+
readonly doNotUseWhen: ["Not for implementation, mutation, persistence, or self-review."];
|
|
85
|
+
readonly escalateWhen: ["Return blockers and remediation anchors to root."];
|
|
61
86
|
readonly toolGovernance: ["performs read-only analysis and independent review and is never the implementer of the work it judges", "does not implement, persist artifacts, or delegate further"];
|
|
62
87
|
readonly verification: ["separates observations, risks, and recommendations"];
|
|
63
88
|
}, {
|
|
@@ -67,6 +92,9 @@ export declare const AGENT_ROLES: readonly [{
|
|
|
67
92
|
readonly canMutateWorkspace: true;
|
|
68
93
|
readonly scope: "UI/UX decisions, implementation, and visual verification";
|
|
69
94
|
readonly responsibility: "Own user-facing implementation choices and visual quality for UI work.";
|
|
95
|
+
readonly useWhen: ["User-facing UI/UX, interaction, accessibility, or visual quality is material."];
|
|
96
|
+
readonly doNotUseWhen: ["Not for backend-only, non-visual, or correctness-heavy cross-cutting work."];
|
|
97
|
+
readonly escalateWhen: ["Escalate coupled contracts, migrations, or high risk to deep."];
|
|
70
98
|
readonly toolGovernance: ["may edit focused UI/UX files", "owns screenshots and visual QA", "does not delegate further"];
|
|
71
99
|
readonly verification: ["includes visual verification when applicable"];
|
|
72
100
|
}, {
|
|
@@ -76,6 +104,9 @@ export declare const AGENT_ROLES: readonly [{
|
|
|
76
104
|
readonly canMutateWorkspace: true;
|
|
77
105
|
readonly scope: "fast bounded implementation";
|
|
78
106
|
readonly responsibility: "Implement narrow, clear, low-risk changes within an explicitly bounded surface.";
|
|
107
|
+
readonly useWhen: ["Known narrow mechanical low-risk work has exact targets."];
|
|
108
|
+
readonly doNotUseWhen: ["Not for coupled contracts, migrations, broad discovery, concurrency, edge cases, or high risk."];
|
|
109
|
+
readonly escalateWhen: ["Escalate discovery, coupling, edge cases, or higher risk to deep."];
|
|
79
110
|
readonly toolGovernance: ["edits only bounded targets", "escalates when discovery or correctness risk exceeds the assignment", "does not delegate further"];
|
|
80
111
|
readonly verification: ["runs the smallest sufficient focused check"];
|
|
81
112
|
}, {
|
|
@@ -85,6 +116,9 @@ export declare const AGENT_ROLES: readonly [{
|
|
|
85
116
|
readonly canMutateWorkspace: true;
|
|
86
117
|
readonly scope: "correctness-critical implementation and verification";
|
|
87
118
|
readonly responsibility: "Handle multi-file, edge-case-heavy, or high-risk implementation with full local context.";
|
|
119
|
+
readonly useWhen: ["Implementation is multi-file, edge-case-heavy, migration, concurrency, shared-contract, or high-risk."];
|
|
120
|
+
readonly doNotUseWhen: ["Not for visual-only work or narrow known low-risk edits."];
|
|
121
|
+
readonly escalateWhen: ["Return product or architecture choices to root."];
|
|
88
122
|
readonly toolGovernance: ["may edit implementation and tests within the assigned surface", "validates shared behavior against related code and call sites", "does not delegate further"];
|
|
89
123
|
readonly verification: ["reports focused checks and relevant edge-case evidence"];
|
|
90
124
|
}];
|
|
@@ -93,4 +127,5 @@ export declare const AGENT_RETURN_CONTRACT: readonly ["conclusion", "evidence",
|
|
|
93
127
|
export declare const VERIFICATION_PROTOCOL: readonly ["Completion reports identify changed files and verification evidence.", "Behavior changes receive the smallest sufficient automated check or a declared manual check.", "Visual changes receive designer-owned visual QA when applicable."];
|
|
94
128
|
export declare const AGENT_PACK_CONTRACT: AgentPackContract;
|
|
95
129
|
export declare function getAgentRole(name: AgentRoleName): AgentRoleContract;
|
|
130
|
+
export declare function renderAgentRoutingDescription(role: AgentRoleContract): string;
|
|
96
131
|
export declare function getAgentPackContract(): AgentPackContract;
|
|
@@ -24,6 +24,7 @@ export interface SddRoutingDecision {
|
|
|
24
24
|
}
|
|
25
25
|
export type SddPhaseId = 'explore' | 'specify' | 'clarify' | 'plan' | 'checklist' | 'tasks' | 'plan-review' | 'implement' | 'verify' | 'converge' | 'archive';
|
|
26
26
|
export type SddPhaseActivation = 'required' | 'conditional';
|
|
27
|
+
export type SddPhaseOwner = AgentRoleName | 'adaptive-implementation';
|
|
27
28
|
export interface SddPhaseContract {
|
|
28
29
|
id: SddPhaseId;
|
|
29
30
|
order: number;
|
|
@@ -32,7 +33,7 @@ export interface SddPhaseContract {
|
|
|
32
33
|
activation: SddPhaseActivation;
|
|
33
34
|
prerequisites: SddPhaseId[];
|
|
34
35
|
producesArtifact: boolean;
|
|
35
|
-
defaultAgentRole:
|
|
36
|
+
defaultAgentRole: SddPhaseOwner;
|
|
36
37
|
eligibleAgentRoles: AgentRoleName[];
|
|
37
38
|
reason: string;
|
|
38
39
|
condition?: string;
|
|
@@ -170,9 +171,9 @@ export declare const SDD_PHASES: readonly [{
|
|
|
170
171
|
readonly activation: "required";
|
|
171
172
|
readonly prerequisites: ["tasks"];
|
|
172
173
|
readonly producesArtifact: false;
|
|
173
|
-
readonly defaultAgentRole: "
|
|
174
|
+
readonly defaultAgentRole: "adaptive-implementation";
|
|
174
175
|
readonly eligibleAgentRoles: ["orchestrator", "designer", "quick", "deep"];
|
|
175
|
-
readonly reason: "
|
|
176
|
+
readonly reason: "Choose root, designer, quick, or deep from task-shaped net gain independently from the SDD route.";
|
|
176
177
|
}, {
|
|
177
178
|
readonly id: "verify";
|
|
178
179
|
readonly order: 8;
|
|
@@ -311,7 +312,7 @@ export declare const SDD_PHASE_PROTOCOLS: readonly [{
|
|
|
311
312
|
readonly id: "specify";
|
|
312
313
|
readonly objective: "Create a testable, implementation-neutral feature contract in spec.md.";
|
|
313
314
|
readonly requiredInputs: ["User intent and accepted scope", "Explore handoff when the route is full", "Project constitution and existing public contracts when relevant"];
|
|
314
|
-
readonly instructions: ["Record intent and scope as Why, Impact, and Affected capabilities before prescribing any contract.", "Define prioritized independent stories and map each story to its FR-### and SC-### contracts with Covers metadata.", "Give every normative MUST or SHALL requirement a descriptive title and declare it INTERNAL or as an ADDED, MODIFIED, REMOVED, or RENAMED durable capability delta.", "Classify every success criterion as buildable or outcome; both remain measurable, but only buildable criteria require implementation task coverage.", "Capture assumptions, acceptance scenarios, edge cases, dependencies, and explicit non-goals.", "Use a clarification marker only when no safe default exists and the answer materially changes scope or behavior."];
|
|
315
|
+
readonly instructions: ["Record intent and scope as Why, Impact, and Affected capabilities before prescribing any contract.", "Define prioritized independent stories and map each story to its FR-### and SC-### contracts with Covers metadata.", "Inspect each affected canonical capability before choosing durable metadata: ADDED is only for genuinely new behavior; MODIFIED and REMOVED preserve exact existing titles; RENAMED names the exact previous title; only ADDED is valid when the capability is absent.", "Give every normative MUST or SHALL requirement a descriptive title and declare it INTERNAL or as an ADDED, MODIFIED, REMOVED, or RENAMED durable capability delta; treat an ADDED warning on an existing capability as a required semantic-overlap review.", "Classify every success criterion as buildable or outcome; both remain measurable, but only buildable criteria require implementation task coverage.", "Capture assumptions, acceptance scenarios, edge cases, dependencies, and explicit non-goals.", "Use a clarification marker only when no safe default exists and the answer materially changes scope or behavior."];
|
|
315
316
|
readonly allowedWrites: ["openspec/changes/<feature>/spec.md"];
|
|
316
317
|
readonly outputSchema: ["spec.md path", "requirements summary", "open clarifications"];
|
|
317
318
|
readonly doneWhen: ["Every accepted FR and SC is testable, materially unambiguous, mapped to a story, and implementation-neutral."];
|
|
@@ -370,13 +371,13 @@ export declare const SDD_PHASE_PROTOCOLS: readonly [{
|
|
|
370
371
|
}, {
|
|
371
372
|
readonly id: "implement";
|
|
372
373
|
readonly objective: "Execute the accepted task slice with one writer and focused verification.";
|
|
373
|
-
readonly requiredInputs: ["User request or assigned tasks.md slice", "Accepted spec.md and plan.md when present", "Exact implementation boundaries and verification commands"];
|
|
374
|
-
readonly instructions: ["The root marks selected artifact-backed tasks [~] before
|
|
374
|
+
readonly requiredInputs: ["User request or assigned tasks.md slice", "Accepted spec.md and plan.md when present", "Exact implementation boundaries and verification commands", "Implementation owner decision (orchestrator, designer, quick, or deep), exact mutable surface, requirement anchors, and task-shape/net-gain rationale"];
|
|
375
|
+
readonly instructions: ["The root marks selected artifact-backed tasks [~] before implementation and marks them [x] only after task-specific evidence is verified; Direct or no-artifact work has no task state.", "The SDD route governs artifacts and gates, not implementation ownership; choose root or a specialist from explicit safe user direction and demonstrated task-shaped net gain.", "When root owns implementation, retain the accepted mutable surface with no child dispatch; when a specialist owns implementation, send one bounded dispatch with the exact surface, requirements, and verification.", "Use test-first or TDD execution for behavior changes and preserve one writer per mutable surface.", "Balance specialization, context isolation, independent work, quality, latency, and total cost against sequential dependency, shared mutable state, accumulated context, rediscovery, and coordination overhead.", "Only after deciding delegation creates net gain, select designer for user-facing UI/UX, quick for known narrow low-risk work, and deep for coupled multi-file, edge-case-heavy, migration, concurrency, shared-contract, or high-risk work.", "Record the owner decision, rationale, exact mutable surface, requirement anchors, and verification before implementation or dispatch.", "Proven independent surfaces may use separate writers with non-overlapping files; overlapping or compatibility-coupled surfaces use one deep writer and ordered handoffs.", "Quick and designer must escalate before expanding into deep-risk or compatibility-coupled scope.", "Edit only the assigned implementation surface and report justified deviations from the accepted plan.", "When evidence refines the same intent, return it to root so canonical artifacts are updated and only affected downstream artifacts and gates are revalidated.", "Start a new change instead of expanding the active one when the intent changes."];
|
|
375
376
|
readonly allowedWrites: ["Assigned product and test files", "Root only: task checkbox transitions in openspec/changes/<feature>/tasks.md; child writers must not edit task state."];
|
|
376
377
|
readonly outputSchema: ["status: completed | partial | failed", "per-task outcome", "files changed", "executed verification and results", "deviations, issues, and remaining work"];
|
|
377
378
|
readonly doneWhen: ["The assigned task slice is complete and its focused checks pass with concrete evidence."];
|
|
378
379
|
readonly blockingConditions: ["A task needs scope expansion, a material unresolved decision, or fails repeatedly without a safe bounded recovery."];
|
|
379
|
-
readonly handoff: ["Pass changed files, per-task evidence, deviations, and verification results to verify."];
|
|
380
|
+
readonly handoff: ["Pass changed files, per-task evidence, deviations, and verification results to a fresh Oracle for independent verify."];
|
|
380
381
|
}, {
|
|
381
382
|
readonly id: "verify";
|
|
382
383
|
readonly objective: "Judge the implementation against accepted requirements using executed evidence.";
|
|
@@ -418,7 +419,7 @@ export declare function getSddPhaseProtocol(id: SddPhaseId): SddPhaseProtocol;
|
|
|
418
419
|
export declare function getSddPhaseProtocolsForRole(role: AgentRoleName): SddPhaseProtocol[];
|
|
419
420
|
export declare function renderSddPhaseDispatchEnvelope(input: SddPhaseDispatchInput): string;
|
|
420
421
|
export declare function renderSddPhaseDispatchTemplate(): string;
|
|
421
|
-
export declare function getSddPhaseOwner(_route: SddRoute, phaseId: SddPhaseId):
|
|
422
|
+
export declare function getSddPhaseOwner(_route: SddRoute, phaseId: SddPhaseId): SddPhaseOwner;
|
|
422
423
|
export declare function getRequiredSddPhaseOrder(route: SddRoute): SddPhaseId[];
|
|
423
424
|
export declare function canEnterSddPhase({ route, completed, target, }: {
|
|
424
425
|
route: SddRoute;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
renderOpenCodeAgentConfigs,
|
|
4
4
|
spawn,
|
|
5
5
|
spawnSync
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CB3EBA7H.js";
|
|
7
7
|
import {
|
|
8
8
|
POLL_INTERVAL_BACKGROUND_MS,
|
|
9
9
|
context7,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
grep_app,
|
|
13
13
|
loadPluginConfig,
|
|
14
14
|
stripJsonComments
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-GIUU6FNE.js";
|
|
16
16
|
|
|
17
17
|
// src/index.ts
|
|
18
18
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thoth-agents",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"description": "Adaptive multi-harness orchestration with seven roles, runtime-autonomous Spec Kit-compatible SDD routes, and external provider boundaries.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,37 +9,37 @@
|
|
|
9
9
|
{
|
|
10
10
|
"path": "agents/deep.md",
|
|
11
11
|
"kind": "agent-config",
|
|
12
|
-
"sha256": "sha256:
|
|
12
|
+
"sha256": "sha256:f00254f54d1e4226247c3acc1f97d718d200939031ee846cdcad5178f82e2311"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"path": "agents/designer.md",
|
|
16
16
|
"kind": "agent-config",
|
|
17
|
-
"sha256": "sha256:
|
|
17
|
+
"sha256": "sha256:506bddde48c14e39ec40fd940ca0993bd468d484f8d461a14c39acf85e878a20"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"path": "agents/explorer.md",
|
|
21
21
|
"kind": "agent-config",
|
|
22
|
-
"sha256": "sha256:
|
|
22
|
+
"sha256": "sha256:3e622eee39d16224fdb22dd29a06da154e9b21273b1da61590b675f77433e1f3"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"path": "agents/librarian.md",
|
|
26
26
|
"kind": "agent-config",
|
|
27
|
-
"sha256": "sha256:
|
|
27
|
+
"sha256": "sha256:0d95292215a64535e8eabca729f9c4778cdaa8542b2467efe5895d9f082d56cb"
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"path": "agents/oracle.md",
|
|
31
31
|
"kind": "agent-config",
|
|
32
|
-
"sha256": "sha256:
|
|
32
|
+
"sha256": "sha256:ce0cabf80941271f9125c4164ddb01250bfff4c96b8432ddebb0b85be725d0a8"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"path": "agents/orchestrator.md",
|
|
36
36
|
"kind": "agent-config",
|
|
37
|
-
"sha256": "sha256:
|
|
37
|
+
"sha256": "sha256:f66650aa018f4cc0d39468eaf2c0ae35e14f7bbdc5eda99cf6a0dc38761961ee"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"path": "agents/quick.md",
|
|
41
41
|
"kind": "agent-config",
|
|
42
|
-
"sha256": "sha256:
|
|
42
|
+
"sha256": "sha256:f82b9658bd19576c2ec611f28ea37115f316200cc6d7ffee10d873db8707cc80"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
"path": "settings.json",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thoth-agents",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"description": "Bundled Spec Kit-compatible SDD skills and MCP configuration; the seven-role global Codex layer requires thoth-agents CLI setup.",
|
|
5
5
|
"skills": "./skills/",
|
|
6
6
|
"mcpServers": "./codex.mcp.json"
|