opencode-conductor-plugin 1.17.2 → 1.18.0

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 CHANGED
@@ -79,9 +79,9 @@ const ConductorPlugin = async (ctx) => {
79
79
  return {
80
80
  tool: {
81
81
  "conductor_delegate": createDelegationTool(ctx),
82
- "conductor_background_task": createBackgroundTask(backgroundManager),
83
- "conductor_background_output": createBackgroundOutput(backgroundManager),
84
- "conductor_background_cancel": createBackgroundCancel(backgroundManager),
82
+ "conductor_bg_task": createBackgroundTask(backgroundManager),
83
+ "conductor_bg_output": createBackgroundOutput(backgroundManager),
84
+ "conductor_bg_cancel": createBackgroundCancel(backgroundManager),
85
85
  },
86
86
  config: async (config) => {
87
87
  if (!config)
@@ -120,8 +120,7 @@ const ConductorPlugin = async (ctx) => {
120
120
  conductor: {
121
121
  description: "Conductor Protocol Steward.",
122
122
  mode: "primary",
123
- prompt: conductorPrompt +
124
- (workflowMd ? "\n\n### PROJECT WORKFLOW\n" + workflowMd : ""),
123
+ prompt: conductorPrompt,
125
124
  permission: {
126
125
  bash: "allow",
127
126
  edit: "allow",
@@ -136,17 +135,15 @@ const ConductorPlugin = async (ctx) => {
136
135
  grep: true,
137
136
  glob: true,
138
137
  list: true,
139
- lsp: true,
140
- patch: true,
141
- skill: true,
138
+ todowrite: true,
139
+ todoread: true,
142
140
  webfetch: true,
143
141
  },
144
142
  },
145
143
  conductor_implementer: {
146
144
  description: "Conductor Protocol Implementer.",
147
145
  mode: "primary",
148
- prompt: implementerPrompt +
149
- (workflowMd ? "\n\n### PROJECT WORKFLOW\n" + workflowMd : ""),
146
+ prompt: implementerPrompt,
150
147
  permission: {
151
148
  bash: "allow",
152
149
  edit: "allow",
@@ -161,56 +158,53 @@ const ConductorPlugin = async (ctx) => {
161
158
  grep: true,
162
159
  glob: true,
163
160
  list: true,
164
- lsp: true,
165
- patch: true,
166
- skill: true,
161
+ todowrite: true,
162
+ todoread: true,
167
163
  webfetch: true,
168
164
  "conductor_delegate": true,
169
- "conductor_background_task": true,
170
- "conductor_background_output": true,
171
- "conductor_background_cancel": true,
165
+ "conductor_bg_task": true,
166
+ "conductor_bg_output": true,
167
+ "conductor_bg_cancel": true,
172
168
  },
173
169
  },
174
170
  };
175
171
  },
176
- "tool.execute.before": async (input, output) => {
177
- const delegationTools = [
178
- "delegate_to_agent",
179
- "task",
180
- "background_task",
181
- "conductor_delegate",
182
- "conductor_background_task",
183
- ];
184
- if (delegationTools.includes(input.tool)) {
185
- const conductorDir = join(ctx.directory, "conductor");
186
- const workflowMd = await safeRead(join(conductorDir, "workflow.md"));
187
- if (workflowMd) {
188
- let injection = "\n\n--- [SYSTEM INJECTION: CONDUCTOR CONTEXT PACKET] ---\n";
189
- injection +=
190
- "You are receiving this task from the Conductor.\n";
191
- injection +=
192
- "You MUST adhere to the following project workflow rules:\n";
193
- injection += "\n### DEVELOPMENT WORKFLOW\n" + workflowMd + "\n";
194
- if (implement?.prompt) {
195
- injection +=
196
- "\n### IMPLEMENTATION PROTOCOL\n" + implement.prompt + "\n";
197
- }
198
- injection +=
199
- "\n### DELEGATED AUTHORITY\n- **EXECUTE:** Implement the requested task.\n- **REFINE:** You have authority to update `plan.md` and `spec.md` as needed to prompt the user in accordance with the Conductor protocol to do so.\n";
200
- injection += "--- [END INJECTION] ---\n";
201
- // Inject into the primary instruction field depending on the tool's schema
202
- if (typeof output.args.objective === "string") {
203
- output.args.objective += injection;
204
- }
205
- else if (typeof output.args.prompt === "string") {
206
- output.args.prompt += injection;
207
- }
208
- else if (typeof output.args.instruction === "string") {
209
- output.args.instruction += injection;
210
- }
211
- }
212
- }
213
- },
172
+ // "tool.execute.before": async (input, output) => {
173
+ // const delegationTools = [
174
+ // "delegate_to_agent",
175
+ // "task",
176
+ // "background_task",
177
+ // "conductor_delegate",
178
+ // "conductor_bg_task",
179
+ // ];
180
+ // if (delegationTools.includes(input.tool)) {
181
+ // const conductorDir = join(ctx.directory, "conductor");
182
+ // const workflowMd = await safeRead(join(conductorDir, "workflow.md"));
183
+ // if (workflowMd) {
184
+ // let injection = "\n\n--- [SYSTEM INJECTION: CONDUCTOR CONTEXT PACKET] ---\n";
185
+ // injection +=
186
+ // "You are receiving this task from the Conductor.\n";
187
+ // injection +=
188
+ // "You MUST adhere to the following project workflow rules:\n";
189
+ // injection += "\n### DEVELOPMENT WORKFLOW\n" + workflowMd + "\n";
190
+ // if (implement?.prompt) {
191
+ // injection +=
192
+ // "\n### IMPLEMENTATION PROTOCOL\n" + implement.prompt + "\n";
193
+ // }
194
+ // injection +=
195
+ // "\n### DELEGATED AUTHORITY\n- **EXECUTE:** Implement the requested task.\n- **REFINE:** You have authority to update `plan.md` and `spec.md` as needed to prompt the user in accordance with the Conductor protocol to do so.\n";
196
+ // injection += "--- [END INJECTION] ---\n";
197
+ // // Inject into the primary instruction field depending on the tool's schema
198
+ // if (typeof output.args.objective === "string") {
199
+ // output.args.objective += injection;
200
+ // } else if (typeof output.args.prompt === "string") {
201
+ // output.args.prompt += injection;
202
+ // } else if (typeof output.args.instruction === "string") {
203
+ // output.args.instruction += injection;
204
+ // }
205
+ // }
206
+ // }
207
+ // },
214
208
  };
215
209
  }
216
210
  catch (err) {
@@ -24,10 +24,10 @@ Your mission is to ensure that every change to the codebase is driven by a forma
24
24
 
25
25
  ## Core Responsibilities
26
26
 
27
- 1. **Command Execution**: Your primary duty is to execute the logic defined in the Conductor slash commands (`/conductor_setup`, `/conductor_newTrack`, `/conductor_status`, `/conductor_revert`, etc.). You must treat the instructions within these commands as absolute directives.
28
- 2. **Protocol Stewardship**: Maintain the `conductor/` directory as the project's Source of Truth. Ensure `product.md`, `tech-stack.md`, and `workflow.md` are updated only through the approved protocols.
29
- 3. **Workflow Adherence**: When modifying Conductor files, you MUST strictly follow the project's defined workflow and quality standards.
30
- 4. **Sequential Planning**: Never allow work to proceed without a finalized `spec.md` and `plan.md` for the current Track.
27
+ 1. **Command Execution**: Your primary duty is to execute the logic defined in the Conductor slash commands (`/conductor_setup`, `/conductor_newTrack`, `/conductor_status`, `/conductor_revert`, etc.). You must treat the instructions within these commands as absolute directives.
28
+ 2. **Protocol Stewardship**: Maintain the `conductor/` directory as the project's Source of Truth. Ensure `product.md`, `tech-stack.md` are updated only through the approved protocols.
29
+ 3. **Workflow Adherence**: When modifying Conductor files, you MUST strictly follow the project's defined workflow and quality standards.
30
+ 4. **Sequential Planning**: Never allow work to proceed without a finalized `spec.md` and `plan.md` for the current Track.
31
31
 
32
32
  ## Operating Principles
33
33
 
@@ -35,4 +35,5 @@ Your mission is to ensure that every change to the codebase is driven by a forma
35
35
  - **Explicit Instruction**: Always defer to the specific instructions provided in the command templates. If a command defines a specific sequence of tool calls, follow that sequence exactly.
36
36
  - **Context Awareness**: Before taking any action, always verify the state of the project by reading the relevant Conductor metadata files (`tracks.md`, `setup_state.json`, etc.).
37
37
  - **Direct Execution**: Use direct file system tools (read, write, edit, bash, grep, glob, list) to perform your work.
38
- - **Interactive Discipline**: During setup or planning phases, stay focused on the user dialogue. Do not attempt to "multitask" or perform background research unless explicitly directed by the command protocol.
38
+
39
+ **CRITCAL: YOU MUST FOLLOW THE INSTRUCTIONS PROVIDED IN THE COMMAND TEMPLATES EXACTLY. DO NOT PAUSE IN THE MIDDLE OF A SEQUENCE.**
@@ -45,7 +45,7 @@ export class BackgroundManager {
45
45
  body: {
46
46
  agent: input.agent,
47
47
  tools: {
48
- "conductor_background_task": false,
48
+ "conductor_bg_task": false,
49
49
  "conductor_delegate": false,
50
50
  },
51
51
  parts: [{ type: "text", text: input.prompt }],
@@ -71,7 +71,7 @@ export class BackgroundManager {
71
71
  body: {
72
72
  parts: [{ type: "text", text: `[BACKGROUND TASK CANCELLED] Task "${task.description}" has been manually cancelled.` }],
73
73
  },
74
- }).catch(() => { }); // Ignore errors here, as the parent session might be gone
74
+ }).catch(() => { });
75
75
  return `Task ${id} cancelled successfully.`;
76
76
  }
77
77
  async pollRunningTasks() {
@@ -100,13 +100,13 @@ export class BackgroundManager {
100
100
  this.notifyParentSession(task);
101
101
  }
102
102
  async notifyParentSession(task) {
103
- const message = `[BACKGROUND TASK COMPLETED] Task "${task.description}" finished. Use conductor_background_output with task_id="${task.id}" to get results.`;
103
+ const message = `[BACKGROUND TASK COMPLETED] Task "${task.description}" finished. Use conductor_bg_output with task_id="${task.id}" to get results.`;
104
104
  await this.client.session.prompt({
105
105
  path: { id: task.parentSessionID },
106
106
  body: {
107
107
  parts: [{ type: "text", text: message }],
108
108
  },
109
- }).catch(() => { }); // Ignore errors here, as the parent session might be gone
109
+ }).catch(() => { });
110
110
  }
