opencode-collaboration 0.6.0 → 0.6.1
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 +9 -0
- package/dist/session-runtime.js +16 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -281,6 +281,15 @@ export const PeersPlugin = async (ctx, pluginOptions) => {
|
|
|
281
281
|
if (disposing)
|
|
282
282
|
return;
|
|
283
283
|
const e = event;
|
|
284
|
+
if (e.type && e.type.includes("agent.switched")) {
|
|
285
|
+
const probe = e.properties ?? {};
|
|
286
|
+
await logger("debug", "agent switch event observed", {
|
|
287
|
+
type: e.type,
|
|
288
|
+
sessionID: typeof probe.sessionID === "string" ? probe.sessionID : undefined,
|
|
289
|
+
agent: typeof probe.agent === "string" ? probe.agent : undefined,
|
|
290
|
+
messageID: typeof probe.messageID === "string" ? probe.messageID : undefined,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
284
293
|
const changed = await runtime.handleEvent(e);
|
|
285
294
|
if (changed && !disposing)
|
|
286
295
|
await registry.heartbeat();
|
package/dist/session-runtime.js
CHANGED
|
@@ -387,6 +387,22 @@ export function SessionRuntime(opts) {
|
|
|
387
387
|
setStatus(endpoint, event.type === "session.idle" ? "idle" : normalizeStatus(properties.status));
|
|
388
388
|
return true;
|
|
389
389
|
}
|
|
390
|
+
// The user toggled the session's agent/mode (e.g. build<->plan). Peer
|
|
391
|
+
// injections use the last-known agent, so refreshing here keeps the
|
|
392
|
+
// next injected turn under the mode the user actually selected — even
|
|
393
|
+
// when the toggle happens without a follow-up user message.
|
|
394
|
+
if (event.type === "session.next.agent.switched" ||
|
|
395
|
+
event.type === "session.next.agent.switched.1") {
|
|
396
|
+
const sessionId = properties.sessionID;
|
|
397
|
+
const agent = properties.agent;
|
|
398
|
+
if (!sessionId || !agent)
|
|
399
|
+
return false;
|
|
400
|
+
const endpoint = await findSession(sessionId);
|
|
401
|
+
if (!endpoint)
|
|
402
|
+
return false;
|
|
403
|
+
endpoint.agent = agent;
|
|
404
|
+
return true;
|
|
405
|
+
}
|
|
390
406
|
return false;
|
|
391
407
|
});
|
|
392
408
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-collaboration",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Cross-session messaging for opencode — let independent sessions discover and text each other, modeled after Claude Code's cross-session messaging",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|