@paigy/mcp 0.40.23 → 0.40.25

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.
package/README.md CHANGED
@@ -117,7 +117,7 @@ Then pair: `PAIGY_AGENT=gemini npx -p @paigy/mcp@latest paigy-mcp-onboard`.
117
117
  ## Tools
118
118
 
119
119
  One catalog, on every transport (2026-09-11): the agent tools are `AGENT_TOOLS` in
120
- `packages/schema/src/tools.ts` — contact, check_replies, create_goal, claim_goal,
120
+ `packages/schema/src/tools.ts` — who_is_working, contact, manage_goals, claim_goal,
121
121
  get_goal, update_goal — and both this server and the hosted MCP
122
122
  (`apps/api/src/mcp`) publish that list and dispatch it through the SDK's one `runTool`.
123
123
  This server adds only onboard, pair and unpair, the tools that mint and delete the token
@@ -125,10 +125,12 @@ file this machine holds. See the [SDK contract](../../packages/sdk/README.md) fo
125
125
  single-Goal start shape. Notification returns immediately. Call holds one cancellable
126
126
  ~45-second window here (the hosted transport returns after one read); continue with
127
127
  contact({deliveryId}) without sending another ask. Durable Entries and accepted answers can
128
- repeat on reads; check_replies lists every open Delivery addressed to you (a request the
129
- user started toward you, an answer relayed to something you asked, a handoff) without
130
- consuming any of it, and claim_goal is the catch-up for your own Goals. Bookkeeping ids
131
- (`operationId`, `idempotencyKey`) are minted here, never asked of the model. Retired
128
+ repeat on reads; contact with nothing to send receives what is addressed to you (a request the
129
+ user started toward you, an answer relayed to something you asked, a handoff, a question you owe) without
130
+ consuming any of it until you acknowledge it (`ackEventIds`), and claim_goal is the catch-up for
131
+ your own Goals. manage_goals creates, edits, assigns, organizes and closes work, a change at a
132
+ time. Bookkeeping (`operationId`, the manage request id, the revision an edit was read at) is
133
+ minted here, never asked of the model. Retired
132
134
  reply-lease/ACK/work/callback tools and hidden notification aliases are rejected.
133
135
 
134
136
  The standalone listener below is still a **legacy host and target-release blocker**.
@@ -154,7 +156,7 @@ wake channel and reads what is waiting on every nudge. Keep it alive past the te
154
156
  with `paigy-listen --install` (launchd on macOS, systemd user unit on Linux;
155
157
  `--uninstall` removes it).
156
158
 
157
- The read is `check_replies` — the open Deliveries addressed to this agent — and it
159
+ The read is `receive` (behind `contact({})`) — the open Deliveries addressed to this agent — and it
158
160
  **consumes nothing**: no lease, no acknowledgement, and the same read twice returns the
159
161
  same list. So the daemon hands the launcher what it found and stops there; claiming is
160
162
  the agent's own first act (`claim_goal`), because the daemon shares this machine's
@@ -184,26 +186,39 @@ Goal" from "an empty id".
184
186
  PAIGY_ON_WAKE='claude -p "Handle the Paigy work in $PAIGY_WORK — claim_goal first, and read a Goal you do not recognize with get_goal."' \
185
187
  npx -y -p @paigy/mcp paigy-listen --install
186
188
 