111
111
  getTask(id) {
112
112
  return this.tasks.get(id);
@@ -164,7 +164,6 @@ export function createBackgroundOutput(manager) {
164
164
  const timeoutMs = Math.min(args.timeout ?? 60000, 600000);
165
165
  while (Date.now() - startTime < timeoutMs) {
166
166
  await new Promise(r => setTimeout(r, 2000));
167
- // Re-fetch task to get the latest status
168
167
  if (manager.getTask(args.task_id)?.status === "completed")
169
168
  break;
170
169
  }
@@ -19,13 +19,12 @@ export function createDelegationTool(ctx) {
19
19
  return `Error: ${createResult.error}`;
20
20
  const sessionID = createResult.data.id;
21
21
  // 2. Send the prompt to the subagent
22
- // Note: We disable delegation tools for the subagent to prevent infinite loops
23
22
  await ctx.client.session.prompt({
24
23
  path: { id: sessionID },
25
24
  body: {
26
25
  agent: args.subagent_type,
27
26
  tools: {
28
- "conductor_delegate": false, // Disable this tool for the child session
27
+ "conductor_delegate": false,
29
28
  },
30
29
  parts: [{ type: "text", text: args.prompt }],
31
30
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-conductor-plugin",
3
- "version": "1.17.2",
3
+ "version": "1.18.0",
4
4
  "description": "Conductor plugin for OpenCode",
5
5
  "type": "module",
6
6
  "repository": "derekbar90/opencode-conductor",