opencode-orchestrator 0.9.73 → 1.0.3
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 +22 -9
- package/dist/core/agents/concurrency.d.ts +6 -0
- package/dist/core/agents/interfaces/parallel-task.interface.d.ts +1 -0
- package/dist/core/agents/manager/task-poller.d.ts +1 -1
- package/dist/core/agents/manager.d.ts +1 -0
- package/dist/core/agents/persistence/task-wal.d.ts +26 -0
- package/dist/core/agents/types/parallel-task-status.type.d.ts +2 -1
- package/dist/core/notification/os-notify/handler.d.ts +19 -0
- package/dist/core/notification/os-notify/index.d.ts +6 -0
- package/dist/core/notification/os-notify/notifier.d.ts +7 -0
- package/dist/core/notification/os-notify/platform-resolver.d.ts +7 -0
- package/dist/core/notification/os-notify/platform.d.ts +7 -0
- package/dist/core/notification/os-notify/sound-player.d.ts +7 -0
- package/dist/core/notification/os-notify/todo-checker.d.ts +5 -0
- package/dist/core/notification/task-toast-manager.d.ts +2 -1
- package/dist/core/orchestrator/state.d.ts +1 -1
- package/dist/index.js +838 -98
- package/dist/plugin-handlers/interfaces/event-handler-context.d.ts +2 -0
- package/dist/shared/core/constants/index.d.ts +1 -0
- package/dist/shared/core/constants/limits.d.ts +1 -1
- package/dist/shared/core/constants/status-labels.d.ts +1 -0
- package/dist/shared/core/constants/wal-actions.d.ts +10 -0
- package/dist/shared/index.d.ts +1 -15
- package/dist/shared/loop/constants/index.d.ts +1 -0
- package/dist/shared/loop/constants/loop.d.ts +1 -1
- package/dist/shared/loop/constants/mission-seal.d.ts +2 -2
- package/dist/shared/loop/constants/todo-status.d.ts +9 -0
- package/dist/shared/notification/os-notify/constants/index.d.ts +6 -0
- package/dist/shared/notification/os-notify/constants/notification-command-keys.d.ts +11 -0
- package/dist/shared/notification/os-notify/constants/notification-commands.d.ts +11 -0
- package/dist/shared/notification/os-notify/constants/notification-defaults.d.ts +5 -0
- package/dist/shared/notification/os-notify/index.d.ts +6 -0
- package/dist/shared/notification/os-notify/interfaces/index.d.ts +5 -0
- package/dist/shared/notification/os-notify/interfaces/notification-config.d.ts +19 -0
- package/dist/shared/notification/os-notify/interfaces/notification-state.d.ts +15 -0
- package/dist/shared/notification/os-notify/types/index.d.ts +4 -0
- package/dist/shared/notification/os-notify/types/notification-commands.d.ts +5 -0
- package/dist/shared/os/constants/index.d.ts +4 -0
- package/dist/shared/os/constants/platform.d.ts +9 -0
- package/dist/shared/os/index.d.ts +5 -0
- package/dist/shared/os/types/index.d.ts +4 -0
- package/dist/shared/os/types/platform.d.ts +5 -0
- package/package.json +1 -1
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
5
5
|
import type { SessionState } from "./session-state.js";
|
|
6
6
|
import type { OrchestratorState } from "./orchestrator-state.js";
|
|
7
|
+
import type { SessionNotificationHandler } from "../../core/notification/os-notify/index.js";
|
|
7
8
|
type OpencodeClient = PluginInput["client"];
|
|
8
9
|
export interface EventHandlerContext {
|
|
9
10
|
client: OpencodeClient;
|
|
10
11
|
directory: string;
|
|
11
12
|
sessions: Map<string, SessionState>;
|
|
12
13
|
state: OrchestratorState;
|
|
14
|
+
sessionNotifyHandler?: SessionNotificationHandler;
|
|
13
15
|
}
|
|
14
16
|
export {};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const LIMITS: {
|
|
5
5
|
/** Maximum mission loop iterations */
|
|
6
|
-
readonly MAX_ITERATIONS:
|
|
6
|
+
readonly MAX_ITERATIONS: 10000;
|
|
7
7
|
/** Default scan limit for file listing */
|
|
8
8
|
readonly DEFAULT_SCAN_LIMIT: 20;
|
|
9
9
|
/** Max message history to check for seal */
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAL (Write-Ahead Log) Action constants
|
|
3
|
+
*/
|
|
4
|
+
export declare const WAL_ACTIONS: {
|
|
5
|
+
readonly LAUNCH: "LAUNCH";
|
|
6
|
+
readonly UPDATE: "UPDATE";
|
|
7
|
+
readonly COMPLETE: "COMPLETE";
|
|
8
|
+
readonly DELETE: "DELETE";
|
|
9
|
+
};
|
|
10
|
+
export type WALAction = typeof WAL_ACTIONS[keyof typeof WAL_ACTIONS];
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -1,20 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared Module - Central Exports
|
|
3
|
-
*
|
|
4
|
-
* Domain-first organization:
|
|
5
|
-
* - shared/agent/ - AGENT_NAMES, AgentDefinition, AgentName
|
|
6
|
-
* - shared/core/ - TIME, PATHS, ID_PREFIX
|
|
7
|
-
* - shared/task/ - PARALLEL_TASK, ParallelTask, ParallelTaskStatus
|
|
8
|
-
* - shared/loop/ - LOOP, Todo, TodoStatus
|
|
9
|
-
* - shared/notification/ - TOAST_DURATION, ToastMessage, ToastVariant
|
|
10
|
-
* - shared/recovery/ - RECOVERY, ErrorContext, RecoveryAction
|
|
11
|
-
* - shared/cache/ - CACHE, CACHE_ACTIONS
|
|
12
|
-
* - shared/session/ - SESSION_EVENTS, EVENT_TYPES
|
|
13
|
-
* - shared/command/ - BackgroundTask, BackgroundTaskStatus
|
|
14
|
-
* - shared/tool/ - TOOL_NAMES, TOOL_OUTPUT
|
|
15
|
-
* - shared/message/ - PART_TYPES, PROMPTS
|
|
16
|
-
* - shared/errors/ - ERROR_PATTERNS, ERROR_TYPE
|
|
17
|
-
* - shared/prompt/ - PROMPT_TAGS, WORK_STATUS
|
|
18
3
|
*/
|
|
19
4
|
export * from "./agent/index.js";
|
|
20
5
|
export * from "./core/index.js";
|
|
@@ -27,6 +12,7 @@ export * from "./session/index.js";
|
|
|
27
12
|
export * from "./command/index.js";
|
|
28
13
|
export * from "./tool/index.js";
|
|
29
14
|
export * from "./message/index.js";
|
|
15
|
+
export * from "./os/index.js";
|
|
30
16
|
export * from "./errors/index.js";
|
|
31
17
|
export * from "./prompt/index.js";
|
|
32
18
|
export { TASK_STATUS, TODO_STATUS } from "../core/agents/consts/task-status.const.js";
|
|
@@ -11,7 +11,7 @@ export declare const LOOP: {
|
|
|
11
11
|
/** Window to consider abort as recent */
|
|
12
12
|
readonly ABORT_WINDOW_MS: number;
|
|
13
13
|
/** Maximum iterations for mission loop */
|
|
14
|
-
readonly DEFAULT_MAX_ITERATIONS:
|
|
14
|
+
readonly DEFAULT_MAX_ITERATIONS: 10000;
|
|
15
15
|
/** Rust tool timeout */
|
|
16
16
|
readonly RUST_TOOL_TIMEOUT_MS: number;
|
|
17
17
|
};
|
|
@@ -5,7 +5,7 @@ export declare const MISSION_SEAL: {
|
|
|
5
5
|
readonly TAG: "mission_seal";
|
|
6
6
|
readonly CONFIRMATION: "SEALED";
|
|
7
7
|
readonly PATTERN: "<mission_seal>SEALED</mission_seal>";
|
|
8
|
-
readonly DEFAULT_MAX_ITERATIONS:
|
|
8
|
+
readonly DEFAULT_MAX_ITERATIONS: 10000;
|
|
9
9
|
readonly DEFAULT_COUNTDOWN_SECONDS: 3;
|
|
10
10
|
readonly STATE_FILE: "loop-state.json";
|
|
11
11
|
readonly STOP_COMMAND: "/stop";
|
|
@@ -16,7 +16,7 @@ export declare const MISSION: {
|
|
|
16
16
|
readonly TAG: "mission_seal";
|
|
17
17
|
readonly CONFIRMATION: "SEALED";
|
|
18
18
|
readonly PATTERN: "<mission_seal>SEALED</mission_seal>";
|
|
19
|
-
readonly DEFAULT_MAX_ITERATIONS:
|
|
19
|
+
readonly DEFAULT_MAX_ITERATIONS: 10000;
|
|
20
20
|
readonly DEFAULT_COUNTDOWN_SECONDS: 3;
|
|
21
21
|
readonly STATE_FILE: "loop-state.json";
|
|
22
22
|
readonly STOP_COMMAND: "/stop";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OS Notification Command Keys
|
|
3
|
+
*/
|
|
4
|
+
export declare const NOTIFICATION_COMMAND_KEYS: {
|
|
5
|
+
readonly OSASCRIPT: "osascript";
|
|
6
|
+
readonly NOTIFY_SEND: "notifySend";
|
|
7
|
+
readonly POWERSHELL: "powershell";
|
|
8
|
+
readonly AFPLAY: "afplay";
|
|
9
|
+
readonly PAPLAY: "paplay";
|
|
10
|
+
readonly APLAY: "aplay";
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OS Notification Commands
|
|
3
|
+
*/
|
|
4
|
+
export declare const NOTIFICATION_COMMANDS: {
|
|
5
|
+
readonly OSASCRIPT: "osascript";
|
|
6
|
+
readonly NOTIFY_SEND: "notify-send";
|
|
7
|
+
readonly POWERSHELL: "powershell";
|
|
8
|
+
readonly AFPLAY: "afplay";
|
|
9
|
+
readonly PAPLAY: "paplay";
|
|
10
|
+
readonly APLAY: "aplay";
|
|
11
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification Config Interface
|
|
3
|
+
*/
|
|
4
|
+
export interface NotificationConfig {
|
|
5
|
+
/** Notification title (default: "OpenCode Orchestrator") */
|
|
6
|
+
title?: string;
|
|
7
|
+
/** Notification message (default: "Agent is ready for input") */
|
|
8
|
+
message?: string;
|
|
9
|
+
/** Play sound with notification (default: true) */
|
|
10
|
+
playSound?: boolean;
|
|
11
|
+
/** Custom sound file path */
|
|
12
|
+
soundPath?: string;
|
|
13
|
+
/** Delay in ms before sending notification to confirm session is still idle (default: 1500) */
|
|
14
|
+
idleConfirmationDelay?: number;
|
|
15
|
+
/** Skip notification if there are incomplete todos (default: true) */
|
|
16
|
+
skipIfIncompleteTodos?: boolean;
|
|
17
|
+
/** Maximum number of sessions to track before cleanup (default: 100) */
|
|
18
|
+
maxTrackedSessions?: number;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification State Interface
|
|
3
|
+
*/
|
|
4
|
+
export interface NotificationState {
|
|
5
|
+
/** Sessions that have already been notified */
|
|
6
|
+
notifiedSessions: Set<string>;
|
|
7
|
+
/** Pending notification timers */
|
|
8
|
+
pendingTimers: Map<string, ReturnType<typeof setTimeout>>;
|
|
9
|
+
/** Sessions with activity since idle event */
|
|
10
|
+
sessionActivitySinceIdle: Set<string>;
|
|
11
|
+
/** Version tracking for race condition handling */
|
|
12
|
+
notificationVersions: Map<string, number>;
|
|
13
|
+
/** Sessions currently executing notification */
|
|
14
|
+
executingNotifications: Set<string>;
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "opencode-orchestrator",
|
|
3
3
|
"displayName": "OpenCode Orchestrator",
|
|
4
4
|
"description": "Distributed Cognitive Architecture for OpenCode. Turns simple prompts into specialized multi-agent workflows (Planner, Coder, Reviewer).",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "1.0.3",
|
|
6
6
|
"author": "agnusdei1207",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|