opencode-orchestrator 1.0.43 → 1.0.47
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 +35 -35
- package/dist/core/notification/os-notify/index.d.ts +3 -2
- package/dist/core/notification/task-toast-manager.d.ts +9 -20
- package/dist/core/notification/toast-core.d.ts +1 -1
- package/dist/core/notification/toast.d.ts +2 -2
- package/dist/core/recovery/retry.d.ts +59 -0
- package/dist/index.js +20424 -19236
- package/dist/plugin-handlers/index.d.ts +2 -0
- package/dist/plugin-handlers/interfaces/event-handler-context.d.ts +0 -2
- package/dist/plugin-handlers/interfaces/index.d.ts +2 -0
- package/dist/plugin-handlers/interfaces/session-compacting.d.ts +19 -0
- package/dist/plugin-handlers/interfaces/system-transform.d.ts +17 -0
- package/dist/plugin-handlers/session-compacting-handler.d.ts +14 -0
- package/dist/plugin-handlers/system-transform-handler.d.ts +14 -0
- package/dist/shared/agent/types/index.d.ts +0 -1
- package/dist/shared/core/constants/index.d.ts +1 -1
- package/dist/shared/core/constants/status-labels.d.ts +1 -0
- package/dist/shared/notification/constants/index.d.ts +2 -4
- package/dist/shared/notification/constants/tui.const.d.ts +24 -0
- package/dist/shared/notification/index.d.ts +1 -0
- package/dist/shared/notification/interfaces/index.d.ts +1 -0
- package/dist/shared/notification/interfaces/task-toast.interface.d.ts +18 -0
- package/dist/shared/notification/os-notify/interfaces/notification-config.d.ts +1 -5
- package/dist/shared/notification/os-notify/interfaces/notification-state.d.ts +0 -2
- package/dist/{core → shared}/notification/presets/mission.d.ts +2 -2
- package/dist/{core → shared}/notification/presets/parallel.d.ts +3 -3
- package/dist/{core → shared}/notification/presets/session.d.ts +3 -3
- package/dist/{core → shared}/notification/presets/task-lifecycle.d.ts +4 -4
- package/dist/{core → shared}/notification/presets/tools.d.ts +3 -3
- package/dist/{core → shared}/notification/presets/warnings.d.ts +4 -4
- package/package.json +2 -2
- package/dist/core/notification/os-notify/handler.d.ts +0 -19
- package/dist/core/notification/presets.d.ts +0 -7
- package/dist/core/notification/types/index.d.ts +0 -6
- package/dist/core/notification/types/toast-message.d.ts +0 -13
- package/dist/core/notification/types/toast-options.d.ts +0 -10
- package/dist/core/notification/types/toast-variant.d.ts +0 -4
- package/dist/core/notification/types.d.ts +0 -6
- package/dist/shared/agent/types/status-types.d.ts +0 -5
- /package/dist/{core → shared}/notification/presets/index.d.ts +0 -0
package/README.md
CHANGED
|
@@ -30,41 +30,41 @@ OpenCode Orchestrator manages complex software tasks through **parallel multi-ag
|
|
|
30
30
|
## 📊 Workflow
|
|
31
31
|
|
|
32
32
|
```text
|
|
33
|
-
[User Task Input]
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
│
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
│
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
│
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
│
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
[MISSION SEALED]
|
|
33
|
+
[ 👤 User Task Input ]
|
|
34
|
+
│
|
|
35
|
+
┌───────────▼───────────┐
|
|
36
|
+
│ 🫡 COMMANDER (Hub) │ (Orchestration)
|
|
37
|
+
└───────────┬───────────┘
|
|
38
|
+
│
|
|
39
|
+
┌───────────▼───────────┐
|
|
40
|
+
│ 🗓️ PLANNER (Map) │ (Create TODO.md)
|
|
41
|
+
└───────────┬───────────┘
|
|
42
|
+
│
|
|
43
|
+
┌──────────────────▼──────────────────┐
|
|
44
|
+
│ ⚡ COMMANDER: Parallel Spawning │
|
|
45
|
+
└──────┬───────────┬───────────┬──────┘
|
|
46
|
+
│ │ │
|
|
47
|
+
┌──────▼───┐ ┌─────▼────┐ ┌────▼─────┐
|
|
48
|
+
│ 🔨 WORKER│ │ 🔨 WORKER│ │ 🔨 WORKER│
|
|
49
|
+
└──────┬───┘ └─────┬────┘ └────┬─────┘
|
|
50
|
+
│ │ │
|
|
51
|
+
╔══════▼═══════════▼═══════════▼══════╗
|
|
52
|
+
║ 🔍 COMMANDER: Parallel Reviewers ║
|
|
53
|
+
╚══════╤═══════════╤═══════════╤══════╝
|
|
54
|
+
│ │ │
|
|
55
|
+
┌──────▼───┐ ┌─────▼────┐ ┌────▼─────┐
|
|
56
|
+
│🔍REVIEWER│ │🔍REVIEWER│ │🔍REVIEWER│
|
|
57
|
+
└──────┬───┘ └─────┬────┘ └────┬─────┘
|
|
58
|
+
│ │ │
|
|
59
|
+
═▼═══════════▼═══════════▼═
|
|
60
|
+
│ 🚦 SYNC BARRIER │
|
|
61
|
+
═════════════╤═════════════
|
|
62
|
+
│
|
|
63
|
+
┌───────────▼───────────┐
|
|
64
|
+
│ 👑 MASTER REVIEWER │ (E2E Verification)
|
|
65
|
+
└───────────┬───────────┘
|
|
66
|
+
│
|
|
67
|
+
[ 🎖️ MISSION SEALED ]
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
* OS Native Notification Module
|
|
3
3
|
*/
|
|
4
4
|
export * from "../../../shared/notification/os-notify/index.js";
|
|
5
|
-
export {
|
|
6
|
-
export
|
|
5
|
+
export { sendNotification } from "./notifier.js";
|
|
6
|
+
export { playSound } from "./sound-player.js";
|
|
7
|
+
export { detectPlatform, getDefaultSoundPath } from "./platform.js";
|
|
@@ -12,26 +12,9 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
14
14
|
import type { ConcurrencyController } from "../agents/concurrency.js";
|
|
15
|
-
import {
|
|
15
|
+
import { type TaskStatus, type TrackedTask, type TaskCompletionInfo } from "../../shared/index.js";
|
|
16
|
+
export type { TaskStatus, TrackedTask, TaskCompletionInfo } from "../../shared/index.js";
|
|
16
17
|
type OpencodeClient = PluginInput["client"];
|
|
17
|
-
export type TaskStatus = typeof STATUS_LABEL[keyof typeof STATUS_LABEL];
|
|
18
|
-
export interface TrackedTask {
|
|
19
|
-
id: string;
|
|
20
|
-
description: string;
|
|
21
|
-
agent: string;
|
|
22
|
-
status: TaskStatus;
|
|
23
|
-
startedAt: Date;
|
|
24
|
-
isBackground: boolean;
|
|
25
|
-
parentSessionID?: string;
|
|
26
|
-
sessionID?: string;
|
|
27
|
-
}
|
|
28
|
-
export interface TaskCompletionInfo {
|
|
29
|
-
id: string;
|
|
30
|
-
description: string;
|
|
31
|
-
duration: string;
|
|
32
|
-
status: TaskStatus;
|
|
33
|
-
error?: string;
|
|
34
|
-
}
|
|
35
18
|
export declare class TaskToastManager {
|
|
36
19
|
private tasks;
|
|
37
20
|
private client;
|
|
@@ -80,6 +63,9 @@ export declare class TaskToastManager {
|
|
|
80
63
|
* Format duration since task started
|
|
81
64
|
*/
|
|
82
65
|
private formatDuration;
|
|
66
|
+
/**
|
|
67
|
+
* Get concurrency info string (e.g., " [2/5]")
|
|
68
|
+
*/
|
|
83
69
|
/**
|
|
84
70
|
* Get concurrency info string (e.g., " [2/5]")
|
|
85
71
|
*/
|
|
@@ -100,6 +86,10 @@ export declare class TaskToastManager {
|
|
|
100
86
|
* Show all-tasks-complete summary toast
|
|
101
87
|
*/
|
|
102
88
|
showAllCompleteToast(parentSessionID: string, completedTasks: TaskCompletionInfo[]): void;
|
|
89
|
+
/**
|
|
90
|
+
* Show Mission Sealed toast (Grand Finale)
|
|
91
|
+
*/
|
|
92
|
+
showMissionSealedToast(title?: string, message?: string): void;
|
|
103
93
|
/**
|
|
104
94
|
* Show progress toast (for long-running tasks)
|
|
105
95
|
*/
|
|
@@ -129,4 +119,3 @@ export declare function getTaskToastManager(): TaskToastManager | null;
|
|
|
129
119
|
* Initialize the global TaskToastManager
|
|
130
120
|
*/
|
|
131
121
|
export declare function initTaskToastManager(client: OpencodeClient, concurrency?: ConcurrencyController): TaskToastManager;
|
|
132
|
-
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Toast Core - Core notification functions
|
|
3
3
|
* Uses OpenCode TUI's showToast API for actual UI display
|
|
4
4
|
*/
|
|
5
|
-
import type { ToastMessage, ToastOptions } from "
|
|
5
|
+
import type { ToastMessage, ToastOptions } from "../../shared/index.js";
|
|
6
6
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
7
7
|
type OpencodeClient = PluginInput["client"];
|
|
8
8
|
/**
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides notifications for task events, completions, errors
|
|
5
5
|
*/
|
|
6
|
-
export type { ToastVariant, ToastMessage, ToastOptions } from "
|
|
6
|
+
export type { ToastVariant, ToastMessage, ToastOptions } from "../../shared/index.js";
|
|
7
7
|
export { show, dismiss, getActive, getHistory, clear, onToast, initToastClient } from "./toast-core.js";
|
|
8
|
-
export { presets } from "
|
|
8
|
+
export { presets } from "../../shared/index.js";
|
|
9
9
|
export { TaskToastManager, getTaskToastManager, initTaskToastManager, type TrackedTask, type TaskStatus, type TaskCompletionInfo, } from "./task-toast-manager.js";
|
|
@@ -0,0 +1,59 @@
|
|
|
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;
|