opencode-conductor-plugin 1.17.2 → 1.17.3
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 +11 -13
- package/dist/tools/background.js +4 -5
- package/dist/tools/delegate.js +1 -2
- package/package.json +1 -1
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
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
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)
|
|
@@ -136,9 +136,8 @@ const ConductorPlugin = async (ctx) => {
|
|
|
136
136
|
grep: true,
|
|
137
137
|
glob: true,
|
|
138
138
|
list: true,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
skill: true,
|
|
139
|
+
todowrite: true,
|
|
140
|
+
todoread: true,
|
|
142
141
|
webfetch: true,
|
|
143
142
|
},
|
|
144
143
|
},
|
|
@@ -161,14 +160,13 @@ const ConductorPlugin = async (ctx) => {
|
|
|
161
160
|
grep: true,
|
|
162
161
|
glob: true,
|
|
163
162
|
list: true,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
skill: true,
|
|
163
|
+
todowrite: true,
|
|
164
|
+
todoread: true,
|
|
167
165
|
webfetch: true,
|
|
168
166
|
"conductor_delegate": true,
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
167
|
+
"conductor_bg_task": true,
|
|
168
|
+
"conductor_bg_output": true,
|
|
169
|
+
"conductor_bg_cancel": true,
|
|
172
170
|
},
|
|
173
171
|
},
|
|
174
172
|
};
|
|
@@ -179,7 +177,7 @@ const ConductorPlugin = async (ctx) => {
|
|
|
179
177
|
"task",
|
|
180
178
|
"background_task",
|
|
181
179
|
"conductor_delegate",
|
|
182
|
-
"
|
|
180
|
+
"conductor_bg_task",
|
|
183
181
|
];
|
|
184
182
|
if (delegationTools.includes(input.tool)) {
|
|
185
183
|
const conductorDir = join(ctx.directory, "conductor");
|
package/dist/tools/background.js
CHANGED
|
@@ -45,7 +45,7 @@ export class BackgroundManager {
|
|
|
45
45
|
body: {
|
|
46
46
|
agent: input.agent,
|
|
47
47
|
tools: {
|
|
48
|
-
"
|
|
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(() => { });
|
|
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
|
|
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(() => { });
|
|
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
|
}
|
package/dist/tools/delegate.js
CHANGED
|
@@ -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,
|
|
27
|
+
"conductor_delegate": false,
|
|
29
28
|
},
|
|
30
29
|
parts: [{ type: "text", text: args.prompt }],
|
|
31
30
|
},
|