@synaplink/orqlaude 0.3.3 → 0.5.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 +45 -2
- package/dist/__tests__/state.test.js +1 -1
- package/dist/__tests__/userio.test.d.ts +1 -0
- package/dist/__tests__/userio.test.js +101 -0
- package/dist/__tests__/userio.test.js.map +1 -0
- package/dist/__tests__/v05.test.d.ts +1 -0
- package/dist/__tests__/v05.test.js +80 -0
- package/dist/__tests__/v05.test.js.map +1 -0
- package/dist/cli.js +65 -42
- package/dist/cli.js.map +1 -1
- package/dist/lib/agnet.d.ts +26 -0
- package/dist/lib/agnet.js +94 -0
- package/dist/lib/agnet.js.map +1 -0
- package/dist/lib/state.d.ts +95 -1
- package/dist/lib/state.js +26 -4
- package/dist/lib/state.js.map +1 -1
- package/dist/lib/style.d.ts +42 -0
- package/dist/lib/style.js +96 -0
- package/dist/lib/style.js.map +1 -0
- package/dist/server.js +3 -1
- package/dist/server.js.map +1 -1
- package/dist/telegram/api.d.ts +40 -0
- package/dist/telegram/api.js +70 -2
- package/dist/telegram/api.js.map +1 -1
- package/dist/telegram/bot.js +6 -1
- package/dist/telegram/bot.js.map +1 -1
- package/dist/telegram/commands.d.ts +5 -1
- package/dist/telegram/commands.js +107 -6
- package/dist/telegram/commands.js.map +1 -1
- package/dist/telegram/notifier.d.ts +3 -11
- package/dist/telegram/notifier.js +304 -25
- package/dist/telegram/notifier.js.map +1 -1
- package/dist/tools/ping.js +1 -1
- package/dist/tools/planning.js +8 -0
- package/dist/tools/planning.js.map +1 -1
- package/dist/tools/userio.d.ts +4 -0
- package/dist/tools/userio.js +194 -0
- package/dist/tools/userio.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { findPlan, findUserResponseRequest, findUserStream } from "../lib/state.js";
|
|
4
|
+
/**
|
|
5
|
+
* Broker-to-user tools (v0.4+).
|
|
6
|
+
*
|
|
7
|
+
* The other broker tools (send_message / post_note) only connect primary
|
|
8
|
+
* Claude to spawned children. These three close the gap to the user:
|
|
9
|
+
*
|
|
10
|
+
* notify_user one-way push (Telegram), no response expected
|
|
11
|
+
* request_user_response push + await; user taps a button or replies
|
|
12
|
+
* poll_user_response primary Claude polls for the answer
|
|
13
|
+
*
|
|
14
|
+
* Implementation: writes to plan.userNotifications / plan.userResponseRequests.
|
|
15
|
+
* The Telegram notifier (separate process, `orqlaude tg start`) detects new
|
|
16
|
+
* entries on its 5-second tick and pushes them. The bot listens for callback_query
|
|
17
|
+
* updates and writes the response back into state.
|
|
18
|
+
*/
|
|
19
|
+
const URGENCY = z.enum(["low", "normal", "high"]);
|
|
20
|
+
export function registerUserIo(server, store, audit) {
|
|
21
|
+
// ---- notify_user ----------------------------------------------------------
|
|
22
|
+
server.tool("notify_user", "PRIMARY CLAUDE → USER (Telegram). One-way push of an arbitrary message to the user's whitelisted Telegram chats. The notifier picks it up on its next 5-second tick. Use for mid-fleet status updates the user might want to know about (e.g. 'reviewer agent flagged 3 BLOCKERs', 'agent 2 finished early', 'budget at 80%'). Doesn't await a response — pair with request_user_response if you need one.", {
|
|
23
|
+
plan_id: z.string().describe("Plan id this notification belongs to (for filtering / context)."),
|
|
24
|
+
text: z.string().min(1).max(2000).describe("The message text. Will be Markdown-escaped before send. Keep concise."),
|
|
25
|
+
urgency: URGENCY.default("normal").describe("Affects emoji prefix in the Telegram message. low → 💬, normal → 📢, high → 🚨."),
|
|
26
|
+
task_id: z.string().optional().describe("Optional: attribute the notification to a specific task in the plan."),
|
|
27
|
+
}, audit.wrap("notify_user", async ({ plan_id, text, urgency, task_id }) => {
|
|
28
|
+
const result = await store.update((state) => {
|
|
29
|
+
const plan = findPlan(state, plan_id);
|
|
30
|
+
const note = {
|
|
31
|
+
id: randomUUID(),
|
|
32
|
+
taskId: task_id,
|
|
33
|
+
text,
|
|
34
|
+
urgency,
|
|
35
|
+
createdAt: Date.now(),
|
|
36
|
+
delivered: false,
|
|
37
|
+
};
|
|
38
|
+
plan.userNotifications.push(note);
|
|
39
|
+
return {
|
|
40
|
+
plan_id,
|
|
41
|
+
notification_id: note.id,
|
|
42
|
+
queued: true,
|
|
43
|
+
delivered_via_telegram: "pending — depends on `orqlaude tg start` running with at least one whitelisted user.",
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
47
|
+
}, ({ plan_id }) => ({ planId: plan_id })));
|
|
48
|
+
// ---- request_user_response -----------------------------------------------
|
|
49
|
+
server.tool("request_user_response", "PRIMARY CLAUDE asks the user a question via Telegram and awaits the response. If `options` is provided, the message has inline-keyboard buttons; otherwise the user is told to reply with `/respond <short_id> <text>`. Returns a `request_id` — poll it via `poll_user_response`. Times out after `timeout_sec` (default 600s = 10 min); if no response, status returns `timed_out`.", {
|
|
50
|
+
plan_id: z.string(),
|
|
51
|
+
prompt: z.string().min(1).max(2000).describe("The question to ask the user."),
|
|
52
|
+
options: z.array(z.string().min(1).max(32)).max(8).optional().describe("Optional list of button labels (≤8, each ≤32 chars). If provided, Telegram shows an inline keyboard. If omitted, freeform reply expected."),
|
|
53
|
+
timeout_sec: z.number().int().positive().max(3600).default(600).describe("Max seconds to wait. After this, poll returns `timed_out`. Default 600 (10 min); cap 3600 (1h)."),
|
|
54
|
+
task_id: z.string().optional(),
|
|
55
|
+
}, audit.wrap("request_user_response", async ({ plan_id, prompt, options, timeout_sec, task_id }) => {
|
|
56
|
+
const result = await store.update((state) => {
|
|
57
|
+
const plan = findPlan(state, plan_id);
|
|
58
|
+
const id = randomUUID();
|
|
59
|
+
const shortId = id.slice(0, 8);
|
|
60
|
+
const req = {
|
|
61
|
+
id,
|
|
62
|
+
shortId,
|
|
63
|
+
taskId: task_id,
|
|
64
|
+
prompt,
|
|
65
|
+
options,
|
|
66
|
+
createdAt: Date.now(),
|
|
67
|
+
timeoutAt: Date.now() + timeout_sec * 1000,
|
|
68
|
+
delivered: false,
|
|
69
|
+
};
|
|
70
|
+
plan.userResponseRequests.push(req);
|
|
71
|
+
return {
|
|
72
|
+
plan_id,
|
|
73
|
+
request_id: id,
|
|
74
|
+
short_id: shortId,
|
|
75
|
+
timeout_at: req.timeoutAt,
|
|
76
|
+
has_options: Boolean(options && options.length > 0),
|
|
77
|
+
next_step: "Poll `poll_user_response(request_id)` periodically. It returns status=`pending` until the user answers (or timeout). If no Telegram bot is running, the user can't respond — fall back to AskUserQuestion.",
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
81
|
+
}, ({ plan_id }) => ({ planId: plan_id })));
|
|
82
|
+
// ---- stream_to_user_start -------------------------------------------------
|
|
83
|
+
server.tool("stream_to_user_start", "PRIMARY CLAUDE → USER (Telegram), streaming. Open a streaming message: Telegram sends an initial message, and subsequent stream_to_user_append calls EDIT that same message to add content. The user sees a single message that grows in place — the Telegram equivalent of a streamed assistant reply. Returns a stream_id. Call stream_to_user_end when finished (the message gets a ✓ marker). Telegram rate-limits edits to ~1/1.5s; the notifier coalesces appends.", {
|
|
84
|
+
plan_id: z.string(),
|
|
85
|
+
title: z.string().min(1).max(120).describe("Bold header shown at the top of the message. E.g. 'Agnet Verdant — reviewing PR #42' or 'Fleet summary'."),
|
|
86
|
+
initial_content: z.string().default("").describe("Optional starting content for the message body."),
|
|
87
|
+
task_id: z.string().optional(),
|
|
88
|
+
}, audit.wrap("stream_to_user_start", async ({ plan_id, title, initial_content, task_id }) => {
|
|
89
|
+
const result = await store.update((state) => {
|
|
90
|
+
const plan = findPlan(state, plan_id);
|
|
91
|
+
const id = randomUUID();
|
|
92
|
+
const shortId = id.slice(0, 8);
|
|
93
|
+
plan.userStreams.push({
|
|
94
|
+
id,
|
|
95
|
+
shortId,
|
|
96
|
+
taskId: task_id,
|
|
97
|
+
title,
|
|
98
|
+
content: initial_content,
|
|
99
|
+
status: "active",
|
|
100
|
+
createdAt: Date.now(),
|
|
101
|
+
});
|
|
102
|
+
return {
|
|
103
|
+
plan_id,
|
|
104
|
+
stream_id: id,
|
|
105
|
+
short_id: shortId,
|
|
106
|
+
next_step: "Call stream_to_user_append(stream_id, chunk_text) with each new chunk. Call stream_to_user_end(stream_id) when finished.",
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
110
|
+
}, ({ plan_id }) => ({ planId: plan_id })));
|
|
111
|
+
// ---- stream_to_user_append ------------------------------------------------
|
|
112
|
+
server.tool("stream_to_user_append", "Append a chunk to a streaming message previously opened with stream_to_user_start. The notifier will edit the corresponding Telegram message on its next tick (subject to a ~1.5s rate-limit coalesce). Returns the current full length for sanity-check; if content exceeds Telegram's 4096-char limit, further appends will be silently truncated until you start a new stream.", {
|
|
113
|
+
stream_id: z.string().describe("Either the full UUID or the 8-char short_id."),
|
|
114
|
+
chunk: z.string().min(1).max(4000).describe("The text to append. Plain text recommended; Markdown is allowed but escape special chars yourself."),
|
|
115
|
+
}, audit.wrap("stream_to_user_append", async ({ stream_id, chunk }) => {
|
|
116
|
+
const result = await store.update((state) => {
|
|
117
|
+
const found = findUserStream(state, stream_id);
|
|
118
|
+
if (!found)
|
|
119
|
+
return { ok: false, note: "stream not found" };
|
|
120
|
+
const { stream } = found;
|
|
121
|
+
if (stream.status === "ended")
|
|
122
|
+
return { ok: false, note: "stream already ended" };
|
|
123
|
+
// Cap total content at Telegram's 4096-char limit (minus headroom
|
|
124
|
+
// for the title + completion marker).
|
|
125
|
+
const MAX = 3800;
|
|
126
|
+
const room = Math.max(0, MAX - stream.content.length);
|
|
127
|
+
stream.content += chunk.slice(0, room);
|
|
128
|
+
return {
|
|
129
|
+
ok: true,
|
|
130
|
+
stream_id: stream.id,
|
|
131
|
+
current_length: stream.content.length,
|
|
132
|
+
truncated: chunk.length > room,
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
136
|
+
}, ({ stream_id }) => ({})));
|
|
137
|
+
// ---- stream_to_user_end ---------------------------------------------------
|
|
138
|
+
server.tool("stream_to_user_end", "Mark a streaming message complete. The notifier will do a final edit appending a ✓ marker to the Telegram message. No-op if the stream is already ended.", {
|
|
139
|
+
stream_id: z.string(),
|
|
140
|
+
final_chunk: z.string().optional().describe("Optional last bit of content to append before finalizing."),
|
|
141
|
+
}, audit.wrap("stream_to_user_end", async ({ stream_id, final_chunk }) => {
|
|
142
|
+
const result = await store.update((state) => {
|
|
143
|
+
const found = findUserStream(state, stream_id);
|
|
144
|
+
if (!found)
|
|
145
|
+
return { ok: false, note: "stream not found" };
|
|
146
|
+
const { stream } = found;
|
|
147
|
+
if (stream.status === "ended")
|
|
148
|
+
return { ok: true, note: "already ended" };
|
|
149
|
+
if (final_chunk) {
|
|
150
|
+
const MAX = 3800;
|
|
151
|
+
const room = Math.max(0, MAX - stream.content.length);
|
|
152
|
+
stream.content += final_chunk.slice(0, room);
|
|
153
|
+
}
|
|
154
|
+
stream.status = "ended";
|
|
155
|
+
stream.endedAt = Date.now();
|
|
156
|
+
return { ok: true, stream_id: stream.id };
|
|
157
|
+
});
|
|
158
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
159
|
+
}, ({ stream_id }) => ({})));
|
|
160
|
+
// ---- poll_user_response ---------------------------------------------------
|
|
161
|
+
server.tool("poll_user_response", "Poll a previously-issued `request_user_response`. Returns `status: pending | answered | timed_out | cancelled` and the `response` text when answered. Safe to call repeatedly; no side effects.", {
|
|
162
|
+
request_id: z.string().describe("Either the full UUID or the 8-char short_id returned by request_user_response."),
|
|
163
|
+
}, audit.wrap("poll_user_response", async ({ request_id }) => {
|
|
164
|
+
const result = await store.read((state) => {
|
|
165
|
+
const found = findUserResponseRequest(state, request_id);
|
|
166
|
+
if (!found) {
|
|
167
|
+
return { request_id, status: "unknown", note: "No request with that id or short_id." };
|
|
168
|
+
}
|
|
169
|
+
const { req } = found;
|
|
170
|
+
if (req.cancelled)
|
|
171
|
+
return { request_id: req.id, status: "cancelled" };
|
|
172
|
+
if (req.response !== undefined) {
|
|
173
|
+
return {
|
|
174
|
+
request_id: req.id,
|
|
175
|
+
status: "answered",
|
|
176
|
+
response: req.response,
|
|
177
|
+
responded_at: req.respondedAt,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
if (Date.now() > req.timeoutAt) {
|
|
181
|
+
return { request_id: req.id, status: "timed_out", timeout_at: req.timeoutAt };
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
request_id: req.id,
|
|
185
|
+
status: "pending",
|
|
186
|
+
delivered: req.delivered,
|
|
187
|
+
timeout_at: req.timeoutAt,
|
|
188
|
+
remaining_sec: Math.max(0, Math.round((req.timeoutAt - Date.now()) / 1000)),
|
|
189
|
+
};
|
|
190
|
+
});
|
|
191
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
192
|
+
}));
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=userio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userio.js","sourceRoot":"","sources":["../../src/tools/userio.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAc,QAAQ,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGhG;;;;;;;;;;;;;;GAcG;AAEH,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAElD,MAAM,UAAU,cAAc,CAAC,MAAiB,EAAE,KAAiB,EAAE,KAAe;IAClF,8EAA8E;IAC9E,MAAM,CAAC,IAAI,CACT,aAAa,EACb,4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AAY,EAAE,GAAG,CAAC,WAAW;iBAC9B,CAAC;YACJ,CAAC;YACD,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC;gBAC/B,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC;YAChF,CAAC;YACD,OAAO;gBACL,UAAU,EAAE,GAAG,CAAC,EAAE;gBAClB,MAAM,EAAE,SAAS;gBACjB,SAAS,EAAE,GAAG,CAAC,SAAS;gBACxB,UAAU,EAAE,GAAG,CAAC,SAAS;gBACzB,aAAa,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;aAC5E,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IAChF,CAAC,CACF,CACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synaplink/orqlaude",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Multi-agent orchestrator for Claude Code. One primary session decomposes a complex task, gets a single budget approval, then dispatches N parallel agents via the Desktop app's native spawn_task. Tracks cost/status via JSONL tails; brokers messages between agents; detects hallucination; manages PRs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|