opencode-orchestrator 0.8.19 → 0.8.21

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 (103) hide show
  1. package/README.md +12 -0
  2. package/dist/agents/commander.d.ts +1 -1
  3. package/dist/agents/definitions.d.ts +1 -1
  4. package/dist/agents/subagents/planner.d.ts +1 -1
  5. package/dist/agents/subagents/reviewer.d.ts +1 -1
  6. package/dist/agents/subagents/worker.d.ts +1 -1
  7. package/dist/core/agents/config.d.ts +1 -1
  8. package/dist/core/cache/constants.d.ts +2 -0
  9. package/dist/core/orchestrator/state.d.ts +2 -2
  10. package/dist/core/orchestrator/types/task-status.d.ts +2 -1
  11. package/dist/core/recovery/constants.d.ts +6 -3
  12. package/dist/core/task/interfaces/index.d.ts +1 -1
  13. package/dist/core/task/interfaces/task-node.d.ts +1 -1
  14. package/dist/index.js +317 -173
  15. package/dist/shared/agent/constants/agent-tokens.d.ts +11 -0
  16. package/dist/shared/agent/constants/index.d.ts +7 -0
  17. package/dist/shared/agent/{names.d.ts → constants/names.d.ts} +1 -2
  18. package/dist/shared/agent/index.d.ts +4 -4
  19. package/dist/shared/agent/{definition.d.ts → interfaces/agent-definition.d.ts} +1 -1
  20. package/dist/shared/agent/interfaces/concurrency-config.d.ts +9 -0
  21. package/dist/shared/agent/interfaces/index.d.ts +5 -0
  22. package/dist/shared/agent/types/agent-name.d.ts +5 -0
  23. package/dist/shared/agent/types/index.d.ts +4 -0
  24. package/dist/shared/cache/constants/cache.d.ts +11 -0
  25. package/dist/shared/cache/constants/index.d.ts +8 -0
  26. package/dist/shared/cache/index.d.ts +4 -0
  27. package/dist/shared/command/index.d.ts +5 -0
  28. package/dist/shared/command/interfaces/background-task.d.ts +20 -0
  29. package/dist/shared/command/interfaces/index.d.ts +5 -0
  30. package/dist/shared/command/interfaces/run-background-options.d.ts +9 -0
  31. package/dist/shared/command/types/background-task-status.d.ts +4 -0
  32. package/dist/shared/command/types/index.d.ts +4 -0
  33. package/dist/shared/core/constants/index.d.ts +7 -0
  34. package/dist/shared/core/index.d.ts +4 -0
  35. package/dist/shared/errors/index.d.ts +1 -1
  36. package/dist/shared/errors/patterns.d.ts +13 -0
  37. package/dist/shared/errors/retry.d.ts +1 -1
  38. package/dist/shared/index.d.ts +30 -0
  39. package/dist/shared/loop/constants/index.d.ts +5 -0
  40. package/dist/shared/loop/constants/loop.d.ts +17 -0
  41. package/dist/shared/loop/index.d.ts +6 -0
  42. package/dist/shared/loop/interfaces/index.d.ts +5 -0
  43. package/dist/shared/loop/interfaces/todo-stats.d.ts +11 -0
  44. package/dist/shared/loop/interfaces/todo.d.ts +13 -0
  45. package/dist/shared/loop/types/index.d.ts +5 -0
  46. package/dist/shared/loop/types/todo-priority.d.ts +4 -0
  47. package/dist/shared/loop/types/todo-status.d.ts +4 -0
  48. package/dist/shared/message/constants/index.d.ts +6 -0
  49. package/dist/shared/message/index.d.ts +4 -0
  50. package/dist/shared/notification/constants/index.d.ts +5 -0
  51. package/dist/shared/notification/constants/toast-duration.d.ts +19 -0
  52. package/dist/shared/notification/index.d.ts +6 -0
  53. package/dist/shared/notification/interfaces/index.d.ts +5 -0
  54. package/dist/shared/notification/interfaces/toast-message.d.ts +13 -0
  55. package/dist/shared/notification/interfaces/toast-options.d.ts +10 -0
  56. package/dist/shared/notification/types/index.d.ts +4 -0
  57. package/dist/shared/notification/types/toast-variant.d.ts +4 -0
  58. package/dist/shared/recovery/constants/history.d.ts +11 -0
  59. package/dist/shared/recovery/constants/index.d.ts +5 -0
  60. package/dist/shared/recovery/constants/recovery.d.ts +13 -0
  61. package/dist/shared/recovery/index.d.ts +6 -0
  62. package/dist/shared/recovery/interfaces/error-context.d.ts +11 -0
  63. package/dist/shared/recovery/interfaces/index.d.ts +5 -0
  64. package/dist/shared/recovery/interfaces/recovery-record.d.ts +10 -0
  65. package/dist/shared/recovery/types/index.d.ts +4 -0
  66. package/dist/shared/recovery/types/recovery-action.d.ts +4 -0
  67. package/dist/shared/session/constants/index.d.ts +7 -0
  68. package/dist/shared/session/constants/session-events.d.ts +10 -0
  69. package/dist/shared/session/index.d.ts +4 -0
  70. package/dist/shared/{constants → task/constants}/background-task.d.ts +3 -0
  71. package/dist/shared/task/constants/index.d.ts +7 -0
  72. package/dist/shared/{constants → task/constants}/parallel-task.d.ts +7 -4
  73. package/dist/shared/task/index.d.ts +6 -0
  74. package/dist/shared/task/interfaces/index.d.ts +7 -0
  75. package/dist/shared/task/interfaces/launch-input.d.ts +11 -0
  76. package/dist/shared/task/interfaces/parallel-task.d.ts +26 -0
  77. package/dist/shared/task/interfaces/resume-input.d.ts +16 -0
  78. package/dist/shared/task/interfaces/task-progress.d.ts +9 -0
  79. package/dist/shared/task/types/index.d.ts +4 -0
  80. package/dist/shared/task/types/parallel-task-status.d.ts +4 -0
  81. package/dist/shared/tool/constants/index.d.ts +5 -0
  82. package/dist/shared/tool/constants/tool-output.d.ts +9 -0
  83. package/dist/shared/tool/index.d.ts +4 -0
  84. package/package.json +1 -1
  85. package/dist/shared/agent.d.ts +0 -6
  86. package/dist/shared/constants/index.d.ts +0 -28
  87. package/dist/shared/constants.d.ts +0 -7
  88. package/dist/shared/error-patterns.d.ts +0 -6
  89. /package/dist/shared/{constants → agent/constants}/status.d.ts +0 -0
  90. /package/dist/shared/{constants → cache/constants}/cache-actions.d.ts +0 -0
  91. /package/dist/shared/{constants → cache/constants}/filter-status.d.ts +0 -0
  92. /package/dist/shared/{constants → core/constants}/id-prefix.d.ts +0 -0
  93. /package/dist/shared/{constants → core/constants}/memory-limits.d.ts +0 -0
  94. /package/dist/shared/{constants → core/constants}/paths.d.ts +0 -0
  95. /package/dist/shared/{constants → core/constants}/time.d.ts +0 -0
  96. /package/dist/shared/{constants → loop/constants}/mission-seal.d.ts +0 -0
  97. /package/dist/shared/{constants → message/constants}/part-types.d.ts +0 -0
  98. /package/dist/shared/{constants → message/constants}/prompts.d.ts +0 -0
  99. /package/dist/shared/{constants → message/constants}/slash-commands.d.ts +0 -0
  100. /package/dist/shared/{constants → notification/constants}/toast-variants.d.ts +0 -0
  101. /package/dist/shared/{event-types.d.ts → session/constants/event-types.d.ts} +0 -0
  102. /package/dist/shared/{constants → task/constants}/background-status.d.ts +0 -0
  103. /package/dist/shared/{constants → tool/constants}/tool-names.d.ts +0 -0
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Agent Token Configuration
3
+ */
4
+ export declare const AGENT_TOKENS: {
5
+ /** Primary agent (Commander) max tokens */
6
+ readonly PRIMARY_MAX_TOKENS: 64000;
7
+ /** Primary agent thinking budget */
8
+ readonly PRIMARY_THINKING_BUDGET: 32000;
9
+ /** Subagent max tokens */
10
+ readonly SUBAGENT_MAX_TOKENS: 32000;
11
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Agent constants
3
+ */
4
+ export { AGENT_NAMES } from "./names.js";
5
+ export { AGENT_TOKENS } from "./agent-tokens.js";
6
+ export { AGENT_EMOJI, STATUS_EMOJI, getStatusEmoji } from "./status.js";
7
+ export type { TaskStatus } from "./status.js";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Agent Names
2
+ * Agent names constant
3
3
  */
4
4
  export declare const AGENT_NAMES: {
5
5
  readonly COMMANDER: "Commander";
@@ -7,4 +7,3 @@ export declare const AGENT_NAMES: {
7
7
  readonly WORKER: "Worker";
8
8
  readonly REVIEWER: "Reviewer";
9
9
  };
10
- export type AgentName = (typeof AGENT_NAMES)[keyof typeof AGENT_NAMES];
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Agent - Index
2
+ * Agent Domain
3
3
  */
4
- export { AGENT_NAMES } from "./names.js";
5
- export type { AgentName } from "./names.js";
6
- export type { AgentDefinition } from "./definition.js";
4
+ export * from "./constants/index.js";
5
+ export * from "./interfaces/index.js";
6
+ export * from "./types/index.js";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Agent Definition Interface
2
+ * Agent definition for orchestrator
3
3
  */
4
4
  export interface AgentDefinition {
5
5
  id: string;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Concurrency limits configuration
3
+ */
4
+ export interface ConcurrencyConfig {
5
+ defaultConcurrency?: number;
6
+ agentConcurrency?: Record<string, number>;
7
+ providerConcurrency?: Record<string, number>;
8
+ modelConcurrency?: Record<string, number>;
9
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Agent interfaces
3
+ */
4
+ export type { AgentDefinition } from "./agent-definition.js";
5
+ export type { ConcurrencyConfig } from "./concurrency-config.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Agent name type (derived from AGENT_NAMES)
3
+ */
4
+ import { AGENT_NAMES } from "../constants/names.js";
5
+ export type AgentName = (typeof AGENT_NAMES)[keyof typeof AGENT_NAMES];
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Agent types
3
+ */
4
+ export type { AgentName } from "./agent-name.js";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Cache Configuration Constants
3
+ */
4
+ export declare const CACHE: {
5
+ /** Default cache TTL (24 hours) */
6
+ readonly DEFAULT_TTL_MS: number;
7
+ /** Maximum cache entries */
8
+ readonly MAX_ENTRIES: 100;
9
+ /** Session TTL (24 hours for long tasks) */
10
+ readonly SESSION_TTL_MS: number;
11
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Cache constants
3
+ */
4
+ export { CACHE } from "./cache.js";
5
+ export { CACHE_ACTIONS } from "./cache-actions.js";
6
+ export type { CacheAction } from "./cache-actions.js";
7
+ export { FILTER_STATUS } from "./filter-status.js";
8
+ export type { FilterStatus } from "./filter-status.js";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Cache Domain
3
+ */
4
+ export * from "./constants/index.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Command Domain
3
+ */
4
+ export * from "./interfaces/index.js";
5
+ export * from "./types/index.js";
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Background shell command task
3
+ */
4
+ import type { ChildProcess } from "child_process";
5
+ import type { BackgroundTaskStatus } from "../types/index.js";
6
+ export interface BackgroundTask {
7
+ id: string;
8
+ command: string;
9
+ args: string[];
10
+ cwd: string;
11
+ label?: string;
12
+ status: BackgroundTaskStatus;
13
+ output: string;
14
+ errorOutput: string;
15
+ exitCode: number | null;
16
+ startTime: number;
17
+ endTime?: number;
18
+ timeout: number;
19
+ process?: ChildProcess;
20
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Command interfaces
3
+ */
4
+ export type { BackgroundTask } from "./background-task.js";
5
+ export type { RunBackgroundOptions } from "./run-background-options.js";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Options for running background command
3
+ */
4
+ export interface RunBackgroundOptions {
5
+ command: string;
6
+ cwd?: string;
7
+ timeout?: number;
8
+ label?: string;
9
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Background task status values
3
+ */
4
+ export type BackgroundTaskStatus = "pending" | "running" | "done" | "error" | "timeout";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Command types
3
+ */
4
+ export type { BackgroundTaskStatus } from "./background-task-status.js";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Core constants
3
+ */
4
+ export { TIME } from "./time.js";
5
+ export { ID_PREFIX } from "./id-prefix.js";
6
+ export { PATHS } from "./paths.js";
7
+ export { MEMORY_LIMITS } from "./memory-limits.js";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Core Domain
3
+ */
4
+ export * from "./constants/index.js";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Errors - Index
3
3
  */
4
- export { ERROR_PATTERNS } from "./patterns.js";
4
+ export { ERROR_PATTERNS, ERROR_TYPE } from "./patterns.js";
5
5
  export type { ErrorPatternType } from "./patterns.js";
6
6
  export { detectErrorType } from "./detection.js";
7
7
  export { isRetryableError, shouldAbortOnError, getRetryDelay } from "./retry.js";
@@ -12,3 +12,16 @@ export declare const ERROR_PATTERNS: {
12
12
  readonly AUTH_ERROR: RegExp;
13
13
  };
14
14
  export type ErrorPatternType = keyof typeof ERROR_PATTERNS;
15
+ /**
16
+ * Error Type Constants (for use in switch statements)
17
+ */
18
+ export declare const ERROR_TYPE: {
19
+ readonly TOOL_RESULT_MISSING: "TOOL_RESULT_MISSING";
20
+ readonly THINKING_BLOCK_ORDER: "THINKING_BLOCK_ORDER";
21
+ readonly THINKING_DISABLED: "THINKING_DISABLED";
22
+ readonly RATE_LIMIT: "RATE_LIMIT";
23
+ readonly CONTEXT_OVERFLOW: "CONTEXT_OVERFLOW";
24
+ readonly MESSAGE_ABORTED: "MESSAGE_ABORTED";
25
+ readonly NETWORK_ERROR: "NETWORK_ERROR";
26
+ readonly AUTH_ERROR: "AUTH_ERROR";
27
+ };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Error Retry Logic
3
3
  */
4
- import type { ErrorPatternType } from "./patterns.js";
4
+ import { type ErrorPatternType } from "./patterns.js";
5
5
  export declare function isRetryableError(errorType: ErrorPatternType | null): boolean;
6
6
  export declare function shouldAbortOnError(errorType: ErrorPatternType | null): boolean;
7
7
  export declare function getRetryDelay(errorType: ErrorPatternType | null, attempt: number): number;
@@ -0,0 +1,30 @@
1
+ /**
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
+ */
18
+ export * from "./agent/index.js";
19
+ export * from "./core/index.js";
20
+ export * from "./task/index.js";
21
+ export * from "./loop/index.js";
22
+ export * from "./notification/index.js";
23
+ export * from "./recovery/index.js";
24
+ export * from "./cache/index.js";
25
+ export * from "./session/index.js";
26
+ export * from "./command/index.js";
27
+ export * from "./tool/index.js";
28
+ export * from "./message/index.js";
29
+ export * from "./errors/index.js";
30
+ export { TASK_STATUS, TODO_STATUS } from "../core/agents/consts/task-status.const.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Loop constants
3
+ */
4
+ export { LOOP } from "./loop.js";
5
+ export { MISSION_SEAL, MISSION } from "./mission-seal.js";
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Loop Continuation Configuration
3
+ */
4
+ export declare const LOOP: {
5
+ /** Countdown seconds before auto-continuation */
6
+ readonly COUNTDOWN_SECONDS: 3;
7
+ /** Minimum time between continuation checks */
8
+ readonly MIN_TIME_BETWEEN_CHECKS_MS: number;
9
+ /** Grace period after countdown starts (ignore messages) */
10
+ readonly COUNTDOWN_GRACE_PERIOD_MS: 500;
11
+ /** Window to consider abort as recent */
12
+ readonly ABORT_WINDOW_MS: number;
13
+ /** Maximum iterations for mission loop */
14
+ readonly DEFAULT_MAX_ITERATIONS: 1000;
15
+ /** Rust tool timeout */
16
+ readonly RUST_TOOL_TIMEOUT_MS: number;
17
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Loop Domain
3
+ */
4
+ export * from "./constants/index.js";
5
+ export * from "./interfaces/index.js";
6
+ export * from "./types/index.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Loop interfaces
3
+ */
4
+ export type { Todo } from "./todo.js";
5
+ export type { TodoStats } from "./todo-stats.js";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Todo statistics
3
+ */
4
+ export interface TodoStats {
5
+ total: number;
6
+ pending: number;
7
+ inProgress: number;
8
+ completed: number;
9
+ cancelled: number;
10
+ percentComplete: number;
11
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Todo item
3
+ */
4
+ import type { TodoStatus, TodoPriority } from "../types/index.js";
5
+ export interface Todo {
6
+ id: string;
7
+ content: string;
8
+ status: TodoStatus;
9
+ priority: TodoPriority;
10
+ parentId?: string;
11
+ createdAt: Date;
12
+ completedAt?: Date;
13
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Loop types
3
+ */
4
+ export type { TodoStatus } from "./todo-status.js";
5
+ export type { TodoPriority } from "./todo-priority.js";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Todo priority values
3
+ */
4
+ export type TodoPriority = "high" | "medium" | "low";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Todo status values
3
+ */
4
+ export type TodoStatus = "pending" | "in_progress" | "completed" | "cancelled";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Message constants
3
+ */
4
+ export { PART_TYPES } from "./part-types.js";
5
+ export { PROMPTS } from "./prompts.js";
6
+ export { SLASH_COMMANDS } from "./slash-commands.js";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Message Domain
3
+ */
4
+ export * from "./constants/index.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Notification constants
3
+ */
4
+ export { TOAST_DURATION } from "./toast-duration.js";
5
+ export { TOAST_VARIANTS } from "./toast-variants.js";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Toast Duration Constants
3
+ */
4
+ export declare const TOAST_DURATION: {
5
+ /** Extra short: 1.5 seconds */
6
+ readonly EXTRA_SHORT: 1500;
7
+ /** Short: 2 seconds */
8
+ readonly SHORT: number;
9
+ /** Medium: 3 seconds */
10
+ readonly MEDIUM: number;
11
+ /** Default: 4 seconds */
12
+ readonly DEFAULT: number;
13
+ /** Long: 5 seconds */
14
+ readonly LONG: number;
15
+ /** Extended: 7 seconds */
16
+ readonly EXTENDED: number;
17
+ /** Persistent: 0 (stays until dismissed) */
18
+ readonly PERSISTENT: 0;
19
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Notification Domain
3
+ */
4
+ export * from "./constants/index.js";
5
+ export * from "./interfaces/index.js";
6
+ export * from "./types/index.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Notification interfaces
3
+ */
4
+ export type { ToastOptions } from "./toast-options.js";
5
+ export type { ToastMessage } from "./toast-message.js";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Toast message with metadata
3
+ */
4
+ import type { ToastVariant } from "../types/index.js";
5
+ export interface ToastMessage {
6
+ id: string;
7
+ title: string;
8
+ message: string;
9
+ variant: ToastVariant;
10
+ timestamp: Date;
11
+ duration: number;
12
+ dismissed: boolean;
13
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Toast display options
3
+ */
4
+ import type { ToastVariant } from "../types/index.js";
5
+ export interface ToastOptions {
6
+ title: string;
7
+ message: string;
8
+ variant?: ToastVariant;
9
+ duration?: number;
10
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Notification types
3
+ */
4
+ export type { ToastVariant } from "./toast-variant.js";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Toast variant type
3
+ */
4
+ export type ToastVariant = "info" | "success" | "warning" | "error";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * History & Storage Limits
3
+ */
4
+ export declare const HISTORY: {
5
+ /** Recovery history max entries */
6
+ readonly MAX_RECOVERY: 100;
7
+ /** Toast history max entries */
8
+ readonly MAX_TOAST: 50;
9
+ /** Progress store max entries */
10
+ readonly MAX_PROGRESS: 100;
11
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Recovery constants
3
+ */
4
+ export { RECOVERY } from "./recovery.js";
5
+ export { HISTORY } from "./history.js";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Recovery Configuration Constants
3
+ */
4
+ export declare const RECOVERY: {
5
+ /** Maximum recovery attempts per session */
6
+ readonly MAX_ATTEMPTS: 3;
7
+ /** Minimum time between recovery attempts */
8
+ readonly MIN_INTERVAL_MS: number;
9
+ /** Base delay for retry backoff calculation */
10
+ readonly BASE_DELAY_MS: number;
11
+ /** Maximum retry multiplier */
12
+ readonly MAX_RETRY_MULTIPLIER: 5;
13
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Recovery Domain
3
+ */
4
+ export * from "./constants/index.js";
5
+ export * from "./interfaces/index.js";
6
+ export * from "./types/index.js";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Error context for recovery
3
+ */
4
+ export interface ErrorContext {
5
+ sessionId: string;
6
+ taskId?: string;
7
+ agent?: string;
8
+ error: Error;
9
+ attempt: number;
10
+ timestamp: Date;
11
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Recovery interfaces
3
+ */
4
+ export type { ErrorContext } from "./error-context.js";
5
+ export type { RecoveryRecord } from "./recovery-record.js";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Recovery history record
3
+ */
4
+ import type { ErrorContext } from "./error-context.js";
5
+ import type { RecoveryAction } from "../types/index.js";
6
+ export interface RecoveryRecord {
7
+ context: ErrorContext;
8
+ action: RecoveryAction;
9
+ timestamp: Date;
10
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Recovery types
3
+ */
4
+ export type { RecoveryAction } from "./recovery-action.js";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Recovery action type
3
+ */
4
+ export type RecoveryAction = "retry" | "abort" | "escalate" | "ignore";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Session constants
3
+ */
4
+ export { SESSION_EVENTS } from "./session-events.js";
5
+ export type { SessionEventType } from "./session-events.js";
6
+ export { TASK_EVENTS, TODO_EVENTS, SESSION_EVENTS as SESSION_STATE_EVENTS, DOCUMENT_EVENTS, MISSION_EVENTS, SPECIAL_EVENTS, EVENT_TYPES, } from "./event-types.js";
7
+ export type { EventTypeValue } from "./event-types.js";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * OpenCode Session Event Types
3
+ */
4
+ export declare const SESSION_EVENTS: {
5
+ readonly IDLE: "session.idle";
6
+ readonly DELETED: "session.deleted";
7
+ readonly CREATED: "session.created";
8
+ readonly ERROR: "session.error";
9
+ };
10
+ export type SessionEventType = (typeof SESSION_EVENTS)[keyof typeof SESSION_EVENTS];
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Session Domain
3
+ */
4
+ export * from "./constants/index.js";
@@ -4,4 +4,7 @@
4
4
  export declare const BACKGROUND_TASK: {
5
5
  readonly DEFAULT_TIMEOUT_MS: number;
6
6
  readonly MAX_OUTPUT_LENGTH: 10000;
7
+ readonly MAX_CONCURRENT: 5;
8
+ readonly POLL_INTERVAL_MS: 500;
9
+ readonly RETRY_COOLDOWN_MS: number;
7
10
  };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Task constants
3
+ */
4
+ export { PARALLEL_TASK } from "./parallel-task.js";
5
+ export { BACKGROUND_TASK } from "./background-task.js";
6
+ export { BACKGROUND_STATUS } from "./background-status.js";
7
+ export type { BackgroundStatus } from "./background-status.js";
@@ -4,10 +4,13 @@
4
4
  export declare const PARALLEL_TASK: {
5
5
  readonly TTL_MS: number;
6
6
  readonly CLEANUP_DELAY_MS: number;
7
- readonly MIN_STABILITY_MS: number;
8
- readonly POLL_INTERVAL_MS: 1000;
7
+ readonly MAX_DEPTH: 3;
9
8
  readonly DEFAULT_CONCURRENCY: 3;
10
- readonly MAX_CONCURRENCY: 50;
9
+ readonly MAX_CONCURRENCY: 10;
11
10
  readonly SYNC_TIMEOUT_MS: number;
12
- readonly MAX_DEPTH: 3;
11
+ readonly POLL_INTERVAL_MS: 500;
12
+ readonly MIN_IDLE_TIME_MS: number;
13
+ readonly MIN_STABILITY_MS: number;
14
+ readonly STABLE_POLLS_REQUIRED: 3;
15
+ readonly MAX_POLL_COUNT: 600;
13
16
  };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Task Domain
3
+ */
4
+ export * from "./constants/index.js";
5
+ export * from "./interfaces/index.js";
6
+ export * from "./types/index.js";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Task interfaces
3
+ */
4
+ export type { TaskProgress } from "./task-progress.js";
5
+ export type { ParallelTask } from "./parallel-task.js";
6
+ export type { LaunchInput } from "./launch-input.js";
7
+ export type { ResumeInput } from "./resume-input.js";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Input for launching a parallel task
3
+ */
4
+ export interface LaunchInput {
5
+ description: string;
6
+ prompt: string;
7
+ agent: string;
8
+ parentSessionID: string;
9
+ /** Current nesting depth (default: 1) */
10
+ depth?: number;
11
+ }