thoth-agents 0.4.2 → 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 (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 +18 -4
  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
@@ -1,3 +1,3 @@
1
1
  export type ClaudeCodeInstallScope = 'project' | 'user';
2
- export type ClaudeCodeRoleName = 'explorer' | 'librarian' | 'oracle' | 'designer' | 'quick' | 'deep';
3
- export declare const CLAUDE_CODE_ROLE_NAMES: readonly ["explorer", "librarian", "oracle", "designer", "quick", "deep"];
2
+ export type ClaudeCodeRoleName = 'explorer' | 'librarian' | 'oracle' | 'designer' | 'worker';
3
+ export declare const CLAUDE_CODE_ROLE_NAMES: readonly ["explorer", "librarian", "oracle", "designer", "worker"];
@@ -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' | 'merge-toml' | 'diagnose-only';
5
- export type CodexTargetKind = 'root-instructions' | 'role-subagent-toml' | 'managed-model-state' | 'user-config' | 'diagnostic';
4
+ export type CodexSetupAction = 'merge-managed-block' | 'write-role-toml' | 'retire-obsolete-role-toml' | 'write-install-recovery' | 'write-managed-model-state' | 'merge-toml' | 'diagnose-only';
5
+ export type CodexTargetKind = 'root-instructions' | 'role-subagent-toml' | 'managed-model-state' | 'install-recovery' | 'user-config' | 'diagnostic';
6
6
  export interface CodexInstallConfig {
7
7
  dryRun?: boolean;
8
8
  reset: boolean;
@@ -22,6 +22,9 @@ export interface CodexSetupPlanItem {
22
22
  content?: string;
23
23
  role?: CodexRoleName;
24
24
  renderedModel?: string;
25
+ /** Apply-time guard captured while planning. */
26
+ expectedContent?: string;
27
+ expectedAbsent?: boolean;
25
28
  }
26
29
  export interface CodexSetupPlan {
27
30
  dryRun: boolean;
@@ -1,6 +1,6 @@
1
1
  export type CodexInstallScope = 'project' | 'user';
2
- export type CodexRoleName = 'explorer' | 'librarian' | 'oracle' | 'designer' | 'quick' | 'deep';
3
- export declare const CODEX_ROLE_NAMES: readonly ["explorer", "librarian", "oracle", "designer", "quick", "deep"];
2
+ export type CodexRoleName = 'explorer' | 'librarian' | 'oracle' | 'designer' | 'worker';
3
+ export declare const CODEX_ROLE_NAMES: readonly ["explorer", "librarian", "oracle", "designer", "worker"];
4
4
  export interface CodexTargetResolverOptions {
5
5
  scope: CodexInstallScope;
6
6
  projectRoot: string;
package/dist/cli/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  getOpenCodeVersion,
5
5
  isOpenCodeInstalled,
6
6
  opencodeAdapter
7
- } from "../chunk-STCURXAQ.js";
7
+ } from "../chunk-MRFCA3U2.js";
8
8
  import {
9
9
  CODEX_ROLE_NAMES,
10
10
  REQUIRED_SKILLS,
@@ -59,11 +59,11 @@ import {
59
59
  normalizeEffortSelection,
60
60
  recordHarnessInstallCompletion,
61
61
  syncOpenCodeOwnedSkills
62
- } from "../chunk-WCLUZZHI.js";
62
+ } from "../chunk-VUNYH263.js";
63
63
  import "../chunk-62L3ORXN.js";
64
64
  import {
65
65
  piAdapter
66
- } from "../chunk-2U5MBLLV.js";
66
+ } from "../chunk-V7HSGRMB.js";
67
67
  import {
68
68
  ALL_AGENT_NAMES,
69
69
  detectCurrentConfig,
@@ -74,7 +74,7 @@ import {
74
74
  resolveExecutingPackageVersion,
75
75
  updateOpenCodeMainConfig,
76
76
  writeLiteConfig
77
- } from "../chunk-EFGSGPYM.js";
77
+ } from "../chunk-OW6I7ZUU.js";
78
78
 
79
79
  // src/cli/index.ts
80
80
  import { pathToFileURL } from "url";
@@ -171,7 +171,9 @@ function formatConfigSummary(dryRun) {
171
171
  lines.push(` ${BOLD}Preset:${RESET} ${BLUE}openai${RESET}`);
172
172
  lines.push(` ${SYMBOLS.check} Seven-role adaptive thoth-agents roster`);
173
173
  lines.push(` ${SYMBOLS.check} OpenAI models by default`);
174
- lines.push(` ${SYMBOLS.check} Direct, Accelerated, and Full SDD routing`);
174
+ lines.push(
175
+ ` ${SYMBOLS.check} Proportional SDD and ID-named substantial-change records`
176
+ );
175
177
  lines.push(
176
178
  ` ${SYMBOLS.check} ${dryRun ? "thoth-mem setup plan confirmed" : "thoth-mem setup completed through its provider-owned installer"}`
177
179
  );
@@ -392,7 +394,7 @@ ${JSON.stringify(liteConfig, null, 2)}
392
394
  const modelsInfo = "Default configuration uses OpenAI models.";
393
395
  console.log(`${BOLD}${modelsInfo}${RESET}`);
394
396
  console.log(
395
- ` ${DIM}Includes the seven-role adaptive roster, native delegation, and Direct / Accelerated / Full SDD routing.${RESET}`
397
+ ` ${DIM}Includes the seven-role adaptive roster, native parallel delegation, and proportional SDD governance.${RESET}`
396
398
  );
397
399
  return 0;
398
400
  }
@@ -407,6 +409,7 @@ async function runPiInstall(config, dependencies, packageVersion, executingPacka
407
409
  expectedVersion: packageVersion,
408
410
  packageRoot: executingPackageRoot,
409
411
  ...config.localPackageRoot ? { firstPartySource: config.localPackageRoot } : {},
412
+ ...config.localPiRuntimeRoot ? { runtimePackageRoot: config.localPiRuntimeRoot } : {},
410
413
  receiptOptions: dependencies.installLedgerOptions,
411
414
  verifyFirstParty: dependencies.verifyPiFirstParty
412
415
  });
