@paigy/mcp 0.10.4 → 0.11.0

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.
@@ -103,22 +103,14 @@ var ScheduleCallbackSchema = z.object({
103
103
  });
104
104
  var PendingRepliesSchema = z.object({
105
105
  replies: z.array(
106
- z.object({
107
- threadId: z.string(),
108
- notificationId: z.string(),
109
- answer: UserAnswerSchema,
110
- /** True if this reply was already claimed on a prior check_replies/await_reply —
111
- * re-surfaced because includeRecent recovered it (e.g. after an unexpected
112
- * restart). You may have already acted on it; check before repeating a
113
- * side-effecting response. */
114
- redelivered: z.boolean().optional()
115
- })
106
+ z.object({ threadId: z.string(), notificationId: z.string(), answer: UserAnswerSchema })
116
107
  ),
117
108
  pending: z.array(
118
109
  z.object({ threadId: z.string(), notificationId: z.string(), createdAt: z.string() })
119
110
  ),
120
111
  /** User-initiated requests addressed to this agent; act on them and reply via
121
- * notify_user on the same threadId. Each is returned once (claimed on read). */
112
+ * notify_user on the same threadId. Keeps reappearing until you call
113
+ * set_task_state on its notificationId. */
122
114
  requests: z.array(
123
115
  z.object({ threadId: z.string(), notificationId: z.string(), text: z.string(), createdAt: z.string() })
124
116
  ),
@@ -400,10 +392,9 @@ async function awaitReply(notificationId, opts = {}) {
400
392
  await doSleep(intervalMs);
401
393
  }
402
394
  }
403
- async function checkReplies(includeRecent = false) {
395
+ async function checkReplies() {
404
396
  const token = loadToken();
405
- const qs = includeRecent ? "?includeRecent=true" : "";
406
- const res = ensureAuthed(await reach(`${BACKEND_URL}/api/pending${qs}`, {
397
+ const res = ensureAuthed(await reach(`${BACKEND_URL}/api/pending`, {
407
398
  headers: { authorization: `Bearer ${token}` }
408
399
  }));
409
400
  if (!res.ok) throw new Error(`check_replies failed: ${res.status} ${await res.text()}`);
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  scheduleCallback,
9
9
  setTaskState,
10
10
  submitNotification
11
- } from "./chunk-UWM2Q4DJ.js";
11
+ } from "./chunk-CGEKDPQW.js";
12
12
  import {
13
13
  deleteToken,
14
14
  openBrowser,
@@ -61,11 +61,6 @@ function json(s) {
61
61
  var AwaitReplySchema = z.object({
62
62
  notificationId: z.string().describe("The notificationId returned by notify_user \u2014 waits for the user's reply to THIS notification only.")
63
63
  });
64
- var CheckRepliesSchema = z.object({
65
- includeRecent: z.boolean().optional().describe(
66
- "Set true only if you just unexpectedly restarted/reconnected and might have already claimed a reply without acting on it (that reply won't show up again otherwise \u2014 claims are one-time). Re-includes replies from the last ~10 min, marked redelivered:true so you can tell they may be duplicates. Leave false/omitted for normal use."
67
- )
68
- });
69
64
  var PairSchema = z.object({
70
65
  device_code: z.string().optional().describe("Omit to start pairing (returns an approval link to show the user). Pass the device_code from that first call to finish, once the user has approved.")
71
66
  });
@@ -120,12 +115,12 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
120
115
  },
121
116
  {
122
117
  name: "check_replies",
123
- description: "The catch-up sweep for everything you haven't consumed yet: returns answers to notifications you sent that you haven't seen (now marked seen), your still-pending notifications, and `requests` \u2014 new requests the user started toward you (each { notificationId, threadId, text }, returned once). Act on each request and reply with notify_user on the SAME threadId. Use it when booting up / starting a session, or when you've been waiting a long time on something else, to discover acks or work you're unaware of. To wait on an answer to a notify_user call you just made, use await_reply instead. Also returns owedCallbacks: callbacks now due that you promised \u2014 fulfill each with notify_user on its threadId. Also returns `stalled`: work (either direction) that got reported in_progress via set_task_state a while ago and never reported completed \u2014 likely left half-done by this session or a prior one that crashed or went idle. For each, either continue the work and report a real state, or investigate why it stalled. Pass includeRecent:true only right after an unexpected restart, to recover a reply you may have claimed but not acted on.",
124
- inputSchema: json(CheckRepliesSchema)
118
+ description: "The catch-up sweep for everything outstanding \u2014 a PURE read, takes no arguments, safe to call as often as you like: nothing here is consumed by reading it. Returns `replies` (answers to notifications you sent), your still-pending notifications, and `requests` \u2014 requests the user started toward you (each { notificationId, threadId, text }). Each keeps reappearing on every call until you actually engage with it: call set_task_state on its notificationId, which is what claims/acknowledges it \u2014 a human-initiated reply or request must never be silently dropped just because you read the list without acting. Use check_replies when booting up / starting a session, or when you've been waiting a long time on something else. To wait on an answer to a notify_user call you just made, use await_reply instead. Also returns owedCallbacks: callbacks now due that you promised \u2014 fulfill each with notify_user on its threadId. Also returns `stalled`: work (either direction) you reported in_progress via set_task_state a while ago and never reported completed \u2014 likely left half-done by this session or a prior one that crashed or went idle. For each, either continue the work and report a real state, or investigate why it stalled.",
119
+ inputSchema: json(z.object({}))
125
120
  },
126
121
  {
127
122
  name: "set_task_state",
128
- description: "Report progress on the follow-up work behind ANY notification you own \u2014 a user-initiated request (from check_replies), or your OWN notify_user question once await_reply/check_replies returns its answer and you start acting on it. Pass that notificationId. States: in_progress (you started working), completed (done), or needs_input (you need more from the user \u2014 usually paired with a notify_user carrying parentId = the same notificationId you're reporting on). Calling this reliably is what lets a future session's check_replies surface `stalled` work you (or a crashed/idle prior session) left at in_progress without ever reporting completed.",
123
+ description: "Report progress on the follow-up work behind ANY notification you own \u2014 a user-initiated request (from check_replies), or your OWN notify_user question once await_reply/check_replies returns its answer and you start acting on it. Pass that notificationId. THIS is what actually claims/acknowledges a reply or request \u2014 check_replies is a pure read that never consumes anything on its own, so call this as soon as you start engaging with something it returned; otherwise that same item just keeps reappearing forever. States: in_progress (you started working), completed (done), or needs_input (you need more from the user \u2014 usually paired with a notify_user carrying parentId = the same notificationId you're reporting on). Calling this reliably is also what lets a future session's check_replies surface `stalled` work you (or a crashed/idle prior session) left at in_progress without ever reporting completed.",
129
124
  inputSchema: json(SetTaskStateToolSchema)
130
125
  },
131
126
  {
@@ -226,8 +221,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
226
221
  return { content: [{ type: "text", text: JSON.stringify(item) }] };
227
222
  }
228
223
  case "check_replies": {
229
- const { includeRecent } = CheckRepliesSchema.parse(request.params.arguments ?? {});
230
- const result = await checkReplies(includeRecent);
224
+ const result = await checkReplies();
231
225
  return { content: [{ type: "text", text: JSON.stringify(result) }] };
232
226
  }
233
227
  case "set_task_state": {
package/dist/listen.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  checkReplies,
5
5
  registerDelivery,
6
6
  wakeChannel
7
- } from "./chunk-UWM2Q4DJ.js";
7
+ } from "./chunk-CGEKDPQW.js";
8
8
  import "./chunk-GU7C5H6L.js";
9
9
 
10
10
  // src/listen.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paigy/mcp",
3
- "version": "0.10.4",
3
+ "version": "0.11.0",
4
4
  "description": "Paigy MCP server — a voice inbox for your AI agents. Lets an agent notify a user and await their reply.",
5
5
  "license": "MIT",
6
6
  "type": "module",