opencode-orchestrator 1.2.21 → 1.2.23
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.md +41 -91
- package/dist/core/agents/adaptive-concurrency.d.ts +57 -0
- package/dist/core/agents/index.d.ts +3 -2
- package/dist/core/agents/interfaces/session-pool.interface.d.ts +7 -0
- package/dist/core/agents/manager.d.ts +8 -36
- package/dist/core/agents/session-pool.d.ts +5 -0
- package/dist/core/agents/unified-task-executor.d.ts +10 -92
- package/dist/core/mission/mission-controller.d.ts +53 -0
- package/dist/core/resource/resource-tracker.d.ts +61 -0
- package/dist/index.d.ts +0 -8
- package/dist/index.js +6533 -27677
- package/dist/shared/constants/system-messages.d.ts +3 -3
- package/dist/shared/core/constants/index.d.ts +4 -0
- package/dist/shared/core/constants/labels.d.ts +12 -0
- package/dist/shared/core/constants/mission.d.ts +8 -0
- package/dist/shared/{os/constants/platform.d.ts → core/constants/os.d.ts} +4 -3
- package/dist/shared/core/constants/signals.d.ts +22 -0
- package/dist/shared/index.d.ts +6 -8
- package/dist/shared/prompt/constants/prompts.d.ts +7 -0
- package/dist/shared/prompt/constants/tags.d.ts +4 -0
- package/dist/shared/prompt/index.d.ts +1 -0
- package/dist/shared/session/constants/index.d.ts +2 -0
- package/dist/shared/session/constants/message.d.ts +15 -0
- package/dist/shared/session/constants/status.d.ts +9 -0
- package/dist/shared/session/index.d.ts +1 -0
- package/dist/tools/parallel/list-agents.d.ts +1 -1
- package/dist/utils/common.d.ts +3 -5
- package/package.json +3 -3
- package/dist/core/agents/agent-registry.d.ts +0 -28
- package/dist/core/agents/concurrency.d.ts +0 -41
- package/dist/core/agents/config.d.ts +0 -10
- package/dist/core/agents/consts/index.d.ts +0 -4
- package/dist/core/agents/manager/event-handler.d.ts +0 -35
- package/dist/core/agents/manager/index.d.ts +0 -10
- package/dist/core/agents/manager/task-cleaner.d.ts +0 -29
- package/dist/core/agents/manager/task-launcher.d.ts +0 -35
- package/dist/core/agents/manager/task-poller.d.ts +0 -30
- package/dist/core/agents/manager/task-resumer.d.ts +0 -18
- package/dist/core/agents/persistence/task-wal.d.ts +0 -26
- package/dist/core/agents/task-store.d.ts +0 -54
- package/dist/core/cleanup/cleanup-scheduler.d.ts +0 -11
- package/dist/core/context/context-window-monitor.d.ts +0 -66
- package/dist/core/context/index.d.ts +0 -6
- package/dist/core/loop/continuation-lock.d.ts +0 -57
- package/dist/core/loop/formatters.d.ts +0 -17
- package/dist/core/loop/interfaces/index.d.ts +0 -5
- package/dist/core/loop/interfaces/todo-stats.d.ts +0 -11
- package/dist/core/loop/interfaces/todo.d.ts +0 -13
- package/dist/core/loop/interfaces.d.ts +0 -7
- package/dist/core/loop/mission-loop-handler.d.ts +0 -25
- package/dist/core/loop/mission-loop.d.ts +0 -48
- package/dist/core/loop/parser.d.ts +0 -8
- package/dist/core/loop/stats.d.ts +0 -24
- package/dist/core/loop/todo-continuation.d.ts +0 -39
- package/dist/core/loop/todo-enforcer.d.ts +0 -9
- package/dist/core/loop/todo-manager.d.ts +0 -22
- package/dist/core/loop/types/index.d.ts +0 -5
- package/dist/core/loop/types/todo-priority.d.ts +0 -4
- package/dist/core/loop/types/todo-status.d.ts +0 -4
- package/dist/core/loop/verification.d.ts +0 -27
- package/dist/core/memory/interfaces.d.ts +0 -33
- package/dist/core/memory/memory-manager.d.ts +0 -40
- package/dist/core/metrics/collector.d.ts +0 -27
- package/dist/core/notification/os-notify/index.d.ts +0 -7
- package/dist/core/notification/os-notify/notifier.d.ts +0 -7
- package/dist/core/notification/os-notify/platform-resolver.d.ts +0 -7
- package/dist/core/notification/os-notify/platform.d.ts +0 -7
- package/dist/core/notification/os-notify/sound-player.d.ts +0 -7
- package/dist/core/notification/os-notify/todo-checker.d.ts +0 -5
- package/dist/core/notification/task-toast-manager.d.ts +0 -127
- package/dist/core/notification/toast-core.d.ts +0 -36
- package/dist/core/notification/toast.d.ts +0 -9
- package/dist/core/orchestrator/index.d.ts +0 -6
- package/dist/core/orchestrator/interfaces/index.d.ts +0 -4
- package/dist/core/orchestrator/interfaces/session-state.d.ts +0 -11
- package/dist/core/orchestrator/session-manager.d.ts +0 -31
- package/dist/core/orchestrator/state.d.ts +0 -10
- package/dist/core/orchestrator/types/index.d.ts +0 -4
- package/dist/core/orchestrator/types/task-status.d.ts +0 -5
- package/dist/core/plugins/interfaces.d.ts +0 -30
- package/dist/core/plugins/plugin-manager.d.ts +0 -21
- package/dist/core/progress/calculator.d.ts +0 -11
- package/dist/core/progress/formatters.d.ts +0 -20
- package/dist/core/progress/interfaces/index.d.ts +0 -8
- package/dist/core/progress/interfaces/progress-snapshot.d.ts +0 -15
- package/dist/core/progress/interfaces/snapshot-input.d.ts +0 -13
- package/dist/core/progress/interfaces/step-progress.d.ts +0 -7
- package/dist/core/progress/interfaces/task-progress.d.ts +0 -10
- package/dist/core/progress/interfaces/todo-progress.d.ts +0 -9
- package/dist/core/progress/interfaces.d.ts +0 -6
- package/dist/core/progress/progress-notifier.d.ts +0 -14
- package/dist/core/progress/state-broadcaster.d.ts +0 -29
- package/dist/core/progress/store.d.ts +0 -28
- package/dist/core/progress/tracker.d.ts +0 -11
- package/dist/core/queue/async-queue.d.ts +0 -46
- package/dist/core/queue/async-utils.d.ts +0 -20
- package/dist/core/queue/index.d.ts +0 -8
- package/dist/core/queue/work-pool.d.ts +0 -19
- package/dist/core/recovery/auto-recovery.d.ts +0 -9
- package/dist/core/recovery/constants.d.ts +0 -9
- package/dist/core/recovery/handler.d.ts +0 -27
- package/dist/core/recovery/interfaces/error-context.d.ts +0 -11
- package/dist/core/recovery/interfaces/error-pattern.d.ts +0 -10
- package/dist/core/recovery/interfaces/index.d.ts +0 -8
- package/dist/core/recovery/interfaces/recovery-action.d.ts +0 -25
- package/dist/core/recovery/interfaces/recovery-record.d.ts +0 -10
- package/dist/core/recovery/interfaces/recovery-stats.d.ts +0 -9
- package/dist/core/recovery/interfaces.d.ts +0 -6
- package/dist/core/recovery/patterns.d.ts +0 -8
- package/dist/core/recovery/retry.d.ts +0 -59
- package/dist/core/recovery/session-recovery.d.ts +0 -30
- package/dist/core/session/interfaces/context-stats.d.ts +0 -9
- package/dist/core/session/interfaces/index.d.ts +0 -8
- package/dist/core/session/interfaces/shared-context.d.ts +0 -15
- package/dist/core/session/interfaces/shared-decision.d.ts +0 -10
- package/dist/core/session/interfaces/shared-document.d.ts +0 -9
- package/dist/core/session/interfaces/shared-finding.d.ts +0 -10
- package/dist/core/session/interfaces.d.ts +0 -6
- package/dist/core/session/session-health.d.ts +0 -93
- package/dist/core/session/shared-context.d.ts +0 -8
- package/dist/core/session/store.d.ts +0 -44
- package/dist/core/session/summary.d.ts +0 -7
- package/dist/core/sync/todo-parser.d.ts +0 -5
- package/dist/core/sync/todo-sync-service.d.ts +0 -42
- package/dist/core/task/interfaces/index.d.ts +0 -8
- package/dist/core/task/interfaces/task-hierarchy.d.ts +0 -9
- package/dist/core/task/interfaces/task-input.d.ts +0 -11
- package/dist/core/task/interfaces/task-node.d.ts +0 -20
- package/dist/core/task/interfaces/task-progress.d.ts +0 -11
- package/dist/core/task/interfaces.d.ts +0 -6
- package/dist/core/task/parser.d.ts +0 -8
- package/dist/core/task/scheduler.d.ts +0 -12
- package/dist/core/task/store.d.ts +0 -32
- package/dist/core/task/summary.d.ts +0 -7
- package/dist/core/task/task-decomposer.d.ts +0 -10
- package/dist/core/todo/todo-manager.d.ts +0 -36
- package/dist/hooks/compatibility/external-plugin.d.ts +0 -10
- package/dist/hooks/constants.d.ts +0 -27
- package/dist/hooks/custom/agent-ui.d.ts +0 -20
- package/dist/hooks/custom/memory-gate.d.ts +0 -21
- package/dist/hooks/custom/metrics.d.ts +0 -14
- package/dist/hooks/custom/resource-control.d.ts +0 -13
- package/dist/hooks/custom/secret-scanner.d.ts +0 -19
- package/dist/hooks/custom/strict-role-guard.d.ts +0 -21
- package/dist/hooks/custom/user-activity.d.ts +0 -11
- package/dist/hooks/features/mission-loop.d.ts +0 -18
- package/dist/hooks/features/sanity-check.d.ts +0 -15
- package/dist/hooks/index.d.ts +0 -5
- package/dist/hooks/registry.d.ts +0 -37
- package/dist/hooks/types.d.ts +0 -72
- package/dist/plugin-handlers/assistant-done-handler.d.ts +0 -12
- package/dist/plugin-handlers/chat-message-handler.d.ts +0 -30
- package/dist/plugin-handlers/config-handler.d.ts +0 -9
- package/dist/plugin-handlers/event-handler.d.ts +0 -18
- package/dist/plugin-handlers/index.d.ts +0 -9
- package/dist/plugin-handlers/interfaces/assistant-done-context.d.ts +0 -12
- package/dist/plugin-handlers/interfaces/chat-message-context.d.ts +0 -12
- package/dist/plugin-handlers/interfaces/event-handler-context.d.ts +0 -14
- package/dist/plugin-handlers/interfaces/index.d.ts +0 -12
- package/dist/plugin-handlers/interfaces/orchestrator-state.d.ts +0 -14
- package/dist/plugin-handlers/interfaces/session-compacting.d.ts +0 -19
- package/dist/plugin-handlers/interfaces/session-state.d.ts +0 -15
- package/dist/plugin-handlers/interfaces/system-transform.d.ts +0 -17
- package/dist/plugin-handlers/interfaces/tool-execute-context.d.ts +0 -8
- package/dist/plugin-handlers/interfaces/tool-hook.d.ts +0 -14
- package/dist/plugin-handlers/session-compacting-handler.d.ts +0 -14
- package/dist/plugin-handlers/system-transform-handler.d.ts +0 -14
- package/dist/plugin-handlers/tool-execute-handler.d.ts +0 -14
- package/dist/plugin-handlers/tool-execute-pre-handler.d.ts +0 -8
- package/dist/shared/errors/constants/error-patterns.d.ts +0 -13
- package/dist/shared/errors/constants/error-type.d.ts +0 -13
- package/dist/shared/errors/constants/index.d.ts +0 -5
- package/dist/shared/errors/detection.d.ts +0 -5
- package/dist/shared/errors/index.d.ts +0 -7
- package/dist/shared/errors/retry.d.ts +0 -7
- package/dist/shared/errors/types/error-pattern-type.d.ts +0 -5
- package/dist/shared/errors/types/index.d.ts +0 -4
- package/dist/shared/loop/constants/index.d.ts +0 -7
- package/dist/shared/loop/constants/labels.d.ts +0 -33
- package/dist/shared/loop/constants/loop.d.ts +0 -17
- package/dist/shared/loop/constants/mission-control.d.ts +0 -20
- package/dist/shared/loop/constants/todo-status.d.ts +0 -9
- package/dist/shared/loop/index.d.ts +0 -6
- package/dist/shared/loop/interfaces/index.d.ts +0 -6
- package/dist/shared/loop/interfaces/mission-loop.d.ts +0 -29
- package/dist/shared/loop/interfaces/todo-stats.d.ts +0 -11
- package/dist/shared/loop/interfaces/todo.d.ts +0 -13
- package/dist/shared/loop/types/index.d.ts +0 -5
- package/dist/shared/loop/types/todo-priority.d.ts +0 -4
- package/dist/shared/loop/types/todo-status.d.ts +0 -4
- package/dist/shared/message/constants/index.d.ts +0 -8
- package/dist/shared/message/constants/message-roles.d.ts +0 -23
- package/dist/shared/message/constants/part-types.d.ts +0 -13
- package/dist/shared/message/constants/plugin-hooks.d.ts +0 -15
- package/dist/shared/message/constants/prompts.d.ts +0 -8
- package/dist/shared/message/constants/slash-commands.d.ts +0 -21
- package/dist/shared/message/index.d.ts +0 -4
- package/dist/shared/notification/constants/index.d.ts +0 -3
- package/dist/shared/notification/constants/toast-duration.d.ts +0 -19
- package/dist/shared/notification/constants/toast-variants.d.ts +0 -10
- package/dist/shared/notification/constants/tui.const.d.ts +0 -24
- package/dist/shared/notification/index.d.ts +0 -7
- package/dist/shared/notification/interfaces/index.d.ts +0 -6
- package/dist/shared/notification/interfaces/task-toast.interface.d.ts +0 -18
- package/dist/shared/notification/interfaces/toast-message.d.ts +0 -13
- package/dist/shared/notification/interfaces/toast-options.d.ts +0 -10
- package/dist/shared/notification/os-notify/constants/index.d.ts +0 -6
- package/dist/shared/notification/os-notify/constants/notification-command-keys.d.ts +0 -11
- package/dist/shared/notification/os-notify/constants/notification-commands.d.ts +0 -11
- package/dist/shared/notification/os-notify/constants/notification-defaults.d.ts +0 -5
- package/dist/shared/notification/os-notify/index.d.ts +0 -6
- package/dist/shared/notification/os-notify/interfaces/index.d.ts +0 -5
- package/dist/shared/notification/os-notify/interfaces/notification-config.d.ts +0 -15
- package/dist/shared/notification/os-notify/interfaces/notification-state.d.ts +0 -13
- package/dist/shared/notification/os-notify/types/index.d.ts +0 -4
- package/dist/shared/notification/os-notify/types/notification-commands.d.ts +0 -5
- package/dist/shared/notification/presets/index.d.ts +0 -9
- package/dist/shared/notification/presets/mission.d.ts +0 -5
- package/dist/shared/notification/presets/parallel.d.ts +0 -6
- package/dist/shared/notification/presets/session.d.ts +0 -6
- package/dist/shared/notification/presets/task-lifecycle.d.ts +0 -7
- package/dist/shared/notification/presets/tools.d.ts +0 -6
- package/dist/shared/notification/presets/warnings.d.ts +0 -7
- package/dist/shared/notification/types/index.d.ts +0 -4
- package/dist/shared/notification/types/toast-variant.d.ts +0 -4
- package/dist/shared/os/constants/index.d.ts +0 -4
- package/dist/shared/os/index.d.ts +0 -5
- package/dist/shared/os/types/index.d.ts +0 -4
- package/dist/shared/os/types/platform.d.ts +0 -5
- package/dist/shared/recovery/constants/history.d.ts +0 -11
- package/dist/shared/recovery/constants/index.d.ts +0 -6
- package/dist/shared/recovery/constants/recovery-level.d.ts +0 -15
- package/dist/shared/recovery/constants/recovery.d.ts +0 -13
- package/dist/shared/recovery/index.d.ts +0 -6
- package/dist/shared/recovery/interfaces/error-context.d.ts +0 -11
- package/dist/shared/recovery/interfaces/index.d.ts +0 -5
- package/dist/shared/recovery/interfaces/recovery-record.d.ts +0 -10
- package/dist/shared/recovery/types/index.d.ts +0 -4
- package/dist/shared/recovery/types/recovery-action.d.ts +0 -4
- package/dist/shared/verification/constants/categories.d.ts +0 -95
- package/dist/shared/verification/constants/checklist.d.ts +0 -16
- package/dist/shared/verification/constants/index.d.ts +0 -7
- package/dist/shared/verification/constants/patterns.d.ts +0 -19
- package/dist/shared/verification/constants/signals.d.ts +0 -10
- package/dist/shared/verification/index.d.ts +0 -8
- package/dist/shared/verification/interfaces/checklist-item.d.ts +0 -21
- package/dist/shared/verification/interfaces/checklist-verification-result.d.ts +0 -24
- package/dist/shared/verification/interfaces/index.d.ts +0 -7
- package/dist/shared/verification/interfaces/verification-checklist.d.ts +0 -19
- package/dist/shared/verification/interfaces/verification-result.d.ts +0 -29
- package/dist/shared/verification/types/checklist-category.d.ts +0 -18
- package/dist/shared/verification/types/index.d.ts +0 -4
- package/dist/tools/parallel/show-metrics.d.ts +0 -10
- package/dist/tools/parallel/update-todo.d.ts +0 -7
- package/dist/utils/compatibility/claude.d.ts +0 -9
- package/dist/utils/formatting/elapsed-time.d.ts +0 -4
- package/dist/utils/formatting/index.d.ts +0 -5
- package/dist/utils/formatting/timestamp.d.ts +0 -4
- package/dist/utils/parsing/index.d.ts +0 -4
- package/dist/utils/parsing/slash-command.d.ts +0 -7
- package/dist/utils/sanity/checker.d.ts +0 -8
- package/dist/utils/sanity/constants/escalation-prompt.d.ts +0 -4
- package/dist/utils/sanity/constants/index.d.ts +0 -6
- package/dist/utils/sanity/constants/recovery-prompt.d.ts +0 -4
- package/dist/utils/sanity/constants/severity.d.ts +0 -8
- package/dist/utils/sanity/index.d.ts +0 -7
- package/dist/utils/sanity/interfaces/index.d.ts +0 -4
- package/dist/utils/sanity/interfaces/sanity-result.d.ts +0 -9
- package/dist/utils/sanity/types/index.d.ts +0 -4
- package/dist/utils/sanity/types/severity.d.ts +0 -5
- /package/dist/{core/agents/consts/task-status.const.d.ts → shared/task/constants/task-status.d.ts} +0 -0
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Toast Notification System
|
|
3
|
-
*
|
|
4
|
-
* Provides notifications for task events, completions, errors
|
|
5
|
-
*/
|
|
6
|
-
export type { ToastVariant, ToastMessage, ToastOptions } from "../../shared/index.js";
|
|
7
|
-
export { show, dismiss, getActive, getHistory, clear, onToast, initToastClient } from "./toast-core.js";
|
|
8
|
-
export { presets } from "../../shared/index.js";
|
|
9
|
-
export { TaskToastManager, getTaskToastManager, initTaskToastManager, type TrackedTask, type TaskStatus, type TaskCompletionInfo, } from "./task-toast-manager.js";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SessionState - State for a single orchestration session
|
|
3
|
-
*/
|
|
4
|
-
export interface SessionState {
|
|
5
|
-
enabled: boolean;
|
|
6
|
-
iterations: number;
|
|
7
|
-
taskRetries: Map<string, number>;
|
|
8
|
-
currentTask: string;
|
|
9
|
-
anomalyCount: number;
|
|
10
|
-
lastHealthyOutput?: string;
|
|
11
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ensures a local session object exists in the plugin context map.
|
|
3
|
-
* Now WITH disk-based rehydration for robustness.
|
|
4
|
-
*/
|
|
5
|
-
export declare function ensureSessionInitialized(sessions: Map<string, any>, sessionID: string, directory?: string): any;
|
|
6
|
-
/**
|
|
7
|
-
* Activates the global mission state for a specific session.
|
|
8
|
-
*/
|
|
9
|
-
export declare function activateMissionState(sessionID: string): void;
|
|
10
|
-
/**
|
|
11
|
-
* Checks if the mission is globally active and the session is enabled.
|
|
12
|
-
* CROSS-CHECK: Will return true if disk state confirms mission, even if in-memory 'missionActive' flag reset.
|
|
13
|
-
*/
|
|
14
|
-
export declare function isMissionActive(sessionID: string, directory?: string): boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Deactivates mission state (e.g., on cancellation or error).
|
|
17
|
-
*/
|
|
18
|
-
export declare function deactivateMissionState(sessionID: string): void;
|
|
19
|
-
/**
|
|
20
|
-
* Updates token usage and estimated cost for a session.
|
|
21
|
-
*/
|
|
22
|
-
export declare function updateSessionTokens(sessions: Map<string, any>, sessionID: string, inputLen: number, outputLen: number): void;
|
|
23
|
-
/**
|
|
24
|
-
* Anomaly Management
|
|
25
|
-
*/
|
|
26
|
-
export declare function recordAnomaly(sessionID: string): number;
|
|
27
|
-
export declare function resetAnomaly(sessionID: string): void;
|
|
28
|
-
/**
|
|
29
|
-
* Task Tracking
|
|
30
|
-
*/
|
|
31
|
-
export declare function updateCurrentTask(sessionID: string, taskID: string): void;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Global State - Orchestration state manager
|
|
3
|
-
*/
|
|
4
|
-
import { SessionState } from "./interfaces/session-state.js";
|
|
5
|
-
export declare const state: {
|
|
6
|
-
missionActive: boolean;
|
|
7
|
-
maxIterations: 10000;
|
|
8
|
-
maxRetries: 3;
|
|
9
|
-
sessions: Map<string, SessionState>;
|
|
10
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin System Interfaces
|
|
3
|
-
*/
|
|
4
|
-
import type { ToolDefinition } from "@opencode-ai/plugin";
|
|
5
|
-
import type { PreToolUseHook, PostToolUseHook, ChatMessageHook, AssistantDoneHook } from "../../hooks/types.js";
|
|
6
|
-
export interface CustomPlugin {
|
|
7
|
-
name: string;
|
|
8
|
-
version: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
/**
|
|
11
|
-
* Tools to register
|
|
12
|
-
*/
|
|
13
|
-
tools?: Record<string, ToolDefinition>;
|
|
14
|
-
/**
|
|
15
|
-
* Hooks to register
|
|
16
|
-
*/
|
|
17
|
-
hooks?: {
|
|
18
|
-
preTool?: PreToolUseHook;
|
|
19
|
-
postTool?: PostToolUseHook;
|
|
20
|
-
chat?: ChatMessageHook;
|
|
21
|
-
done?: AssistantDoneHook;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Initialization logic
|
|
25
|
-
*/
|
|
26
|
-
init?: (context: PluginContext) => Promise<void>;
|
|
27
|
-
}
|
|
28
|
-
export interface PluginContext {
|
|
29
|
-
directory: string;
|
|
30
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PluginManager - Manages dynamic loading of orchestrator plugins
|
|
3
|
-
*/
|
|
4
|
-
export declare class PluginManager {
|
|
5
|
-
private static instance;
|
|
6
|
-
private plugins;
|
|
7
|
-
private directory;
|
|
8
|
-
private dynamicTools;
|
|
9
|
-
private constructor();
|
|
10
|
-
static getInstance(): PluginManager;
|
|
11
|
-
initialize(directory: string): Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* Load plugins from .opencode/plugins/*.js
|
|
14
|
-
*/
|
|
15
|
-
private loadPlugins;
|
|
16
|
-
private loadPlugin;
|
|
17
|
-
/**
|
|
18
|
-
* Get all dynamically registered tools
|
|
19
|
-
*/
|
|
20
|
-
getDynamicTools(): Record<string, any>;
|
|
21
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Progress Calculator - Rate and estimation calculations
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Calculate rate (items per minute)
|
|
6
|
-
*/
|
|
7
|
-
export declare function calculateRate(sessionId: string): number;
|
|
8
|
-
/**
|
|
9
|
-
* Estimate remaining time in ms
|
|
10
|
-
*/
|
|
11
|
-
export declare function estimateRemaining(sessionId: string): number | undefined;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Progress Formatting Utilities
|
|
3
|
-
*/
|
|
4
|
-
import type { ProgressSnapshot } from "./interfaces.js";
|
|
5
|
-
/**
|
|
6
|
-
* Format elapsed time
|
|
7
|
-
*/
|
|
8
|
-
export declare function formatElapsed(ms: number): string;
|
|
9
|
-
/**
|
|
10
|
-
* Format progress bar
|
|
11
|
-
*/
|
|
12
|
-
export declare function formatProgressBar(percentage: number, width?: number): string;
|
|
13
|
-
/**
|
|
14
|
-
* Get formatted progress string
|
|
15
|
-
*/
|
|
16
|
-
export declare function formatSnapshot(snapshot: ProgressSnapshot): string;
|
|
17
|
-
/**
|
|
18
|
-
* Get compact progress string (for inline display)
|
|
19
|
-
*/
|
|
20
|
-
export declare function formatCompact(snapshot: ProgressSnapshot): string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Progress Interfaces - Index
|
|
3
|
-
*/
|
|
4
|
-
export type { TodoProgress } from "./todo-progress.js";
|
|
5
|
-
export type { TaskProgress } from "./task-progress.js";
|
|
6
|
-
export type { StepProgress } from "./step-progress.js";
|
|
7
|
-
export type { ProgressSnapshot } from "./progress-snapshot.js";
|
|
8
|
-
export type { SnapshotInput } from "./snapshot-input.js";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Progress Snapshot Interface
|
|
3
|
-
*/
|
|
4
|
-
import type { TodoProgress } from "./todo-progress.js";
|
|
5
|
-
import type { TaskProgress } from "./task-progress.js";
|
|
6
|
-
import type { StepProgress } from "./step-progress.js";
|
|
7
|
-
export interface ProgressSnapshot {
|
|
8
|
-
sessionId: string;
|
|
9
|
-
timestamp: Date;
|
|
10
|
-
todos: TodoProgress;
|
|
11
|
-
tasks: TaskProgress;
|
|
12
|
-
steps: StepProgress;
|
|
13
|
-
startedAt: Date;
|
|
14
|
-
elapsedMs: number;
|
|
15
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Snapshot Input Interface
|
|
3
|
-
*/
|
|
4
|
-
export interface SnapshotInput {
|
|
5
|
-
todoTotal?: number;
|
|
6
|
-
todoCompleted?: number;
|
|
7
|
-
taskTotal?: number;
|
|
8
|
-
taskRunning?: number;
|
|
9
|
-
taskCompleted?: number;
|
|
10
|
-
taskFailed?: number;
|
|
11
|
-
currentStep?: number;
|
|
12
|
-
maxSteps?: number;
|
|
13
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ParallelAgentManager } from "../agents/manager.js";
|
|
2
|
-
export declare class ProgressNotifier {
|
|
3
|
-
private static _instance;
|
|
4
|
-
private manager;
|
|
5
|
-
private constructor();
|
|
6
|
-
static getInstance(): ProgressNotifier;
|
|
7
|
-
setManager(manager: ParallelAgentManager): void;
|
|
8
|
-
/**
|
|
9
|
-
* Poll current status from ParallelAgentManager and broadcast it
|
|
10
|
-
*/
|
|
11
|
-
update(): void;
|
|
12
|
-
private handleStateChange;
|
|
13
|
-
}
|
|
14
|
-
export declare const progressNotifier: ProgressNotifier;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Todo } from "../loop/todo-enforcer.js";
|
|
2
|
-
export interface MissionState {
|
|
3
|
-
missionId: string;
|
|
4
|
-
status: 'planning' | 'executing' | 'reviewing' | 'completed' | 'failed';
|
|
5
|
-
progress: {
|
|
6
|
-
totalTasks: number;
|
|
7
|
-
completedTasks: number;
|
|
8
|
-
percentage: number;
|
|
9
|
-
};
|
|
10
|
-
activeAgents: {
|
|
11
|
-
id: string;
|
|
12
|
-
type: string;
|
|
13
|
-
status: string;
|
|
14
|
-
currentTask?: string;
|
|
15
|
-
}[];
|
|
16
|
-
todo: Todo[];
|
|
17
|
-
lastUpdated: Date;
|
|
18
|
-
}
|
|
19
|
-
export declare class StateBroadcaster {
|
|
20
|
-
private static _instance;
|
|
21
|
-
private listeners;
|
|
22
|
-
private currentState;
|
|
23
|
-
private constructor();
|
|
24
|
-
static getInstance(): StateBroadcaster;
|
|
25
|
-
subscribe(listener: (state: MissionState) => void): () => boolean;
|
|
26
|
-
broadcast(state: MissionState): void;
|
|
27
|
-
getCurrentState(): MissionState | null;
|
|
28
|
-
}
|
|
29
|
-
export declare const stateBroadcaster: StateBroadcaster;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Progress Store - Session data management
|
|
3
|
-
*/
|
|
4
|
-
import type { ProgressSnapshot, SnapshotInput } from "./interfaces.js";
|
|
5
|
-
/**
|
|
6
|
-
* Start tracking a session
|
|
7
|
-
*/
|
|
8
|
-
export declare function startSession(sessionId: string): void;
|
|
9
|
-
/**
|
|
10
|
-
* Get session start time
|
|
11
|
-
*/
|
|
12
|
-
export declare function getSessionStart(sessionId: string): Date | undefined;
|
|
13
|
-
/**
|
|
14
|
-
* Record a progress snapshot
|
|
15
|
-
*/
|
|
16
|
-
export declare function recordSnapshot(sessionId: string, data: SnapshotInput): ProgressSnapshot;
|
|
17
|
-
/**
|
|
18
|
-
* Get latest snapshot
|
|
19
|
-
*/
|
|
20
|
-
export declare function getLatest(sessionId: string): ProgressSnapshot | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Get progress history
|
|
23
|
-
*/
|
|
24
|
-
export declare function getHistory(sessionId: string, limit?: number): ProgressSnapshot[];
|
|
25
|
-
/**
|
|
26
|
-
* Clear session data
|
|
27
|
-
*/
|
|
28
|
-
export declare function clearSession(sessionId: string): void;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Progress Tracker Module
|
|
3
|
-
*
|
|
4
|
-
* Tracks progress of sessions, tasks, and todos
|
|
5
|
-
*/
|
|
6
|
-
export type { TodoProgress, TaskProgress, StepProgress, ProgressSnapshot, SnapshotInput, } from "./interfaces.js";
|
|
7
|
-
export { startSession, getSessionStart, recordSnapshot, getLatest, getHistory, clearSession, } from "./store.js";
|
|
8
|
-
export { formatElapsed, formatProgressBar, formatSnapshot, } from "./formatters.js";
|
|
9
|
-
export { calculateRate, estimateRemaining, } from "./calculator.js";
|
|
10
|
-
export declare function format(sessionId: string): string;
|
|
11
|
-
export declare function formatCompact(sessionId: string): string;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AsyncQueue - Async iterable queue
|
|
3
|
-
*
|
|
4
|
-
* Useful for producer/consumer patterns
|
|
5
|
-
*/
|
|
6
|
-
export declare class AsyncQueue<T> implements AsyncIterable<T> {
|
|
7
|
-
private queue;
|
|
8
|
-
private resolvers;
|
|
9
|
-
private closed;
|
|
10
|
-
/**
|
|
11
|
-
* Push an item to the queue
|
|
12
|
-
*/
|
|
13
|
-
push(item: T): void;
|
|
14
|
-
/**
|
|
15
|
-
* Get the next item (blocks if empty)
|
|
16
|
-
*/
|
|
17
|
-
next(): Promise<T>;
|
|
18
|
-
/**
|
|
19
|
-
* Try to get an item without blocking
|
|
20
|
-
*/
|
|
21
|
-
tryNext(): T | undefined;
|
|
22
|
-
/**
|
|
23
|
-
* Check if queue is empty
|
|
24
|
-
*/
|
|
25
|
-
isEmpty(): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Get current queue length
|
|
28
|
-
*/
|
|
29
|
-
get length(): number;
|
|
30
|
-
/**
|
|
31
|
-
* Close the queue (no more items can be added)
|
|
32
|
-
*/
|
|
33
|
-
close(): void;
|
|
34
|
-
/**
|
|
35
|
-
* Check if queue is closed
|
|
36
|
-
*/
|
|
37
|
-
isClosed(): boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Clear all items
|
|
40
|
-
*/
|
|
41
|
-
clear(): void;
|
|
42
|
-
/**
|
|
43
|
-
* Async iterator support
|
|
44
|
-
*/
|
|
45
|
-
[Symbol.asyncIterator](): AsyncGenerator<T, void, unknown>;
|
|
46
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Async Utilities - Retry, timeout, debounce
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Retry with exponential backoff
|
|
6
|
-
*/
|
|
7
|
-
export declare function retryWithBackoff<T>(fn: () => Promise<T>, options?: {
|
|
8
|
-
maxRetries?: number;
|
|
9
|
-
initialDelay?: number;
|
|
10
|
-
maxDelay?: number;
|
|
11
|
-
backoffFactor?: number;
|
|
12
|
-
}): Promise<T>;
|
|
13
|
-
/**
|
|
14
|
-
* Timeout wrapper
|
|
15
|
-
*/
|
|
16
|
-
export declare function withTimeout<T>(promise: Promise<T>, timeoutMs: number, errorMessage?: string): Promise<T>;
|
|
17
|
-
/**
|
|
18
|
-
* Debounce async function
|
|
19
|
-
*/
|
|
20
|
-
export declare function debounceAsync<T extends (...args: any[]) => Promise<any>>(fn: T, delayMs: number): T;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AsyncQueue & Work Pool
|
|
3
|
-
*
|
|
4
|
-
* Utilities for async iteration and concurrent work processing
|
|
5
|
-
*/
|
|
6
|
-
export { AsyncQueue } from "./async-queue.js";
|
|
7
|
-
export { workPool, workPoolWithResults, processBatches } from "./work-pool.js";
|
|
8
|
-
export { retryWithBackoff, withTimeout, debounceAsync } from "./async-utils.js";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Work Pool - Concurrent task execution utilities
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Work Pool - Concurrent task execution with limit
|
|
6
|
-
*
|
|
7
|
-
* @param concurrency - Maximum concurrent tasks
|
|
8
|
-
* @param items - Items to process
|
|
9
|
-
* @param fn - Processing function
|
|
10
|
-
*/
|
|
11
|
-
export declare function workPool<T>(concurrency: number, items: T[], fn: (item: T, index: number) => Promise<void>): Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* Work Pool with results - Returns results in order
|
|
14
|
-
*/
|
|
15
|
-
export declare function workPoolWithResults<T, R>(concurrency: number, items: T[], fn: (item: T, index: number) => Promise<R>): Promise<R[]>;
|
|
16
|
-
/**
|
|
17
|
-
* Batch processing - Process items in batches
|
|
18
|
-
*/
|
|
19
|
-
export declare function processBatches<T, R>(items: T[], batchSize: number, fn: (batch: T[]) => Promise<R[]>): Promise<R[]>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auto Recovery System
|
|
3
|
-
*
|
|
4
|
-
* Automatically handles and recovers from common errors
|
|
5
|
-
*/
|
|
6
|
-
export type { RecoveryAction, ErrorContext, ErrorPattern, RecoveryRecord, RecoveryStats, } from "./interfaces.js";
|
|
7
|
-
export { MAX_RETRIES, BASE_DELAY, MAX_HISTORY } from "./constants.js";
|
|
8
|
-
export { errorPatterns } from "./patterns.js";
|
|
9
|
-
export { handleError, withRecovery, getStats, getHistory, clearSession, } from "./handler.js";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recovery Constants
|
|
3
|
-
*
|
|
4
|
-
* @deprecated Use RECOVERY and HISTORY from shared/constants instead
|
|
5
|
-
* This file is kept for backward compatibility only.
|
|
6
|
-
*/
|
|
7
|
-
export declare const MAX_RETRIES: 3;
|
|
8
|
-
export declare const BASE_DELAY: number;
|
|
9
|
-
export declare const MAX_HISTORY: 100;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recovery Handler - Core error handling logic
|
|
3
|
-
*/
|
|
4
|
-
import type { ErrorContext, RecoveryAction, RecoveryRecord, RecoveryStats } from "./interfaces.js";
|
|
5
|
-
/**
|
|
6
|
-
* Handle an error and determine recovery action
|
|
7
|
-
*/
|
|
8
|
-
export declare function handleError(context: ErrorContext): RecoveryAction;
|
|
9
|
-
/**
|
|
10
|
-
* Execute a function with auto-recovery
|
|
11
|
-
*/
|
|
12
|
-
export declare function withRecovery<T>(sessionId: string, fn: () => Promise<T>, options?: {
|
|
13
|
-
maxRetries?: number;
|
|
14
|
-
onRetry?: (action: RecoveryAction) => void;
|
|
15
|
-
}): Promise<T>;
|
|
16
|
-
/**
|
|
17
|
-
* Get recovery statistics
|
|
18
|
-
*/
|
|
19
|
-
export declare function getStats(): RecoveryStats;
|
|
20
|
-
/**
|
|
21
|
-
* Get recent recovery history
|
|
22
|
-
*/
|
|
23
|
-
export declare function getHistory(limit?: number): RecoveryRecord[];
|
|
24
|
-
/**
|
|
25
|
-
* Clear error counts for a session
|
|
26
|
-
*/
|
|
27
|
-
export declare function clearSession(sessionId: string): void;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error Pattern Interface
|
|
3
|
-
*/
|
|
4
|
-
import type { ErrorContext } from "./error-context.js";
|
|
5
|
-
import type { RecoveryAction } from "./recovery-action.js";
|
|
6
|
-
export interface ErrorPattern {
|
|
7
|
-
pattern: RegExp | string;
|
|
8
|
-
category: string;
|
|
9
|
-
handler: (context: ErrorContext) => RecoveryAction;
|
|
10
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recovery Interfaces - Index
|
|
3
|
-
*/
|
|
4
|
-
export type { RecoveryAction } from "./recovery-action.js";
|
|
5
|
-
export type { ErrorContext } from "./error-context.js";
|
|
6
|
-
export type { ErrorPattern } from "./error-pattern.js";
|
|
7
|
-
export type { RecoveryRecord } from "./recovery-record.js";
|
|
8
|
-
export type { RecoveryStats } from "./recovery-stats.js";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recovery Action Type
|
|
3
|
-
*/
|
|
4
|
-
export type RecoveryAction = {
|
|
5
|
-
type: "retry";
|
|
6
|
-
delay: number;
|
|
7
|
-
attempt: number;
|
|
8
|
-
modifyPrompt?: string;
|
|
9
|
-
} | {
|
|
10
|
-
type: "skip";
|
|
11
|
-
reason: string;
|
|
12
|
-
} | {
|
|
13
|
-
type: "escalate";
|
|
14
|
-
to: string;
|
|
15
|
-
reason: string;
|
|
16
|
-
} | {
|
|
17
|
-
type: "resume";
|
|
18
|
-
sessionId: string;
|
|
19
|
-
} | {
|
|
20
|
-
type: "compact";
|
|
21
|
-
reason: string;
|
|
22
|
-
} | {
|
|
23
|
-
type: "abort";
|
|
24
|
-
reason: string;
|
|
25
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recovery Record Interface
|
|
3
|
-
*/
|
|
4
|
-
import type { ErrorContext } from "./error-context.js";
|
|
5
|
-
import type { RecoveryAction } from "./recovery-action.js";
|
|
6
|
-
export interface RecoveryRecord {
|
|
7
|
-
context: ErrorContext;
|
|
8
|
-
action: RecoveryAction;
|
|
9
|
-
timestamp: Date;
|
|
10
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session Retry Utilities
|
|
3
|
-
*
|
|
4
|
-
* Provides sophisticated retry logic for API errors including:
|
|
5
|
-
* - retry-after header parsing
|
|
6
|
-
* - Exponential backoff
|
|
7
|
-
* - Retryable error detection
|
|
8
|
-
*
|
|
9
|
-
* Inspired by OpenCode's SessionRetry system.
|
|
10
|
-
*/
|
|
11
|
-
/** Initial delay for retries (ms) */
|
|
12
|
-
export declare const RETRY_INITIAL_DELAY = 2000;
|
|
13
|
-
/** Backoff multiplier */
|
|
14
|
-
export declare const RETRY_BACKOFF_FACTOR = 2;
|
|
15
|
-
/** Max delay when no headers (30 seconds) */
|
|
16
|
-
export declare const RETRY_MAX_DELAY_NO_HEADERS = 30000;
|
|
17
|
-
/** Absolute max delay for setTimeout (max 32-bit signed int) */
|
|
18
|
-
export declare const RETRY_MAX_DELAY = 2147483647;
|
|
19
|
-
/** Max retry attempts */
|
|
20
|
-
export declare const MAX_RETRY_ATTEMPTS = 5;
|
|
21
|
-
export interface APIErrorData {
|
|
22
|
-
isRetryable?: boolean;
|
|
23
|
-
message?: string;
|
|
24
|
-
responseHeaders?: Record<string, string>;
|
|
25
|
-
status?: number;
|
|
26
|
-
}
|
|
27
|
-
export interface RetryConfig {
|
|
28
|
-
maxAttempts?: number;
|
|
29
|
-
initialDelay?: number;
|
|
30
|
-
maxDelay?: number;
|
|
31
|
-
backoffFactor?: number;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Sleep with abort signal support
|
|
35
|
-
*/
|
|
36
|
-
export declare function sleep(ms: number, signal?: AbortSignal): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Calculate retry delay from attempt number and optional error data
|
|
39
|
-
*
|
|
40
|
-
* Priority:
|
|
41
|
-
* 1. retry-after-ms header
|
|
42
|
-
* 2. retry-after header (seconds or HTTP date)
|
|
43
|
-
* 3. Exponential backoff
|
|
44
|
-
*/
|
|
45
|
-
export declare function calculateDelay(attempt: number, errorData?: APIErrorData): number;
|
|
46
|
-
/**
|
|
47
|
-
* Check if an error is retryable
|
|
48
|
-
*
|
|
49
|
-
* Returns a human-readable reason if retryable, undefined otherwise.
|
|
50
|
-
*/
|
|
51
|
-
export declare function isRetryable(error: unknown): string | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* Retry an async operation with exponential backoff
|
|
54
|
-
*/
|
|
55
|
-
export declare function withRetry<T>(operation: () => Promise<T>, config?: RetryConfig, signal?: AbortSignal): Promise<T>;
|
|
56
|
-
/**
|
|
57
|
-
* Format delay for human readability
|
|
58
|
-
*/
|
|
59
|
-
export declare function formatDelay(ms: number): string;
|