@skj1724/oh-my-opencode 3.19.5 → 3.19.7
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/dist/agents/atlas.d.ts +1 -1
- package/dist/agents/prometheus-prompt.d.ts +1 -1
- package/dist/cli/index.js +54 -3
- package/dist/config/schema.d.ts +27 -0
- package/dist/features/background-agent/manager.d.ts +3 -0
- package/dist/features/background-agent/types.d.ts +14 -0
- package/dist/features/task-toast-manager/manager.d.ts +5 -1
- package/dist/hooks/runtime-fallback/index.d.ts +23 -0
- package/dist/hooks/runtime-fallback/index.test.d.ts +1 -0
- package/dist/index.js +1116 -420
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/provider-error-classifier.d.ts +23 -0
- package/dist/shared/provider-error-classifier.test.d.ts +1 -0
- package/dist/shared/retry-strategy.d.ts +39 -0
- package/dist/shared/retry-strategy.test.d.ts +1 -0
- package/dist/shared/runtime-fallback.d.ts +46 -0
- package/dist/shared/runtime-fallback.test.d.ts +1 -0
- package/dist/shared/windows-reserved-names.d.ts +8 -0
- package/package.json +1 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { FallbackAttempt } from "../../shared/runtime-fallback";
|
|
2
|
+
export type { FallbackAttempt };
|
|
1
3
|
export type BackgroundTaskStatus = "pending" | "running" | "completed" | "error" | "cancelled";
|
|
2
4
|
export interface PhaseTiming {
|
|
3
5
|
/** queuedAt -> startedAt in ms */
|
|
@@ -20,6 +22,8 @@ export interface TaskProgress {
|
|
|
20
22
|
lastMessage?: string;
|
|
21
23
|
lastMessageAt?: Date;
|
|
22
24
|
phaseTiming?: PhaseTiming;
|
|
25
|
+
/** Timestamp when the current LLM step started (reset on each session.idle) */
|
|
26
|
+
stepStartedAt?: number;
|
|
23
27
|
}
|
|
24
28
|
export interface BackgroundTask {
|
|
25
29
|
id: string;
|
|
@@ -55,6 +59,16 @@ export interface BackgroundTask {
|
|
|
55
59
|
lastMsgCount?: number;
|
|
56
60
|
/** Number of consecutive polls with stable message count */
|
|
57
61
|
stablePolls?: number;
|
|
62
|
+
/** Step count (incremented on session.idle events) */
|
|
63
|
+
stepCount?: number;
|
|
64
|
+
/** Max steps before auto-completion (0 = unlimited) */
|
|
65
|
+
maxSteps?: number;
|
|
66
|
+
/** Max runtime in ms before auto-completion (0 / undefined = unlimited, uses TASK_TTL_MS) */
|
|
67
|
+
maxRuntimeMs?: number;
|
|
68
|
+
/** Max duration of a single step in ms (0 / undefined = unlimited) */
|
|
69
|
+
stepTimeoutMs?: number;
|
|
70
|
+
/** Fallback attempts history */
|
|
71
|
+
attempts?: FallbackAttempt[];
|
|
58
72
|
}
|
|
59
73
|
export interface LaunchInput {
|
|
60
74
|
description: string;
|
|
@@ -6,6 +6,9 @@ export declare class TaskToastManager {
|
|
|
6
6
|
private tasks;
|
|
7
7
|
private client;
|
|
8
8
|
private concurrencyManager?;
|
|
9
|
+
private completionBatch;
|
|
10
|
+
private completionDebounceTimer?;
|
|
11
|
+
private static COMPLETION_DEBOUNCE_MS;
|
|
9
12
|
constructor(client: OpencodeClient, concurrencyManager?: ConcurrencyManager);
|
|
10
13
|
setConcurrencyManager(manager: ConcurrencyManager): void;
|
|
11
14
|
addTask(task: {
|
|
@@ -45,13 +48,14 @@ export declare class TaskToastManager {
|
|
|
45
48
|
*/
|
|
46
49
|
private showTaskListToast;
|
|
47
50
|
/**
|
|
48
|
-
* Show task completion toast
|
|
51
|
+
* Show task completion toast with debounce to batch rapid completions.
|
|
49
52
|
*/
|
|
50
53
|
showCompletionToast(task: {
|
|
51
54
|
id: string;
|
|
52
55
|
description: string;
|
|
53
56
|
duration: string;
|
|
54
57
|
}): void;
|
|
58
|
+
private flushCompletionBatch;
|
|
55
59
|
}
|
|
56
60
|
export declare function getTaskToastManager(): TaskToastManager | null;
|
|
57
61
|
export declare function initTaskToastManager(client: OpencodeClient, concurrencyManager?: ConcurrencyManager): TaskToastManager;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime Fallback Hook
|
|
3
|
+
*
|
|
4
|
+
* 处理 session.error 事件中的 provider 错误(quota、rate_limit),
|
|
5
|
+
* 在 retry 耗尽后自动切换到 fallback 模型。
|
|
6
|
+
*
|
|
7
|
+
* 不处理:context_overflow(由 context-window-recovery 处理)、auth、bad_request。
|
|
8
|
+
* 避让 sessionRecovery(可恢复错误优先由 sessionRecovery 处理)。
|
|
9
|
+
*/
|
|
10
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
11
|
+
export interface RuntimeFallbackOptions {
|
|
12
|
+
sessionRecovery?: {
|
|
13
|
+
isRecoverableError: (error: unknown) => boolean;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare function createRuntimeFallbackHook(ctx: PluginInput, options?: RuntimeFallbackOptions): {
|
|
17
|
+
handler: ({ event, }: {
|
|
18
|
+
event: {
|
|
19
|
+
type: string;
|
|
20
|
+
properties?: unknown;
|
|
21
|
+
};
|
|
22
|
+
}) => Promise<boolean>;
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|