thoth-agents 0.10.0 → 0.12.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 (101) hide show
  1. package/README.md +5 -3
  2. package/dist/agents/agent-config.d.ts +13 -0
  3. package/dist/agents/index.d.ts +1 -1
  4. package/dist/agents/orchestrator.d.ts +1 -1
  5. package/dist/{chunk-VHQMTZ5O.js → chunk-7F33WUSD.js} +1 -1
  6. package/dist/{chunk-RWQPMWEM.js → chunk-JLU3FSBT.js} +17 -2
  7. package/dist/chunk-MIDGZE34.js +107 -0
  8. package/dist/{chunk-RVQ6IIBR.js → chunk-NY2IPJ7V.js} +361 -118
  9. package/dist/{chunk-RN2ERZLZ.js → chunk-QOA2AETX.js} +2 -228
  10. package/dist/{chunk-6NZTNWI4.js → chunk-SEF6PFM6.js} +504 -211
  11. package/dist/cli/config-io.d.ts +2 -2
  12. package/dist/cli/index.js +92 -39
  13. package/dist/cli/install.d.ts +1 -0
  14. package/dist/cli/opencode-skill-consent.d.ts +5 -0
  15. package/dist/cli/operations/opencode.d.ts +2 -1
  16. package/dist/cli/operations/types.d.ts +1 -0
  17. package/dist/cli/owned-skills.d.ts +16 -0
  18. package/dist/cli/paths.d.ts +1 -1
  19. package/dist/cli/providers.d.ts +1 -1
  20. package/dist/cli/system.d.ts +3 -1
  21. package/dist/cli/thoth-mem-install.d.ts +10 -10
  22. package/dist/cli/tui/index.js +53 -5
  23. package/dist/cli/tui/operations.d.ts +2 -0
  24. package/dist/cli/types.d.ts +2 -4
  25. package/dist/config/loader.d.ts +1 -1
  26. package/dist/config/schema.d.ts +0 -31
  27. package/dist/harness/adapters/opencode.d.ts +1 -1
  28. package/dist/harness/core/agent-pack.d.ts +1 -0
  29. package/dist/harness/core/sdd.d.ts +6 -6
  30. package/dist/hooks/delegate-task-retry/hook.d.ts +8 -8
  31. package/dist/hooks/foreground-fallback/index.d.ts +14 -69
  32. package/dist/hooks/index.d.ts +0 -2
  33. package/dist/hooks/json-error-recovery/hook.d.ts +2 -15
  34. package/dist/hooks/oracle-gate-verdict/hook.d.ts +4 -11
  35. package/dist/index.d.ts +7 -4
  36. package/dist/index.js +822 -1421
  37. package/dist/opencode/agents.d.ts +3 -0
  38. package/dist/opencode/command.d.ts +3 -0
  39. package/dist/opencode/context.d.ts +20 -0
  40. package/dist/opencode/delegation-hooks.d.ts +3 -0
  41. package/dist/opencode/mcp.d.ts +3 -0
  42. package/dist/opencode/permission-rules.d.ts +9 -0
  43. package/dist/opencode/permissions.d.ts +3 -0
  44. package/dist/opencode/session-hooks.d.ts +3 -0
  45. package/dist/opencode/session-state.d.ts +39 -0
  46. package/dist/opencode/skills.d.ts +3 -0
  47. package/dist/opencode/tools.d.ts +3 -0
  48. package/dist/pi.js +3 -3
  49. package/dist/tools/ast-grep/cli.d.ts +1 -0
  50. package/dist/tools/ast-grep/index.d.ts +108 -2
  51. package/dist/tools/ast-grep/tools.d.ts +107 -3
  52. package/dist/tools/define-tool.d.ts +23 -0
  53. package/dist/tools/lsp/tools.d.ts +97 -5
  54. package/dist/utils/index.d.ts +0 -1
  55. package/package.json +14 -3
  56. package/pi/.thoth-agents-assets.json +2 -2
  57. package/pi/agents/thoth-designer.md +1 -1
  58. package/pi/agents/thoth-worker.md +1 -1
  59. package/plugin/.claude-plugin/.thoth-agents-plugin-assets.json +3 -3
  60. package/plugin/.claude-plugin/plugin.json +1 -1
  61. package/plugin/.codex-plugin/.thoth-agents-plugin-assets.json +3 -3
  62. package/plugin/.codex-plugin/plugin.json +1 -1
  63. package/plugin/agents/designer.md +1 -1
  64. package/plugin/agents/orchestrator.md +32 -32
  65. package/plugin/agents/worker.md +1 -1
  66. package/plugin/codex-hooks/payloads/designer.md +1 -1
  67. package/plugin/codex-hooks/payloads/root.md +32 -32
  68. package/plugin/codex-hooks/payloads/worker.md +1 -1
  69. package/plugin/skills/plan-reviewer/SKILL.md +5 -5
  70. package/plugin/skills/thoth-sdd/SKILL.md +33 -9
  71. package/plugin/skills/thoth-sdd/references/phases/checklist.md +1 -1
  72. package/plugin/skills/thoth-sdd/references/phases/clarify.md +1 -1
  73. package/plugin/skills/thoth-sdd/references/phases/converge.md +8 -1
  74. package/plugin/skills/thoth-sdd/references/phases/implement.md +5 -1
  75. package/plugin/skills/thoth-sdd/references/phases/plan.md +1 -1
  76. package/plugin/skills/thoth-sdd/references/phases/specify.md +1 -1
  77. package/plugin/skills/thoth-sdd/references/phases/tasks.md +1 -1
  78. package/plugin/skills/thoth-sdd/references/phases/verify.md +10 -3
  79. package/plugin/skills/thoth-sdd/scripts/validate-result.mjs +28 -2
  80. package/plugin/skills/thoth-sdd/templates/change.md +2 -1
  81. package/skills/plan-reviewer/SKILL.md +5 -5
  82. package/skills/thoth-sdd/SKILL.md +33 -9
  83. package/skills/thoth-sdd/references/phases/checklist.md +1 -1
  84. package/skills/thoth-sdd/references/phases/clarify.md +1 -1
  85. package/skills/thoth-sdd/references/phases/converge.md +8 -1
  86. package/skills/thoth-sdd/references/phases/implement.md +5 -1
  87. package/skills/thoth-sdd/references/phases/plan.md +1 -1
  88. package/skills/thoth-sdd/references/phases/specify.md +1 -1
  89. package/skills/thoth-sdd/references/phases/tasks.md +1 -1
  90. package/skills/thoth-sdd/references/phases/verify.md +10 -3
  91. package/skills/thoth-sdd/scripts/validate-result.mjs +28 -2
  92. package/skills/thoth-sdd/templates/change.md +2 -1
  93. package/thoth-agents.schema.json +0 -26
  94. package/dist/chunk-62L3ORXN.js +0 -30
  95. package/dist/delegation/project-id.d.ts +0 -10
  96. package/dist/hooks/auto-update-checker/checker.d.ts +0 -23
  97. package/dist/hooks/auto-update-checker/constants.d.ts +0 -11
  98. package/dist/hooks/auto-update-checker/index.d.ts +0 -17
  99. package/dist/hooks/auto-update-checker/types.d.ts +0 -22
  100. package/dist/utils/tmux-session-manager.d.ts +0 -63
  101. package/dist/utils/tmux.d.ts +0 -32
