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.
- package/README.md +12 -0
- package/dist/agents/commander.d.ts +1 -1
- package/dist/agents/definitions.d.ts +1 -1
- package/dist/agents/subagents/planner.d.ts +1 -1
- package/dist/agents/subagents/reviewer.d.ts +1 -1
- package/dist/agents/subagents/worker.d.ts +1 -1
- package/dist/core/agents/config.d.ts +1 -1
- package/dist/core/cache/constants.d.ts +2 -0
- package/dist/core/orchestrator/state.d.ts +2 -2
- package/dist/core/orchestrator/types/task-status.d.ts +2 -1
- package/dist/core/recovery/constants.d.ts +6 -3
- package/dist/core/task/interfaces/index.d.ts +1 -1
- package/dist/core/task/interfaces/task-node.d.ts +1 -1
- package/dist/index.js +317 -173
- package/dist/shared/agent/constants/agent-tokens.d.ts +11 -0
- package/dist/shared/agent/constants/index.d.ts +7 -0
- package/dist/shared/agent/{names.d.ts → constants/names.d.ts} +1 -2
- package/dist/shared/agent/index.d.ts +4 -4
- package/dist/shared/agent/{definition.d.ts → interfaces/agent-definition.d.ts} +1 -1
- package/dist/shared/agent/interfaces/concurrency-config.d.ts +9 -0
- package/dist/shared/agent/interfaces/index.d.ts +5 -0
- package/dist/shared/agent/types/agent-name.d.ts +5 -0
- package/dist/shared/agent/types/index.d.ts +4 -0
- package/dist/shared/cache/constants/cache.d.ts +11 -0
- package/dist/shared/cache/constants/index.d.ts +8 -0
- package/dist/shared/cache/index.d.ts +4 -0
- package/dist/shared/command/index.d.ts +5 -0
- package/dist/shared/command/interfaces/background-task.d.ts +20 -0
- package/dist/shared/command/interfaces/index.d.ts +5 -0
- package/dist/shared/command/interfaces/run-background-options.d.ts +9 -0
- package/dist/shared/command/types/background-task-status.d.ts +4 -0
- package/dist/shared/command/types/index.d.ts +4 -0
- package/dist/shared/core/constants/index.d.ts +7 -0
- package/dist/shared/core/index.d.ts +4 -0
- package/dist/shared/errors/index.d.ts +1 -1
- package/dist/shared/errors/patterns.d.ts +13 -0
- package/dist/shared/errors/retry.d.ts +1 -1
- package/dist/shared/index.d.ts +30 -0
- package/dist/shared/loop/constants/index.d.ts +5 -0
- package/dist/shared/loop/constants/loop.d.ts +17 -0
- package/dist/shared/loop/index.d.ts +6 -0
- package/dist/shared/loop/interfaces/index.d.ts +5 -0
- package/dist/shared/loop/interfaces/todo-stats.d.ts +11 -0
- package/dist/shared/loop/interfaces/todo.d.ts +13 -0
- package/dist/shared/loop/types/index.d.ts +5 -0
- package/dist/shared/loop/types/todo-priority.d.ts +4 -0
- package/dist/shared/loop/types/todo-status.d.ts +4 -0
- package/dist/shared/message/constants/index.d.ts +6 -0
- package/dist/shared/message/index.d.ts +4 -0
- package/dist/shared/notification/constants/index.d.ts +5 -0
- package/dist/shared/notification/constants/toast-duration.d.ts +19 -0
- package/dist/shared/notification/index.d.ts +6 -0
- package/dist/shared/notification/interfaces/index.d.ts +5 -0
- package/dist/shared/notification/interfaces/toast-message.d.ts +13 -0
- package/dist/shared/notification/interfaces/toast-options.d.ts +10 -0
- package/dist/shared/notification/types/index.d.ts +4 -0
- package/dist/shared/notification/types/toast-variant.d.ts +4 -0
- package/dist/shared/recovery/constants/history.d.ts +11 -0
- package/dist/shared/recovery/constants/index.d.ts +5 -0
- package/dist/shared/recovery/constants/recovery.d.ts +13 -0
- package/dist/shared/recovery/index.d.ts +6 -0
- package/dist/shared/recovery/interfaces/error-context.d.ts +11 -0
- package/dist/shared/recovery/interfaces/index.d.ts +5 -0
- package/dist/shared/recovery/interfaces/recovery-record.d.ts +10 -0
- package/dist/shared/recovery/types/index.d.ts +4 -0
- package/dist/shared/recovery/types/recovery-action.d.ts +4 -0
- package/dist/shared/session/constants/index.d.ts +7 -0
- package/dist/shared/session/constants/session-events.d.ts +10 -0
- package/dist/shared/session/index.d.ts +4 -0
- package/dist/shared/{constants → task/constants}/background-task.d.ts +3 -0
- package/dist/shared/task/constants/index.d.ts +7 -0
- package/dist/shared/{constants → task/constants}/parallel-task.d.ts +7 -4
- package/dist/shared/task/index.d.ts +6 -0
- package/dist/shared/task/interfaces/index.d.ts +7 -0
- package/dist/shared/task/interfaces/launch-input.d.ts +11 -0
- package/dist/shared/task/interfaces/parallel-task.d.ts +26 -0
- package/dist/shared/task/interfaces/resume-input.d.ts +16 -0
- package/dist/shared/task/interfaces/task-progress.d.ts +9 -0
- package/dist/shared/task/types/index.d.ts +4 -0
- package/dist/shared/task/types/parallel-task-status.d.ts +4 -0
- package/dist/shared/tool/constants/index.d.ts +5 -0
- package/dist/shared/tool/constants/tool-output.d.ts +9 -0
- package/dist/shared/tool/index.d.ts +4 -0
- package/package.json +1 -1
- package/dist/shared/agent.d.ts +0 -6
- package/dist/shared/constants/index.d.ts +0 -28
- package/dist/shared/constants.d.ts +0 -7
- package/dist/shared/error-patterns.d.ts +0 -6
- /package/dist/shared/{constants → agent/constants}/status.d.ts +0 -0
- /package/dist/shared/{constants → cache/constants}/cache-actions.d.ts +0 -0
- /package/dist/shared/{constants → cache/constants}/filter-status.d.ts +0 -0
- /package/dist/shared/{constants → core/constants}/id-prefix.d.ts +0 -0
- /package/dist/shared/{constants → core/constants}/memory-limits.d.ts +0 -0
- /package/dist/shared/{constants → core/constants}/paths.d.ts +0 -0
- /package/dist/shared/{constants → core/constants}/time.d.ts +0 -0
- /package/dist/shared/{constants → loop/constants}/mission-seal.d.ts +0 -0
- /package/dist/shared/{constants → message/constants}/part-types.d.ts +0 -0
- /package/dist/shared/{constants → message/constants}/prompts.d.ts +0 -0
- /package/dist/shared/{constants → message/constants}/slash-commands.d.ts +0 -0
- /package/dist/shared/{constants → notification/constants}/toast-variants.d.ts +0 -0
- /package/dist/shared/{event-types.d.ts → session/constants/event-types.d.ts} +0 -0
- /package/dist/shared/{constants → task/constants}/background-status.d.ts +0 -0
- /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
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Agent
|
|
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
|
|
2
|
+
* Agent Domain
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
4
|
+
export * from "./constants/index.js";
|
|
5
|
+
export * from "./interfaces/index.js";
|
|
6
|
+
export * from "./types/index.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,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
|
+
}
|
|
@@ -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
|
|
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,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,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,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,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,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,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,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,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];
|
|
@@ -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
|
|
8
|
-
readonly POLL_INTERVAL_MS: 1000;
|
|
7
|
+
readonly MAX_DEPTH: 3;
|
|
9
8
|
readonly DEFAULT_CONCURRENCY: 3;
|
|
10
|
-
readonly MAX_CONCURRENCY:
|
|
9
|
+
readonly MAX_CONCURRENCY: 10;
|
|
11
10
|
readonly SYNC_TIMEOUT_MS: number;
|
|
12
|
-
readonly
|
|
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
|
};
|