thoth-agents 0.4.1 → 0.5.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 (117) 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-2D7E7GMP.js → chunk-VUNYH263.js} +1650 -380
  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/model-defaults.d.ts +4 -0
  15. package/dist/cli/operations/pi.d.ts +1 -0
  16. package/dist/cli/pi-effort.d.ts +1 -1
  17. package/dist/cli/pi-external-package.d.ts +24 -0
  18. package/dist/cli/pi-git-source.d.ts +1 -0
  19. package/dist/cli/pi-install.d.ts +92 -15
  20. package/dist/cli/pi-managed-write.d.ts +3 -0
  21. package/dist/cli/pi-model-config.d.ts +17 -0
  22. package/dist/cli/pi-native-probe.d.ts +2 -0
  23. package/dist/cli/pi-paths.d.ts +2 -0
  24. package/dist/cli/pi-resources.d.ts +3 -1
  25. package/dist/cli/pi-tool-config.d.ts +32 -0
  26. package/dist/cli/tui/index.js +32 -7
  27. package/dist/cli/tui/operations.d.ts +3 -1
  28. package/dist/cli/types.d.ts +2 -0
  29. package/dist/config/constants.d.ts +4 -8
  30. package/dist/config/schema.d.ts +7 -36
  31. package/dist/harness/adapters/claude-code.d.ts +2 -4
  32. package/dist/harness/core/agent-pack.d.ts +52 -42
  33. package/dist/harness/core/memory-governance.d.ts +2 -2
  34. package/dist/harness/core/sdd.d.ts +159 -319
  35. package/dist/harness/writers/pi-agent.d.ts +3 -1
  36. package/dist/index.js +12 -6
  37. package/dist/pi/tools-panel.d.ts +51 -0
  38. package/dist/pi.d.ts +44 -2
  39. package/dist/pi.js +471 -9
  40. package/dist/utils/subprocess.d.ts +1 -0
  41. package/package.json +18 -4
  42. package/pi/.thoth-agents-assets.json +5 -6
  43. package/pi/agents/thoth-designer.md +23 -8
  44. package/pi/agents/thoth-explorer.md +29 -9
  45. package/pi/agents/thoth-librarian.md +30 -8
  46. package/pi/agents/thoth-oracle.md +18 -10
  47. package/pi/agents/thoth-worker.md +96 -0
  48. package/plugin/.claude-plugin/.thoth-agents-plugin-assets.json +7 -12
  49. package/plugin/.claude-plugin/plugin.json +2 -2
  50. package/plugin/.codex-plugin/plugin.json +2 -2
  51. package/plugin/agents/designer.md +13 -5
  52. package/plugin/agents/explorer.md +16 -5
  53. package/plugin/agents/librarian.md +15 -4
  54. package/plugin/agents/oracle.md +13 -7
  55. package/plugin/agents/orchestrator.md +82 -91
  56. package/plugin/agents/worker.md +76 -0
  57. package/plugin/skills/plan-reviewer/SKILL.md +39 -141
  58. package/plugin/skills/thoth-archive/SKILL.md +50 -47
  59. package/plugin/skills/thoth-archive/scripts/archive.mjs +287 -654
  60. package/plugin/skills/thoth-constitution/SKILL.md +23 -42
  61. package/plugin/skills/thoth-constitution/templates/constitution.md +54 -44
  62. package/plugin/skills/thoth-init/SKILL.md +19 -29
  63. package/plugin/skills/thoth-init/scripts/init.mjs +73 -66
  64. package/plugin/skills/thoth-sdd/SKILL.md +164 -117
  65. package/plugin/skills/thoth-sdd/references/phases/checklist.md +2 -22
  66. package/plugin/skills/thoth-sdd/references/phases/clarify.md +14 -12
  67. package/plugin/skills/thoth-sdd/references/phases/converge.md +2 -13
  68. package/plugin/skills/thoth-sdd/references/phases/explore.md +3 -8
  69. package/plugin/skills/thoth-sdd/references/phases/implement.md +58 -57
  70. package/plugin/skills/thoth-sdd/references/phases/plan.md +2 -18
  71. package/plugin/skills/thoth-sdd/references/phases/specify.md +2 -33
  72. package/plugin/skills/thoth-sdd/references/phases/tasks.md +4 -45
  73. package/plugin/skills/thoth-sdd/references/phases/verify.md +4 -22
  74. package/plugin/skills/thoth-sdd/scripts/validate.mjs +610 -1232
  75. package/plugin/skills/thoth-sdd/templates/change.md +94 -0
  76. package/skills/README.md +11 -13
  77. package/skills/plan-reviewer/SKILL.md +39 -141
  78. package/skills/thoth-archive/SKILL.md +50 -47
  79. package/skills/thoth-archive/scripts/archive.mjs +287 -654
  80. package/skills/thoth-constitution/SKILL.md +23 -42
  81. package/skills/thoth-constitution/templates/constitution.md +54 -44
  82. package/skills/thoth-init/SKILL.md +19 -29
  83. package/skills/thoth-init/scripts/init.mjs +73 -66
  84. package/skills/thoth-sdd/SKILL.md +164 -117
  85. package/skills/thoth-sdd/references/phases/checklist.md +2 -22
  86. package/skills/thoth-sdd/references/phases/clarify.md +14 -12
  87. package/skills/thoth-sdd/references/phases/converge.md +2 -13
  88. package/skills/thoth-sdd/references/phases/explore.md +3 -8
  89. package/skills/thoth-sdd/references/phases/implement.md +58 -57
  90. package/skills/thoth-sdd/references/phases/plan.md +2 -18
  91. package/skills/thoth-sdd/references/phases/specify.md +2 -33
  92. package/skills/thoth-sdd/references/phases/tasks.md +4 -45
  93. package/skills/thoth-sdd/references/phases/verify.md +4 -22
  94. package/skills/thoth-sdd/scripts/validate.mjs +610 -1232
  95. package/skills/thoth-sdd/templates/change.md +94 -0
  96. package/thoth-agents.schema.json +9 -77
  97. package/dist/agents/deep.d.ts +0 -2
  98. package/dist/agents/quick.d.ts +0 -2
  99. package/dist/chunk-2U5MBLLV.js +0 -312
  100. package/pi/agents/thoth-deep.md +0 -81
  101. package/pi/agents/thoth-quick.md +0 -81
  102. package/plugin/agents/deep.md +0 -68
  103. package/plugin/agents/quick.md +0 -68
  104. package/plugin/skills/plan-reviewer/templates/plan-review.md +0 -65
  105. package/plugin/skills/thoth-sdd/templates/archive-report.md +0 -25
  106. package/plugin/skills/thoth-sdd/templates/checklist.md +0 -27
  107. package/plugin/skills/thoth-sdd/templates/plan.md +0 -46
  108. package/plugin/skills/thoth-sdd/templates/spec.md +0 -62
  109. package/plugin/skills/thoth-sdd/templates/tasks.md +0 -58
  110. package/plugin/skills/thoth-sdd/templates/verify-report.md +0 -28
  111. package/skills/plan-reviewer/templates/plan-review.md +0 -65
  112. package/skills/thoth-sdd/templates/archive-report.md +0 -25
  113. package/skills/thoth-sdd/templates/checklist.md +0 -27
  114. package/skills/thoth-sdd/templates/plan.md +0 -46
  115. package/skills/thoth-sdd/templates/spec.md +0 -62
  116. package/skills/thoth-sdd/templates/tasks.md +0 -58
  117. package/skills/thoth-sdd/templates/verify-report.md +0 -28
