thoth-agents 0.2.10 → 0.3.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 (150) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.claude-plugin/marketplace.json +21 -0
  3. package/README.md +301 -311
  4. package/dist/agents/configured-role-prompt.d.ts +9 -0
  5. package/dist/agents/prompt-sections.d.ts +8 -4
  6. package/dist/agents/prompt-utils.d.ts +0 -4
  7. package/dist/{chunk-YYVE7YHR.js → chunk-2MZ5C2RN.js} +1755 -1760
  8. package/dist/chunk-XO74DXBZ.js +1781 -0
  9. package/dist/{chunk-MF5NNCPC.js → chunk-YUCGIJPP.js} +12 -30
  10. package/dist/cli/claude-code-install.d.ts +24 -26
  11. package/dist/cli/claude-code-paths.d.ts +0 -28
  12. package/dist/cli/codex-install.d.ts +2 -2
  13. package/dist/cli/codex-paths.d.ts +0 -2
  14. package/dist/cli/config-io.d.ts +5 -0
  15. package/dist/cli/index.js +294 -133
  16. package/dist/cli/install.d.ts +5 -1
  17. package/dist/cli/model-catalog/cache.d.ts +1 -1
  18. package/dist/cli/operations/claude-code.d.ts +6 -3
  19. package/dist/cli/operations/codex.d.ts +2 -1
  20. package/dist/cli/operations/opencode.d.ts +2 -1
  21. package/dist/cli/operations/types.d.ts +11 -1
  22. package/dist/cli/package-root.d.ts +1 -0
  23. package/dist/cli/providers.d.ts +6 -116
  24. package/dist/cli/skills.d.ts +19 -32
  25. package/dist/cli/thoth-mem-install.d.ts +45 -0
  26. package/dist/cli/tui/components/StatusView.d.ts +12 -1
  27. package/dist/cli/tui/index.js +293 -106
  28. package/dist/cli/tui/operations.d.ts +4 -3
  29. package/dist/cli/types.d.ts +0 -10
  30. package/dist/config/constants.d.ts +20 -16
  31. package/dist/config/index.d.ts +0 -1
  32. package/dist/config/loader.d.ts +1 -1
  33. package/dist/config/schema.d.ts +2 -38
  34. package/dist/config/utils.d.ts +1 -2
  35. package/dist/harness/adapters/codex-surfaces.d.ts +3 -3
  36. package/dist/harness/core/agent-pack.d.ts +37 -29
  37. package/dist/harness/core/memory-governance.d.ts +24 -48
  38. package/dist/harness/core/sdd.d.ts +364 -131
  39. package/dist/harness/generate-integration-packages.d.ts +20 -0
  40. package/dist/harness/opencode-init-command.d.ts +11 -0
  41. package/dist/harness/types.d.ts +14 -1
  42. package/dist/harness/writers/claude-code-subagent.d.ts +3 -1
  43. package/dist/hooks/index.d.ts +0 -5
  44. package/dist/index.js +562 -1314
  45. package/dist/mcp/index.d.ts +1 -2
  46. package/package.json +17 -12
  47. package/plugin/.claude-plugin/.thoth-agents-plugin-assets.json +50 -0
  48. package/plugin/.claude-plugin/plugin.json +8 -0
  49. package/plugin/.codex-plugin/.thoth-agents-plugin-assets.json +16 -0
  50. package/plugin/.codex-plugin/plugin.json +7 -0
  51. package/plugin/.mcp.json +19 -0
  52. package/plugin/agents/deep.md +89 -0
  53. package/plugin/agents/designer.md +89 -0
  54. package/plugin/agents/explorer.md +90 -0
  55. package/plugin/agents/librarian.md +90 -0
  56. package/plugin/agents/oracle.md +92 -0
  57. package/plugin/agents/orchestrator.md +128 -0
  58. package/plugin/agents/quick.md +89 -0
  59. package/plugin/codex.mcp.json +17 -0
  60. package/plugin/settings.json +3 -0
  61. package/plugin/skills/thoth-archive/SKILL.md +40 -0
  62. package/plugin/skills/thoth-archive/scripts/archive.mjs +748 -0
  63. package/plugin/skills/thoth-constitution/SKILL.md +45 -0
  64. package/plugin/skills/thoth-constitution/scripts/validate.mjs +167 -0
  65. package/plugin/skills/thoth-constitution/templates/constitution.md +54 -0
  66. package/plugin/skills/thoth-init/SKILL.md +30 -0
  67. package/plugin/skills/thoth-init/scripts/init.mjs +141 -0
  68. package/plugin/skills/thoth-sdd/SKILL.md +83 -0
  69. package/plugin/skills/thoth-sdd/references/phases/analyze.md +21 -0
  70. package/plugin/skills/thoth-sdd/references/phases/checklist.md +20 -0
  71. package/plugin/skills/thoth-sdd/references/phases/clarify.md +15 -0
  72. package/plugin/skills/thoth-sdd/references/phases/converge.md +14 -0
  73. package/plugin/skills/thoth-sdd/references/phases/explore.md +10 -0
  74. package/plugin/skills/thoth-sdd/references/phases/implement.md +19 -0
  75. package/plugin/skills/thoth-sdd/references/phases/plan.md +15 -0
  76. package/plugin/skills/thoth-sdd/references/phases/specify.md +21 -0
  77. package/plugin/skills/thoth-sdd/references/phases/tasks.md +20 -0
  78. package/plugin/skills/thoth-sdd/references/phases/verify.md +22 -0
  79. package/plugin/skills/thoth-sdd/scripts/validate.mjs +1117 -0
  80. package/plugin/skills/thoth-sdd/templates/archive-report.md +25 -0
  81. package/plugin/skills/thoth-sdd/templates/checklist.md +27 -0
  82. package/plugin/skills/thoth-sdd/templates/plan.md +38 -0
  83. package/plugin/skills/thoth-sdd/templates/spec.md +54 -0
  84. package/plugin/skills/thoth-sdd/templates/tasks.md +29 -0
  85. package/plugin/skills/thoth-sdd/templates/verify-report.md +28 -0
  86. package/skills/README.md +12 -0
  87. package/skills/thoth-archive/SKILL.md +40 -0
  88. package/skills/thoth-archive/scripts/archive.mjs +748 -0
  89. package/skills/thoth-constitution/SKILL.md +45 -0
  90. package/skills/thoth-constitution/scripts/validate.mjs +167 -0
  91. package/skills/thoth-constitution/templates/constitution.md +54 -0
  92. package/skills/thoth-init/SKILL.md +30 -0
  93. package/skills/thoth-init/scripts/init.mjs +141 -0
  94. package/skills/thoth-sdd/SKILL.md +83 -0
  95. package/skills/thoth-sdd/references/phases/analyze.md +21 -0
  96. package/skills/thoth-sdd/references/phases/checklist.md +20 -0
  97. package/skills/thoth-sdd/references/phases/clarify.md +15 -0
  98. package/skills/thoth-sdd/references/phases/converge.md +14 -0
  99. package/skills/thoth-sdd/references/phases/explore.md +10 -0
  100. package/skills/thoth-sdd/references/phases/implement.md +19 -0
  101. package/skills/thoth-sdd/references/phases/plan.md +15 -0
  102. package/skills/thoth-sdd/references/phases/specify.md +21 -0
  103. package/skills/thoth-sdd/references/phases/tasks.md +20 -0
  104. package/skills/thoth-sdd/references/phases/verify.md +22 -0
  105. package/skills/thoth-sdd/scripts/validate.mjs +1117 -0
  106. package/skills/thoth-sdd/templates/archive-report.md +25 -0
  107. package/skills/thoth-sdd/templates/checklist.md +27 -0
  108. package/skills/thoth-sdd/templates/plan.md +38 -0
  109. package/skills/thoth-sdd/templates/spec.md +54 -0
  110. package/skills/thoth-sdd/templates/tasks.md +29 -0
  111. package/skills/thoth-sdd/templates/verify-report.md +28 -0
  112. package/thoth-agents.schema.json +0 -39
  113. package/dist/chunk-WBRGPRRB.js +0 -2353
  114. package/dist/cli/custom-skills.d.ts +0 -48
  115. package/dist/cli/skill-manifest.d.ts +0 -32
  116. package/dist/harness/core/skills.d.ts +0 -211
  117. package/dist/harness/generate-codex-plugin.d.ts +0 -9
  118. package/dist/harness/writers/claude-code-skill-layout.d.ts +0 -16
  119. package/dist/harness/writers/fs-skill-collect.d.ts +0 -7
  120. package/dist/harness/writers/skill-layout.d.ts +0 -16
  121. package/dist/hooks/chat-headers.d.ts +0 -16
  122. package/dist/hooks/phase-reminder/index.d.ts +0 -28
  123. package/dist/hooks/post-read-nudge/index.d.ts +0 -18
  124. package/dist/hooks/skill-sync.d.ts +0 -10
  125. package/dist/hooks/thoth-mem/index.d.ts +0 -46
  126. package/dist/hooks/thoth-mem/protocol.d.ts +0 -7
  127. package/dist/mcp/thoth.d.ts +0 -3
  128. package/dist/sdd/artifact-governance/artifact-loader.d.ts +0 -130
  129. package/dist/sdd/artifact-governance/index.d.ts +0 -6
  130. package/dist/sdd/artifact-governance/tasks-validator.d.ts +0 -17
  131. package/dist/sdd/artifact-governance/types.d.ts +0 -52
  132. package/dist/thoth/client.d.ts +0 -14
  133. package/dist/thoth/index.d.ts +0 -2
  134. package/src/skills/_shared/openspec-convention.md +0 -350
  135. package/src/skills/_shared/persistence-contract.md +0 -163
  136. package/src/skills/_shared/thoth-mem-convention.md +0 -123
  137. package/src/skills/executing-plans/SKILL.md +0 -288
  138. package/src/skills/plan-reviewer/SKILL.md +0 -219
  139. package/src/skills/requirements-interview/SKILL.md +0 -233
  140. package/src/skills/sdd-apply/SKILL.md +0 -89
  141. package/src/skills/sdd-archive/SKILL.md +0 -92
  142. package/src/skills/sdd-clarify/SKILL.md +0 -105
  143. package/src/skills/sdd-constitution/SKILL.md +0 -107
  144. package/src/skills/sdd-design/SKILL.md +0 -155
  145. package/src/skills/sdd-init/SKILL.md +0 -233
  146. package/src/skills/sdd-propose/SKILL.md +0 -101
  147. package/src/skills/sdd-spec/SKILL.md +0 -136
  148. package/src/skills/sdd-tasks/SKILL.md +0 -232
  149. package/src/skills/sdd-verify/SKILL.md +0 -131
  150. package/src/skills/thoth-mem-agents/SKILL.md +0 -210
