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.
@@ -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: MessageWithParts[];
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 plan or research
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 research
14034
- - If context is insufficient, read the files; only ask for missing inputs you cannot retrieve
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 !== false;
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
- if (!enabled)
14623
- return;
14624
- const { messages } = output;
14625
- if (messages.length === 0)
14626
- return;
14627
- let lastUserMessageIndex = -1;
14628
- for (let i = messages.length - 1;i >= 0; i--) {
14629
- if (messages[i].info.role === "user") {
14630
- lastUserMessageIndex = i;
14631
- break;
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
- if (lastUserMessageIndex === -1)
14635
- return;
14636
- const lastUserMessage = messages[lastUserMessageIndex];
14637
- const agent = lastUserMessage.info.agent;
14638
- if (agent && agent !== "architect")
14639
- return;
14640
- const textPartIndex = lastUserMessage.parts.findIndex((p) => p.type === "text" && p.text !== undefined);
14641
- if (textPartIndex === -1)
14642
- return;
14643
- const originalText = lastUserMessage.parts[textPartIndex].text ?? "";
14644
- lastUserMessage.parts[textPartIndex].text = `${PHASE_REMINDER}
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.12",
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",