opencode-swarm 1.0.12 → 1.0.14
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 +33 -26
- 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
|
@@ -14025,13 +14025,15 @@ var CODER_PROMPT = `You are Coder - a fast, focused implementation specialist.
|
|
|
14025
14025
|
**Behavior**:
|
|
14026
14026
|
- Read files before using edit/write tools and gather exact content before making changes
|
|
14027
14027
|
- Execute the task specification provided by the Architect
|
|
14028
|
-
- Be fast and direct - implement, don't
|
|
14028
|
+
- Be fast and direct - implement the code, don't research or look up documentation
|
|
14029
14029
|
- Report completion with summary of changes
|
|
14030
14030
|
|
|
14031
14031
|
**Constraints**:
|
|
14032
14032
|
- No delegation to other agents
|
|
14033
|
-
- No external
|
|
14034
|
-
-
|
|
14033
|
+
- No web searches or fetching external URLs
|
|
14034
|
+
- No looking up documentation online
|
|
14035
|
+
- Just write the code based on the specification you received
|
|
14036
|
+
- If you don't know an API, use your training knowledge or make reasonable choices
|
|
14035
14037
|
|
|
14036
14038
|
**Output Format**:
|
|
14037
14039
|
<summary>
|
|
@@ -14616,36 +14618,41 @@ DELEGATION RULES:
|
|
|
14616
14618
|
- Always wait for response before next delegation
|
|
14617
14619
|
</swarm_reminder>`;
|
|
14618
14620
|
function createPipelineTrackerHook(config2) {
|
|
14619
|
-
const enabled = config2.inject_phase_reminders
|
|
14621
|
+
const enabled = config2.inject_phase_reminders === true;
|
|
14622
|
+
if (!enabled) {
|
|
14623
|
+
return {};
|
|
14624
|
+
}
|
|
14620
14625
|
return {
|
|
14621
14626
|
"experimental.chat.messages.transform": async (_input, output) => {
|
|
14622
|
-
|
|
14623
|
-
|
|
14624
|
-
|
|
14625
|
-
|
|
14626
|
-
|
|
14627
|
-
|
|
14628
|
-
|
|
14629
|
-
|
|
14630
|
-
|
|
14631
|
-
|
|
14627
|
+
try {
|
|
14628
|
+
const messages = output?.messages;
|
|
14629
|
+
if (!messages || messages.length === 0)
|
|
14630
|
+
return;
|
|
14631
|
+
let lastUserMessageIndex = -1;
|
|
14632
|
+
for (let i = messages.length - 1;i >= 0; i--) {
|
|
14633
|
+
if (messages[i]?.info?.role === "user") {
|
|
14634
|
+
lastUserMessageIndex = i;
|
|
14635
|
+
break;
|
|
14636
|
+
}
|
|
14632
14637
|
}
|
|
14633
|
-
|
|
14634
|
-
|
|
14635
|
-
|
|
14636
|
-
|
|
14637
|
-
|
|
14638
|
-
|
|
14639
|
-
|
|
14640
|
-
|
|
14641
|
-
|
|
14642
|
-
|
|
14643
|
-
|
|
14644
|
-
|
|
14638
|
+
if (lastUserMessageIndex === -1)
|
|
14639
|
+
return;
|
|
14640
|
+
const lastUserMessage = messages[lastUserMessageIndex];
|
|
14641
|
+
if (!lastUserMessage?.parts)
|
|
14642
|
+
return;
|
|
14643
|
+
const agent = lastUserMessage.info?.agent;
|
|
14644
|
+
if (agent && agent !== "architect")
|
|
14645
|
+
return;
|
|
14646
|
+
const textPartIndex = lastUserMessage.parts.findIndex((p) => p?.type === "text" && p.text !== undefined);
|
|
14647
|
+
if (textPartIndex === -1)
|
|
14648
|
+
return;
|
|
14649
|
+
const originalText = lastUserMessage.parts[textPartIndex].text ?? "";
|
|
14650
|
+
lastUserMessage.parts[textPartIndex].text = `${PHASE_REMINDER}
|
|
14645
14651
|
|
|
14646
14652
|
---
|
|
14647
14653
|
|
|
14648
14654
|
${originalText}`;
|
|
14655
|
+
} catch {}
|
|
14649
14656
|
}
|
|
14650
14657
|
};
|
|
14651
14658
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
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",
|