oh-my-opencode 4.9.2 → 4.10.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 (211) hide show
  1. package/.agents/skills/opencode-qa/scripts/lib/common.sh +39 -1
  2. package/.agents/skills/tech-debt-audit/SKILL.md +277 -0
  3. package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/execution-plan.md +1 -1
  4. package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/execution-plan.md +1 -1
  5. package/bin/platform.js +5 -0
  6. package/bin/platform.test.ts +56 -0
  7. package/dist/agents/atlas/agent.d.ts +4 -3
  8. package/dist/agents/gpt-apply-patch-guard.d.ts +2 -2
  9. package/dist/agents/hephaestus/agent.d.ts +5 -0
  10. package/dist/agents/hephaestus/index.d.ts +1 -1
  11. package/dist/agents/metis.d.ts +1 -0
  12. package/dist/agents/prometheus/system-prompt.d.ts +1 -1
  13. package/dist/agents/sisyphus/kimi-k2-7.d.ts +17 -0
  14. package/dist/agents/sisyphus-junior/agent.d.ts +1 -1
  15. package/dist/agents/sisyphus-junior/kimi-k2-7.d.ts +11 -0
  16. package/dist/agents/types.d.ts +2 -2
  17. package/dist/cli/doctor/checks/codex-components.d.ts +13 -0
  18. package/dist/cli/doctor/checks/tui-plugin-config.d.ts +1 -0
  19. package/dist/cli/doctor/constants.d.ts +1 -1
  20. package/dist/cli/index.js +929 -291
  21. package/dist/cli/install-codex/codex-cleanup.d.ts +4 -0
  22. package/dist/cli/install-codex/install-codex-test-fixtures.d.ts +34 -0
  23. package/dist/cli/install-codex/link-cached-plugin-agents.d.ts +4 -0
  24. package/dist/cli/model-fallback.d.ts +1 -0
  25. package/dist/cli/provider-availability.d.ts +2 -0
  26. package/dist/cli-node/index.js +929 -291
  27. package/dist/config/schema/agent-overrides.d.ts +80 -16
  28. package/dist/config/schema/experimental.d.ts +0 -1
  29. package/dist/config/schema/hooks.d.ts +0 -1
  30. package/dist/config/schema/internal/permission.d.ts +5 -1
  31. package/dist/config/schema/oh-my-opencode-config.d.ts +75 -16
  32. package/dist/create-hooks.d.ts +0 -1
  33. package/dist/features/background-agent/index.d.ts +1 -1
  34. package/dist/features/background-agent/manager.d.ts +6 -0
  35. package/dist/features/background-agent/types.d.ts +2 -0
  36. package/dist/features/claude-code-plugin-loader/types.d.ts +3 -0
  37. package/dist/features/claude-code-session-state/state.d.ts +1 -0
  38. package/dist/features/skill-mcp-manager/manager.d.ts +11 -7
  39. package/dist/features/team-mode/team-mailbox/pending-delivery-recovery.d.ts +31 -0
  40. package/dist/features/team-mode/team-runtime/delete-team.d.ts +2 -1
  41. package/dist/features/team-mode/tools/lifecycle-inline-spec.d.ts +2 -2
  42. package/dist/features/tmux-subagent/stale-tmux-resource-sweeper.d.ts +12 -0
  43. package/dist/features/tool-metadata-store/store.d.ts +5 -0
  44. package/dist/hooks/anthropic-context-window-limit-recovery/storage/constants.d.ts +3 -0
  45. package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/messages-reader.d.ts +1 -1
  46. package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/part-content.d.ts +1 -1
  47. package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/parts-reader.d.ts +1 -1
  48. package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery/storage}/types.d.ts +0 -13
  49. package/dist/hooks/auto-update-checker/checker/bundled-version.d.ts +1 -0
  50. package/dist/hooks/auto-update-checker/checker.d.ts +1 -0
  51. package/dist/hooks/auto-update-checker/constants.d.ts +3 -3
  52. package/dist/hooks/auto-update-checker/hook.d.ts +2 -1
  53. package/dist/hooks/claude-code-hooks/types.d.ts +4 -0
  54. package/dist/hooks/index.d.ts +0 -1
  55. package/dist/hooks/team-session-events/team-idle-wake-hint.d.ts +5 -0
  56. package/dist/index.js +2991 -2367
  57. package/dist/oh-my-opencode.schema.json +120 -18
  58. package/dist/plugin/build-team-idle-wake-hint-client.d.ts +2 -0
  59. package/dist/plugin/event-session-lifecycle.d.ts +0 -3
  60. package/dist/plugin/hooks/create-continuation-hooks.d.ts +0 -6
  61. package/dist/plugin/hooks/create-core-hooks.d.ts +0 -1
  62. package/dist/plugin/hooks/create-session-hooks.d.ts +1 -2
  63. package/dist/shared/command-executor/execute-hook-command.d.ts +7 -0
  64. package/dist/shared/plugin-identity.d.ts +2 -2
  65. package/dist/shared/tmux/tmux-utils/server-health.d.ts +2 -1
  66. package/dist/shared/tmux/tmux-utils/stale-attach-pane-sweep.d.ts +16 -0
  67. package/dist/shared/tmux/tmux-utils.d.ts +1 -0
  68. package/dist/tools/background-task/clients.d.ts +2 -0
  69. package/dist/tools/background-task/full-session-format.d.ts +1 -0
  70. package/dist/tools/background-task/types.d.ts +1 -0
  71. package/dist/tools/delegate-task/sync-prompt-sender.d.ts +1 -1
  72. package/dist/tools/delegate-task/sync-session-lifecycle.d.ts +2 -1
  73. package/dist/tools/look-at/look-at-input-preparer.d.ts +6 -2
  74. package/dist/tools/look-at/look-at-prompt.d.ts +2 -1
  75. package/dist/tools/look-at/look-at-session-runner.d.ts +3 -4
  76. package/dist/tools/look-at/types.d.ts +2 -0
  77. package/dist/tools/session-manager/types.d.ts +1 -0
  78. package/dist/tools/skill-mcp/types.d.ts +1 -0
  79. package/package.json +14 -13
  80. package/packages/ast-grep-mcp/dist/cli.js +50 -17
  81. package/packages/lsp-daemon/dist/cli.js +8 -5
  82. package/packages/lsp-daemon/dist/index.js +8 -5
  83. package/packages/lsp-tools-mcp/dist/lsp/connection.js +1 -1
  84. package/packages/lsp-tools-mcp/dist/lsp/server-definitions.js +2 -2
  85. package/packages/lsp-tools-mcp/dist/lsp/transport.d.ts +10 -1
  86. package/packages/lsp-tools-mcp/dist/lsp/transport.js +6 -3
  87. package/packages/omo-codex/lazycodex-repository/.github/workflows/pr-source-guidance.yml +11 -12
  88. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  89. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +2583 -0
  90. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +17 -0
  91. package/packages/omo-codex/plugin/components/bootstrap/manifests/ast-grep.json +22 -0
  92. package/packages/omo-codex/plugin/components/bootstrap/manifests/node.json +10 -0
  93. package/packages/omo-codex/plugin/components/bootstrap/package.json +20 -0
  94. package/packages/omo-codex/plugin/components/bootstrap/scripts/bootstrap.ps1 +310 -0
  95. package/packages/omo-codex/plugin/components/bootstrap/scripts/build.mjs +35 -0
  96. package/packages/omo-codex/plugin/components/bootstrap/scripts/generate-manifests.mjs +115 -0
  97. package/packages/omo-codex/plugin/components/bootstrap/src/cli.ts +153 -0
  98. package/packages/omo-codex/plugin/components/bootstrap/src/download.ts +212 -0
  99. package/packages/omo-codex/plugin/components/bootstrap/src/environment.ts +286 -0
  100. package/packages/omo-codex/plugin/components/bootstrap/src/hook.ts +108 -0
  101. package/packages/omo-codex/plugin/components/bootstrap/src/provision.ts +243 -0
  102. package/packages/omo-codex/plugin/components/bootstrap/src/setup.ts +294 -0
  103. package/packages/omo-codex/plugin/components/bootstrap/src/worker.ts +279 -0
  104. package/packages/omo-codex/plugin/components/bootstrap/test/download.test.ts +295 -0
  105. package/packages/omo-codex/plugin/components/bootstrap/test/environment.test.ts +375 -0
  106. package/packages/omo-codex/plugin/components/bootstrap/test/provision.test.ts +464 -0
  107. package/packages/omo-codex/plugin/components/bootstrap/tsconfig.json +25 -0
  108. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  109. package/packages/omo-codex/plugin/components/comment-checker/package.json +4 -4
  110. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  111. package/packages/omo-codex/plugin/components/git-bash/package.json +2 -2
  112. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.js +6 -10
  113. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  114. package/packages/omo-codex/plugin/components/lsp/package.json +4 -4
  115. package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-tools.test.mjs +8 -3
  116. package/packages/omo-codex/plugin/components/lsp/src/codex-hook-cli.ts +5 -8
  117. package/packages/omo-codex/plugin/components/lsp/test/codex-hook-cli.test.ts +24 -1
  118. package/packages/omo-codex/plugin/components/rules/bundled-rules/windows-git-bash.md +3 -1
  119. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  120. package/packages/omo-codex/plugin/components/rules/package.json +4 -4
  121. package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +35 -1
  122. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  123. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +4 -4
  124. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  125. package/packages/omo-codex/plugin/components/telemetry/package.json +4 -4
  126. package/packages/omo-codex/plugin/components/ultrawork/biome.json +1 -1
  127. package/packages/omo-codex/plugin/components/ultrawork/directive.md +155 -99
  128. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  129. package/packages/omo-codex/plugin/components/ultrawork/package.json +4 -4
  130. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +19 -51
  131. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +46 -51
  132. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +19 -0
  133. package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +0 -1
  134. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +9 -1
  135. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +1 -0
  136. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +18 -0
  137. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +1 -3
  138. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +2 -2
  139. package/packages/omo-codex/plugin/components/ulw-loop/package.json +4 -4
  140. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +6 -2
  141. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-output.ts +19 -0
  142. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-crud.ts +1 -1
  143. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-commands.test.ts +6 -0
  144. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-complete-goals.test.ts +26 -1
  145. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-json-errors.test.ts +89 -0
  146. package/packages/omo-codex/plugin/hooks/hooks.json +27 -16
  147. package/packages/omo-codex/plugin/package-lock.json +193 -193
  148. package/packages/omo-codex/plugin/package.json +1 -1
  149. package/packages/omo-codex/plugin/scripts/auto-update-state.d.mts +20 -0
  150. package/packages/omo-codex/plugin/scripts/auto-update.mjs +28 -8
  151. package/packages/omo-codex/plugin/scripts/build-components.mjs +36 -5
  152. package/packages/omo-codex/plugin/scripts/install-flow.mjs +43 -0
  153. package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/SKILL.md +79 -28
  154. package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/agents/openai.yaml +2 -2
  155. package/packages/omo-codex/plugin/skills/lcx-report-bug/SKILL.md +7 -6
  156. package/packages/omo-codex/plugin/skills/lcx-report-bug/agents/openai.yaml +1 -1
  157. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +19 -51
  158. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +46 -51
  159. package/packages/omo-codex/plugin/test/aggregate-manifest.test.mjs +1 -0
  160. package/packages/omo-codex/plugin/test/auto-update.test.mjs +145 -0
  161. package/packages/omo-codex/plugin/test/bootstrap-binlinks.test.mjs +250 -0
  162. package/packages/omo-codex/plugin/test/bootstrap-hooks.test.mjs +166 -0
  163. package/packages/omo-codex/plugin/test/bootstrap-orchestration.test.mjs +371 -0
  164. package/packages/omo-codex/plugin/test/bootstrap-ps-guard.test.mjs +134 -0
  165. package/packages/omo-codex/plugin/test/bootstrap-setup.test.mjs +249 -0
  166. package/packages/omo-codex/plugin/test/lcx-bug-skills.test.mjs +10 -1
  167. package/packages/omo-codex/plugin/test/ulw-plan-skill.test.mjs +46 -0
  168. package/packages/omo-codex/scripts/atomic-write.test.mjs +82 -0
  169. package/packages/omo-codex/scripts/install/agents.d.mts +18 -0
  170. package/packages/omo-codex/scripts/install/agents.mjs +78 -5
  171. package/packages/omo-codex/scripts/install/atomic-write.mjs +59 -0
  172. package/packages/omo-codex/scripts/install/bin-dir.d.mts +7 -0
  173. package/packages/omo-codex/scripts/install/bin-links.d.mts +18 -0
  174. package/packages/omo-codex/scripts/install/config.d.mts +35 -0
  175. package/packages/omo-codex/scripts/install/config.mjs +13 -3
  176. package/packages/omo-codex/scripts/install/git-bash-mcp-env.d.mts +5 -0
  177. package/packages/omo-codex/scripts/install/git-bash.d.mts +23 -0
  178. package/packages/omo-codex/scripts/install/hook-trust.d.mts +10 -0
  179. package/packages/omo-codex/scripts/install-agent-links.test.mjs +41 -0
  180. package/packages/omo-codex/scripts/install-local.mjs +3 -2
  181. package/packages/shared-skills/skills/lcx-contribute-bug-fix/SKILL.md +79 -28
  182. package/packages/shared-skills/skills/lcx-contribute-bug-fix/agents/openai.yaml +2 -2
  183. package/packages/shared-skills/skills/lcx-report-bug/SKILL.md +7 -6
  184. package/packages/shared-skills/skills/lcx-report-bug/agents/openai.yaml +1 -1
  185. package/dist/hooks/session-recovery/constants.d.ts +0 -4
  186. package/dist/hooks/session-recovery/detect-error-type.d.ts +0 -4
  187. package/dist/hooks/session-recovery/error-recovery.d.ts +0 -4
  188. package/dist/hooks/session-recovery/hook-types.d.ts +0 -22
  189. package/dist/hooks/session-recovery/hook.d.ts +0 -4
  190. package/dist/hooks/session-recovery/index.d.ts +0 -5
  191. package/dist/hooks/session-recovery/interrupted-idle-message-fetch-timeout.d.ts +0 -7
  192. package/dist/hooks/session-recovery/interrupted-tool-results.d.ts +0 -3
  193. package/dist/hooks/session-recovery/message-state.d.ts +0 -4
  194. package/dist/hooks/session-recovery/recover-thinking-block-order.d.ts +0 -5
  195. package/dist/hooks/session-recovery/recover-thinking-disabled-violation.d.ts +0 -5
  196. package/dist/hooks/session-recovery/recover-tool-result-missing.d.ts +0 -10
  197. package/dist/hooks/session-recovery/recover-unavailable-tool.d.ts +0 -5
  198. package/dist/hooks/session-recovery/resume.d.ts +0 -7
  199. package/dist/hooks/session-recovery/storage/latest-assistant-message.d.ts +0 -5
  200. package/dist/hooks/session-recovery/storage/orphan-thinking-search.d.ts +0 -2
  201. package/dist/hooks/session-recovery/storage/thinking-block-search.d.ts +0 -2
  202. package/dist/hooks/session-recovery/storage/thinking-prepend.d.ts +0 -33
  203. package/dist/hooks/session-recovery/storage/thinking-strip.d.ts +0 -11
  204. package/dist/hooks/session-recovery/storage.d.ts +0 -20
  205. package/dist/plugin/event-session-recovery.d.ts +0 -9
  206. package/dist/plugin/user-abort-interrupted-recovery-guard.d.ts +0 -6
  207. /package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/empty-messages.d.ts +0 -0
  208. /package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/empty-text.d.ts +0 -0
  209. /package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/message-dir.d.ts +0 -0
  210. /package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/part-id.d.ts +0 -0
  211. /package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/text-part-injector.d.ts +0 -0