@@ -1,4 +1,4 @@
1
- import type { AgentRoleContract } from '../core/agent-pack';
1
+ import { type AgentRoleContract } from '../core/agent-pack';
2
2
  import { type PiSpecialistRole } from '../pi-specialists';
3
3
  export declare const PI_MANAGED_OWNER = "thoth-agents";
4
4
  export declare const PI_ROOT_START = "<!-- thoth-agents:pi-root:start -->";
@@ -11,6 +11,8 @@ export interface PiAgentDefinitionInput {
11
11
  instructions: string;
12
12
  model?: string;
13
13
  effort?: string;
14
+ subagentMode: 'task' | 'background';
14
15
  }
16
+ export declare function getPiSpecialistDefaultTools(role: PiSpecialistRole): string[];
15
17
  export declare function renderPiAgentDefinition(input: PiAgentDefinitionInput): string;
16
18
  export declare function renderPiRootBlock(instructions: string): string;
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  renderOpenCodeAgentConfigs,
4
4
  spawn,
5
5
  spawnSync
6
- } from "./chunk-STCURXAQ.js";
6
+ } from "./chunk-MRFCA3U2.js";
7
7
  import {
8
8
  context7,
9
9
  exa,
@@ -14,7 +14,7 @@ import {
14
14
  getOpenCodeConfigPaths,
15
15
  loadPluginConfig,
16
16
  stripJsonComments
17
- } from "./chunk-EFGSGPYM.js";
17
+ } from "./chunk-OW6I7ZUU.js";
18
18
 
19
19
  // src/index.ts