package/dist/cli/index.js CHANGED
@@ -4,10 +4,10 @@ import {
4
4
  getOpenCodeVersion,
5
5
  isOpenCodeInstalled,
6
6
  opencodeAdapter
7
- } from "../chunk-MF5NNCPC.js";
7
+ } from "../chunk-YUCGIJPP.js";
8
8
  import {
9
9
  CODEX_ROLE_NAMES,
10
- RECOMMENDED_SKILLS,
10
+ REQUIRED_SKILLS,
11
11
  SUPPORTED_OPERATION_HARNESSES,
12
12
  applyClaudeCodePlan,
13
13
  applyClaudeCodeSetup,
@@ -38,22 +38,21 @@ import {
38
38
  getOpenCodeModelRoles,
39
39
  getOpenCodeStatus,
40
40
  getOperationHarness,
41
- installRecommendedSkill,
41
+ getRequiredSkillInstallCommand,
42
+ installRequiredSkill,
42
43
  listOperationHarnesses,
43
44
  normalizeEffortSelection
44
- } from "../chunk-YYVE7YHR.js";
45
+ } from "../chunk-2MZ5C2RN.js";
45
46
  import {
46
47
  ALL_AGENT_NAMES,
47
- CUSTOM_SKILLS,
48
- DEFAULT_MODELS,
49
- addPluginToOpenCodeConfig,
50
48
  detectCurrentConfig,
51
- disableDefaultAgents,
52
49
  generateLiteConfig,
50
+ getDefaultOpenCodeModel,
51
+ getDefaultOpenCodeVariant,
53
52
  getExistingLiteConfigPath,
54
- installCustomSkills,
53
+ updateOpenCodeMainConfig,
55
54
  writeLiteConfig
56
- } from "../chunk-WBRGPRRB.js";
55
+ } from "../chunk-XO74DXBZ.js";
57
56
 