@@ -0,0 +1,35 @@
1
+ export interface CodexMarketplaceSource {
2
+ sourceType: string;
3
+ source: string;
4
+ ref?: string;
5
+ }
6
+
7
+ export interface CodexTrustedHookState {
8
+ key: string;
9
+ trustedHash: string;
10
+ }
11
+
12
+ export interface CodexAgentConfig {
13
+ name: string;
14
+ configFile: string;
15
+ }
16
+
17
+ export interface UpdateCodexConfigOptions {
18
+ configPath: string;
19
+ repoRoot?: string;
20
+ marketplaceName: string;
21
+ marketplaceSource?: CodexMarketplaceSource;
22
+ /**
23
+ * Leave any existing `[marketplaces.<name>]` block byte-identical and write
24
+ * nothing when it is absent. Used by the marketplace-flow bootstrap worker.
25
+ */
26
+ preserveMarketplaceSource?: boolean;
27
+ pluginNames: readonly string[];
28
+ platform?: string;
29
+ trustedHookStates?: readonly CodexTrustedHookState[];
30
+ agentConfigs?: readonly CodexAgentConfig[];
31
+ autonomousPermissions?: boolean;
32
+ gitBashEnabled?: boolean;
33
+ }
34
+
35
+ export declare function updateCodexConfig(options: UpdateCodexConfigOptions): Promise<void>;
@@ -1,6 +1,8 @@
1
- import { mkdir, readFile, writeFile } from "node:fs/promises";
1
+ import { mkdir, readFile } from "node:fs/promises";
2
2
  import { dirname } from "node:path";