187
- # Codex (or any CLI harness) — the scalars are enough for a one-liner:
188
- PAIGY_ON_WAKE='codex exec "Claim Paigy goal $PAIGY_GOAL_ID and continue thread $PAIGY_THREAD_ID. The user said: $PAIGY_TEXT. Reply with contact."' \
189
- npx -y -p @paigy/mcp paigy-listen --install
189
+ # Codex terminal session: no custom script and no new conversation.
190
+ # CODEX_THREAD_ID is inherited from the running session.
191
+ npx -y -p @paigy/mcp@latest paigy-listen --brief
190
192
  ```
191
193
 
192
194
  ### A session that starts listening (`listen`, #2265)
193
195
 
194
- Nothing pushes an answer into a session started in a terminal — it waits for that
195
- session's next `check_replies`. What can reach a running session mid-turn is a watched
196
- background task, so a terminal session runs `paigy-listen --brief` as its own watched task
197
- (one human line per event: `Paigy · wake:reply · 2 waiting · lead <deliveryId> on Goal
198
- <goalId>: "…"`). The `listen` tool is how a session asked to "start listening" gets there
199
- in one call: it decides and hands over — `listening` (nothing to do), `unpaired` (call
200
- `onboard`), or `start` with the exact command (this server's own node and `listen.js`,
201
- `PAIGY_AGENT` and `PAIGY_SESSION_ID` set to this session's slot and id — a session-bound
202
- identity is refused from any other) for the agent to run as its background task in the
203
- same turn. It never subscribes, spawns or writes settings. "Already running" is a fact: the
204
- daemon marks its pid under `~/.paigy/listen/<slot>.pid` while it runs. A session started by
205
- the Paigy harness (`paigy-harness host` / `run`) needs none of this — its pump types each
206
- answer in as it lands, and `listen` says so.
196
+ Run `listen` to obtain the exact background command for the current session. For Codex,
197
+ `paigy-listen` reads `CODEX_THREAD_ID`, checks that the installed `codex queue` supports
198
+ `--thread` and `--message`, then queues a wake into that existing conversation. It uses
199
+ argument arrays, never interpolates user text into a shell, and never starts another
200
+ conversation. Two threads in the same folder have separate listener marks and checkpoints.
201
+ Onboarding forwards the thread identifier into the MCP environment; `listen` forwards it
202
+ into the listener command explicitly. Re-running onboarding repairs an existing Paigy allowlist while preserving custom variables; restart the MCP server to inherit the repaired environment. An older slot-wide listener is reported as already receiving until deliberately stopped, so upgrades do not start a second subscriber.
203
+
204
+ `PAIGY_ON_WAKE` remains an explicit override with its original per-sweep behavior: an
205
+ existing script may ignore boot or timer events. Without a supported adapter, the listener
206
+ still prints events, but reports only `receiving`; a process being alive does not prove it
207
+ can resume an agent. `listening` with a ready adapter means the command is available, and
208
+ `lastQueuedAt` records its last successful exit. Neither claims that the agent read or
209
+ handled a reply. Queue errors are visible in listener output and in `listen` status.
210
+
211
+ Native Codex wakes coalesce unchanged backlog, including across listener restarts. The listener compares source Entry IDs and accepted Answer timestamps on the bounded list of pending review Goals; its own progress and claims are excluded. A later reply is new evidence even if its words are identical. Failed handoffs remain retryable
212
+ on the existing timer, next nudge or reconnect; discovery never claims or acknowledges
213
+ work. Queue commands are serialized, so a burst becomes one fresh discovery read after
214
+ an in-flight handoff. A command accepted just before a process crash may be queued again;
215
+ the resumed agent must still read and acknowledge actual evidence through Paigy.
216
+
217
+ A managed Paigy session carries `PAIGY_HARNESS` and keeps its existing delivery pump;
218
+ it does not start another listener. `PAIGY_SESSION_ID` binds API requests and alone does
219
+ not establish harness delivery. Other hosts need a supported wake command or a host that
220
+ actually surfaces watched-task output. Use a session listener for Codex, not `--install`:
221
+ the service is machine-wide and has no current conversation.
207
222
 
208
223
  `$PAIGY_TEXT` is whatever the user said, expanded inside a shell command — keep it
209
224
  quoted, as above. For anything longer than a one-liner, point `PAIGY_ON_WAKE` at a
@@ -218,7 +233,7 @@ codex exec "Paigy goal $PAIGY_GOAL_ID. claim_goal it first. The user said: $PAIG
218
233
  ## Stalled work (turn-end hook — Claude Code, Codex, Gemini CLI, Antigravity)
219
234
 
220
235
  An agent that goes quiet leaves its Goals behind. Three things hand it that work back, all
221
- reading one rule (no progress for 3 days, `COLD_AFTER_MS`): `check_replies` lists it under
236
+ reading one rule (no progress for 3 days, `COLD_AFTER_MS`): `contact({})` lists it under
222
237
  `stalled`, `paigy-listen` carries it in `PAIGY_WORK` (and launches for it on boot), and this
223
238
  hook holds a session's turn end once a day to list it. One program, four tools:
224
239
 
@@ -6,7 +6,7 @@ import {
6
6
  saveToken,
7
7
  setIdentity,
8
8
  sleep
9
- } from "./chunk-PR7ROBN4.js";
9
+ } from "./chunk-EJYXBEWN.js";
10
10
 
11
11
  // src/identity.ts
12
12
  var CLIENT_LABELS = {