@paigy/mcp 0.40.30 → 0.40.31

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.
@@ -3909,8 +3909,13 @@ var handle = (entryId) => entryId.slice(0, 8);
3909
3909
  function conversation(e) {
3910
3910
  const answers = new Map((e.answers ?? []).map((a) => [a.decisionNeedId, a]));
3911
3911
  const shown = new Set((e.entries ?? []).map((entry) => entry.entryId));
3912
+ const settles = new Map((e.answers ?? []).flatMap((a) => a.spans.map((s) => [s.entryId, a.requestEntryId])));
3913
+ const thread = (entry) => {
3914
+ const to = entry.aboutId ?? settles.get(entry.entryId);
3915
+ return to && to !== entry.entryId && shown.has(to) ? to : void 0;
3916
+ };
3912
3917
  const entries = (e.entries ?? []).filter((entry) => !entryUnit(entry));
3913
- const repliedTo = new Set(entries.flatMap((entry) => entry.aboutId && shown.has(entry.aboutId) ? [entry.aboutId] : []));
3918
+ const repliedTo = new Set(entries.flatMap((entry) => thread(entry) ?? []));
3914
3919
  return entries.map((entry) => {
3915
3920
  const sealed = !!entry.content && "sealed" in entry.content;
3916
3921
  const plain = entry.content && "plain" in entry.content ? entry.content.plain : null;
@@ -3919,13 +3924,14 @@ function conversation(e) {
3919
3924
  const answer = need ? answers.get(need.decisionNeedId) : void 0;
3920
3925
  const decision = answer ? decided(answer.result) : void 0;
3921
3926
  const owed = need?.state === "open" && entry.authorParticipant.startsWith("human:");
3927
+ const re = thread(entry);
3922
3928
  return compact({
3923
3929
  id: repliedTo.has(entry.entryId) || owed ? handle(entry.entryId) : void 0,
3924
3930
  from: who(entry.authorParticipant),
3925
3931
  at: at(entry.createdAt),
3926
3932
  said: sealed ? "[encrypted]" : entryWords(entry).trim(),
3927
3933
  units: askUnits(entry, e.entries ?? []).map((u) => `${u.title}: ${u.body}`),
3928
- re: entry.aboutId && shown.has(entry.aboutId) ? handle(entry.aboutId) : void 0,
3934
+ re: re ? handle(re) : void 0,
3929
3935
  options,
3930
3936
  decision: need ? compact({ state: stateOf(need.state, answer, decision), answer: decision }) : void 0
3931
3937
  });
@@ -6,7 +6,7 @@ import {
6
6
  saveToken,
7
7
  setIdentity,
8
8
  sleep
9
- } from "./chunk-5BSMUS7B.js";
9
+ } from "./chunk-CULBHBFU.js";
10
10
 
11
11
  // src/identity.ts
12
12
  var CLIENT_LABELS = {
@@ -9,7 +9,7 @@ import {
9
9
  CODEX_ENV,
10
10
  agentName,
11
11
  withCodexEnv
12
- } from "./chunk-5BSMUS7B.js";
12
+ } from "./chunk-CULBHBFU.js";
13
13
 
14
14
  // src/toolset.ts
15
15
  var CONFIGURE_DESCRIPTION = "Set this agent up with Paigy \u2014 call it FIRST, before contact, and any time you're unsure who you are. One call does whatever the situation needs: NOT SET UP \u2192 if this machine holds a device credential (the user ran the Paigy desktop app or harness) it hatches an identity INSTANTLY, no code and no approval; otherwise it starts the code ceremony. ALREADY SET UP \u2192 returns your current identity and the two things left to decide, renaming it or logging out. TOKEN NO LONGER VALID \u2192 says so, then re-pairs. Pass { name, voice } to choose who you are when hatching, or to RENAME yourself when already set up (pick your own; voices: rachel, george, jessica, brian, lily). Safe to call any time: idempotent, and it never writes settings \u2014 the tool-allowlist state it reports is read-only.\n\nTHE CODE CEREMONY does not open a browser; the user enters the code in the Paigy app (or scans `qr`). A result with { user_code, device_code, qr, user_message } has already started polling for approval in the background: you MUST immediately print the `user_message` (the bare code) to the user, AND in that same turn call configure again with that `device_code` to collect the result. It returns the moment the user approves; on { status:'pending' } call again to keep waiting; on { status:'awaiting_confirmation' } (E2EE) show the bare `user_message` verify code and call again to finish. The leading text block of every result states the code plainly, so it shows even if you emit no prose.\n\nOn { status:'paired' }, or whenever it returns `enable_command`, ALWAYS follow the `enable_prompt`: PRINT that command for the user to run, so Paigy's tools stop prompting each time. You cannot apply it yourself (it writes your own permission allowlist, which hosts block as privilege escalation), so print it, don't wait for it, and carry on.\n\nLOG OUT with { logOut: true }: it logs out THIS agent only \u2014 its token is revoked server-side and its local entry removed. Other agents and this device's credential are untouched, and a later configure re-hatches instantly while the device credential exists. Disconnecting the device itself is not an agent tool.";
@@ -65,7 +65,7 @@ import {
65
65
  updateSlot,
66
66
  whoAmI,
67
67
  withCodexEnv
68
- } from "./chunk-5BSMUS7B.js";
68
+ } from "./chunk-CULBHBFU.js";
69
69
  export {
70
70
  AGENT_TOOLS,
71
71
  AGENT_TOOL_NAMES,
package/dist/enable.js CHANGED
@@ -3,9 +3,9 @@ import {
3
3
  PAIGY_TOOL_IDS,
4
4
  enablePaigyTools,
5
5
  installSessionListening
6
- } from "./chunk-YY2AKPYC.js";
6
+ } from "./chunk-NHPLQOQP.js";
7
7
  import "./chunk-AWI252HQ.js";
8
- import "./chunk-5BSMUS7B.js";
8
+ import "./chunk-CULBHBFU.js";
9
9
 
10
10
  // src/enable.ts
11
11
  function main() {
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  resolvePairing,
10
10
  startPairing,
11
11
  suggestedAgentName
12
- } from "./chunk-37NWW6N5.js";
12
+ } from "./chunk-FAS3IB2F.js";
13
13
  import {
14
14
  ConfigureSchema,
15
15
  ENABLE_COMMAND,
@@ -17,7 +17,7 @@ import {
17
17
  SERVER_INSTRUCTIONS,
18
18
  TOOLS,
19
19
  paigyToolsAllowlisted
20
- } from "./chunk-YY2AKPYC.js";
20
+ } from "./chunk-NHPLQOQP.js";
21
21
  import {
22
22
  decideListen,
23
23
  existingListener,
@@ -45,7 +45,7 @@ import {
45
45
  setClient,
46
46
  slotName,
47
47
  whoAmI
48
- } from "./chunk-5BSMUS7B.js";
48
+ } from "./chunk-CULBHBFU.js";
49
49
 
50
50
  // src/index.ts
51
51
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
package/dist/listen.js CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  receive,
21
21
  slotName,
22
22
  subscribeWake
23
- } from "./chunk-5BSMUS7B.js";
23
+ } from "./chunk-CULBHBFU.js";
24
24
 
