thoth-agents 0.4.2 → 0.5.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 (115) hide show
  1. package/LICENSE +30 -0
  2. package/README.md +86 -58
  3. package/dist/agents/prompt-sections.d.ts +5 -3
  4. package/dist/agents/prompt-utils.d.ts +1 -1
  5. package/dist/agents/worker.d.ts +2 -0
  6. package/dist/{chunk-STCURXAQ.js → chunk-MRFCA3U2.js} +33 -67
  7. package/dist/{chunk-EFGSGPYM.js → chunk-OW6I7ZUU.js} +391 -416
  8. package/dist/chunk-V7HSGRMB.js +1016 -0
  9. package/dist/{chunk-WCLUZZHI.js → chunk-VUNYH263.js} +1580 -351
  10. package/dist/cli/claude-code-paths.d.ts +2 -2
  11. package/dist/cli/codex-install.d.ts +5 -2
  12. package/dist/cli/codex-paths.d.ts +2 -2
  13. package/dist/cli/index.js +47 -11
  14. package/dist/cli/operations/pi.d.ts +1 -0
  15. package/dist/cli/pi-effort.d.ts +1 -1
  16. package/dist/cli/pi-external-package.d.ts +24 -0
  17. package/dist/cli/pi-git-source.d.ts +1 -0
  18. package/dist/cli/pi-install.d.ts +92 -15
  19. package/dist/cli/pi-managed-write.d.ts +3 -0
  20. package/dist/cli/pi-model-config.d.ts +17 -0
  21. package/dist/cli/pi-native-probe.d.ts +2 -0
  22. package/dist/cli/pi-paths.d.ts +2 -0
  23. package/dist/cli/pi-resources.d.ts +3 -1
  24. package/dist/cli/pi-tool-config.d.ts +32 -0
  25. package/dist/cli/tui/index.js +3 -3
  26. package/dist/cli/types.d.ts +2 -0
  27. package/dist/config/constants.d.ts +4 -8
  28. package/dist/config/schema.d.ts +7 -36
  29. package/dist/harness/adapters/claude-code.d.ts +2 -4
  30. package/dist/harness/core/agent-pack.d.ts +52 -42
  31. package/dist/harness/core/memory-governance.d.ts +2 -2
  32. package/dist/harness/core/sdd.d.ts +159 -319
  33. package/dist/harness/writers/pi-agent.d.ts +3 -1
  34. package/dist/index.js +12 -6
  35. package/dist/pi/tools-panel.d.ts +51 -0
  36. package/dist/pi.d.ts +44 -2
  37. package/dist/pi.js +471 -9
  38. package/dist/utils/subprocess.d.ts +1 -0
  39. package/package.json +23 -6
  40. package/pi/.thoth-agents-assets.json +5 -6
  41. package/pi/agents/thoth-designer.md +23 -8
  42. package/pi/agents/thoth-explorer.md +29 -9
  43. package/pi/agents/thoth-librarian.md +30 -8
  44. package/pi/agents/thoth-oracle.md +18 -10
  45. package/pi/agents/thoth-worker.md +96 -0
  46. package/plugin/.claude-plugin/.thoth-agents-plugin-assets.json +7 -12
  47. package/plugin/.claude-plugin/plugin.json +2 -2
  48. package/plugin/.codex-plugin/plugin.json +2 -2
  49. package/plugin/agents/designer.md +13 -5
  50. package/plugin/agents/explorer.md +16 -5
  51. package/plugin/agents/librarian.md +15 -4
  52. package/plugin/agents/oracle.md +13 -7
  53. package/plugin/agents/orchestrator.md +82 -91
  54. package/plugin/agents/worker.md +76 -0
  55. package/plugin/skills/plan-reviewer/SKILL.md +39 -141
  56. package/plugin/skills/thoth-archive/SKILL.md +50 -47
  57. package/plugin/skills/thoth-archive/scripts/archive.mjs +287 -654
  58. package/plugin/skills/thoth-constitution/SKILL.md +23 -42
  59. package/plugin/skills/thoth-constitution/templates/constitution.md +54 -44
  60. package/plugin/skills/thoth-init/SKILL.md +19 -29
  61. package/plugin/skills/thoth-init/scripts/init.mjs +73 -66
  62. package/plugin/skills/thoth-sdd/SKILL.md +164 -117
  63. package/plugin/skills/thoth-sdd/references/phases/checklist.md +2 -22
  64. package/plugin/skills/thoth-sdd/references/phases/clarify.md +14 -12
  65. package/plugin/skills/thoth-sdd/references/phases/converge.md +2 -13
  66. package/plugin/skills/thoth-sdd/references/phases/explore.md +3 -8
  67. package/plugin/skills/thoth-sdd/references/phases/implement.md +58 -57
  68. package/plugin/skills/thoth-sdd/references/phases/plan.md +2 -18
  69. package/plugin/skills/thoth-sdd/references/phases/specify.md +2 -33
  70. package/plugin/skills/thoth-sdd/references/phases/tasks.md +4 -45
  71. package/plugin/skills/thoth-sdd/references/phases/verify.md +4 -22
  72. package/plugin/skills/thoth-sdd/scripts/validate.mjs +610 -1232
  73. package/plugin/skills/thoth-sdd/templates/change.md +94 -0
  74. package/skills/README.md +11 -13
  75. package/skills/plan-reviewer/SKILL.md +39 -141
  76. package/skills/thoth-archive/SKILL.md +50 -47
  77. package/skills/thoth-archive/scripts/archive.mjs +287 -654
  78. package/skills/thoth-constitution/SKILL.md +23 -42
  79. package/skills/thoth-constitution/templates/constitution.md +54 -44
  80. package/skills/thoth-init/SKILL.md +19 -29
  81. package/skills/thoth-init/scripts/init.mjs +73 -66
  82. package/skills/thoth-sdd/SKILL.md +164 -117
  83. package/skills/thoth-sdd/references/phases/checklist.md +2 -22
  84. package/skills/thoth-sdd/references/phases/clarify.md +14 -12
  85. package/skills/thoth-sdd/references/phases/converge.md +2 -13
  86. package/skills/thoth-sdd/references/phases/explore.md +3 -8
  87. package/skills/thoth-sdd/references/phases/implement.md +58 -57
  88. package/skills/thoth-sdd/references/phases/plan.md +2 -18
  89. package/skills/thoth-sdd/references/phases/specify.md +2 -33
  90. package/skills/thoth-sdd/references/phases/tasks.md +4 -45
  91. package/skills/thoth-sdd/references/phases/verify.md +4 -22
  92. package/skills/thoth-sdd/scripts/validate.mjs +610 -1232
  93. package/skills/thoth-sdd/templates/change.md +94 -0
  94. package/thoth-agents.schema.json +9 -77
  95. package/dist/agents/deep.d.ts +0 -2
  96. package/dist/agents/quick.d.ts +0 -2
  97. package/dist/chunk-2U5MBLLV.js +0 -312
  98. package/pi/agents/thoth-deep.md +0 -81
  99. package/pi/agents/thoth-quick.md +0 -81
  100. package/plugin/agents/deep.md +0 -68
  101. package/plugin/agents/quick.md +0 -68
  102. package/plugin/skills/plan-reviewer/templates/plan-review.md +0 -65
  103. package/plugin/skills/thoth-sdd/templates/archive-report.md +0 -25
  104. package/plugin/skills/thoth-sdd/templates/checklist.md +0 -27
  105. package/plugin/skills/thoth-sdd/templates/plan.md +0 -46
  106. package/plugin/skills/thoth-sdd/templates/spec.md +0 -62
  107. package/plugin/skills/thoth-sdd/templates/tasks.md +0 -58
  108. package/plugin/skills/thoth-sdd/templates/verify-report.md +0 -28
  109. package/skills/plan-reviewer/templates/plan-review.md +0 -65
  110. package/skills/thoth-sdd/templates/archive-report.md +0 -25
  111. package/skills/thoth-sdd/templates/checklist.md +0 -27
  112. package/skills/thoth-sdd/templates/plan.md +0 -46
  113. package/skills/thoth-sdd/templates/spec.md +0 -62
  114. package/skills/thoth-sdd/templates/tasks.md +0 -58
  115. package/skills/thoth-sdd/templates/verify-report.md +0 -28