@@ -483,6 +486,7 @@ function createInstallConfig(args) {
483
486
  agent: args.agent ?? "opencode",
484
487
  hasTmux: args.tmux === "yes",
485
488
  ...args.localPackageRoot ? { localPackageRoot: args.localPackageRoot } : {},
489
+ ...args.localPiRuntimeRoot ? { localPiRuntimeRoot: args.localPiRuntimeRoot } : {},
486
490
  dryRun: args.dryRun,
487
491
  reset: args.reset ?? false
488
492
  };
@@ -788,7 +792,7 @@ Codex and Claude marketplace versions remain native-manager-owned and do not pro
788
792
  that CLI-managed agents, skills, configuration, or provider setup are aligned.
789
793
  Runtime release checks notify only; use the latest CLI install or interactive CLI Update.
790
794
 
791
- OpenCode install configures the adaptive seven-role roster and native task delegation.
795
+ OpenCode install configures the adaptive six-role roster and native task delegation.
792
796
  Provider capability is external and reported only from caller-supplied evidence.
793
797
 
794
798
  External required skills are installed for every harness:
@@ -897,8 +901,8 @@ function printModelGuidance() {
897
901
  [
898
902
  "Model command requires explicit model input.",
899
903
  "Examples:",
900
- " thoth-agents model --harness=codex --role=deep --model=openai/gpt-5.4-mini",
901
- " thoth-agents model --harness=opencode --role-model=deep=openai/gpt-5.4",
904
+ " thoth-agents model --harness=codex --role=worker --model=openai/gpt-5.4-mini",
905
+ " thoth-agents model --harness=opencode --role-model=worker=openai/gpt-5.4",
902
906
  "Preview is the default. Add --apply only after reviewing the plan."
903
907
  ].join("\n")
904
908
  );
@@ -1075,15 +1079,20 @@ function parseOperationHarness(value) {
1075
1079
  }
1076
1080
  return value;
1077
1081
  }
1082
+ function assertSupportedRoleName(role) {
1083
+ if (role === "quick" || role === "deep")
1084
+ throw new Error(`Unsupported removed agent role: ${role}. Use worker.`);
1085
+ }
1078
1086
  function parseRoleModel(value) {
1079
1087
  const separator = value.includes("=") ? "=" : ":";
1080
1088
  const [role, ...modelParts] = value.split(separator);
1081
1089
  const model = modelParts.join(separator);
1082
1090
  if (!role || !model) {
1083
1091
  throw new Error(
1084
- "--role-model must use role=model or role:model, for example --role-model=deep=openai/gpt-5.4-mini."
1092
+ "--role-model must use role=model or role:model, for example --role-model=worker=openai/gpt-5.4-mini."
1085
1093
  );
1086
1094
  }
1095
+ assertSupportedRoleName(role);
1087
1096
  return { role, model };
1088
1097
  }