@@ -19,10 +19,10 @@ export declare function addPluginToOpenCodeConfig(pluginVersion: string): Promis
19
19
  export interface OpenCodeMainConfigUpdate {
20
20
  ensurePlugin?: boolean;
21
21
  pluginVersion?: string;
22
- disableDefaults?: boolean;
23
22
  }
23
+ export declare function pluginEntries(value: unknown): unknown[];
24
+ export declare function isManagedOpenCodePlugin(entry: unknown): boolean;
24
25
  export declare function updateOpenCodeMainConfig(update: OpenCodeMainConfigUpdate): ConfigMergeResult;
25
26
  export declare function writeLiteConfig(installConfig: InstallConfig, targetPath?: string): ConfigMergeResult;
26
- export declare function disableDefaultAgents(): ConfigMergeResult;
27
27
  export declare function canModifyOpenCodeConfig(): boolean;
28
28
  export declare function detectCurrentConfig(): DetectedConfig;
package/dist/cli/index.js CHANGED
@@ -1,13 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- getOpenCodePath,
4
- getOpenCodeVersion,
5
- isOpenCodeInstalled,
6
3
  opencodeAdapter
7
- } from "../chunk-RN2ERZLZ.js";
4
+ } from "../chunk-QOA2AETX.js";
8
5
  import {
9
6
  CODEX_PLUGIN_ID,
10
7
  CODEX_ROLE_NAMES,
8
+ OPENCODE_VERSION_REQUIREMENT,
11
9
  REQUIRED_SKILLS,
12
10
  SUPPORTED_OPERATION_HARNESSES,
13
11
  applyClaudeCodePlan,
@@ -52,16 +50,22 @@ import {
52
50
  getClaudeCodeStatus,
53
51
  getCodexModelRoles,
54
52
  getCodexStatus,
53
+ getLegacyOpenCodeSkillBackupRoot,
55
54
  getModelOptions,
56
55
  getOpenCodeModelRoles,
56
+ getOpenCodePath,
57
57
  getOpenCodeStatus,
58
+ getOpenCodeVersion,
58
59
  getOperationHarness,
59
60
  getPiModelRoles,
60
61
  getPiStatus,
61
62
  getRequiredSkillInstallCommand,
63
+ inspectLegacyOpenCodeSkills,
62
64
  inspectPiPackageSkills,
63
65
  installRequiredSkill,
64
66
  isMigratableLegacyRole,
67
+ isOpenCodeInstalled,
68
+ isSupportedOpenCodeVersion,
65
69
  listOperationHarnesses,
66
70
  normalizeEffortSelection,
67
71
  parseCodexToml,
@@ -76,11 +80,11 @@ import {
76
80
  safeAtomicWriteFileSync,
77
81
  scalarLocation,
78
82
  syncOpenCodeOwnedSkills
79
- } from "../chunk-6NZTNWI4.js";
80
- import "../chunk-62L3ORXN.js";
83
+ } from "../chunk-SEF6PFM6.js";
84
+ import "../chunk-MIDGZE34.js";
81
85
  import {
82
86
  piAdapter
83
- } from "../chunk-VHQMTZ5O.js";
87
+ } from "../chunk-7F33WUSD.js";
84
88
  import {
85
89
  ALL_AGENT_NAMES,
86
90
  detectCurrentConfig,
@@ -91,7 +95,7 @@ import {
91
95
  resolveExecutingPackageVersion,
92
96
  updateOpenCodeMainConfig,
93
97
  writeLiteConfig
94
- } from "../chunk-RVQ6IIBR.js";
98
+ } from "../chunk-NY2IPJ7V.js";
95
99
 