25
25
  // src/listen.ts
26
26
  import { createHash } from "crypto";
package/dist/onboard.js CHANGED
@@ -3,12 +3,12 @@ import {
3
3
  resolvePairing,
4
4
  startPairing,
5
5
  suggestedAgentName
6
- } from "./chunk-37NWW6N5.js";
6
+ } from "./chunk-FAS3IB2F.js";
7
7
  import {
8
8
  autoConfigureClients,
9
9
  claudeInstallHint,
10
10
  openBrowser
11
- } from "./chunk-YY2AKPYC.js";
11
+ } from "./chunk-NHPLQOQP.js";
12
12
  import "./chunk-AWI252HQ.js";
13
13
  import {
14
14
  TOKEN_PATH,
@@ -20,7 +20,7 @@ import {
20
20
  saveToken,
21
21
  setIdentity,
22
22
  whoAmI
23
- } from "./chunk-5BSMUS7B.js";
23
+ } from "./chunk-CULBHBFU.js";
24
24
 
25
25
  // src/onboard.ts
26
26
  function reportRegistered() {
package/dist/slot.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  agentName
4
- } from "./chunk-5BSMUS7B.js";
4
+ } from "./chunk-CULBHBFU.js";
5
5
 
6
6
  // src/slot.ts
7
7
  process.stdout.write(agentName());
package/dist/stalled.js CHANGED
@@ -29,7 +29,7 @@ async function main() {
29
29
  const dir = join(homedir(), ".paigy", "stalled-reminded");
30
30
  const mark = join(dir, `${session || "session"}-${day}`);
31
31
  if (existsSync(mark)) return;
32
- const { receive } = await import("./dist-JPETGYUX.js");
32
+ const { receive } = await import("./dist-2WLAZWSH.js");
33
33
  const reply = stopReply((await receive()).stalled ?? [], input.hook_event_name ?? "Stop");
34
34
  if (!reply) return;
35
35
  mkdirSync(dir, { recursive: true });
@@ -7,7 +7,7 @@ import {
7
7
  readToken,
8
8
  sessionSlot,
9
9
  slotName
10
- } from "./chunk-5BSMUS7B.js";
10
+ } from "./chunk-CULBHBFU.js";
11
11
 
12
12
  // src/statusline.ts
13
13
  import { realpathSync } from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paigy/mcp",
3
- "version": "0.40.30",
3
+ "version": "0.40.31",
4
4
  "description": "Paigy MCP server — the AI agent harness that calls you. Lets an agent notify a user and await their reply.",
5
5
  "license": "MIT",
6
6
  "type": "module",