@paigy/mcp 0.21.0 → 0.22.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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AGENT_NAME
3
- } from "./chunk-VWQQ3VJF.js";
3
+ } from "./chunk-XVZDHNKB.js";
4
4
 
5
5
  // src/clients.ts
6
6
  import { execFile } from "child_process";
@@ -3243,24 +3243,36 @@ var PROTO = "paigy-pair-v2|sas=24";
3243
3243
  var SAS_BITS = 24;
3244
3244
  var TOKEN_PATH = join(homedir(), ".paigy", "token.json");
3245
3245
  var KEY_PATH = join(homedir(), ".paigy", "key.json");
3246
- function saveToken(token) {
3246
+ var SHARED = "*";
3247
+ function readTokenFile() {
3248
+ if (!existsSync(TOKEN_PATH)) return {};
3249
+ try {
3250
+ const parsed = JSON.parse(readFileSync(TOKEN_PATH, "utf8"));
3251
+ if (typeof parsed.access_token === "string") return { [SHARED]: parsed };
3252
+ return parsed;
3253
+ } catch {
3254
+ return {};
3255
+ }
3256
+ }
3257
+ function saveToken(token, agent2 = AGENT_NAME) {
3258
+ const slots = { ...readTokenFile(), [agent2]: token };
3247
3259
  mkdirSync(join(homedir(), ".paigy"), { recursive: true });
3248
- writeFileSync(TOKEN_PATH, JSON.stringify(token, null, 2) + "\n", { mode: 384 });
3260
+ writeFileSync(TOKEN_PATH, JSON.stringify(slots, null, 2) + "\n", { mode: 384 });
3249
3261
  }
3250
3262
  var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
3251
- function readToken() {
3263
+ function readToken(agent2 = AGENT_NAME) {
3252
3264
  if (process.env.PAIGY_TOKEN) return process.env.PAIGY_TOKEN;
3253
- if (existsSync(TOKEN_PATH)) {
3254
- try {
3255
- return JSON.parse(readFileSync(TOKEN_PATH, "utf8")).access_token ?? "";
3256
- } catch {
3257
- }
3258
- }
3259
- return "";
3260
- }
3261
- function deleteToken() {
3262
- if (!existsSync(TOKEN_PATH)) return false;
3263
- rmSync(TOKEN_PATH);
3265
+ const slots = readTokenFile();
3266
+ return (slots[agent2] ?? slots[SHARED])?.access_token ?? "";
3267
+ }
3268
+ function deleteToken(agent2 = AGENT_NAME) {
3269
+ const slots = readTokenFile();
3270
+ const removed = agent2 in slots || SHARED in slots;
3271
+ if (!removed) return false;
3272
+ delete slots[agent2];
3273
+ delete slots[SHARED];
3274
+ if (Object.keys(slots).length === 0) rmSync(TOKEN_PATH);
3275
+ else writeFileSync(TOKEN_PATH, JSON.stringify(slots, null, 2) + "\n", { mode: 384 });
3264
3276
  return true;
3265
3277
  }
3266
3278
  async function revokeToken(token) {
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  autoConfigureClients,
8
8
  claudeInstallHint,
9
9
  enablePaigyTools
10
- } from "./chunk-HO3OJHRA.js";
10
+ } from "./chunk-JNQ4KHZA.js";
11
11
  import {
12
12
  clearSurface,
13
13
  writeSurface
@@ -38,7 +38,7 @@ import {
38
38
  sleep,
39
39
  startE2ee,
40
40
  submitNotification
41
- } from "./chunk-VWQQ3VJF.js";
41
+ } from "./chunk-XVZDHNKB.js";
42
42
 
43
43
  // src/index.ts
44
44
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
package/dist/listen.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  checkReplies,
8
8
  registerDelivery
9
- } from "./chunk-VWQQ3VJF.js";
9
+ } from "./chunk-XVZDHNKB.js";
10
10
 
11
11
  // src/listen.ts
12
12
  import { createClient } from "@supabase/supabase-js";
package/dist/onboard.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  autoConfigureClients,
4
4
  claudeInstallHint,
5
5
  openBrowser
6
- } from "./chunk-HO3OJHRA.js";
6
+ } from "./chunk-JNQ4KHZA.js";
7
7
  import {
8
8
  AGENT_NAME,
9
9
  TOKEN_PATH,
@@ -11,7 +11,7 @@ import {
11
11
  requestCode,
12
12
  saveToken,
13
13
  sleep
14
- } from "./chunk-VWQQ3VJF.js";
14
+ } from "./chunk-XVZDHNKB.js";
15
15
 
16
16
  // src/onboard.ts
17
17
  async function main() {
@@ -6,7 +6,7 @@ import {
6
6
  BACKEND_URL,
7
7
  reach,
8
8
  readToken
9
- } from "./chunk-VWQQ3VJF.js";
9
+ } from "./chunk-XVZDHNKB.js";
10
10
 
11
11
  // src/statusline.ts
12
12
  import { mkdirSync, readFileSync, realpathSync, writeFileSync } from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paigy/mcp",
3
- "version": "0.21.0",
3
+ "version": "0.22.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",
@@ -36,9 +36,9 @@
36
36
  "tsup": "^8.3.5",
37
37
  "typescript": "^5.7.2",
38
38
  "vitest": "^2.1.8",
39
- "@paigy/crypto": "0.0.0",
40
39
  "@paigy/schema": "0.0.0",
41
- "@paigy/sdk": "0.1.0"
40
+ "@paigy/sdk": "0.1.0",
41
+ "@paigy/crypto": "0.0.0"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "tsup",