opencode-orchestrator 0.8.10 → 0.8.13
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 +265 -67
- package/dist/agents/commander.d.ts +6 -0
- package/dist/agents/prompts/commander/agents.d.ts +4 -0
- package/dist/agents/prompts/commander/execution.d.ts +4 -0
- package/dist/agents/prompts/commander/forbidden.d.ts +4 -0
- package/dist/agents/prompts/commander/identity.d.ts +4 -0
- package/dist/agents/prompts/commander/index.d.ts +12 -0
- package/dist/agents/prompts/commander/parallel.d.ts +4 -0
- package/dist/agents/prompts/commander/required.d.ts +4 -0
- package/dist/agents/prompts/commander/role.d.ts +4 -0
- package/dist/agents/prompts/commander/todo-format.d.ts +4 -0
- package/dist/agents/prompts/commander/tools.d.ts +4 -0
- package/dist/agents/prompts/common/anti-hallucination.d.ts +6 -0
- package/dist/agents/prompts/common/environment-discovery.d.ts +6 -0
- package/dist/agents/prompts/common/index.d.ts +11 -0
- package/dist/agents/prompts/common/mission-seal.d.ts +6 -0
- package/dist/agents/prompts/common/shared-workspace.d.ts +6 -0
- package/dist/agents/prompts/common/todo-rules.d.ts +6 -0
- package/dist/agents/prompts/common/verification.d.ts +6 -0
- package/dist/agents/prompts/index.d.ts +11 -0
- package/dist/agents/prompts/planner/forbidden.d.ts +4 -0
- package/dist/agents/prompts/planner/index.d.ts +8 -0
- package/dist/agents/prompts/planner/required.d.ts +4 -0
- package/dist/agents/prompts/planner/research.d.ts +4 -0
- package/dist/agents/prompts/planner/role.d.ts +4 -0
- package/dist/agents/prompts/planner/todo-format.d.ts +4 -0
- package/dist/agents/prompts/reviewer/forbidden.d.ts +4 -0
- package/dist/agents/prompts/reviewer/index.d.ts +9 -0
- package/dist/agents/prompts/reviewer/output.d.ts +4 -0
- package/dist/agents/prompts/reviewer/required.d.ts +4 -0
- package/dist/agents/prompts/reviewer/role.d.ts +4 -0
- package/dist/agents/prompts/reviewer/todo-update.d.ts +4 -0
- package/dist/agents/prompts/reviewer/verification.d.ts +4 -0
- package/dist/agents/prompts/worker/forbidden.d.ts +4 -0
- package/dist/agents/prompts/worker/index.d.ts +8 -0
- package/dist/agents/prompts/worker/quality.d.ts +4 -0
- package/dist/agents/prompts/worker/required.d.ts +4 -0
- package/dist/agents/prompts/worker/role.d.ts +4 -0
- package/dist/agents/prompts/worker/workflow.d.ts +4 -0
- package/dist/agents/subagents/planner.d.ts +8 -0
- package/dist/agents/subagents/reviewer.d.ts +9 -0
- package/dist/agents/subagents/worker.d.ts +8 -0
- package/dist/core/cache/interfaces/cache-document-entry.d.ts +10 -0
- package/dist/core/cache/interfaces/cache-list-entry.d.ts +12 -0
- package/dist/core/cache/interfaces/cache-metadata.d.ts +8 -0
- package/dist/core/cache/interfaces/cache-stats.d.ts +10 -0
- package/dist/core/cache/interfaces/cached-document.d.ts +11 -0
- package/dist/core/cache/interfaces/index.d.ts +8 -0
- package/dist/core/cache/interfaces.d.ts +3 -50
- package/dist/core/loop/interfaces/index.d.ts +5 -0
- package/dist/core/loop/interfaces/todo-stats.d.ts +11 -0
- package/dist/core/loop/interfaces/todo.d.ts +13 -0
- package/dist/core/loop/interfaces.d.ts +5 -32
- package/dist/core/loop/mission-seal-handler.d.ts +3 -0
- package/dist/core/loop/mission-seal.d.ts +3 -0
- package/dist/core/loop/types/index.d.ts +5 -0
- package/dist/core/loop/types/todo-priority.d.ts +4 -0
- package/dist/core/loop/types/todo-status.d.ts +4 -0
- package/dist/core/notification/presets/index.d.ts +9 -0
- package/dist/core/notification/presets/mission.d.ts +5 -0
- package/dist/core/notification/presets/parallel.d.ts +6 -0
- package/dist/core/notification/presets/session.d.ts +6 -0
- package/dist/core/notification/presets/task-lifecycle.d.ts +7 -0
- package/dist/core/notification/presets/tools.d.ts +6 -0
- package/dist/core/notification/presets/warnings.d.ts +7 -0
- package/dist/core/notification/presets.d.ts +5 -22
- package/dist/core/notification/types/index.d.ts +6 -0
- package/dist/core/notification/types/toast-message.d.ts +13 -0
- package/dist/core/notification/types/toast-options.d.ts +10 -0
- package/dist/core/notification/types/toast-variant.d.ts +4 -0
- package/dist/core/notification/types.d.ts +3 -16
- package/dist/core/progress/interfaces/index.d.ts +8 -0
- package/dist/core/progress/interfaces/progress-snapshot.d.ts +15 -0
- package/dist/core/progress/interfaces/snapshot-input.d.ts +13 -0
- package/dist/core/progress/interfaces/step-progress.d.ts +7 -0
- package/dist/core/progress/interfaces/task-progress.d.ts +10 -0
- package/dist/core/progress/interfaces/todo-progress.d.ts +9 -0
- package/dist/core/progress/interfaces.d.ts +3 -51
- package/dist/core/recovery/interfaces/error-context.d.ts +11 -0
- package/dist/core/recovery/interfaces/error-pattern.d.ts +10 -0
- package/dist/core/recovery/interfaces/index.d.ts +8 -0
- package/dist/core/recovery/interfaces/recovery-action.d.ts +24 -0
- package/dist/core/recovery/interfaces/recovery-record.d.ts +10 -0
- package/dist/core/recovery/interfaces/recovery-stats.d.ts +9 -0
- package/dist/core/recovery/interfaces.d.ts +3 -60
- package/dist/core/session/interfaces/context-stats.d.ts +9 -0
- package/dist/core/session/interfaces/index.d.ts +8 -0
- package/dist/core/session/interfaces/shared-context.d.ts +15 -0
- package/dist/core/session/interfaces/shared-decision.d.ts +10 -0
- package/dist/core/session/interfaces/shared-document.d.ts +9 -0
- package/dist/core/session/interfaces/shared-finding.d.ts +10 -0
- package/dist/core/session/interfaces.d.ts +3 -50
- package/dist/core/task/interfaces/index.d.ts +8 -0
- package/dist/core/task/interfaces/task-hierarchy.d.ts +9 -0
- package/dist/core/task/interfaces/task-input.d.ts +11 -0
- package/dist/core/task/interfaces/task-node.d.ts +20 -0
- package/dist/core/task/interfaces/task-progress.d.ts +11 -0
- package/dist/core/task/interfaces.d.ts +3 -51
- package/dist/index.js +1005 -773
- package/dist/plugin-handlers/chat-message-handler.d.ts +3 -10
- package/dist/plugin-handlers/event-handler.d.ts +4 -29
- package/dist/plugin-handlers/interfaces/assistant-done-context.d.ts +12 -0
- package/dist/plugin-handlers/interfaces/chat-message-context.d.ts +12 -0
- package/dist/plugin-handlers/interfaces/event-handler-context.d.ts +14 -0
- package/dist/plugin-handlers/interfaces/index.d.ts +9 -0
- package/dist/plugin-handlers/interfaces/orchestrator-state.d.ts +14 -0
- package/dist/plugin-handlers/interfaces/session-state.d.ts +10 -0
- package/dist/plugin-handlers/interfaces/tool-execute-context.d.ts +7 -0
- package/dist/plugin-handlers/tool-execute-handler.d.ts +3 -5
- package/dist/shared/agent/definition.d.ts +10 -0
- package/dist/shared/agent/index.d.ts +6 -0
- package/dist/shared/agent/names.d.ts +10 -0
- package/dist/shared/agent.d.ts +2 -21
- package/dist/shared/constants/background-status.d.ts +10 -0
- package/dist/shared/constants/background-task.d.ts +7 -0
- package/dist/shared/constants/cache-actions.d.ts +10 -0
- package/dist/shared/constants/filter-status.d.ts +12 -0
- package/dist/shared/constants/id-prefix.d.ts +8 -0
- package/dist/shared/constants/index.d.ts +28 -0
- package/dist/shared/constants/memory-limits.d.ts +12 -0
- package/dist/shared/constants/mission-seal.d.ts +24 -0
- package/dist/shared/constants/parallel-task.d.ts +13 -0
- package/dist/shared/constants/part-types.d.ts +9 -0
- package/dist/shared/constants/paths.d.ts +14 -0
- package/dist/shared/constants/prompts.d.ts +8 -0
- package/dist/shared/constants/slash-commands.d.ts +10 -0
- package/dist/shared/constants/status.d.ts +15 -0
- package/dist/shared/constants/time.d.ts +8 -0
- package/dist/shared/constants/toast-variants.d.ts +10 -0
- package/dist/shared/constants/tool-names.d.ts +22 -0
- package/dist/shared/constants.d.ts +3 -140
- package/dist/shared/error-patterns.d.ts +3 -35
- package/dist/shared/errors/detection.d.ts +5 -0
- package/dist/shared/errors/index.d.ts +7 -0
- package/dist/shared/errors/patterns.d.ts +14 -0
- package/dist/shared/errors/retry.d.ts +7 -0
- package/dist/tools/background-cmd/list.d.ts +2 -2
- package/dist/utils/common.d.ts +5 -13
- package/dist/utils/formatting/elapsed-time.d.ts +4 -0
- package/dist/utils/formatting/index.d.ts +5 -0
- package/dist/utils/formatting/timestamp.d.ts +4 -0
- package/dist/utils/parsing/index.d.ts +4 -0
- package/dist/utils/parsing/slash-command.d.ts +7 -0
- package/dist/utils/sanity.d.ts +0 -4
- package/package.json +1 -1
- package/dist/agents/consolidated/planner.d.ts +0 -8
- package/dist/agents/consolidated/reviewer.d.ts +0 -8
- package/dist/agents/consolidated/worker.d.ts +0 -8
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Chat Message Handler
|
|
3
3
|
*
|
|
4
4
|
* Handles chat.message hook:
|
|
5
5
|
* - Intercepting commands
|
|
6
6
|
* - Setting up sessions
|
|
7
7
|
* - Auto-applying mission mode for Commander
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
10
|
-
|
|
11
|
-
type OpencodeClient = PluginInput["client"];
|
|
12
|
-
export interface ChatMessageHandlerContext {
|
|
13
|
-
client: OpencodeClient;
|
|
14
|
-
directory: string;
|
|
15
|
-
sessions: Map<string, SessionState>;
|
|
16
|
-
}
|
|
9
|
+
import type { ChatMessageHandlerContext } from "./interfaces/index.js";
|
|
10
|
+
export type { ChatMessageHandlerContext } from "./interfaces/index.js";
|
|
17
11
|
/**
|
|
18
12
|
* Create chat.message handler
|
|
19
13
|
*/
|
|
20
14
|
export declare function createChatMessageHandler(ctx: ChatMessageHandlerContext): (msgInput: any, msgOutput: any) => Promise<void>;
|
|
21
|
-
export {};
|
|
@@ -1,36 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Event Handler
|
|
3
3
|
*
|
|
4
|
-
* Handles
|
|
4
|
+
* Handles OpenCode session events:
|
|
5
5
|
* - session.created, session.deleted, session.error, session.idle
|
|
6
6
|
* - message.updated
|
|
7
7
|
*/
|
|
8
|
-
import type {
|
|
9
|
-
type
|
|
10
|
-
export interface SessionState {
|
|
11
|
-
active: boolean;
|
|
12
|
-
step: number;
|
|
13
|
-
timestamp: number;
|
|
14
|
-
startTime: number;
|
|
15
|
-
lastStepTime: number;
|
|
16
|
-
}
|
|
17
|
-
export interface OrchestratorState {
|
|
18
|
-
missionActive: boolean;
|
|
19
|
-
sessions: Map<string, {
|
|
20
|
-
enabled: boolean;
|
|
21
|
-
iterations: number;
|
|
22
|
-
taskRetries: Map<string, number>;
|
|
23
|
-
currentTask: string;
|
|
24
|
-
anomalyCount: number;
|
|
25
|
-
lastHealthyOutput?: string;
|
|
26
|
-
}>;
|
|
27
|
-
}
|
|
28
|
-
export interface EventHandlerContext {
|
|
29
|
-
client: OpencodeClient;
|
|
30
|
-
directory: string;
|
|
31
|
-
sessions: Map<string, SessionState>;
|
|
32
|
-
state: OrchestratorState;
|
|
33
|
-
}
|
|
8
|
+
import type { EventHandlerContext } from "./interfaces/index.js";
|
|
9
|
+
export type { SessionState, OrchestratorState, EventHandlerContext } from "./interfaces/index.js";
|
|
34
10
|
/**
|
|
35
11
|
* Create event handler for session events
|
|
36
12
|
*/
|
|
@@ -40,4 +16,3 @@ export declare function createEventHandler(ctx: EventHandlerContext): (input: {
|
|
|
40
16
|
properties?: Record<string, unknown>;
|
|
41
17
|
};
|
|
42
18
|
}) => Promise<void>;
|
|
43
|
-
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assistant Done Handler Context
|
|
3
|
+
*/
|
|
4
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
5
|
+
import type { SessionState } from "./session-state.js";
|
|
6
|
+
type OpencodeClient = PluginInput["client"];
|
|
7
|
+
export interface AssistantDoneHandlerContext {
|
|
8
|
+
client: OpencodeClient;
|
|
9
|
+
directory: string;
|
|
10
|
+
sessions: Map<string, SessionState>;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat Message Handler Context
|
|
3
|
+
*/
|
|
4
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
5
|
+
import type { SessionState } from "./session-state.js";
|
|
6
|
+
type OpencodeClient = PluginInput["client"];
|
|
7
|
+
export interface ChatMessageHandlerContext {
|
|
8
|
+
client: OpencodeClient;
|
|
9
|
+
directory: string;
|
|
10
|
+
sessions: Map<string, SessionState>;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event Handler Context
|
|
3
|
+
*/
|
|
4
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
5
|
+
import type { SessionState } from "./session-state.js";
|
|
6
|
+
import type { OrchestratorState } from "./orchestrator-state.js";
|
|
7
|
+
type OpencodeClient = PluginInput["client"];
|
|
8
|
+
export interface EventHandlerContext {
|
|
9
|
+
client: OpencodeClient;
|
|
10
|
+
directory: string;
|
|
11
|
+
sessions: Map<string, SessionState>;
|
|
12
|
+
state: OrchestratorState;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Handlers Interfaces - Index
|
|
3
|
+
*/
|
|
4
|
+
export type { SessionState } from "./session-state.js";
|
|
5
|
+
export type { OrchestratorState } from "./orchestrator-state.js";
|
|
6
|
+
export type { EventHandlerContext } from "./event-handler-context.js";
|
|
7
|
+
export type { ChatMessageHandlerContext } from "./chat-message-context.js";
|
|
8
|
+
export type { ToolExecuteHandlerContext } from "./tool-execute-context.js";
|
|
9
|
+
export type { AssistantDoneHandlerContext } from "./assistant-done-context.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orchestrator State Interface
|
|
3
|
+
*/
|
|
4
|
+
export interface OrchestratorState {
|
|
5
|
+
missionActive: boolean;
|
|
6
|
+
sessions: Map<string, {
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
iterations: number;
|
|
9
|
+
taskRetries: Map<string, number>;
|
|
10
|
+
currentTask: string;
|
|
11
|
+
anomalyCount: number;
|
|
12
|
+
lastHealthyOutput?: string;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Tool Execute Handler
|
|
3
3
|
*
|
|
4
4
|
* Handles tool.execute.after hook:
|
|
5
5
|
* - Sanity checks for LLM output
|
|
6
6
|
* - Task status tracking
|
|
7
7
|
* - Progress display
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
10
|
-
export
|
|
11
|
-
sessions: Map<string, SessionState>;
|
|
12
|
-
}
|
|
9
|
+
import type { ToolExecuteHandlerContext } from "./interfaces/index.js";
|
|
10
|
+
export type { ToolExecuteHandlerContext } from "./interfaces/index.js";
|
|
13
11
|
/**
|
|
14
12
|
* Create tool.execute.after handler
|
|
15
13
|
*/
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Names
|
|
3
|
+
*/
|
|
4
|
+
export declare const AGENT_NAMES: {
|
|
5
|
+
readonly COMMANDER: "Commander";
|
|
6
|
+
readonly PLANNER: "Planner";
|
|
7
|
+
readonly WORKER: "Worker";
|
|
8
|
+
readonly REVIEWER: "Reviewer";
|
|
9
|
+
};
|
|
10
|
+
export type AgentName = (typeof AGENT_NAMES)[keyof typeof AGENT_NAMES];
|
package/dist/shared/agent.d.ts
CHANGED
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent Definitions
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Architecture (v2 - Consolidated):
|
|
7
|
-
* - Commander: Master orchestrator
|
|
8
|
-
* - Planner: Strategic planning + research (was: Architect + Researcher)
|
|
9
|
-
* - Worker: Implementation + documentation (was: Builder + Librarian)
|
|
10
|
-
* - Reviewer: Verification + context management (was: Inspector + Recorder)
|
|
4
|
+
* Re-exports for backward compatibility.
|
|
11
5
|
*/
|
|
12
|
-
export
|
|
13
|
-
readonly COMMANDER: "Commander";
|
|
14
|
-
readonly PLANNER: "Planner";
|
|
15
|
-
readonly WORKER: "Worker";
|
|
16
|
-
readonly REVIEWER: "Reviewer";
|
|
17
|
-
};
|
|
18
|
-
export type AgentName = (typeof AGENT_NAMES)[keyof typeof AGENT_NAMES];
|
|
19
|
-
export interface AgentDefinition {
|
|
20
|
-
id: string;
|
|
21
|
-
description: string;
|
|
22
|
-
systemPrompt: string;
|
|
23
|
-
canWrite: boolean;
|
|
24
|
-
canBash: boolean;
|
|
25
|
-
}
|
|
6
|
+
export * from "./agent/index.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Background Task Status
|
|
3
|
+
*/
|
|
4
|
+
export declare const BACKGROUND_STATUS: {
|
|
5
|
+
readonly RUNNING: "running";
|
|
6
|
+
readonly DONE: "done";
|
|
7
|
+
readonly ERROR: "error";
|
|
8
|
+
readonly TIMEOUT: "timeout";
|
|
9
|
+
};
|
|
10
|
+
export type BackgroundStatus = (typeof BACKGROUND_STATUS)[keyof typeof BACKGROUND_STATUS];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filter Status (for list operations)
|
|
3
|
+
*/
|
|
4
|
+
export declare const FILTER_STATUS: {
|
|
5
|
+
readonly ALL: "all";
|
|
6
|
+
readonly RUNNING: "running";
|
|
7
|
+
readonly DONE: "done";
|
|
8
|
+
readonly COMPLETED: "completed";
|
|
9
|
+
readonly ERROR: "error";
|
|
10
|
+
readonly PENDING: "pending";
|
|
11
|
+
};
|
|
12
|
+
export type FilterStatus = (typeof FILTER_STATUS)[keyof typeof FILTER_STATUS];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Constants - Index
|
|
3
|
+
*
|
|
4
|
+
* Re-exports all constants for backward compatibility.
|
|
5
|
+
*/
|
|
6
|
+
export { TIME } from "./time.js";
|
|
7
|
+
export { ID_PREFIX } from "./id-prefix.js";
|
|
8
|
+
export { PARALLEL_TASK } from "./parallel-task.js";
|
|
9
|
+
export { MEMORY_LIMITS } from "./memory-limits.js";
|
|
10
|
+
export { PATHS } from "./paths.js";
|
|
11
|
+
export { BACKGROUND_TASK } from "./background-task.js";
|
|
12
|
+
export { TOOL_NAMES } from "./tool-names.js";
|
|
13
|
+
export { MISSION_SEAL, MISSION } from "./mission-seal.js";
|
|
14
|
+
export { SLASH_COMMANDS } from "./slash-commands.js";
|
|
15
|
+
export { AGENT_EMOJI, STATUS_EMOJI, getStatusEmoji } from "./status.js";
|
|
16
|
+
export type { TaskStatus } from "./status.js";
|
|
17
|
+
export { PART_TYPES } from "./part-types.js";
|
|
18
|
+
export { PROMPTS } from "./prompts.js";
|
|
19
|
+
export { CACHE_ACTIONS } from "./cache-actions.js";
|
|
20
|
+
export type { CacheAction } from "./cache-actions.js";
|
|
21
|
+
export { BACKGROUND_STATUS } from "./background-status.js";
|
|
22
|
+
export type { BackgroundStatus } from "./background-status.js";
|
|
23
|
+
export { TOAST_VARIANTS } from "./toast-variants.js";
|
|
24
|
+
export { FILTER_STATUS } from "./filter-status.js";
|
|
25
|
+
export type { FilterStatus } from "./filter-status.js";
|
|
26
|
+
export { AGENT_NAMES } from "../agent.js";
|
|
27
|
+
export { TASK_STATUS, TODO_STATUS } from "../../core/agents/consts/task-status.const.js";
|
|
28
|
+
export type { ParallelTaskStatus } from "../../core/agents/types/parallel-task-status.type.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memory Limits
|
|
3
|
+
*/
|
|
4
|
+
export declare const MEMORY_LIMITS: {
|
|
5
|
+
readonly MAX_TASKS_IN_MEMORY: 1000;
|
|
6
|
+
readonly MAX_NOTIFICATIONS_PER_PARENT: 100;
|
|
7
|
+
readonly MAX_EVENT_HISTORY: 100;
|
|
8
|
+
readonly MAX_TOAST_HISTORY: 50;
|
|
9
|
+
readonly MAX_PROGRESS_HISTORY_PER_SESSION: 100;
|
|
10
|
+
readonly ARCHIVE_AGE_MS: number;
|
|
11
|
+
readonly ERROR_CLEANUP_AGE_MS: number;
|
|
12
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mission Seal Configuration
|
|
3
|
+
*/
|
|
4
|
+
export declare const MISSION_SEAL: {
|
|
5
|
+
readonly TAG: "mission_seal";
|
|
6
|
+
readonly CONFIRMATION: "SEALED";
|
|
7
|
+
readonly PATTERN: "<mission_seal>SEALED</mission_seal>";
|
|
8
|
+
readonly DEFAULT_MAX_ITERATIONS: 20;
|
|
9
|
+
readonly DEFAULT_COUNTDOWN_SECONDS: 3;
|
|
10
|
+
readonly STATE_FILE: "loop-state.json";
|
|
11
|
+
readonly STOP_COMMAND: "/stop";
|
|
12
|
+
readonly CANCEL_COMMAND: "/cancel";
|
|
13
|
+
};
|
|
14
|
+
/** @deprecated Use MISSION_SEAL instead */
|
|
15
|
+
export declare const MISSION: {
|
|
16
|
+
readonly TAG: "mission_seal";
|
|
17
|
+
readonly CONFIRMATION: "SEALED";
|
|
18
|
+
readonly PATTERN: "<mission_seal>SEALED</mission_seal>";
|
|
19
|
+
readonly DEFAULT_MAX_ITERATIONS: 20;
|
|
20
|
+
readonly DEFAULT_COUNTDOWN_SECONDS: 3;
|
|
21
|
+
readonly STATE_FILE: "loop-state.json";
|
|
22
|
+
readonly STOP_COMMAND: "/stop";
|
|
23
|
+
readonly CANCEL_COMMAND: "/cancel";
|
|
24
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parallel Task Configuration
|
|
3
|
+
*/
|
|
4
|
+
export declare const PARALLEL_TASK: {
|
|
5
|
+
readonly TTL_MS: number;
|
|
6
|
+
readonly CLEANUP_DELAY_MS: number;
|
|
7
|
+
readonly MIN_STABILITY_MS: number;
|
|
8
|
+
readonly POLL_INTERVAL_MS: 1000;
|
|
9
|
+
readonly DEFAULT_CONCURRENCY: 3;
|
|
10
|
+
readonly MAX_CONCURRENCY: 50;
|
|
11
|
+
readonly SYNC_TIMEOUT_MS: number;
|
|
12
|
+
readonly MAX_DEPTH: 3;
|
|
13
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File Paths
|
|
3
|
+
*/
|
|
4
|
+
export declare const PATHS: {
|
|
5
|
+
readonly OPENCODE: ".opencode";
|
|
6
|
+
readonly DOCS: ".opencode/docs";
|
|
7
|
+
readonly ARCHIVE: ".opencode/archive";
|
|
8
|
+
readonly TASK_ARCHIVE: ".opencode/archive/tasks";
|
|
9
|
+
readonly DOC_ARCHIVE: ".opencode/archive/docs";
|
|
10
|
+
readonly TODO: ".opencode/todo.md";
|
|
11
|
+
readonly CONTEXT: ".opencode/context.md";
|
|
12
|
+
readonly SUMMARY: ".opencode/summary.md";
|
|
13
|
+
readonly DOC_METADATA: ".opencode/docs/_metadata.json";
|
|
14
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status and Emoji
|
|
3
|
+
*/
|
|
4
|
+
export declare const AGENT_EMOJI: Record<string, string>;
|
|
5
|
+
export declare const STATUS_EMOJI: {
|
|
6
|
+
readonly pending: "...";
|
|
7
|
+
readonly running: "RUN";
|
|
8
|
+
readonly completed: "OK";
|
|
9
|
+
readonly done: "OK";
|
|
10
|
+
readonly error: "ERR";
|
|
11
|
+
readonly timeout: "TIM";
|
|
12
|
+
readonly cancelled: "CAN";
|
|
13
|
+
};
|
|
14
|
+
export type TaskStatus = keyof typeof STATUS_EMOJI;
|
|
15
|
+
export declare function getStatusEmoji(status: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toast Variants
|
|
3
|
+
*/
|
|
4
|
+
export declare const TOAST_VARIANTS: {
|
|
5
|
+
readonly INFO: "info";
|
|
6
|
+
readonly SUCCESS: "success";
|
|
7
|
+
readonly WARNING: "warning";
|
|
8
|
+
readonly ERROR: "error";
|
|
9
|
+
};
|
|
10
|
+
export type ToastVariant = (typeof TOAST_VARIANTS)[keyof typeof TOAST_VARIANTS];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Names
|
|
3
|
+
*/
|
|
4
|
+
export declare const TOOL_NAMES: {
|
|
5
|
+
readonly DELEGATE_TASK: "delegate_task";
|
|
6
|
+
readonly GET_TASK_RESULT: "get_task_result";
|
|
7
|
+
readonly LIST_TASKS: "list_tasks";
|
|
8
|
+
readonly CANCEL_TASK: "cancel_task";
|
|
9
|
+
readonly RUN_BACKGROUND: "run_background";
|
|
10
|
+
readonly CHECK_BACKGROUND: "check_background";
|
|
11
|
+
readonly LIST_BACKGROUND: "list_background";
|
|
12
|
+
readonly KILL_BACKGROUND: "kill_background";
|
|
13
|
+
readonly GREP_SEARCH: "grep_search";
|
|
14
|
+
readonly GLOB_SEARCH: "glob_search";
|
|
15
|
+
readonly MGREP: "mgrep";
|
|
16
|
+
readonly WEBFETCH: "webfetch";
|
|
17
|
+
readonly WEBSEARCH: "websearch";
|
|
18
|
+
readonly CODESEARCH: "codesearch";
|
|
19
|
+
readonly CACHE_DOCS: "cache_docs";
|
|
20
|
+
readonly CALL_AGENT: "call_agent";
|
|
21
|
+
readonly SLASHCOMMAND: "slashcommand";
|
|
22
|
+
};
|
|
@@ -1,144 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Centralized Constants
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Re-exports from modular constants folder.
|
|
5
|
+
* @see ./constants/ for individual constant files
|
|
5
6
|
*/
|
|
6
|
-
export
|
|
7
|
-
readonly SECOND: 1000;
|
|
8
|
-
readonly MINUTE: number;
|
|
9
|
-
readonly HOUR: number;
|
|
10
|
-
};
|
|
11
|
-
export declare const ID_PREFIX: {
|
|
12
|
-
/** Parallel agent task ID (e.g., task_a1b2c3d4) */
|
|
13
|
-
readonly TASK: "task_";
|
|
14
|
-
/** Background command job ID (e.g., job_a1b2c3d4) */
|
|
15
|
-
readonly JOB: "job_";
|
|
16
|
-
/** Session ID prefix */
|
|
17
|
-
readonly SESSION: "session_";
|
|
18
|
-
};
|
|
19
|
-
export declare const PARALLEL_TASK: {
|
|
20
|
-
readonly TTL_MS: number;
|
|
21
|
-
readonly CLEANUP_DELAY_MS: number;
|
|
22
|
-
readonly MIN_STABILITY_MS: number;
|
|
23
|
-
readonly POLL_INTERVAL_MS: 1000;
|
|
24
|
-
readonly DEFAULT_CONCURRENCY: 3;
|
|
25
|
-
readonly MAX_CONCURRENCY: 50;
|
|
26
|
-
readonly SYNC_TIMEOUT_MS: number;
|
|
27
|
-
readonly MAX_DEPTH: 3;
|
|
28
|
-
};
|
|
29
|
-
export declare const MEMORY_LIMITS: {
|
|
30
|
-
readonly MAX_TASKS_IN_MEMORY: 1000;
|
|
31
|
-
readonly MAX_NOTIFICATIONS_PER_PARENT: 100;
|
|
32
|
-
readonly MAX_EVENT_HISTORY: 100;
|
|
33
|
-
readonly MAX_TOAST_HISTORY: 50;
|
|
34
|
-
readonly MAX_PROGRESS_HISTORY_PER_SESSION: 100;
|
|
35
|
-
readonly ARCHIVE_AGE_MS: number;
|
|
36
|
-
readonly ERROR_CLEANUP_AGE_MS: number;
|
|
37
|
-
};
|
|
38
|
-
export declare const PATHS: {
|
|
39
|
-
readonly OPENCODE: ".opencode";
|
|
40
|
-
readonly DOCS: ".opencode/docs";
|
|
41
|
-
readonly ARCHIVE: ".opencode/archive";
|
|
42
|
-
readonly TASK_ARCHIVE: ".opencode/archive/tasks";
|
|
43
|
-
readonly DOC_ARCHIVE: ".opencode/archive/docs";
|
|
44
|
-
readonly TODO: ".opencode/todo.md";
|
|
45
|
-
readonly CONTEXT: ".opencode/context.md";
|
|
46
|
-
readonly SUMMARY: ".opencode/summary.md";
|
|
47
|
-
readonly DOC_METADATA: ".opencode/docs/_metadata.json";
|
|
48
|
-
};
|
|
49
|
-
export declare const BACKGROUND_TASK: {
|
|
50
|
-
readonly DEFAULT_TIMEOUT_MS: number;
|
|
51
|
-
readonly MAX_OUTPUT_LENGTH: 10000;
|
|
52
|
-
};
|
|
53
|
-
export declare const TOOL_NAMES: {
|
|
54
|
-
readonly DELEGATE_TASK: "delegate_task";
|
|
55
|
-
readonly GET_TASK_RESULT: "get_task_result";
|
|
56
|
-
readonly LIST_TASKS: "list_tasks";
|
|
57
|
-
readonly CANCEL_TASK: "cancel_task";
|
|
58
|
-
readonly RUN_BACKGROUND: "run_background";
|
|
59
|
-
readonly CHECK_BACKGROUND: "check_background";
|
|
60
|
-
readonly LIST_BACKGROUND: "list_background";
|
|
61
|
-
readonly KILL_BACKGROUND: "kill_background";
|
|
62
|
-
readonly GREP_SEARCH: "grep_search";
|
|
63
|
-
readonly GLOB_SEARCH: "glob_search";
|
|
64
|
-
readonly MGREP: "mgrep";
|
|
65
|
-
readonly WEBFETCH: "webfetch";
|
|
66
|
-
readonly WEBSEARCH: "websearch";
|
|
67
|
-
readonly CODESEARCH: "codesearch";
|
|
68
|
-
readonly CACHE_DOCS: "cache_docs";
|
|
69
|
-
readonly CALL_AGENT: "call_agent";
|
|
70
|
-
readonly SLASHCOMMAND: "slashcommand";
|
|
71
|
-
};
|
|
72
|
-
export declare const MISSION_SEAL: {
|
|
73
|
-
/** XML tag name for mission seal */
|
|
74
|
-
readonly TAG: "mission_seal";
|
|
75
|
-
/** Confirmation value inside tag */
|
|
76
|
-
readonly CONFIRMATION: "SEALED";
|
|
77
|
-
/** Full seal pattern: <mission_seal>SEALED</mission_seal> */
|
|
78
|
-
readonly PATTERN: "<mission_seal>SEALED</mission_seal>";
|
|
79
|
-
/** Default max loop iterations */
|
|
80
|
-
readonly DEFAULT_MAX_ITERATIONS: 20;
|
|
81
|
-
/** Default countdown seconds before continue */
|
|
82
|
-
readonly DEFAULT_COUNTDOWN_SECONDS: 3;
|
|
83
|
-
/** Loop state file name */
|
|
84
|
-
readonly STATE_FILE: "loop-state.json";
|
|
85
|
-
/** Stop command */
|
|
86
|
-
readonly STOP_COMMAND: "/stop";
|
|
87
|
-
/** Cancel command */
|
|
88
|
-
readonly CANCEL_COMMAND: "/cancel";
|
|
89
|
-
};
|
|
90
|
-
/** @deprecated Use MISSION_SEAL instead */
|
|
91
|
-
export declare const MISSION: {
|
|
92
|
-
/** XML tag name for mission seal */
|
|
93
|
-
readonly TAG: "mission_seal";
|
|
94
|
-
/** Confirmation value inside tag */
|
|
95
|
-
readonly CONFIRMATION: "SEALED";
|
|
96
|
-
/** Full seal pattern: <mission_seal>SEALED</mission_seal> */
|
|
97
|
-
readonly PATTERN: "<mission_seal>SEALED</mission_seal>";
|
|
98
|
-
/** Default max loop iterations */
|
|
99
|
-
readonly DEFAULT_MAX_ITERATIONS: 20;
|
|
100
|
-
/** Default countdown seconds before continue */
|
|
101
|
-
readonly DEFAULT_COUNTDOWN_SECONDS: 3;
|
|
102
|
-
/** Loop state file name */
|
|
103
|
-
readonly STATE_FILE: "loop-state.json";
|
|
104
|
-
/** Stop command */
|
|
105
|
-
readonly STOP_COMMAND: "/stop";
|
|
106
|
-
/** Cancel command */
|
|
107
|
-
readonly CANCEL_COMMAND: "/cancel";
|
|
108
|
-
};
|
|
109
|
-
export declare const SLASH_COMMANDS: {
|
|
110
|
-
readonly TASK: "/task";
|
|
111
|
-
readonly PLAN: "/plan";
|
|
112
|
-
readonly STATUS: "/status";
|
|
113
|
-
readonly STOP: "/stop";
|
|
114
|
-
readonly CANCEL: "/cancel";
|
|
115
|
-
};
|
|
116
|
-
export declare const AGENT_EMOJI: Record<string, string>;
|
|
117
|
-
export declare const PART_TYPES: {
|
|
118
|
-
readonly TEXT: "text";
|
|
119
|
-
readonly REASONING: "reasoning";
|
|
120
|
-
readonly TOOL_CALL: "tool_call";
|
|
121
|
-
readonly TOOL_RESULT: "tool_result";
|
|
122
|
-
};
|
|
123
|
-
export declare const PROMPTS: {
|
|
124
|
-
/** Simple continue prompt for auto-continue loop */
|
|
125
|
-
readonly CONTINUE: "continue";
|
|
126
|
-
/** Default fallback for empty arguments */
|
|
127
|
-
readonly CONTINUE_PREVIOUS: "continue previous work";
|
|
128
|
-
/** Default fallback for slash commands */
|
|
129
|
-
readonly CONTINUE_DEFAULT: "continue from where we left off";
|
|
130
|
-
};
|
|
131
|
-
export { AGENT_NAMES } from "./agent.js";
|
|
132
|
-
export { TASK_STATUS, TODO_STATUS } from "../core/agents/consts/task-status.const.js";
|
|
133
|
-
export type { ParallelTaskStatus } from "../core/agents/types/parallel-task-status.type.js";
|
|
134
|
-
export declare const STATUS_EMOJI: {
|
|
135
|
-
readonly pending: "⏳";
|
|
136
|
-
readonly running: "🔄";
|
|
137
|
-
readonly completed: "✅";
|
|
138
|
-
readonly done: "✅";
|
|
139
|
-
readonly error: "❌";
|
|
140
|
-
readonly timeout: "⏰";
|
|
141
|
-
readonly cancelled: "🚫";
|
|
142
|
-
};
|
|
143
|
-
export type TaskStatus = keyof typeof STATUS_EMOJI;
|
|
144
|
-
export declare function getStatusEmoji(status: string): string;
|
|
7
|
+
export * from "./constants/index.js";
|