pendingyou 0.43.0 → 0.43.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.43.1 (2026-11-16)
4
+
5
+ - Claude Code: when you answer a card while its session sits idle, the turn that wakes it now carries your answer in
6
+ words, and the version to acknowledge it with: "Pending You: your person answered “Which retry plan?” (req_…): “Job
7
+ queue. Try it twice first.” Act on their words, then ack_answer (…) with a one-line outcome." The assistant no longer
8
+ calls `get_request` just to read it, which saves a call of its model for each answer. Only your own answer, when the
9
+ words are all of it: an approved draft or an option that sends, a picture, a helper's or a teammate's answer, a
10
+ high-stakes card, and a reply on one of its answers still say to call `get_request`, as before. The words stay in the
11
+ session: never in the mod's store, a log or a program's arguments. Codex is unchanged (its wake goes through a
12
+ command's arguments, which other programs can read, so it still reads the answer itself).
13
+ - Needs Pending You's server from the same release (get_request's answer in words); against an older one the mod checks
14
+ as before and the wake says to call `get_request`.
15
+ - Run `npx pendingyou@latest init`; nothing to restart: an open Claude Code session reloads the mod by itself.
16
+
3
17
  ## 0.43.0 (2026-11-16)
4
18
 
5
19
  - Pending You for Herdr shows an assistant's question on a card it still has, and answers it. When a card you handed
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.43.0';
1
+ export const VERSION = '0.43.1';
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pendingyou-wake",
3
3
  "displayName": "Pending You",
4
- "version": "2.61.0",
4
+ "version": "2.61.1",
5
5
  "description": "Wakes Claude Code when your person answers a Pending You card it posted, even while it sits idle. Installed by `npx pendingyou init`.",
