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.
- package/README.ja.md +206 -243
- package/README.ko.md +205 -244
- package/README.md +176 -174
- package/README.zh-cn.md +211 -255
- package/dist/agents/atlas/default.d.ts +1 -1
- package/dist/agents/atlas/gpt.d.ts +1 -1
- package/dist/agents/atlas/prompt-section-builder.d.ts +1 -1
- package/dist/agents/builtin-agents/environment-context.d.ts +5 -1
- package/dist/agents/builtin-agents/general-agents.d.ts +1 -0
- package/dist/agents/builtin-agents/hephaestus-agent.d.ts +1 -0
- package/dist/agents/builtin-agents/sisyphus-agent.d.ts +1 -0
- package/dist/agents/builtin-agents.d.ts +1 -1
- package/dist/agents/dynamic-agent-prompt-builder.d.ts +0 -5
- package/dist/agents/index.d.ts +2 -1
- package/dist/agents/metis.d.ts +1 -1
- package/dist/agents/prometheus/behavioral-summary.d.ts +1 -1
- package/dist/agents/prometheus/gpt.d.ts +24 -0
- package/dist/agents/prometheus/identity-constraints.d.ts +1 -1
- package/dist/agents/prometheus/index.d.ts +3 -1
- package/dist/agents/prometheus/interview-mode.d.ts +1 -1
- package/dist/agents/prometheus/plan-generation.d.ts +1 -1
- package/dist/agents/prometheus/plan-template.d.ts +1 -1
- package/dist/agents/prometheus/system-prompt.d.ts +13 -2
- package/dist/agents/sisyphus-junior/agent.d.ts +1 -1
- package/dist/agents/types.d.ts +1 -0
- package/dist/cli/config-manager/antigravity-provider-configuration.d.ts +2 -2
- package/dist/cli/fallback-chain-resolution.d.ts +1 -1
- package/dist/cli/index.js +527 -175
- package/dist/cli/model-fallback-requirements.d.ts +3 -0
- package/dist/cli/provider-model-id-transform.d.ts +1 -1
- package/dist/cli/run/event-state.d.ts +4 -0
- package/dist/cli/run/stdin-suppression.d.ts +12 -0
- package/dist/cli/run/timestamp-output.d.ts +5 -0
- package/dist/cli/run/types.d.ts +1 -0
- package/dist/config/index.d.ts +2 -2
- package/dist/config/schema/agent-overrides.d.ts +75 -0
- package/dist/config/schema/categories.d.ts +2 -0
- package/dist/config/schema/experimental.d.ts +2 -0
- package/dist/config/schema/fallback-models.d.ts +3 -0
- package/dist/config/schema/hooks.d.ts +4 -3
- package/dist/config/schema/oh-my-opencode-config.d.ts +87 -47
- package/dist/config/schema/ralph-loop.d.ts +4 -0
- package/dist/config/schema/runtime-fallback.d.ts +10 -0
- package/dist/config/schema.d.ts +2 -0
- package/dist/create-hooks.d.ts +8 -5
- package/dist/features/background-agent/manager.d.ts +3 -0
- package/dist/features/background-agent/parent-session-context-resolver.d.ts +1 -0
- package/dist/features/background-agent/types.d.ts +7 -0
- package/dist/features/builtin-commands/templates/ralph-loop.d.ts +1 -1
- package/dist/features/claude-code-session-state/state.d.ts +1 -0
- package/dist/features/task-toast-manager/manager.d.ts +5 -0
- package/dist/features/task-toast-manager/types.d.ts +2 -1
- package/dist/features/tmux-subagent/action-executor.d.ts +10 -3
- package/dist/features/tmux-subagent/grid-planning.d.ts +5 -3
- package/dist/features/tmux-subagent/manager.d.ts +12 -0
- package/dist/features/tmux-subagent/pane-split-availability.d.ts +0 -1
- package/dist/features/tmux-subagent/spawn-target-finder.d.ts +2 -2
- package/dist/features/tmux-subagent/tmux-grid-constants.d.ts +4 -0
- package/dist/features/tmux-subagent/types.d.ts +2 -0
- package/dist/hooks/atlas/recent-model-resolver.d.ts +6 -0
- package/dist/hooks/atlas/system-reminder-templates.d.ts +1 -1
- package/dist/hooks/hashline-edit-diff-enhancer/hook.d.ts +28 -0
- package/dist/hooks/hashline-edit-diff-enhancer/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +5 -2
- package/dist/hooks/model-fallback/hook.d.ts +60 -0
- package/dist/hooks/no-hephaestus-non-gpt/hook.d.ts +16 -0
- package/dist/hooks/no-hephaestus-non-gpt/index.d.ts +1 -0
- package/dist/hooks/{sisyphus-gpt-hephaestus-reminder → no-sisyphus-gpt}/hook.d.ts +6 -1
- package/dist/hooks/no-sisyphus-gpt/index.d.ts +1 -0
- package/dist/hooks/ralph-loop/command-arguments.d.ts +8 -0
- package/dist/hooks/ralph-loop/continuation-prompt-injector.d.ts +1 -0
- package/dist/hooks/ralph-loop/iteration-continuation.d.ts +12 -0
- package/dist/hooks/ralph-loop/loop-state-controller.d.ts +2 -0
- package/dist/hooks/ralph-loop/ralph-loop-event-handler.d.ts +1 -0
- package/dist/hooks/ralph-loop/ralph-loop-hook.d.ts +1 -0
- package/dist/hooks/ralph-loop/session-reset-strategy.d.ts +3 -0
- package/dist/hooks/ralph-loop/types.d.ts +1 -0
- package/dist/hooks/runtime-fallback/agent-resolver.d.ts +5 -0
- package/dist/hooks/runtime-fallback/auto-retry.d.ts +10 -0
- package/dist/hooks/runtime-fallback/chat-message-handler.d.ts +20 -0
- package/dist/hooks/runtime-fallback/constants.d.ts +19 -0
- package/dist/hooks/runtime-fallback/error-classifier.d.ts +17 -0
- package/dist/hooks/runtime-fallback/event-handler.d.ts +8 -0
- package/dist/hooks/runtime-fallback/fallback-models.d.ts +2 -0
- package/dist/hooks/runtime-fallback/fallback-state.d.ts +6 -0
- package/dist/hooks/runtime-fallback/hook.d.ts +3 -0
- package/dist/hooks/runtime-fallback/index.d.ts +2 -0
- package/dist/hooks/runtime-fallback/message-update-handler.d.ts +5 -0
- package/dist/hooks/runtime-fallback/types.d.ts +59 -0
- package/dist/hooks/session-recovery/detect-error-type.d.ts +2 -1
- package/dist/hooks/session-recovery/recover-unavailable-tool.d.ts +5 -0
- package/dist/hooks/session-recovery/types.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/continuation-injection.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/countdown.d.ts +1 -0
- package/dist/hooks/unstable-agent-babysitter/task-message-analyzer.d.ts +1 -0
- package/dist/hooks/unstable-agent-babysitter/unstable-agent-babysitter-hook.d.ts +2 -0
- package/dist/hooks/write-existing-file-guard/hook.d.ts +1 -0
- package/dist/index.js +6614 -3149
- package/dist/oh-my-opencode.schema.json +3681 -0
- package/dist/plugin/chat-headers.d.ts +4 -0
- package/dist/plugin/chat-message.d.ts +9 -8
- package/dist/plugin/chat-params.d.ts +2 -3
- package/dist/plugin/event.d.ts +2 -6
- package/dist/plugin/hooks/create-core-hooks.d.ts +8 -5
- package/dist/plugin/hooks/create-session-hooks.d.ts +7 -5
- package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
- package/dist/plugin/hooks/create-transform-hooks.d.ts +1 -1
- package/dist/plugin/system-transform.d.ts +5 -0
- package/dist/plugin/types.d.ts +7 -1
- package/dist/plugin/ultrawork-db-model-override.d.ts +11 -0
- package/dist/plugin/ultrawork-model-override.d.ts +37 -0
- package/dist/shared/index.d.ts +4 -0
- package/dist/shared/internal-initiator-marker.d.ts +5 -0
- package/dist/shared/model-error-classifier.d.ts +31 -0
- package/dist/shared/model-resolution-pipeline.d.ts +1 -0
- package/dist/shared/model-resolver.d.ts +6 -0
- package/dist/shared/prompt-tools.d.ts +3 -0
- package/dist/shared/provider-model-id-transform.d.ts +1 -0
- package/dist/shared/session-category-registry.d.ts +32 -0
- package/dist/shared/session-model-state.d.ts +7 -0
- package/dist/shared/tmux/tmux-utils/layout.d.ts +17 -2
- package/dist/tools/delegate-task/background-task.d.ts +2 -1
- package/dist/tools/delegate-task/category-resolver.d.ts +2 -0
- package/dist/tools/delegate-task/constants.d.ts +1 -1
- package/dist/tools/delegate-task/skill-resolver.d.ts +1 -0
- package/dist/tools/delegate-task/subagent-resolver.d.ts +2 -0
- package/dist/tools/delegate-task/sync-task.d.ts +1 -1
- package/dist/tools/hashline-edit/constants.d.ts +5 -2
- package/dist/tools/hashline-edit/diff-utils.d.ts +6 -0
- package/dist/tools/hashline-edit/edit-operations.d.ts +4 -4
- package/dist/tools/hashline-edit/hash-computation.d.ts +1 -1
- package/dist/tools/hashline-edit/index.d.ts +1 -1
- package/dist/tools/hashline-edit/types.d.ts +4 -4
- package/dist/tools/hashline-edit/validation.d.ts +1 -0
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/skill/constants.d.ts +2 -2
- package/dist/tools/skill/types.d.ts +4 -0
- package/dist/tools/slashcommand/index.d.ts +1 -1
- package/dist/tools/slashcommand/types.d.ts +1 -7
- package/package.json +10 -10
- package/dist/cli/run/opencode-bin-path.d.ts +0 -3
- package/dist/hooks/sisyphus-gpt-hephaestus-reminder/index.d.ts +0 -1
- package/dist/tools/slashcommand/skill-command-converter.d.ts +0 -3
- package/dist/tools/slashcommand/slashcommand-description.d.ts +0 -3
- package/dist/tools/slashcommand/slashcommand-tool.d.ts +0 -4
- 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,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,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 {};
|
|
@@ -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;
|