58
57
  // src/cli/index.ts
59
58
  import { pathToFileURL } from "url";
@@ -73,6 +72,167 @@ function getHarnessAdapter(harness) {
73
72
  import { existsSync } from "fs";
74
73
  import { homedir } from "os";
75
74
  import { cwd } from "process";
75
+
76
+ // src/cli/thoth-mem-install.ts
77
+ import { spawnSync } from "child_process";
78
+ var THOTH_MEM_SETUP_TIMEOUT_MS = 12e4;
79
+ var STATUS_EXIT_CODE = {
80
+ complete: 0,
81
+ failed: 1,
82
+ partial: 2,
83
+ requires_user_action: 3
84
+ };
85
+ var SETUP_STATUSES = new Set(
86
+ Object.keys(STATUS_EXIT_CODE)
87
+ );
88
+ var STEP_OUTCOMES = /* @__PURE__ */ new Set([
89
+ "planned",
90
+ "skipped",
91
+ "confirmed",
92
+ "failed",
93
+ "unavailable"
94
+ ]);
95
+ function isRecord(value) {
96
+ return typeof value === "object" && value !== null && !Array.isArray(value);
97
+ }
98
+ function isStringArray(value) {
99
+ return Array.isArray(value) && value.every((item) => typeof item === "string");
100
+ }
101
+ function isSetupStep(value) {
102
+ return isRecord(value) && typeof value.name === "string" && value.name.length > 0 && typeof value.outcome === "string" && STEP_OUTCOMES.has(value.outcome);
103
+ }
104
+ function isProviderSetupResult(value, expectedHarness) {
105
+ return isRecord(value) && typeof value.status === "string" && SETUP_STATUSES.has(value.status) && typeof value.changed === "boolean" && value.harness === expectedHarness && value.scope === "global" && typeof value.target === "string" && value.target.length > 0 && Array.isArray(value.steps) && value.steps.every(isSetupStep) && isStringArray(value.diagnostics) && isStringArray(value.manual_actions) && (value.receipt === null || typeof value.receipt === "string");
106
+ }
107
+ function parseProviderSetupResult(stdout, expectedHarness) {
108
+ let value;
109
+ try {
110
+ value = JSON.parse(stdout.trim());
111
+ } catch {
112
+ return void 0;
113
+ }
114
+ return isProviderSetupResult(value, expectedHarness) ? value : void 0;
115
+ }
116
+ function defaultCommandExecutor(command, args, options) {
117
+ const result = spawnSync(command, [...args], {
118
+ cwd: options.cwd,
119
+ encoding: "utf8",
120
+ stdio: ["ignore", "pipe", "pipe"],
121
+ timeout: options.timeoutMs
122
+ });
123
+ return {
124
+ exitCode: result.status,
125
+ stdout: result.stdout ?? "",
126
+ stderr: result.stderr ?? "",
127
+ error: result.error
128
+ };
129
+ }
130
+ function describeError(error) {
131
+ return error instanceof Error ? error.message : String(error);
132
+ }
133
+ function isTimeoutError(error) {
134
+ return isRecord(error) && error.code === "ETIMEDOUT";
135
+ }
136
+ function invalidResult(harness, command, args, exitCode, error) {
137
+ return {
138
+ success: false,
139
+ evidenceValid: false,
140
+ status: "invalid",
141
+ changed: false,
142
+ harness,
143
+ steps: [],
144
+ diagnostics: [],
145
+ manualActions: [],
146
+ receipt: null,
147
+ command,
148
+ args,
149
+ exitCode,
150
+ error
151
+ };
152
+ }
153
+ function getThothMemSetupCommand(harness, dryRun) {
154
+ return {
155
+ command: "npx",
156
+ args: [
157
+ "-y",
158
+ "thoth-mem@latest",
159
+ "setup",
160
+ harness,
161
+ "--scope",
162
+ "global",
163
+ ...dryRun ? ["--plan"] : [],
164
+ "--json"
165
+ ]
166
+ };
167
+ }
168
+ function runThothMemSetup(options) {
169
+ const { command, args } = getThothMemSetupCommand(
170
+ options.harness,
171
+ options.dryRun ?? false
172
+ );
173
+ const executor = options.commandExecutor ?? defaultCommandExecutor;
174
+ let commandResult;
175
+ try {
176
+ commandResult = executor(command, args, {
177
+ cwd: options.cwd,
178
+ timeoutMs: THOTH_MEM_SETUP_TIMEOUT_MS
179
+ });
180
+ } catch (error) {
181
+ return invalidResult(
182
+ options.harness,
183
+ command,
184
+ args,
185
+ null,
186
+ `Unable to launch thoth-mem setup: ${describeError(error)}`
187
+ );
188
+ }
189
+ if (commandResult.error) {
190
+ const stderr = commandResult.stderr.trim().slice(0, 2e3);
191
+ return invalidResult(
192
+ options.harness,
193
+ command,
194
+ args,
195
+ commandResult.exitCode,
196
+ isTimeoutError(commandResult.error) ? `thoth-mem setup timed out after ${THOTH_MEM_SETUP_TIMEOUT_MS} ms${stderr ? `: ${stderr}` : "."}` : `Unable to launch thoth-mem setup: ${describeError(commandResult.error)}`
197
+ );
198
+ }
199
+ const provider = parseProviderSetupResult(
200
+ commandResult.stdout,
201
+ options.harness
202
+ );
203
+ if (!provider) {
204
+ const stderr = commandResult.stderr.trim();
205
+ return invalidResult(
206
+ options.harness,
207
+ command,
208
+ args,
209
+ commandResult.exitCode,
210
+ stderr ? `thoth-mem returned invalid JSON evidence: ${stderr.slice(0, 2e3)}` : "thoth-mem returned invalid JSON evidence."
211
+ );
212
+ }
213
+ const expectedExitCode = STATUS_EXIT_CODE[provider.status];
214
+ const evidenceValid = commandResult.exitCode === expectedExitCode;
215
+ return {
216
+ success: evidenceValid && provider.status === "complete",
217
+ evidenceValid,
218
+ status: provider.status,
219
+ changed: provider.changed,
220
+ harness: provider.harness,
221
+ target: provider.target,
222
+ steps: provider.steps,
223
+ diagnostics: provider.diagnostics,
224
+ manualActions: provider.manual_actions,
225
+ receipt: provider.receipt,
226
+ command,
227
+ args,
228
+ exitCode: commandResult.exitCode,
229
+ ...!evidenceValid ? {
230
+ error: `thoth-mem exit code ${String(commandResult.exitCode)} contradicts reported status ${provider.status} (expected ${expectedExitCode}).`
231
+ } : {}
232
+ };
233
+ }
234
+
235
+ // src/cli/install.ts
76
236
  var GREEN = "\x1B[32m";
77
237
  var BLUE = "\x1B[34m";
78
238
  var YELLOW = "\x1B[33m";
@@ -107,14 +267,8 @@ function printError(message) {
107
267
  function printInfo(message) {
108
268
  console.log(`${SYMBOLS.info} ${message}`);
109
269
  }
110
- function formatCustomSkillReasons(report) {
111
- if (report.updatedSkills.length === 0 && report.removedSkills.length === 0) {
112
- return "all bundled skills already up to date";
113
- }
114
- return `${report.updatedSkills.length} updated, ${report.removedSkills.length} removed, ${report.skippedSkills.length} unchanged`;
115
- }
116
- function formatSkillReasons(reasons) {
117
- return reasons.join(", ");
270
+ function printWarning(message) {
271
+ console.log(`${SYMBOLS.warn} ${message}`);
118
272
  }
119
273
  async function checkOpenCodeInstalled() {
120
274
  const installed = await isOpenCodeInstalled();
@@ -147,29 +301,87 @@ function handleStepResult(result, successMsg) {
147
301
  );
148
302
  return true;
149
303
  }
150
- function formatConfigSummary() {
304
+ function formatConfigSummary(dryRun) {
151
305
  const lines = [];
152
306
  lines.push(`${BOLD}Configuration Summary${RESET}`);
153
307
  lines.push("");
154
308
  lines.push(` ${BOLD}Preset:${RESET} ${BLUE}openai${RESET}`);
155
- lines.push(` ${SYMBOLS.check} Seven-agent thoth-agents roster`);
309
+ lines.push(` ${SYMBOLS.check} Seven-role adaptive thoth-agents roster`);
156
310
  lines.push(` ${SYMBOLS.check} OpenAI models by default`);
157
- lines.push(` ${SYMBOLS.check} thoth-mem enabled for orchestrator memory`);
158
- lines.push(` ${SYMBOLS.check} Delegation results persisted to disk`);
159
- lines.push(` ${SYMBOLS.check} Bundled SDD skills ready for install`);
160
- const seeDocs = "see docs/provider-configurations.md";
161
- lines.push(` ${DIM}\u25CB Kimi \u2014 ${seeDocs}${RESET}`);
162
- lines.push(` ${DIM}\u25CB GitHub Copilot \u2014 ${seeDocs}${RESET}`);
163
- lines.push(` ${DIM}\u25CB ZAI Coding Plan \u2014 ${seeDocs}${RESET}`);
311
+ lines.push(` ${SYMBOLS.check} Direct, Accelerated, and Full SDD routing`);
312
+ lines.push(
313
+ ` ${SYMBOLS.check} ${dryRun ? "thoth-mem setup plan confirmed" : "thoth-mem setup completed through its provider-owned installer"}`
314
+ );
315
+ lines.push(
316
+ ` ${DIM}\u25CB thoth-mem remains the owner of hooks, MCP, skill, lifecycle, persistence, receipts, and recovery.${RESET}`
317
+ );
318
+ lines.push(` ${SYMBOLS.check} Required external skills for this harness`);
164
319
  return lines.join("\n");
165
320
  }
166
- async function runInstall(config) {
321
+ function installRequiredSkillsForHarness(harness, dryRun, homeDir = homedir()) {
322
+ if (dryRun) {
323
+ printInfo(`Dry run mode - required ${harness} skills:`);
324
+ for (const skill of REQUIRED_SKILLS) {
325
+ const { command, args } = getRequiredSkillInstallCommand(skill, harness);
326
+ printInfo(` - ${skill.name}: ${command} ${args.join(" ")}`);
327
+ }
328
+ printSuccess(`Required external skills planned for ${harness}`);
329
+ return true;
330
+ }
331
+ let installed = 0;
332
+ let alreadyInstalled = 0;
333
+ for (const skill of REQUIRED_SKILLS) {
334
+ printInfo(`Installing required skill ${skill.name} for ${harness}...`);
335
+ const result = installRequiredSkill(skill, harness, { homeDir });
336
+ if (result.status === "failed") {
337
+ printError(`Failed to install required skill: ${skill.name}`);
338
+ return false;
339
+ }
340
+ if (result.status === "installed") {
341
+ installed += 1;
342
+ printSuccess(`Installed: ${skill.name}`);
343
+ } else {
344
+ alreadyInstalled += 1;
345
+ printInfo(`Skipped: ${skill.name} (already installed)`);
346
+ }
347
+ }
348
+ printSuccess(
349
+ `${installed} required skills installed, ${alreadyInstalled} already installed`
350
+ );
351
+ return true;
352
+ }
353
+ function printThothMemSetupResult(result, dryRun) {
354
+ printInfo(`Provider command: ${result.command} ${result.args.join(" ")}`);
355
+ for (const step of result.steps) {
356
+ printInfo(`thoth-mem: ${step.name} [${step.outcome}]`);
357
+ }
358
+ for (const diagnostic of result.diagnostics) printInfo(diagnostic);
359
+ if (result.receipt) printInfo(`thoth-mem receipt: ${result.receipt}`);
360
+ for (const action of result.manualActions) {
361
+ printWarning(`thoth-mem manual action: ${action}`);
362
+ }
363
+ if (!result.success) {
364
+ printError(`thoth-mem setup is incomplete: ${result.status}`);
365
+ if (result.error) printError(result.error);
366
+ return false;
367
+ }
368
+ printSuccess(
369
+ dryRun ? "thoth-mem setup plan confirmed" : "thoth-mem setup complete through its provider-owned installer"
370
+ );
371
+ return true;
372
+ }
373
+ function installThothMemForHarness(harness, dryRun, dependencies) {
374
+ const setup = dependencies.runThothMemSetup ?? runThothMemSetup;
375
+ return printThothMemSetupResult(
376
+ setup({ harness, dryRun, cwd: cwd() }),
377
+ dryRun
378
+ );
379
+ }
380
+ async function runInstall(config, dependencies) {
167
381
  const detected = detectCurrentConfig();
168
382
  const isUpdate = detected.isInstalled;
169
383
  printHeader(isUpdate);
170
- let totalSteps = 4;
171
- if (config.installSkills) totalSteps += 1;
172
- if (config.installCustomSkills) totalSteps += 1;
384
+ const totalSteps = 5;
173
385
  let step = 1;
174
386
  printStep(step++, totalSteps, "Checking OpenCode installation...");
175
387
  if (config.dryRun) {
@@ -178,19 +390,19 @@ async function runInstall(config) {
178
390
  const { ok } = await checkOpenCodeInstalled();
179
391
  if (!ok) return 1;
180
392
  }
181
- printStep(step++, totalSteps, "Adding thoth-agents plugin...");
182
- if (config.dryRun) {
183
- printInfo("Dry run mode - skipping plugin installation");
184
- } else {
185
- const pluginResult = await addPluginToOpenCodeConfig();
186
- if (!handleStepResult(pluginResult, "Plugin added")) return 1;
187
- }
188
- printStep(step++, totalSteps, "Disabling OpenCode default agents...");
393
+ printStep(
394
+ step++,
395
+ totalSteps,
396
+ "Configuring the thoth-agents plugin and OpenCode default agents..."
397
+ );
189
398
  if (config.dryRun) {
190
- printInfo("Dry run mode - skipping agent disabling");
399
+ printInfo("Dry run mode - skipping main config update");
191
400
  } else {
192
- const agentResult = disableDefaultAgents();
193
- if (!handleStepResult(agentResult, "Default agents disabled")) return 1;
401
+ const mainConfigResult = updateOpenCodeMainConfig({
402
+ ensurePlugin: true,
403
+ disableDefaults: true
404
+ });
405
+ if (!handleStepResult(mainConfigResult, "Main config updated")) return 1;
194
406
  }
195
407
  printStep(step++, totalSteps, "Writing thoth-agents configuration...");
196
408
  if (config.dryRun) {
@@ -218,70 +430,14 @@ ${JSON.stringify(liteConfig, null, 2)}
218
430
  return 1;
219
431
  }
220
432
  }
221
- if (config.installSkills) {
222
- printStep(step++, totalSteps, "Installing recommended external skills...");
223
- if (config.dryRun) {
224
- printInfo("Dry run mode - would install skills:");
225
- for (const skill of RECOMMENDED_SKILLS) {
226
- printInfo(` - ${skill.name}`);
227
- }
228
- } else {
229
- let skillsInstalled = 0;
230
- let skillsAlreadyInstalled = 0;
231
- for (const skill of RECOMMENDED_SKILLS) {
232
- printInfo(`Installing ${skill.name}...`);
233
- const result = installRecommendedSkill(skill);
234
- if (result.status === "installed") {
235
- printSuccess(`Installed: ${skill.name}`);
236
- skillsInstalled++;
237
- } else if (result.status === "already-installed") {
238
- printInfo(`Skipped: ${skill.name} (already installed)`);
239
- skillsAlreadyInstalled++;
240
- } else {
241
- printError(`Failed to install recommended skill: ${skill.name}`);
242
- return 1;
243
- }
244
- }
245
- printSuccess(
246
- `${skillsInstalled} installed, ${skillsAlreadyInstalled} already installed`
247
- );
248
- }
249
- }
250
- if (config.installCustomSkills) {
251
- printStep(step++, totalSteps, "Installing bundled thoth-agents skills...");
252
- if (config.dryRun) {
253
- printInfo("Dry run mode - would install bundled skills:");
254
- for (const skill of CUSTOM_SKILLS) {
255
- printInfo(` - ${skill.name}`);
256
- }
257
- } else {
258
- const report = installCustomSkills();
259
- for (const updatedSkill of report.updatedSkills) {
260
- printSuccess(
261
- `Installed: ${updatedSkill.skill.name} (${formatSkillReasons(updatedSkill.reasons)})`
262
- );
263
- }
264
- for (const skippedSkill of report.skippedSkills) {
265
- printInfo(`Up to date: ${skippedSkill.name}`);
266
- }
267
- for (const removedSkill of report.removedSkills) {
268
- printInfo(`Removed obsolete skill: ${removedSkill}`);
269
- }
270
- for (const failedSkill of report.failedSkills) {
271
- printError(
272
- `Failed: ${failedSkill.skill.name} (${formatSkillReasons(failedSkill.reasons)})`
273
- );
274
- }
275
- if (!report.success) {
276
- return 1;
277
- }
278
- printSuccess(
279
- `Bundled skills processed: ${formatCustomSkillReasons(report)}`
280
- );
281
- }
433
+ printStep(step++, totalSteps, "Installing required external skills...");
434
+ if (!installRequiredSkillsForHarness("opencode", config.dryRun)) return 1;
435
+ printStep(step++, totalSteps, "Configuring provider-owned thoth-mem...");
436
+ if (!installThothMemForHarness("opencode", config.dryRun, dependencies)) {
437
+ return 1;
282
438
  }
283
439
  console.log();
284
- console.log(formatConfigSummary());
440
+ console.log(formatConfigSummary(config.dryRun));
285
441
  console.log();
286
442
  const statusMsg = isUpdate ? "thoth-agents updated!" : "thoth-agents installation complete!";
287
443
  console.log(`${SYMBOLS.star} ${BOLD}${GREEN}${statusMsg}${RESET}`);
@@ -291,32 +447,22 @@ ${JSON.stringify(liteConfig, null, 2)}
291
447
  console.log(` 1. Start OpenCode:`);
292
448
  console.log(` ${BLUE}$ opencode${RESET}`);
293
449
  console.log();
294
- const modelsInfo = "Default configuration uses OpenAI models (gpt-5.4 / gpt-5.4-mini).";
450
+ const modelsInfo = "Default configuration uses OpenAI models.";
295
451
  console.log(`${BOLD}${modelsInfo}${RESET}`);
296
452
  console.log(
297
- ` ${DIM}Includes the seven-agent roster, thoth-mem memory defaults,${RESET}`
298
- );
299
- console.log(
300
- ` ${DIM}native task delegation, and bundled SDD skills.${RESET}`
453
+ ` ${DIM}Includes the seven-role adaptive roster, native delegation, and Direct / Accelerated / Full SDD routing.${RESET}`
301
454
  );
302
- const altProviders = "For alternative providers (Kimi, GitHub Copilot, ZAI Coding Plan)";
303
- console.log(`${BOLD}${altProviders}, see:${RESET}`);
304
- const docsUrl = "https://github.com/EremesNG/thoth-agents/blob/master/docs/provider-configurations.md";
305
- console.log(` ${BLUE}${docsUrl}${RESET}`);
306
- console.log();
307
455
  return 0;
308
456
  }
309
457
  function createInstallConfig(args) {
310
458
  return {
311
459
  agent: args.agent ?? "opencode",
312
460
  hasTmux: args.tmux === "yes",
313
- installSkills: args.skills === "yes",
314
- installCustomSkills: true,
315
461
  dryRun: args.dryRun,
316
462
  reset: args.reset ?? false
317
463
  };
318
464
  }
319
- async function install(args) {
465
+ async function install(args, dependencies = {}) {
320
466
  const config = createInstallConfig(args);
321
467
  if (config.agent === "codex") {
322
468
  const plan = buildCodexSetupPlan({
@@ -333,6 +479,10 @@ async function install(args) {
333
479
  printError(`Codex install failed: ${result.error}`);
334
480
  return 1;
335
481
  }
482
+ if (!installRequiredSkillsForHarness("codex", config.dryRun)) return 1;
483
+ if (!installThothMemForHarness("codex", config.dryRun, dependencies)) {
484
+ return 1;
485
+ }
336
486
  printSuccess(
337
487
  config.dryRun ? "Codex dry-run complete; no files written" : "Codex agent-pack setup complete"
338
488
  );
@@ -343,8 +493,7 @@ async function install(args) {
343
493
  dryRun: config.dryRun,
344
494
  reset: config.reset,
345
495
  scope: "user",
346
- projectRoot: cwd(),
347
- homeDir: homedir()
496
+ projectRoot: cwd()
348
497
  });
349
498
  console.log(formatClaudeCodeSetupPlan(plan));
350
499
  const result = applyClaudeCodeSetup(plan);
@@ -353,12 +502,16 @@ async function install(args) {
353
502
  printError(`Claude Code install failed: ${result.error}`);
354
503
  return 1;
355
504
  }
505
+ if (!installRequiredSkillsForHarness("claude", config.dryRun)) return 1;
506
+ if (!installThothMemForHarness("claude", config.dryRun, dependencies)) {
507
+ return 1;
508
+ }
356
509
  printSuccess(
357
- config.dryRun ? "Claude Code dry-run complete; no files written" : "Claude Code plugin installed as thoth-agents@skills-dir (restart Claude Code or run /reload-plugins to activate)"
510
+ config.dryRun ? "Claude Code dry-run complete; no files written" : "Claude Code plugin installed as thoth-agents@thoth-agents through the native manager (restart Claude Code or run /reload-plugins to activate)"
358
511
  );
359
512
  return 0;
360
513
  }
361
- return runInstall(config);
514
+ return runInstall(config, dependencies);
362
515
  }
363
516
 
364
517
  // src/cli/commands.ts
@@ -382,7 +535,7 @@ function formatPaths(paths) {
382
535
  }
383
536
  function formatWarnings(warnings) {
384
537
  return warnings.map(
385
- (warning) => `- [${warning.severity}] ${warning.message}`
538
+ (warning) => `- [${warning.severity}]${warning.code ? ` [${warning.code}]` : ""} ${warning.message}`
386
539
  );
387
540
  }
388
541
  function formatDisclaimers(disclaimers) {
@@ -409,6 +562,12 @@ function formatHarnessStatusReport(reports) {
409
562
  `${report.displayName ?? getOperationHarness(report.harness).displayName} (${report.harness})`,
410
563
  `State: ${report.state}`,
411
564
  `Summary: ${report.summary}`,
565
+ ...report.providerCapability ? [
566
+ "Provider evidence:",
567
+ `Provider capability: ${report.providerCapability.state}`,
568
+ `Evidence source: ${report.providerCapability.source}`,
569
+ `Evidence basis: ${report.providerCapability.basis.length > 0 ? report.providerCapability.basis.join("; ") : "none supplied"}`
570
+ ] : [],
412
571
  ...report.targets.length > 0 ? ["Targets:", ...report.targets.map(formatTarget)] : [],
413
572
  ...report.diagnostics.length > 0 ? ["Warnings:", ...formatWarnings(report.diagnostics)] : [],
414
573
  ...report.disclaimers && report.disclaimers.length > 0 ? ["Disclaimers:", ...formatDisclaimers(report.disclaimers)] : [],
@@ -447,6 +606,7 @@ function formatOperationPlan(plan) {
447
606
  `Summary: ${plan.summary}`
448
607
  ],
449
608
  plan.targets.length > 0 ? ["Targets:", ...plan.targets.map(formatTarget)] : [],
609
+ plan.blockerTargets?.length ? ["Blocking targets:", ...plan.blockerTargets.map(formatTarget)] : [],
450
610
  plan.surfaces.length > 0 ? [
451
611
  "Managed surfaces:",
452
612
  ...plan.surfaces.map(
@@ -476,6 +636,7 @@ function formatOperationApplyResult(result) {
476
636
  `Summary: ${result.summary}`
477
637
  ],
478
638
  result.changedTargets.length > 0 ? ["Changed targets:", ...result.changedTargets.map(formatTarget)] : [],
639
+ result.diagnosticTargets?.length ? ["Diagnostic targets:", ...result.diagnosticTargets.map(formatTarget)] : [],
479
640
  result.backups.length > 0 ? ["Backups:", ...formatPaths(result.backups)] : [],
480
641
  result.warnings.length > 0 ? ["Warnings:", ...formatWarnings(result.warnings)] : [],
481
642
  result.disclaimers.length > 0 ? ["Disclaimers:", ...formatDisclaimers(result.disclaimers)] : []
@@ -503,7 +664,6 @@ Commands:
503
664
 
504
665
  Options:
505
666
  --tmux=yes|no Enable tmux integration (yes/no)
506
- --skills=yes|no Install recommended external skills
507
667
  --no-tui Non-interactive mode
508
668
  --dry-run Simulate install without writing files
509
669
  --reset Repair managed installer-owned targets
@@ -525,14 +685,14 @@ OpenCode loads the plugin with config such as:
525
685
  That plugin entry does not create a global thoth-agents command.
526
686
  Run this CLI through a global install, npx, or pnpm dlx.
527
687
 
528
- OpenCode install configures the seven-agent roster, thoth-mem defaults,
529
- native task delegation, and bundled SDD skills for OpenCode.
688
+ OpenCode install configures the adaptive seven-role roster and native task delegation.
689
+ Provider capability is external and reported only from caller-supplied evidence.
530
690
 
531
- Bundled thoth-agents skills are always installed.
532
- Use --skills=no to skip only recommended external skills.
691
+ External required skills are installed for every harness:
692
+ simplify, tdd, progressive-context-router, and architectural-grilling.
693
+ Their installation is mandatory and cannot be skipped.
533
694
 
534
- The generated config uses OpenAI by default.
535
- For alternative providers, see docs/provider-configurations.md.
695
+ The generated OpenCode config supports the built-in OpenAI preset only.
536
696
 
537
697
  Examples:
538
698
  thoth-agents
@@ -543,7 +703,7 @@ Examples:
543
703
  pnpm dlx thoth-agents@latest install --agent=codex --dry-run
544
704
  pnpm dlx thoth-agents@latest install --agent=claude
545
705
  pnpm dlx thoth-agents@latest install --agent=claude --dry-run
546
- pnpm dlx thoth-agents install --no-tui --tmux=no --skills=yes
706
+ pnpm dlx thoth-agents install --no-tui --tmux=no
547
707
  pnpm dlx thoth-agents install --dry-run
548
708
  pnpm dlx thoth-agents install --reset
549
709
  pnpm dlx thoth-agents generate --harness=codex --dry-run
@@ -588,7 +748,8 @@ function defaultModelRoles(harness) {
588
748
  }
589
749
  return ALL_AGENT_NAMES.map((role) => ({
590
750
  role,
591
- model: DEFAULT_MODELS[role] ?? "openai/gpt-5.4"
751
+ model: getDefaultOpenCodeModel(role),
752
+ effort: { kind: "effort", value: getDefaultOpenCodeVariant(role) }
592
753
  }));
593
754
  }
594
755
  function resolveCliModelRoles(harness, roles, resolution) {
@@ -890,8 +1051,6 @@ function parseInstallArgs(args) {
890
1051
  result.tui = false;
891
1052
  } else if (arg.startsWith("--tmux=")) {
892
1053
  result.tmux = parseBooleanArg("--tmux", arg.split("=")[1] ?? "");
893
- } else if (arg.startsWith("--skills=")) {
894
- result.skills = parseBooleanArg("--skills", arg.split("=")[1] ?? "");
895
1054
  } else if (arg === "--dry-run") {
896
1055
  result.dryRun = true;
897
1056
  } else if (arg === "--reset") {
@@ -906,6 +1065,8 @@ function parseInstallArgs(args) {
906
1065
  result.agent = agent;
907
1066
  } else if (arg === "-h" || arg === "--help") {
908
1067
  throw new Error("help");
1068
+ } else {
1069
+ throw new Error(`Unsupported install option: ${arg}`);
909
1070
  }
910
1071
  }
911
1072
  return result;
@@ -1,3 +1,7 @@
1
+ import { type ThothMemSetupOptions, type ThothMemSetupResult } from './thoth-mem-install';
1
2
  import type { InstallArgs, InstallConfig } from './types';
3
+ export interface InstallDependencies {
4
+ runThothMemSetup?: (options: ThothMemSetupOptions) => ThothMemSetupResult;
5
+ }
2
6
  export declare function createInstallConfig(args: InstallArgs): InstallConfig;
3
- export declare function install(args: InstallArgs): Promise<number>;
7
+ export declare function install(args: InstallArgs, dependencies?: InstallDependencies): Promise<number>;
@@ -11,8 +11,8 @@ export declare const modelsDevCacheSchema: z.ZodObject<{
11
11
  provider: z.ZodString;
12
12
  efforts: z.ZodArray<z.ZodString>;
13
13
  source: z.ZodEnum<{
14
- manual: "manual";
15
14
  remote: "remote";
15
+ manual: "manual";
16
16
  lkg: "lkg";
17
17
  }>;
18
18
  }, z.core.$loose>>;
@@ -1,9 +1,12 @@
1
+ import type { ProviderEvidenceInput } from '../../harness/types';
2
+ import { type ClaudeCommandExecutor } from '../claude-code-install';
1
3
  import type { ClaudeCodeInstallScope } from '../claude-code-paths';
2
4
  import type { HarnessAction, HarnessStatusReport, ModelConfigInput, ModelRoleInput, OperationApplyResult, OperationContext, OperationPlan } from './types';
3
5
  export interface ClaudeCodeOperationContext extends OperationContext {
4
6
  scope?: ClaudeCodeInstallScope;
5
7
  homeDir?: string;
6
8
  packageRoot?: string;
9
+ commandExecutor?: ClaudeCommandExecutor;
7
10
  }
8
11
  export type ClaudeCodeEffortResolution = {
9
12
  ok: true;
@@ -18,13 +21,13 @@ export declare const claudeCodeOperationAdapter: {
18
21
  readonly id: "claude";
19
22
  readonly displayName: "Claude Code";
20
23
  readonly available: true;
21
- readonly description: "Claude Code plugin package and managed subagent surfaces.";
24
+ readonly description: "Native Claude Code marketplace plugin and required skills.";
22
25
  readonly actions: HarnessAction[];
23
26
  };
24
- export declare function getClaudeCodeStatus(context?: ClaudeCodeOperationContext): HarnessStatusReport;
27
+ export declare function getClaudeCodeStatus(context?: ClaudeCodeOperationContext, evidence?: ProviderEvidenceInput): HarnessStatusReport;
25
28
  export declare function buildClaudeCodeInstallPlan(context?: ClaudeCodeOperationContext): OperationPlan;
26
29
  export declare function buildClaudeCodeUpdatePlan(context?: ClaudeCodeOperationContext): OperationPlan;
27
30
  export declare function buildClaudeCodeSyncPlan(context?: ClaudeCodeOperationContext): OperationPlan;
28
- export declare function buildClaudeCodeModelPlan(input: ModelConfigInput, context?: ClaudeCodeOperationContext): OperationPlan;
31
+ export declare function buildClaudeCodeModelPlan(input: ModelConfigInput, _context?: ClaudeCodeOperationContext): OperationPlan;
29
32
  export declare function applyClaudeCodePlan(plan: OperationPlan): OperationApplyResult;
30
33
  export declare function defaultClaudeCodeModelRoles(): ModelRoleInput[];
@@ -1,3 +1,4 @@
1
+ import type { ProviderEvidenceInput } from '../../harness/types';
1
2
  import type { CodexInstallScope } from '../codex-paths';
2
3
  import type { HarnessAction, HarnessStatusReport, ModelConfigInput, ModelRoleInput, OperationApplyResult, OperationContext, OperationPlan } from './types';
3
4
  export interface CodexOperationContext extends OperationContext {
@@ -14,7 +15,7 @@ export declare const codexOperationAdapter: {
14
15
  readonly description: "Codex agent-pack and managed subagent surfaces.";
15
16
  readonly actions: HarnessAction[];
16
17
  };
17
- export declare function getCodexStatus(context?: CodexOperationContext): HarnessStatusReport;
18
+ export declare function getCodexStatus(context?: CodexOperationContext, evidence?: ProviderEvidenceInput): HarnessStatusReport;
18
19
  export declare function buildCodexUpdatePlan(context?: CodexOperationContext): OperationPlan;
19
20
  export declare function buildCodexSyncPlan(context?: CodexOperationContext): OperationPlan;
20
21
  export declare function buildCodexInstallPlan(context?: CodexOperationContext): OperationPlan;