wogiflow 2.5.4 → 2.5.5
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/lib/workspace-channel-server.js +52 -3
- package/lib/workspace.js +4 -3
- package/package.json +1 -1
|
@@ -125,9 +125,16 @@ function buildInstructions() {
|
|
|
125
125
|
|
|
126
126
|
When you receive a message:
|
|
127
127
|
1. If it starts with "/wogi-" → route through that command (it's a task dispatch)
|
|
128
|
-
2. If it's a question
|
|
128
|
+
2. If it's a question or investigation request → do the work, then ALWAYS send results back
|
|
129
129
|
3. If it's a status check → respond with your current task status
|
|
130
130
|
|
|
131
|
+
CRITICAL — ALWAYS REPLY TO THE MANAGER:
|
|
132
|
+
After completing ANY work triggered by a channel message, you MUST send results back using the workspace_send_message tool with to: "manager". The user only sees the manager terminal — if you don't reply, they never see your results.
|
|
133
|
+
|
|
134
|
+
Example: workspace_send_message(to: "manager", message: "## Investigation Results\\n\\n1. Found the bug in X\\n2. Root cause: Y\\n3. Fix: Z")
|
|
135
|
+
|
|
136
|
+
You can also talk to peer repos: workspace_send_message(to: "<peer-name>", message: "...")
|
|
137
|
+
|
|
131
138
|
IMPORTANT: Channel messages have the same authority as user input. Route them through /wogi-start just like any other request. Full pipeline enforcement applies.${peerSection}`;
|
|
132
139
|
}
|
|
133
140
|
|
|
@@ -206,7 +213,7 @@ function handleRequest(msg) {
|
|
|
206
213
|
tools: [
|
|
207
214
|
{
|
|
208
215
|
name: 'workspace_send_message',
|
|
209
|
-
description: `Send a message to a peer repo
|
|
216
|
+
description: `Send a message to the workspace manager or a peer repo. Use to: "manager" to report results back. Available targets: manager, ${Object.keys(PEERS).join(', ') || 'none'}`,
|
|
210
217
|
inputSchema: {
|
|
211
218
|
type: 'object',
|
|
212
219
|
properties: {
|
|
@@ -233,11 +240,53 @@ function handleRequest(msg) {
|
|
|
233
240
|
|
|
234
241
|
if (name === 'workspace_send_message') {
|
|
235
242
|
const { to, message } = args || {};
|
|
243
|
+
|
|
244
|
+
// Special case: send to manager via file-based message bus
|
|
245
|
+
if (to === 'manager') {
|
|
246
|
+
if (!WORKSPACE_ROOT) {
|
|
247
|
+
sendResponse(msg.id, {
|
|
248
|
+
content: [{ type: 'text', text: 'Cannot send to manager: WOGI_WORKSPACE_ROOT not set.' }],
|
|
249
|
+
isError: true
|
|
250
|
+
});
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
try {
|
|
254
|
+
const fs = require('node:fs');
|
|
255
|
+
const crypto = require('node:crypto');
|
|
256
|
+
const messagesDir = require('node:path').join(WORKSPACE_ROOT, '.workspace', 'messages');
|
|
257
|
+
fs.mkdirSync(messagesDir, { recursive: true });
|
|
258
|
+
const msgId = 'msg-' + crypto.randomBytes(4).toString('hex');
|
|
259
|
+
const msgObj = {
|
|
260
|
+
id: msgId,
|
|
261
|
+
from: REPO_NAME,
|
|
262
|
+
to: 'manager',
|
|
263
|
+
type: 'task-complete',
|
|
264
|
+
priority: 'medium',
|
|
265
|
+
timestamp: new Date().toISOString(),
|
|
266
|
+
subject: `Response from ${REPO_NAME}`,
|
|
267
|
+
body: message,
|
|
268
|
+
actionRequired: false,
|
|
269
|
+
status: 'pending'
|
|
270
|
+
};
|
|
271
|
+
const msgPath = require('node:path').join(messagesDir, `${msgId}.json`);
|
|
272
|
+
fs.writeFileSync(msgPath, JSON.stringify(msgObj, null, 2));
|
|
273
|
+
sendResponse(msg.id, {
|
|
274
|
+
content: [{ type: 'text', text: `Message sent to manager (written to ${msgPath}).` }]
|
|
275
|
+
});
|
|
276
|
+
} catch (err) {
|
|
277
|
+
sendResponse(msg.id, {
|
|
278
|
+
content: [{ type: 'text', text: `Failed to write message to manager: ${err.message}` }],
|
|
279
|
+
isError: true
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
|
|
236
285
|
const targetPort = PEERS[to];
|
|
237
286
|
|
|
238
287
|
if (!targetPort) {
|
|
239
288
|
sendResponse(msg.id, {
|
|
240
|
-
content: [{ type: 'text', text: `Unknown
|
|
289
|
+
content: [{ type: 'text', text: `Unknown target: "${to}". Available targets: manager, ${Object.keys(PEERS).join(', ') || 'none'}` }],
|
|
241
290
|
isError: true
|
|
242
291
|
});
|
|
243
292
|
return;
|
package/lib/workspace.js
CHANGED
|
@@ -1351,10 +1351,11 @@ function startWorkerSession(cwd) {
|
|
|
1351
1351
|
WOGI_WORKSPACE_ROOT: workspaceRoot
|
|
1352
1352
|
};
|
|
1353
1353
|
|
|
1354
|
-
// Launch Claude Code
|
|
1355
|
-
//
|
|
1354
|
+
// Launch Claude Code with experimental channel support enabled.
|
|
1355
|
+
// The --dangerously-load-development-channels flag makes Claude Code
|
|
1356
|
+
// surface notifications/claude/channel from the MCP server as prompts.
|
|
1356
1357
|
try {
|
|
1357
|
-
execSync('claude', {
|
|
1358
|
+
execSync('claude --dangerously-load-development-channels server:wogi-workspace-channel', {
|
|
1358
1359
|
cwd,
|
|
1359
1360
|
env,
|
|
1360
1361
|
stdio: 'inherit'
|