6
6
  "author": {
7
7
  "name": "RecordPlane",
package/mod/README.md CHANGED
@@ -4,4 +4,4 @@ The pendingyou command line’s copy of the Pending You plugin’s wake mod, for
4
4
 
5
5
  In each session it learns the cards the session posts to Pending You, checks them through the session’s own Pending You connection, and starts a turn when your person answers, writes back or a fallback comes due, or hands the session a question from another of their assistants (CLI 0.14.0), even while it sits idle. It answers `npx pendingyou hold` itself, so nothing waits in the background, and shows “2 waiting on you” under the prompt, after the plugin’s name. With the Pending You plugin installed too, only one copy acts.
6
6
 
7
- Generated from recordplane/pendingyou (packages/claude-plugin/src/wake) with Pending You’s guide 2.61.0; send changes there.
7
+ Generated from recordplane/pendingyou (packages/claude-plugin/src/wake) with Pending You’s guide 2.61.1; send changes there.
@@ -1,7 +1,7 @@
1
1
  // Generated from packages/claude-plugin/src/wake/register.ts in recordplane/pendingyou: edit that, then run
2
2
  // `pnpm --filter @pendingyou/claude-plugin generate`.
3
3
 
4
- import { argumentsOf, blockedNote, CLAIM_PREFIX, CLI_COPY, cardTool, checked, claimedElsewhere, claimHeld, claimLease, cliConfigOf, connectionOf, dueCards, emptyBook, failed, folderOf, graceEnds, HANDED_FAST_MS, HANDED_READS, HERDR_EVERY_MS, HERDR_RUN_MS, handedDue, handedNext, handedOf, handedText, handedView, herdrArgv, herdrPayload, holdOf, holdReply, inHerdr, isFresh, isRefusal, isStale, isWaitingOnYou, KEEP_MS, LISTEN_RUN_MS, LISTENER_KEY, learn, leaseFor, leaseHolder, listenArgv, listened, loadedNote, loadedPath, mayListen, momentOf, originOf, PRESENCE_EVERY_MS, PRESENCE_RUN_MS, presenceArgv, prompted, put, readBook, readClaim, readListener, readSetup, readSignal, readSince, readWait, resultObject, SETUP_AFTER_MS, SETUP_RETRY_MS, SETUP_SERVER, SETUP_TRIES, SIGNAL_KEY, settle, setUpOf, setupNeeded, setupPrompt, stateOf, statusText, TICK_MS, takesHanded, told, toTell, untold, wakeText, } from "./wake.js";
4
+ import { argumentsOf, blockedNote, CLAIM_PREFIX, CLI_COPY, cardTool, checkArgs, checked, claimedElsewhere, claimHeld, claimLease, cliConfigOf, connectionOf, dueCards, emptyBook, failed, folderOf, graceEnds, HANDED_FAST_MS, HANDED_READS, HERDR_EVERY_MS, HERDR_RUN_MS, handedDue, handedNext, handedOf, handedText, handedView, herdrArgv, herdrPayload, holdOf, holdReply, inHerdr, isFresh, isRefusal, isStale, isWaitingOnYou, KEEP_MS, LISTEN_RUN_MS, LISTENER_KEY, learn, leaseFor, leaseHolder, listenArgv, listened, loadedNote, loadedPath, mayListen, momentOf, originOf, PRESENCE_EVERY_MS, PRESENCE_RUN_MS, presenceArgv, prompted, put, readBook, readClaim, readListener, readSetup, readSignal, readSince, readWait, resultObject, SETUP_AFTER_MS, SETUP_RETRY_MS, SETUP_SERVER, SETUP_TRIES, SIGNAL_KEY, settle, setUpOf, setupNeeded, setupPrompt, stateOf, statusText, TICK_MS, takesHanded, told, toTell, untold, wakeText, wordsOf, } from "./wake.js";
5
5
  const UNHEARD = { error: 'unavailable' };
6
6
  const RETRY_MS = 60_000;
7
7
  const live = {
@@ -32,6 +32,8 @@ const live = {
32
32
  herdrTimer: null,
33
33
  waiting: false,
34
34
  signalSeen: 0,
35
+ words: new Map(),
36
+ wordless: new Set(),
35
37
  };
36
38
  const keyOf = (sessionId) => `session:${sessionId}`;
37
39
  function blockedServer() {
@@ -107,23 +109,37 @@ async function allowed($, server, args, tool = 'get_request') {
107
109
  return false;
108
110
  }
109
111
  }
112
+ async function readCard($, card, words) {
113
+ const args = checkArgs(card, words);
114
+ if (!(await allowed($, card.server, args)))
115
+ return { output: null, blocked: true };
116
+ try {
117
+ return {
118
+ output: resultObject(await $.mcp.call(card.server, 'get_request', args)),
119
+ blocked: false,
120
+ };
121
+ }
122
+ catch (error) {
123
+ return { output: null, blocked: isRefusal(error) };
124
+ }
125
+ }
110
126
  async function check($, requestId) {
111
127
  const card = live.book.cards[requestId];
112
128
  if (!card)
113
129
  return 'error';
114
- let output = null;
115
- let blocked = false;
116
- const args = { requestId, ...(card.name ? { name: card.name } : {}) };
117
- if (await allowed($, card.server, args)) {
118
- try {
119
- output = resultObject(await $.mcp.call(card.server, 'get_request', args));
120
- }
121
- catch (error) {
122
- blocked = isRefusal(error);
123
- }
130
+ const words = !live.wordless.has(card.server);
131
+ let read = await readCard($, card, words);
132
+ if (words && !read.blocked && !(read.output && stateOf(read.output))) {
133
+ read = await readCard($, card, false);
134
+ if (read.output && stateOf(read.output))
135
+ live.wordless.add(card.server);
124
136
  }
125
- else
126
- blocked = true;
137
+ const { output, blocked } = read;
138
+ const said = output ? wordsOf(output) : undefined;
139
+ if (said)
140
+ live.words.set(requestId, said);
141
+ else if (output && stateOf(output))
142
+ live.words.delete(requestId);
127
143
  const outcome = output && stateOf(output) ? 'ok' : blocked ? 'blocked' : 'error';
128
144
  if (outcome === 'ok') {
129
145
  live.verified.add(card.server);
@@ -160,7 +176,7 @@ async function deliver($) {
160
176
  return false;
161
177
  live.book = told(live.book, cards);
162
178
  await save($);
163
- $.prompt.submit({ text: wakeText(cards) }).catch(async () => {
179
+ $.prompt.submit({ text: wakeText(cards, live.words) }).catch(async () => {
164
180
  live.book = untold(live.book, cards);
165
181
  live.quietUntil = (await $.clock.now()) + RETRY_MS;
166
182
  await save($).catch(() => { });
@@ -462,6 +478,7 @@ async function switchSession($, e) {
462
478
  live.sessionId = id;
463
479
  live.book = carried ?? readBook(await $.store.get(keyOf(id)));
464
480
  live.noted.clear();
481
+ live.words.clear();
465
482
  freshHanded();
466
483
  await noteLoaded($);
467
484
  if (typeof e.cwd === 'string' && e.cwd)
package/mod/hooks/wake.js CHANGED
@@ -417,9 +417,71 @@ export function settle(book, now) {
417
417
  export const isStale = (book, now) => now - book.updatedAt > KEEP_MS;
418
418
  const titled = (card) => card.title ? `“${clip(card.title)}” (${card.requestId})` : card.requestId;
419
419
  const named = (card) => (card.name ? `name “${card.name}”` : 'your name');
420
- function line(card) {
420
+ export const WORDS_CHARS = 600;
421
+ export function wordsOf(output) {
422
+ const state = stateOf(output);
423
+ if (state?.status !== 'answered' || state.turn !== 'agent' || state.approvedDraft)
424
+ return undefined;
425
+ const given = isObject(output.answer) ? output.answer.words : undefined;
426
+ if (typeof given !== 'string')
427
+ return undefined;
428
+ const flat = given.replace(/\s+/g, ' ').trim().replaceAll('“', '‘').replaceAll('”', '’');
429
+ if (!flat)
430
+ return undefined;
431
+ const chars = [...flat];
432
+ const cut = chars.length > WORDS_CHARS;
433
+ const text = cut
434
+ ? `${chars
435
+ .slice(0, WORDS_CHARS - 1)
436
+ .join('')
437
+ .trimEnd()}…`
438
+ : flat;
439
+ return { moment: momentOf(state), text, cut };
440
+ }
441
+ export const checkArgs = (card, words) => ({
442
+ requestId: card.requestId,
443
+ ...(card.name ? { name: card.name } : {}),
444
+ ...(words ? { words: true } : {}),
445
+ });
446
+ function wordsFor(card, words) {
447
+ const state = card.state;
448
+ if (!words || !state || card.kind === 'answer')
449
+ return undefined;
450
+ if (state.status !== 'answered' || state.approvedDraft)
451
+ return undefined;
452
+ return words.moment === momentOf(state) ? words : undefined;
453
+ }
454
+ function line(card, given) {
421
455
  const state = card.state;
422
456
  const get = `get_request (requestId ${card.requestId}, ${named(card)})`;
457
+ const words = wordsFor(card, given);
458
+ if (words) {
459
+ const ack = `ack_answer (requestId ${card.requestId}, ${named(card)}, expectedVersion ${state.version})`;
460
+ const quoted = `: “${words.text}”`;
461
+ const after = words.cut ? `Cut short: ${get} has all of it.` : undefined;
462
+ const rest = { quoted: true, ...(after ? { after } : {}) };
463
+ if (state.handled === 'self')
464
+ return {
465
+ happened: `your person will handle ${titled(card)} themselves${quoted}`,
466
+ todo: `close it out: take no action on it, leave things as they are and don’t follow up; ${ack} with an outcome like “Left to you”`,
467
+ ...rest,
468
+ };
469
+ if (state.handled === 'leave')
470
+ return {
471
+ happened: `your person won’t do ${titled(card)}${quoted}`,
472
+ todo: `close it out: don’t do it for them and don’t follow up; ${ack} with an outcome like “Skipped”`,
473
+ ...rest,
474
+ };
475
+ return {
476
+ happened: `your person answered ${titled(card)}${quoted}`,
477
+ todo: `act on their words, then ${ack} with a one-line outcome`,
478
+ ...rest,
479
+ };
480
+ }
481
+ const [happened, todo] = plainLine(card, get, state);
482
+ return { happened, todo };
483
+ }
484
+ function plainLine(card, get, state) {
423
485
  if (card.kind === 'answer')
424
486
  return [
425
487
  `your person replied to your answer ${titled(card)}`,
@@ -461,7 +523,7 @@ function line(card) {
461
523
  }
462
524
  }
463
525
  const capital = (sentence) => sentence.charAt(0).toUpperCase() + sentence.slice(1);
464
- export function wakeText(cards) {
526
+ export function wakeText(cards, words) {
465
527
  const asked = cards.some((card) => card.state?.turn === 'agent' &&
466
528
  !isClosed(card.state.status) &&
467
529
  card.state.status !== 'delegated' &&
@@ -469,15 +531,16 @@ export function wakeText(cards) {
469
531
  const reopen = asked
470
532
  ? ' If you need more from them, or the next step, post a new card with follows: that card’s requestId; never reopen.'
471
533
  : '';
534
+ const lineOf = (card) => line(card, words?.get(card.requestId));
472
535
  if (cards.length === 1) {
473
- const [happened, todo] = line(cards[0]);
474
- return `Pending You: ${happened}. ${capital(todo)}.${reopen}`;
536
+ const { happened, todo, quoted, after } = lineOf(cards[0]);
537
+ return `Pending You: ${happened}${quoted ? '' : '.'} ${capital(todo)}.${after ? ` ${after}` : ''}${reopen}`;
475
538
  }
476
539
  return [
477
540
  `Pending You: ${cards.length} of your cards need you.`,
478
541
  ...cards.map((card) => {
479
- const [happened, todo] = line(card);
480
- return `- ${capital(happened)}: ${todo}.`;
542
+ const { happened, todo, after } = lineOf(card);
543
+ return `- ${capital(happened)}: ${todo}.${after ? ` ${after}` : ''}`;
481
544
  }),
482
545
  ...(reopen ? [reopen.trim()] : []),
483
546
  ].join('\n');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pendingyou",
3
- "version": "0.43.0",
3
+ "version": "0.43.1",
4
4
  "description": "Pending You for your coding agents: one command sets up Claude Code, Codex, OpenCode and Pi to ask you through Pending You and hear your answers, even while they sit idle.",
5
5
  "keywords": [
6
6
  "pendingyou",