oh-my-opencode 3.11.2 → 3.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/README.ja.md +18 -12
  2. package/README.ko.md +18 -12
  3. package/README.md +16 -16
  4. package/README.ru.md +12 -6
  5. package/README.zh-cn.md +18 -12
  6. package/dist/agents/atlas/default.d.ts +1 -1
  7. package/dist/agents/atlas/gemini.d.ts +1 -1
  8. package/dist/agents/atlas/gpt.d.ts +1 -1
  9. package/dist/agents/builtin-agents/general-agents.d.ts +1 -0
  10. package/dist/agents/dynamic-agent-prompt-builder.d.ts +2 -0
  11. package/dist/agents/env-context.d.ts +1 -1
  12. package/dist/agents/index.d.ts +1 -0
  13. package/dist/agents/metis.d.ts +1 -1
  14. package/dist/agents/prometheus/gemini.d.ts +1 -1
  15. package/dist/agents/prometheus/gpt.d.ts +1 -1
  16. package/dist/agents/prometheus/interview-mode.d.ts +1 -1
  17. package/dist/agents/prometheus/plan-generation.d.ts +1 -1
  18. package/dist/agents/prometheus/plan-template.d.ts +1 -1
  19. package/dist/agents/prometheus/system-prompt.d.ts +1 -1
  20. package/dist/agents/types.d.ts +1 -1
  21. package/dist/cli/config-manager/bun-install.d.ts +8 -1
  22. package/dist/cli/config-manager/plugin-name-with-version.d.ts +1 -1
  23. package/dist/cli/doctor/checks/tools-lsp.d.ts +4 -6
  24. package/dist/cli/doctor/types.d.ts +4 -8
  25. package/dist/cli/index.js +1087 -802
  26. package/dist/cli/install-validators.d.ts +1 -0
  27. package/dist/cli/model-fallback-requirements.d.ts +1 -1
  28. package/dist/cli/model-fallback-types.d.ts +1 -0
  29. package/dist/cli/openai-only-model-catalog.d.ts +3 -0
  30. package/dist/cli/run/index.d.ts +1 -0
  31. package/dist/cli/run/model-resolver.d.ts +4 -0
  32. package/dist/cli/run/types.d.ts +1 -0
  33. package/dist/cli/types.d.ts +3 -0
  34. package/dist/config/schema/agent-names.d.ts +3 -1
  35. package/dist/config/schema/background-task.d.ts +9 -0
  36. package/dist/config/schema/git-env-prefix.d.ts +5 -0
  37. package/dist/config/schema/git-master.d.ts +1 -0
  38. package/dist/config/schema/hooks.d.ts +2 -0
  39. package/dist/config/schema/oh-my-opencode-config.d.ts +10 -0
  40. package/dist/config/schema.d.ts +1 -0
  41. package/dist/create-hooks.d.ts +13 -0
  42. package/dist/features/background-agent/compaction-aware-message-resolver.d.ts +16 -1
  43. package/dist/features/background-agent/constants.d.ts +7 -2
  44. package/dist/features/background-agent/loop-detector.d.ts +19 -0
  45. package/dist/features/background-agent/manager.d.ts +20 -4
  46. package/dist/features/background-agent/process-cleanup.d.ts +1 -1
  47. package/dist/features/background-agent/remove-task-toast-tracking.d.ts +1 -0
  48. package/dist/features/background-agent/subagent-spawn-limits.d.ts +23 -0
  49. package/dist/features/background-agent/task-history.d.ts +1 -0
  50. package/dist/features/background-agent/task-poller.d.ts +1 -0
  51. package/dist/features/background-agent/types.d.ts +11 -0
  52. package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
  53. package/dist/features/claude-code-agent-loader/claude-model-mapper.d.ts +4 -0
  54. package/dist/features/claude-code-agent-loader/loader.d.ts +3 -3
  55. package/dist/features/claude-code-agent-loader/types.d.ts +8 -1
  56. package/dist/features/claude-code-plugin-loader/agent-loader.d.ts +2 -2
  57. package/dist/features/claude-code-plugin-loader/loader.d.ts +2 -2
  58. package/dist/features/claude-code-plugin-loader/types.d.ts +22 -3
  59. package/dist/features/opencode-skill-loader/git-master-template-injection.d.ts +1 -1
  60. package/dist/features/skill-mcp-manager/types.d.ts +4 -0
  61. package/dist/features/tmux-subagent/index.d.ts +1 -0
  62. package/dist/features/tmux-subagent/manager.d.ts +5 -0
  63. package/dist/features/tmux-subagent/pane-state-parser.d.ts +8 -0
  64. package/dist/features/tmux-subagent/tracked-session-state.d.ts +8 -0
  65. package/dist/features/tmux-subagent/types.d.ts +2 -0
  66. package/dist/hooks/atlas/boulder-session-lineage.d.ts +6 -0
  67. package/dist/hooks/atlas/final-wave-approval-gate.d.ts +6 -0
  68. package/dist/hooks/atlas/final-wave-plan-state.d.ts +5 -0
  69. package/dist/hooks/atlas/idle-event.d.ts +8 -0
  70. package/dist/hooks/atlas/resolve-active-boulder-session.d.ts +11 -0
  71. package/dist/hooks/atlas/tool-execute-after.d.ts +2 -0
  72. package/dist/hooks/atlas/types.d.ts +4 -0
  73. package/dist/hooks/atlas/verification-reminders.d.ts +4 -0
  74. package/dist/hooks/auto-slash-command/executor.d.ts +1 -0
  75. package/dist/hooks/auto-slash-command/hook.d.ts +7 -0
  76. package/dist/hooks/auto-slash-command/processed-command-store.d.ts +7 -0
  77. package/dist/hooks/auto-slash-command/types.d.ts +9 -0
  78. package/dist/hooks/auto-update-checker/checker/sync-package-json.d.ts +7 -0
  79. package/dist/hooks/auto-update-checker/checker.d.ts +3 -1
  80. package/dist/hooks/compaction-context-injector/compaction-context-prompt.d.ts +1 -0
  81. package/dist/hooks/compaction-context-injector/constants.d.ts +5 -0
  82. package/dist/hooks/compaction-context-injector/hook.d.ts +5 -1
  83. package/dist/hooks/compaction-context-injector/recovery-prompt-config.d.ts +6 -0
  84. package/dist/hooks/compaction-context-injector/recovery.d.ts +6 -0
  85. package/dist/hooks/compaction-context-injector/session-id.d.ts +2 -0
  86. package/dist/hooks/compaction-context-injector/session-prompt-config-resolver.d.ts +16 -0
  87. package/dist/hooks/compaction-context-injector/tail-monitor.d.ts +13 -0
  88. package/dist/hooks/compaction-context-injector/types.d.ts +43 -0
  89. package/dist/hooks/compaction-context-injector/validated-model.d.ts +13 -0
  90. package/dist/hooks/context-window-monitor.d.ts +2 -5
  91. package/dist/hooks/gpt-permission-continuation/assistant-message.d.ts +23 -0
  92. package/dist/hooks/gpt-permission-continuation/constants.d.ts +4 -0
  93. package/dist/hooks/gpt-permission-continuation/detector.d.ts +1 -0
  94. package/dist/hooks/gpt-permission-continuation/handler.d.ts +12 -0
  95. package/dist/hooks/gpt-permission-continuation/index.d.ts +13 -0
  96. package/dist/hooks/gpt-permission-continuation/session-state.d.ts +15 -0
  97. package/dist/hooks/index.d.ts +2 -0
  98. package/dist/hooks/keyword-detector/hook.d.ts +1 -0
  99. package/dist/hooks/preemptive-compaction.d.ts +2 -5
  100. package/dist/hooks/ralph-loop/pending-verification-handler.d.ts +17 -0
  101. package/dist/hooks/runtime-fallback/fallback-bootstrap-model.d.ts +10 -0
  102. package/dist/hooks/runtime-fallback/fallback-retry-dispatcher.d.ts +11 -0
  103. package/dist/hooks/runtime-fallback/hook.d.ts +2 -3
  104. package/dist/hooks/runtime-fallback/last-user-retry-parts.d.ts +4 -0
  105. package/dist/hooks/runtime-fallback/message-update-handler.d.ts +1 -2
  106. package/dist/hooks/runtime-fallback/retry-model-payload.d.ts +7 -0
  107. package/dist/hooks/runtime-fallback/session-messages.d.ts +9 -0
  108. package/dist/hooks/runtime-fallback/session-status-handler.d.ts +3 -0
  109. package/dist/hooks/runtime-fallback/types.d.ts +57 -3
  110. package/dist/hooks/runtime-fallback/visible-assistant-response.d.ts +3 -0
  111. package/dist/hooks/session-notification-content.d.ts +30 -0
  112. package/dist/hooks/session-notification-scheduler.d.ts +1 -3
  113. package/dist/hooks/start-work/index.d.ts +1 -1
  114. package/dist/hooks/start-work/worktree-detector.d.ts +7 -0
  115. package/dist/hooks/todo-continuation-enforcer/compaction-guard.d.ts +2 -0
  116. package/dist/hooks/todo-continuation-enforcer/constants.d.ts +2 -0
  117. package/dist/hooks/todo-continuation-enforcer/handler.d.ts +1 -0
  118. package/dist/hooks/todo-continuation-enforcer/idle-event.d.ts +1 -0
  119. package/dist/hooks/todo-continuation-enforcer/resolve-message-info.d.ts +3 -0
  120. package/dist/hooks/todo-continuation-enforcer/session-state.d.ts +10 -1
  121. package/dist/hooks/todo-continuation-enforcer/stagnation-detection.d.ts +6 -0
  122. package/dist/hooks/todo-continuation-enforcer/types.d.ts +10 -0
  123. package/dist/hooks/todo-description-override/description.d.ts +1 -0
  124. package/dist/hooks/todo-description-override/hook.d.ts +8 -0
  125. package/dist/hooks/todo-description-override/index.d.ts +1 -0
  126. package/dist/hooks/tool-output-truncator.d.ts +1 -0
  127. package/dist/index.js +10849 -6983
  128. package/dist/oh-my-opencode.schema.json +46 -2
  129. package/dist/plugin/hooks/create-continuation-hooks.d.ts +2 -1
  130. package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
  131. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
  132. package/dist/plugin/normalize-tool-arg-schemas.d.ts +2 -0
  133. package/dist/plugin/ultrawork-model-override.d.ts +1 -15
  134. package/dist/plugin/ultrawork-variant-availability.d.ts +6 -0
  135. package/dist/plugin-dispose.d.ts +10 -0
  136. package/dist/plugin-handlers/agent-override-protection.d.ts +3 -0
  137. package/dist/plugin-state.d.ts +5 -0
  138. package/dist/shared/compaction-agent-config-checkpoint.d.ts +11 -0
  139. package/dist/shared/connected-providers-cache.d.ts +26 -29
  140. package/dist/shared/context-limit-resolver.d.ts +5 -0
  141. package/dist/shared/dynamic-truncator.d.ts +4 -7
  142. package/dist/shared/fallback-chain-from-models.d.ts +3 -0
  143. package/dist/shared/index.d.ts +3 -0
  144. package/dist/shared/model-error-classifier.d.ts +2 -1
  145. package/dist/shared/opencode-command-dirs.d.ts +3 -0
  146. package/dist/shared/plugin-identity.d.ts +5 -0
  147. package/dist/shared/question-denied-session-permission.d.ts +6 -0
  148. package/dist/shared/retry-status-utils.d.ts +2 -0
  149. package/dist/shared/shell-env.d.ts +27 -0
  150. package/dist/shared/tmux/tmux-utils/environment.d.ts +1 -0
  151. package/dist/shared/vision-capable-models-cache.d.ts +4 -0
  152. package/dist/tools/call-omo-agent/background-executor.d.ts +2 -1
  153. package/dist/tools/call-omo-agent/constants.d.ts +1 -1
  154. package/dist/tools/call-omo-agent/sync-executor.d.ts +11 -3
  155. package/dist/tools/call-omo-agent/tools.d.ts +2 -1
  156. package/dist/tools/delegate-task/cancel-unstable-agent-task.d.ts +2 -0
  157. package/dist/tools/delegate-task/model-selection.d.ts +3 -0
  158. package/dist/tools/delegate-task/model-string-parser.d.ts +5 -3
  159. package/dist/tools/hashline-edit/hash-computation.d.ts +1 -0
  160. package/dist/tools/hashline-edit/tool-description.d.ts +1 -1
  161. package/dist/tools/look-at/constants.d.ts +1 -1
  162. package/dist/tools/look-at/multimodal-fallback-chain.d.ts +4 -0
  163. package/dist/tools/lsp/constants.d.ts +1 -0
  164. package/dist/tools/lsp/directory-diagnostics.d.ts +1 -0
  165. package/dist/tools/lsp/lsp-client-transport.d.ts +4 -2
  166. package/dist/tools/lsp/lsp-client-wrapper.d.ts +2 -1
  167. package/dist/tools/lsp/server-path-bases.d.ts +1 -0
  168. package/package.json +18 -18