96
100
  // src/cli/index.ts
97
101
  import { pathToFileURL } from "url";
@@ -577,6 +581,34 @@ import { existsSync } from "fs";
577
581
  import { homedir } from "os";
578
582
  import { join as join2 } from "path";
579
583
  import { cwd } from "process";
584
+
585
+ // src/cli/opencode-skill-consent.ts
586
+ import { createInterface as createInterface2 } from "readline/promises";
587
+ async function requestOpenCodeSkillMoveConsent(options) {
588
+ if (options.dryRun) return false;
589
+ if (options.moveLegacyOpenCodeSkills) return true;
590
+ if (!isInteractiveRuntime(detectRuntimeContext())) return false;
591
+ const copies = inspectLegacyOpenCodeSkills(options.homeDir);
592
+ if (!copies.length) return false;
593
+ console.log(
594
+ copies.map(({ sourcePath }) => `Legacy skill: ${sourcePath}`).join("\n")
595
+ );
596
+ const prompt = createInterface2({
597
+ input: process.stdin,
598
+ output: process.stdout
599
+ });
600
+ try {
601
+ return /^(y|yes)$/i.test(
602
+ (await prompt.question(
603
+ `Move these shadowing copies to a new backup under ${getLegacyOpenCodeSkillBackupRoot(options.homeDir)}? [y/N] `
604
+ )).trim()
605
+ );
606
+ } finally {
607
+ prompt.close();
608
+ }
609
+ }
610
+
611
+ // src/cli/install.ts
580
612
  var GREEN = "\x1B[32m";
581
613
  var BLUE = "\x1B[34m";
582
614
  var YELLOW = "\x1B[33m";