3
3
 
4
+ import { writeFileAtomic } from "./atomic-write.mjs";
5
+
4
6
  import { ensureCodexMultiAgentV2Config } from "./multi-agent-v2-config.mjs";
5
7
  import { readCodexModelCatalog } from "./model-catalog.mjs";
6
8
  import { ensureCodexReasoningConfig } from "./reasoning-config.mjs";
@@ -24,6 +26,7 @@ export async function updateCodexConfig({
24
26
  repoRoot,
25
27
  marketplaceName,
26
28
  marketplaceSource = defaultMarketplaceSource(repoRoot),
29
+ preserveMarketplaceSource = false,
27
30
  pluginNames,
28
31
  platform = process.platform,
29
32
  trustedHookStates = [],
@@ -50,7 +53,14 @@ export async function updateCodexConfig({
50
53
  config = ensureCodexReasoningConfig(config, await readCodexModelCatalog(repoRoot));
51
54
  config = ensureCodexMultiAgentV2Config(config);
52
55
  if (autonomousPermissions === true) config = ensureAutonomousPermissions(config);
53
- config = ensureMarketplaceBlock(config, marketplaceName, marketplaceSource);
56
+ // Marketplace-flow bootstrap (preserveMarketplaceSource) must keep the
57
+ // Codex-managed [marketplaces.<name>] block byte-identical: rewriting it
58
+ // would replace the git source with a local one and bump last_updated on
59
+ // every worker run. When the block is absent we write nothing rather than
60
+ // invent a source.
61
+ if (preserveMarketplaceSource !== true) {
62
+ config = ensureMarketplaceBlock(config, marketplaceName, marketplaceSource);
63
+ }
54
64
  for (const pluginName of pluginNames) {
55
65
  config = ensurePluginEnabled(config, `${pluginName}@${marketplaceName}`);
56
66
  }
@@ -62,7 +72,7 @@ export async function updateCodexConfig({
62
72
  config = ensureAgentConfig(config, agentConfig);
63
73
  }
64
74
 
65
- await writeFile(configPath, config.trimEnd() + "\n");
75
+ await writeFileAtomic(configPath, config.trimEnd() + "\n");
66
76
  }
67
77
 
68
78
  function legacyMarketplaceNames(marketplaceName) {
@@ -0,0 +1,5 @@
1
+ export declare function stampGitBashMcpEnv(options: {
2
+ pluginRoot: string;
3
+ env?: Record<string, string | undefined>;
4
+ platform?: string;
5
+ }): Promise<boolean>;
@@ -0,0 +1,23 @@
1
+ export type GitBashResolution =
2
+ | { found: true; path: string | null; source: string; checkedPaths: string[] }
3
+ | { found: false; checkedPaths: string[]; installHint: string };
4
+
5
+ export declare function resolveGitBash(options: {
6
+ platform: string;
7
+ env: Record<string, string | undefined>;
8
+ exists: (path: string) => boolean;
9
+ where: (command: string) => string[];
10
+ }): GitBashResolution;
11
+
12
+ export declare function resolveGitBashForCurrentProcess(options?: {
13
+ platform?: string;
14
+ env?: Record<string, string | undefined>;
15
+ }): GitBashResolution;
16
+
17
+ export declare function prepareGitBashForInstall(options: {
18
+ platform: string;
19
+ env: Record<string, string | undefined>;
20
+ cwd: string;
21
+ runCommand: (command: string, args: readonly string[], options: { cwd: string }) => Promise<unknown>;
22
+ resolveGitBash?: () => GitBashResolution;
23
+ }): Promise<GitBashResolution>;
@@ -0,0 +1,10 @@
1
+ export interface TrustedHookState {
2
+ key: string;
3
+ trustedHash: string;
4
+ }
5
+
6
+ export declare function trustedHookStatesForPlugin(options: {
7
+ marketplaceName: string;
8
+ pluginName: string;
9
+ pluginRoot: string;
10
+ }): Promise<TrustedHookState[]>;
@@ -252,6 +252,47 @@ test(
252
252
  },
253
253
  );
254
254
 
255
+ test(
256
+ "#given user removed installed ultrawork service tier #when reinstalling after snapshot refresh #then removal survives",
257
+ async () => {
258
+ const repoRoot = await makeTempDir();
259
+ const codexHome = await makeTempDir();
260
+ const codexPackageRoot = join(repoRoot, "packages", "omo-codex");
261
+ const pluginRoot = join(codexPackageRoot, "plugin");
262
+ const agentsRoot = join(pluginRoot, "components", "ultrawork", "agents");
263
+
264
+ await writeJson(join(codexPackageRoot, "marketplace.json"), {
265
+ name: "sisyphuslabs",
266
+ plugins: [{ name: "omo", source: "./plugins/omo" }],
267
+ });
268
+ await writePluginAt(pluginRoot, "omo", "0.1.0");
269
+ await mkdir(agentsRoot, { recursive: true });
270
+ await writeFile(
271
+ join(agentsRoot, "explorer.toml"),
272
+ 'name = "explorer"\nmodel = "gpt-5.5"\nmodel_reasoning_effort = "low"\nservice_tier = "fast"\n',
273
+ );
274
+
275
+ await installMarketplaceLocally({
276
+ repoRoot,
277
+ codexHome,
278
+ platform: "linux",
279
+ runCommand: async () => {},
280
+ log: () => {},
281
+ });
282
+ await writeFile(join(codexHome, "agents", "explorer.toml"), 'name = "explorer"\nmodel = "gpt-5.5"\nmodel_reasoning_effort = "low"\n');
283
+ await installMarketplaceLocally({
284
+ repoRoot,
285
+ codexHome,
286
+ platform: "linux",
287
+ runCommand: async () => {},
288
+ log: () => {},
289
+ });
290
+
291
+ const installedExplorer = await readFile(join(codexHome, "agents", "explorer.toml"), "utf8");
292
+ assert.equal(installedExplorer.includes("service_tier"), false);
293
+ },
294
+ );
295
+
255
296
  test(
256
297
  "#given user edited installed ultrawork plan #when reinstalling after snapshot refresh #then bundled snapshot target retains xhigh",
257
298
  async () => {
@@ -13,7 +13,7 @@ import {
13
13
  pruneMarketplacePluginCaches,
14
14
  } from "./install/cache.mjs";
15
15
  import { agentSourceRootsForInstall } from "./install/agent-source-roots.mjs";
16
- import { capturePreservedAgentReasoning, linkCachedPluginAgents } from "./install/agents.mjs";
16
+ import { capturePreservedAgentReasoning, capturePreservedAgentServiceTier, linkCachedPluginAgents } from "./install/agents.mjs";
17
17
  import { writeCachedMarketplaceManifest } from "./install/cached-marketplace-manifest.mjs";
18
18
  import { updateCodexConfig } from "./install/config.mjs";
19
19
  import {
@@ -116,10 +116,11 @@ export async function installMarketplaceLocally(options = {}) {
116
116
  }
117
117
 
118
118
  const preservedReasoning = await capturePreservedAgentReasoning({ codexHome });
119
+ const preservedServiceTier = await capturePreservedAgentServiceTier({ codexHome });
119
120
  const agentSourceRoots = await agentSourceRootsForInstall({ codexHome, marketplace, installed, pluginSources });
120
121
  for (const plugin of installed) {
121
122
  const pluginRoot = agentSourceRoots.get(plugin.name) ?? plugin.path;
122
- const agentLinks = await linkCachedPluginAgents({ codexHome, pluginRoot, platform, preservedReasoning });
123
+ const agentLinks = await linkCachedPluginAgents({ codexHome, pluginRoot, platform, preservedReasoning, preservedServiceTier });
123
124
  for (const link of agentLinks) {
124
125
  log(`Linked agent ${link.name} -> ${link.target}`);
125
126
  const agentName = agentNameFromToml(link.name);
@@ -1,22 +1,22 @@
1
1
  ---
2
2
  name: lcx-contribute-bug-fix
3
- description: "Contribute a verified bug-fix PR for LazyCodex, lazycodex-ai, omo-codex, bundled Codex skills, or upstream Codex CLI bugs. Use when the user asks to fix a bug, contribute a bug fix, contribute to fix bug, open a PR for a bug, or debug and PR a LazyCodex/Codex defect."
3
+ description: "Contribute a verified bug fix for LazyCodex, lazycodex-ai, omo-codex, bundled Codex skills, or upstream Codex CLI bugs. Opens a fork PR only for upstream openai/codex; LazyCodex-owned defects become a verified-fix issue on code-yeongyu/lazycodex (never a PR — that repo is a generated distribution mirror). Use when the user asks to fix a bug, contribute a bug fix, contribute to fix bug, open a PR for a bug, or debug and PR a LazyCodex/Codex defect."
4
4
  metadata:
5
- short-description: Contribute verified LazyCodex or Codex bug-fix PRs
5
+ short-description: Contribute verified LazyCodex or Codex bug fixes
6
6
  ---
7
7
 
8
8
  # lcx-contribute-bug-fix
9
9
 
10
- Use this skill to debug a concrete LazyCodex or Codex defect, implement the smallest correct fix in a fresh temporary workspace, and open a GitHub PR. Work in English, keep the PR body short, and support every claim with runtime or source evidence.
10
+ Use this skill to debug a concrete LazyCodex or Codex defect, implement the smallest correct fix in a fresh temporary workspace, and deliver it. Work in English, keep the body short, and support every claim with runtime or source evidence.
11
11
 
12
- Route ownership the same way as `$lcx-report-bug`:
12
+ Route ownership the same way as `$lcx-report-bug`, but the deliverable differs by target:
13
13
 
14
- - `code-yeongyu/lazycodex` for LazyCodex, lazycodex-ai, omo-codex, bundled skills, hooks, MCP wiring, installer behavior, marketplace sync, docs, or packaging.
15
- - `openai/codex` for upstream Codex CLI bugs that reproduce without LazyCodex or come from Codex core behavior.
14
+ - `code-yeongyu/lazycodex` for LazyCodex, lazycodex-ai, omo-codex, bundled skills, hooks, MCP wiring, installer behavior, marketplace sync, docs, or packaging. Deliverable: a verified-fix issue with the patch embedded. NEVER open a PR or push a branch against this repo — its contents are regenerated from the source tree on every release, so PRs there cannot be merged and will be closed.
15
+ - `openai/codex` for upstream Codex CLI bugs that reproduce without LazyCodex or come from Codex core behavior. Deliverable: a PR from a fork.
16
16
 
17
17
  ## Required Outcome
18
18
 
19
- Create a PR that includes:
19
+ For `openai/codex`, create a fork PR that includes:
20
20
 
21
21
  - a focused branch from a fresh `/tmp` clone/worktree
22
22
  - reproduction logs from before the fix
@@ -26,6 +26,15 @@ Create a PR that includes:
26
26
  - the required LazyCodex footer tag `Tag: lazycodex-generated`
27
27
  - cleanup of temporary worktrees and clones
28
28
 
29
+ For `code-yeongyu/lazycodex`, create an issue (never a PR) that includes:
30
+
31
+ - reproduction logs from before the fix
32
+ - the root cause with source evidence
33
+ - the verified patch as a unified diff, produced and tested in a fresh `/tmp` clone/worktree
34
+ - verification logs from after the fix
35
+ - the `lazycodex-generated` label and the footer tag `Tag: lazycodex-generated`
36
+ - cleanup of temporary worktrees and clones
37
+
29
38
  ## Required Workflow
30
39
 
31
40
  1. Read the user's bug report and identify the affected surface.
@@ -66,7 +75,7 @@ If `gh` cannot clone, use `git clone --depth=1 "https://github.com/$TARGET_REPO"
66
75
  6. Write or update a failing regression test before production changes. Confirm it fails for the bug, not for a missing fixture or typo.
67
76
  7. Implement the smallest correct fix. Avoid refactors unless the fix cannot be made safely without one.
68
77
  8. Run the regression test, adjacent tests, and the smallest real-surface QA command that proves the user-visible behavior changed.
69
- 9. Commit the verified fix before pushing. Inspect the status first so the PR cannot be empty or stale:
78
+ 9. Commit the verified fix in the worktree. Inspect the status first so the delivered diff cannot be empty or stale:
70
79
 
71
80
  ```bash
72
81
  git status --short
@@ -75,7 +84,15 @@ git commit -m "fix: <short bug-fix summary>"
75
84
  git log --oneline "origin/$BASE_BRANCH..HEAD"
76
85
  ```
77
86
 
78
- 10. Generate the PR body with `scripts/create-pr-body.mjs`.
87
+ 10. Build the delivery body for the target:
88
+ - `openai/codex`: generate the PR body with `scripts/create-pr-body.mjs`.
89
+ - `code-yeongyu/lazycodex`: export the verified patch and write the issue body from the Verified-Fix Issue Template below:
90
+
91
+ ```bash
92
+ PATCH_FILE="/tmp/lazycodex-fix-<short-slug>.patch"
93
+ git diff "origin/$BASE_BRANCH"..HEAD > "$PATCH_FILE"
94
+ ```
95
+
79
96
  11. Ensure the generated label exists when the target repo allows label management. Keep the footer tag even when label creation is unavailable:
80
97
 
81
98
  ```bash
@@ -87,20 +104,21 @@ else
87
104
  fi
88
105
  ```
89
106
 
90
- 12. Push to a writable remote, then create the PR. For upstream `openai/codex`, fork first and use the fork as the head repository:
107
+ 12. Deliver the fix.
108
+ - `code-yeongyu/lazycodex`: create the verified-fix issue. Never push a branch to this repo and never run `gh pr create` against it:
91
109
 
92
110
  ```bash
93
- PUSH_REMOTE="origin"
94
- PR_HEAD="$BRANCH_NAME"
95
- if [ "$TARGET_REPO" = "openai/codex" ]; then
96
- gh repo fork "$TARGET_REPO" --remote --remote-name fork
97
- PUSH_REMOTE="fork"
98
- GH_USER="$(gh api user --jq .login)"
99
- PR_HEAD="$GH_USER:$BRANCH_NAME"
100
- fi
111
+ ISSUE_BODY="/tmp/lazycodex-fix-<short-slug>-issue.md"
112
+ gh issue create --repo code-yeongyu/lazycodex --title "<short fix title>" "${LABEL_ARGS[@]}" --body-file "$ISSUE_BODY"
113
+ ```
101
114
 
102
- git push -u "$PUSH_REMOTE" "$BRANCH_NAME"
103
- gh pr create --repo "$TARGET_REPO" --base "$BASE_BRANCH" --head "$PR_HEAD" --title "<short fix title>" "${LABEL_ARGS[@]}" --body-file "$PR_BODY"
115
+ - `openai/codex`: fork, push the branch to the fork, and create the PR:
116
+
117
+ ```bash
118
+ gh repo fork openai/codex --remote --remote-name fork
119
+ GH_USER="$(gh api user --jq .login)"
120
+ git push -u fork "$BRANCH_NAME"
121
+ gh pr create --repo openai/codex --base "$BASE_BRANCH" --head "$GH_USER:$BRANCH_NAME" --title "<short fix title>" "${LABEL_ARGS[@]}" --body-file "$PR_BODY"
104
122
  ```
105
123
 
106
124
  13. Clean up:
@@ -112,16 +130,47 @@ find "$WORK_ROOT" -mindepth 1 -maxdepth 1 -exec rm -r -- {} +
112
130
  rmdir "$WORK_ROOT"
113
131
  ```
114
132
 
115
- Return the PR URL, the reproduction command, the verification command, and the cleanup receipt.
133
+ Return the PR or issue URL, the reproduction command, the verification command, and the cleanup receipt.
134
+
135
+ ## Verified-Fix Issue Template (code-yeongyu/lazycodex)
136
+
137
+ Write the issue body in English. Embed the patch verbatim so a maintainer can apply it to the source tree:
138
+
139
+ ````markdown
140
+ ## Problem Situation
141
+ [What failed for the user.]
142
+
143
+ ## Reproduction Logs
144
+ [Exact failing command and relevant log excerpt.]
145
+
146
+ ## Root Cause
147
+ [Confirmed cause with runtime and source evidence.]
148
+
149
+ ## Verified Fix
150
+ [What changed and why this is the smallest correct fix.]
151
+
152
+ ```diff
153
+ [Contents of $PATCH_FILE.]
154
+ ```
155
+
156
+ ## Verification
157
+ - [RED test output or repro before the fix]
158
+ - [GREEN test output after the fix]
159
+ - [Manual QA command and result]
160
+
161
+ ---
162
+ This fix was debugged, implemented, and verified with [LazyCodex](https://github.com/code-yeongyu/lazycodex).
163
+ Tag: lazycodex-generated
164
+ ````
116
165
 
117
- ## PR Body Generator
166
+ ## PR Body Generator (openai/codex)
118
167
 
119
168
  Use the bundled script to generate the PR body. Create a JSON file with this shape:
120
169
 
121
170
  ```json
122
171
  {
123
172
  "title": "Fix short user-visible failure",
124
- "targetRepository": "code-yeongyu/lazycodex",
173
+ "targetRepository": "openai/codex",
125
174
  "problem": "What is broken for the user.",
126
175
  "reproductionLogs": "Exact failing command, log excerpt, or trace.",
127
176
  "approach": "What changed and why this is the smallest correct fix.",
@@ -140,7 +189,7 @@ PR_BODY="/tmp/lazycodex-fix-<short-slug>-pr.md"
140
189
  node "<skill-root>/scripts/create-pr-body.mjs" "$PR_INPUT" "$PR_BODY"
141
190
  ```
142
191
 
143
- ## PR Body Template
192
+ ## PR Body Template (openai/codex)
144
193
 
145
194
  The generated body must follow this structure:
146
195
 
@@ -179,13 +228,15 @@ Stop and ask one narrow question only when:
179
228
 
180
229
  - the bug cannot be reproduced from available information
181
230
  - target repository ownership remains ambiguous after comparing LazyCodex and upstream Codex evidence
182
- - authentication is missing for pushing or creating the PR
231
+ - authentication is missing for creating the issue or pushing and creating the PR
183
232
  - the fix requires a product decision rather than a technical correction
184
233
 
185
234
  Do not open:
186
235
 
187
- - a PR without a failing-before and passing-after test
188
- - a PR without a real-surface QA command
189
- - a PR without the `Tag: lazycodex-generated` footer
236
+ - a PR or pushed branch targeting `code-yeongyu/lazycodex` deliver the verified-fix issue instead, always
237
+ - a PR or verified-fix issue without a failing-before and passing-after test
238
+ - a PR or verified-fix issue without a real-surface QA command
239
+ - a PR or issue without the `Tag: lazycodex-generated` footer
240
+ - a verified-fix issue without the patch embedded in a `diff` block
190
241
  - a vague fix that does not identify the root cause
191
242
  - a broad refactor disguised as a bug fix
@@ -1,6 +1,6 @@
1
1
  interface:
2
2
  display_name: "lcx-contribute-bug-fix (omo)"
3
- short_description: "Contribute verified LazyCodex or Codex bug-fix PRs"
3
+ short_description: "Contribute verified LazyCodex or Codex bug fixes"
4
4
  search_terms:
5
5
  - "lcx-contribute-bug-fix"
6
6
  - "contribute a bug fix"
@@ -9,4 +9,4 @@ interface:
9
9
  - "lazycodex fix"
10
10
  - "omo-codex bug fix"
11
11
  - "codex bug fix pr"
12
- default_prompt: "Use $lcx-contribute-bug-fix to debug this LazyCodex or Codex bug, work from a fresh /tmp clone and worktree, implement the smallest verified fix, generate the PR body, apply the lazycodex-generated label, open the PR, and clean up."
12
+ default_prompt: "Use $lcx-contribute-bug-fix to debug this LazyCodex or Codex bug, work from a fresh /tmp clone and worktree, implement the smallest verified fix, apply the lazycodex-generated label, deliver it (verified-fix issue on code-yeongyu/lazycodex — never a PR there; fork PR only for openai/codex), and clean up."
@@ -9,8 +9,8 @@ metadata:
9
9
 
10
10
  You are a LazyCodex bug router and reporter. Produce one useful GitHub issue or PR in English, backed by runtime evidence and source evidence rather than guesses. Route it to the repository that owns the defect:
11
11
 
12
- - `code-yeongyu/lazycodex` for LazyCodex, lazycodex-ai, omo-codex, marketplace, bundled skill, hook, MCP, installer, or packaging bugs.
13
- - `openai/codex` for upstream Codex CLI bugs that reproduce without LazyCodex or are caused by Codex core behavior.
12
+ - `code-yeongyu/lazycodex` for LazyCodex, lazycodex-ai, omo-codex, marketplace, bundled skill, hook, MCP, installer, or packaging bugs. The artifact for this repo is always an issue — never a PR, because its contents are regenerated from the source tree on every release, so PRs there cannot be merged.
13
+ - `openai/codex` for upstream Codex CLI bugs that reproduce without LazyCodex or are caused by Codex core behavior. This is the only repo where this skill may create a PR.
14
14
 
15
15
  Use GPT-5.5 style: outcome first, concise, evidence-bound. Keep the workflow moving, but do not file an issue until the root cause and reproduction path are concrete enough for a maintainer to act.
16
16
 
@@ -80,7 +80,7 @@ fi
80
80
 
81
81
  If the selected repo is `openai/codex` and label management is not available, still include the footer tag in the body and continue without claiming label creation succeeded.
82
82
  10. If no matching issue exists, create the issue with `gh` and apply the `lazycodex-generated` label.
83
- 11. Create a PR only when the user asked for a PR, the fix is already implemented on a branch, or the smallest correct fix can be safely made in the selected repo. Apply the `lazycodex-generated` label to every PR created by this skill. Otherwise create an issue with fix guidance.
83
+ 11. Create a PR only when the target repo is `openai/codex` AND the user asked for a PR, the fix is already implemented on a branch, or the smallest correct fix can be safely made there. Never create a PR or push a branch against `code-yeongyu/lazycodex` — always file an issue there, embedding the verified patch in the Proposed Fix section when one exists. Apply the `lazycodex-generated` label to every PR created by this skill. Otherwise create an issue with fix guidance.
84
84
 
85
85
  ## Required Label And Footer
86
86
 
@@ -145,7 +145,7 @@ Tag: lazycodex-generated
145
145
 
146
146
  ## PR Body Template
147
147
 
148
- Use this when a PR is the right artifact:
148
+ Use this only when a PR is the right artifact, which is only ever for `openai/codex`:
149
149
 
150
150
  ```markdown
151
151
  ## Summary
@@ -195,11 +195,11 @@ if [ "${#LABEL_ARGS[@]}" -gt 0 ]; then
195
195
  fi
196
196
  ```
197
197
 
198
- For a PR from a branch pushed to the selected repo or fork:
198
+ For a PR from a branch pushed to a fork `openai/codex` only, never `code-yeongyu/lazycodex`:
199
199
 
200
200
  ```bash
201
201
  PR_BODY="/tmp/lcx-report-bug-pr-$(date +%Y%m%d-%H%M%S).md"
202
- gh pr create --repo "$TARGET_REPO" --title "<clear title>" "${LABEL_ARGS[@]}" --body-file "$PR_BODY"
202
+ gh pr create --repo openai/codex --title "<clear title>" "${LABEL_ARGS[@]}" --body-file "$PR_BODY"
203
203
  ```
204
204
 
205
205
  After creating or commenting, return the issue or PR URL and a short summary of the evidence used.
@@ -228,6 +228,7 @@ Stop and ask one narrow question only when the missing fact changes the issue ma
228
228
 
229
229
  Do not file:
230
230
 
231
+ - a PR or pushed branch targeting `code-yeongyu/lazycodex` — file the issue instead, always
231
232
  - a vague issue without reproduction steps
232
233
  - an issue that claims a root cause not supported by runtime evidence
233
234
  - a duplicate when commenting on an existing issue is enough
@@ -8,4 +8,4 @@ interface:
8
8
  - "omo-codex bug"
9
9
  - "openai codex bug"
10
10
  - "codex upstream issue"
11
- default_prompt: "Use $lcx-report-bug to investigate this LazyCodex or Codex bug, compare LazyCodex evidence with /tmp openai/codex source, choose the correct GitHub repo, and file an issue or PR with reproduction, root cause, fix guidance, and the lazycodex-generated label and footer."
11
+ default_prompt: "Use $lcx-report-bug to investigate this LazyCodex or Codex bug, compare LazyCodex evidence with /tmp openai/codex source, choose the correct GitHub repo, and file an issue (or, for openai/codex only, a PR — never a PR on code-yeongyu/lazycodex) with reproduction, root cause, fix guidance, and the lazycodex-generated label and footer."
@@ -1,4 +0,0 @@
1
- export { OPENCODE_STORAGE, MESSAGE_STORAGE, PART_STORAGE } from "../../shared";
2
- export declare const THINKING_TYPES: Set<string>;
3
- export declare const META_TYPES: Set<string>;
4
- export declare const CONTENT_TYPES: Set<string>;
@@ -1,4 +0,0 @@
1
- export type RecoveryErrorType = "tool_result_missing" | "thinking_block_order" | "thinking_disabled_violation" | "thinking_block_modified" | "assistant_prefill_unsupported" | "unavailable_tool" | null;
2
- export declare function extractMessageIndex(error: unknown): number | null;
3
- export declare function extractUnavailableToolName(error: unknown): string | null;
4
- export declare function detectErrorType(error: unknown): RecoveryErrorType;
@@ -1,4 +0,0 @@
1
- import type { PluginInput } from "@opencode-ai/plugin";
2
- import type { ExperimentalConfig } from "../../config";
3
- import type { MessageInfo, SessionRecoveryCallbacks } from "./hook-types";
4
- export declare function createSessionErrorRecoveryHandler(ctx: PluginInput, callbacks: SessionRecoveryCallbacks, experimental?: ExperimentalConfig): (info: MessageInfo) => Promise<boolean>;
@@ -1,22 +0,0 @@
1
- import type { ExperimentalConfig } from "../../config";
2
- export interface MessageInfo {
3
- id?: string;
4
- role?: string;
5
- sessionID?: string;
6
- parentID?: string;
7
- error?: unknown;
8
- }
9
- export interface SessionRecoveryOptions {
10
- experimental?: ExperimentalConfig;
11
- }
12
- export interface SessionRecoveryHook {
13
- handleSessionRecovery: (info: MessageInfo) => Promise<boolean>;
14
- handleInterruptedToolResultsOnIdle: (sessionID: string) => Promise<boolean>;
15
- isRecoverableError: (error: unknown) => boolean;
16
- setOnAbortCallback: (callback: (sessionID: string) => void) => void;
17
- setOnRecoveryCompleteCallback: (callback: (sessionID: string) => void) => void;
18
- }
19
- export interface SessionRecoveryCallbacks {
20
- onAbortCallback: ((sessionID: string) => void) | null;
21
- onRecoveryCompleteCallback: ((sessionID: string) => void) | null;
22
- }
@@ -1,4 +0,0 @@
1
- import type { PluginInput } from "@opencode-ai/plugin";
2
- import type { SessionRecoveryHook, SessionRecoveryOptions } from "./hook-types";
3
- export type { MessageInfo, SessionRecoveryHook, SessionRecoveryOptions } from "./hook-types";
4
- export declare function createSessionRecoveryHook(ctx: PluginInput, options?: SessionRecoveryOptions): SessionRecoveryHook;
@@ -1,5 +0,0 @@
1
- export { createSessionRecoveryHook } from "./hook";
2
- export type { SessionRecoveryHook, SessionRecoveryOptions } from "./hook";
3
- export { detectErrorType } from "./detect-error-type";
4
- export type { RecoveryErrorType } from "./detect-error-type";
5
- export type { MessageData, ResumeConfig } from "./types";
@@ -1,7 +0,0 @@
1
- export declare const DEFAULT_INTERRUPTED_IDLE_MESSAGES_FETCH_TIMEOUT_MS = 5000;
2
- export declare function _setInterruptedIdleMessagesFetchTimeoutMsForTesting(value: number | undefined): void;
3
- export declare function getInterruptedIdleMessagesFetchTimeoutMs(): number;
4
- export declare class InterruptedIdleMessagesFetchTimeoutError extends Error {
5
- constructor(timeoutMs: number);
6
- }
7
- export declare function withInterruptedIdleMessagesFetchTimeout<T>(operation: Promise<T>, timeoutMs: number): Promise<T>;
@@ -1,3 +0,0 @@
1
- import type { PluginInput } from "@opencode-ai/plugin";
2
- import type { SessionRecoveryCallbacks } from "./hook-types";
3
- export declare function createInterruptedToolResultsHandler(ctx: PluginInput, callbacks: SessionRecoveryCallbacks): (sessionID: string) => Promise<boolean>;
@@ -1,4 +0,0 @@
1
- import type { MessageData } from "./types";
2
- export declare function assistantMessageIsFinished(message: MessageData): boolean;
3
- export declare function messageHasInterruptedToolResults(message: MessageData): boolean;
4
- export declare function findLatestAssistantMessage(messages: MessageData[]): MessageData | undefined;
@@ -1,5 +0,0 @@
1
- import type { createOpencodeClient } from "@opencode-ai/sdk";
2
- import type { MessageData } from "./types";
3
- type Client = ReturnType<typeof createOpencodeClient>;
4
- export declare function recoverThinkingBlockOrder(client: Client, sessionID: string, _failedAssistantMsg: MessageData, _directory: string, error: unknown): Promise<boolean>;
5
- export {};
@@ -1,5 +0,0 @@
1
- import type { createOpencodeClient } from "@opencode-ai/sdk";
2
- import type { MessageData } from "./types";
3
- type Client = ReturnType<typeof createOpencodeClient>;
4
- export declare function recoverThinkingDisabledViolation(client: Client, sessionID: string, _failedAssistantMsg: MessageData): Promise<boolean>;
5
- export {};
@@ -1,10 +0,0 @@
1
- import type { createOpencodeClient } from "@opencode-ai/sdk";
2
- import type { MessageData, ResumeConfig } from "./types";
3
- type Client = ReturnType<typeof createOpencodeClient>;
4
- export type RecoverToolResultMissingOptions = {
5
- recoverStatuses?: ReadonlySet<string>;
6
- resultText?: string;
7
- source?: string;
8
- };
9
- export declare function recoverToolResultMissing(client: Client, sessionID: string, failedAssistantMsg: MessageData, resumeConfig?: ResumeConfig, options?: RecoverToolResultMissingOptions): Promise<boolean>;
10
- export {};
@@ -1,5 +0,0 @@
1
- import type { createOpencodeClient } from "@opencode-ai/sdk";
2
- import type { MessageData } from "./types";
3
- type Client = ReturnType<typeof createOpencodeClient>;
4
- export declare function recoverUnavailableTool(client: Client, sessionID: string, failedAssistantMsg: MessageData): Promise<boolean>;
5
- export {};
@@ -1,7 +0,0 @@
1
- import type { createOpencodeClient } from "@opencode-ai/sdk";
2
- import type { MessageData, ResumeConfig } from "./types";
3
- type Client = ReturnType<typeof createOpencodeClient>;
4
- export declare function findLastUserMessage(messages: MessageData[]): MessageData | undefined;
5
- export declare function extractResumeConfig(userMessage: MessageData | undefined, sessionID: string): ResumeConfig;
6
- export declare function resumeSession(client: Client, config: ResumeConfig): Promise<boolean>;
7
- export {};
@@ -1,5 +0,0 @@
1
- import type { PluginInput } from "@opencode-ai/plugin";
2
- type OpencodeClient = PluginInput["client"];
3
- export declare function isLatestAssistantMessage(sessionID: string, messageID: string): boolean;
4
- export declare function isLatestAssistantMessageFromSDK(client: OpencodeClient, sessionID: string, messageID: string): Promise<boolean>;
5
- export {};
@@ -1,2 +0,0 @@
1
- export declare function findMessagesWithOrphanThinking(sessionID: string): string[];
2
- export declare function findMessageByIndexNeedingThinking(sessionID: string, targetIndex: number): string | null;
@@ -1,2 +0,0 @@
1
- export declare function findMessagesWithThinkingBlocks(sessionID: string): string[];
2
- export declare function findMessagesWithThinkingOnly(sessionID: string): string[];
@@ -1,33 +0,0 @@
1
- import type { PluginInput } from "@opencode-ai/plugin";
2
- import type { MessageData, StoredPart } from "../types";
3
- import { log, isSqliteBackend, patchPart } from "../../../shared";
4
- import { isLatestAssistantMessage, isLatestAssistantMessageFromSDK } from "./latest-assistant-message";
5
- type OpencodeClient = PluginInput["client"];
6
- type StoredSignedThinkingPart = StoredPart & {
7
- type: "thinking" | "redacted_thinking";
8
- signature: string;
9
- };
10
- type SDKMessagePart = NonNullable<MessageData["parts"]>[number];
11
- type SDKSignedThinkingPart = SDKMessagePart & {
12
- id: string;
13
- type: "thinking" | "redacted_thinking";
14
- signature: string;
15
- };
16
- type ThinkingPrependDeps = {
17
- isSqliteBackend: typeof isSqliteBackend;
18
- patchPart: typeof patchPart;
19
- log: typeof log;
20
- findLastThinkingPart: typeof findLastThinkingPart;
21
- findLastThinkingPartFromSDK: typeof findLastThinkingPartFromSDK;
22
- readTargetPartIDs: typeof readTargetPartIDs;
23
- readTargetPartIDsFromSDK: typeof readTargetPartIDsFromSDK;
24
- isLatestAssistantMessage?: typeof isLatestAssistantMessage;
25
- isLatestAssistantMessageFromSDK?: typeof isLatestAssistantMessageFromSDK;
26
- };
27
- declare function readTargetPartIDs(messageID: string): string[];
28
- declare function readTargetPartIDsFromSDK(client: OpencodeClient, sessionID: string, messageID: string): Promise<string[]>;
29
- declare function findLastThinkingPart(sessionID: string, beforeMessageID: string): StoredSignedThinkingPart | null;
30
- export declare function prependThinkingPart(sessionID: string, messageID: string, deps?: ThinkingPrependDeps): boolean;
31
- declare function findLastThinkingPartFromSDK(client: OpencodeClient, sessionID: string, beforeMessageID: string): Promise<SDKSignedThinkingPart | null>;
32
- export declare function prependThinkingPartAsync(client: OpencodeClient, sessionID: string, messageID: string, deps?: ThinkingPrependDeps): Promise<boolean>;
33
- export {};
@@ -1,11 +0,0 @@
1
- import type { PluginInput } from "@opencode-ai/plugin";
2
- import { log, isSqliteBackend } from "../../../shared";
3
- type OpencodeClient = PluginInput["client"];
4
- type StripThinkingPartsDeps = {
5
- readonly isSqliteBackend: typeof isSqliteBackend;
6
- readonly log: typeof log;
7
- readonly partStorage: string;
8
- };
9
- export declare function stripThinkingParts(messageID: string, deps?: StripThinkingPartsDeps): boolean;
10
- export declare function stripThinkingPartsAsync(client: OpencodeClient, sessionID: string, messageID: string): Promise<boolean>;
11
- export {};