@@ -10,14 +10,12 @@ export declare const CLAUDE_CODE_SUBAGENT_DEFAULT_MODELS: {
10
10
  readonly librarian: "sonnet";
11
11
  readonly oracle: "opus";
12
12
  readonly designer: "sonnet";
13
- readonly quick: "haiku";
14
- readonly deep: "sonnet";
13
+ readonly worker: "sonnet";
15
14
  };
16
15
  export declare const CLAUDE_CODE_SUBAGENT_DEFAULT_EFFORTS: {
17
16
  readonly explorer: "low";
18
- readonly quick: "low";
19
17
  readonly designer: "medium";
20
- readonly deep: "medium";
18
+ readonly worker: "medium";
21
19
  readonly librarian: "high";
22
20
  readonly oracle: "high";
23
21
  };
@@ -1,6 +1,6 @@
1
- export type AgentRoleName = 'orchestrator' | 'explorer' | 'librarian' | 'oracle' | 'designer' | 'quick' | 'deep';
1
+ export type AgentRoleName = 'orchestrator' | 'explorer' | 'librarian' | 'oracle' | 'designer' | 'worker';
2
2
  export type AgentMutationMode = 'adaptive-root' | 'read-only' | 'write-capable';
3
- export type AgentDispatchMethod = 'root-coordinator' | 'task' | 'synchronous-task-only';
3
+ export type AgentDispatchMethod = 'root-coordinator' | 'task';
4
4
  export interface AgentRoleContract {
5
5
  name: AgentRoleName;
6
6
  mode: AgentMutationMode;
@@ -23,7 +23,7 @@ export interface OrchestrationPolicy {
23
23
  specialistDirectory: SpecialistDecision[];
24
24
  rules: string[];
25
25
  }
26
- export type TaskShapingStep = 'bound-work' | 'map-dependencies' | 'assign-ownership' | 'select-specialists' | 'mark-ready-and-blocked' | 'dispatch-ready-wave' | 'wait-for-terminal-evidence' | 'reconcile-and-verify';
26
+ export type TaskShapingStep = 'bound-units' | 'map-output-dependencies' | 'assign-ownership' | 'select-specialists' | 'admit-ready-units' | 'dispatch-to-native-capacity' | 'wait-for-native-terminal-event' | 'accept-results' | 'refill-capacity';
27
27
  export interface TaskShapingPolicy {
28
28
  steps: TaskShapingStep[];
29
29
  nativeAuthority: boolean;
@@ -31,7 +31,13 @@ export interface TaskShapingPolicy {
31
31
  decisions: {
32
32
  dependency: string;
33
33
  ownershipConflict: string;
34
- readyWave: string;
34
+ unitOutcome: string;
35
+ unitEnvelope: string;
36
+ phaseSplitting: string;
37
+ independentDiscovery: string;
38
+ scopeGrowth: string;
39
+ readyDispatch: string;
40
+ refill: string;
35
41
  terminalEvidence: string;
36
42
  degradation: string;
37
43
  };
@@ -41,34 +47,42 @@ export interface SpecialistDecision {
41
47
  selectWhen: string;
42
48
  rejectWhen: string;
43
49
  }
44
- export type ImplementationOwner = 'orchestrator' | 'designer' | 'quick' | 'deep';
50
+ export type ImplementationOwner = 'orchestrator' | 'designer' | 'worker';
45
51
  export interface ImplementationOwnershipPolicy {
46
52
  eligibleOwners: ImplementationOwner[];
47
- routeIndependent: boolean;
48
- delegationBenefits: string[];
49
- rootContinuityBenefits: string[];
53
+ workflowIndependent: boolean;
54
+ defaultImplementationOwner: 'specialist';
55
+ rootIdentity: string;
56
+ defaultRule: string;
57
+ rootResponsibilities: string[];
58
+ discovery: string[];
59
+ directConsultation: string[];
60
+ directException: string[];
61
+ writerRouting: string[];
62
+ evidenceHandling: string[];
63
+ delegationFailure: string[];
50
64
  userDirection: string;
51
65
  insufficientSignals: string[];
52
66
  }
53
67
  export interface AgentPackContract {
54
68
  roles: AgentRoleContract[];
55
69
  orchestrationPolicy: OrchestrationPolicy;
56
- returnContract: string[];
70
+ returnContract: Record<AgentRoleName, string[]>;
57
71
  verificationProtocol: string[];
58
72
  }
59
- export declare const AGENT_ROLE_NAMES: readonly ["orchestrator", "explorer", "librarian", "oracle", "designer", "quick", "deep"];
73
+ export declare const AGENT_ROLE_NAMES: readonly ["orchestrator", "explorer", "librarian", "oracle", "designer", "worker"];
60
74
  export declare const AGENT_ROLES: readonly [{
61
75
  readonly name: "orchestrator";
62
76
  readonly mode: "adaptive-root";
63
77
  readonly dispatch: "root-coordinator";
64
78
  readonly canMutateWorkspace: true;
65
- readonly scope: "requirements, SDD coordination, routing, bounded implementation, decisions, and synthesis";
66
- readonly responsibility: "Keep requirements, decisions, sequential SDD coordination, and final synthesis in the root thread; evaluate implementation ownership independently in every route, implement directly or delegate by demonstrated net gain, and run focused verification for trivial deterministic Direct work.";
67
- 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."];
79
+ readonly scope: "human agreement, SDD coordination, bounded direct exceptions, decisions, and synthesis";
80
+ readonly responsibility: "Coordinate goals, decisions, acceptance, and synthesis under the specialist-default implementation-ownership policy; direct work is limited to its bounded exceptions and explicit user instructions.";
81
+ readonly useWhen: ["Coordinate goals, constraints, decisions, governed artifacts, routing, acceptance, and synthesis.", "Retain reviewed commits and known low-risk mechanical operations; honor explicit direct-work or no-delegation instructions.", "Consult a known source for one bounded question or make a minimal authorized low-risk edit only when source, scope, and verification are known and no discovery or independent judgment is needed."];
68
82
  readonly doNotUseWhen: ["Not for independent plan review or Oracle-required final verification."];
69
- 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."];
70
- readonly toolGovernance: ["may inspect and edit the accepted bounded implementation surface in every route and may verify trivial deterministic Direct work without self-approval", "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"];
71
- readonly verification: ["runs focused checks for trivial deterministic Direct work while final verification remains mandatory", "delegates selected plan review plus Accelerated, Full, and material-risk Direct final verification to a fresh oracle", "consolidates summarized evidence returned by child agents"];
83
+ readonly escalateWhen: ["Reassess ownership when actual uncertainty, scope, or risk increases, not because another search is needed; never override explicit no-delegation instructions."];
84
+ readonly toolGovernance: ["may inspect and edit the accepted bounded implementation surface and may verify trivial deterministic work without self-approval", "loads the matching thoth-sdd phase guidance on demand instead of carrying every phase protocol in its prompt", "owns proportional understanding, classification, one ID-named substantial-change record, semantic acceptance, and active .thoth/ work evidence", "uses the bounded implementation-ownership exceptions for reviewed commits and known low-risk mechanical work", "keeps requirements, decisions, and final synthesis in the root thread"];
85
+ readonly verification: ["runs focused checks for trivial deterministic work while final verification remains mandatory", "delegates selected focused plan review plus artifact-backed and material-risk final verification to a fresh oracle", "consolidates summarized evidence returned by child agents"];
72
86
  }, {
73
87
  readonly name: "explorer";
74
88
  readonly mode: "read-only";
@@ -76,7 +90,7 @@ export declare const AGENT_ROLES: readonly [{
76
90
  readonly canMutateWorkspace: false;
77
91
  readonly scope: "local repository discovery";
78
92
  readonly responsibility: "Resolve broad or uncertain repository questions and return distilled evidence.";
79
- readonly useWhen: ["Repository ownership or behavior is broad or uncertain."];
93
+ readonly useWhen: ["Local source, effective flow, responsibility, repository ownership, or behavior is unknown or uncertain."];
80
94
  readonly doNotUseWhen: ["Not for implementation, edits, or known narrow questions."];
81
95
  readonly escalateWhen: ["Send external evidence to librarian and mutation scope to root."];
82
96
  readonly toolGovernance: ["uses read, search, and code-navigation tools only", "does not mutate files or delegate further"];
@@ -96,11 +110,11 @@ export declare const AGENT_ROLES: readonly [{
96
110
  }, {
97
111
  readonly name: "oracle";
98
112
  readonly mode: "read-only";
99
- readonly dispatch: "synchronous-task-only";
113
+ readonly dispatch: "task";
100
114
  readonly canMutateWorkspace: false;
101
- readonly scope: "diagnosis, architecture, optional plan review, and independent verification";
102
- readonly responsibility: "Independently review plans when the user requests it and provide independent judgment for artifact-backed or material-risk final verification, exposing correctness risks and judging whether results satisfy their contracts.";
103
- readonly useWhen: ["Selected plan review, persistent diagnosis, material architecture or security risk, contradictory evidence, high failure cost, or artifact-backed final verification needs independent judgment."];
115
+ readonly scope: "diagnosis, architecture, optional focused plan review, and independent verification";
116
+ readonly responsibility: "Independently review plans when selected and provide independent judgment for artifact-backed or material-risk final verification, exposing correctness risks and judging whether results satisfy their contracts.";
117
+ readonly useWhen: ["Selected focused plan review, persistent diagnosis, material architecture or security risk, contradictory evidence, high failure cost, or artifact-backed final verification needs independent judgment."];
104
118
  readonly doNotUseWhen: ["Not for implementation, mutation, persistence, or self-review."];
105
119
  readonly escalateWhen: ["Return blockers and remediation anchors to root."];
106
120
  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"];
@@ -108,42 +122,38 @@ export declare const AGENT_ROLES: readonly [{
108
122
  }, {
109
123
  readonly name: "designer";
110
124
  readonly mode: "write-capable";
111
- readonly dispatch: "synchronous-task-only";
125
+ readonly dispatch: "task";
112
126
  readonly canMutateWorkspace: true;
113
127
  readonly scope: "UI/UX decisions, implementation, and visual verification";
114
128
  readonly responsibility: "Own user-facing implementation choices and visual quality for UI work.";
115
129
  readonly useWhen: ["User-facing UI/UX, interaction, accessibility, or visual quality is material."];
116
130
  readonly doNotUseWhen: ["Not for backend-only, non-visual, or correctness-heavy cross-cutting work."];
117
- readonly escalateWhen: ["Escalate coupled contracts, migrations, or high risk to deep."];
131
+ readonly escalateWhen: ["Escalate coupled contracts, migrations, or high risk to worker."];
118
132
  readonly toolGovernance: ["may edit focused UI/UX files", "owns screenshots and visual QA", "does not delegate further"];
119
133
  readonly verification: ["includes visual verification when applicable"];
120
134
  }, {
121
- readonly name: "quick";
122
- readonly mode: "write-capable";
123
- readonly dispatch: "synchronous-task-only";
124
- readonly canMutateWorkspace: true;
125
- readonly scope: "fast bounded implementation";
126
- readonly responsibility: "Implement narrow, clear, low-risk changes within an explicitly bounded surface.";
127
- readonly useWhen: ["Known narrow mechanical low-risk work has exact targets."];
128
- readonly doNotUseWhen: ["Not for coupled contracts, migrations, broad discovery, concurrency, edge cases, or high risk."];
129
- readonly escalateWhen: ["Escalate discovery, coupling, edge cases, or higher risk to deep."];
130
- readonly toolGovernance: ["edits only bounded targets", "escalates when discovery or correctness risk exceeds the assignment", "does not delegate further"];
131
- readonly verification: ["runs the smallest sufficient focused check"];
132
- }, {
133
- readonly name: "deep";
135
+ readonly name: "worker";
134
136
  readonly mode: "write-capable";
135
- readonly dispatch: "synchronous-task-only";
137
+ readonly dispatch: "task";
136
138
  readonly canMutateWorkspace: true;
137
- readonly scope: "correctness-critical implementation and verification";
138
- readonly responsibility: "Handle multi-file, edge-case-heavy, or high-risk implementation with full local context.";
139
- readonly useWhen: ["Implementation is multi-file, edge-case-heavy, migration, concurrency, shared-contract, or high-risk."];
140
- readonly doNotUseWhen: ["Not for visual-only work or narrow known low-risk edits."];
139
+ readonly scope: "bounded nonvisual implementation and verification";
140
+ readonly responsibility: "Handle bounded nonvisual implementation with full local context, including exact low-risk edits and correctness-critical, multi-file, edge-case-heavy, or high-risk work.";
141
+ readonly useWhen: ["Known bounded nonvisual implementation is ready, regardless of complexity; root direct work is limited to the bounded implementation-ownership exceptions.", "Correctness-critical work may be multi-file, edge-case-heavy, migration, concurrency, shared-contract, or high-risk."];
142
+ readonly doNotUseWhen: ["Not for visual-only work, reviewed commits, or work explicitly retained by the user in root."];
141
143
  readonly escalateWhen: ["Return product or architecture choices to root."];
142
144
  readonly toolGovernance: ["may edit implementation and tests within the assigned surface", "validates shared behavior against related code and call sites", "does not delegate further"];
143
145
  readonly verification: ["reports focused checks and relevant edge-case evidence"];
144
146
  }];
147
+ export declare function getImplementationOwnershipInstructions(policy: ImplementationOwnershipPolicy): string[];
145
148
  export declare const ORCHESTRATION_POLICY: OrchestrationPolicy;
146
- export declare const AGENT_RETURN_CONTRACT: readonly ["conclusion", "evidence", "verification", "risks", "openQuestions", "nextAction"];
149
+ export declare const AGENT_RETURN_CONTRACT: {
150
+ readonly orchestrator: readonly ["conclusion", "evidence", "verification", "risks", "openQuestions", "nextAction"];
151
+ readonly explorer: readonly ["conclusion", "evidence", "verification", "risks", "openQuestions"];
152
+ readonly librarian: readonly ["conclusion", "evidence", "verification", "risks", "openQuestions"];
153
+ readonly oracle: readonly ["conclusion", "evidence", "verification", "risks", "openQuestions", "nextAction"];
154
+ readonly designer: readonly ["conclusion", "evidence", "verification", "risks", "openQuestions", "nextAction"];
155
+ readonly worker: readonly ["conclusion", "evidence", "verification", "risks", "openQuestions", "nextAction"];
156
+ };
147
157
  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."];
148
158
  export declare const AGENT_PACK_CONTRACT: AgentPackContract;
149
159
  export declare function getAgentRole(name: AgentRoleName): AgentRoleContract;
@@ -21,8 +21,8 @@ export interface MemoryOrchestrationContract {
21
21
  provider: 'thoth-mem';
22
22
  providerOwnership: 'external';
23
23
  installedGuidance: 'thoth-mem skill';
24
- canonicalSddStore: 'openspec/';
25
- prohibitsSddArtifactMirroring: true;
24
+ canonicalWorkStore: '.thoth/';
25
+ prohibitsWorkArtifactMirroring: true;
26
26
  requiresParentAuthorization: true;
27
27
  rootLifecycleOwner: 'orchestrator';
28
28
  handoffOutcome: 'bounded-memory-contract';