@@ -4,6 +4,8 @@ export interface TrackedSession {
4
4
  description: string;
5
5
  createdAt: Date;
6
6
  lastSeenAt: Date;
7
+ closePending: boolean;
8
+ closeRetryCount: number;
7
9
  lastMessageCount?: number;
8
10
  stableIdlePolls?: number;
9
11
  }
@@ -0,0 +1,6 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ export declare function isSessionInBoulderLineage(input: {
3
+ client: PluginInput["client"];
4
+ sessionID: string;
5
+ boulderSessionIDs: string[];
6
+ }): Promise<boolean>;
@@ -0,0 +1,6 @@
1
+ import type { SessionState } from "./types";
2
+ export declare function shouldPauseForFinalWaveApproval(input: {
3
+ planPath: string;
4
+ taskOutput: string;
5
+ sessionState: SessionState;
6
+ }): boolean;
@@ -0,0 +1,5 @@
1
+ export type FinalWavePlanState = {
2
+ pendingImplementationTaskCount: number;
3
+ pendingFinalWaveTaskCount: number;
4
+ };
5
+ export declare function readFinalWavePlanState(planPath: string): FinalWavePlanState | null;
@@ -0,0 +1,8 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ import type { AtlasHookOptions, SessionState } from "./types";
3
+ export declare function handleAtlasSessionIdle(input: {
4
+ ctx: PluginInput;
5
+ options?: AtlasHookOptions;
6
+ getState: (sessionID: string) => SessionState;
7
+ sessionID: string;
8
+ }): Promise<void>;
@@ -0,0 +1,11 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ import type { BoulderState, PlanProgress } from "../../features/boulder-state";
3
+ export declare function resolveActiveBoulderSession(input: {
4
+ client: PluginInput["client"];
5
+ directory: string;
6
+ sessionID: string;
7
+ }): Promise<{
8
+ boulderState: BoulderState;
9
+ progress: PlanProgress;
10
+ appendedSession: boolean;
11
+ } | null>;
@@ -1,7 +1,9 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
+ import type { SessionState } from "./types";
2
3
  import type { ToolExecuteAfterInput, ToolExecuteAfterOutput } from "./types";
