thoth-agents 0.2.11 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) 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-ASKXWU6E.js → chunk-2MZ5C2RN.js} +1078 -1725
  8. package/dist/chunk-XO74DXBZ.js +1781 -0
  9. package/dist/{chunk-6BNAV534.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/index.js +279 -119
  15. package/dist/cli/install.d.ts +5 -1
  16. package/dist/cli/model-catalog/cache.d.ts +1 -1
  17. package/dist/cli/operations/claude-code.d.ts +6 -3
  18. package/dist/cli/operations/codex.d.ts +2 -1
  19. package/dist/cli/operations/opencode.d.ts +2 -1
  20. package/dist/cli/operations/types.d.ts +9 -1
  21. package/dist/cli/package-root.d.ts +1 -0
  22. package/dist/cli/providers.d.ts +6 -116
  23. package/dist/cli/skills.d.ts +19 -32
  24. package/dist/cli/thoth-mem-install.d.ts +45 -0
  25. package/dist/cli/tui/components/StatusView.d.ts +12 -1
  26. package/dist/cli/tui/index.js +256 -142
  27. package/dist/cli/tui/operations.d.ts +4 -3
  28. package/dist/cli/types.d.ts +0 -10
  29. package/dist/config/constants.d.ts +20 -16
  30. package/dist/config/index.d.ts +0 -1
  31. package/dist/config/loader.d.ts +1 -1
  32. package/dist/config/schema.d.ts +2 -38
  33. package/dist/config/utils.d.ts +1 -2
  34. package/dist/harness/adapters/codex-surfaces.d.ts +3 -3
  35. package/dist/harness/core/agent-pack.d.ts +37 -29
  36. package/dist/harness/core/memory-governance.d.ts +24 -48
  37. package/dist/harness/core/sdd.d.ts +364 -131
  38. package/dist/harness/generate-integration-packages.d.ts +20 -0
  39. package/dist/harness/opencode-init-command.d.ts +11 -0
  40. package/dist/harness/types.d.ts +14 -1
  41. package/dist/harness/writers/claude-code-subagent.d.ts +3 -1
  42. package/dist/hooks/index.d.ts +0 -5
  43. package/dist/index.js +562 -1314
  44. package/dist/mcp/index.d.ts +1 -2
  45. package/package.json +17 -12
  46. package/plugin/.claude-plugin/.thoth-agents-plugin-assets.json +50 -0
  47. package/plugin/.claude-plugin/plugin.json +8 -0
  48. package/plugin/.codex-plugin/.thoth-agents-plugin-assets.json +16 -0
  49. package/plugin/.codex-plugin/plugin.json +7 -0
  50. package/plugin/.mcp.json +19 -0
  51. package/plugin/agents/deep.md +89 -0
  52. package/plugin/agents/designer.md +89 -0
  53. package/plugin/agents/explorer.md +90 -0
  54. package/plugin/agents/librarian.md +90 -0
  55. package/plugin/agents/oracle.md +92 -0
  56. package/plugin/agents/orchestrator.md +128 -0
  57. package/plugin/agents/quick.md +89 -0
  58. package/plugin/codex.mcp.json +17 -0
  59. package/plugin/settings.json +3 -0
  60. package/plugin/skills/thoth-archive/SKILL.md +40 -0
  61. package/plugin/skills/thoth-archive/scripts/archive.mjs +748 -0
  62. package/plugin/skills/thoth-constitution/SKILL.md +45 -0
  63. package/plugin/skills/thoth-constitution/scripts/validate.mjs +167 -0
  64. package/plugin/skills/thoth-constitution/templates/constitution.md +54 -0
  65. package/plugin/skills/thoth-init/SKILL.md +30 -0
  66. package/plugin/skills/thoth-init/scripts/init.mjs +141 -0
  67. package/plugin/skills/thoth-sdd/SKILL.md +83 -0
  68. package/plugin/skills/thoth-sdd/references/phases/analyze.md +21 -0
  69. package/plugin/skills/thoth-sdd/references/phases/checklist.md +20 -0
  70. package/plugin/skills/thoth-sdd/references/phases/clarify.md +15 -0
  71. package/plugin/skills/thoth-sdd/references/phases/converge.md +14 -0
  72. package/plugin/skills/thoth-sdd/references/phases/explore.md +10 -0
  73. package/plugin/skills/thoth-sdd/references/phases/implement.md +19 -0
  74. package/plugin/skills/thoth-sdd/references/phases/plan.md +15 -0
  75. package/plugin/skills/thoth-sdd/references/phases/specify.md +21 -0
  76. package/plugin/skills/thoth-sdd/references/phases/tasks.md +20 -0
  77. package/plugin/skills/thoth-sdd/references/phases/verify.md +22 -0
  78. package/plugin/skills/thoth-sdd/scripts/validate.mjs +1117 -0
  79. package/plugin/skills/thoth-sdd/templates/archive-report.md +25 -0
  80. package/plugin/skills/thoth-sdd/templates/checklist.md +27 -0
  81. package/plugin/skills/thoth-sdd/templates/plan.md +38 -0
  82. package/plugin/skills/thoth-sdd/templates/spec.md +54 -0
  83. package/plugin/skills/thoth-sdd/templates/tasks.md +29 -0
  84. package/plugin/skills/thoth-sdd/templates/verify-report.md +28 -0
  85. package/skills/README.md +12 -0
  86. package/skills/thoth-archive/SKILL.md +40 -0
  87. package/skills/thoth-archive/scripts/archive.mjs +748 -0
  88. package/skills/thoth-constitution/SKILL.md +45 -0
  89. package/skills/thoth-constitution/scripts/validate.mjs +167 -0
  90. package/skills/thoth-constitution/templates/constitution.md +54 -0
  91. package/skills/thoth-init/SKILL.md +30 -0
  92. package/skills/thoth-init/scripts/init.mjs +141 -0
  93. package/skills/thoth-sdd/SKILL.md +83 -0
  94. package/skills/thoth-sdd/references/phases/analyze.md +21 -0
  95. package/skills/thoth-sdd/references/phases/checklist.md +20 -0
  96. package/skills/thoth-sdd/references/phases/clarify.md +15 -0
  97. package/skills/thoth-sdd/references/phases/converge.md +14 -0
  98. package/skills/thoth-sdd/references/phases/explore.md +10 -0
  99. package/skills/thoth-sdd/references/phases/implement.md +19 -0
  100. package/skills/thoth-sdd/references/phases/plan.md +15 -0
  101. package/skills/thoth-sdd/references/phases/specify.md +21 -0
  102. package/skills/thoth-sdd/references/phases/tasks.md +20 -0
  103. package/skills/thoth-sdd/references/phases/verify.md +22 -0
  104. package/skills/thoth-sdd/scripts/validate.mjs +1117 -0
  105. package/skills/thoth-sdd/templates/archive-report.md +25 -0
  106. package/skills/thoth-sdd/templates/checklist.md +27 -0
  107. package/skills/thoth-sdd/templates/plan.md +38 -0
  108. package/skills/thoth-sdd/templates/spec.md +54 -0
  109. package/skills/thoth-sdd/templates/tasks.md +29 -0
  110. package/skills/thoth-sdd/templates/verify-report.md +28 -0
  111. package/thoth-agents.schema.json +0 -39
  112. package/dist/chunk-OZE7JVGS.js +0 -2344
  113. package/dist/cli/custom-skills.d.ts +0 -49
  114. package/dist/cli/skill-manifest.d.ts +0 -32
  115. package/dist/harness/core/skills.d.ts +0 -211
  116. package/dist/harness/generate-codex-plugin.d.ts +0 -9
  117. package/dist/harness/writers/claude-code-skill-layout.d.ts +0 -16
  118. package/dist/harness/writers/fs-skill-collect.d.ts +0 -7
  119. package/dist/harness/writers/skill-layout.d.ts +0 -16
  120. package/dist/hooks/chat-headers.d.ts +0 -16
  121. package/dist/hooks/phase-reminder/index.d.ts +0 -28
  122. package/dist/hooks/post-read-nudge/index.d.ts +0 -18
  123. package/dist/hooks/skill-sync.d.ts +0 -10
  124. package/dist/hooks/thoth-mem/index.d.ts +0 -46
  125. package/dist/hooks/thoth-mem/protocol.d.ts +0 -7
  126. package/dist/mcp/thoth.d.ts +0 -3
  127. package/dist/sdd/artifact-governance/artifact-loader.d.ts +0 -130
  128. package/dist/sdd/artifact-governance/index.d.ts +0 -6
  129. package/dist/sdd/artifact-governance/tasks-validator.d.ts +0 -17
  130. package/dist/sdd/artifact-governance/types.d.ts +0 -52
  131. package/dist/thoth/client.d.ts +0 -14
  132. package/dist/thoth/index.d.ts +0 -2
  133. package/src/skills/_shared/openspec-convention.md +0 -350
  134. package/src/skills/_shared/persistence-contract.md +0 -163
  135. package/src/skills/_shared/thoth-mem-convention.md +0 -123
  136. package/src/skills/executing-plans/SKILL.md +0 -288
  137. package/src/skills/plan-reviewer/SKILL.md +0 -219
  138. package/src/skills/requirements-interview/SKILL.md +0 -233
  139. package/src/skills/sdd-apply/SKILL.md +0 -89
  140. package/src/skills/sdd-archive/SKILL.md +0 -92
  141. package/src/skills/sdd-clarify/SKILL.md +0 -105
  142. package/src/skills/sdd-constitution/SKILL.md +0 -107
  143. package/src/skills/sdd-design/SKILL.md +0 -155
  144. package/src/skills/sdd-init/SKILL.md +0 -233
  145. package/src/skills/sdd-propose/SKILL.md +0 -101
  146. package/src/skills/sdd-spec/SKILL.md +0 -136
  147. package/src/skills/sdd-tasks/SKILL.md +0 -232
  148. package/src/skills/sdd-verify/SKILL.md +0 -131
  149. package/src/skills/thoth-mem-agents/SKILL.md +0 -210
@@ -1,5 +1,7 @@
1
1
  import {
2
+ CONFIRMED_OPENAI_SUBAGENT_PRESET,
2
3
  DEFAULT_MODELS,
4
+ OPENCODE_OPENAI_ORCHESTRATOR_PRESET,
3
5
  OPENCODE_PROMPT_DIALECT,
4
6
  SUBAGENT_NAMES,
5
7
  appendPromptSections,
@@ -7,13 +9,12 @@ import {
7
9
  createOrchestratorPromptSections,
8
10
  createReadOnlySpecialistPromptSections,
9
11
  createWriteCapableSpecialistPromptSections,
10
- detectModelFamily,
11
12
  getAgentOverride,
12
13
  getModelFamilyPromptSection,
13
14
  getStepBudgetPromptSection,
14
15
  loadAgentPrompt,
15
16
  renderRolePrompt
16
- } from "./chunk-OZE7JVGS.js";
17
+ } from "./chunk-XO74DXBZ.js";
17
18
 
18
19
  // src/agents/deep.ts
19
20
  var DEEP_PROMPT = renderRolePrompt(
@@ -148,13 +149,9 @@ function createOracleAgent(model, customPrompt, customAppendPrompt) {
148
149
  }
149
150
 
150
151
  // src/agents/orchestrator.ts
151
- var OPENCODE_RUNTIME_SECTION = `<opencode-runtime>
152
- In the OpenCode harness, an automatic \`<reminder>...</reminder>\` workflow block followed by a \`\\n\\n---\\n\\n\` separator is prepended to your user messages as harness scaffolding, not user input.
153
- When saving the user prompt via mem_save(kind="prompt"), you MUST exclude that injected \`<reminder>\` block and the \`---\` separator, and persist only the real user request text that follows.
154
- </opencode-runtime>`;
155
- var ORCHESTRATOR_PROMPT = appendPromptSections(
156
- renderRolePrompt(createOrchestratorPromptSections(), OPENCODE_PROMPT_DIALECT),
157
- OPENCODE_RUNTIME_SECTION
152
+ var ORCHESTRATOR_PROMPT = renderRolePrompt(
153
+ createOrchestratorPromptSections(),
154
+ OPENCODE_PROMPT_DIALECT
158
155
  );
159
156
  function createOrchestratorAgent(model, customPrompt, customAppendPrompt) {
160
157
  const prompt = composeAgentPrompt({
@@ -167,7 +164,7 @@ function createOrchestratorAgent(model, customPrompt, customAppendPrompt) {
167
164
  });
168
165
  const definition = {
169
166
  name: "orchestrator",
170
- description: "Delegate-first coordinator for SDD workflow, specialist dispatch, and root-session memory ownership.",
167
+ description: "Adaptive root coordinator that handles bounded work directly and delegates only for net gain.",
171
168
  config: {
172
169
  temperature: 0.1,
173
170
  prompt,
@@ -213,14 +210,6 @@ function createQuickAgent(model, customPrompt, customAppendPrompt) {
213
210
  }
214
211
 
215
212
  // src/agents/index.ts
216
- var GEMINI_DEFAULT_STEPS = {
217
- explorer: 120,
218
- librarian: 80,
219
- oracle: 80,
220
- designer: 80,
221
- quick: 40,
222
- deep: 120
223
- };
224
213
  var BUILTIN_PERMISSION_PRESETS = {
225
214
  orchestrator: {
226
215
  read: "allow",
@@ -375,15 +364,6 @@ function applyStepBudgetPrompt(agent) {
375
364
  stepBudgetPrompt
376
365
  );
377
366
  }
378
- function applyGeminiDefaultSteps(agent) {
379
- if (!isSubagent(agent.name) || agent.config.steps !== void 0) {
380
- return;
381
- }
382
- if (detectModelFamily(agent._modelArray ?? agent.config.model) !== "gemini") {
383
- return;
384
- }
385
- agent.config.steps = GEMINI_DEFAULT_STEPS[agent.name];
386
- }
387
367
  function clonePermissionConfig(permission) {
388
368
  if (typeof permission === "string") {
389
369
  return permission;
@@ -424,24 +404,26 @@ function createAgents(config) {
424
404
  const override = getAgentOverride(config, name);
425
405
  const prompts = loadAgentPrompt(name, config?.preset);
426
406
  const model = getPrimaryModelForPrompt(override?.model) ?? DEFAULT_MODELS[name];
427
- return factory(model, prompts.prompt, prompts.appendPrompt);
407
+ const agent = factory(model, prompts.prompt, prompts.appendPrompt);
408
+ agent.config.variant = CONFIRMED_OPENAI_SUBAGENT_PRESET[name].effort;
409
+ return agent;
428
410
  });
429
411
  const allSubAgents = protoSubAgents.map((agent) => {
430
412
  const override = getAgentOverride(config, agent.name);
431
413
  if (override) {
432
414
  applyOverrides(agent, override);
433
415
  }
434
- applyGeminiDefaultSteps(agent);
435
416
  applyStepBudgetPrompt(agent);
436
417
  return agent;
437
418
  });
438
419
  const orchestratorOverride = getAgentOverride(config, "orchestrator");
439
420
  const orchestratorPrompts = loadAgentPrompt("orchestrator", config?.preset);
440
421
  const orchestrator = createOrchestratorAgent(
441
- orchestratorOverride?.model ?? DEFAULT_MODELS.orchestrator,
422
+ orchestratorOverride?.model ?? `openai/${OPENCODE_OPENAI_ORCHESTRATOR_PRESET.model}`,
442
423
  orchestratorPrompts.prompt,
443
424
  orchestratorPrompts.appendPrompt
444
425
  );
426
+ orchestrator.config.variant = OPENCODE_OPENAI_ORCHESTRATOR_PRESET.effort;
445
427
  if (orchestratorOverride) {
446
428
  applyOverrides(orchestrator, orchestratorOverride);
447
429
  }
@@ -1,27 +1,36 @@
1
1
  import { isClaudeCodeModel } from '../harness/writers/claude-code-subagent';
2
- import type { ClaudeCodeInstallScope, ClaudeCodeResolvedTargets, ClaudeCodeRoleName } from './claude-code-paths';
3
- import { type ManagedModelState } from './managed-state-io';
2
+ import type { ClaudeCodeInstallScope } from './claude-code-paths';
4
3
  export { CLAUDE_CODE_ROLE_NAMES } from './claude-code-paths';
5
- export declare const CLAUDE_CODE_MANAGED_MODEL_STATE_VERSION = 1;
6
- export declare const CLAUDE_CODE_MODEL_ALIASES: readonly ["sonnet", "opus", "haiku", "inherit"];
7
- export type ClaudeCodeSetupAction = 'write-plugin-file' | 'write-managed-model-state';
8
- export type ClaudeCodeTargetKind = 'plugin-manifest' | 'subagent' | 'mcp-config' | 'hook' | 'skill' | 'plugin-asset' | 'managed-model-state';
4
+ export type ClaudeCodeSetupAction = 'register-marketplace' | 'install-plugin' | 'update-plugin' | 'enable-plugin';
5
+ export type ClaudeCodeTargetKind = 'native-marketplace' | 'native-plugin';
6
+ export interface ClaudeCommandResult {
7
+ exitCode: number;
8
+ stdout: string;
9
+ stderr: string;
10
+ }
11
+ export interface ClaudeCommandOptions {
12
+ cwd: string;
13
+ }
14
+ export type ClaudeCommandExecutor = (command: string, args: readonly string[], options: ClaudeCommandOptions) => ClaudeCommandResult;
9
15
  export interface ClaudeCodeInstallConfig {
10
16
  dryRun?: boolean;
11
17
  reset: boolean;
12
18
  scope: ClaudeCodeInstallScope;
13
19
  projectRoot: string;
14
- homeDir?: string;
15
- packageRoot?: string;
20
+ commandExecutor?: ClaudeCommandExecutor;
21
+ refresh?: boolean;
16
22
  }
17
23
  export interface ClaudeCodeSetupPlanItem {
18
24
  kind: ClaudeCodeTargetKind;
19
25
  action: ClaudeCodeSetupAction;
20
26
  targetPath: string;
21
27
  description: string;
22
- requiresBackup: boolean;
23
- content: string;
24
- role?: ClaudeCodeRoleName;
28
+ requiresBackup: false;
29
+ command: {
30
+ executable: 'claude';
31
+ args: string[];
32
+ cwd: string;
33
+ };
25
34
  }
26
35
  export interface ClaudeCodeSetupPlan {
27
36
  dryRun: boolean;
@@ -30,6 +39,10 @@ export interface ClaudeCodeSetupPlan {
30
39
  diagnostics: string[];
31
40
  disclaimers: string[];
32
41
  pluginRoot: string;
42
+ ready: boolean;
43
+ scope: ClaudeCodeInstallScope;
44
+ projectRoot: string;
45
+ commandExecutor: ClaudeCommandExecutor;
33
46
  }
34
47
  export interface ClaudeCodeApplyResult {
35
48
  success: boolean;
@@ -37,22 +50,7 @@ export interface ClaudeCodeApplyResult {
37
50
  diagnostics: string[];
38
51
  error?: string;
39
52
  }
40
- export interface ClaudeCodeManagedModelOverride {
41
- role: ClaudeCodeRoleName;
42
- model: string;
43
- catalogId?: string;
44
- effort?: string;
45
- clearEffort?: boolean;
46
- }
47
53
  export declare const isClaudeCodeModelAlias: typeof isClaudeCodeModel;
48
- export declare function parseSubagentModel(content: string): string | undefined;
49
- export declare function replaceSubagentModel(content: string, model: string): string;
50
- export declare function parseSubagentEffort(content: string): string | undefined;
51
- export declare function replaceSubagentEffort(content: string, effort: string | undefined): string;
52
- export declare function parseManagedModelStateJson(text: string | undefined): ManagedModelState;
53
- export declare function readManagedModelState(path: string): ManagedModelState;
54
54
  export declare function buildClaudeCodeSetupPlan(config: ClaudeCodeInstallConfig): ClaudeCodeSetupPlan;
55
55
  export declare function applyClaudeCodeSetup(plan: ClaudeCodeSetupPlan): ClaudeCodeApplyResult;
56
- export declare function applyClaudeCodeManagedModelOverrides(config: ClaudeCodeInstallConfig, overrides: ClaudeCodeManagedModelOverride[]): ClaudeCodeApplyResult;
57
56
  export declare function formatClaudeCodeSetupPlan(plan: ClaudeCodeSetupPlan): string;
58
- export type { ClaudeCodeResolvedTargets };
@@ -1,31 +1,3 @@
1
1
  export type ClaudeCodeInstallScope = 'project' | 'user';
2
2
  export type ClaudeCodeRoleName = 'explorer' | 'librarian' | 'oracle' | 'designer' | 'quick' | 'deep';
3
3
  export declare const CLAUDE_CODE_ROLE_NAMES: readonly ["explorer", "librarian", "oracle", "designer", "quick", "deep"];
4
- export interface ClaudeCodeTargetResolverOptions {
5
- scope: ClaudeCodeInstallScope;
6
- projectRoot: string;
7
- homeDir?: string;
8
- }
9
- export interface ClaudeCodeResolvedTargets {
10
- scope: ClaudeCodeInstallScope;
11
- pluginRoot: string;
12
- pluginManifestPath: string;
13
- agentPaths: {
14
- role: ClaudeCodeRoleName;
15
- path: string;
16
- }[];
17
- mcpPath: string;
18
- hooksPath: string;
19
- skillsDir: string;
20
- managedModelsPath: string;
21
- }
22
- /**
23
- * Resolve the on-disk Claude Code plugin package targets. Claude Code plugins
24
- * installed as a "skills-directory plugin": a folder under a Claude Code skills
25
- * directory (`~/.claude/skills/<name>` for user scope, `<project>/.claude/skills/<name>`
26
- * for project scope) that contains `.claude-plugin/plugin.json` is auto-loaded
27
- * as `<name>@skills-dir` on the next session — no marketplace, no install step,
28
- * discovered in place rather than copied to the `~/.claude/plugins/cache`.
29
- * Only `plugin.json` sits in `.claude-plugin/`; components are plugin-root siblings.
30
- */
31
- export declare function resolveClaudeCodeTargets(options: ClaudeCodeTargetResolverOptions): ClaudeCodeResolvedTargets;
@@ -1,8 +1,8 @@
1
1
  import type { CodexInstallScope, CodexRoleName } from './codex-paths';
2
2
  import { type ManagedModelState } from './managed-state-io';
3
3
  export { CODEX_ROLE_NAMES } from './codex-paths';
4
- export type CodexSetupAction = 'merge-managed-block' | 'write-role-toml' | 'write-managed-model-state' | 'refresh-package' | 'merge-marketplace' | 'merge-toml' | 'diagnose-only';
5
- export type CodexTargetKind = 'root-instructions' | 'role-subagent-toml' | 'managed-model-state' | 'user-config' | 'plugin-package' | 'personal-plugin-source' | 'personal-marketplace' | 'diagnostic';
4
+ export type CodexSetupAction = 'merge-managed-block' | 'write-role-toml' | 'write-managed-model-state' | 'merge-toml' | 'diagnose-only';
5
+ export type CodexTargetKind = 'root-instructions' | 'role-subagent-toml' | 'managed-model-state' | 'user-config' | 'diagnostic';
6
6
  export interface CodexInstallConfig {
7
7
  dryRun?: boolean;
8
8
  reset: boolean;
@@ -19,8 +19,6 @@ export interface CodexResolvedTargets {
19
19
  managedModelsPath: string;
20
20
  skillsDir: string;
21
21
  packageRoot: string;
22
- personalPluginRoot: string;
23
- personalMarketplacePath: string;
24
22
  }
25
23
  export declare function getCodexHome(options?: {
26
24
  homeDir?: string;