@paigy/mcp 0.40.4 → 0.40.5

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.
@@ -2,10 +2,10 @@ import {
2
2
  AGENT_TOOLS,
3
3
  mcpInputSchema,
4
4
  serverInstructions
5
- } from "./chunk-CL5P4IVS.js";
5
+ } from "./chunk-AOQ2CNMG.js";
6
6
  import {
7
7
  AGENT_NAME
8
- } from "./chunk-QCWXYJ64.js";
8
+ } from "./chunk-JSQ6MXBI.js";
9
9
 
10
10
  // src/toolset.ts
11
11
  var ONBOARD_DESCRIPTION = "Get this agent talking to Paigy \u2014 call it FIRST, before contact, and any time you're unsure who you are. One call, and it does whatever the situation needs: NOT SET UP \u2192 hatches an identity instantly if this machine holds a device credential (the user ran the Paigy desktop app or harness), otherwise starts the code ceremony; ALREADY SET UP \u2192 returns your current identity and offers the two things left to decide, renaming it or unpairing; 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 (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. If it returns a `user_code`, print it to the user immediately and call onboard again with the `device_code`. If it returns `enable_command`, PRINT that command for the user to run \u2014 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.";
@@ -101,9 +101,9 @@ var UpdateGoalToolSchema = UpdateGoalSchema.omit({ operationId: true }).extend({
101
101
  var ClaimGoalSchema = z2.object({ goalId: z2.string().uuid().optional() }).strict();
102
102
  var GetGoalSchema = z2.object({ goalId: z2.string().uuid() }).strict();
103
103
  var GET_GOAL_DESCRIPTION = "Read the current authorized Goal brief: state, owner, blockers, open decisions, progress, and the next operation. Foreign or sibling-owned Goals are not disclosed.";
104
- var UPDATE_GOAL_DESCRIPTION = "Update an owned Goal at an exact revision. State, ownership, dependencies, children, progress, and review acknowledgement are explicit; stale revisions are rejected. Returns the new revision and a prose summary.";
104
+ var UPDATE_GOAL_DESCRIPTION = "Update an owned Goal at an exact revision. State, ownership, dependencies, children, progress, and review acknowledgement are explicit; stale revisions are rejected. reviewed: true acknowledges new evidence and closes the Deliveries addressed to you on that Goal, never over an open decision. Returns the new revision and a prose summary.";
105
105
  var CLAIM_GOAL_DESCRIPTION = "Claim the oldest runnable or review-pending Goal you own, or pass goalId to claim that Goal. Returns a Goal-scoped brief, current revision, blockers, and the next valid operation. Claiming creates or renews the execution lease.";
106
- var CHECK_REPLIES_DESCRIPTION = "Your open Deliveries: every Notification or Call currently addressed to you \u2014 a request the user started toward you, an answer relayed to something you asked, a handoff \u2014 each with its durable Entries, accepted decisions and open decision needs, in the same shape a contact read returns. A pure read with no arguments: nothing is consumed, acknowledged or claimed by reading it, so call it on startup, after a long wait, or whenever you want to know what is outstanding. To act on one, claim its Goal (claim_goal) or reread it with contact({deliveryId}). Your runnable and review-pending Goals come from claim_goal, not from here.";
106
+ var CHECK_REPLIES_DESCRIPTION = "Your open Deliveries: every Notification or Call currently addressed to you \u2014 a request the user started toward you, an answer relayed to something you asked, a handoff \u2014 one row each: its Goals, the newest words in brief, accepted decisions and open decision needs, without the Entries. A pure read with no arguments: nothing is consumed, acknowledged or claimed by reading it, so call it on startup, after a long wait, or whenever you want to know what is outstanding. To act on one, claim its Goal (claim_goal) or reread it in full with contact({deliveryId}). Once you have acted on what arrived, update_goal with reviewed: true closes the Deliveries addressed to you on that Goal. Your runnable and review-pending Goals come from claim_goal, not from here.";
107
107
  var CheckRepliesSchema = z2.object({}).strict();
108
108
  var GetThreadSchema = z2.object({
109
109
  parentId: z2.string().describe("The Thread to read \u2014 the threadId a Delivery returned, or the parentId of a search hit.")
@@ -500,67 +500,6 @@ var AwaitItemSchema = z3.discriminatedUnion("type", [
500
500
  inFlight: z3.boolean().optional()
501
501
  })
502
502
  ]);
503
- var CallbackTriggerSchema = z3.enum(["on_done", "on_blocked", "scheduled"]);
504
- var NotifyResponseSchema = z3.object({
505
- notificationId: z3.string(),
506
- workId: z3.string().uuid().optional(),
507
- decisionId: z3.string().uuid().optional(),
508
- status: NotifyStatusSchema,
509
- createdAt: z3.string().datetime(),
510
- answer: UserAnswerSchema.optional(),
511
- answeredAt: z3.string().datetime().optional(),
512
- /** Ride-alongs for THIS agent — pending work it should pick up when it's done with
513
- * what it came for. Present on any reply, because an unwakeable agent's only
514
- * reliable moment is one it initiated. Absent/empty = nothing owed. */
515
- also: z3.array(RideAlongSchema).optional()
516
- });
517
- var NotifyPlanUnitSchema = z3.object({
518
- notificationId: z3.string(),
519
- /** The unit's own heading, so the agent can tell which of its paragraphs this became. */
520
- title: z3.string(),
521
- /** How loudly this unit was arbitrated to arrive — per unit, which is the point of units. */
522
- level: NotifyLevelSchema,
523
- /** Answered from something the user already decided: nobody is interrupted, and a trail card
524
- * says so. The agent should not wait on this one. */
525
- settled: z3.literal(true).optional(),
526
- /** What this unit would need to be answerable and does not carry (#894). A PROPOSAL to the
527
- * agent — nothing here changed the ask, and ignoring it costs nothing. */
528
- needs: z3.array(z3.enum(["options", "visuals"])).optional(),
529
- /** The SHAPE the broker would give this unit, for the agent to ratify (#886/#894). The
530
- * split layer reads prose and can see that a paragraph is a yes/no or a pick-one — but a
531
- * broker that DECIDES that destroys the only fact separating a statement from a real ask
532
- * (#731), so it is offered, never applied: the unit is stored `text` until the agent
533
- * confirms the shape (POST /notify/:id/confirm). Ignoring it costs nothing. */
534
- proposal: z3.object({
535
- select: SelectShapeSchema,
536
- options: z3.array(z3.object({ label: z3.string().min(1) })).optional()
537
- }).optional(),
538
- /** What the broker READ this unit as wanting from the human (#952 layer 2): a `decision`
539
- * between alternatives, an `approval` the agent is blocked on, or `knowledge` it just
540
- * needs to know. Reported so the agent can correct a misread the same way it ratifies a
541
- * shape — the read RAISES (a decision always asks) and never silences a question the
542
- * agent declared (#731, #923). */
543
- wants: z3.enum(["decision", "approval", "knowledge"]).optional()
544
- });
545
- var NotifyPlanSchema = z3.object({
546
- units: z3.array(NotifyPlanUnitSchema),
547
- /** Which unit is this arrival's ONE interruption (units-design.md D23). Absent means nobody
548
- * was interrupted — every unit was either settled or quiet enough to sit in the inbox. */
549
- speaks: z3.string().optional()
550
- });
551
- var UserResponseSchema = z3.object({
552
- requestId: z3.string(),
553
- answer: UserAnswerSchema,
554
- answeredAt: z3.string().datetime(),
555
- transcript: z3.string().optional(),
556
- /** E2EE: the sealed answer (opaque envelope + plaintext `ignored` hint) when the item was
557
- * E2EE-sealed. Present → the server persists it opaquely and branches status on `ignored`;
558
- * the plaintext `answer` is a placeholder (`{ kind: "ignored" }`) the server ignores for a
559
- * sealed row. Absent = today's plaintext answer, unchanged. */
560
- sealed: z3.lazy(() => SealedAnswerSchema).optional(),
561
- /** Coverage report (#396): which of the ask's declared `points` were addressed. */
562
- covered: z3.array(z3.string()).optional()
563
- });
564
503
  var VoiceKeySchema = z3.enum(["rachel", "george", "jessica", "brian", "lily"]);
565
504
  var AgendaTurnSchema = z3.object({
566
505
  /** THE TURN'S IDENTITY (the first-sentence stream, 2026-09-09): the brain call that wrote
@@ -744,10 +683,6 @@ var InboxItemSchema = z3.object({
744
683
  goalState: z3.string().optional()
745
684
  }).optional()
746
685
  });
747
- var SnoozeRequestSchema = z3.object({
748
- requestId: z3.string(),
749
- until: z3.string().datetime()
750
- });
751
686
  var APNS_TOKEN_RE = /^[0-9a-fA-F]{64}$/;
752
687
  var PushTokenSchema = z3.object({
753
688
  voipToken: z3.string().min(1).optional(),
@@ -968,19 +903,6 @@ var MoveSchema = z3.object({
968
903
  * distilled from a clarify ruling (those carry no agent) or one whose source rows are gone. */
969
904
  learnedFrom: z3.object({ id: z3.string(), name: z3.string() }).nullable()
970
905
  });
971
- var CreateRequestSchema = z3.object({
972
- /** The connection (token id) to send to, from GET /api/tokens. */
973
- tokenId: z3.string(),
974
- /** The user's message to the agent. */
975
- text: z3.string().min(1),
976
- /** Land the request on an existing conversation thread (History → "Continue")
977
- * instead of minting a fresh one. Must belong to the requesting user. */
978
- parentId: z3.string().optional(),
979
- /** Point the agent at a past conversation (possibly with a different agent) as
980
- * starting context (History → "New session from this"). A reference, not a copy —
981
- * the agent reads it via get_thread. Must belong to the requesting user. */
982
- contextParentId: z3.string().optional()
983
- });
984
906
  var QueueQuestionSchema = z3.object({
985
907
  /** The decision need's id — what an answer is accepted against. */
986
908
  id: z3.string(),
@@ -1072,38 +994,6 @@ var NoteSchema = z3.object({
1072
994
  lastRideAt: z3.string().nullable().default(null),
1073
995
  createdAt: z3.string()
1074
996
  });
1075
- var CreateNoteSchema = z3.object({
1076
- /** The intent, in the user's own words. Stored verbatim; the broker only titles it. */
1077
- text: z3.string().min(1).max(4e3),
1078
- /** Capture it as a REMINDER — a note assigned to the user themselves, which rides
1079
- * their next call instead of being handed to an agent. Everything else about the
1080
- * note is identical; this is the one parameter that separates the two. */
1081
- forMe: z3.boolean().optional(),
1082
- /** The not-before, when the user already said one. Absent = the very next call. */
1083
- dueAt: z3.string().datetime().optional(),
1084
- repeat: NoteRepeatSchema.optional()
1085
- });
1086
- var RecordDecisionSchema = z3.object({
1087
- /** An open decision (from /clarify) to answer. */
1088
- decisionId: z3.string().optional(),
1089
- /** For an ad-hoc decision: what was ambiguous. Required without `decisionId`. */
1090
- question: z3.string().min(1).max(500).optional(),
1091
- /** The ruling. */
1092
- answer: z3.string().min(1).max(2e3)
1093
- }).refine((d) => d.decisionId || d.question, { message: "decisionId or question required" });
1094
- var AssignNoteSchema = z3.object({
1095
- /** An EXISTING agent: token id or nickname. Omit when spawning fresh. */
1096
- target: z3.string().min(1).optional(),
1097
- /** Spawn a NEW session for this note (companion.md §2.2): the assignee doesn't
1098
- * exist yet — mint it on a live desktop that advertises the harness+workspace,
1099
- * named after the note. The brief arrives as its opening request. */
1100
- spawn: z3.object({
1101
- hostTokenId: z3.string().uuid(),
1102
- harness: z3.string().min(1),
1103
- workspace: z3.string().min(1)
1104
- }).optional()
1105
- }).refine((a) => !!a.target !== !!a.spawn, { message: "exactly one of target or spawn" });
1106
- var TriageVerdictSchema = z3.enum(["keep", "stale", "close", "assign"]);
1107
997
  var TriageItemSchema = z3.object({
1108
998
  noteId: z3.string(),
1109
999
  /** The note's headline at run time. */
@@ -1237,20 +1127,6 @@ var PairingRevealSchema = z3.object({
1237
1127
  ed25519: z3.string(),
1238
1128
  nonce: z3.string()
1239
1129
  });
1240
- var DeviceCodeRequestSchema = z3.object({
1241
- /** The agent's suggested name for the pairing — the human sees it pre-filled at
1242
- * approval and can override. Optional; blank → a default silly name server-side. */
1243
- suggestedName: z3.string().optional(),
1244
- /** Legacy alias for suggestedName (older MCPs sent `agent`). Accepted for
1245
- * back-compat; `suggestedName` wins when both are present. ponytail: drop once no
1246
- * pre-`name` MCP is in the wild. */
1247
- agent: z3.union([z3.string(), z3.object({ name: z3.string().optional() })]).optional(),
1248
- device: z3.string().optional(),
1249
- proto: z3.string().optional(),
1250
- // compiled-in tag, e.g. "paigy-pair-v2|sas=24"
1251
- commitment: z3.string().optional()
1252
- // agent's Ca
1253
- });
1254
1130
  var DeviceCodeSchema = z3.object({
1255
1131
  device_code: z3.string(),
1256
1132
  user_code: z3.string(),
@@ -1284,11 +1160,6 @@ var DeviceInfoSchema = z3.object({
1284
1160
  phone_reveal: PairingRevealSchema.nullable().optional(),
1285
1161
  uik_pub: z3.string().nullable().optional()
1286
1162
  });
1287
- var DeviceTokenRequestSchema = z3.object({
1288
- device_code: z3.string(),
1289
- reveal: PairingRevealSchema.optional()
1290
- // agent's reveal {x25519, ed25519, nonce}
1291
- });
1292
1163
  var DeviceTokenSchema = z3.object({
1293
1164
  access_token: z3.string(),
1294
1165
  /** The pairing's single name (user-typed at approval, the agent's suggestion, or
@@ -1310,14 +1181,6 @@ var DeviceTokenSchema = z3.object({
1310
1181
  // present once the phone reveals
1311
1182
  uik_pub: z3.string().nullable().optional()
1312
1183
  });
1313
- var DeviceCommitRequestSchema = z3.object({
1314
- code: z3.string(),
1315
- commitment: z3.string()
1316
- // Cb
1317
- });
1318
- var DevicePeerCommitSchema = z3.object({
1319
- commitment: z3.string().nullable()
1320
- });
1321
1184
  var SupportRequestSchema = z3.object({
1322
1185
  email: z3.string().email().max(320),
1323
1186
  message: z3.string().trim().min(1).max(5e3),
@@ -1337,15 +1200,6 @@ var NotificationFeedbackKindSchema = z3.enum([
1337
1200
  "other"
1338
1201
  // anything else — the note carries it.
1339
1202
  ]);
1340
- var NotificationFeedbackSchema = z3.object({
1341
- notificationId: z3.string(),
1342
- kind: NotificationFeedbackKindSchema,
1343
- /** Optional free-text elaboration for a preset; required (non-empty) for 'other'. */
1344
- note: z3.string().trim().max(2e3).optional()
1345
- }).superRefine((r, ctx) => {
1346
- if (r.kind === "other" && !r.note)
1347
- ctx.addIssue({ code: z3.ZodIssueCode.custom, path: ["note"], message: "note is required for 'other' feedback" });
1348
- });
1349
1203
  var FeedbackResolutionSchema = z3.enum(["broker_fixed", "sent_to_agent"]);
1350
1204
  var FeedbackOutcomeSchema = z3.object({
1351
1205
  resolution: FeedbackResolutionSchema,
@@ -3617,9 +3617,9 @@ var UpdateGoalToolSchema = UpdateGoalSchema.omit({ operationId: true }).extend({
3617
3617
  var ClaimGoalSchema = z2.object({ goalId: z2.string().uuid().optional() }).strict();
3618
3618
  var GetGoalSchema = z2.object({ goalId: z2.string().uuid() }).strict();
3619
3619
  var GET_GOAL_DESCRIPTION = "Read the current authorized Goal brief: state, owner, blockers, open decisions, progress, and the next operation. Foreign or sibling-owned Goals are not disclosed.";
3620
- var UPDATE_GOAL_DESCRIPTION = "Update an owned Goal at an exact revision. State, ownership, dependencies, children, progress, and review acknowledgement are explicit; stale revisions are rejected. Returns the new revision and a prose summary.";
3620
+ var UPDATE_GOAL_DESCRIPTION = "Update an owned Goal at an exact revision. State, ownership, dependencies, children, progress, and review acknowledgement are explicit; stale revisions are rejected. reviewed: true acknowledges new evidence and closes the Deliveries addressed to you on that Goal, never over an open decision. Returns the new revision and a prose summary.";
3621
3621
  var CLAIM_GOAL_DESCRIPTION = "Claim the oldest runnable or review-pending Goal you own, or pass goalId to claim that Goal. Returns a Goal-scoped brief, current revision, blockers, and the next valid operation. Claiming creates or renews the execution lease.";
3622
- var CHECK_REPLIES_DESCRIPTION = "Your open Deliveries: every Notification or Call currently addressed to you \u2014 a request the user started toward you, an answer relayed to something you asked, a handoff \u2014 each with its durable Entries, accepted decisions and open decision needs, in the same shape a contact read returns. A pure read with no arguments: nothing is consumed, acknowledged or claimed by reading it, so call it on startup, after a long wait, or whenever you want to know what is outstanding. To act on one, claim its Goal (claim_goal) or reread it with contact({deliveryId}). Your runnable and review-pending Goals come from claim_goal, not from here.";
3622
+ var CHECK_REPLIES_DESCRIPTION = "Your open Deliveries: every Notification or Call currently addressed to you \u2014 a request the user started toward you, an answer relayed to something you asked, a handoff \u2014 one row each: its Goals, the newest words in brief, accepted decisions and open decision needs, without the Entries. A pure read with no arguments: nothing is consumed, acknowledged or claimed by reading it, so call it on startup, after a long wait, or whenever you want to know what is outstanding. To act on one, claim its Goal (claim_goal) or reread it in full with contact({deliveryId}). Once you have acted on what arrived, update_goal with reviewed: true closes the Deliveries addressed to you on that Goal. Your runnable and review-pending Goals come from claim_goal, not from here.";
3623
3623
  var CheckRepliesSchema = z2.object({}).strict();
3624
3624
  var GetThreadSchema = z2.object({
3625
3625
  parentId: z2.string().describe("The Thread to read \u2014 the threadId a Delivery returned, or the parentId of a search hit.")
@@ -4053,67 +4053,6 @@ var AwaitItemSchema = z3.discriminatedUnion("type", [
4053
4053
  inFlight: z3.boolean().optional()
4054
4054
  })
4055
4055
  ]);
4056
- var CallbackTriggerSchema = z3.enum(["on_done", "on_blocked", "scheduled"]);
4057
- var NotifyResponseSchema = z3.object({
4058
- notificationId: z3.string(),
4059
- workId: z3.string().uuid().optional(),
4060
- decisionId: z3.string().uuid().optional(),
4061
- status: NotifyStatusSchema,
4062
- createdAt: z3.string().datetime(),
4063
- answer: UserAnswerSchema.optional(),
4064
- answeredAt: z3.string().datetime().optional(),
4065
- /** Ride-alongs for THIS agent — pending work it should pick up when it's done with
4066
- * what it came for. Present on any reply, because an unwakeable agent's only
4067
- * reliable moment is one it initiated. Absent/empty = nothing owed. */
4068
- also: z3.array(RideAlongSchema).optional()
4069
- });
4070
- var NotifyPlanUnitSchema = z3.object({
4071
- notificationId: z3.string(),
4072
- /** The unit's own heading, so the agent can tell which of its paragraphs this became. */
4073
- title: z3.string(),
4074
- /** How loudly this unit was arbitrated to arrive — per unit, which is the point of units. */
4075
- level: NotifyLevelSchema,
4076
- /** Answered from something the user already decided: nobody is interrupted, and a trail card
4077
- * says so. The agent should not wait on this one. */
4078
- settled: z3.literal(true).optional(),
4079
- /** What this unit would need to be answerable and does not carry (#894). A PROPOSAL to the
4080
- * agent — nothing here changed the ask, and ignoring it costs nothing. */
4081
- needs: z3.array(z3.enum(["options", "visuals"])).optional(),
4082
- /** The SHAPE the broker would give this unit, for the agent to ratify (#886/#894). The
4083
- * split layer reads prose and can see that a paragraph is a yes/no or a pick-one — but a
4084
- * broker that DECIDES that destroys the only fact separating a statement from a real ask
4085
- * (#731), so it is offered, never applied: the unit is stored `text` until the agent
4086
- * confirms the shape (POST /notify/:id/confirm). Ignoring it costs nothing. */
4087
- proposal: z3.object({
4088
- select: SelectShapeSchema,
4089
- options: z3.array(z3.object({ label: z3.string().min(1) })).optional()
4090
- }).optional(),
4091
- /** What the broker READ this unit as wanting from the human (#952 layer 2): a `decision`
4092
- * between alternatives, an `approval` the agent is blocked on, or `knowledge` it just
4093
- * needs to know. Reported so the agent can correct a misread the same way it ratifies a
4094
- * shape — the read RAISES (a decision always asks) and never silences a question the
4095
- * agent declared (#731, #923). */
4096
- wants: z3.enum(["decision", "approval", "knowledge"]).optional()
4097
- });
4098
- var NotifyPlanSchema = z3.object({
4099
- units: z3.array(NotifyPlanUnitSchema),
4100
- /** Which unit is this arrival's ONE interruption (units-design.md D23). Absent means nobody
4101
- * was interrupted — every unit was either settled or quiet enough to sit in the inbox. */
4102
- speaks: z3.string().optional()
4103
- });
4104
- var UserResponseSchema = z3.object({
4105
- requestId: z3.string(),
4106
- answer: UserAnswerSchema,
4107
- answeredAt: z3.string().datetime(),
4108
- transcript: z3.string().optional(),
4109
- /** E2EE: the sealed answer (opaque envelope + plaintext `ignored` hint) when the item was
4110
- * E2EE-sealed. Present → the server persists it opaquely and branches status on `ignored`;
4111
- * the plaintext `answer` is a placeholder (`{ kind: "ignored" }`) the server ignores for a
4112
- * sealed row. Absent = today's plaintext answer, unchanged. */
4113
- sealed: z3.lazy(() => SealedAnswerSchema).optional(),
4114
- /** Coverage report (#396): which of the ask's declared `points` were addressed. */
4115
- covered: z3.array(z3.string()).optional()
4116
- });
4117
4056
  var VoiceKeySchema = z3.enum(["rachel", "george", "jessica", "brian", "lily"]);
4118
4057
  var AgendaTurnSchema = z3.object({
4119
4058
  /** THE TURN'S IDENTITY (the first-sentence stream, 2026-09-09): the brain call that wrote
@@ -4297,10 +4236,6 @@ var InboxItemSchema = z3.object({
4297
4236
  goalState: z3.string().optional()
4298
4237
  }).optional()
4299
4238
  });
4300
- var SnoozeRequestSchema = z3.object({
4301
- requestId: z3.string(),
4302
- until: z3.string().datetime()
4303
- });
4304
4239
  var APNS_TOKEN_RE = /^[0-9a-fA-F]{64}$/;
4305
4240
  var PushTokenSchema = z3.object({
4306
4241
  voipToken: z3.string().min(1).optional(),
@@ -4521,19 +4456,6 @@ var MoveSchema = z3.object({
4521
4456
  * distilled from a clarify ruling (those carry no agent) or one whose source rows are gone. */
4522
4457
  learnedFrom: z3.object({ id: z3.string(), name: z3.string() }).nullable()
4523
4458
  });
4524
- var CreateRequestSchema = z3.object({
4525
- /** The connection (token id) to send to, from GET /api/tokens. */
4526
- tokenId: z3.string(),
4527
- /** The user's message to the agent. */
4528
- text: z3.string().min(1),
4529
- /** Land the request on an existing conversation thread (History → "Continue")
4530
- * instead of minting a fresh one. Must belong to the requesting user. */
4531
- parentId: z3.string().optional(),
4532
- /** Point the agent at a past conversation (possibly with a different agent) as
4533
- * starting context (History → "New session from this"). A reference, not a copy —
4534
- * the agent reads it via get_thread. Must belong to the requesting user. */
4535
- contextParentId: z3.string().optional()
4536
- });
4537
4459
  var QueueQuestionSchema = z3.object({
4538
4460
  /** The decision need's id — what an answer is accepted against. */
4539
4461
  id: z3.string(),
@@ -4625,38 +4547,6 @@ var NoteSchema = z3.object({
4625
4547
  lastRideAt: z3.string().nullable().default(null),
4626
4548
  createdAt: z3.string()
4627
4549
  });
4628
- var CreateNoteSchema = z3.object({
4629
- /** The intent, in the user's own words. Stored verbatim; the broker only titles it. */
4630
- text: z3.string().min(1).max(4e3),
4631
- /** Capture it as a REMINDER — a note assigned to the user themselves, which rides
4632
- * their next call instead of being handed to an agent. Everything else about the
4633
- * note is identical; this is the one parameter that separates the two. */
4634
- forMe: z3.boolean().optional(),
4635
- /** The not-before, when the user already said one. Absent = the very next call. */
4636
- dueAt: z3.string().datetime().optional(),
4637
- repeat: NoteRepeatSchema.optional()
4638
- });
4639
- var RecordDecisionSchema = z3.object({
4640
- /** An open decision (from /clarify) to answer. */
4641
- decisionId: z3.string().optional(),
4642
- /** For an ad-hoc decision: what was ambiguous. Required without `decisionId`. */
4643
- question: z3.string().min(1).max(500).optional(),
4644
- /** The ruling. */
4645
- answer: z3.string().min(1).max(2e3)
4646
- }).refine((d) => d.decisionId || d.question, { message: "decisionId or question required" });
4647
- var AssignNoteSchema = z3.object({
4648
- /** An EXISTING agent: token id or nickname. Omit when spawning fresh. */
4649
- target: z3.string().min(1).optional(),
4650
- /** Spawn a NEW session for this note (companion.md §2.2): the assignee doesn't
4651
- * exist yet — mint it on a live desktop that advertises the harness+workspace,
4652
- * named after the note. The brief arrives as its opening request. */
4653
- spawn: z3.object({
4654
- hostTokenId: z3.string().uuid(),
4655
- harness: z3.string().min(1),
4656
- workspace: z3.string().min(1)
4657
- }).optional()
4658
- }).refine((a) => !!a.target !== !!a.spawn, { message: "exactly one of target or spawn" });
4659
- var TriageVerdictSchema = z3.enum(["keep", "stale", "close", "assign"]);
4660
4550
  var TriageItemSchema = z3.object({
4661
4551
  noteId: z3.string(),
4662
4552
  /** The note's headline at run time. */
@@ -4792,20 +4682,6 @@ var PairingRevealSchema = z3.object({
4792
4682
  ed25519: z3.string(),
4793
4683
  nonce: z3.string()
4794
4684
  });
4795
- var DeviceCodeRequestSchema = z3.object({
4796
- /** The agent's suggested name for the pairing — the human sees it pre-filled at
4797
- * approval and can override. Optional; blank → a default silly name server-side. */
4798
- suggestedName: z3.string().optional(),
4799
- /** Legacy alias for suggestedName (older MCPs sent `agent`). Accepted for
4800
- * back-compat; `suggestedName` wins when both are present. ponytail: drop once no
4801
- * pre-`name` MCP is in the wild. */
4802
- agent: z3.union([z3.string(), z3.object({ name: z3.string().optional() })]).optional(),
4803
- device: z3.string().optional(),
4804
- proto: z3.string().optional(),
4805
- // compiled-in tag, e.g. "paigy-pair-v2|sas=24"
4806
- commitment: z3.string().optional()
4807
- // agent's Ca
4808
- });
4809
4685
  var DeviceCodeSchema = z3.object({
4810
4686
  device_code: z3.string(),
4811
4687
  user_code: z3.string(),
@@ -4839,11 +4715,6 @@ var DeviceInfoSchema = z3.object({
4839
4715
  phone_reveal: PairingRevealSchema.nullable().optional(),
4840
4716
  uik_pub: z3.string().nullable().optional()
4841
4717
  });
4842
- var DeviceTokenRequestSchema = z3.object({
4843
- device_code: z3.string(),
4844
- reveal: PairingRevealSchema.optional()
4845
- // agent's reveal {x25519, ed25519, nonce}
4846
- });
4847
4718
  var DeviceTokenSchema = z3.object({
4848
4719
  access_token: z3.string(),
4849
4720
  /** The pairing's single name (user-typed at approval, the agent's suggestion, or
@@ -4865,14 +4736,6 @@ var DeviceTokenSchema = z3.object({
4865
4736
  // present once the phone reveals
4866
4737
  uik_pub: z3.string().nullable().optional()
4867
4738
  });
4868
- var DeviceCommitRequestSchema = z3.object({
4869
- code: z3.string(),
4870
- commitment: z3.string()
4871
- // Cb
4872
- });
4873
- var DevicePeerCommitSchema = z3.object({
4874
- commitment: z3.string().nullable()
4875
- });
4876
4739
  var SupportRequestSchema = z3.object({
4877
4740
  email: z3.string().email().max(320),
4878
4741
  message: z3.string().trim().min(1).max(5e3),
@@ -4892,15 +4755,6 @@ var NotificationFeedbackKindSchema = z3.enum([
4892
4755
  "other"
4893
4756
  // anything else — the note carries it.
4894
4757
  ]);
4895
- var NotificationFeedbackSchema = z3.object({
4896
- notificationId: z3.string(),
4897
- kind: NotificationFeedbackKindSchema,
4898
- /** Optional free-text elaboration for a preset; required (non-empty) for 'other'. */
4899
- note: z3.string().trim().max(2e3).optional()
4900
- }).superRefine((r, ctx) => {
4901
- if (r.kind === "other" && !r.note)
4902
- ctx.addIssue({ code: z3.ZodIssueCode.custom, path: ["note"], message: "note is required for 'other' feedback" });
4903
- });
4904
4758
  var FeedbackResolutionSchema = z3.enum(["broker_fixed", "sent_to_agent"]);
4905
4759
  var FeedbackOutcomeSchema = z3.object({
4906
4760
  resolution: FeedbackResolutionSchema,
@@ -5610,6 +5464,7 @@ export {
5610
5464
  whoAmI,
5611
5465
  setIdentity,
5612
5466
  heartbeat,
5467
+ contact,
5613
5468
  checkReplies,
5614
5469
  runTool,
5615
5470
  subscribeWake
@@ -10,7 +10,7 @@ import {
10
10
  saveToken,
11
11
  sleep,
12
12
  startE2ee
13
- } from "./chunk-QCWXYJ64.js";
13
+ } from "./chunk-JSQ6MXBI.js";
14
14
 
15
15
  // src/identity.ts
16
16
  var CLIENT_LABELS = {
package/dist/enable.js CHANGED
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  PAIGY_TOOL_IDS,
4
4
  enablePaigyTools
5
- } from "./chunk-IXVUUHTY.js";
6
- import "./chunk-CL5P4IVS.js";
7
- import "./chunk-QCWXYJ64.js";
5
+ } from "./chunk-4KT2EBPI.js";
6
+ import "./chunk-AOQ2CNMG.js";
7
+ import "./chunk-JSQ6MXBI.js";
8
8
 
9
9
  // src/enable.ts
10
10
  function main() {
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  resolvePairing,
6
6
  startPairing,
7
7
  suggestedAgentName
8
- } from "./chunk-4KN5TGBJ.js";
8
+ } from "./chunk-WW5Y5D42.js";
9
9
  import {
10
10
  ENABLE_COMMAND,
11
11
  OnboardSchema,
@@ -16,8 +16,8 @@ import {
16
16
  autoConfigureClients,
17
17
  claudeInstallHint,
18
18
  paigyToolsAllowlisted
19
- } from "./chunk-IXVUUHTY.js";
20
- import "./chunk-CL5P4IVS.js";
19
+ } from "./chunk-4KT2EBPI.js";
20
+ import "./chunk-AOQ2CNMG.js";
21
21
  import {
22
22
  clearSurface,
23
23
  writeSurface
@@ -38,7 +38,7 @@ import {
38
38
  setIdentity,
39
39
  slotName,
40
40
  whoAmI
41
- } from "./chunk-QCWXYJ64.js";
41
+ } from "./chunk-JSQ6MXBI.js";
42
42
 
43
43
  // src/index.ts
44
44
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
package/dist/listen.js CHANGED
@@ -1,12 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  entryWords
4
- } from "./chunk-CL5P4IVS.js";
4
+ } from "./chunk-AOQ2CNMG.js";
5
5
  import {
6
6
  checkReplies,
7
+ contact,
7
8
  getGoal,
8
9
  subscribeWake
9
- } from "./chunk-QCWXYJ64.js";
10
+ } from "./chunk-JSQ6MXBI.js";
10
11
 
11
12
  // src/listen.ts
12
13
  import { spawn } from "child_process";
@@ -113,7 +114,7 @@ function uninstallService() {
113
114
  // src/listen.ts
114
115
  var emit = (obj) => void process.stdout.write(JSON.stringify(obj) + "\n");
115
116
  function saidIn(delivery) {
116
- return delivery.entries.filter((entry) => entry.kind === "contribution").map((entry) => entryWords(entry)).filter(Boolean).join("\n");
117
+ return ("entries" in delivery ? delivery.entries : []).filter((entry) => entry.kind === "contribution").map((entry) => entryWords(entry)).filter(Boolean).join("\n");
117
118
  }
118
119
  function launchEnv(waiting, reason, goalId) {
119
120
  const env = { PAIGY_WORK: JSON.stringify(waiting), PAIGY_EVENT: reason };
@@ -134,8 +135,10 @@ function launchEnv(waiting, reason, goalId) {
134
135
  async function sweep(reason, goalId) {
135
136
  try {
136
137
  const cmd = process.env.PAIGY_ON_WAKE;
137
- const { deliveries } = await checkReplies();
138
- const lead = (goalId ? deliveries.find((d) => d.goalIds.includes(goalId)) : void 0) ?? deliveries[0];
138
+ const { deliveries: rows } = await checkReplies();
139
+ const lead = (goalId ? rows.find((d) => d.goalIds.includes(goalId)) : void 0) ?? rows[0];
140
+ const full = lead ? await contact({ deliveryId: lead.deliveryId }, { waits: false }).catch(() => null) : null;
141
+ const deliveries = rows.map((d) => d === lead && full ? full : d);
139
142
  const leadGoalId = lead?.goalIds[0];
140
143
  const goal = leadGoalId ? await getGoal(leadGoalId).then((g) => ({ goalId: leadGoalId, contextThreadId: g.contextThreadId, progress: g.progress })).catch(() => null) : null;
141
144
  const waiting = { deliveries, goal };
package/dist/onboard.js CHANGED
@@ -3,13 +3,13 @@ import {
3
3
  resolvePairing,
4
4
  startPairing,
5
5
  suggestedAgentName
6
- } from "./chunk-4KN5TGBJ.js";
6
+ } from "./chunk-WW5Y5D42.js";
7
7
  import {
8
8
  autoConfigureClients,
9
9
  claudeInstallHint,
10
10
  openBrowser
11
- } from "./chunk-IXVUUHTY.js";
12
- import "./chunk-CL5P4IVS.js";
11
+ } from "./chunk-4KT2EBPI.js";
12
+ import "./chunk-AOQ2CNMG.js";
13
13
  import {
14
14
  AGENT_NAME,
15
15
  TOKEN_PATH,
@@ -20,7 +20,7 @@ import {
20
20
  saveToken,
21
21
  setIdentity,
22
22
  whoAmI
23
- } from "./chunk-QCWXYJ64.js";
23
+ } from "./chunk-JSQ6MXBI.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
  AGENT_NAME
4
- } from "./chunk-QCWXYJ64.js";
4
+ } from "./chunk-JSQ6MXBI.js";
5
5
 
6
6
  // src/slot.ts
7
7
  process.stdout.write(AGENT_NAME);
@@ -9,7 +9,7 @@ import {
9
9
  readToken,
10
10
  sessionSlot,
11
11
  slotName
12
- } from "./chunk-QCWXYJ64.js";
12
+ } from "./chunk-JSQ6MXBI.js";
13
13
 
14
14
  // src/statusline.ts
15
15
  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.40.4",
3
+ "version": "0.40.5",
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",