@@ -617,7 +649,7 @@ function printWarning(message) {
617
649
  async function checkOpenCodeInstalled() {
618
650
  const installed = await isOpenCodeInstalled();
619
651
  if (!installed) {
620
- printError("OpenCode is not installed on this system.");
652
+ printError(OPENCODE_VERSION_REQUIREMENT);
621
653
  printInfo("Install it with:");
622
654
  console.log(
623
655
  ` ${BLUE}curl -fsSL https://opencode.ai/install | bash${RESET}`
@@ -629,6 +661,12 @@ async function checkOpenCodeInstalled() {
629
661
  return { ok: false };
630
662
  }
631
663
  const version = await getOpenCodeVersion();
664
+ if (!isSupportedOpenCodeVersion(version)) {
665
+ printError(
666
+ `${OPENCODE_VERSION_REQUIREMENT} Detected: ${version ?? "unavailable"}.`
667
+ );
668
+ return { ok: false };
669
+ }
632
670
  const path = getOpenCodePath();
633
671
  const detectedVersion = version ?? "";
634
672
  const pathInfo = path ? ` (${DIM}${path}${RESET})` : "";
@@ -650,7 +688,7 @@ function formatConfigSummary(dryRun) {
650
688
  lines.push(`${BOLD}Configuration Summary${RESET}`);
651
689
  lines.push("");
652
690
  lines.push(` ${BOLD}Preset:${RESET} ${BLUE}openai${RESET}`);
653
- lines.push(` ${SYMBOLS.check} Seven-role adaptive thoth-agents roster`);
691
+ lines.push(` ${SYMBOLS.check} Six-role adaptive thoth-agents roster`);
654
692
  lines.push(` ${SYMBOLS.check} OpenAI models by default`);
655
693
  lines.push(
656
694
  ` ${SYMBOLS.check} Proportional SDD and ID-named substantial-change records`
@@ -661,27 +699,31 @@ function formatConfigSummary(dryRun) {
661
699
  lines.push(
662
700
  ` ${DIM}\u25CB thoth-mem remains the owner of hooks, MCP, skill, lifecycle, persistence, receipts, and recovery.${RESET}`
663
701
  );
664
- lines.push(` ${SYMBOLS.check} Global thoth-owned OpenCode skills`);
702
+ lines.push(` ${SYMBOLS.check} Package-provided thoth-owned OpenCode skills`);
665
703
  lines.push(` ${SYMBOLS.check} Required external skills for this harness`);
666
704
  return lines.join("\n");
667
705
  }
668
706
  function installOwnedSkillsForOpenCode(dryRun, dependencies) {
669
707
  const result = syncOpenCodeOwnedSkills({
670
708
  dryRun,
709
+ moveLegacyOpenCodeSkills: dependencies.moveLegacyOpenCodeSkills,
671
710
  homeDir: dependencies.homeDir ?? homedir(),
672
711
  packageRoot: dependencies.opencodeOwnedSkillPackageRoot
673
712
  });
674
713
  for (const skill of result.skills) {
675
- printInfo(` - ${skill.name}: ${skill.destinationPath}`);
714
+ printInfo(` - ${skill.name}: ${skill.sourcePath}`);
715
+ }
716
+ for (const notice of result.notices ?? []) {
717
+ printInfo(notice);
676
718
  }
677
719
  if (!result.success) {
678
720
  printError(
679
- `Failed to synchronize global thoth-owned OpenCode skills: ${result.error ?? "unknown error"}`
721
+ `Failed to inspect package-provided thoth-owned OpenCode skills: ${result.error ?? "unknown error"}`
680
722
  );
681
723
  return false;
682
724
  }
683
725
  printSuccess(
684
- dryRun ? "Global thoth-owned OpenCode skills planned" : "Global thoth-owned OpenCode skills synchronized"
726
+ dryRun ? "Package-provided thoth-owned OpenCode skills planned" : "Package-provided thoth-owned OpenCode skills available"
685
727
  );
686
728
  return true;
687
729
  }
@@ -719,14 +761,12 @@ function installRequiredSkillsForHarness(harness, dryRun, homeDir = homedir()) {
719
761
  }
720
762
  function printThothMemSetupResult(result, dryRun) {
721
763
  printInfo(`Provider command: ${result.command} ${result.args.join(" ")}`);
722
- for (const step of result.steps) {
723
- printInfo(`thoth-mem: ${step.name} [${step.outcome}]`);
724
- }
764
+ for (const action of result.actions) printInfo(`thoth-mem action: ${action}`);
765
+ for (const warning of result.warnings)
766
+ printWarning(`thoth-mem warning: ${warning}`);
767
+ if (result.restartRequired) printWarning("thoth-mem: restart required");
725
768
  for (const diagnostic of result.diagnostics) printInfo(diagnostic);
726
769
  if (result.receipt) printInfo(`thoth-mem receipt: ${result.receipt}`);
727
- for (const action of result.manualActions) {
728
- printWarning(`thoth-mem manual action: ${action}`);
729
- }
730
770
  if (!result.success) {
731
771
  printError(`thoth-mem setup is incomplete: ${result.status}`);
732
772
  if (result.error) printError(result.error);
@@ -800,7 +840,7 @@ async function runInstall(config, dependencies, pluginVersion) {
800
840
  printStep(
801
841
  step++,
802
842
  totalSteps,
803
- "Configuring the thoth-agents plugin and OpenCode default agents..."
843
+ "Configuring the pinned thoth-agents plugin (OpenCode 2.2.6+)..."
804
844
  );
805
845
  if (config.dryRun) {
806
846
  printInfo("Dry run mode - skipping main config update");
@@ -808,8 +848,7 @@ async function runInstall(config, dependencies, pluginVersion) {
808
848
  const updateMainConfig = dependencies.updateOpenCodeMainConfig ?? updateOpenCodeMainConfig;
809
849
  const mainConfigResult = updateMainConfig({
810
850
  ensurePlugin: true,
811
- pluginVersion,
812
- disableDefaults: true
851
+ pluginVersion
813
852
  });
814
853
  if (!handleStepResult(mainConfigResult, "Main config updated")) return 1;
815
854
  }
@@ -842,8 +881,16 @@ ${JSON.stringify(liteConfig, null, 2)}
842
881
  printStep(
843
882
  step++,
844
883
  totalSteps,
845
- "Synchronizing global thoth-owned OpenCode skills..."
884
+ "Inspecting package-provided thoth-owned OpenCode skills..."
846
885
  );
886
+ dependencies = {
887
+ ...dependencies,
888
+ moveLegacyOpenCodeSkills: await requestOpenCodeSkillMoveConsent({
889
+ dryRun: config.dryRun,
890
+ homeDir: dependencies.homeDir,
891
+ moveLegacyOpenCodeSkills: dependencies.moveLegacyOpenCodeSkills
892
+ })
893
+ };
847
894
  if (!installOwnedSkillsForOpenCode(config.dryRun, dependencies)) return 1;
848
895
  printStep(step++, totalSteps, "Installing required external skills...");
849
896
  if (!installRequiredSkillsForHarness(
@@ -875,7 +922,7 @@ ${JSON.stringify(liteConfig, null, 2)}
875
922
  const modelsInfo = "Default configuration uses OpenAI models.";
876
923
  console.log(`${BOLD}${modelsInfo}${RESET}`);
877
924
  console.log(
878
- ` ${DIM}Includes the seven-role adaptive roster, native parallel delegation, and proportional SDD governance.${RESET}`
925
+ ` ${DIM}Includes the six-role adaptive roster, native parallel delegation, and proportional SDD governance.${RESET}`
879
926
  );
880
927
  return 0;
881
928
  }
@@ -965,7 +1012,6 @@ async function runPiInstall(config, dependencies, packageVersion, executingPacka
965
1012
  function createInstallConfig(args) {
966
1013
  return {
967
1014
  agent: args.agent ?? "opencode",
968
- hasTmux: args.tmux === "yes",
969
1015
  ...args.localPackageRoot ? { localPackageRoot: args.localPackageRoot } : {},
970
1016
  ...args.localPiRuntimeRoot ? { localPiRuntimeRoot: args.localPiRuntimeRoot } : {},
971
1017
  dryRun: args.dryRun,
@@ -973,6 +1019,10 @@ function createInstallConfig(args) {
973
1019
  };
974
1020
  }
975
1021
  async function install(args, dependencies = {}) {
1022
+ dependencies = {
1023
+ ...dependencies,
1024
+ moveLegacyOpenCodeSkills: args.moveLegacyOpenCodeSkills
1025
+ };
976
1026
  const config = createInstallConfig(args);
977
1027
  const resolvePackageVersion = dependencies.resolveExecutingPackageVersion ?? resolveExecutingPackageVersion;
978
1028
  const packageVersion = resolvePackageVersion();
@@ -1244,11 +1294,12 @@ Commands:
1244
1294
  model Preview role model/provider settings
1245
1295
 
1246
1296
  Options:
1247
- --tmux=yes|no Enable tmux integration (yes/no)
1248
1297
  --no-tui Non-interactive mode
1249
1298
  --dry-run Simulate install without writing files
1250
1299
  --apply Apply a reviewed update, sync, or model plan
1251
1300
  --trust-hooks Consent to Codex plugin hooks running outside the sandbox (install/update)
1301
+ --move-legacy-opencode-skills
1302
+ Confirm backup move of shadowing owned OpenCode skills (install/update)
1252
1303
  --reset Repair managed installer-owned targets
1253
1304
  --agent=opencode|codex|claude|pi
1254
1305
  Select OpenCode plugin install (default), Codex/Claude setup, or complete Pi-native setup
@@ -1265,7 +1316,7 @@ Generate options:
1265
1316
 
1266
1317
  OpenCode plugin config and the npm binary are separate surfaces.
1267
1318
  OpenCode loads the plugin with config such as:
1268
- plugin: ["${exactPluginEntry}"]
1319
+ plugins: ["${exactPluginEntry}"]
1269
1320
 
1270
1321
  That plugin entry does not create a global thoth-agents command.
1271
1322
  Run this CLI through a global install, npx, or pnpm dlx.
@@ -1276,9 +1327,11 @@ The official record is $XDG_CONFIG_HOME/thoth-agents/install-state.json,
1276
1327
  or ~/.config/thoth-agents/install-state.json when XDG_CONFIG_HOME is unset.
1277
1328
  Codex and Claude marketplace versions remain native-manager-owned and do not prove
1278
1329
  that CLI-managed agents, skills, configuration, or provider setup are aligned.
1279
- Runtime release checks notify only; use the latest CLI install or interactive CLI Update.
1330
+ Use the latest CLI install or interactive CLI Update to change the pinned release.
1280
1331
 
1281
- OpenCode install configures the adaptive six-role roster and native task delegation.
1332
+ OpenCode 2.2.6 or later is required before applying configuration.
1333
+ OpenCode install configures the adaptive six-role roster and native subagent delegation.
1334
+ The plugin provides its five owned skills from its installed package; no global copies are written.
1282
1335
  Provider capability is external and reported only from caller-supplied evidence.
1283
1336
 
1284
1337
  External required skills are installed for every harness:
@@ -1298,7 +1351,7 @@ Examples:
1298
1351
  pnpm dlx thoth-agents@latest install --agent=claude --dry-run
1299
1352
  pnpm dlx thoth-agents@latest install --agent=pi --dry-run
1300
1353
  node dist/cli/index.js install --agent=pi --local-package-root="<absolute-path>"
1301
- pnpm dlx thoth-agents install --no-tui --tmux=no
1354
+ pnpm dlx thoth-agents install --no-tui
1302
1355
  pnpm dlx thoth-agents install --dry-run
1303
1356
  pnpm dlx thoth-agents install --reset
1304
1357
  pnpm dlx thoth-agents generate --harness=codex --dry-run
@@ -1480,6 +1533,10 @@ async function runOperationCommand(command, args, services) {
1480
1533
  buildOperationPlan(command, args, {
1481
1534
  ...services.operationContext(),
1482
1535
  trustHooks,
1536
+ moveLegacyOpenCodeSkills: selectedHarness(args) === "opencode" ? await requestOpenCodeSkillMoveConsent({
1537
+ moveLegacyOpenCodeSkills: args.moveLegacyOpenCodeSkills,
1538
+ dryRun: !args.apply || args.dryRun
1539
+ }) : false,
1483
1540
  replaceLegacyAgents: args.replaceLegacyAgents
1484
1541
  }),
1485
1542
  args,
@@ -1554,12 +1611,6 @@ var operationCommands = /* @__PURE__ */ new Set([
1554
1611
  "sync",
1555
1612
  "model"
1556
1613
  ]);
1557
- function parseBooleanArg(name, value) {
1558
- if (value !== "yes" && value !== "no") {
1559
- throw new Error(`${name} must be yes or no.`);
1560
- }
1561
- return value;
1562
- }
1563
1614
  function parseOperationHarness(value) {
1564
1615
  if (value !== "opencode" && value !== "codex" && value !== "claude" && value !== "pi") {
1565
1616
  throw new Error(
@@ -1636,6 +1687,8 @@ function parseOperationArgs(args) {
1636
1687
  result.apply = true;
1637
1688
  } else if (arg === "--replace-legacy-agents") {
1638
1689
  result.replaceLegacyAgents = true;
1690
+ } else if (arg === "--move-legacy-opencode-skills") {
1691
+ result.moveLegacyOpenCodeSkills = true;
1639
1692
  } else if (arg === "--trust-hooks") {
1640
1693
  result.trustHooks = true;
1641
1694
  } else if (arg === "--dry-run") {
@@ -1682,8 +1735,8 @@ function parseInstallArgs(args) {
1682
1735
  if (arg === void 0) break;
1683
1736
  if (arg === "--no-tui") {
1684
1737
  result.tui = false;
1685
- } else if (arg.startsWith("--tmux=")) {
1686
- result.tmux = parseBooleanArg("--tmux", arg.split("=")[1] ?? "");
1738
+ } else if (arg === "--move-legacy-opencode-skills") {
1739
+ result.moveLegacyOpenCodeSkills = true;
1687
1740
  } else if (arg === "--trust-hooks") {
1688
1741
  result.trustHooks = true;
1689
1742
  } else if (arg === "--dry-run") {
@@ -9,6 +9,7 @@ import type { ThothMemSetupOptions, ThothMemSetupResult } from './thoth-mem-inst
9
9
  import type { InstallArgs, InstallConfig } from './types';
10
10
  export interface InstallDependencies {
11
11
  homeDir?: string;
12
+ moveLegacyOpenCodeSkills?: boolean;
12
13
  opencodeOwnedSkillPackageRoot?: string;
13
14
  runThothMemSetup?: (options: ThothMemSetupOptions) => ThothMemSetupResult;
14
15
  resolveExecutingPackageVersion?: () => ExecutingPackageVersionResult;
@@ -0,0 +1,5 @@
1
+ export declare function requestOpenCodeSkillMoveConsent(options: {
2
+ moveLegacyOpenCodeSkills?: boolean;
3
+ dryRun?: boolean;
4
+ homeDir?: string;
5
+ }): Promise<boolean>;
@@ -8,6 +8,7 @@ import { installRequiredSkill } from '../skills';
8
8
  import type { ConfigMergeResult } from '../types';
9
9
  import type { HarnessAction, HarnessStatusReport, ModelConfigInput, OperationApplyResult, OperationContext, OperationPlan } from './types';
10
10
  export interface OpenCodeOperationContext extends OperationContext {
11
+ getOpenCodeVersion?: () => string | null;
11
12
  resolveExecutingPackageVersion?: () => ExecutingPackageVersionResult;
12
13
  updateOpenCodeMainConfig?: (update: OpenCodeMainConfigUpdate) => ConfigMergeResult;
13
14
  writeLiteConfig?: typeof writeLiteConfig;
@@ -21,7 +22,7 @@ export declare const opencodeOperationAdapter: {
21
22
  readonly id: "opencode";
22
23
  readonly displayName: "OpenCode";
23
24
  readonly available: true;
24
- readonly description: "OpenCode plugin and configuration surfaces.";
25
+ readonly description: "OpenCode 2.2.6 or later: pinned plugin and configuration surfaces.";
25
26
  readonly actions: HarnessAction[];
26
27
  };
27
28
  export declare function getOpenCodeStatus(context?: OperationContext, evidence?: ProviderEvidenceInput): HarnessStatusReport;
@@ -136,6 +136,7 @@ export interface OperationApplyResult {
136
136
  disclaimers: OperationDisclaimer[];
137
137
  }
138
138
  export interface OperationContext {
139
+ moveLegacyOpenCodeSkills?: boolean;
139
140
  cwd: string;
140
141
  env?: Readonly<Record<string, string | undefined>>;
141
142
  }
@@ -1,6 +1,7 @@
1
1
  import { type ThothOwnedSkillName } from '../harness/core/owned-skills';
2
2
  export interface OpenCodeOwnedSkillSyncOptions {
3
3
  dryRun?: boolean;
4
+ moveLegacyOpenCodeSkills?: boolean;
4
5
  homeDir?: string;
5
6
  packageRoot?: string;
6
7
  }
@@ -13,6 +14,9 @@ export interface OpenCodeOwnedSkillSyncResult {
13
14
  success: boolean;
14
15
  status: 'planned' | 'installed' | 'failed';
15
16
  skills: OpenCodeOwnedSkillSyncEntry[];
17
+ notices?: string[];
18
+ backupRoot?: string;
19
+ legacyMoves?: LegacyOpenCodeSkillMove[];
16
20
  error?: string;
17
21
  }
18
22
  export interface PiPackageSkillInspectionResult {
@@ -31,6 +35,18 @@ export declare function getOpenCodeOwnedSkillEntries(options?: Pick<OpenCodeOwne
31
35
  export declare function getPiOwnedSkillEntries(options: {
32
36
  packageRoot: string;
33
37
  }): OpenCodeOwnedSkillSyncEntry[];
38
+ export interface LegacyOpenCodeSkillMove {
39
+ sourcePath: string;
40
+ destinationPath: string;
41
+ status: 'planned' | 'moved' | 'failed';
42
+ }
43
+ export declare function getLegacyOpenCodeSkillBackupRoot(homeDir?: string): string;
44
+ export declare function inspectLegacyOpenCodeSkills(homeDir?: string): Array<{
45
+ name: ThothOwnedSkillName;
46
+ sourcePath: string;
47
+ label: string;
48
+ }>;
49
+ export declare function legacyOpenCodeSkillNotice(path: string): string;
34
50
  export declare function syncOpenCodeOwnedSkills(options?: OpenCodeOwnedSkillSyncOptions): OpenCodeOwnedSkillSyncResult;
35
51
  export declare function inspectPiPackageSkills(options: {
36
52
  packageRoot: string;
@@ -6,7 +6,7 @@
6
6
  * 2. XDG_CONFIG_HOME/opencode
7
7
  * 3. ~/.config/opencode
8
8
  */
9
- export declare function getConfigDir(): string;
9
+ export declare function getConfigDir(homeDir?: string): string;
10
10
  export declare function getOpenCodeConfigPaths(): string[];
11
11
  export declare function getConfigJson(): string;
12
12
  export declare function getConfigJsonc(): string;
@@ -7,5 +7,5 @@ type ModelMapping = {
7
7
  export declare const MODEL_MAPPINGS: {
8
8
  readonly openai: Record<string, ModelMapping>;
9
9
  };
10
- export declare function generateLiteConfig(installConfig: InstallConfig): Record<string, unknown>;
10
+ export declare function generateLiteConfig(_installConfig: InstallConfig): Record<string, unknown>;
11
11
  export {};
@@ -9,7 +9,9 @@ type OpenCodeVersionInvocation = {
9
9
  export declare function getOpenCodeVersionInvocation(opencodePath: string, platform?: typeof process.platform): OpenCodeVersionInvocation;
10
10
  export declare function resolveOpenCodePath(): string;
11
11
  export declare function isOpenCodeInstalled(): Promise<boolean>;
12
- export declare function isTmuxInstalled(): Promise<boolean>;
12
+ export declare const OPENCODE_VERSION_REQUIREMENT = "OpenCode 2.2.6 or later is required; install or upgrade OpenCode before applying configuration.";
13
+ export declare function isSupportedOpenCodeVersion(output: string | null): boolean;
14
+ export declare function getOpenCodeVersionSync(): string | null;
13
15
  export declare function getOpenCodeVersion(): Promise<string | null>;
14
16
  export declare function getOpenCodePath(): string | null;
15
17
  export declare function fetchLatestVersion(packageName: string): Promise<string | null>;
@@ -1,12 +1,8 @@
1
- import { type NpxCommand, type NpxCommandOptions } from './npx-command';
1
+ import type { NpxCommand, NpxCommandOptions } from './npx-command';
2
2
  import type { InstallAgent } from './types';
3
+ export declare const THOTH_MEM_PACKAGE_SPEC = "thoth-mem@>=0.7.0";
3
4
  export declare const THOTH_MEM_SETUP_TIMEOUT_MS = 120000;
4
- export type ThothMemSetupStatus = 'complete' | 'failed' | 'partial' | 'requires_user_action';
5
- export type ThothMemSetupOutcome = 'planned' | 'skipped' | 'confirmed' | 'failed' | 'unavailable';
6
- export interface ThothMemSetupStep {
7
- name: string;
8
- outcome: ThothMemSetupOutcome;
9
- }
5
+ export type ThothMemSetupStatus = 'planned' | 'complete' | 'unsupported' | 'requires-user-action';
10
6
  export interface ThothMemCommandResult {
11
7
  exitCode: number | null;
12
8
  stdout: string;
@@ -29,15 +25,19 @@ export interface ThothMemSetupResult {
29
25
  status: ThothMemSetupStatus | 'invalid';
30
26
  changed: boolean;
31
27
  harness: InstallAgent;
32
- target?: string;
33
- steps: ThothMemSetupStep[];
28
+ actions: string[];
29
+ warnings: string[];
30
+ restartRequired?: boolean;
34
31
  diagnostics: string[];
35
- manualActions: string[];
36
32
  receipt: string | null;
37
33
  command: string;
38
34
  args: string[];
39
35
  exitCode: number | null;
40
36
  error?: string;
41
37
  }
38
+ export declare function executeThothMemCommand(command: string, args: readonly string[], options: {
39
+ cwd?: string;
40
+ timeoutMs: number;
41
+ }): ThothMemCommandResult;
42
42
  export declare function getThothMemSetupCommand(harness: InstallAgent, dryRun: boolean, options?: NpxCommandOptions): NpxCommand;
43
43
  export declare function runThothMemSetup(options: ThothMemSetupOptions): ThothMemSetupResult;
@@ -2,10 +2,10 @@ import {
2
2
  defaultTuiOperations,
3
3
  effortChoicesForModel,
4
4
  listOperationHarnesses
5
- } from "../../chunk-6NZTNWI4.js";
6
- import "../../chunk-62L3ORXN.js";
7
- import "../../chunk-VHQMTZ5O.js";
8
- import "../../chunk-RVQ6IIBR.js";
5
+ } from "../../chunk-SEF6PFM6.js";
6
+ import "../../chunk-MIDGZE34.js";
7
+ import "../../chunk-7F33WUSD.js";
8
+ import "../../chunk-NY2IPJ7V.js";
9
9
 
10
10
  // src/cli/tui/index.tsx
11
11
  import { render } from "ink";
@@ -974,7 +974,7 @@ function App({
974
974
  setView("harness");
975
975
  } else if (view === "action") {
976
976
  setView("root");
977
- } else if (view === "preview" || view === "hookTrust") {
977
+ } else if (view === "preview" || view === "hookTrust" || view === "skillMove") {
978
978
  setView(previewBackView);
979
979
  } else if (view === "modelRoles") {
980
980
  setView("manageHarness");
@@ -1003,6 +1003,12 @@ function App({
1003
1003
  setView("hookTrust");
1004
1004
  return;
1005
1005
  }
1006
+ if (harness === "opencode" && (action === "install" || action === "update") && (operations.legacyOpenCodeSkillCopies?.().length ?? 0) > 0) {
1007
+ setPendingHookAction(action);
1008
+ setHookTrustSelected(0);
1009
+ setView("skillMove");
1010
+ return;
1011
+ }
1006
1012
  setPlan(operations.plan(harness, action));
1007
1013
  setView("preview");
1008
1014
  }
@@ -1194,6 +1200,19 @@ function App({
1194
1200
  if (view !== "root") goBack();
1195
1201
  return;
1196
1202
  }
1203
+ if (view === "skillMove") {
1204
+ if (key.upArrow || key.downArrow || input === "j" || input === "k")
1205
+ setHookTrustSelected((current) => current === 0 ? 1 : 0);
1206
+ if (key.return) {
1207
+ setPlan(
1208
+ operations.plan("opencode", pendingHookAction, {
1209
+ moveLegacyOpenCodeSkills: hookTrustSelected === 1
1210
+ })
1211
+ );
1212
+ setView("preview");
1213
+ }
1214
+ return;
1215
+ }
1197
1216
  if (view === "hookTrust") {
1198
1217
  if (key.upArrow || key.downArrow || input === "j" || input === "k")
1199
1218
  setHookTrustSelected((current) => current === 0 ? 1 : 0);
@@ -1505,6 +1524,35 @@ function App({
1505
1524
  )
1506
1525
  ] });
1507
1526
  }
1527
+ if (view === "skillMove") {
1528
+ return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", children: [
1529
+ /* @__PURE__ */ jsx8(
1530
+ Header,
1531
+ {
1532
+ title: "Move legacy OpenCode skills?",
1533
+ subtitle: "These copies shadow the packaged skills. Backup only; never delete."
1534
+ }
1535
+ ),
1536
+ /* @__PURE__ */ jsx8(
1537
+ Menu,
1538
+ {
1539
+ items: [
1540
+ {
1541
+ id: "no",
1542
+ label: "No \u2014 leave copies unchanged",
1543
+ detail: "Copies will continue to shadow packaged skills."
1544
+ },
1545
+ {
1546
+ id: "yes",
1547
+ label: "Yes \u2014 move copies to a new hidden backup",
1548
+ detail: "Keep the original contents in a reversible backup."
1549
+ }
1550
+ ],
1551
+ selected: hookTrustSelected
1552
+ }
1553
+ )
1554
+ ] });
1555
+ }
1508
1556
  if (view === "hookTrust") {
1509
1557
  return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", children: [
1510
1558
  /* @__PURE__ */ jsx8(
@@ -5,12 +5,14 @@ import type { HarnessStatusReport, ModelRoleInput, OperationApplyResult, Operati
5
5
  import { type ModelOption } from './model-catalog';
6
6
  export type TuiAction = 'status' | 'list' | 'install' | 'update' | 'sync' | 'model';
7
7
  export interface TuiOperations {
8
+ legacyOpenCodeSkillCopies?: () => string[];
8
9
  status(harness: HarnessId, evidence?: ProviderEvidenceInput): HarnessStatusReport;
9
10
  providerCapability?(harness: HarnessId): Promise<ProviderCapabilityEvidence>;
10
11
  modelRoles(harness: HarnessId): ModelRoleInput[];
11
12
  modelOptions(harness: HarnessId): Promise<ModelOption[]>;
12
13
  plan(harness: HarnessId, action: Exclude<TuiAction, 'status' | 'list'>, options?: {
13
14
  trustHooks?: boolean;
15
+ moveLegacyOpenCodeSkills?: boolean;
14
16
  }): OperationPlan;
15
17
  modelPlan(harness: HarnessId, roles: ModelRoleInput[]): OperationPlan;
16
18
  restoreModelPlan(harness: HarnessId, options: readonly ModelOption[]): OperationPlan;
@@ -1,11 +1,10 @@
1
- export type BooleanArg = 'yes' | 'no';
2
1
  export type InstallAgent = 'opencode' | 'codex' | 'claude' | 'pi';
3
2
  export interface InstallArgs {
3
+ moveLegacyOpenCodeSkills?: boolean;
4
4
  tui: boolean;
5
5
  agent?: InstallAgent;
6
6
  localPackageRoot?: string;
7
7
  localPiRuntimeRoot?: string;
8
- tmux?: BooleanArg;
9
8
  dryRun?: boolean;
10
9
  trustHooks?: boolean;
11
10
  reset?: boolean;
@@ -23,6 +22,7 @@ export interface CliModelRoleArg {
23
22
  effort?: EffortSelection;
24
23
  }
25
24
  export interface OperationArgs {
25
+ moveLegacyOpenCodeSkills?: boolean;
26
26
  replaceLegacyAgents?: boolean;
27
27
  harness?: OperationHarnessArg;
28
28
  all?: boolean;
@@ -57,7 +57,6 @@ export interface OpenCodeConfig {
57
57
  }
58
58
  export interface InstallConfig {
59
59
  agent: InstallAgent;
60
- hasTmux: boolean;
61
60
  localPackageRoot?: string;
62
61
  localPiRuntimeRoot?: string;
63
62
  dryRun?: boolean;
@@ -71,6 +70,5 @@ export interface ConfigMergeResult {
71
70
  export interface DetectedConfig {
72
71
  isInstalled: boolean;
73
72
  hasOpenAI: boolean;
74
- hasTmux: boolean;
75
73
  }
76
74
  import type { EffortSelection } from './model-effort';
@@ -9,7 +9,7 @@ import { type PluginConfig } from './schema';
9
9
  *
10
10
  * JSONC format is preferred over JSON (allows comments and trailing commas).
11
11
  * Project config takes precedence over user config. Nested objects (agents,
12
- * tmux, fallback, and harness generation options) are
12
+ * fallback, and harness generation options) are
13
13
  * deep-merged, while top-level arrays are replaced entirely
14
14
  * by project config.
15
15
  *