oh-my-opencode 3.7.3 → 3.8.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 (146) hide show
  1. package/README.ja.md +206 -243
  2. package/README.ko.md +205 -244
  3. package/README.md +176 -174
  4. package/README.zh-cn.md +211 -255
  5. package/dist/agents/atlas/default.d.ts +1 -1
  6. package/dist/agents/atlas/gpt.d.ts +1 -1
  7. package/dist/agents/atlas/prompt-section-builder.d.ts +1 -1
  8. package/dist/agents/builtin-agents/environment-context.d.ts +5 -1
  9. package/dist/agents/builtin-agents/general-agents.d.ts +1 -0
  10. package/dist/agents/builtin-agents/hephaestus-agent.d.ts +1 -0
  11. package/dist/agents/builtin-agents/sisyphus-agent.d.ts +1 -0
  12. package/dist/agents/builtin-agents.d.ts +1 -1
  13. package/dist/agents/dynamic-agent-prompt-builder.d.ts +0 -5
  14. package/dist/agents/index.d.ts +2 -1
  15. package/dist/agents/metis.d.ts +1 -1
  16. package/dist/agents/prometheus/behavioral-summary.d.ts +1 -1
  17. package/dist/agents/prometheus/gpt.d.ts +24 -0
  18. package/dist/agents/prometheus/identity-constraints.d.ts +1 -1
  19. package/dist/agents/prometheus/index.d.ts +3 -1
  20. package/dist/agents/prometheus/interview-mode.d.ts +1 -1
  21. package/dist/agents/prometheus/plan-generation.d.ts +1 -1
  22. package/dist/agents/prometheus/plan-template.d.ts +1 -1
  23. package/dist/agents/prometheus/system-prompt.d.ts +13 -2
  24. package/dist/agents/sisyphus-junior/agent.d.ts +1 -1
  25. package/dist/agents/types.d.ts +1 -0
  26. package/dist/cli/config-manager/antigravity-provider-configuration.d.ts +2 -2
  27. package/dist/cli/fallback-chain-resolution.d.ts +1 -1
  28. package/dist/cli/index.js +527 -175
  29. package/dist/cli/model-fallback-requirements.d.ts +3 -0
  30. package/dist/cli/provider-model-id-transform.d.ts +1 -1
  31. package/dist/cli/run/event-state.d.ts +4 -0
  32. package/dist/cli/run/stdin-suppression.d.ts +12 -0
  33. package/dist/cli/run/timestamp-output.d.ts +5 -0
  34. package/dist/cli/run/types.d.ts +1 -0
  35. package/dist/config/index.d.ts +2 -2
  36. package/dist/config/schema/agent-overrides.d.ts +75 -0
  37. package/dist/config/schema/categories.d.ts +2 -0
  38. package/dist/config/schema/experimental.d.ts +2 -0
  39. package/dist/config/schema/fallback-models.d.ts +3 -0
  40. package/dist/config/schema/hooks.d.ts +4 -3
  41. package/dist/config/schema/oh-my-opencode-config.d.ts +87 -47
  42. package/dist/config/schema/ralph-loop.d.ts +4 -0
  43. package/dist/config/schema/runtime-fallback.d.ts +10 -0
  44. package/dist/config/schema.d.ts +2 -0
  45. package/dist/create-hooks.d.ts +8 -5
  46. package/dist/features/background-agent/manager.d.ts +3 -0
  47. package/dist/features/background-agent/parent-session-context-resolver.d.ts +1 -0
  48. package/dist/features/background-agent/types.d.ts +7 -0
  49. package/dist/features/builtin-commands/templates/ralph-loop.d.ts +1 -1
  50. package/dist/features/claude-code-session-state/state.d.ts +1 -0
  51. package/dist/features/task-toast-manager/manager.d.ts +5 -0
  52. package/dist/features/task-toast-manager/types.d.ts +2 -1
  53. package/dist/features/tmux-subagent/action-executor.d.ts +10 -3
  54. package/dist/features/tmux-subagent/grid-planning.d.ts +5 -3
  55. package/dist/features/tmux-subagent/manager.d.ts +12 -0
  56. package/dist/features/tmux-subagent/pane-split-availability.d.ts +0 -1
  57. package/dist/features/tmux-subagent/spawn-target-finder.d.ts +2 -2
  58. package/dist/features/tmux-subagent/tmux-grid-constants.d.ts +4 -0
  59. package/dist/features/tmux-subagent/types.d.ts +2 -0
  60. package/dist/hooks/atlas/recent-model-resolver.d.ts +6 -0
  61. package/dist/hooks/atlas/system-reminder-templates.d.ts +1 -1
  62. package/dist/hooks/hashline-edit-diff-enhancer/hook.d.ts +28 -0
  63. package/dist/hooks/hashline-edit-diff-enhancer/index.d.ts +1 -0
  64. package/dist/hooks/index.d.ts +5 -2
  65. package/dist/hooks/model-fallback/hook.d.ts +60 -0
  66. package/dist/hooks/no-hephaestus-non-gpt/hook.d.ts +16 -0
  67. package/dist/hooks/no-hephaestus-non-gpt/index.d.ts +1 -0
  68. package/dist/hooks/{sisyphus-gpt-hephaestus-reminder → no-sisyphus-gpt}/hook.d.ts +6 -1
  69. package/dist/hooks/no-sisyphus-gpt/index.d.ts +1 -0
  70. package/dist/hooks/ralph-loop/command-arguments.d.ts +8 -0
  71. package/dist/hooks/ralph-loop/continuation-prompt-injector.d.ts +1 -0
  72. package/dist/hooks/ralph-loop/iteration-continuation.d.ts +12 -0
  73. package/dist/hooks/ralph-loop/loop-state-controller.d.ts +2 -0
  74. package/dist/hooks/ralph-loop/ralph-loop-event-handler.d.ts +1 -0
  75. package/dist/hooks/ralph-loop/ralph-loop-hook.d.ts +1 -0
  76. package/dist/hooks/ralph-loop/session-reset-strategy.d.ts +3 -0
  77. package/dist/hooks/ralph-loop/types.d.ts +1 -0
  78. package/dist/hooks/runtime-fallback/agent-resolver.d.ts +5 -0
  79. package/dist/hooks/runtime-fallback/auto-retry.d.ts +10 -0
  80. package/dist/hooks/runtime-fallback/chat-message-handler.d.ts +20 -0
  81. package/dist/hooks/runtime-fallback/constants.d.ts +19 -0
  82. package/dist/hooks/runtime-fallback/error-classifier.d.ts +17 -0
  83. package/dist/hooks/runtime-fallback/event-handler.d.ts +8 -0
  84. package/dist/hooks/runtime-fallback/fallback-models.d.ts +2 -0
  85. package/dist/hooks/runtime-fallback/fallback-state.d.ts +6 -0
  86. package/dist/hooks/runtime-fallback/hook.d.ts +3 -0
  87. package/dist/hooks/runtime-fallback/index.d.ts +2 -0
  88. package/dist/hooks/runtime-fallback/message-update-handler.d.ts +5 -0
  89. package/dist/hooks/runtime-fallback/types.d.ts +59 -0
  90. package/dist/hooks/session-recovery/detect-error-type.d.ts +2 -1
  91. package/dist/hooks/session-recovery/recover-unavailable-tool.d.ts +5 -0
  92. package/dist/hooks/session-recovery/types.d.ts +1 -0
  93. package/dist/hooks/todo-continuation-enforcer/continuation-injection.d.ts +1 -0
  94. package/dist/hooks/todo-continuation-enforcer/countdown.d.ts +1 -0
  95. package/dist/hooks/unstable-agent-babysitter/task-message-analyzer.d.ts +1 -0
  96. package/dist/hooks/unstable-agent-babysitter/unstable-agent-babysitter-hook.d.ts +2 -0
  97. package/dist/hooks/write-existing-file-guard/hook.d.ts +1 -0
  98. package/dist/index.js +6614 -3149
  99. package/dist/oh-my-opencode.schema.json +3681 -0
  100. package/dist/plugin/chat-headers.d.ts +4 -0
  101. package/dist/plugin/chat-message.d.ts +9 -8
  102. package/dist/plugin/chat-params.d.ts +2 -3
  103. package/dist/plugin/event.d.ts +2 -6
  104. package/dist/plugin/hooks/create-core-hooks.d.ts +8 -5
  105. package/dist/plugin/hooks/create-session-hooks.d.ts +7 -5
  106. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
  107. package/dist/plugin/hooks/create-transform-hooks.d.ts +1 -1
  108. package/dist/plugin/system-transform.d.ts +5 -0
  109. package/dist/plugin/types.d.ts +7 -1
  110. package/dist/plugin/ultrawork-db-model-override.d.ts +11 -0
  111. package/dist/plugin/ultrawork-model-override.d.ts +37 -0
  112. package/dist/shared/index.d.ts +4 -0
  113. package/dist/shared/internal-initiator-marker.d.ts +5 -0
  114. package/dist/shared/model-error-classifier.d.ts +31 -0
  115. package/dist/shared/model-resolution-pipeline.d.ts +1 -0
  116. package/dist/shared/model-resolver.d.ts +6 -0
  117. package/dist/shared/prompt-tools.d.ts +3 -0
  118. package/dist/shared/provider-model-id-transform.d.ts +1 -0
  119. package/dist/shared/session-category-registry.d.ts +32 -0
  120. package/dist/shared/session-model-state.d.ts +7 -0
  121. package/dist/shared/tmux/tmux-utils/layout.d.ts +17 -2
  122. package/dist/tools/delegate-task/background-task.d.ts +2 -1
  123. package/dist/tools/delegate-task/category-resolver.d.ts +2 -0
  124. package/dist/tools/delegate-task/constants.d.ts +1 -1
  125. package/dist/tools/delegate-task/skill-resolver.d.ts +1 -0
  126. package/dist/tools/delegate-task/subagent-resolver.d.ts +2 -0
  127. package/dist/tools/delegate-task/sync-task.d.ts +1 -1
  128. package/dist/tools/hashline-edit/constants.d.ts +5 -2
  129. package/dist/tools/hashline-edit/diff-utils.d.ts +6 -0
  130. package/dist/tools/hashline-edit/edit-operations.d.ts +4 -4
  131. package/dist/tools/hashline-edit/hash-computation.d.ts +1 -1
  132. package/dist/tools/hashline-edit/index.d.ts +1 -1
  133. package/dist/tools/hashline-edit/types.d.ts +4 -4
  134. package/dist/tools/hashline-edit/validation.d.ts +1 -0
  135. package/dist/tools/index.d.ts +2 -2
  136. package/dist/tools/skill/constants.d.ts +2 -2
  137. package/dist/tools/skill/types.d.ts +4 -0
  138. package/dist/tools/slashcommand/index.d.ts +1 -1
  139. package/dist/tools/slashcommand/types.d.ts +1 -7
  140. package/package.json +10 -10
  141. package/dist/cli/run/opencode-bin-path.d.ts +0 -3
  142. package/dist/hooks/sisyphus-gpt-hephaestus-reminder/index.d.ts +0 -1
  143. package/dist/tools/slashcommand/skill-command-converter.d.ts +0 -3
  144. package/dist/tools/slashcommand/slashcommand-description.d.ts +0 -3
  145. package/dist/tools/slashcommand/slashcommand-tool.d.ts +0 -4
  146. package/dist/tools/slashcommand/tools.d.ts +0 -2
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Runtime Fallback Hook - Constants
3
+ *
4
+ * Default values and configuration constants for the runtime fallback feature.
5
+ */
6
+ import type { RuntimeFallbackConfig } from "../../config";
7
+ /**
8
+ * Default configuration values for runtime fallback
9
+ */
10
+ export declare const DEFAULT_CONFIG: Required<RuntimeFallbackConfig>;
11
+ /**
12
+ * Error patterns that indicate rate limiting or temporary failures
13
+ * These are checked in addition to HTTP status codes
14
+ */
15
+ export declare const RETRYABLE_ERROR_PATTERNS: RegExp[];
16
+ /**
17
+ * Hook name for identification and logging
18
+ */
19
+ export declare const HOOK_NAME = "runtime-fallback";
@@ -0,0 +1,17 @@
1
+ export declare function getErrorMessage(error: unknown): string;
2
+ export declare function extractStatusCode(error: unknown, retryOnErrors?: number[]): number | undefined;
3
+ export declare function extractErrorName(error: unknown): string | undefined;
4
+ export declare function classifyErrorType(error: unknown): string | undefined;
5
+ export interface AutoRetrySignal {
6
+ signal: string;
7
+ }
8
+ export declare const AUTO_RETRY_PATTERNS: Array<(combined: string) => boolean>;
9
+ export declare function extractAutoRetrySignal(info: Record<string, unknown> | undefined): AutoRetrySignal | undefined;
10
+ export declare function containsErrorContent(parts: Array<{
11
+ type?: string;
12
+ text?: string;
13
+ }> | undefined): {
14
+ hasError: boolean;
15
+ errorMessage?: string;
16
+ };
17
+ export declare function isRetryableError(error: unknown, retryOnErrors: number[]): boolean;
@@ -0,0 +1,8 @@
1
+ import type { HookDeps } from "./types";
2
+ import type { AutoRetryHelpers } from "./auto-retry";
3
+ export declare function createEventHandler(deps: HookDeps, helpers: AutoRetryHelpers): ({ event }: {
4
+ event: {
5
+ type: string;
6
+ properties?: unknown;
7
+ };
8
+ }) => Promise<void>;
@@ -0,0 +1,2 @@
1
+ import type { OhMyOpenCodeConfig } from "../../config";
2
+ export declare function getFallbackModelsForSession(sessionID: string, agent: string | undefined, pluginConfig: OhMyOpenCodeConfig | undefined): string[];
@@ -0,0 +1,6 @@
1
+ import type { FallbackState, FallbackResult } from "./types";
2
+ import type { RuntimeFallbackConfig } from "../../config";
3
+ export declare function createFallbackState(originalModel: string): FallbackState;
4
+ export declare function isModelInCooldown(model: string, state: FallbackState, cooldownSeconds: number): boolean;
5
+ export declare function findNextAvailableFallback(state: FallbackState, fallbackModels: string[], cooldownSeconds: number): string | undefined;
6
+ export declare function prepareFallback(sessionID: string, state: FallbackState, fallbackModels: string[], config: Required<RuntimeFallbackConfig>): FallbackResult;
@@ -0,0 +1,3 @@
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;
@@ -0,0 +1,2 @@
1
+ export { createRuntimeFallbackHook } from "./hook";
2
+ export type { RuntimeFallbackHook, RuntimeFallbackOptions } from "./types";
@@ -0,0 +1,5 @@
1
+ import type { HookDeps } from "./types";
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>;
5
+ export declare function createMessageUpdateHandler(deps: HookDeps, helpers: AutoRetryHelpers): (props: Record<string, unknown> | undefined) => Promise<void>;
@@ -0,0 +1,59 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ import type { RuntimeFallbackConfig, OhMyOpenCodeConfig } from "../../config";
3
+ export interface FallbackState {
4
+ originalModel: string;
5
+ currentModel: string;
6
+ fallbackIndex: number;
7
+ failedModels: Map<string, number>;
8
+ attemptCount: number;
9
+ pendingFallbackModel?: string;
10
+ }
11
+ export interface FallbackResult {
12
+ success: boolean;
13
+ newModel?: string;
14
+ error?: string;
15
+ maxAttemptsReached?: boolean;
16
+ }
17
+ export interface RuntimeFallbackOptions {
18
+ config?: RuntimeFallbackConfig;
19
+ pluginConfig?: OhMyOpenCodeConfig;
20
+ session_timeout_ms?: number;
21
+ }
22
+ export interface RuntimeFallbackHook {
23
+ event: (input: {
24
+ event: {
25
+ type: string;
26
+ properties?: unknown;
27
+ };
28
+ }) => Promise<void>;
29
+ "chat.message"?: (input: {
30
+ sessionID: string;
31
+ agent?: string;
32
+ model?: {
33
+ providerID: string;
34
+ modelID: string;
35
+ };
36
+ }, output: {
37
+ message: {
38
+ model?: {
39
+ providerID: string;
40
+ modelID: string;
41
+ };
42
+ };
43
+ parts?: Array<{
44
+ type: string;
45
+ text?: string;
46
+ }>;
47
+ }) => Promise<void>;
48
+ }
49
+ export interface HookDeps {
50
+ ctx: PluginInput;
51
+ config: Required<RuntimeFallbackConfig>;
52
+ options: RuntimeFallbackOptions | undefined;
53
+ pluginConfig: OhMyOpenCodeConfig | undefined;
54
+ sessionStates: Map<string, FallbackState>;
55
+ sessionLastAccess: Map<string, number>;
56
+ sessionRetryInFlight: Set<string>;
57
+ sessionAwaitingFallbackResult: Set<string>;
58
+ sessionFallbackTimeouts: Map<string, ReturnType<typeof setTimeout>>;
59
+ }
@@ -1,3 +1,4 @@
1
- export type RecoveryErrorType = "tool_result_missing" | "thinking_block_order" | "thinking_disabled_violation" | "assistant_prefill_unsupported" | null;
1
+ export type RecoveryErrorType = "tool_result_missing" | "thinking_block_order" | "thinking_disabled_violation" | "assistant_prefill_unsupported" | "unavailable_tool" | null;
2
2
  export declare function extractMessageIndex(error: unknown): number | null;
