opencode-swarm 1.0.12 → 1.0.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/dist/hooks/pipeline-tracker.d.ts +3 -1
- package/dist/index.js +28 -23
- package/package.json +1 -1
|
@@ -27,8 +27,10 @@ interface MessageWithParts {
|
|
|
27
27
|
* Only injects for the architect agent.
|
|
28
28
|
*/
|
|
29
29
|
export declare function createPipelineTrackerHook(config: PluginConfig): {
|
|
30
|
+
'experimental.chat.messages.transform'?: undefined;
|
|
31
|
+
} | {
|
|
30
32
|
'experimental.chat.messages.transform': (_input: Record<string, never>, output: {
|
|
31
|
-
messages
|
|
33
|
+
messages?: MessageWithParts[];
|
|
32
34
|
}) => Promise<void>;
|
|
33
35
|
};
|
|
34
36
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -14616,36 +14616,41 @@ DELEGATION RULES:
|
|
|
14616
14616
|
- Always wait for response before next delegation
|
|
14617
14617
|
</swarm_reminder>`;
|
|
14618
14618
|
function createPipelineTrackerHook(config2) {
|
|
14619
|
-
const enabled = config2.inject_phase_reminders
|
|
14619
|
+
const enabled = config2.inject_phase_reminders === true;
|
|
14620
|
+
if (!enabled) {
|
|
14621
|
+
return {};
|
|
14622
|
+
}
|
|
14620
14623
|
return {
|
|
14621
14624
|
"experimental.chat.messages.transform": async (_input, output) => {
|
|
14622
|
-
|
|
14623
|
-
|
|
14624
|
-
|
|
14625
|
-
|
|
14626
|
-
|
|
14627
|
-
|
|
14628
|
-
|
|
14629
|
-
|
|
14630
|
-
|
|
14631
|
-
|
|
14625
|
+
try {
|
|
14626
|
+
const messages = output?.messages;
|
|
14627
|
+
if (!messages || messages.length === 0)
|
|
14628
|
+
return;
|
|
14629
|
+
let lastUserMessageIndex = -1;
|
|
14630
|
+
for (let i = messages.length - 1;i >= 0; i--) {
|
|
14631
|
+
if (messages[i]?.info?.role === "user") {
|
|
14632
|
+
lastUserMessageIndex = i;
|
|
14633
|
+
break;
|
|
14634
|
+
}
|
|
14632
14635
|
}
|
|
14633
|
-
|
|
14634
|
-
|
|
14635
|
-
|
|
14636
|
-
|
|
14637
|
-
|
|
14638
|
-
|
|
14639
|
-
|
|
14640
|
-
|
|
14641
|
-
|
|
14642
|
-
|
|
14643
|
-
|
|
14644
|
-
|
|
14636
|
+
if (lastUserMessageIndex === -1)
|
|
14637
|
+
return;
|
|
14638
|
+
const lastUserMessage = messages[lastUserMessageIndex];
|
|
14639
|
+
if (!lastUserMessage?.parts)
|
|
14640
|
+
return;
|
|
14641
|
+
const agent = lastUserMessage.info?.agent;
|
|
14642
|
+
if (agent && agent !== "architect")
|
|
14643
|
+
return;
|
|
14644
|
+
const textPartIndex = lastUserMessage.parts.findIndex((p) => p?.type === "text" && p.text !== undefined);
|
|
14645
|
+
if (textPartIndex === -1)
|
|
14646
|
+
return;
|
|
14647
|
+
const originalText = lastUserMessage.parts[textPartIndex].text ?? "";
|
|
14648
|
+
lastUserMessage.parts[textPartIndex].text = `${PHASE_REMINDER}
|
|
14645
14649
|
|
|
14646
14650
|
---
|
|
14647
14651
|
|
|
14648
14652
|
${originalText}`;
|
|
14653
|
+
} catch {}
|
|
14649
14654
|
}
|
|
14650
14655
|
};
|
|
14651
14656
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|