3
4
  export declare function createToolExecuteAfterHandler(input: {
4
5
  ctx: PluginInput;
5
6
  pendingFilePaths: Map<string, string>;
6
7
  autoCommit: boolean;
8
+ getState: (sessionID: string) => SessionState;
7
9
  }): (toolInput: ToolExecuteAfterInput, toolOutput: ToolExecuteAfterOutput) => Promise<void>;
@@ -8,6 +8,7 @@ export interface AtlasHookOptions {
8
8
  directory: string;
9
9
  backgroundManager?: BackgroundManager;
10
10
  isContinuationStopped?: (sessionID: string) => boolean;
11
+ shouldSkipContinuation?: (sessionID: string) => boolean;
11
12
  agentOverrides?: AgentOverrides;
12
13
  /** Enable auto-commit after each atomic task completion (default: true) */
13
14
  autoCommit?: boolean;
@@ -28,4 +29,7 @@ export interface SessionState {
28
29
  promptFailureCount: number;
29
30
  lastFailureAt?: number;
30
31
  pendingRetryTimer?: ReturnType<typeof setTimeout>;
32
+ waitingForFinalWaveApproval?: boolean;
33
+ pendingFinalWaveTaskCount?: number;
34
+ approvedFinalWaveTaskCount?: number;
31
35
  }
@@ -3,4 +3,8 @@ export declare function buildOrchestratorReminder(planName: string, progress: {
3
3
  total: number;
4
4
  completed: number;
5
5
  }, sessionId: string, autoCommit?: boolean, includeCompletionGate?: boolean): string;
6
+ export declare function buildFinalWaveApprovalReminder(planName: string, progress: {
7
+ total: number;
8
+ completed: number;
9
+ }, sessionId: string): string;
6
10
  export declare function buildStandaloneVerificationReminder(sessionId: string): string;
@@ -4,6 +4,7 @@ export interface ExecutorOptions {
4
4
  skills?: LoadedSkill[];
5
5
  pluginsEnabled?: boolean;
6
6
  enabledPluginsOverride?: Record<string, boolean>;
7
+ agent?: string;
7
8
  }
8
9
  export interface ExecuteResult {
9
10
  success: boolean;
@@ -8,4 +8,11 @@ export interface AutoSlashCommandHookOptions {
8
8
  export declare function createAutoSlashCommandHook(options?: AutoSlashCommandHookOptions): {
9
9
  "chat.message": (input: AutoSlashCommandHookInput, output: AutoSlashCommandHookOutput) => Promise<void>;
10
10
  "command.execute.before": (input: CommandExecuteBeforeInput, output: CommandExecuteBeforeOutput) => Promise<void>;
11
+ event: ({ event, }: {
12
+ event: {
13
+ type: string;
14
+ properties?: unknown;
15
+ };
16
+ }) => Promise<void>;
17
+ dispose: () => void;
11
18
  };
@@ -0,0 +1,7 @@
1
+ export interface ProcessedCommandStore {
2
+ has(commandKey: string): boolean;
3
+ add(commandKey: string, ttlMs?: number): void;
4
+ cleanupSession(sessionID: string): void;
5
+ clear(): void;
6
+ }
7
+ export declare function createProcessedCommandStore(): ProcessedCommandStore;
@@ -29,6 +29,15 @@ export interface CommandExecuteBeforeInput {
29
29
  command: string;
30
30
  sessionID: string;
31
31
  arguments: string;
32
+ agent?: string;
33
+ messageID?: string;
34
+ messageId?: string;
35
+ eventID?: string;
36
+ eventId?: string;
37
+ invocationID?: string;
38
+ invocationId?: string;
39
+ commandID?: string;
40
+ commandId?: string;
32
41
  }
33
42
  export interface CommandExecuteBeforeOutput {
34
43
  parts: Array<{
@@ -0,0 +1,7 @@
1
+ import type { PluginEntryInfo } from "./plugin-entry";
2
+ export interface SyncResult {
3
+ synced: boolean;
4
+ error: "file_not_found" | "plugin_not_in_deps" | "parse_error" | "write_error" | null;
5
+ message?: string;
6
+ }
7
+ export declare function syncCachePackageJsonToIntent(pluginInfo: PluginEntryInfo): SyncResult;
@@ -3,6 +3,8 @@ export { getLocalDevVersion } from "./checker/local-dev-version";
3
3
  export { findPluginEntry } from "./checker/plugin-entry";
4
4
  export type { PluginEntryInfo } from "./checker/plugin-entry";
5
5
  export { getCachedVersion } from "./checker/cached-version";
6
- export { updatePinnedVersion, revertPinnedVersion } from "./checker/pinned-version-updater";
6
+ export { updatePinnedVersion } from "./checker/pinned-version-updater";
7
7
  export { getLatestVersion } from "./checker/latest-version";
8
8
  export { checkForUpdate } from "./checker/check-for-update";
9
+ export { syncCachePackageJsonToIntent } from "./checker/sync-package-json";
10
+ export type { SyncResult } from "./checker/sync-package-json";
@@ -0,0 +1 @@
1
+ export declare const COMPACTION_CONTEXT_PROMPT: string;
@@ -0,0 +1,5 @@
1
+ export declare const HOOK_NAME = "compaction-context-injector";
2
+ export declare const AGENT_RECOVERY_PROMPT = "[restore checkpointed session agent configuration after compaction]";
3
+ export declare const NO_TEXT_TAIL_THRESHOLD = 5;
4
+ export declare const RECOVERY_COOLDOWN_MS = 60000;
5
+ export declare const RECENT_COMPACTION_WINDOW_MS: number;
@@ -1,2 +1,6 @@
1
1
  import type { BackgroundManager } from "../../features/background-agent";
2
- export declare function createCompactionContextInjector(backgroundManager?: BackgroundManager): (sessionID?: string) => string;
2
+ import type { CompactionContextClient, CompactionContextInjector } from "./types";
3
+ export declare function createCompactionContextInjector(options?: {
4
+ ctx?: CompactionContextClient;
5
+ backgroundManager?: BackgroundManager;
6
+ }): CompactionContextInjector;
@@ -0,0 +1,6 @@
1
+ import type { CompactionAgentConfigCheckpoint } from "../../shared/compaction-agent-config-checkpoint";
2
+ export type RecoveryPromptConfig = CompactionAgentConfigCheckpoint & {
3
+ agent: string;
4
+ };
5
+ export declare function createExpectedRecoveryPromptConfig(checkpoint: Pick<RecoveryPromptConfig, "agent"> & CompactionAgentConfigCheckpoint, currentPromptConfig: CompactionAgentConfigCheckpoint): RecoveryPromptConfig;
6
+ export declare function isPromptConfigRecovered(actualPromptConfig: CompactionAgentConfigCheckpoint, expectedPromptConfig: RecoveryPromptConfig): boolean;
@@ -0,0 +1,6 @@
1
+ import type { CompactionContextClient } from "./types";
2
+ import type { TailMonitorState } from "./tail-monitor";
3
+ export declare function createRecoveryLogic(ctx: CompactionContextClient | undefined, getTailState: (sessionID: string) => TailMonitorState): {
4
+ recoverCheckpointedAgentConfig: (sessionID: string, reason: "session.compacted" | "no-text-tail") => Promise<boolean>;
5
+ maybeWarnAboutNoTextTail: (sessionID: string) => Promise<void>;
6
+ };
@@ -0,0 +1,2 @@
1
+ export declare function isCompactionAgent(agent: string | undefined): boolean;
2
+ export declare function resolveSessionID(props?: Record<string, unknown>): string | undefined;
@@ -0,0 +1,16 @@
1
+ import type { CompactionAgentConfigCheckpoint } from "../../shared/compaction-agent-config-checkpoint";
2
+ type ResolverContext = {
3
+ client: {
4
+ session: {
5
+ messages: (input: {
6
+ path: {
7
+ id: string;
8
+ };
9
+ }) => Promise<unknown>;
10
+ };
11
+ };
12
+ directory: string;
13
+ };
14
+ export declare function resolveSessionPromptConfig(ctx: ResolverContext, sessionID: string): Promise<CompactionAgentConfigCheckpoint>;
15
+ export declare function resolveLatestSessionPromptConfig(ctx: ResolverContext, sessionID: string): Promise<CompactionAgentConfigCheckpoint>;
16
+ export {};
@@ -0,0 +1,13 @@
1
+ export type TailMonitorState = {
2
+ currentMessageID?: string;
3
+ currentHasOutput: boolean;
4
+ consecutiveNoTextMessages: number;
5
+ lastCompactedAt?: number;
6
+ lastRecoveryAt?: number;
7
+ };
8
+ export declare function finalizeTrackedAssistantMessage(state: TailMonitorState): number;
9
+ export declare function shouldTreatAssistantPartAsOutput(part: {
10
+ type?: string;
11
+ text?: string;
12
+ }): boolean;
13
+ export declare function trackAssistantOutput(state: TailMonitorState, messageID?: string): void;
@@ -0,0 +1,43 @@
1
+ export interface CompactionContextInjector {
2
+ capture: (sessionID: string) => Promise<void>;
3
+ inject: (sessionID?: string) => string;
4
+ event: (input: {
5
+ event: {
6
+ type: string;
7
+ properties?: unknown;
8
+ };
9
+ }) => Promise<void>;
10
+ }
11
+ export type CompactionContextClient = {
12
+ client: {
13
+ session: {
14
+ messages: (input: {
15
+ path: {
16
+ id: string;
17
+ };
18
+ }) => Promise<unknown>;
19
+ promptAsync: (input: {
20
+ path: {
21
+ id: string;
22
+ };
23
+ body: {
24
+ noReply?: boolean;
25
+ agent?: string;
26
+ model?: {
27
+ providerID: string;
28
+ modelID: string;
29
+ };
30
+ tools?: Record<string, boolean>;
31
+ parts: Array<{
32
+ type: "text";
33
+ text: string;
34
+ }>;
35
+ };
36
+ query?: {
37
+ directory: string;
38
+ };
39
+ }) => Promise<unknown>;
40
+ };
41
+ };
42
+ directory: string;
43
+ };
@@ -0,0 +1,13 @@
1
+ import type { CompactionAgentConfigCheckpoint } from "../../shared/compaction-agent-config-checkpoint";
2
+ type PromptConfigInfo = {
3
+ agent?: string;
4
+ model?: {
5
+ providerID?: string;
6
+ modelID?: string;
7
+ };
8
+ providerID?: string;
9
+ modelID?: string;
10
+ };
11
+ export declare function resolveValidatedModel(info: PromptConfigInfo | undefined): CompactionAgentConfigCheckpoint["model"] | undefined;
12
+ export declare function validateCheckpointModel(checkpointModel: CompactionAgentConfigCheckpoint["model"], currentModel: CompactionAgentConfigCheckpoint["model"]): CompactionAgentConfigCheckpoint["model"] | undefined;
13
+ export {};
@@ -1,8 +1,6 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
- type ModelCacheStateLike = {
3
- anthropicContext1MEnabled: boolean;
4
- };
5
- export declare function createContextWindowMonitorHook(_ctx: PluginInput, modelCacheState?: ModelCacheStateLike): {
2
+ import { type ContextLimitModelCacheState } from "../shared/context-limit-resolver";
3
+ export declare function createContextWindowMonitorHook(_ctx: PluginInput, modelCacheState?: ContextLimitModelCacheState): {
6
4
  "tool.execute.after": (input: {
7
5
  tool: string;
8
6
  sessionID: string;
@@ -19,4 +17,3 @@ export declare function createContextWindowMonitorHook(_ctx: PluginInput, modelC
19
17
  };
20
18
  }) => Promise<void>;
21
19
  };
22
- export {};
@@ -0,0 +1,23 @@
1
+ type TextPart = {
2
+ type?: string;
3
+ text?: string;
4
+ };
5
+ type MessageInfo = {
6
+ id?: string;
7
+ role?: string;
8
+ error?: unknown;
9
+ model?: {
10
+ providerID?: string;
11
+ modelID?: string;
12
+ };
13
+ providerID?: string;
14
+ modelID?: string;
15
+ };
16
+ export type SessionMessage = {
17
+ info?: MessageInfo;
18
+ parts?: TextPart[];
19
+ };
20
+ export declare function getLastAssistantMessage(messages: SessionMessage[]): SessionMessage | null;
21
+ export declare function extractAssistantText(message: SessionMessage): string;
22
+ export declare function isGptAssistantMessage(message: SessionMessage): boolean;
23
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const HOOK_NAME = "gpt-permission-continuation";
2
+ export declare const CONTINUATION_PROMPT = "continue";
3
+ export declare const MAX_CONSECUTIVE_AUTO_CONTINUES = 3;
4
+ export declare const DEFAULT_STALL_PATTERNS: readonly ["if you want", "would you like", "shall i", "do you want me to", "let me know if"];
@@ -0,0 +1 @@
1
+ export declare function detectStallPattern(text: string, patterns?: readonly string[]): boolean;
@@ -0,0 +1,12 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ import type { SessionStateStore } from "./session-state";
3
+ export declare function createGptPermissionContinuationHandler(args: {
4
+ ctx: PluginInput;
5
+ sessionStateStore: SessionStateStore;
6
+ isContinuationStopped?: (sessionID: string) => boolean;
7
+ }): (input: {
8
+ event: {
9
+ type: string;
10
+ properties?: unknown;
11
+ };
12
+ }) => Promise<void>;
@@ -0,0 +1,13 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ export type GptPermissionContinuationHook = {
3
+ handler: (input: {
4
+ event: {
5
+ type: string;
6
+ properties?: unknown;
7
+ };
8
+ }) => Promise<void>;
9
+ wasRecentlyInjected: (sessionID: string) => boolean;
10
+ };
11
+ export declare function createGptPermissionContinuationHook(ctx: PluginInput, options?: {
12
+ isContinuationStopped?: (sessionID: string) => boolean;
13
+ }): GptPermissionContinuationHook;
@@ -0,0 +1,15 @@
1
+ type SessionState = {
2
+ inFlight: boolean;
3
+ consecutiveAutoContinueCount: number;
4
+ awaitingAutoContinuationResponse: boolean;
5
+ lastHandledMessageID?: string;
6
+ lastAutoContinuePermissionPhrase?: string;
7
+ lastInjectedAt?: number;
8
+ };
9
+ export type SessionStateStore = ReturnType<typeof createSessionStateStore>;
10
+ export declare function createSessionStateStore(): {
11
+ getState: (sessionID: string) => SessionState;
12
+ wasRecentlyInjected(sessionID: string, windowMs: number): boolean;
13
+ cleanup(sessionID: string): void;
14
+ };
15
+ export {};
@@ -27,6 +27,7 @@ export { createCategorySkillReminderHook } from "./category-skill-reminder";
27
27
  export { createRalphLoopHook, type RalphLoopHook } from "./ralph-loop";
28
28
  export { createNoSisyphusGptHook } from "./no-sisyphus-gpt";
29
29
  export { createNoHephaestusNonGptHook } from "./no-hephaestus-non-gpt";
30
+ export { createGptPermissionContinuationHook, type GptPermissionContinuationHook } from "./gpt-permission-continuation";
30
31
  export { createAutoSlashCommandHook } from "./auto-slash-command";
31
32
  export { createEditErrorRecoveryHook } from "./edit-error-recovery";
32
33
  export { createPrometheusMdOnlyHook } from "./prometheus-md-only";
@@ -47,3 +48,4 @@ export { createWriteExistingFileGuardHook } from "./write-existing-file-guard";
47
48
  export { createHashlineReadEnhancerHook } from "./hashline-read-enhancer";
48
49
  export { createJsonErrorRecoveryHook, JSON_ERROR_TOOL_EXCLUDE_LIST, JSON_ERROR_PATTERNS, JSON_ERROR_REMINDER } from "./json-error-recovery";
49
50
  export { createReadImageResizerHook } from "./read-image-resizer";
51
+ export { createTodoDescriptionOverrideHook } from "./todo-description-override";
@@ -9,6 +9,7 @@ export declare function createKeywordDetectorHook(ctx: PluginInput, _collector?:
9
9
  modelID: string;
10
10
  };
11
11
  messageID?: string;
12
+ variant?: string;
12
13
  }, output: {
13
14
  message: Record<string, unknown>;
14
15
  parts: Array<{
@@ -1,8 +1,5 @@
1
1
  import type { OhMyOpenCodeConfig } from "../config";
2
- type ModelCacheStateLike = {
3
- anthropicContext1MEnabled: boolean;
4
- modelContextLimitsCache?: Map<string, number>;
5
- };
2
+ import { type ContextLimitModelCacheState } from "../shared/context-limit-resolver";
6
3
  type PluginInput = {
7
4
  client: {
8
5
  session: {
@@ -15,7 +12,7 @@ type PluginInput = {
15
12
  };
16
13
  directory: string;
17
14
  };
18
- export declare function createPreemptiveCompactionHook(ctx: PluginInput, pluginConfig: OhMyOpenCodeConfig, modelCacheState?: ModelCacheStateLike): {
15
+ export declare function createPreemptiveCompactionHook(ctx: PluginInput, pluginConfig: OhMyOpenCodeConfig, modelCacheState?: ContextLimitModelCacheState): {
19
16
  "tool.execute.after": (input: {
20
17
  tool: string;
21
18
  sessionID: string;
@@ -0,0 +1,17 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ import type { RalphLoopState } from "./types";
3
+ type LoopStateController = {
4
+ restartAfterFailedVerification: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null;
5
+ setVerificationSessionID: (sessionID: string, verificationSessionID: string) => RalphLoopState | null;
6
+ };
7
+ export declare function handlePendingVerification(ctx: PluginInput, input: {
8
+ sessionID: string;
9
+ state: RalphLoopState;
10
+ verificationSessionID?: string;
11
+ matchesParentSession: boolean;
12
+ matchesVerificationSession: boolean;
13
+ loopState: LoopStateController;
14
+ directory: string;
15
+ apiTimeoutMs: number;
16
+ }): Promise<void>;
17
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { OhMyOpenCodeConfig } from "../../config";
2
+ type ResolveFallbackBootstrapModelOptions = {
3
+ sessionID: string;
4
+ source: string;
5
+ eventModel?: string;
6
+ resolvedAgent?: string;
7
+ pluginConfig?: OhMyOpenCodeConfig;
8
+ };
9
+ export declare function resolveFallbackBootstrapModel(options: ResolveFallbackBootstrapModelOptions): string | undefined;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { AutoRetryHelpers } from "./auto-retry";
2
+ import type { HookDeps, FallbackState } from "./types";
3
+ type DispatchFallbackRetryOptions = {
4
+ sessionID: string;
5
+ state: FallbackState;
6
+ fallbackModels: string[];
7
+ resolvedAgent?: string;
8
+ source: string;
9
+ };
10
+ export declare function dispatchFallbackRetry(deps: HookDeps, helpers: AutoRetryHelpers, options: DispatchFallbackRetryOptions): Promise<void>;
11
+ export {};
@@ -1,3 +1,2 @@
1
- import type { PluginInput } from "@opencode-ai/plugin";
2
- import type { RuntimeFallbackHook, RuntimeFallbackOptions } from "./types";
3
- export declare function createRuntimeFallbackHook(ctx: PluginInput, options?: RuntimeFallbackOptions): RuntimeFallbackHook;
1
+ import type { RuntimeFallbackHook, RuntimeFallbackOptions, RuntimeFallbackPluginInput } from "./types";
2
+ export declare function createRuntimeFallbackHook(ctx: RuntimeFallbackPluginInput, options?: RuntimeFallbackOptions): RuntimeFallbackHook;
@@ -0,0 +1,4 @@
1
+ export declare function getLastUserRetryParts(messagesResponse: unknown): Array<{
2
+ type: "text";
3
+ text: string;
4
+ }>;
@@ -1,5 +1,4 @@
1
1
  import type { HookDeps } from "./types";
2
2
  import type { AutoRetryHelpers } from "./auto-retry";
3
- import { extractAutoRetrySignal } from "./error-classifier";
4
- export declare function hasVisibleAssistantResponse(extractAutoRetrySignalFn: typeof extractAutoRetrySignal): (ctx: HookDeps["ctx"], sessionID: string, _info: Record<string, unknown> | undefined) => Promise<boolean>;
3
+ export { hasVisibleAssistantResponse } from "./visible-assistant-response";
5
4
  export declare function createMessageUpdateHandler(deps: HookDeps, helpers: AutoRetryHelpers): (props: Record<string, unknown> | undefined) => Promise<void>;
@@ -0,0 +1,7 @@
1
+ export declare function buildRetryModelPayload(model: string): {
2
+ model: {
3
+ providerID: string;
4
+ modelID: string;
5
+ };
6
+ variant?: string;
7
+ } | undefined;
@@ -0,0 +1,9 @@
1
+ export type SessionMessagePart = {
2
+ type?: string;
3
+ text?: string;
4
+ };
5
+ export type SessionMessage = {
6
+ info?: Record<string, unknown>;
7
+ parts?: SessionMessagePart[];
8
+ };
9
+ export declare function extractSessionMessages(messagesResponse: unknown): SessionMessage[] | undefined;
@@ -0,0 +1,3 @@
1
+ import type { HookDeps } from "./types";
2
+ import type { AutoRetryHelpers } from "./auto-retry";
3
+ export declare function createSessionStatusHandler(deps: HookDeps, helpers: AutoRetryHelpers, sessionStatusRetryKeys: Map<string, string>): (props: Record<string, unknown> | undefined) => Promise<void>;
@@ -1,5 +1,57 @@
1
- import type { PluginInput } from "@opencode-ai/plugin";
2
1
  import type { RuntimeFallbackConfig, OhMyOpenCodeConfig } from "../../config";
2
+ export interface RuntimeFallbackInterval {
3
+ unref: () => void;
4
+ }
5
+ export type RuntimeFallbackTimeout = object | number;
6
+ export interface RuntimeFallbackPluginInput {
7
+ client: {
8
+ session: {
9
+ abort: (input: {
10
+ path: {
11
+ id: string;
12
+ };
13
+ }) => Promise<unknown>;
14
+ messages: (input: {
15
+ path: {
16
+ id: string;
17
+ };
18
+ query: {
19
+ directory: string;
20
+ };
21
+ }) => Promise<unknown>;
22
+ promptAsync: (input: {
23
+ path: {
24
+ id: string;
25
+ };
26
+ body: {
27
+ agent?: string;
28
+ model: {
29
+ providerID: string;
30
+ modelID: string;
31
+ };
32
+ parts: Array<{
33
+ type: "text";
34
+ text: string;
35
+ }>;
36
+ };
37
+ query: {
38
+ directory: string;
39
+ };
40
+ }) => Promise<unknown>;
41
+ };
42
+ tui: {
43
+ showToast: (input: {
44
+ body: {
45
+ title: string;
46
+ message: string;
47
+ variant: "success" | "error" | "info" | "warning";
48
+ duration: number;
49
+ };
50
+ }) => Promise<unknown>;
51
+ };
52
+ };
53
+ directory: string;
54
+ }
3
55
  export interface FallbackState {
4
56
  originalModel: string;
5
57
  currentModel: string;
@@ -45,9 +97,10 @@ export interface RuntimeFallbackHook {
45
97
  text?: string;
46
98
  }>;
47
99
  }) => Promise<void>;
100
+ dispose?: () => void;
48
101
  }
49
102
  export interface HookDeps {
50
- ctx: PluginInput;
103
+ ctx: RuntimeFallbackPluginInput;
51
104
  config: Required<RuntimeFallbackConfig>;
52
105
  options: RuntimeFallbackOptions | undefined;
53
106
  pluginConfig: OhMyOpenCodeConfig | undefined;
@@ -55,5 +108,6 @@ export interface HookDeps {
55
108
  sessionLastAccess: Map<string, number>;
56
109
  sessionRetryInFlight: Set<string>;
57
110
  sessionAwaitingFallbackResult: Set<string>;
58
- sessionFallbackTimeouts: Map<string, ReturnType<typeof setTimeout>>;
111
+ sessionFallbackTimeouts: Map<string, RuntimeFallbackTimeout>;
112
+ sessionStatusRetryKeys: Map<string, string>;
59
113
  }
@@ -0,0 +1,3 @@
1
+ import type { HookDeps } from "./types";
2
+ import { extractAutoRetrySignal } from "./error-classifier";
3
+ export declare function hasVisibleAssistantResponse(extractAutoRetrySignalFn: typeof extractAutoRetrySignal): (ctx: HookDeps["ctx"], sessionID: string, _info: Record<string, unknown> | undefined) => Promise<boolean>;
@@ -0,0 +1,30 @@
1
+ type ReadyNotificationContext = {
2
+ client: {
3
+ session: {
4
+ get?: (input: {
5
+ path: {
6
+ id: string;
7
+ };
8
+ }) => Promise<unknown>;
9
+ messages?: (input: {
10
+ path: {
11
+ id: string;
12
+ };
13
+ query: {
14
+ directory: string;
15
+ };
16
+ }) => Promise<unknown>;
17
+ };
18
+ };
19
+ directory: string;
20
+ };
21
+ type ReadyNotificationInput = {
22
+ sessionID: string;
23
+ baseTitle: string;
24
+ baseMessage: string;
25
+ };
26
+ export declare function buildReadyNotificationContent(ctx: ReadyNotificationContext, input: ReadyNotificationInput): Promise<{
27
+ title: string;
28
+ message: string;
29
+ }>;
30
+ export {};