@wolfx/oh-my-openagent 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/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/features/team-mode/types.d.ts +1 -1
- package/dist/hooks/auto-update-checker/hook/background-update-check.d.ts +1 -1
- 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 +1433 -5528
- package/dist/plugin/event.d.ts +1 -0
- package/dist/{cli/config-manager → shared}/config-context.d.ts +1 -1
- 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 +8 -8
- package/dist/cli/cli-installer.d.ts +0 -2
- package/dist/cli/cli-program.d.ts +0 -1
- package/dist/cli/config-manager/add-plugin-to-opencode-config.d.ts +0 -2
- package/dist/cli/config-manager/backup-config.d.ts +0 -6
- package/dist/cli/config-manager/deep-merge-record.d.ts +0 -1
- package/dist/cli/config-manager/detect-current-config.d.ts +0 -2
- package/dist/cli/config-manager/ensure-config-directory-exists.d.ts +0 -1
- package/dist/cli/config-manager/format-error-with-suggestion.d.ts +0 -1
- package/dist/cli/config-manager/generate-omo-config.d.ts +0 -2
- package/dist/cli/config-manager/npm-dist-tags.d.ts +0 -7
- package/dist/cli/config-manager/opencode-binary.d.ts +0 -2
- package/dist/cli/config-manager/opencode-config-format.d.ts +0 -5
- package/dist/cli/config-manager/parse-opencode-config-file.d.ts +0 -10
- package/dist/cli/config-manager/plugin-name-with-version.d.ts +0 -1
- package/dist/cli/config-manager/version-compatibility.d.ts +0 -9
- package/dist/cli/config-manager/write-omo-config.d.ts +0 -2
- package/dist/cli/config-manager.d.ts +0 -15
- package/dist/cli/doctor/checks/config.d.ts +0 -2
- package/dist/cli/doctor/checks/dependencies.d.ts +0 -4
- package/dist/cli/doctor/checks/index.d.ts +0 -7
- package/dist/cli/doctor/checks/model-resolution-cache.d.ts +0 -2
- package/dist/cli/doctor/checks/model-resolution-config.d.ts +0 -2
- package/dist/cli/doctor/checks/model-resolution-details.d.ts +0 -6
- package/dist/cli/doctor/checks/model-resolution-effective-model.d.ts +0 -3
- package/dist/cli/doctor/checks/model-resolution-types.d.ts +0 -40
- package/dist/cli/doctor/checks/model-resolution-variant.d.ts +0 -5
- package/dist/cli/doctor/checks/model-resolution.d.ts +0 -11
- package/dist/cli/doctor/checks/system-binary.d.ts +0 -13
- package/dist/cli/doctor/checks/system-loaded-version.d.ts +0 -10
- package/dist/cli/doctor/checks/system-plugin.d.ts +0 -15
- package/dist/cli/doctor/checks/system.d.ts +0 -16
- package/dist/cli/doctor/checks/tools-gh.d.ts +0 -10
- package/dist/cli/doctor/checks/tools-lsp.d.ts +0 -4
- package/dist/cli/doctor/checks/tools-mcp.d.ts +0 -3
- package/dist/cli/doctor/checks/tools.d.ts +0 -3
- package/dist/cli/doctor/constants.d.ts +0 -29
- package/dist/cli/doctor/format-default.d.ts +0 -2
- package/dist/cli/doctor/format-shared.d.ts +0 -6
- package/dist/cli/doctor/format-status.d.ts +0 -2
- package/dist/cli/doctor/format-verbose.d.ts +0 -2
- package/dist/cli/doctor/formatter.d.ts +0 -3
- package/dist/cli/doctor/index.d.ts +0 -5
- package/dist/cli/doctor/runner.d.ts +0 -5
- package/dist/cli/doctor/spawn-with-timeout.d.ts +0 -8
- package/dist/cli/doctor/types.d.ts +0 -120
- package/dist/cli/fallback-chain-resolution.d.ts +0 -10
- package/dist/cli/get-local-version/formatter.d.ts +0 -3
- package/dist/cli/get-local-version/get-local-version.d.ts +0 -2
- package/dist/cli/get-local-version/index.d.ts +0 -2
- package/dist/cli/get-local-version/types.d.ts +0 -13
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/install-validators.d.ts +0 -34
- package/dist/cli/install.d.ts +0 -2
- package/dist/cli/mcp-oauth/index.d.ts +0 -6
- package/dist/cli/mcp-oauth/login.d.ts +0 -11
- package/dist/cli/mcp-oauth/logout.d.ts +0 -4
- package/dist/cli/mcp-oauth/status.d.ts +0 -1
- package/dist/cli/minimum-opencode-version.d.ts +0 -1
- package/dist/cli/model-fallback-requirements.d.ts +0 -3
- package/dist/cli/model-fallback-types.d.ts +0 -31
- package/dist/cli/model-fallback.d.ts +0 -5
- package/dist/cli/openai-only-model-catalog.d.ts +0 -3
- package/dist/cli/provider-availability.d.ts +0 -4
- package/dist/cli/provider-model-id-transform.d.ts +0 -1
- package/dist/cli/refresh-model-capabilities.d.ts +0 -15
- package/dist/cli/run/agent-profile-colors.d.ts +0 -2
- package/dist/cli/run/agent-resolver.d.ts +0 -5
- package/dist/cli/run/completion.d.ts +0 -2
- package/dist/cli/run/continuation-state.d.ts +0 -10
- package/dist/cli/run/display-chars.d.ts +0 -5
- package/dist/cli/run/event-formatting.d.ts +0 -3
- package/dist/cli/run/event-handlers.d.ts +0 -11
- package/dist/cli/run/event-state.d.ts +0 -47
- package/dist/cli/run/event-stream-processor.d.ts +0 -3
- package/dist/cli/run/events.d.ts +0 -4
- package/dist/cli/run/index.d.ts +0 -10
- package/dist/cli/run/json-output.d.ts +0 -12
- package/dist/cli/run/model-resolver.d.ts +0 -4
- package/dist/cli/run/on-complete-hook.d.ts +0 -7
- package/dist/cli/run/opencode-binary-resolver.d.ts +0 -5
- package/dist/cli/run/output-renderer.d.ts +0 -7
- package/dist/cli/run/poll-for-completion.d.ts +0 -10
- package/dist/cli/run/runner.d.ts +0 -5
- package/dist/cli/run/server-connection.d.ts +0 -6
- package/dist/cli/run/session-resolver.d.ts +0 -6
- package/dist/cli/run/stdin-suppression.d.ts +0 -12
- package/dist/cli/run/timestamp-output.d.ts +0 -5
- package/dist/cli/run/tool-input-preview.d.ts +0 -6
- package/dist/cli/run/types.d.ts +0 -131
- package/dist/cli/tui-install-prompts.d.ts +0 -2
- package/dist/cli/tui-installer.d.ts +0 -2
- package/dist/cli/types.d.ts +0 -46
- package/dist/shared/posthog-activity-state.d.ts +0 -11
- package/dist/shared/posthog.d.ts +0 -19
- /package/dist/{cli/config-manager → shared}/bun-install.d.ts +0 -0
|
@@ -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 */
|
|
@@ -175,8 +175,8 @@ export declare const RuntimeStateSchema: z.ZodObject<{
|
|
|
175
175
|
completed: "completed";
|
|
176
176
|
running: "running";
|
|
177
177
|
idle: "idle";
|
|
178
|
-
errored: "errored";
|
|
179
178
|
shutdown_approved: "shutdown_approved";
|
|
179
|
+
errored: "errored";
|
|
180
180
|
}>;
|
|
181
181
|
color: z.ZodOptional<z.ZodString>;
|
|
182
182
|
worktreePath: z.ZodOptional<z.ZodString>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
-
import { runBunInstallWithDetails } from "../../../
|
|
4
|
+
import { runBunInstallWithDetails } from "../../../shared/bun-install";
|
|
5
5
|
import { log } from "../../../shared/logger";
|
|
6
6
|
import { getOpenCodeCacheDir, getOpenCodeConfigPaths } from "../../../shared";
|
|
7
7
|
import { invalidatePackage } from "../cache";
|
|
@@ -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.
|