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.
Files changed (148) hide show
  1. package/README.md +265 -67
  2. package/dist/agents/commander.d.ts +6 -0
  3. package/dist/agents/prompts/commander/agents.d.ts +4 -0
  4. package/dist/agents/prompts/commander/execution.d.ts +4 -0
  5. package/dist/agents/prompts/commander/forbidden.d.ts +4 -0
  6. package/dist/agents/prompts/commander/identity.d.ts +4 -0
  7. package/dist/agents/prompts/commander/index.d.ts +12 -0
  8. package/dist/agents/prompts/commander/parallel.d.ts +4 -0
  9. package/dist/agents/prompts/commander/required.d.ts +4 -0
  10. package/dist/agents/prompts/commander/role.d.ts +4 -0
  11. package/dist/agents/prompts/commander/todo-format.d.ts +4 -0
  12. package/dist/agents/prompts/commander/tools.d.ts +4 -0
  13. package/dist/agents/prompts/common/anti-hallucination.d.ts +6 -0
  14. package/dist/agents/prompts/common/environment-discovery.d.ts +6 -0
  15. package/dist/agents/prompts/common/index.d.ts +11 -0
  16. package/dist/agents/prompts/common/mission-seal.d.ts +6 -0
  17. package/dist/agents/prompts/common/shared-workspace.d.ts +6 -0
  18. package/dist/agents/prompts/common/todo-rules.d.ts +6 -0
  19. package/dist/agents/prompts/common/verification.d.ts +6 -0
  20. package/dist/agents/prompts/index.d.ts +11 -0
  21. package/dist/agents/prompts/planner/forbidden.d.ts +4 -0
  22. package/dist/agents/prompts/planner/index.d.ts +8 -0
  23. package/dist/agents/prompts/planner/required.d.ts +4 -0
  24. package/dist/agents/prompts/planner/research.d.ts +4 -0
  25. package/dist/agents/prompts/planner/role.d.ts +4 -0
  26. package/dist/agents/prompts/planner/todo-format.d.ts +4 -0
  27. package/dist/agents/prompts/reviewer/forbidden.d.ts +4 -0
  28. package/dist/agents/prompts/reviewer/index.d.ts +9 -0
  29. package/dist/agents/prompts/reviewer/output.d.ts +4 -0
  30. package/dist/agents/prompts/reviewer/required.d.ts +4 -0
  31. package/dist/agents/prompts/reviewer/role.d.ts +4 -0
  32. package/dist/agents/prompts/reviewer/todo-update.d.ts +4 -0
  33. package/dist/agents/prompts/reviewer/verification.d.ts +4 -0
  34. package/dist/agents/prompts/worker/forbidden.d.ts +4 -0
  35. package/dist/agents/prompts/worker/index.d.ts +8 -0
  36. package/dist/agents/prompts/worker/quality.d.ts +4 -0
  37. package/dist/agents/prompts/worker/required.d.ts +4 -0
  38. package/dist/agents/prompts/worker/role.d.ts +4 -0
  39. package/dist/agents/prompts/worker/workflow.d.ts +4 -0
  40. package/dist/agents/subagents/planner.d.ts +8 -0
  41. package/dist/agents/subagents/reviewer.d.ts +9 -0
  42. package/dist/agents/subagents/worker.d.ts +8 -0
  43. package/dist/core/cache/interfaces/cache-document-entry.d.ts +10 -0
  44. package/dist/core/cache/interfaces/cache-list-entry.d.ts +12 -0
  45. package/dist/core/cache/interfaces/cache-metadata.d.ts +8 -0
  46. package/dist/core/cache/interfaces/cache-stats.d.ts +10 -0
  47. package/dist/core/cache/interfaces/cached-document.d.ts +11 -0
  48. package/dist/core/cache/interfaces/index.d.ts +8 -0
  49. package/dist/core/cache/interfaces.d.ts +3 -50
  50. package/dist/core/loop/interfaces/index.d.ts +5 -0
  51. package/dist/core/loop/interfaces/todo-stats.d.ts +11 -0
  52. package/dist/core/loop/interfaces/todo.d.ts +13 -0
  53. package/dist/core/loop/interfaces.d.ts +5 -32
  54. package/dist/core/loop/mission-seal-handler.d.ts +3 -0
  55. package/dist/core/loop/mission-seal.d.ts +3 -0
  56. package/dist/core/loop/types/index.d.ts +5 -0
  57. package/dist/core/loop/types/todo-priority.d.ts +4 -0
  58. package/dist/core/loop/types/todo-status.d.ts +4 -0
  59. package/dist/core/notification/presets/index.d.ts +9 -0
  60. package/dist/core/notification/presets/mission.d.ts +5 -0
  61. package/dist/core/notification/presets/parallel.d.ts +6 -0
  62. package/dist/core/notification/presets/session.d.ts +6 -0
  63. package/dist/core/notification/presets/task-lifecycle.d.ts +7 -0
  64. package/dist/core/notification/presets/tools.d.ts +6 -0
  65. package/dist/core/notification/presets/warnings.d.ts +7 -0
  66. package/dist/core/notification/presets.d.ts +5 -22
  67. package/dist/core/notification/types/index.d.ts +6 -0
  68. package/dist/core/notification/types/toast-message.d.ts +13 -0
  69. package/dist/core/notification/types/toast-options.d.ts +10 -0
  70. package/dist/core/notification/types/toast-variant.d.ts +4 -0
  71. package/dist/core/notification/types.d.ts +3 -16
  72. package/dist/core/progress/interfaces/index.d.ts +8 -0
  73. package/dist/core/progress/interfaces/progress-snapshot.d.ts +15 -0
  74. package/dist/core/progress/interfaces/snapshot-input.d.ts +13 -0
  75. package/dist/core/progress/interfaces/step-progress.d.ts +7 -0
  76. package/dist/core/progress/interfaces/task-progress.d.ts +10 -0
  77. package/dist/core/progress/interfaces/todo-progress.d.ts +9 -0
  78. package/dist/core/progress/interfaces.d.ts +3 -51
  79. package/dist/core/recovery/interfaces/error-context.d.ts +11 -0
  80. package/dist/core/recovery/interfaces/error-pattern.d.ts +10 -0
  81. package/dist/core/recovery/interfaces/index.d.ts +8 -0
  82. package/dist/core/recovery/interfaces/recovery-action.d.ts +24 -0
  83. package/dist/core/recovery/interfaces/recovery-record.d.ts +10 -0
  84. package/dist/core/recovery/interfaces/recovery-stats.d.ts +9 -0
  85. package/dist/core/recovery/interfaces.d.ts +3 -60
  86. package/dist/core/session/interfaces/context-stats.d.ts +9 -0
  87. package/dist/core/session/interfaces/index.d.ts +8 -0
  88. package/dist/core/session/interfaces/shared-context.d.ts +15 -0
  89. package/dist/core/session/interfaces/shared-decision.d.ts +10 -0
  90. package/dist/core/session/interfaces/shared-document.d.ts +9 -0
  91. package/dist/core/session/interfaces/shared-finding.d.ts +10 -0
  92. package/dist/core/session/interfaces.d.ts +3 -50
  93. package/dist/core/task/interfaces/index.d.ts +8 -0
  94. package/dist/core/task/interfaces/task-hierarchy.d.ts +9 -0
  95. package/dist/core/task/interfaces/task-input.d.ts +11 -0
  96. package/dist/core/task/interfaces/task-node.d.ts +20 -0
  97. package/dist/core/task/interfaces/task-progress.d.ts +11 -0
  98. package/dist/core/task/interfaces.d.ts +3 -51
  99. package/dist/index.js +1005 -773
  100. package/dist/plugin-handlers/chat-message-handler.d.ts +3 -10
  101. package/dist/plugin-handlers/event-handler.d.ts +4 -29
  102. package/dist/plugin-handlers/interfaces/assistant-done-context.d.ts +12 -0
  103. package/dist/plugin-handlers/interfaces/chat-message-context.d.ts +12 -0
  104. package/dist/plugin-handlers/interfaces/event-handler-context.d.ts +14 -0
  105. package/dist/plugin-handlers/interfaces/index.d.ts +9 -0
  106. package/dist/plugin-handlers/interfaces/orchestrator-state.d.ts +14 -0
  107. package/dist/plugin-handlers/interfaces/session-state.d.ts +10 -0
  108. package/dist/plugin-handlers/interfaces/tool-execute-context.d.ts +7 -0
  109. package/dist/plugin-handlers/tool-execute-handler.d.ts +3 -5
  110. package/dist/shared/agent/definition.d.ts +10 -0
  111. package/dist/shared/agent/index.d.ts +6 -0
  112. package/dist/shared/agent/names.d.ts +10 -0
  113. package/dist/shared/agent.d.ts +2 -21
  114. package/dist/shared/constants/background-status.d.ts +10 -0
  115. package/dist/shared/constants/background-task.d.ts +7 -0
  116. package/dist/shared/constants/cache-actions.d.ts +10 -0
  117. package/dist/shared/constants/filter-status.d.ts +12 -0
  118. package/dist/shared/constants/id-prefix.d.ts +8 -0
  119. package/dist/shared/constants/index.d.ts +28 -0
  120. package/dist/shared/constants/memory-limits.d.ts +12 -0
  121. package/dist/shared/constants/mission-seal.d.ts +24 -0
  122. package/dist/shared/constants/parallel-task.d.ts +13 -0
  123. package/dist/shared/constants/part-types.d.ts +9 -0
  124. package/dist/shared/constants/paths.d.ts +14 -0
  125. package/dist/shared/constants/prompts.d.ts +8 -0
  126. package/dist/shared/constants/slash-commands.d.ts +10 -0
  127. package/dist/shared/constants/status.d.ts +15 -0
  128. package/dist/shared/constants/time.d.ts +8 -0
  129. package/dist/shared/constants/toast-variants.d.ts +10 -0
  130. package/dist/shared/constants/tool-names.d.ts +22 -0
  131. package/dist/shared/constants.d.ts +3 -140
  132. package/dist/shared/error-patterns.d.ts +3 -35
  133. package/dist/shared/errors/detection.d.ts +5 -0
  134. package/dist/shared/errors/index.d.ts +7 -0
  135. package/dist/shared/errors/patterns.d.ts +14 -0
  136. package/dist/shared/errors/retry.d.ts +7 -0
  137. package/dist/tools/background-cmd/list.d.ts +2 -2
  138. package/dist/utils/common.d.ts +5 -13
  139. package/dist/utils/formatting/elapsed-time.d.ts +4 -0
  140. package/dist/utils/formatting/index.d.ts +5 -0
  141. package/dist/utils/formatting/timestamp.d.ts +4 -0
  142. package/dist/utils/parsing/index.d.ts +4 -0
  143. package/dist/utils/parsing/slash-command.d.ts +7 -0
  144. package/dist/utils/sanity.d.ts +0 -4
  145. package/package.json +1 -1
  146. package/dist/agents/consolidated/planner.d.ts +0 -8
  147. package/dist/agents/consolidated/reviewer.d.ts +0 -8
  148. package/dist/agents/consolidated/worker.d.ts +0 -8
