opencode-orchestrator 1.2.34 → 1.2.35
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 +91 -41
- package/dist/core/agents/agent-registry.d.ts +28 -0
- package/dist/core/agents/concurrency.d.ts +38 -0
- package/dist/core/agents/config.d.ts +9 -0
- package/dist/core/agents/consts/index.d.ts +4 -0
- package/dist/core/agents/index.d.ts +2 -3
- package/dist/core/agents/interfaces/session-pool.interface.d.ts +0 -7
- package/dist/core/agents/manager/event-handler.d.ts +35 -0
- package/dist/core/agents/manager/index.d.ts +10 -0
- package/dist/core/agents/manager/task-cleaner.d.ts +29 -0
- package/dist/core/agents/manager/task-launcher.d.ts +35 -0
- package/dist/core/agents/manager/task-poller.d.ts +28 -0
- package/dist/core/agents/manager/task-resumer.d.ts +18 -0
- package/dist/core/agents/manager.d.ts +41 -9
- package/dist/core/agents/persistence/task-wal.d.ts +26 -0
- package/dist/core/agents/session-pool.d.ts +0 -10
- package/dist/core/agents/task-store.d.ts +54 -0
- package/dist/core/cleanup/cleanup-scheduler.d.ts +11 -0
- package/dist/core/context/context-window-monitor.d.ts +66 -0
- package/dist/core/context/index.d.ts +6 -0
- package/dist/core/loop/formatters.d.ts +17 -0
- 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 +7 -0
- package/dist/core/loop/mission-loop-handler.d.ts +25 -0
- package/dist/core/loop/mission-loop.d.ts +48 -0
- package/dist/core/loop/parser.d.ts +8 -0
- package/dist/core/loop/stats.d.ts +24 -0
- package/dist/core/loop/todo-continuation.d.ts +39 -0
- package/dist/core/loop/todo-enforcer.d.ts +9 -0
- package/dist/core/loop/todo-manager.d.ts +22 -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/loop/verification.d.ts +22 -0
- package/dist/core/memory/interfaces.d.ts +33 -0
- package/dist/core/memory/memory-manager.d.ts +40 -0
- package/dist/core/metrics/collector.d.ts +27 -0
- package/dist/core/notification/os-notify/index.d.ts +7 -0
- package/dist/core/notification/os-notify/notifier.d.ts +7 -0
- package/dist/core/notification/os-notify/platform-resolver.d.ts +7 -0
- package/dist/core/notification/os-notify/platform.d.ts +7 -0
- package/dist/core/notification/os-notify/sound-player.d.ts +7 -0
- package/dist/core/notification/os-notify/todo-checker.d.ts +5 -0
- package/dist/core/notification/task-toast-manager.d.ts +127 -0
- package/dist/core/notification/toast-core.d.ts +36 -0
- package/dist/core/notification/toast.d.ts +9 -0
- package/dist/core/orchestrator/index.d.ts +6 -0
- package/dist/core/orchestrator/interfaces/index.d.ts +4 -0
- package/dist/core/orchestrator/interfaces/session-state.d.ts +11 -0
- package/dist/core/orchestrator/session-manager.d.ts +31 -0
- package/dist/core/orchestrator/state.d.ts +10 -0
- package/dist/core/orchestrator/types/index.d.ts +4 -0
- package/dist/core/orchestrator/types/task-status.d.ts +5 -0
- package/dist/core/plugins/interfaces.d.ts +30 -0
- package/dist/core/plugins/plugin-manager.d.ts +21 -0
- package/dist/core/progress/calculator.d.ts +11 -0
- package/dist/core/progress/formatters.d.ts +20 -0
- 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 +6 -0
- package/dist/core/progress/progress-notifier.d.ts +14 -0
- package/dist/core/progress/state-broadcaster.d.ts +29 -0
- package/dist/core/progress/store.d.ts +28 -0
- package/dist/core/progress/tracker.d.ts +11 -0
- package/dist/core/queue/async-queue.d.ts +46 -0
- package/dist/core/queue/async-utils.d.ts +20 -0
- package/dist/core/queue/index.d.ts +8 -0
- package/dist/core/queue/work-pool.d.ts +19 -0
- package/dist/core/recovery/auto-recovery.d.ts +9 -0
- package/dist/core/recovery/constants.d.ts +9 -0
- package/dist/core/recovery/handler.d.ts +27 -0
- 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 +25 -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 +6 -0
- package/dist/core/recovery/patterns.d.ts +8 -0
- package/dist/core/recovery/retry.d.ts +59 -0
- package/dist/core/recovery/session-recovery.d.ts +30 -0
- 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 +6 -0
- package/dist/core/session/shared-context.d.ts +8 -0
- package/dist/core/session/store.d.ts +44 -0
- package/dist/core/session/summary.d.ts +7 -0
- package/dist/core/sync/todo-parser.d.ts +5 -0
- package/dist/core/sync/todo-sync-service.d.ts +35 -0
- 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 +6 -0
- package/dist/core/task/parser.d.ts +8 -0
- package/dist/core/task/scheduler.d.ts +12 -0
- package/dist/core/task/store.d.ts +32 -0
- package/dist/core/task/summary.d.ts +7 -0
- package/dist/core/task/task-decomposer.d.ts +10 -0
- package/dist/core/todo/todo-manager.d.ts +36 -0
- package/dist/hooks/compatibility/external-plugin.d.ts +10 -0
- package/dist/hooks/constants.d.ts +27 -0
- package/dist/hooks/custom/agent-ui.d.ts +20 -0
- package/dist/hooks/custom/memory-gate.d.ts +21 -0
- package/dist/hooks/custom/metrics.d.ts +14 -0
- package/dist/hooks/custom/resource-control.d.ts +13 -0
- package/dist/hooks/custom/secret-scanner.d.ts +19 -0
- package/dist/hooks/custom/strict-role-guard.d.ts +21 -0
- package/dist/hooks/custom/user-activity.d.ts +11 -0
- package/dist/hooks/features/mission-loop.d.ts +18 -0
- package/dist/hooks/features/sanity-check.d.ts +15 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/registry.d.ts +37 -0
- package/dist/hooks/types.d.ts +72 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +27188 -6225
- package/dist/plugin-handlers/assistant-done-handler.d.ts +12 -0
- package/dist/plugin-handlers/chat-message-handler.d.ts +30 -0
- package/dist/plugin-handlers/config-handler.d.ts +9 -0
- package/dist/plugin-handlers/event-handler.d.ts +18 -0
- package/dist/plugin-handlers/index.d.ts +9 -0
- 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 +12 -0
- package/dist/plugin-handlers/interfaces/orchestrator-state.d.ts +14 -0
- package/dist/plugin-handlers/interfaces/session-compacting.d.ts +19 -0
- package/dist/plugin-handlers/interfaces/session-state.d.ts +15 -0
- package/dist/plugin-handlers/interfaces/system-transform.d.ts +17 -0
- package/dist/plugin-handlers/interfaces/tool-execute-context.d.ts +8 -0
- package/dist/plugin-handlers/interfaces/tool-hook.d.ts +14 -0
- package/dist/plugin-handlers/session-compacting-handler.d.ts +14 -0
- package/dist/plugin-handlers/system-transform-handler.d.ts +14 -0
- package/dist/plugin-handlers/tool-execute-handler.d.ts +14 -0
- package/dist/plugin-handlers/tool-execute-pre-handler.d.ts +8 -0
- package/dist/scripts/postinstall.js +29 -125
- package/dist/shared/command/index.d.ts +0 -1
- package/dist/shared/constants/system-messages.d.ts +4 -4
- package/dist/shared/core/constants/index.d.ts +0 -4
- package/dist/shared/errors/constants/error-patterns.d.ts +13 -0
- package/dist/shared/errors/constants/error-type.d.ts +13 -0
- package/dist/shared/errors/constants/index.d.ts +5 -0
- package/dist/shared/errors/detection.d.ts +5 -0
- package/dist/shared/errors/index.d.ts +7 -0
- package/dist/shared/errors/retry.d.ts +7 -0
- package/dist/shared/errors/types/error-pattern-type.d.ts +5 -0
- package/dist/shared/errors/types/index.d.ts +4 -0
- package/dist/shared/index.d.ts +8 -7
- package/dist/shared/loop/constants/index.d.ts +7 -0
- package/dist/shared/loop/constants/labels.d.ts +33 -0
- package/dist/shared/loop/constants/loop.d.ts +17 -0
- package/dist/shared/loop/constants/mission-control.d.ts +20 -0
- package/dist/shared/loop/constants/todo-status.d.ts +9 -0
- package/dist/shared/loop/index.d.ts +6 -0
- package/dist/shared/loop/interfaces/index.d.ts +6 -0
- package/dist/shared/loop/interfaces/mission-loop.d.ts +29 -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 +8 -0
- package/dist/shared/message/constants/message-roles.d.ts +23 -0
- package/dist/shared/message/constants/part-types.d.ts +13 -0
- package/dist/shared/message/constants/plugin-hooks.d.ts +15 -0
- package/dist/shared/message/constants/prompts.d.ts +8 -0
- package/dist/shared/message/constants/slash-commands.d.ts +21 -0
- package/dist/shared/message/index.d.ts +4 -0
- package/dist/shared/notification/constants/index.d.ts +3 -0
- package/dist/shared/notification/constants/toast-duration.d.ts +19 -0
- package/dist/shared/notification/constants/toast-variants.d.ts +10 -0
- package/dist/shared/notification/constants/tui.const.d.ts +24 -0
- package/dist/shared/notification/index.d.ts +7 -0
- package/dist/shared/notification/interfaces/index.d.ts +6 -0
- package/dist/shared/notification/interfaces/task-toast.interface.d.ts +18 -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/os-notify/constants/index.d.ts +6 -0
- package/dist/shared/notification/os-notify/constants/notification-command-keys.d.ts +11 -0
- package/dist/shared/notification/os-notify/constants/notification-commands.d.ts +11 -0
- package/dist/shared/notification/os-notify/constants/notification-defaults.d.ts +5 -0
- package/dist/shared/notification/os-notify/index.d.ts +6 -0
- package/dist/shared/notification/os-notify/interfaces/index.d.ts +5 -0
- package/dist/shared/notification/os-notify/interfaces/notification-config.d.ts +15 -0
- package/dist/shared/notification/os-notify/interfaces/notification-state.d.ts +13 -0
- package/dist/shared/notification/os-notify/types/index.d.ts +4 -0
- package/dist/shared/notification/os-notify/types/notification-commands.d.ts +5 -0
- package/dist/shared/notification/presets/index.d.ts +9 -0
- package/dist/shared/notification/presets/mission.d.ts +5 -0
- package/dist/shared/notification/presets/parallel.d.ts +6 -0
- package/dist/shared/notification/presets/session.d.ts +6 -0
- package/dist/shared/notification/presets/task-lifecycle.d.ts +7 -0
- package/dist/shared/notification/presets/tools.d.ts +6 -0
- package/dist/shared/notification/presets/warnings.d.ts +7 -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/os/constants/index.d.ts +4 -0
- package/dist/shared/{core/constants/os.d.ts → os/constants/platform.d.ts} +3 -4
- package/dist/shared/os/index.d.ts +5 -0
- package/dist/shared/os/types/index.d.ts +4 -0
- package/dist/shared/os/types/platform.d.ts +5 -0
- package/dist/shared/prompt/constants/tags.d.ts +0 -4
- package/dist/shared/prompt/index.d.ts +0 -1
- package/dist/shared/recovery/constants/history.d.ts +11 -0
- package/dist/shared/recovery/constants/index.d.ts +6 -0
- package/dist/shared/recovery/constants/recovery-level.d.ts +15 -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/events/index.d.ts +0 -5
- package/dist/shared/session/constants/index.d.ts +0 -2
- package/dist/shared/session/index.d.ts +0 -1
- package/dist/shared/task/constants/parallel-task.d.ts +4 -5
- package/dist/shared/verification/constants/categories.d.ts +95 -0
- package/dist/shared/verification/constants/checklist.d.ts +16 -0
- package/dist/shared/verification/constants/index.d.ts +7 -0
- package/dist/shared/verification/constants/patterns.d.ts +19 -0
- package/dist/shared/verification/constants/signals.d.ts +10 -0
- package/dist/shared/verification/index.d.ts +8 -0
- package/dist/shared/verification/interfaces/checklist-item.d.ts +21 -0
- package/dist/shared/verification/interfaces/checklist-verification-result.d.ts +24 -0
- package/dist/shared/verification/interfaces/index.d.ts +7 -0
- package/dist/shared/verification/interfaces/verification-checklist.d.ts +19 -0
- package/dist/shared/verification/interfaces/verification-result.d.ts +29 -0
- package/dist/shared/verification/types/checklist-category.d.ts +18 -0
- package/dist/shared/verification/types/index.d.ts +4 -0
- package/dist/tools/parallel/list-agents.d.ts +1 -1
- package/dist/tools/parallel/show-metrics.d.ts +10 -0
- package/dist/tools/parallel/update-todo.d.ts +7 -0
- package/dist/utils/common.d.ts +5 -3
- package/dist/utils/compatibility/claude.d.ts +9 -0
- 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/checker.d.ts +8 -0
- package/dist/utils/sanity/constants/escalation-prompt.d.ts +4 -0
- package/dist/utils/sanity/constants/index.d.ts +6 -0
- package/dist/utils/sanity/constants/recovery-prompt.d.ts +4 -0
- package/dist/utils/sanity/constants/severity.d.ts +8 -0
- package/dist/utils/sanity/index.d.ts +7 -0
- package/dist/utils/sanity/interfaces/index.d.ts +4 -0
- package/dist/utils/sanity/interfaces/sanity-result.d.ts +9 -0
- package/dist/utils/sanity/types/index.d.ts +4 -0
- package/dist/utils/sanity/types/severity.d.ts +5 -0
- package/package.json +3 -3
- package/dist/core/agents/adaptive-concurrency.d.ts +0 -57
- package/dist/core/agents/unified-task-executor.d.ts +0 -27
- package/dist/core/mission/mission-controller.d.ts +0 -53
- package/dist/core/resource/resource-tracker.d.ts +0 -61
- package/dist/shared/command/constants/names.d.ts +0 -8
- package/dist/shared/core/constants/labels.d.ts +0 -12
- package/dist/shared/core/constants/mission.d.ts +0 -8
- package/dist/shared/core/constants/signals.d.ts +0 -22
- package/dist/shared/prompt/constants/prompts.d.ts +0 -7
- package/dist/shared/session/constants/events/hook-events.d.ts +0 -9
- package/dist/shared/session/constants/message.d.ts +0 -15
- package/dist/shared/session/constants/status.d.ts +0 -9
- /package/dist/{shared/task/constants/task-status.d.ts → core/agents/consts/task-status.const.d.ts} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sanity Check Hook
|
|
3
|
+
* Implements output anomaly detection.
|
|
4
|
+
*/
|
|
5
|
+
import type { PostToolUseHook, AssistantDoneHook, HookContext } from "../types.js";
|
|
6
|
+
export declare class SanityCheckHook implements PostToolUseHook, AssistantDoneHook {
|
|
7
|
+
name: "SanityCheck";
|
|
8
|
+
execute(ctx: HookContext, toolOrText: string, input?: any, output?: {
|
|
9
|
+
title: string;
|
|
10
|
+
output: string;
|
|
11
|
+
metadata: any;
|
|
12
|
+
}): Promise<any>;
|
|
13
|
+
private checkToolOutput;
|
|
14
|
+
private checkFinalText;
|
|
15
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook Registry
|
|
3
|
+
* Manages registration and execution of hooks with priority and dependency support.
|
|
4
|
+
*/
|
|
5
|
+
import type { PreToolUseHook, PostToolUseHook, ChatMessageHook, AssistantDoneHook, HookContext, HookResult, HookMetadata } from "./types.js";
|
|
6
|
+
import { HOOK_ACTIONS } from "./constants.js";
|
|
7
|
+
export declare class HookRegistry {
|
|
8
|
+
private static instance;
|
|
9
|
+
private preToolHooks;
|
|
10
|
+
private postToolHooks;
|
|
11
|
+
private chatHooks;
|
|
12
|
+
private doneHooks;
|
|
13
|
+
private constructor();
|
|
14
|
+
static getInstance(): HookRegistry;
|
|
15
|
+
registerPreTool(hook: PreToolUseHook, metadata?: Partial<HookMetadata>): void;
|
|
16
|
+
registerPostTool(hook: PostToolUseHook, metadata?: Partial<HookMetadata>): void;
|
|
17
|
+
registerChat(hook: ChatMessageHook, metadata?: Partial<HookMetadata>): void;
|
|
18
|
+
registerDone(hook: AssistantDoneHook, metadata?: Partial<HookMetadata>): void;
|
|
19
|
+
private prepareMetadata;
|
|
20
|
+
private sortHooks;
|
|
21
|
+
private topologicalSort;
|
|
22
|
+
executePreTool(ctx: HookContext, tool: string, args: Record<string, unknown>): Promise<{
|
|
23
|
+
action: typeof HOOK_ACTIONS.ALLOW | typeof HOOK_ACTIONS.BLOCK | typeof HOOK_ACTIONS.MODIFY;
|
|
24
|
+
modifiedArgs?: Record<string, unknown>;
|
|
25
|
+
reason?: string;
|
|
26
|
+
}>;
|
|
27
|
+
executePostTool(ctx: HookContext, tool: string, input: Record<string, unknown>, output: {
|
|
28
|
+
title: string;
|
|
29
|
+
output: string;
|
|
30
|
+
metadata: Record<string, unknown>;
|
|
31
|
+
}): Promise<void>;
|
|
32
|
+
executeChat(ctx: HookContext, message: string): Promise<{
|
|
33
|
+
action: typeof HOOK_ACTIONS.PROCESS | typeof HOOK_ACTIONS.INTERCEPT;
|
|
34
|
+
modifiedMessage?: string;
|
|
35
|
+
}>;
|
|
36
|
+
executeDone(ctx: HookContext, finalText: string): Promise<HookResult>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook System Types
|
|
3
|
+
* Defines the contract for all hooks in the system.
|
|
4
|
+
*/
|
|
5
|
+
import { HOOK_ACTIONS } from "./constants.js";
|
|
6
|
+
export interface HookContext {
|
|
7
|
+
sessionID: string;
|
|
8
|
+
agent?: string;
|
|
9
|
+
directory: string;
|
|
10
|
+
sessions: Map<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
export interface HookMetadata {
|
|
13
|
+
name: string;
|
|
14
|
+
priority: number;
|
|
15
|
+
phase?: "early" | "normal" | "late";
|
|
16
|
+
dependencies?: string[];
|
|
17
|
+
errorHandling?: "continue" | "stop" | "retry";
|
|
18
|
+
}
|
|
19
|
+
export type HookResult = {
|
|
20
|
+
action: typeof HOOK_ACTIONS.CONTINUE;
|
|
21
|
+
} | {
|
|
22
|
+
action: typeof HOOK_ACTIONS.STOP;
|
|
23
|
+
reason?: string;
|
|
24
|
+
} | {
|
|
25
|
+
action: typeof HOOK_ACTIONS.INJECT;
|
|
26
|
+
prompts: string[];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Pre-Tool Execution Hook
|
|
30
|
+
* Runs before a tool is executed. Can block execution or modify arguments.
|
|
31
|
+
*/
|
|
32
|
+
export interface PreToolUseHook {
|
|
33
|
+
name: string;
|
|
34
|
+
execute(context: HookContext, tool: string, args: Record<string, unknown>): Promise<{
|
|
35
|
+
action: typeof HOOK_ACTIONS.ALLOW | typeof HOOK_ACTIONS.BLOCK | typeof HOOK_ACTIONS.MODIFY;
|
|
36
|
+
modifiedArgs?: Record<string, unknown>;
|
|
37
|
+
reason?: string;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Post-Tool Execution Hook
|
|
42
|
+
* Runs after a tool is executed. Can analyze output or trigger side effects.
|
|
43
|
+
*/
|
|
44
|
+
export interface PostToolUseHook {
|
|
45
|
+
name: string;
|
|
46
|
+
execute(context: HookContext, tool: string, input: Record<string, unknown>, output: {
|
|
47
|
+
title: string;
|
|
48
|
+
output: string;
|
|
49
|
+
metadata: Record<string, unknown>;
|
|
50
|
+
}): Promise<{
|
|
51
|
+
output?: string;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Chat Message Hook
|
|
56
|
+
* Runs when a user sends a message. Can intercept commands.
|
|
57
|
+
*/
|
|
58
|
+
export interface ChatMessageHook {
|
|
59
|
+
name: string;
|
|
60
|
+
execute(context: HookContext, message: string): Promise<{
|
|
61
|
+
action: typeof HOOK_ACTIONS.PROCESS | typeof HOOK_ACTIONS.INTERCEPT;
|
|
62
|
+
modifiedMessage?: string;
|
|
63
|
+
}>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Assistant Done Hook
|
|
67
|
+
* Runs when the assistant finishes a turn. Can inject continuation prompts.
|
|
68
|
+
*/
|
|
69
|
+
export interface AssistantDoneHook {
|
|
70
|
+
name: string;
|
|
71
|
+
execute(context: HookContext, finalText: string): Promise<HookResult>;
|
|
72
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenCode Orchestrator Plugin
|
|
3
|
+
*
|
|
4
|
+
* This is the main entry point for the 4-Agent consolidated architecture.
|
|
5
|
+
* Handlers are modularized in src/plugin-handlers/ for maintainability.
|
|
6
|
+
*
|
|
7
|
+
* The agents are: Commander, Planner, Worker, Reviewer
|
|
8
|
+
*/
|
|
1
9
|
import type { Plugin } from "@opencode-ai/plugin";
|
|
2
10
|
declare const OrchestratorPlugin: Plugin;
|
|
3
11
|
export default OrchestratorPlugin;
|