pendingyou 0.42.0 → 0.43.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.43.0 (2026-11-16)
4
+
5
+ - Pending You for Herdr shows an assistant's question on a card it still has, and answers it. When a card you handed
6
+ to one of your assistants needs something from you, it's in the popup with the rest, first: "Maple needs you to:"
7
+ and the steps, for a helper's to-do (y Done, n "I can't", with your words if you have any), or "Maple asks:" and its
8
+ options or a box for your words. Your answer goes to the question, not the card, which stays with the helper; u takes
9
+ it back for 5 seconds. A question that's high stakes, or carries a draft to send in your name, is answered in Pending
10
+ You (o opens it).
11
+ - "Ask Maple?": introductions go both ways now, so an assistant may ask the one whose card it worked on. The popup says
12
+ "Ask Maple?" for that, and "Wren worked on Maple’s “…”", until Maple has helped it; then "Ask Maple again?" as before.
13
+ - A card its helper handed back and then picked back up says so in the popup.
14
+ - Run `npx pendingyou@latest init`; nothing to restart but Herdr's popup, which picks it up the next time it opens.
15
+
3
16
  ## 0.42.0 (2026-11-16)
4
17
 
5
18
  - Fixed: a Codex thread that had only said its name to Pending You (`whoami`, then read its queue) was never woken for a
@@ -26,6 +26,8 @@ export const SAY_YES_THERE = 'Say yes in Pending You: o opens it.';
26
26
  const ASK_AGAIN_KEYS = 'y: yes, this time; n: no.';
27
27
  export const sendToOf = (card) => card.sendTo && (card.status === 'pending' || card.status === 'snoozed') ? card.sendTo : null;
28
28
  const asksAgain = (sendTo) => sendTo.kind === 'assistant';
29
+ export const openAskOf = (card) => card.ask && !card.ask.answered ? card.ask : null;
30
+ const TODO_KEYS = 'y: done; n: I can’t.';
29
31
  export const toTeammate = (card) => `Send this to ${card.sendTo?.name ?? 'them'}? Answer it in Pending You: o opens it.`;