20
20
  import { fileURLToPath as fileURLToPath3 } from "url";
@@ -39,17 +39,16 @@ function createOpenCodeInitCommand({
39
39
  }
40
40
  const contract = readFileSync(skillPath, "utf8");
41
41
  return {
42
- description: "Initialize thoth-agents project SDD governance",
42
+ description: "Initialize thoth-agents project workflow governance",
43
43
  agent: "orchestrator",
44
44
  subtask: false,
45
45
  template: `Initialize this project now using the bundled thoth-init skill.
46
46
 
47
- The operation must stay scoped to openspec/, idempotent, and offline. Run:
47
+ The operation must stay scoped to .thoth/, idempotent, and offline. Run:
48
48
 
49
49
  node "${scriptPath}" --project "${projectRoot}" --json
50
50
 
51
- Inspect the JSON result and report created, managed, and preserved OpenSpec
52
- assets. Do not install skills or agents, download dependencies, modify harness
51
+ Inspect the JSON result and report created and preserved .thoth assets. Do not install skills or agents, download dependencies, modify harness
53
52
  configuration, or invoke the thoth-agents CLI.
54
53
 
55
54
  Bundled skill contract:
@@ -1055,6 +1054,7 @@ function getWindowsBuildNumber() {
1055
1054
  function isPwshAvailable() {
1056
1055
  if (process.platform !== "win32") return false;
1057
1056
  const result = spawnSync(["where", "pwsh"], {
1057
+ windowsHide: true,
1058
1058
  stdout: "pipe",
1059
1059
  stderr: "pipe"
1060
1060
  });
@@ -1080,6 +1080,7 @@ async function extractZip(archivePath, destDir) {
1080
1080
  switch (extractor) {
1081
1081
  case "tar":
1082
1082
  proc = spawn(["tar", "-xf", archivePath, "-C", destDir], {
1083
+ windowsHide: true,
1083
1084
  stdout: "ignore",
1084
1085
  stderr: "pipe"
1085
1086
  });
@@ -1092,6 +1093,7 @@ async function extractZip(archivePath, destDir) {
1092
1093
  `Expand-Archive -Path '${escapePowerShellPath(archivePath)}' -DestinationPath '${escapePowerShellPath(destDir)}' -Force`
1093
1094
  ],
1094
1095
  {
1096
+ windowsHide: true,
1095
1097
  stdout: "ignore",
1096
1098
  stderr: "pipe"
1097
1099
  }
@@ -1105,6 +1107,7 @@ async function extractZip(archivePath, destDir) {
1105
1107
  `Expand-Archive -Path '${escapePowerShellPath(archivePath)}' -DestinationPath '${escapePowerShellPath(destDir)}' -Force`
1106
1108
  ],
1107
1109
  {
1110
+ windowsHide: true,
1108
1111
  stdout: "ignore",
1109
1112
  stderr: "pipe"
1110
1113
  }
@@ -1113,6 +1116,7 @@ async function extractZip(archivePath, destDir) {
1113
1116
  }
1114
1117
  } else {
1115
1118
  proc = spawn(["unzip", "-o", archivePath, "-d", destDir], {
1119
+ windowsHide: true,
1116
1120
  stdout: "ignore",
1117
1121
  stderr: "pipe"
1118
1122
  });
@@ -1396,6 +1400,7 @@ async function runSg(options) {
1396
1400
  }
1397
1401
  const timeout = DEFAULT_TIMEOUT_MS;
1398
1402
  const proc = spawn([cliPath, ...args], {
1403
+ windowsHide: true,
1399
1404
  stdout: "pipe",
1400
1405
  stderr: "pipe"
1401
1406
  });
@@ -2603,6 +2608,7 @@ var LSPClient = class {
2603
2608
  root: this.root
2604
2609
  });
2605
2610
  this.proc = spawn(this.server.command, {
2611
+ windowsHide: true,
2606
2612
  stdin: "pipe",
2607
2613
  stdout: "pipe",
2608
2614
  stderr: "pipe",
@@ -0,0 +1,51 @@
1
+ import { type PiToolConfigSnapshot, type PiToolRoleInput, type PiToolRoleSnapshot, type PiToolSaveResult } from '../cli/pi-tool-config';
2
+ export type ToolsPanelResult = {
3
+ kind: 'cancelled';
4
+ } | {
5
+ kind: 'saved';
6
+ changedRoles: string[];
7
+ };
8
+ export interface ToolsPanelTheme {
9
+ fg(color: 'accent' | 'border' | 'muted' | 'dim' | 'text' | 'error' | 'warning', text: string): string;
10
+ bg(color: 'selectedBg', text: string): string;
11
+ }
12
+ export interface ToolsPanelDiscoveredTool {
13
+ name: string;
14
+ description?: string;
15
+ active: boolean;
16
+ }
17
+ export type ToolsPanelKey = 'up' | 'down' | 'enter' | 'escape' | 'backspace' | 'space';
18
+ export interface ToolsPanelOptions {
19
+ snapshot: PiToolConfigSnapshot;
20
+ discoveredTools: readonly ToolsPanelDiscoveredTool[];
21
+ save(snapshot: PiToolConfigSnapshot, roles: readonly PiToolRoleInput[]): PiToolSaveResult;
22
+ onDone(result: ToolsPanelResult): void;
23
+ requestRender?(): void;
24
+ maxHeight?(): number;
25
+ matchesKey?: (data: string, key: ToolsPanelKey) => boolean;
26
+ truncate?: (text: string, width: number) => string;
27
+ visibleWidth?: (text: string) => number;
28
+ theme?: ToolsPanelTheme;
29
+ }
30
+ export type RoleToolsDraft = PiToolRoleSnapshot;
31
+ export type ToolsPanelScreen = 'overview' | 'tools' | 'discard';
32
+ export interface ToolsPanelState {
33
+ screen: ToolsPanelScreen;
34
+ selectedRole: number;
35
+ draft: RoleToolsDraft[];
36
+ error?: string;
37
+ changedRoles: string[];
38
+ }
39
+ export type ToolItemStatus = 'active' | 'inactive';
40
+ export interface ToolListItem {
41
+ name: string;
42
+ description?: string;
43
+ status: ToolItemStatus;
44
+ }
45
+ export declare function isEligibleTool(name: string): boolean;
46
+ export declare function createToolsPanel(options: ToolsPanelOptions): {
47
+ render: (width: number) => string[];
48
+ handleInput: (data: string) => void;
49
+ invalidate(): void;
50
+ getState: () => ToolsPanelState;
51
+ };
package/dist/pi.d.ts CHANGED
@@ -1,10 +1,52 @@
1
- type PiHandler = (event: Record<string, unknown>, context?: unknown) => unknown;
1
+ import { type OverlayOptions } from '@earendil-works/pi-tui';
2
+ import { readPiToolConfig, savePiToolConfig } from './cli/pi-tool-config';
3
+ import { type ToolsPanelKey } from './pi/tools-panel';
4
+ type PiHandler = (event: Record<string, unknown>, context?: {
5
+ isIdle(): boolean;
6
+ }) => unknown;
7
+ interface PiCommandContext {
8
+ mode: string;
9
+ ui: {
10
+ notify(message: string, type?: 'info' | 'warning' | 'error'): void;
11
+ custom<T>(factory: (tui: {
12
+ requestRender(): void;
13
+ terminal: {
14
+ rows: number;
15
+ };
16
+ }, theme: unknown, keybindings: unknown, done: (result: T) => void) => {
17
+ render(width: number): string[];
18
+ invalidate(): void;
19
+ handleInput(data: string): void;
20
+ }, options?: {
21
+ overlay?: boolean;
22
+ overlayOptions?: OverlayOptions;
23
+ }): Promise<T>;
24
+ };
25
+ }
26
+ interface PiNativeModules {
27
+ matchesKey(data: string, key: string): boolean;
28
+ truncateToWidth(text: string, width: number): string;
29
+ visibleWidth(text: string): number;
30
+ keys: Record<ToolsPanelKey, string>;
31
+ }
2
32
  export interface PiExtensionApi {
3
- on(event: 'before_agent_start' | 'session_start', handler: PiHandler): void;
33
+ on(event: 'input' | 'before_agent_start' | 'session_start', handler: PiHandler): void;
34
+ registerCommand?(name: string, command: {
35
+ description: string;
36
+ handler(args: string | undefined, context: PiCommandContext): unknown;
37
+ }): void;
38
+ getAllTools?(): Array<{
39
+ name: string;
40
+ description?: string;
41
+ }>;
42
+ getActiveTools?(): string[];
4
43
  }
5
44
  export interface PiExtensionOptions {
6
45
  packageRoot?: string;
7
46
  piRoot?: string;
47
+ readToolConfig?: typeof readPiToolConfig;
48
+ saveToolConfig?: typeof savePiToolConfig;
49
+ loadNativeModules?: () => Promise<PiNativeModules>;
8
50
  }
9
51
  export declare function injectPiRoot(systemPrompt: string): string;
10
52
  export default function thothAgentsPiExtension(pi: PiExtensionApi, options?: PiExtensionOptions): void;