opencode-orchestrator 0.6.9 → 0.6.11
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.js +40 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16910,6 +16910,46 @@ var OrchestratorPlugin = async (input) => {
|
|
|
16910
16910
|
console.log(`[orchestrator] Default agent: ${AGENT_NAMES.COMMANDER}`);
|
|
16911
16911
|
},
|
|
16912
16912
|
// -----------------------------------------------------------------
|
|
16913
|
+
// Event hook - handles OpenCode events (SDK official)
|
|
16914
|
+
// Replaces non-standard session.start/session.end hooks
|
|
16915
|
+
// -----------------------------------------------------------------
|
|
16916
|
+
event: async (input2) => {
|
|
16917
|
+
const { event } = input2;
|
|
16918
|
+
try {
|
|
16919
|
+
const manager = ParallelAgentManager.getInstance();
|
|
16920
|
+
manager.handleEvent(event);
|
|
16921
|
+
} catch {
|
|
16922
|
+
}
|
|
16923
|
+
if (event.type === "session.created") {
|
|
16924
|
+
const sessionID = event.properties?.id || "";
|
|
16925
|
+
log2("[index.ts] event: session.created", { sessionID });
|
|
16926
|
+
presets.missionStarted(`Session ${sessionID.slice(0, 12)}...`);
|
|
16927
|
+
}
|
|
16928
|
+
if (event.type === "session.deleted" || event.type === SESSION_EVENTS.DELETED) {
|
|
16929
|
+
const sessionID = event.properties?.id || event.properties?.info?.id || "";
|
|
16930
|
+
const session = sessions.get(sessionID);
|
|
16931
|
+
if (session) {
|
|
16932
|
+
const totalTime = Date.now() - session.startTime;
|
|
16933
|
+
const duration3 = totalTime < 6e4 ? `${Math.round(totalTime / 1e3)}s` : `${Math.round(totalTime / 6e4)}m`;
|
|
16934
|
+
log2("[index.ts] event: session.deleted", {
|
|
16935
|
+
sessionID,
|
|
16936
|
+
steps: session.step,
|
|
16937
|
+
duration: duration3
|
|
16938
|
+
});
|
|
16939
|
+
sessions.delete(sessionID);
|
|
16940
|
+
state.sessions.delete(sessionID);
|
|
16941
|
+
clearSession(sessionID);
|
|
16942
|
+
presets.sessionCompleted(sessionID, duration3);
|
|
16943
|
+
}
|
|
16944
|
+
}
|
|
16945
|
+
if (event.type === "session.error") {
|
|
16946
|
+
const sessionID = event.properties?.sessionId || "";
|
|
16947
|
+
const error45 = event.properties?.error || "Unknown error";
|
|
16948
|
+
log2("[index.ts] event: session.error", { sessionID, error: error45 });
|
|
16949
|
+
presets.taskFailed("session", error45.slice(0, 50));
|
|
16950
|
+
}
|
|
16951
|
+
},
|
|
16952
|
+
// -----------------------------------------------------------------
|
|
16913
16953
|
// chat.message hook - runs when user sends a message
|
|
16914
16954
|
// This is where we intercept commands and set up sessions
|
|
16915
16955
|
// -----------------------------------------------------------------
|
|
@@ -17171,27 +17211,6 @@ Anomaly count: ${stateSession.anomalyCount}
|
|
|
17171
17211
|
state.missionActive = false;
|
|
17172
17212
|
}
|
|
17173
17213
|
}
|
|
17174
|
-
},
|
|
17175
|
-
// -----------------------------------------------------------------
|
|
17176
|
-
// Event handler - cleans up when sessions are deleted
|
|
17177
|
-
// Uses 'event' hook (not 'handler')
|
|
17178
|
-
// -----------------------------------------------------------------
|
|
17179
|
-
event: async (input2) => {
|
|
17180
|
-
const { event } = input2;
|
|
17181
|
-
try {
|
|
17182
|
-
const manager = ParallelAgentManager.getInstance();
|
|
17183
|
-
manager.handleEvent(event);
|
|
17184
|
-
} catch {
|
|
17185
|
-
}
|
|
17186
|
-
if (event.type === SESSION_EVENTS.DELETED) {
|
|
17187
|
-
const props = event.properties;
|
|
17188
|
-
if (props?.info?.id) {
|
|
17189
|
-
const sessionId = props.info.id;
|
|
17190
|
-
sessions.delete(sessionId);
|
|
17191
|
-
state.sessions.delete(sessionId);
|
|
17192
|
-
clearSession(sessionId);
|
|
17193
|
-
}
|
|
17194
|
-
}
|
|
17195
17214
|
}
|
|
17196
17215
|
};
|
|
17197
17216
|
};
|
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.6.
|
|
5
|
+
"version": "0.6.11",
|
|
6
6
|
"author": "agnusdei1207",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|