1089
1098
  function parseRoleEffort(value) {
@@ -1092,9 +1101,10 @@ function parseRoleEffort(value) {
1092
1101
  const effort = effortParts.join(separator);
1093
1102
  if (!role || !effort) {
1094
1103
  throw new Error(
1095
- "--role-effort must use role=effort or role:effort, for example --role-effort=deep=high."
1104
+ "--role-effort must use role=effort or role:effort, for example --role-effort=worker=high."
1096
1105
  );
1097
1106
  }
1107
+ assertSupportedRoleName(role);
1098
1108
  return { role, effort: normalizeEffortSelection(effort) };
1099
1109
  }
1100
1110
  function parseOperationArgs(args) {
@@ -1140,6 +1150,7 @@ function parseOperationArgs(args) {
1140
1150
  } else if (arg.startsWith("--role=")) {
1141
1151
  pendingRole = arg.split("=")[1] ?? "";
1142
1152
  if (!pendingRole) throw new Error("--role requires a value.");
1153
+ assertSupportedRoleName(pendingRole);
1143
1154
  } else if (arg.startsWith("--provider=")) {
1144
1155
  pendingProvider = arg.split("=")[1] ?? "";
1145
1156
  if (!pendingProvider) throw new Error("--provider requires a value.");
@@ -1212,6 +1223,26 @@ function parseInstallArgs(args) {
1212
1223
  );
1213
1224
  }
1214
1225
  result.localPackageRoot = localPackageRoot;
1226
+ } else if (arg === "--local-pi-runtime-root" || arg.startsWith("--local-pi-runtime-root=")) {
1227
+ if (result.localPiRuntimeRoot !== void 0) {
1228
+ throw new Error("--local-pi-runtime-root cannot be repeated.");
1229
+ }
1230
+ let localPiRuntimeRoot;
1231
+ if (arg === "--local-pi-runtime-root") {
1232
+ index += 1;
1233
+ localPiRuntimeRoot = args[index];
1234
+ } else {
1235
+ localPiRuntimeRoot = arg.slice("--local-pi-runtime-root=".length);
1236
+ }
1237
+ if (!localPiRuntimeRoot || localPiRuntimeRoot.startsWith("--")) {
1238
+ throw new Error("--local-pi-runtime-root requires a value.");
1239
+ }
1240
+ if (!isAbsolute(localPiRuntimeRoot) || resolve(localPiRuntimeRoot) !== localPiRuntimeRoot) {
1241
+ throw new Error(
1242
+ "--local-pi-runtime-root requires a normalized absolute path."
1243
+ );
1244
+ }
1245
+ result.localPiRuntimeRoot = localPiRuntimeRoot;
1215
1246
  } else if (arg === "-h" || arg === "--help") {
1216
1247
  throw new Error("help");
1217
1248
  } else {
@@ -1221,6 +1252,11 @@ function parseInstallArgs(args) {
1221
1252
  if (result.localPackageRoot !== void 0 && result.agent !== "pi") {
1222
1253
  throw new Error("--local-package-root is supported only with --agent=pi.");
1223
1254
  }
1255
+ if (result.localPiRuntimeRoot !== void 0 && result.agent !== "pi") {
1256
+ throw new Error(
1257
+ "--local-pi-runtime-root is supported only with --agent=pi."
1258
+ );
1259
+ }
1224
1260
  return result;
1225
1261
  }
1226
1262
  function parseGenerateArgs(args) {
@@ -8,6 +8,7 @@ import type { HarnessAction, HarnessStatusReport, ModelConfigInput, ModelRoleInp
8
8
  export interface PiOperationContext extends OperationContext {
9
9
  homeDir?: string;
10
10
  packageRoot?: string;
11
+ runtimePackageRoot?: string;
11
12
  env?: Readonly<Record<string, string | undefined>>;
12
13
  installLedgerOptions?: InstallLedgerOptions;
13
14
  buildPiSetupPlan?: typeof buildPiSetupPlan;
@@ -1,5 +1,5 @@
1
1
  import type { ModelRoleInput } from './operations/types';
2
- export declare const PI_EFFORT_VALUES: readonly ["off", "minimal", "low", "medium", "high", "xhigh"];
2
+ export declare const PI_EFFORT_VALUES: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
3
3
  export type PiEffortResolution = {
4
4
  ok: true;
5
5
  effort: string | undefined;
@@ -0,0 +1,24 @@
1
+ export interface PiExternalPackageSpec {
2
+ source: string;
3
+ packageName: string;
4
+ version: string;
5
+ }
6
+ export interface PiConfiguredExternalPackage {
7
+ scope: 'user' | 'project';
8
+ source: string;
9
+ installedPath?: string;
10
+ }
11
+ export type PiExternalPackageEvidence = {
12
+ state: 'installed';
13
+ source: string;
14
+ installedPath: string;
15
+ version: string;
16
+ } | {
17
+ state: 'missing' | 'drift';
18
+ source?: string;
19
+ installedPath?: string;
20
+ version?: string;
21
+ reason: string;
22
+ };
23
+ export declare function piExternalSourceMatches(candidate: PiConfiguredExternalPackage, expectedSource: string): boolean;
24
+ export declare function inspectPiExternalPackage(packages: readonly PiConfiguredExternalPackage[], spec: PiExternalPackageSpec, requireManagedSource?: boolean): PiExternalPackageEvidence;
@@ -0,0 +1 @@
1
+ export declare function projectGitPackagePath(source: string, projectRoot: string): string | undefined;
@@ -1,38 +1,38 @@
1
1
  import { type PiPackageReceipt, type PiPackageReceiptOptions } from './pi-package-receipt';
2
2
  import { type PiPathOptions, type PiPaths } from './pi-paths';
3
- export declare const PI_MINIMUM_VERSION = "0.84.4";
3
+ export declare const PI_MINIMUM_VERSION = "0.99.0";
4
4
  export declare const PI_NODE_MINIMUM = "22.19.0";
5
5
  export declare const PI_COMMAND_TIMEOUT_MS = 120000;
6
6
  export declare const PI_PACKAGE_SPECS: readonly [{
7
7
  readonly id: "delegation";
8
- readonly source: "npm:pi-subagents-j0k3r@1.5.9";
9
- readonly packageName: "pi-subagents-j0k3r";
10
- readonly version: "1.5.9";
8
+ readonly source: "npm:@thoth-agents/pi-subagents@>=0.1.0";
9
+ readonly packageName: "@thoth-agents/pi-subagents";
10
+ readonly version: "0.1.0";
11
11
  }, {
12
12
  readonly id: "context7";
13
- readonly source: "npm:@upstash/context7-pi@0.1.2";
13
+ readonly source: "npm:@upstash/context7-pi@>=0.1.2";
14
14
  readonly packageName: "@upstash/context7-pi";
15
15
  readonly version: "0.1.2";
16
16
  }, {
17
17
  readonly id: "web-access";
18
- readonly source: "npm:pi-web-access@0.27.0";
18
+ readonly source: "npm:pi-web-access@>=0.27.0";
19
19
  readonly packageName: "pi-web-access";
20
20
  readonly version: "0.27.0";
21
21
  }, {
22
22
  readonly id: "grep-adapter";
23
- readonly source: "npm:pi-mcp-adapter@2.32.1";
23
+ readonly source: "npm:pi-mcp-adapter@>=2.32.1";
24
24
  readonly packageName: "pi-mcp-adapter";
25
25
  readonly version: "2.32.1";
26
26
  }, {
27
27
  readonly id: "ask-user-question";
28
- readonly source: "npm:@juicesharp/rpiv-ask-user-question@2.9.0";
29
- readonly packageName: "@juicesharp/rpiv-ask-user-question";
30
- readonly version: "2.9.0";
28
+ readonly source: "npm:@thoth-agents/pi-questions-user@>=0.1.0";
29
+ readonly packageName: "@thoth-agents/pi-questions-user";
30
+ readonly version: "0.1.0";
31
31
  }, {
32
32
  readonly id: "todo";
33
- readonly source: "npm:@juicesharp/rpiv-todo@2.9.0";
34
- readonly packageName: "@juicesharp/rpiv-todo";
35
- readonly version: "2.9.0";
33
+ readonly source: "npm:@thoth-agents/pi-todo@>=0.1.0";
34
+ readonly packageName: "@thoth-agents/pi-todo";
35
+ readonly version: "0.1.0";
36
36
  }];
37
37
  export declare const PI_GREP_MCP_ENTRY: {
38
38
  readonly url: "https://mcp.grep.app";
@@ -51,6 +51,7 @@ export interface PiSetupOptions extends PiPathOptions {
51
51
  commandExecutor?: PiCommandExecutor;
52
52
  expectedVersion?: string;
53
53
  packageRoot?: string;
54
+ runtimePackageRoot?: string;
54
55
  firstPartySource?: string;
55
56
  receiptOptions?: PiPackageReceiptOptions;
56
57
  verifyFirstParty?: (input: {
@@ -67,7 +68,7 @@ export interface PiSetupOptions extends PiPathOptions {
67
68
  };
68
69
  }
69
70
  export interface PiSetupPlanItem {
70
- kind: 'preflight' | 'package' | 'root' | 'agent' | 'mcp';
71
+ kind: 'preflight' | 'package' | 'root' | 'agent' | 'settings' | 'mcp';
71
72
  description: string;
72
73
  target: string;
73
74
  command?: {
@@ -84,6 +85,7 @@ export interface PiSetupPlan {
84
85
  blockers: string[];
85
86
  diagnostics: string[];
86
87
  disclaimers: string[];
88
+ projectIncumbentTodos?: PiConfiguredPackage[];
87
89
  options: PiSetupOptions;
88
90
  }
89
91
  export interface PiApplyResult {
@@ -111,6 +113,70 @@ export declare function verifyPiFirstPartyPackage(input: {
111
113
  success: false;
112
114
  error: string;
113
115
  };
116
+ export declare function isPiIncumbentDelegationSource(source: string): boolean;
117
+ export declare function getPiExternalPackageSpecs(options?: Pick<PiSetupOptions, 'runtimePackageRoot'>): readonly [{
118
+ readonly id: "delegation";
119
+ readonly source: "npm:@thoth-agents/pi-subagents@>=0.1.0";
120
+ readonly packageName: "@thoth-agents/pi-subagents";
121
+ readonly version: "0.1.0";
122
+ }, {
123
+ readonly id: "context7";
124
+ readonly source: "npm:@upstash/context7-pi@>=0.1.2";
125
+ readonly packageName: "@upstash/context7-pi";
126
+ readonly version: "0.1.2";
127
+ }, {
128
+ readonly id: "web-access";
129
+ readonly source: "npm:pi-web-access@>=0.27.0";
130
+ readonly packageName: "pi-web-access";
131
+ readonly version: "0.27.0";
132
+ }, {
133
+ readonly id: "grep-adapter";
134
+ readonly source: "npm:pi-mcp-adapter@>=2.32.1";
135
+ readonly packageName: "pi-mcp-adapter";
136
+ readonly version: "2.32.1";
137
+ }, {
138
+ readonly id: "ask-user-question";
139
+ readonly source: "npm:@thoth-agents/pi-questions-user@>=0.1.0";
140
+ readonly packageName: "@thoth-agents/pi-questions-user";
141
+ readonly version: "0.1.0";
142
+ }, {
143
+ readonly id: "todo";
144
+ readonly source: "npm:@thoth-agents/pi-todo@>=0.1.0";
145
+ readonly packageName: "@thoth-agents/pi-todo";
146
+ readonly version: "0.1.0";
147
+ }] | ({
148
+ readonly id: "context7";
149
+ readonly source: "npm:@upstash/context7-pi@>=0.1.2";
150
+ readonly packageName: "@upstash/context7-pi";
151
+ readonly version: "0.1.2";
152
+ } | {
153
+ readonly id: "web-access";
154
+ readonly source: "npm:pi-web-access@>=0.27.0";
155
+ readonly packageName: "pi-web-access";
156
+ readonly version: "0.27.0";
157
+ } | {
158
+ readonly id: "grep-adapter";
159
+ readonly source: "npm:pi-mcp-adapter@>=2.32.1";
160
+ readonly packageName: "pi-mcp-adapter";
161
+ readonly version: "2.32.1";
162
+ } | {
163
+ readonly id: "ask-user-question";
164
+ readonly source: "npm:@thoth-agents/pi-questions-user@>=0.1.0";
165
+ readonly packageName: "@thoth-agents/pi-questions-user";
166
+ readonly version: "0.1.0";
167
+ } | {
168
+ readonly id: "todo";
169
+ readonly source: "npm:@thoth-agents/pi-todo@>=0.1.0";
170
+ readonly packageName: "@thoth-agents/pi-todo";
171
+ readonly version: "0.1.0";
172
+ } | {
173
+ source: string;
174
+ id: "delegation";
175
+ packageName: "@thoth-agents/pi-subagents";
176
+ version: "0.1.0";
177
+ })[];
178
+ export declare function piIncumbentTodoRecovery(source: string, scope: PiConfiguredPackage['scope'], identityLimitation?: string, unmappedSource?: boolean): string;
179
+ export declare function mergePiSubagentsConfig(current: Record<string, unknown>): Record<string, unknown>;
114
180
  export declare function mergePiGrepMcpConfig(current: Record<string, unknown>): Record<string, unknown>;
115
181
  export declare function mergePiRootBlock(current: string, managedBlock: string): string;
116
182
  export declare function buildPiSetupPlan(options?: PiSetupOptions): PiSetupPlan;
@@ -123,9 +189,20 @@ export interface PiConfiguredPackage {
123
189
  installedPath?: string;
124
190
  packageName?: string;
125
191
  packageVersion?: string;
192
+ identityLimitation?: string;
193
+ /** Directory-only evidence; source is a display path, not a removal source. */
194
+ unmappedSource?: boolean;
126
195
  }
127
196
  export declare function parsePiPackageList(output: string): PiConfiguredPackage[];
197
+ export interface PiIncumbentDelegation {
198
+ candidate: PiConfiguredPackage;
199
+ classification: 'confirmed' | 'ambiguous';
200
+ reason: string;
201
+ }
202
+ export declare function findPiIncumbentDelegation(packages: readonly PiConfiguredPackage[]): PiIncumbentDelegation | undefined;
203
+ export declare function findPiIncumbentTodos(packages: readonly PiConfiguredPackage[]): PiConfiguredPackage[];
204
+ export declare function piIncumbentDelegationRecovery(incumbent: PiIncumbentDelegation): string;
128
205
  export declare function isThothPackageLocation(candidate: PiConfiguredPackage, knownSource?: string): boolean;
129
206
  export declare function getPiFirstPartyPackages(packages: readonly PiConfiguredPackage[], knownSource?: string): PiConfiguredPackage[];
130
- export declare function writePiManagedText(path: string, content: string): boolean;
207
+ export { writePiManagedText } from './pi-managed-write';
131
208
  export declare function applyPiSetup(plan: PiSetupPlan): PiApplyResult;
@@ -0,0 +1,3 @@
1
+ /** Reject links and non-directory ancestors before reading or writing a managed file. */
2
+ export declare function assertSafePiManagedPath(path: string): void;
3
+ export declare function writePiManagedText(path: string, content: string, expectedBefore?: string | null): boolean;
@@ -0,0 +1,17 @@
1
+ import { type PiSpecialistRole } from '../harness/pi-specialists';
2
+ import type { ModelRoleInput } from './operations/types';
3
+ export interface PiModelSnapshot {
4
+ piRoot: string;
5
+ roles: ModelRoleInput[];
6
+ contents: Partial<Record<PiSpecialistRole, string>>;
7
+ }
8
+ export interface PiModelSaveResult {
9
+ success: boolean;
10
+ changedRoles: PiSpecialistRole[];
11
+ /** Reflects only successful writes; use this snapshot to retry the same draft. */
12
+ snapshot: PiModelSnapshot;
13
+ error?: string;
14
+ }
15
+ export declare function readOwnedPiSpecialistDefinition(piRoot: string, role: PiSpecialistRole): string;
16
+ export declare function readPiModelConfig(piRoot: string, roles?: readonly PiSpecialistRole[]): PiModelSnapshot;
17
+ export declare function savePiModelConfig(snapshot: PiModelSnapshot, roles: readonly ModelRoleInput[]): PiModelSaveResult;
@@ -31,4 +31,6 @@ export interface PiNativeProbeResult {
31
31
  orchestratorChild?: boolean;
32
32
  sessionStartCount?: number;
33
33
  }
34
+ export declare function resolvePiWindowsCliFromShim(shimPath: string, shimContents: string): string | undefined;
35
+ export declare function findPiWindowsCli(): string | undefined;
34
36
  export declare function observePiNativeRoot(options: PiNativeProbeOptions): PiNativeProbeResult;
@@ -13,6 +13,8 @@ export interface PiPaths {
13
13
  agentsRoot: string;
14
14
  alternateAgentsRoot: string;
15
15
  ownedSkillsRoot: string;
16
+ settingsPath: string;
17
+ subagentsConfigPath: string;
16
18
  mcpConfigPath: string;
17
19
  projectAgentRoots: string[];
18
20
  projectMcpPaths: string[];
@@ -1,9 +1,11 @@
1
- export declare const PI_SPECIALIST_NAMES: ("thoth-explorer" | "thoth-librarian" | "thoth-oracle" | "thoth-designer" | "thoth-quick" | "thoth-deep")[];
1
+ export declare const PI_SPECIALIST_NAMES: ("thoth-explorer" | "thoth-librarian" | "thoth-oracle" | "thoth-designer" | "thoth-worker")[];
2
2
  export interface PiSpecialistSyncOptions {
3
3
  packageRoot: string;
4
4
  piRoot: string;
5
5
  dryRun?: boolean;
6
6
  projectRoots?: readonly string[];
7
+ /** Test-only seam for exercising replacement races before retirement. */
8
+ beforeRetireForTest?: () => void;
7
9
  }
8
10
  export interface PiSpecialistSyncResult {
9
11
  success: boolean;
@@ -0,0 +1,32 @@
1
+ import { type PiSpecialistRole } from '../harness/pi-specialists';
2
+ export interface PiToolRoleSnapshot {
3
+ role: PiSpecialistRole;
4
+ tools: string[];
5
+ defaultTools: string[];
6
+ disallowedTools: string[];
7
+ }
8
+ export interface PiToolConfigSnapshot {
9
+ piRoot: string;
10
+ roles: PiToolRoleSnapshot[];
11
+ contents: Partial<Record<PiSpecialistRole, string>>;
12
+ }
13
+ export interface PiToolRoleInput {
14
+ role: PiSpecialistRole;
15
+ tools: readonly string[];
16
+ }
17
+ export interface PiToolSaveResult {
18
+ success: boolean;
19
+ changedRoles: PiSpecialistRole[];
20
+ /** Reflects only successful writes; pass it back to retry the same draft. */
21
+ snapshot: PiToolConfigSnapshot;
22
+ error?: string;
23
+ }
24
+ export interface PiSpecialistToolOverrides {
25
+ tools?: string[];
26
+ disallowedTools?: string[];
27
+ subagentMode?: 'task' | 'background';
28
+ }
29
+ export declare function validatePiSpecialistTools(tools: readonly string[]): void;
30
+ export declare function readPiSpecialistToolOverrides(content: string): PiSpecialistToolOverrides;
31
+ export declare function readPiToolConfig(piRoot: string, roles?: readonly PiSpecialistRole[]): PiToolConfigSnapshot;
32
+ export declare function savePiToolConfig(snapshot: PiToolConfigSnapshot, roles: readonly PiToolRoleInput[]): PiToolSaveResult;
@@ -2,10 +2,10 @@ import {
2
2
  defaultTuiOperations,
3
3
  effortChoicesForModel,
4
4
  listOperationHarnesses
5
- } from "../../chunk-WCLUZZHI.js";
5
+ } from "../../chunk-VUNYH263.js";
6
6
  import "../../chunk-62L3ORXN.js";
7
- import "../../chunk-2U5MBLLV.js";
8
- import "../../chunk-EFGSGPYM.js";
7
+ import "../../chunk-V7HSGRMB.js";
8
+ import "../../chunk-OW6I7ZUU.js";
9
9
 
10
10
  // src/cli/tui/index.tsx
11
11
  import { render } from "ink";
@@ -4,6 +4,7 @@ export interface InstallArgs {
4
4
  tui: boolean;
5
5
  agent?: InstallAgent;
6
6
  localPackageRoot?: string;
7
+ localPiRuntimeRoot?: string;
7
8
  tmux?: BooleanArg;
8
9
  dryRun?: boolean;
9
10
  reset?: boolean;
@@ -55,6 +56,7 @@ export interface InstallConfig {
55
56
  agent: InstallAgent;
56
57
  hasTmux: boolean;
57
58
  localPackageRoot?: string;
59
+ localPiRuntimeRoot?: string;
58
60
  dryRun?: boolean;
59
61
  reset: boolean;
60
62
  }
@@ -1,6 +1,6 @@
1
- type BuiltinAgentName = 'orchestrator' | 'explorer' | 'librarian' | 'oracle' | 'designer' | 'quick' | 'deep';
1
+ type BuiltinAgentName = 'orchestrator' | 'explorer' | 'librarian' | 'oracle' | 'designer' | 'worker';
2
2
  export type AgentName = BuiltinAgentName | (string & {});
3
- export declare const SUBAGENT_NAMES: readonly ["explorer", "librarian", "oracle", "designer", "quick", "deep"];
3
+ export declare const SUBAGENT_NAMES: readonly ["explorer", "librarian", "oracle", "designer", "worker"];
4
4
  export declare const ORCHESTRATOR_NAME: "orchestrator";
5
5
  export declare const ALL_AGENT_NAMES: readonly BuiltinAgentName[];
6
6
  export declare const SUBAGENT_DELEGATION_RULES: Record<AgentName, readonly string[]>;
@@ -21,13 +21,9 @@ export declare const CONFIRMED_OPENAI_SUBAGENT_PRESET: {
21
21
  readonly model: "gpt-6-sol";
22
22
  readonly effort: "medium";
23
23
  };
24
- readonly quick: {
24
+ readonly worker: {
25
25
  readonly model: "gpt-6-luna";
26
- readonly effort: "medium";
27
- };
28
- readonly deep: {
29
- readonly model: "gpt-6-sol";
30
- readonly effort: "medium";
26
+ readonly effort: "max";
31
27
  };
32
28
  };
33
29
  export declare const OPENCODE_OPENAI_ORCHESTRATOR_PRESET: {
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- declare const FALLBACK_AGENT_NAMES: readonly ["orchestrator", "oracle", "designer", "explorer", "librarian", "quick", "deep"];
3
- declare const MANUAL_AGENT_NAMES: readonly ["orchestrator", "oracle", "designer", "explorer", "librarian", "quick", "deep"];
2
+ declare const FALLBACK_AGENT_NAMES: readonly ["orchestrator", "oracle", "designer", "explorer", "librarian", "worker"];
3
+ declare const MANUAL_AGENT_NAMES: readonly ["orchestrator", "oracle", "designer", "explorer", "librarian", "worker"];
4
4
  export declare const ManualAgentPlanSchema: z.ZodObject<{
5
5
  primary: z.ZodString;
6
6
  fallback1: z.ZodString;
@@ -38,13 +38,7 @@ export declare const ManualPlanSchema: z.ZodObject<{
38
38
  fallback2: z.ZodString;
39
39
  fallback3: z.ZodString;
40
40
  }, z.core.$strip>;
41
- quick: z.ZodObject<{
42
- primary: z.ZodString;
43
- fallback1: z.ZodString;
44
- fallback2: z.ZodString;
45
- fallback3: z.ZodString;
46
- }, z.core.$strip>;
47
- deep: z.ZodObject<{
41
+ worker: z.ZodObject<{
48
42
  primary: z.ZodString;
49
43
  fallback1: z.ZodString;
50
44
  fallback2: z.ZodString;
@@ -106,8 +100,7 @@ export declare const AgentNameSchema: z.ZodEnum<{
106
100
  librarian: "librarian";
107
101
  oracle: "oracle";
108
102
  designer: "designer";
109
- quick: "quick";
110
- deep: "deep";
103
+ worker: "worker";
111
104
  }>;
112
105
  export declare const McpNameSchema: z.ZodEnum<{
113
106
  exa: "exa";
@@ -131,15 +124,7 @@ export declare const FailoverConfigSchema: z.ZodObject<{
131
124
  enabled: z.ZodDefault<z.ZodBoolean>;
132
125
  timeoutMs: z.ZodDefault<z.ZodNumber>;
133
126
  retryDelayMs: z.ZodDefault<z.ZodNumber>;
134
- chains: z.ZodDefault<z.ZodObject<{
135
- orchestrator: z.ZodOptional<z.ZodArray<z.ZodString>>;
136
- oracle: z.ZodOptional<z.ZodArray<z.ZodString>>;
137
- designer: z.ZodOptional<z.ZodArray<z.ZodString>>;
138
- explorer: z.ZodOptional<z.ZodArray<z.ZodString>>;
139
- librarian: z.ZodOptional<z.ZodArray<z.ZodString>>;
140
- quick: z.ZodOptional<z.ZodArray<z.ZodString>>;
141
- deep: z.ZodOptional<z.ZodArray<z.ZodString>>;
142
- }, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
127
+ chains: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
143
128
  }, z.core.$strip>;
144
129
  export type FailoverConfig = z.infer<typeof FailoverConfigSchema>;
145
130
  export declare const PluginConfigSchema: z.ZodObject<{
@@ -183,13 +168,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
183
168
  fallback2: z.ZodString;
184
169
  fallback3: z.ZodString;
185
170
  }, z.core.$strip>;
186
- quick: z.ZodObject<{
187
- primary: z.ZodString;
188
- fallback1: z.ZodString;
189
- fallback2: z.ZodString;
190
- fallback3: z.ZodString;
191
- }, z.core.$strip>;
192
- deep: z.ZodObject<{
171
+ worker: z.ZodObject<{
193
172
  primary: z.ZodString;
194
173
  fallback1: z.ZodString;
195
174
  fallback2: z.ZodString;
@@ -230,15 +209,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
230
209
  enabled: z.ZodDefault<z.ZodBoolean>;
231
210
  timeoutMs: z.ZodDefault<z.ZodNumber>;
232
211
  retryDelayMs: z.ZodDefault<z.ZodNumber>;
233
- chains: z.ZodDefault<z.ZodObject<{
234
- orchestrator: z.ZodOptional<z.ZodArray<z.ZodString>>;
235
- oracle: z.ZodOptional<z.ZodArray<z.ZodString>>;
236
- designer: z.ZodOptional<z.ZodArray<z.ZodString>>;
237
- explorer: z.ZodOptional<z.ZodArray<z.ZodString>>;
238
- librarian: z.ZodOptional<z.ZodArray<z.ZodString>>;
239
- quick: z.ZodOptional<z.ZodArray<z.ZodString>>;
240
- deep: z.ZodOptional<z.ZodArray<z.ZodString>>;
241
- }, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
212
+ chains: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
242
213
  }, z.core.$strip>>;
243
214
  codex: z.ZodOptional<z.ZodObject<{
244
215
  enabled: z.ZodDefault<z.ZodBoolean>;