@@ -1,21 +1,14 @@
1
1
  /**
2
- * Plugin Handlers - Chat Message Handler
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 { PluginInput } from "@opencode-ai/plugin";
10
- import type { SessionState } from "./event-handler.js";
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
- * Plugin Handlers - Event Handler
2
+ * Event Handler
3
3
  *
4
- * Handles all OpenCode events:
4
+ * Handles OpenCode session events:
5
5
  * - session.created, session.deleted, session.error, session.idle
6
6
  * - message.updated
7
7
  */
8
- import type { PluginInput } from "@opencode-ai/plugin";
9
- type OpencodeClient = PluginInput["client"];
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
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Session State Interface
3
+ */
4
+ export interface SessionState {
5
+ active: boolean;
6
+ step: number;
7
+ timestamp: number;
8
+ startTime: number;
9
+ lastStepTime: number;
10
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Tool Execute Handler Context
3
+ */
4
+ import type { SessionState } from "./session-state.js";
5
+ export interface ToolExecuteHandlerContext {
6
+ sessions: Map<string, SessionState>;
7
+ }
@@ -1,15 +1,13 @@
1
1
  /**
2
- * Plugin Handlers - Tool Execute Handler
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 { SessionState } from "./event-handler.js";
10
- export interface ToolExecuteHandlerContext {
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 Definition Interface
3
+ */
4
+ export interface AgentDefinition {
5
+ id: string;
6
+ description: string;
7
+ systemPrompt: string;
8
+ canWrite: boolean;
9
+ canBash: boolean;
10
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Agent - Index
3
+ */
4
+ export { AGENT_NAMES } from "./names.js";
5
+ export type { AgentName } from "./names.js";
6
+ export type { AgentDefinition } from "./definition.js";
@@ -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];
@@ -1,25 +1,6 @@
1
1
  /**
2
2
  * Agent Definitions
3
3
  *
4
- * Agent names, types, and interfaces.
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 declare const AGENT_NAMES: {
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,7 @@
1
+ /**
2
+ * Background Task Configuration
3
+ */
4
+ export declare const BACKGROUND_TASK: {
5
+ readonly DEFAULT_TIMEOUT_MS: number;
6
+ readonly MAX_OUTPUT_LENGTH: 10000;
7
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Cache Actions
3
+ */
4
+ export declare const CACHE_ACTIONS: {
5
+ readonly LIST: "list";
6
+ readonly GET: "get";
7
+ readonly CLEAR: "clear";
8
+ readonly STATS: "stats";
9
+ };
10
+ export type CacheAction = (typeof CACHE_ACTIONS)[keyof typeof CACHE_ACTIONS];
@@ -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,8 @@
1
+ /**
2
+ * ID Prefixes
3
+ */
4
+ export declare const ID_PREFIX: {
5
+ readonly TASK: "task_";
6
+ readonly JOB: "job_";
7
+ readonly SESSION: "session_";
8
+ };
@@ -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,9 @@
1
+ /**
2
+ * Message Part Types
3
+ */
4
+ export declare const PART_TYPES: {
5
+ readonly TEXT: "text";
6
+ readonly REASONING: "reasoning";
7
+ readonly TOOL_CALL: "tool_call";
8
+ readonly TOOL_RESULT: "tool_result";
9
+ };
@@ -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,8 @@
1
+ /**
2
+ * Common Prompts
3
+ */
4
+ export declare const PROMPTS: {
5
+ readonly CONTINUE: "continue";
6
+ readonly CONTINUE_PREVIOUS: "continue previous work";
7
+ readonly CONTINUE_DEFAULT: "continue from where we left off";
8
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Slash Commands
3
+ */
4
+ export declare const SLASH_COMMANDS: {
5
+ readonly TASK: "/task";
6
+ readonly PLAN: "/plan";
7
+ readonly STATUS: "/status";
8
+ readonly STOP: "/stop";
9
+ readonly CANCEL: "/cancel";
10
+ };
@@ -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,8 @@
1
+ /**
2
+ * Time Constants
3
+ */
4
+ export declare const TIME: {
5
+ readonly SECOND: 1000;
6
+ readonly MINUTE: number;
7
+ readonly HOUR: number;
8
+ };
@@ -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
- * All magic numbers, prefixes, and names in one place.
4
+ * Re-exports from modular constants folder.
5
+ * @see ./constants/ for individual constant files
5
6
  */
6
- export declare const TIME: {
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";