evil-omo 3.17.6 → 3.17.10
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/cli/index.js +21 -19
- package/dist/features/background-agent/attempt-lifecycle.d.ts +12 -0
- package/dist/features/background-agent/background-task-notification-template.d.ts +2 -1
- package/dist/features/background-agent/constants.d.ts +1 -0
- package/dist/features/background-agent/fallback-retry-handler.d.ts +8 -0
- package/dist/features/background-agent/manager.d.ts +9 -0
- package/dist/features/background-agent/types.d.ts +24 -0
- package/dist/hooks/model-fallback/controller-accessor.d.ts +1 -0
- package/dist/hooks/model-fallback/fallback-state-controller.d.ts +1 -0
- package/dist/hooks/model-fallback/hook.d.ts +2 -1
- package/dist/hooks/preemptive-compaction-degradation-monitor.d.ts +1 -0
- package/dist/hooks/preemptive-compaction-no-text-tail.d.ts +1 -0
- package/dist/index.js +990 -326
- package/dist/plugin/event.d.ts +1 -0
- package/dist/shared/dynamic-truncator.d.ts +9 -10
- package/dist/shared/model-error-classifier.d.ts +2 -2
- package/dist/tools/background-task/clients.d.ts +1 -0
- package/dist/tools/delegate-task/builtin-categories.d.ts +1 -0
- package/dist/tools/delegate-task/builtin-category-definition.d.ts +1 -0
- package/dist/tools/delegate-task/constants.d.ts +1 -1
- package/dist/tools/delegate-task/executor-types.d.ts +1 -0
- package/dist/tools/delegate-task/openai-categories.d.ts +3 -0
- package/dist/tools/delegate-task/sync-task-fallback.d.ts +3 -0
- package/package.json +12 -12
package/dist/cli/index.js
CHANGED
|
@@ -6018,8 +6018,10 @@ function normalizeSDKResponse(response, fallback, options) {
|
|
|
6018
6018
|
}
|
|
6019
6019
|
|
|
6020
6020
|
// src/shared/dynamic-truncator.ts
|
|
6021
|
+
var usageCacheByClient;
|
|
6021
6022
|
var init_dynamic_truncator = __esm(() => {
|
|
6022
6023
|
init_context_limit_resolver();
|
|
6024
|
+
usageCacheByClient = new WeakMap;
|
|
6023
6025
|
});
|
|
6024
6026
|
|
|
6025
6027
|
// src/shared/data-path.ts
|
|
@@ -53058,13 +53060,6 @@ function readPackageVersion(packageJsonPath) {
|
|
|
53058
53060
|
return pkg.version ?? null;
|
|
53059
53061
|
}
|
|
53060
53062
|
function getCachedVersion() {
|
|
53061
|
-
for (const candidate of INSTALLED_PACKAGE_JSON_CANDIDATES) {
|
|
53062
|
-
try {
|
|
53063
|
-
if (fs9.existsSync(candidate)) {
|
|
53064
|
-
return readPackageVersion(candidate);
|
|
53065
|
-
}
|
|
53066
|
-
} catch {}
|
|
53067
|
-
}
|
|
53068
53063
|
try {
|
|
53069
53064
|
const currentDir = path9.dirname(fileURLToPath2(import.meta.url));
|
|
53070
53065
|
const pkgPath = findPackageJsonUp(currentDir);
|
|
@@ -53074,6 +53069,13 @@ function getCachedVersion() {
|
|
|
53074
53069
|
} catch (err) {
|
|
53075
53070
|
log("[auto-update-checker] Failed to resolve version from current directory:", err);
|
|
53076
53071
|
}
|
|
53072
|
+
for (const candidate of INSTALLED_PACKAGE_JSON_CANDIDATES) {
|
|
53073
|
+
try {
|
|
53074
|
+
if (fs9.existsSync(candidate)) {
|
|
53075
|
+
return readPackageVersion(candidate);
|
|
53076
|
+
}
|
|
53077
|
+
} catch {}
|
|
53078
|
+
}
|
|
53077
53079
|
try {
|
|
53078
53080
|
const execDir = path9.dirname(fs9.realpathSync(process.execPath));
|
|
53079
53081
|
const pkgPath = findPackageJsonUp(execDir);
|
|
@@ -53858,7 +53860,7 @@ var {
|
|
|
53858
53860
|
// package.json
|
|
53859
53861
|
var package_default = {
|
|
53860
53862
|
name: "evil-omo",
|
|
53861
|
-
version: "3.17.
|
|
53863
|
+
version: "3.17.10",
|
|
53862
53864
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
53863
53865
|
main: "./dist/index.js",
|
|
53864
53866
|
types: "dist/index.d.ts",
|
|
@@ -53937,17 +53939,17 @@ var package_default = {
|
|
|
53937
53939
|
zod: "^4.3.0"
|
|
53938
53940
|
},
|
|
53939
53941
|
optionalDependencies: {
|
|
53940
|
-
"evil-omo-darwin-arm64": "3.17.
|
|
53941
|
-
"evil-omo-darwin-x64": "3.17.
|
|
53942
|
-
"evil-omo-darwin-x64-baseline": "3.17.
|
|
53943
|
-
"evil-omo-linux-x64": "3.17.
|
|
53944
|
-
"evil-omo-linux-x64-baseline": "3.17.
|
|
53945
|
-
"evil-omo-linux-arm64": "3.17.
|
|
53946
|
-
"evil-omo-linux-x64-musl": "3.17.
|
|
53947
|
-
"evil-omo-linux-x64-musl-baseline": "3.17.
|
|
53948
|
-
"evil-omo-linux-arm64-musl": "3.17.
|
|
53949
|
-
"evil-omo-windows-x64": "3.17.
|
|
53950
|
-
"evil-omo-windows-x64-baseline": "3.17.
|
|
53942
|
+
"evil-omo-darwin-arm64": "3.17.10",
|
|
53943
|
+
"evil-omo-darwin-x64": "3.17.10",
|
|
53944
|
+
"evil-omo-darwin-x64-baseline": "3.17.10",
|
|
53945
|
+
"evil-omo-linux-x64": "3.17.10",
|
|
53946
|
+
"evil-omo-linux-x64-baseline": "3.17.10",
|
|
53947
|
+
"evil-omo-linux-arm64": "3.17.10",
|
|
53948
|
+
"evil-omo-linux-x64-musl": "3.17.10",
|
|
53949
|
+
"evil-omo-linux-x64-musl-baseline": "3.17.10",
|
|
53950
|
+
"evil-omo-linux-arm64-musl": "3.17.10",
|
|
53951
|
+
"evil-omo-windows-x64": "3.17.10",
|
|
53952
|
+
"evil-omo-windows-x64-baseline": "3.17.10"
|
|
53951
53953
|
},
|
|
53952
53954
|
overrides: {},
|
|
53953
53955
|
trustedDependencies: [
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DelegatedModelConfig } from "../../shared/model-resolution-types";
|
|
2
|
+
import type { BackgroundTask, BackgroundTaskAttempt, BackgroundTaskStatus } from "./types";
|
|
3
|
+
type TerminalAttemptStatus = Extract<BackgroundTaskStatus, "completed" | "error" | "cancelled" | "interrupt">;
|
|
4
|
+
export declare function getCurrentAttempt(task: BackgroundTask): BackgroundTaskAttempt | undefined;
|
|
5
|
+
export declare function ensureCurrentAttempt(task: BackgroundTask, model?: DelegatedModelConfig | undefined): BackgroundTaskAttempt;
|
|
6
|
+
export declare function projectTaskFromCurrentAttempt(task: BackgroundTask): BackgroundTask;
|
|
7
|
+
export declare function startAttempt(task: BackgroundTask, model: DelegatedModelConfig | undefined): BackgroundTaskAttempt;
|
|
8
|
+
export declare function bindAttemptSession(task: BackgroundTask, attemptID: string, sessionID: string, model: DelegatedModelConfig | undefined): BackgroundTaskAttempt | undefined;
|
|
9
|
+
export declare function finalizeAttempt(task: BackgroundTask, attemptID: string, status: TerminalAttemptStatus, error?: string): BackgroundTaskAttempt | undefined;
|
|
10
|
+
export declare function scheduleRetryAttempt(task: BackgroundTask, failedAttemptID: string, nextModel: DelegatedModelConfig, error?: string): BackgroundTaskAttempt | undefined;
|
|
11
|
+
export declare function findAttemptBySession(task: BackgroundTask, sessionID: string): BackgroundTaskAttempt | undefined;
|
|
12
|
+
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { BackgroundTaskStatus } from "./types";
|
|
1
|
+
import type { BackgroundTaskAttempt, BackgroundTaskStatus } from "./types";
|
|
2
2
|
export type BackgroundTaskNotificationStatus = "COMPLETED" | "CANCELLED" | "INTERRUPTED" | "ERROR";
|
|
3
3
|
export interface BackgroundTaskNotificationTask {
|
|
4
4
|
id: string;
|
|
5
5
|
description: string;
|
|
6
6
|
status: BackgroundTaskStatus;
|
|
7
7
|
error?: string;
|
|
8
|
+
attempts?: BackgroundTaskAttempt[];
|
|
8
9
|
}
|
|
9
10
|
export declare function buildBackgroundTaskNotificationText(input: {
|
|
10
11
|
task: BackgroundTaskNotificationTask;
|
|
@@ -13,4 +13,12 @@ export declare function tryFallbackRetry(args: {
|
|
|
13
13
|
idleDeferralTimers: Map<string, ReturnType<typeof setTimeout>>;
|
|
14
14
|
queuesByKey: Map<string, QueueItem[]>;
|
|
15
15
|
processKey: (key: string) => void;
|
|
16
|
+
onRetrying?: (details: {
|
|
17
|
+
task: BackgroundTask;
|
|
18
|
+
source: string;
|
|
19
|
+
previousSessionID?: string;
|
|
20
|
+
failedModel?: string;
|
|
21
|
+
failedError?: string;
|
|
22
|
+
nextModel: string;
|
|
23
|
+
}) => void;
|
|
16
24
|
}): Promise<boolean>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import type { ModelFallbackControllerAccessor } from "../../hooks/model-fallback";
|
|
2
3
|
import type { BackgroundTask, LaunchInput, ResumeInput } from "./types";
|
|
3
4
|
import { TaskHistory } from "./task-history";
|
|
4
5
|
import type { BackgroundTaskConfig, TmuxConfig } from "../../config/schema";
|
|
@@ -22,6 +23,7 @@ export interface SubagentSessionCreatedEvent {
|
|
|
22
23
|
export type OnSubagentSessionCreated = (event: SubagentSessionCreatedEvent) => Promise<void>;
|
|
23
24
|
export declare class BackgroundManager {
|
|
24
25
|
private tasks;
|
|
26
|
+
private tasksByParentSession;
|
|
25
27
|
private notifications;
|
|
26
28
|
private pendingNotifications;
|
|
27
29
|
private pendingByParent;
|
|
@@ -46,6 +48,7 @@ export declare class BackgroundManager {
|
|
|
46
48
|
private rootDescendantCounts;
|
|
47
49
|
private preStartDescendantReservations;
|
|
48
50
|
private enableParentSessionNotifications;
|
|
51
|
+
private modelFallbackControllerAccessor?;
|
|
49
52
|
readonly taskHistory: TaskHistory;
|
|
50
53
|
private cachedCircuitBreakerSettings?;
|
|
51
54
|
constructor(ctx: PluginInput, config?: BackgroundTaskConfig, options?: {
|
|
@@ -53,6 +56,7 @@ export declare class BackgroundManager {
|
|
|
53
56
|
onSubagentSessionCreated?: OnSubagentSessionCreated;
|
|
54
57
|
onShutdown?: () => void | Promise<void>;
|
|
55
58
|
enableParentSessionNotifications?: boolean;
|
|
59
|
+
modelFallbackControllerAccessor?: ModelFallbackControllerAccessor;
|
|
56
60
|
});
|
|
57
61
|
private abortSessionWithLogging;
|
|
58
62
|
assertCanSpawn(parentSessionID: string): Promise<SubagentSpawnContext>;
|
|
@@ -67,6 +71,10 @@ export declare class BackgroundManager {
|
|
|
67
71
|
private markPreStartDescendantReservation;
|
|
68
72
|
private settlePreStartDescendantReservation;
|
|
69
73
|
private rollbackPreStartDescendantReservation;
|
|
74
|
+
private addTask;
|
|
75
|
+
private removeTask;
|
|
76
|
+
private updateTaskParent;
|
|
77
|
+
private removeTaskFromParentIndex;
|
|
70
78
|
launch(input: LaunchInput): Promise<BackgroundTask>;
|
|
71
79
|
private processKey;
|
|
72
80
|
private startTask;
|
|
@@ -74,6 +82,7 @@ export declare class BackgroundManager {
|
|
|
74
82
|
getTasksByParentSession(sessionID: string): BackgroundTask[];
|
|
75
83
|
getAllDescendantTasks(sessionID: string): BackgroundTask[];
|
|
76
84
|
findBySession(sessionID: string): BackgroundTask | undefined;
|
|
85
|
+
private resolveTaskAttemptBySession;
|
|
77
86
|
private getConcurrencyKeyFromInput;
|
|
78
87
|
/**
|
|
79
88
|
* Track a task created elsewhere (e.g., from task) for notification tracking.
|
|
@@ -16,6 +16,19 @@ export interface TaskProgress {
|
|
|
16
16
|
lastMessage?: string;
|
|
17
17
|
lastMessageAt?: Date;
|
|
18
18
|
}
|
|
19
|
+
export type BackgroundTaskAttemptStatus = BackgroundTaskStatus;
|
|
20
|
+
export interface BackgroundTaskAttempt {
|
|
21
|
+
attemptID: string;
|
|
22
|
+
attemptNumber: number;
|
|
23
|
+
sessionID?: string;
|
|
24
|
+
providerID?: string;
|
|
25
|
+
modelID?: string;
|
|
26
|
+
variant?: string;
|
|
27
|
+
status: BackgroundTaskAttemptStatus;
|
|
28
|
+
error?: string;
|
|
29
|
+
startedAt?: Date;
|
|
30
|
+
completedAt?: Date;
|
|
31
|
+
}
|
|
19
32
|
export interface BackgroundTask {
|
|
20
33
|
id: string;
|
|
21
34
|
sessionID?: string;
|
|
@@ -54,6 +67,17 @@ export interface BackgroundTask {
|
|
|
54
67
|
isUnstableAgent?: boolean;
|
|
55
68
|
/** Category used for this task (e.g., 'quick', 'visual-engineering') */
|
|
56
69
|
category?: string;
|
|
70
|
+
/** Pending retry notification details for the next spawned retry session */
|
|
71
|
+
retryNotification?: {
|
|
72
|
+
previousSessionID?: string;
|
|
73
|
+
failedModel?: string;
|
|
74
|
+
failedError?: string;
|
|
75
|
+
nextModel: string;
|
|
76
|
+
};
|
|
77
|
+
/** Structured attempt history for retry observability */
|
|
78
|
+
attempts?: BackgroundTaskAttempt[];
|
|
79
|
+
/** ID of the currently active attempt */
|
|
80
|
+
currentAttemptID?: string;
|
|
57
81
|
/** Last message count for stability detection */
|
|
58
82
|
lastMsgCount?: number;
|
|
59
83
|
/** Number of consecutive polls with stable message count */
|
|
@@ -3,6 +3,7 @@ import type { ModelFallbackStateController } from "./fallback-state-controller";
|
|
|
3
3
|
export type ModelFallbackControllerAccessor = {
|
|
4
4
|
register: (controller: ModelFallbackStateController) => void;
|
|
5
5
|
setSessionFallbackChain: (sessionID: string, fallbackChain: FallbackEntry[] | undefined) => void;
|
|
6
|
+
getSessionFallbackChain: (sessionID: string) => FallbackEntry[] | undefined;
|
|
6
7
|
clearSessionFallbackChain: (sessionID: string) => void;
|
|
7
8
|
};
|
|
8
9
|
export declare function createModelFallbackControllerAccessor(): ModelFallbackControllerAccessor;
|
|
@@ -10,6 +10,7 @@ type ModelFallbackStateLike = {
|
|
|
10
10
|
export type ModelFallbackStateController = {
|
|
11
11
|
lastToastKey: Map<string, string>;
|
|
12
12
|
setSessionFallbackChain: (sessionID: string, fallbackChain: FallbackEntry[] | undefined) => void;
|
|
13
|
+
getSessionFallbackChain: (sessionID: string) => FallbackEntry[] | undefined;
|
|
13
14
|
clearSessionFallbackChain: (sessionID: string) => void;
|
|
14
15
|
setPendingModelFallback: (sessionID: string, agentName: string, currentProviderID: string, currentModelID: string) => boolean;
|
|
15
16
|
getNextFallback: (sessionID: string) => ReturnType<typeof getNextReachableFallback>;
|
|
@@ -21,7 +21,7 @@ export type ModelFallbackState = {
|
|
|
21
21
|
attemptCount: number;
|
|
22
22
|
pending: boolean;
|
|
23
23
|
};
|
|
24
|
-
type ModelFallbackControllerWithState = Pick<ModelFallbackStateController, "lastToastKey" | "setSessionFallbackChain" | "clearSessionFallbackChain" | "setPendingModelFallback" | "getNextFallback" | "clearPendingModelFallback" | "hasPendingModelFallback" | "getFallbackState" | "reset">;
|
|
24
|
+
type ModelFallbackControllerWithState = Pick<ModelFallbackStateController, "lastToastKey" | "setSessionFallbackChain" | "getSessionFallbackChain" | "clearSessionFallbackChain" | "setPendingModelFallback" | "getNextFallback" | "clearPendingModelFallback" | "hasPendingModelFallback" | "getFallbackState" | "reset">;
|
|
25
25
|
export type ModelFallbackHook = ModelFallbackControllerWithState & {
|
|
26
26
|
"chat.message": (input: ChatMessageInput, output: ChatMessageHandlerOutput) => Promise<void>;
|
|
27
27
|
};
|
|
@@ -32,6 +32,7 @@ type ModelFallbackHookArgs = {
|
|
|
32
32
|
};
|
|
33
33
|
export declare function setSessionFallbackChain(controller: Pick<ModelFallbackStateController, "setSessionFallbackChain">, sessionID: string, fallbackChain: FallbackEntry[] | undefined): void;
|
|
34
34
|
export declare function clearSessionFallbackChain(controller: Pick<ModelFallbackStateController, "clearSessionFallbackChain">, sessionID: string): void;
|
|
35
|
+
export declare function getSessionFallbackChain(controller: Pick<ModelFallbackStateController, "getSessionFallbackChain">, sessionID: string): FallbackEntry[] | undefined;
|
|
35
36
|
/**
|
|
36
37
|
* Sets a pending model fallback for a session.
|
|
37
38
|
* Called when a model error is detected in session.error handler.
|