pi-onlyne 0.3.0 → 0.3.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/README.md +2 -2
- package/SPEC.md +1 -0
- package/dist/index.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ export ONLYNE_BIN=/path/to/onlyne
|
|
|
70
70
|
/onlyne watch on
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
When a message arrives through Onlyne, pi receives it as a follow-up message. The agent can then call `onlyne_reply`, or deliberately call `onlyne_mark_no_reply`.
|
|
73
|
+
When a normal user message arrives through Onlyne, pi receives it as a follow-up message. Onlyne control messages such as `/handshake` are consumed silently. The agent can then call `onlyne_reply`, or deliberately call `onlyne_mark_no_reply`.
|
|
74
74
|
|
|
75
75
|
## Commands
|
|
76
76
|
|
|
@@ -118,7 +118,7 @@ onlyne_broadcast({
|
|
|
118
118
|
{ channelId: "telegram" },
|
|
119
119
|
{ channelId: "feishu" }
|
|
120
120
|
],
|
|
121
|
-
text: "# Release shipped\n\nVersion 0.3.
|
|
121
|
+
text: "# Release shipped\n\nVersion 0.3.1 is live."
|
|
122
122
|
})
|
|
123
123
|
```
|
|
124
124
|
|
package/SPEC.md
CHANGED
|
@@ -15,6 +15,7 @@ Pi extension for Onlyne. Onlyne remains a workspace-local IM broker; this extens
|
|
|
15
15
|
- Send tools default to Markdown and may pass `raw_text: true` to Onlyne for literal text.
|
|
16
16
|
- Broadcast sends concurrently with per-target retry and per-target results.
|
|
17
17
|
- Loopback inbound messages wake Pi without creating a reply obligation.
|
|
18
|
+
- `/handshake` inbound messages are Onlyne control messages and must not be surfaced to Pi as agent work.
|
|
18
19
|
- After pi surfaces an inbound follow-up, it calls `mark_io_consumed` so Onlyne FIFO `out_cursor = "consume"` stays synchronized with pi notifications.
|
|
19
20
|
- FIFO IO itself remains owned by the Onlyne daemon; pi-onlyne does not open `.onlyne/channels/*/in|out` directly.
|
|
20
21
|
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,9 @@ async function startWatch(pi) { state.workspace = findWorkspace(state.cwd); if (
|
|
|
18
18
|
pi.sendUserMessage(`Onlyne loopback activation${inbound.conversationId ? ` (${inbound.conversationId})` : ""}:\n\n${inbound.text}`, { deliverAs: "followUp" });
|
|
19
19
|
consumeIfNotified(inbound);
|
|
20
20
|
return;
|
|
21
|
+
} if (inbound.text.trim() === "/handshake") {
|
|
22
|
+
consumeIfNotified(inbound);
|
|
23
|
+
return;
|
|
21
24
|
} state.currentInbound = { ...inbound, replied: false, noReply: false, reminders: 0 }; if (mode === "auto-handle") {
|
|
22
25
|
pi.sendUserMessage(`Onlyne inbound message from ${inbound.channelId}/${inbound.conversationId}:\n\n${inbound.text}\n\nReply with onlyne_reply, or call onlyne_mark_no_reply if no reply is needed.`, { deliverAs: "followUp" });
|
|
23
26
|
consumeIfNotified(inbound);
|
|
@@ -29,7 +32,7 @@ async function reply(text) { if (!state.workspace)
|
|
|
29
32
|
throw new Error("no active inbound message"); const res = await sendWithRetry(state.workspace.socketPath, { channelId: inbound.channelId }, text, currentConfig().outbound.retry.attempts); if (res.ok)
|
|
30
33
|
inbound.replied = true; return res; }
|
|
31
34
|
export default function onlyne(pi) {
|
|
32
|
-
pi.on("session_start", async (_event, ctx) => { state.cwd = ctx.cwd; state.workspace = findWorkspace(ctx.cwd); ctx.ui.setStatus("onlyne", state.workspace ? "onlyne: ready" : "onlyne: no .onlyne"); if (currentConfig().watch.autoStart && state.workspace) {
|
|
35
|
+
pi.on("session_start", async (_event, ctx) => { const resumeWatch = state.watching; stopWatch(); state.cwd = ctx.cwd; state.workspace = findWorkspace(ctx.cwd); state.currentInbound = undefined; state.lastValidOutput = undefined; ctx.ui.setStatus("onlyne", state.workspace ? "onlyne: ready" : "onlyne: no .onlyne"); if ((currentConfig().watch.autoStart || resumeWatch) && state.workspace) {
|
|
33
36
|
try {
|
|
34
37
|
ctx.ui.notify(await startWatch(pi), "info");
|
|
35
38
|
}
|