3
+ export declare function extractUnavailableToolName(error: unknown): string | null;
3
4
  export declare function detectErrorType(error: unknown): RecoveryErrorType;
@@ -0,0 +1,5 @@
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 {};
@@ -87,4 +87,5 @@ export interface ResumeConfig {
87
87
  providerID: string;
88
88
  modelID: string;
89
89
  };
90
+ tools?: Record<string, boolean>;
90
91
  }
@@ -9,4 +9,5 @@ export declare function injectContinuation(args: {
9
9
  skipAgents?: string[];
10
10
  resolvedInfo?: ResolvedMessageInfo;
11
11
  sessionStateStore: SessionStateStore;
12
+ isContinuationStopped?: (sessionID: string) => boolean;
12
13
  }): Promise<void>;
@@ -11,4 +11,5 @@ export declare function startCountdown(args: {
11
11
  backgroundManager?: BackgroundManager;
12
12
  skipAgents: string[];
13
13
  sessionStateStore: SessionStateStore;
14
+ isContinuationStopped?: (sessionID: string) => boolean;
14
15
  }): void;
@@ -9,6 +9,7 @@ type MessageInfo = {
9
9
  };
10
10
  providerID?: string;
11
11
  modelID?: string;
12
+ tools?: Record<string, boolean | "allow" | "deny" | "ask">;
12
13
  };
13
14
  type MessagePart = {
14
15
  type?: string;
@@ -27,6 +27,7 @@ type BabysitterContext = {
27
27
  providerID: string;
28
28
  modelID: string;
29
29
  };
30
+ tools?: Record<string, boolean>;
30
31
  };
31
32
  query?: {
32
33
  directory?: string;
@@ -46,6 +47,7 @@ type BabysitterContext = {
46
47
  providerID: string;
47
48
  modelID: string;
48
49
  };
50
+ tools?: Record<string, boolean>;
49
51
  };
50
52
  query?: {
51
53
  directory?: string;
@@ -1,2 +1,3 @@
1
1
  import type { Hooks, PluginInput } from "@opencode-ai/plugin";
2
+ export declare const MAX_TRACKED_PATHS_PER_SESSION = 1024;
2
3
  export declare function createWriteExistingFileGuardHook(ctx: PluginInput): Hooks;