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.
Files changed (43) hide show
  1. package/README.md +22 -9
  2. package/dist/core/agents/concurrency.d.ts +6 -0
  3. package/dist/core/agents/interfaces/parallel-task.interface.d.ts +1 -0
  4. package/dist/core/agents/manager/task-poller.d.ts +1 -1
  5. package/dist/core/agents/manager.d.ts +1 -0
  6. package/dist/core/agents/persistence/task-wal.d.ts +26 -0
  7. package/dist/core/agents/types/parallel-task-status.type.d.ts +2 -1
  8. package/dist/core/notification/os-notify/handler.d.ts +19 -0
  9. package/dist/core/notification/os-notify/index.d.ts +6 -0
  10. package/dist/core/notification/os-notify/notifier.d.ts +7 -0
  11. package/dist/core/notification/os-notify/platform-resolver.d.ts +7 -0
  12. package/dist/core/notification/os-notify/platform.d.ts +7 -0
  13. package/dist/core/notification/os-notify/sound-player.d.ts +7 -0
  14. package/dist/core/notification/os-notify/todo-checker.d.ts +5 -0
  15. package/dist/core/notification/task-toast-manager.d.ts +2 -1
  16. package/dist/core/orchestrator/state.d.ts +1 -1
  17. package/dist/index.js +838 -98
  18. package/dist/plugin-handlers/interfaces/event-handler-context.d.ts +2 -0
  19. package/dist/shared/core/constants/index.d.ts +1 -0
  20. package/dist/shared/core/constants/limits.d.ts +1 -1
  21. package/dist/shared/core/constants/status-labels.d.ts +1 -0
  22. package/dist/shared/core/constants/wal-actions.d.ts +10 -0
  23. package/dist/shared/index.d.ts +1 -15
  24. package/dist/shared/loop/constants/index.d.ts +1 -0
  25. package/dist/shared/loop/constants/loop.d.ts +1 -1
  26. package/dist/shared/loop/constants/mission-seal.d.ts +2 -2
  27. package/dist/shared/loop/constants/todo-status.d.ts +9 -0
  28. package/dist/shared/notification/os-notify/constants/index.d.ts +6 -0
  29. package/dist/shared/notification/os-notify/constants/notification-command-keys.d.ts +11 -0
  30. package/dist/shared/notification/os-notify/constants/notification-commands.d.ts +11 -0
  31. package/dist/shared/notification/os-notify/constants/notification-defaults.d.ts +5 -0
  32. package/dist/shared/notification/os-notify/index.d.ts +6 -0
  33. package/dist/shared/notification/os-notify/interfaces/index.d.ts +5 -0
  34. package/dist/shared/notification/os-notify/interfaces/notification-config.d.ts +19 -0
  35. package/dist/shared/notification/os-notify/interfaces/notification-state.d.ts +15 -0
  36. package/dist/shared/notification/os-notify/types/index.d.ts +4 -0
  37. package/dist/shared/notification/os-notify/types/notification-commands.d.ts +5 -0
  38. package/dist/shared/os/constants/index.d.ts +4 -0
  39. package/dist/shared/os/constants/platform.d.ts +9 -0
  40. package/dist/shared/os/index.d.ts +5 -0
  41. package/dist/shared/os/types/index.d.ts +4 -0
  42. package/dist/shared/os/types/platform.d.ts +5 -0
  43. 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 {};
@@ -7,4 +7,5 @@ export { PATHS } from "./paths.js";
7
7
  export { MEMORY_LIMITS } from "./memory-limits.js";
8
8
  export { STATUS_LABEL } from "./status-labels.js";
9
9
  export { LIMITS } from "./limits.js";
10
+ export { WAL_ACTIONS } from "./wal-actions.js";
10
11
  export * from "./cli.js";
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export declare const LIMITS: {
5
5
  /** Maximum mission loop iterations */
6
- readonly MAX_ITERATIONS: 1000;
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 */
@@ -6,6 +6,7 @@
6
6
  */
7
7
  export declare const STATUS_LABEL: {
8
8
  readonly PENDING: "pending";
9
+ readonly QUEUED: "queued";
9
10
  readonly RUNNING: "running";
10
11
  readonly IN_PROGRESS: "in_progress";
11
12
  readonly COMPLETED: "completed";
@@ -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];
@@ -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";
@@ -3,3 +3,4 @@
3
3
  */
4
4
  export { LOOP } from "./loop.js";
5
5
  export { MISSION_SEAL, MISSION } from "./mission-seal.js";
6
+ export { TODO_STATUS } from "./todo-status.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: 1000;
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: 1000;
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: 1000;
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,9 @@
1
+ /**
2
+ * Todo Status Constants
3
+ */
4
+ export declare const TODO_STATUS: {
5
+ readonly PENDING: "pending";
6
+ readonly IN_PROGRESS: "in_progress";
7
+ readonly COMPLETED: "completed";
8
+ readonly CANCELLED: "cancelled";
9
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * OS Notification Constants - Index
3
+ */
4
+ export * from "./notification-defaults.js";
5
+ export * from "./notification-commands.js";
6
+ export * from "./notification-command-keys.js";
@@ -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,5 @@
1
+ /**
2
+ * OS Notification Default Constants
3
+ */
4
+ import type { NotificationConfig } from "../interfaces/notification-config.js";
5
+ export declare const NOTIFICATION_DEFAULTS: Required<NotificationConfig>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * OS Notification Shared Module
3
+ */
4
+ export * from "./types/index.js";
5
+ export * from "./interfaces/index.js";
6
+ export * from "./constants/index.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * OS Notification Interfaces - Index
3
+ */
4
+ export * from "./notification-config.js";
5
+ export * from "./notification-state.js";
@@ -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
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * OS Notification Types - Index
3
+ */
4
+ export * from "./notification-commands.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * OS Notification Command Types
3
+ */
4
+ import { NOTIFICATION_COMMAND_KEYS } from "../constants/notification-command-keys.js";
5
+ export type NotificationCommandKey = typeof NOTIFICATION_COMMAND_KEYS[keyof typeof NOTIFICATION_COMMAND_KEYS];
@@ -0,0 +1,4 @@
1
+ /**
2
+ * OS Constants
3
+ */
4
+ export * from "./platform.js";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * OS Platform Constants
3
+ */
4
+ export declare const PLATFORM: {
5
+ readonly DARWIN: "darwin";
6
+ readonly LINUX: "linux";
7
+ readonly WIN32: "win32";
8
+ readonly UNSUPPORTED: "unsupported";
9
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * OS Shared Domain
3
+ */
4
+ export * from "./constants/index.js";
5
+ export * from "./types/index.js";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * OS Types
3
+ */
4
+ export * from "./platform.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * OS Platform Type
3
+ */
4
+ import { PLATFORM } from "../constants/platform.js";
5
+ export type Platform = typeof PLATFORM[keyof typeof PLATFORM];
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.9.73",
5
+ "version": "1.0.3",
6
6
  "author": "agnusdei1207",
7
7
  "license": "MIT",
8
8
  "repository": {