30
32
  const dayOf = (at) => {
31
33
  const when = new Date(at);
@@ -160,10 +162,47 @@ function listKey(state, key, now) {
160
162
  const sendTo = sendToOf(card);
161
163
  if (sendTo)
162
164
  return sendToKey(state, card, sendTo, key);
165
+ const ask = openAskOf(card);
166
+ if (ask)
167
+ return askKey(state, card, ask, key);
163
168
  if (!answersHere(card))
164
169
  return [{ ...state, note: NOT_HERE }, NONE];
165
170
  return answerKey(state, card, key);
166
171
  }
172
+ function askKey(state, card, ask, key) {
173
+ if (ask.highStakes)
174
+ return [{ ...state, note: HIGH_STAKES }, NONE];
175
+ if (!card.actions.includes('answer'))
176
+ return [{ ...state, note: NOT_HERE }, NONE];
177
+ const send = (answer, words) => [
178
+ { ...state, note: '' },
179
+ { kind: 'answer', card, answer: { version: card.version, askId: ask.id, ...answer }, words },
180
+ ];
181
+ const enter = key === '\r' || key === '\n';
182
+ if (ask.action) {
183
+ if (key === 'y' || enter)
184
+ return send({ done: true }, 'Done');
185
+ if (key === 'n')
186
+ return [{ ...state, screen: { kind: 'write', purpose: 'cant', text: '' }, note: '' }, NONE];
187
+ return [{ ...state, note: TODO_KEYS }, NONE];
188
+ }
189
+ if (ask.options?.length) {
190
+ const n = digit(key);
191
+ const option = n ? ask.options[n - 1] : undefined;
192
+ if (option)
193
+ return send({ choiceIds: [option.id] }, option.label);
194
+ return [
195
+ {
196
+ ...state,
197
+ note: `Press 1–${Math.min(KEYS_MAX, ask.options.length)} to answer ${ask.name}.`,
198
+ },
199
+ NONE,
200
+ ];
201
+ }
202
+ if (enter)
203
+ return [{ ...state, screen: { kind: 'write', purpose: 'ask', text: '' }, note: '' }, NONE];
204
+ return [{ ...state, note: 'Enter writes your answer.' }, NONE];
205
+ }
167
206
  function sendToKey(state, card, sendTo, key) {
168
207
  if (!asksAgain(sendTo))
169
208
  return [{ ...state, note: toTeammate(card) }, NONE];
@@ -377,9 +416,34 @@ function writeKey(state, screen, key) {
377
416
  return [{ ...state, screen: { ...screen, text: [...screen.text].slice(0, -1).join('') } }, NONE];
378
417
  if (key === '\r' || key === '\n') {
379
418
  const text = screen.text.trim();
419
+ const ask = openAskOf(card);
420
+ if (screen.purpose === 'cant' && ask)
421
+ return [
422
+ { ...state, screen: { kind: 'list' }, note: '' },
423
+ {
424
+ kind: 'answer',
425
+ card,
426
+ answer: { version: card.version, askId: ask.id, done: false, ...(text ? { text } : {}) },
427
+ words: text ? `Couldn’t: ${text}` : 'Couldn’t',
428
+ },
429
+ ];
380
430
  if (!text)
381
431
  return [{ ...state, note: 'Write something first, or Esc to go back.' }, NONE];
382
432
  switch (screen.purpose) {
433
+ case 'cant':
434
+ return said(state, '');
435
+ case 'ask':
436
+ if (!ask)
437
+ return said(state, '');
438
+ return [
439
+ { ...state, screen: { kind: 'list' }, note: '' },
440
+ {
441
+ kind: 'answer',
442
+ card,
443
+ answer: { version: card.version, askId: ask.id, text },
444
+ words: text,
445
+ },
446
+ ];
383
447
  case 'reply':
384
448
  return [
385
449
  { ...state, screen: { kind: 'list' }, note: '' },
@@ -508,7 +572,13 @@ export function sentState(state, sent, now) {
508
572
  : (sent.until ?? now + UNDO_MS);
509
573
  return {
510
574
  ...fresh(state),
511
- sent: { cardId: sent.cardId, what: sent.what, words: sent.words, until },
575
+ sent: {
576
+ cardId: sent.cardId,
577
+ what: sent.what,
578
+ words: sent.words,
579
+ until,
580
+ ...(sent.askId ? { askId: sent.askId } : {}),
581
+ },
512
582
  note: '',
513
583
  };
514
584
  }
@@ -554,6 +624,9 @@ function tagOf(card, state, now) {
554
624
  return 'sent';
555
625
  if (card.highStakes)
556
626
  return 'high stakes';
627
+ const ask = openAskOf(card);
628
+ if (ask)
629
+ return ask.action ? `${ask.name} needs you` : `${ask.name} asks`;
557
630
  if (card.turn === 'agent')
558
631
  return 'their turn';
559
632
  return card.blocking ? 'blocking' : card.urgency;
@@ -655,28 +728,82 @@ function askLines(card, state, room, now) {
655
728
  lines.push(...wrap(NOT_HERE, room, 2));
656
729
  return lines;
657
730
  }
731
+ const possessive = (name) => (/s$/i.test(name) ? `${name}’` : `${name}’s`);
732
+ function askedLines(card, ask, room) {
733
+ const fit = (text) => cleanValue(text, room);
734
+ const helper = ask.from === 'helper';
735
+ const lines = [
736
+ BOLD(fit(ask.action
737
+ ? `${ask.name} needs you to:`
738
+ : helper
739
+ ? `${ask.name} asks:`
740
+ : `${ask.name} has a question for you first:`)),
741
+ BOLD(fit(ask.title)),
742
+ ...(ask.summary ? wrap(ask.summary, room, 3) : []),
743
+ ...(ask.why ? wrap(ask.why, room, 3) : []),
744
+ ];
745
+ if (ask.action) {
746
+ for (const [index, step] of ask.action.steps.entries()) {
747
+ const each = typeof step === 'string' ? { text: step } : step;
748
+ lines.push(fit(`${index + 1}. ${each.text}`));
749
+ if (each.command)
750
+ lines.push(fit(` $ ${each.command}`));
751
+ }
752
+ if (ask.action.where)
753
+ lines.push(DIM(fit(`Where: ${ask.action.where}`)));
754
+ if (ask.action.done)
755
+ lines.push(...wrap(`You’ll know it worked: ${ask.action.done}`, room, 2));
756
+ }
757
+ for (const [index, option] of (ask.options ?? []).slice(0, KEYS_MAX).entries()) {
758
+ const star = ask.recommendedIds?.includes(option.id) ? '★ ' : '';
759
+ lines.push(fit(`${index + 1} ${star}${option.label}${option.detail ? ` · ${option.detail}` : ''}`));
760
+ }
761
+ if (helper) {
762
+ lines.push(DIM(fit(`${askerName(card)} asked: ${card.title}`)));
763
+ if (card.delegation?.resumes?.length)
764
+ lines.push(DIM(fit(`${ask.name} handed it back, then picked it back up.`)));
765
+ lines.push(...wrap(`Your answer goes to ${ask.name}.`, room, 2));
766
+ }
767
+ if (ask.highStakes)
768
+ lines.push(...wrap(HIGH_STAKES, room, 2));
769
+ else if (!card.actions.includes('answer'))
770
+ lines.push(...wrap(NOT_HERE, room, 2));
771
+ return lines;
772
+ }
658
773
  function sendToLines(card, sendTo, room) {
659
774
  if (!asksAgain(sendTo))
660
775
  return wrap(toTeammate(card), room, 2);
661
776
  const name = sendTo.name;
662
777
  const helped = sendTo.helped;
663
778
  const on = helped && dayOf(helped.at) ? ` on ${dayOf(helped.at)}` : '';
779
+ const theirs = Boolean(helped?.theirs && !helped.answered);
664
780
  const before = helped
665
781
  ? helped.answered
666
782
  ? `${name} helped with “${helped.title}”${on}.`
667
- : `You handed ${name} “${helped.title}”${on}.`
783
+ : theirs
784
+ ? `${askerName(card)} worked on ${possessive(name)} “${helped.title}”${on}.`
785
+ : `You handed ${name} “${helped.title}”${on}.`
668
786
  : null;
669
787
  const goes = sendTo.mode === 'freely'
670
788
  ? `${name}’s answer goes straight to ${askerName(card)}.`
671
789
  : `${name}’s answer comes back to you first.`;
672
790
  const yesHere = Boolean(sendTo.to) && card.actions.includes('delegate');
673
791
  return [
674
- BOLD(cleanValue(`Ask ${name} again?`, room)),
792
+ BOLD(cleanValue(theirs ? `Ask ${name}?` : `Ask ${name} again?`, room)),
675
793
  ...(before ? wrap(before, room, 2) : []),
676
794
  ...wrap(goes, room, 2),
677
795
  ...(yesHere || card.highStakes ? [] : wrap(SAY_YES_THERE, room, 2)),
678
796
  ];
679
797
  }
798
+ function askKeys(card, ask) {
799
+ if (ask.highStakes || !card.actions.includes('answer'))
800
+ return [];
801
+ if (ask.action)
802
+ return ['y done', 'n I can’t'];
803
+ if (ask.options?.length)
804
+ return [`1–${Math.min(KEYS_MAX, ask.options.length)} answer`];
805
+ return ['Enter write'];
806
+ }
680
807
  function sendToKeys(card, sendTo) {
681
808
  if (!asksAgain(sendTo))
682
809
  return [];
@@ -752,8 +879,11 @@ export function keysLine(state, now) {
752
879
  const busy = state.sent?.cardId === card.id && now < state.sent.until;
753
880
  if (!card.highStakes && !busy) {
754
881
  const sendTo = sendToOf(card);
882
+ const ask = openAskOf(card);
755
883
  if (sendTo)
756
884
  keys.push(...sendToKeys(card, sendTo));
885
+ else if (ask)
886
+ keys.push(...askKeys(card, ask));
757
887
  else if (answersHere(card))
758
888
  keys.push(...answerKeys(card, state));
759
889
  if (card.actions.includes('reply'))
@@ -797,9 +927,11 @@ export function queueLines(state, width, height, now) {
797
927
  ? `To ${askerName(card)}: `
798
928
  : screen.purpose === 'failed'
799
929
  ? `What happened at step ${screen.step ?? 1}? `
800
- : screen.purpose === 'question'
801
- ? 'Your answer: '
802
- : 'Your answer: ';
930
+ : screen.purpose === 'cant'
931
+ ? 'I can’t, because (or just Enter): '
932
+ : screen.purpose === 'ask'
933
+ ? `To ${openAskOf(card)?.name ?? askerName(card)}: `
934
+ : 'Your answer: ';
803
935
  const typed = [...screen.text];
804
936
  const shown = typed.slice(Math.max(0, typed.length - (room - label.length - 1))).join('');
805
937
  foot.push(`${label}${shown}▏`);
@@ -833,8 +965,9 @@ export function queueLines(state, width, height, now) {
833
965
  if (!chosen)
834
966
  return [first];
835
967
  const pane = state.panes[each.id];
968
+ const ask = openAskOf(each);
836
969
  const where = [
837
- askerOf(each),
970
+ ask?.from === 'helper' ? `${askerOf(each)} → ${ask.name}` : askerOf(each),
838
971
  each.area.name,
839
972
  ...(each.asker.machine && each.asker.machine.name !== state.machine
840
973
  ? [each.asker.machine.name]
@@ -845,8 +978,9 @@ export function queueLines(state, width, height, now) {
845
978
  return [
846
979
  INVERSE(first),
847
980
  ` ${DIM(fit(where, inner))}`,
848
- ...wrap(each.summary, inner, 3).map((line) => ` ${line}`),
849
- ...askLines(each, state, inner, now).map((line) => ` ${line}`),
981
+ ...(ask
982
+ ? askedLines(each, ask, inner)
983
+ : [...wrap(each.summary, inner, 3), ...askLines(each, state, inner, now)]).map((line) => ` ${line}`),
850
984
  ];
851
985
  });
852
986
  const space = Math.max(4, height - head.length - foot.length - 2);
@@ -1,6 +1,6 @@
1
1
  import { appClient, readAppSignIn } from "../app-login.js";
2
2
  import { herdrServer } from "../herdr.js";
3
- import { ApiError, SignedOutError } from "../sdk/index.js";
3
+ import { ApiError, SignedOutError, } from "../sdk/index.js";
4
4
  import { askerOf, emptyQueue, HIGH_STAKES, queueKey, queueLines, sentState, targetsFor, UNDO_MS, } from "./answer.js";
5
5
  import { idsOf, readSnapshot } from "./panes.js";
6
6
  import { markActive } from "./presence.js";
@@ -37,6 +37,13 @@ export function failureWords(error) {
37
37
  return error.message || `Pending You couldn’t do that (${error.code}).`;
38
38
  }
39
39
  }
40
+ export function queueCards(pending, delegated) {
41
+ const asked = delegated.cards.filter((card) => card.ask && !card.ask.answered);
42
+ return {
43
+ cards: [...asked, ...pending.cards.filter((card) => !asked.some((one) => one.id === card.id))],
44
+ counts: { ...pending.counts, pending: pending.counts.pending + asked.length },
45
+ };
46
+ }
40
47
  export function panesOf(cards, snapshot, assistants, server) {
41
48
  const panes = {};
42
49
  if (!snapshot)
@@ -225,9 +232,13 @@ export async function queuePopup(io, place, options) {
225
232
  if (!client || ended)
226
233
  return;
227
234
  try {
228
- const page = await client.cards.list({ status: 'pending', limit: 50, whole: 0 });
235
+ const [page, handed] = await Promise.all([
236
+ client.cards.list({ status: 'pending', limit: 50, whole: 0 }),
237
+ client.cards.list({ status: 'delegated', limit: 50, whole: 0 }),
238
+ ]);
229
239
  const keep = state.cards[state.selected]?.id;
230
- let cards = page.cards;
240
+ const listed = queueCards(page, handed);
241
+ let cards = listed.cards;
231
242
  const sent = state.sent;
232
243
  if (sent && io.now() < sent.until && !cards.some((card) => card.id === sent.cardId)) {
233
244
  const held = state.cards.find((card) => card.id === sent.cardId);
@@ -239,7 +250,7 @@ export async function queuePopup(io, place, options) {
239
250
  state = {
240
251
  ...state,
241
252
  cards,
242
- counts: page.counts,
253
+ counts: listed.counts,
243
254
  selected: at >= 0 ? at : Math.max(0, Math.min(state.selected, cards.length - 1)),
244
255
  ...(moved
245
256
  ? { screen: { kind: 'list' }, chosen: [], answers: {}, question: 0 }
@@ -352,7 +363,13 @@ export async function queuePopup(io, place, options) {
352
363
  }
353
364
  try {
354
365
  const done = await client.cards.answer(effect.card.id, effect.answer);
355
- state = sentState(state, { cardId: effect.card.id, what, words: effect.words, until: done.undoUntil }, io.now());
366
+ state = sentState(state, {
367
+ cardId: effect.card.id,
368
+ what,
369
+ words: effect.words,
370
+ until: done.undoUntil,
371
+ ...(effect.answer.askId ? { askId: effect.answer.askId } : {}),
372
+ }, io.now());
356
373
  }
357
374
  catch (error) {
358
375
  fail(error);
@@ -367,8 +384,9 @@ export async function queuePopup(io, place, options) {
367
384
  }
368
385
  try {
369
386
  const { cardId, what } = effect.sent;
387
+ const { askId } = effect.sent;
370
388
  if (what === 'answer' || what === 'not_sent')
371
- await client.cards.undo(cardId);
389
+ await client.cards.undo(cardId, askId ? { askId } : {});
372
390
  else if (what === 'later')
373
391
  await client.cards.back(cardId);
374
392
  else
@@ -190,7 +190,10 @@ export function createClient(options) {
190
190
  body: answer,
191
191
  ...keyed(opts?.idempotencyKey),
192
192
  }),
193
- undo: (id, opts) => request('POST', path(id, 'undo'), { body: {}, ...keyed(opts?.idempotencyKey) }),
193
+ undo: (id, opts) => request('POST', path(id, 'undo'), {
194
+ body: opts?.askId ? { askId: opts.askId } : {},
195
+ ...keyed(opts?.idempotencyKey),
196
+ }),
194
197
  reply: (id, message, opts) => request('POST', path(id, 'messages'), {
195
198
  body: typeof message === 'string' ? { body: message } : message,
196
199
  ...keyed(opts?.idempotencyKey),
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.42.0';
1
+ export const VERSION = '0.43.0';
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pendingyou-wake",
3
3
  "displayName": "Pending You",
4
- "version": "2.60.0",
4
+ "version": "2.61.0",
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.60.0; send changes there.
7
+ Generated from recordplane/pendingyou (packages/claude-plugin/src/wake) with Pending You’s guide 2.61.0; send changes there.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pendingyou",
3
- "version": "0.42.0",
3
+ "version": "0.43.0",
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",