opencode-orchestrator 0.8.9 → 0.8.10
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/dist/index.d.ts +1 -5
- package/dist/index.js +1627 -1599
- package/dist/plugin-handlers/assistant-done-handler.d.ts +21 -0
- package/dist/plugin-handlers/chat-message-handler.d.ts +21 -0
- package/dist/plugin-handlers/config-handler.d.ts +9 -0
- package/dist/plugin-handlers/event-handler.d.ts +43 -0
- package/dist/plugin-handlers/index.d.ts +10 -0
- package/dist/plugin-handlers/tool-execute-handler.d.ts +25 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Handlers - Assistant Done Handler
|
|
3
|
+
*
|
|
4
|
+
* Handles assistant.done hook:
|
|
5
|
+
* - Sanity checks for final response
|
|
6
|
+
* - Mission seal detection
|
|
7
|
+
* - Continuation prompt injection
|
|
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 AssistantDoneHandlerContext {
|
|
13
|
+
client: OpencodeClient;
|
|
14
|
+
directory: string;
|
|
15
|
+
sessions: Map<string, SessionState>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create assistant.done handler
|
|
19
|
+
*/
|
|
20
|
+
export declare function createAssistantDoneHandler(ctx: AssistantDoneHandlerContext): (assistantInput: any, assistantOutput: any) => Promise<void>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Handlers - Chat Message Handler
|
|
3
|
+
*
|
|
4
|
+
* Handles chat.message hook:
|
|
5
|
+
* - Intercepting commands
|
|
6
|
+
* - Setting up sessions
|
|
7
|
+
* - Auto-applying mission mode for Commander
|
|
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
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create chat.message handler
|
|
19
|
+
*/
|
|
20
|
+
export declare function createChatMessageHandler(ctx: ChatMessageHandlerContext): (msgInput: any, msgOutput: any) => Promise<void>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Handlers - Event Handler
|
|
3
|
+
*
|
|
4
|
+
* Handles all OpenCode events:
|
|
5
|
+
* - session.created, session.deleted, session.error, session.idle
|
|
6
|
+
* - message.updated
|
|
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
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create event handler for session events
|
|
36
|
+
*/
|
|
37
|
+
export declare function createEventHandler(ctx: EventHandlerContext): (input: {
|
|
38
|
+
event: {
|
|
39
|
+
type: string;
|
|
40
|
+
properties?: Record<string, unknown>;
|
|
41
|
+
};
|
|
42
|
+
}) => Promise<void>;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Handlers - Index
|
|
3
|
+
*
|
|
4
|
+
* Exports all plugin handlers for use in main index.ts
|
|
5
|
+
*/
|
|
6
|
+
export { createEventHandler, type SessionState, type OrchestratorState, type EventHandlerContext } from "./event-handler.js";
|
|
7
|
+
export { createConfigHandler } from "./config-handler.js";
|
|
8
|
+
export { createChatMessageHandler, type ChatMessageHandlerContext } from "./chat-message-handler.js";
|
|
9
|
+
export { createToolExecuteAfterHandler, type ToolExecuteHandlerContext } from "./tool-execute-handler.js";
|
|
10
|
+
export { createAssistantDoneHandler, type AssistantDoneHandlerContext } from "./assistant-done-handler.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Handlers - Tool Execute Handler
|
|
3
|
+
*
|
|
4
|
+
* Handles tool.execute.after hook:
|
|
5
|
+
* - Sanity checks for LLM output
|
|
6
|
+
* - Task status tracking
|
|
7
|
+
* - Progress display
|
|
8
|
+
*/
|
|
9
|
+
import type { SessionState } from "./event-handler.js";
|
|
10
|
+
export interface ToolExecuteHandlerContext {
|
|
11
|
+
sessions: Map<string, SessionState>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Create tool.execute.after handler
|
|
15
|
+
*/
|
|
16
|
+
export declare function createToolExecuteAfterHandler(ctx: ToolExecuteHandlerContext): (toolInput: {
|
|
17
|
+
tool: string;
|
|
18
|
+
sessionID: string;
|
|
19
|
+
callID: string;
|
|
20
|
+
arguments?: any;
|
|
21
|
+
}, toolOutput: {
|
|
22
|
+
title: string;
|
|
23
|
+
output: string;
|
|
24
|
+
metadata: any;
|
|
25
|
+
}) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "opencode-orchestrator",
|
|
3
3
|
"displayName": "OpenCode Orchestrator",
|
|
4
4
|
"description": "Distributed Cognitive Architecture for OpenCode. Turns simple prompts into specialized multi-agent workflows (Planner, Coder, Reviewer).",
|
|
5
|
-
"version": "0.8.
|
|
5
|
+
"version": "0.8.10",
|
|
6
6
|
"author": "agnusdei1207",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|