@paigy/mcp 0.10.2 → 0.10.4
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.
|
@@ -127,6 +127,12 @@ var PendingRepliesSchema = z.object({
|
|
|
127
127
|
* fulfill one by calling notify_user on its threadId. */
|
|
128
128
|
owedCallbacks: z.array(
|
|
129
129
|
z.object({ threadId: z.string(), trigger: CallbackTriggerSchema, note: z.string() })
|
|
130
|
+
),
|
|
131
|
+
/** Work (either direction) you reported in_progress a while ago and never reported
|
|
132
|
+
* completed — likely left half-done by this session or a prior one that crashed or
|
|
133
|
+
* went idle. Report a real state (set_task_state) or continue the work. */
|
|
134
|
+
stalled: z.array(
|
|
135
|
+
z.object({ threadId: z.string(), notificationId: z.string(), title: z.string().nullable(), startedAt: z.string() })
|
|
130
136
|
)
|
|
131
137
|
});
|
|
132
138
|
var NotifyResponseSchema = z.object({
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
scheduleCallback,
|
|
9
9
|
setTaskState,
|
|
10
10
|
submitNotification
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UWM2Q4DJ.js";
|
|
12
12
|
import {
|
|
13
13
|
deleteToken,
|
|
14
14
|
openBrowser,
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
31
31
|
import { execSync } from "child_process";
|
|
32
32
|
import { z } from "zod";
|
|
33
|
+
import qrcode from "qrcode-generator";
|
|
33
34
|
|
|
34
35
|
// src/schema.ts
|
|
35
36
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
@@ -99,7 +100,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
99
100
|
tools: [
|
|
100
101
|
{
|
|
101
102
|
name: "pair",
|
|
102
|
-
description: "Pair this agent with the user's Paigy account (one-time) \u2014 required before notify_user/await_reply work. Two steps: (1) call with NO args to start; it attempts to open the user's browser and returns { verification_uri_complete, user_code, device_code }. That attempt can silently fail in headless/remote environments (no browser to open) \u2014 always show the user verification_uri_complete AND user_code regardless of whether it opened, so they can go there manually and enter the code themselves if needed; ask them to approve. (2) call again passing that device_code to finish; it waits for approval and saves the token. If it returns { status:'pending' }, the user hasn't approved yet \u2014 call again with the same device_code to keep waiting.",
|
|
103
|
+
description: "Pair this agent with the user's Paigy account (one-time) \u2014 required before notify_user/await_reply work. Two steps: (1) call with NO args to start; it attempts to open the user's browser and returns { verification_uri_complete, user_code, device_code, qr }. That open attempt can silently fail in headless/remote environments (no browser to open) \u2014 always show the user verification_uri_complete AND user_code regardless of whether it opened, so they can go there manually and enter the code themselves if needed; ask them to approve. `qr` is a terminal-renderable ASCII QR code of the same link \u2014 a scan-to-pair alternative to opening a browser at all, handy when the user's phone is right there; print it verbatim in a fenced code block. (2) call again passing that device_code to finish; it waits for approval and saves the token. If it returns { status:'pending' }, the user hasn't approved yet \u2014 call again with the same device_code to keep waiting.",
|
|
103
104
|
inputSchema: json(PairSchema)
|
|
104
105
|
},
|
|
105
106
|
{
|
|
@@ -119,12 +120,12 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
119
120
|
},
|
|
120
121
|
{
|
|
121
122
|
name: "check_replies",
|
|
122
|
-
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. Pass includeRecent:true only right after an unexpected restart, to recover a reply you may have claimed but not acted on.",
|
|
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.",
|
|
123
124
|
inputSchema: json(CheckRepliesSchema)
|
|
124
125
|
},
|
|
125
126
|
{
|
|
126
127
|
name: "set_task_state",
|
|
127
|
-
description: "Report progress on a user-initiated request
|
|
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.",
|
|
128
129
|
inputSchema: json(SetTaskStateToolSchema)
|
|
129
130
|
},
|
|
130
131
|
{
|
|
@@ -141,6 +142,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
141
142
|
if (!device_code) {
|
|
142
143
|
const code = await requestCode();
|
|
143
144
|
openBrowser(code.verification_uri_complete);
|
|
145
|
+
const qr = qrcode(0, "M");
|
|
146
|
+
qr.addData(code.verification_uri_complete);
|
|
147
|
+
qr.make();
|
|
144
148
|
return {
|
|
145
149
|
content: [{
|
|
146
150
|
type: "text",
|
|
@@ -150,7 +154,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
150
154
|
user_code: code.user_code,
|
|
151
155
|
device_code: code.device_code,
|
|
152
156
|
expires_in: code.expires_in,
|
|
153
|
-
|
|
157
|
+
qr: qr.createASCII(1, 2),
|
|
158
|
+
message: "Show the user verification_uri_complete and user_code (their browser should have opened). If they'd rather scan than switch to a browser themselves, print `qr` verbatim in a fenced code block (monospace, no extra indentation) \u2014 it's a scannable QR code for the same link. After they approve, call pair again with this device_code to finish."
|
|
154
159
|
})
|
|
155
160
|
}]
|
|
156
161
|
};
|
package/dist/listen.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paigy/mcp",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
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",
|
|
@@ -25,11 +25,13 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@modelcontextprotocol/sdk": "^1.0.4",
|
|
27
27
|
"@supabase/supabase-js": "^2.47.10",
|
|
28
|
+
"qrcode-generator": "^2.0.4",
|
|
28
29
|
"zod": "^3.24.1",
|
|
29
30
|
"zod-to-json-schema": "^3.24.1"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"@types/node": "^22.0.0",
|
|
34
|
+
"@types/qrcode-generator": "^1.0.6",
|
|
33
35
|
"tsup": "^8.3.5",
|
|
34
36
|
"typescript": "^5.7.2",
|
|
35
37
|
"vitest": "^2.1.8",
|