pendingyou 0.10.0 → 0.12.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 +125 -0
- package/README.md +207 -82
- package/dist/api.js +44 -32
- package/dist/apps/claude-code.js +365 -0
- package/dist/apps/codex-wake.js +479 -0
- package/dist/apps/codex.js +615 -0
- package/dist/apps/ids.js +26 -0
- package/dist/apps/opencode-plugin.js +440 -0
- package/dist/apps/opencode.js +734 -0
- package/dist/apps/pi-extension.js +391 -0
- package/dist/apps/pi.js +679 -0
- package/dist/apps/registry.js +14 -0
- package/dist/apps/types.js +1 -0
- package/dist/args.js +115 -36
- package/dist/bridge.js +566 -0
- package/dist/claude.js +164 -362
- package/dist/confirm.js +5 -4
- package/dist/credentials.js +68 -26
- package/dist/environment.js +17 -3
- package/dist/hold.js +18 -2
- package/dist/hooks.js +117 -0
- package/dist/index.js +3 -1
- package/dist/init.js +309 -0
- package/dist/io.js +34 -0
- package/dist/json.js +281 -0
- package/dist/jsonc.js +315 -0
- package/dist/main.js +38 -314
- package/dist/mod.js +7 -5
- package/dist/oauth.js +147 -51
- package/dist/pickup.js +62 -16
- package/dist/remote.js +116 -61
- package/dist/setup.js +118 -0
- package/dist/shim.js +93 -0
- package/dist/signin.js +227 -0
- package/dist/state.js +24 -3
- package/dist/stopcheck.js +109 -20
- package/dist/toml.js +277 -0
- package/dist/version.js +1 -1
- package/mod/.claude-plugin/plugin.json +1 -1
- package/mod/README.md +1 -1
- package/mod/hooks/register.js +66 -3
- package/mod/hooks/wake.js +54 -1
- package/mod/tests/wake.test.ts +50 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,130 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.12.0 (2026-10-04)
|
|
4
|
+
|
|
5
|
+
- The stdio bridge, `pendingyou mcp --app <app>`: a local MCP server for an agent that can't give its MCP client a
|
|
6
|
+
header from a command (Claude Code's headersHelper, Codex's http_headers_helper), so its `pendingyou` server signs in
|
|
7
|
+
through this computer's own sign-in all the same, with no second sign-in. The agent runs it by a path that never
|
|
8
|
+
changes, `~/.config/pendingyou/bin/pendingyou-mcp --app <app>` (`--origin` off production), a small script that finds
|
|
9
|
+
Node as the headers helper does and runs this version's private copy, so the agent's config never changes on an
|
|
10
|
+
upgrade. It passes each JSON-RPC line from stdin on to `<origin>/mcp` with the agent's own connection, and each
|
|
11
|
+
answer back on a line of its own (a JSON body, or each event of a stream), with nothing else on stdout and only a few
|
|
12
|
+
plain lines on stderr. It keeps the server's session id, sends the protocol version the handshake agreed (and a
|
|
13
|
+
2026-07-28 request's own headers), starts a session again when the server forgot it, refreshes the sign-in once after
|
|
14
|
+
a 401 (in the background, as the helper does) and then answers with an error saying to run `npx -y
|
|
15
|
+
pendingyou@latest init`; Pending You unreachable, a problem on its side, a redirect (never followed: the token goes
|
|
16
|
+
nowhere else) or a cut-off answer each get a plain JSON-RPC error. It waits for what's under way when stdin closes,
|
|
17
|
+
and stops at once on SIGTERM. `--check` says which Node runs it. A module asks for it with `bridged` (docs/apps.md
|
|
18
|
+
has the contract), and init writes the launcher only then.
|
|
19
|
+
- OpenCode (1.17.0 or later; read from 1.18.34's source): `init` finds `opencode` beside Claude Code and Codex and sets
|
|
20
|
+
it up with the same one approval, as its own connection ("OpenCode on Ann-MBP", a device sign-in with
|
|
21
|
+
`assistant=opencode` and a client of its own). Its `pendingyou` MCP server runs the bridge, in OpenCode's global
|
|
22
|
+
config (`~/.config/opencode/opencode.json` or `.jsonc`), edited in place by a small JSON-with-comments editor that
|
|
23
|
+
keeps every comment and byte around it; a file it can't read or edit safely is left alone, with the entry to add by
|
|
24
|
+
hand, and a new file gets OpenCode's `$schema`. A remote server at this Pending You that signs in by itself is moved
|
|
25
|
+
as Codex's is (asked at a terminal, kept with nobody to ask), keeping its `enabled` and `timeout`; one at another
|
|
26
|
+
Pending You is replaced only once the person says so. `--oauth` writes a remote server instead (`opencode mcp auth
|
|
27
|
+
pendingyou`). A `permission` that would make OpenCode ask (`"ask"`, or a catch-all rule) gets `"pendingyou_*":
|
|
28
|
+
"allow"`; a rule of the person's that names Pending You is kept. The skill goes in
|
|
29
|
+
`~/.config/opencode/skills/pendingyou/SKILL.md`, unless OpenCode already reads the one Claude Code's or Codex's init
|
|
30
|
+
saved (a second would be a duplicate).
|
|
31
|
+
- OpenCode's plugin, `~/.config/opencode/plugins/pendingyou.js`: one line re-exporting it from this version's private
|
|
32
|
+
copy, which OpenCode loads at startup. It runs the hooks' script for what it decides: each message carries the
|
|
33
|
+
hand-off (as a part the model reads and the TUI doesn't show), and a session's first message what a session start
|
|
34
|
+
says (the setup line while setup isn't finished: `handoff` takes `source` for that); the cards a session posts are
|
|
35
|
+
remembered (`posted`); a session that goes idle with something for the person left only in chat is asked once to put
|
|
36
|
+
it on a card, never for the turn its own prompt started, one the person stopped or a subagent's, with a toast saying
|
|
37
|
+
why; and when a card is answered, a listener per session (`listen --app opencode`, the plugin's child) hands the
|
|
38
|
+
plugin the wake mod's words, and the plugin starts the turn in that session (`client.session.promptAsync`), idle or
|
|
39
|
+
busy. The answer itself never leaves Pending You but through `get_request`. Its own prompts carry
|
|
40
|
+
`metadata.pendingyou`. `init` ends: restart OpenCode (`/exit`, then `opencode --continue`); it finishes setting up the
|
|
41
|
+
first time you write to it. `status` checks the bridge as OpenCode runs it and with a handshake; `uninstall` gives the
|
|
42
|
+
config back as it was. Not on Windows yet.
|
|
43
|
+
- Pi (pi.dev, the `pi` command; 0.99.0 or later, whose MCP client came in 0.99.0; read from 1.0.2's source): `init`
|
|
44
|
+
finds `pi` and sets it up with the others, on the same one approval, as its own connection ("Pi on Ann-MBP"). Its
|
|
45
|
+
`pendingyou` server runs the bridge, in `~/.pi/agent/mcp.json` (or `$PI_CODING_AGENT_DIR`'s), with `"exposure":
|
|
46
|
+
"direct"`, without which Pi's model reaches an MCP server's tools only from scripts. Only that member is written,
|
|
47
|
+
every other byte of the file as it was (a small JSON editor, `json.ts`, that checks each edit by reading it back); a
|
|
48
|
+
file that isn't JSON, or a `mcpServers` that isn't an object, is left alone, with the entry to add by hand. A server
|
|
49
|
+
at another Pending You is replaced only once the person says so; one Pi signs in to by itself (`pi mcp login`) is
|
|
50
|
+
moved on Yes (the default) at a terminal, or `--yes`; one with a command or an Authorization of its own is kept.
|
|
51
|
+
`--oauth` writes Pending You's address instead, signed in with `pi mcp login pendingyou`, as pi.dev's own client
|
|
52
|
+
(`oauth.clientRegistration: "cimd"`) from Pi 1.0.1. The skill goes in `~/.pi/agent/skills/pendingyou/SKILL.md`,
|
|
53
|
+
unless the same stub is already in `~/.agents/skills` (Codex's), which Pi reads too.
|
|
54
|
+
- Pi's extension, in place of hooks (Pi has none): `~/.config/pendingyou/pi/pendingyou.js`, listed in Pi's
|
|
55
|
+
`settings.json` `extensions` by a path that never changes (upgrading rewrites the file). It runs the hooks' script for
|
|
56
|
+
Pi: as a session starts (`pickup`, for Pi's next turn), with each message (`handoff`), after Pending You's card tools
|
|
57
|
+
(`posted --app pi`) and as a run settles (`stopcheck`: a run that left the person something only in chat goes on
|
|
58
|
+
once). When a card is answered, written back on or its fallback comes due, the listener the extension keeps per
|
|
59
|
+
session (`listen --app pi`, the same as OpenCode's) hands it the wake mod's words, and the extension starts the turn
|
|
60
|
+
(`pi.sendMessage`, at once when Pi is idle, after the run when it's busy), never with the answer in it. In Pi's
|
|
61
|
+
terminal the first session finishes setting up by itself: the session start's setup line starts the turn, once Pending
|
|
62
|
+
You's tools are there (Pi waits for MCP servers only before a typed prompt), and Pi's line waits 10 minutes after the
|
|
63
|
+
last, so two sessions reloaded together don't both set up. `init` ends: `/reload` in each Pi session that's open, or
|
|
64
|
+
start `pi`. `status` checks the bridge as Pi runs it and with a handshake; `uninstall` gives both files back as they
|
|
65
|
+
were (or takes away the ones `init` made). Not on Windows yet.
|
|
66
|
+
- `hold` inside Pi (which marks its processes `AI_AGENT=pi`, `PI_CODING_AGENT=true`) answers at once: Pi's shell waits
|
|
67
|
+
for a command to end, so a hold would stop the session for hours. The extension wakes the session anyway; without
|
|
68
|
+
it, `hold` says to check with `get_request` instead.
|
|
69
|
+
|
|
70
|
+
## 0.11.0
|
|
71
|
+
|
|
72
|
+
- One step for the coding agents on a computer (Darin, 2026-10-04): `npx -y pendingyou@latest init` finds Claude Code
|
|
73
|
+
and Codex (`--app claude-code,codex` names some), says what it found and which it can't set up (an agent too old for
|
|
74
|
+
it is named, with the version it needs), and sets each up with one approval. Then: restart the agent, and its first
|
|
75
|
+
session finishes setting up by itself (whoami, report_setup, a test card). Asked for by name and not installed, or
|
|
76
|
+
nothing found at all: it says so and stops before anyone signs in.
|
|
77
|
+
- One sign-in everywhere: each agent's MCP server signs in through this computer's own connection ("Claude Code on
|
|
78
|
+
Ann-MBP", "Codex on Ann-MBP"), through the headers helper, on every computer but Windows; 0.10.0 did that only over
|
|
79
|
+
SSH. The hooks use the same connection, so there's nothing to Authenticate and no second sign-in. Each agent gets a
|
|
80
|
+
sign-in and a client of its own (`credentials.json`: Claude Code's under the address as before, another agent's under
|
|
81
|
+
`<address>#<app>`, so a 0.10.0 process still running keeps it; a `.gitignore` of `*` in the folder).
|
|
82
|
+
- Several agents, one approval: a device sign-in each, started together and shown as one link,
|
|
83
|
+
`/device?code=A&code=B`, which Pending You turns into one consent card naming each agent and the computer, with one
|
|
84
|
+
Allow (needs Pending You's Worker from this release). On a computer with a browser, the browser opens on it ("Your
|
|
85
|
+
browser is open on Pending You: press Allow once for Claude Code and Codex (codes …)"); over SSH, the link, a QR code
|
|
86
|
+
and each code. `--device` shows the codes anywhere, `--browser` opens the browser anyway, `--no-browser` only prints
|
|
87
|
+
the address. Cancel stops `init` before it changes anything. `login --app <app>` signs one agent in again, with its
|
|
88
|
+
own client, so it keeps its connection; `login --browser` no longer refuses a connection.
|
|
89
|
+
- Codex CLI (0.152 or later, whose `http_headers_helper` can give Authorization): its `[mcp_servers.pendingyou]` table
|
|
90
|
+
in `~/.codex/config.toml`, edited in place with every other line as it was, signed in through the helper
|
|
91
|
+
(`--app codex`) with `default_tools_approval_mode = "approve"`; a stored OAuth sign-in, which would win over the
|
|
92
|
+
helper, is logged out first. Its skill in `~/.agents/skills/pendingyou/SKILL.md`, and four hooks in
|
|
93
|
+
`~/.codex/hooks.json`, added after the person's own: a session start (startup, resume, clear), each message, Pending
|
|
94
|
+
You's card tools, and the Stop check (pattern matching on Codex's final message, once a turn at most). Codex runs a
|
|
95
|
+
hook only once the person trusts it: `init` says to choose “Trust all and continue”, `status` says which are trusted
|
|
96
|
+
(from Codex's own hash of each), and `uninstall` keeps the trust of the person's own hooks that move up when ours go.
|
|
97
|
+
When a card a Codex thread posted is answered, a listener the hooks start for that thread runs `codex queue` in the
|
|
98
|
+
wake mod's words (never with the answer itself, which other programs could read in its arguments) (Codex 0.157 or later starts a turn on an idle thread; `init` says so on an older
|
|
99
|
+
one). A server and hooks Codex's `/import` copied from Claude Code are replaced. Not on Windows yet.
|
|
100
|
+
- What happens to a `pendingyou` server that's there is decided before anyone signs in. At this Pending You, signing
|
|
101
|
+
in by itself (the agent's own OAuth, or the Pending You plugin with no server added by hand): moved to this
|
|
102
|
+
computer's sign-in without a word where there's no browser, on Yes (the default) at a terminal after saying what
|
|
103
|
+
that means, or with `--yes`; with nobody to ask, kept, with the command that switches it. Kept, the agent's hooks get
|
|
104
|
+
a sign-in that only hears, and a kept plugin carries the skill, so none is saved. At another Pending You: replaced
|
|
105
|
+
once the person says so (or `--yes`); kept, that agent is left as it is.
|
|
106
|
+
- `--oauth`: every agent signs in to its MCP server by itself, as before 0.11.0 (Claude Code's `claude mcp add`; Codex's
|
|
107
|
+
table without the helper, then `codex mcp login pendingyou`).
|
|
108
|
+
- Finishing setup by itself: a session start (new, resumed or cleared, never a compaction) adds one line while Pending
|
|
109
|
+
You says the agent's setup isn't finished (hear_answers' `for.setup`, on the request the hook makes anyway): what to
|
|
110
|
+
call, or that the test card's answer is waiting to be picked up; at most 3 times per `init`, none after 7 days, never
|
|
111
|
+
once it's verified. `init`'s copy of the wake mod starts that turn itself in Claude Code 2.1.287 or later. `init`
|
|
112
|
+
ends with the sentence to say when it doesn't, on its own line: “Finish setting up Pending You: it’s connected here
|
|
113
|
+
already.” (`FINISH_SAY`, the same as Pending You's pages).
|
|
114
|
+
- The hooks run a script with a path that never changes, `~/.config/pendingyou/bin/pendingyou-hook <command> --app
|
|
115
|
+
<app>`, which runs this version's private copy: upgrading rewrites the script, never the hook lines. Every request a
|
|
116
|
+
hook or the listener makes names its app (`source`).
|
|
117
|
+
- Node, without the shell's PATH (a Claude Code started from its desktop app or an IDE, Codex's stripped environment):
|
|
118
|
+
`init` records the Node it ran with by its stable path (`/opt/homebrew/bin/node`, not the Cellar folder an upgrade
|
|
119
|
+
removes), and the helper and the hooks' script also look in `/opt/homebrew/bin`, `/usr/local/bin` and `~/.volta/bin`.
|
|
120
|
+
A Mac is named by its own name (`scutil --get ComputerName`) unless `--name` says otherwise.
|
|
121
|
+
- `status` has a section for each agent `init` set up, a `Setup:` line (finished, waiting for the first session with
|
|
122
|
+
the sentence to say, the test card waiting on you, or answered and being picked up) that never changes Ready, and
|
|
123
|
+
"no browser here" in its header only when that's true. `uninstall` covers each agent, takes out the shared parts once
|
|
124
|
+
none is left, says which connections stay on your Assistants page, and ends with how to connect again.
|
|
125
|
+
- `pendingyou mcp --app <app>` is reserved for a stdio MCP server for an agent that can't run a headers helper; it says
|
|
126
|
+
it isn't ready yet.
|
|
127
|
+
|
|
3
128
|
## 0.10.0
|
|
4
129
|
|
|
5
130
|
- The wake mod: Claude Code 2.1.287 or later is woken when you answer, with nothing waiting in the background. A
|
package/README.md
CHANGED
|
@@ -1,51 +1,164 @@
|
|
|
1
1
|
# pendingyou
|
|
2
2
|
|
|
3
|
-
Pending You for
|
|
4
|
-
this command
|
|
3
|
+
Pending You for your coding agents. Your agents ask you in [Pending You](https://www.pendingyou.com) when you're away;
|
|
4
|
+
this command sets Claude Code, Codex, OpenCode and Pi up to ask there and to hear your answer the moment it's ready,
|
|
5
|
+
even while they sit idle at the prompt.
|
|
5
6
|
|
|
6
7
|
```sh
|
|
7
|
-
npx pendingyou init
|
|
8
|
+
npx -y pendingyou@latest init
|
|
8
9
|
```
|
|
9
10
|
|
|
10
|
-
Run it once on each computer. It
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
`~/.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
run. Afterwards restart Claude Code, run `/mcp`, choose pendingyou and Authenticate (on a computer with no browser
|
|
32
|
-
there's nothing to authenticate: [below](#a-computer-with-no-browser)).
|
|
11
|
+
Run it once on each computer, in a terminal. It finds the agents on the computer (Claude Code, Codex, OpenCode, Pi;
|
|
12
|
+
`--app` names some), says what it found, and for each one:
|
|
13
|
+
|
|
14
|
+
- connects it to Pending You through **this computer's own sign-in**: its own connection ("Claude Code on Ann-MBP",
|
|
15
|
+
"Codex on Ann-MBP" on your Assistants page), which its MCP server and its hooks share, so there's nothing to
|
|
16
|
+
Authenticate in the agent and no second sign-in,
|
|
17
|
+
- signs them all in with **one approval**: your browser opens on Pending You with one card naming each agent and this
|
|
18
|
+
computer, and you press Allow once (over SSH: a code and a QR code for your phone, [below](#a-computer-with-no-browser)),
|
|
19
|
+
- adds the Pending You MCP server for every project, signed in through a small helper script (OpenCode and Pi:
|
|
20
|
+
through a small local bridge, [below](#opencode)), and lets the agent use Pending You's tools without asking each
|
|
21
|
+
time,
|
|
22
|
+
- saves the Pending You skill (Claude Code: `~/.claude/skills/pendingyou/SKILL.md`; Codex:
|
|
23
|
+
`~/.agents/skills/pendingyou/SKILL.md`; OpenCode reads either, else `~/.config/opencode/skills/pendingyou/SKILL.md`;
|
|
24
|
+
Pi reads Codex's, else `~/.pi/agent/skills/pendingyou/SKILL.md`),
|
|
25
|
+
- adds the hooks that hand it your answers: a new session picks up answers that arrived while nothing was running,
|
|
26
|
+
your next message brings a waiting answer with it, and a check when it finishes a turn catches what it left you only
|
|
27
|
+
in chat ([below](#nothing-left-only-in-chat)),
|
|
28
|
+
- and wakes it when you answer: Claude Code 2.1.287 or later through the wake mod, Codex through `codex queue`, OpenCode
|
|
29
|
+
through its plugin and Pi through its extension (which also do the hooks' work there).
|
|
30
|
+
|
|
31
|
+
Then it says what to do next, and the one sentence to say if it's needed:
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
```
|
|
34
|
+
Next: restart Claude Code here (/exit, then claude --continue), or start it in the folder you work in.
|
|
35
|
+
It finishes setting up by itself and sends you a test card. If it doesn't, say this to it:
|
|
36
|
+
|
|
37
|
+
Finish setting up Pending You: it’s connected here already.
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The first session finishes setting up on its own: it checks in with Pending You, reports what's set up and sends you a
|
|
41
|
+
test card. Claude Code 2.1.287 or later starts that turn by itself; otherwise (and in Codex, after you choose “Trust all
|
|
42
|
+
and continue” for its hooks) the session start adds one line saying what's left, and you say the sentence.
|
|
43
|
+
`npx pendingyou status` says what's set up for each agent, what's missing with the command that fixes it, and how setup
|
|
44
|
+
stands. `npx pendingyou uninstall` removes exactly what `init` added.
|
|
45
|
+
|
|
46
|
+
Your other settings are kept as they are: `init` merges into Claude Code's `~/.claude/settings.json`, Codex's
|
|
47
|
+
`~/.codex/config.toml` (its `[mcp_servers.pendingyou]` table and nothing else, every other line as it was) and
|
|
48
|
+
`~/.codex/hooks.json`, OpenCode's config and Pi's `~/.pi/agent/mcp.json` and `settings.json` (Pending You's own entry
|
|
49
|
+
in each, every other byte as it was), and running it again changes nothing it doesn't need to.
|
|
50
|
+
|
|
51
|
+
**A pendingyou server that's there already** is decided on before anyone signs in. One at another Pending You
|
|
52
|
+
(staging, say) is named and replaced only once you say so (`--yes` replaces it without asking); keep it and that agent
|
|
53
|
+
is left as it is. One at this Pending You that signs in by itself (Claude Code's `/mcp` → Authenticate, Codex's
|
|
54
|
+
`codex mcp login`, or the Pending You plugin for Claude) is moved to this computer's sign-in: without asking where
|
|
55
|
+
there's no browser (it can't finish there anyway), on Yes (the default) at a terminal, or with `--yes`; with nobody to
|
|
56
|
+
ask it's kept, and `init` prints the command that switches it. The connection it had stays on your Assistants page for
|
|
57
|
+
you to remove, and answers to the cards it asked through that one won't reach the agent by themselves. A kept plugin
|
|
58
|
+
carries the skill, so none is saved. `--oauth` keeps every agent signing in by itself, as before 0.11.0.
|
|
59
|
+
|
|
60
|
+
The hooks run a copy of this version kept in `~/.config/pendingyou/cli/<version>/`, through a small script with a path
|
|
61
|
+
that never changes, `~/.config/pendingyou/bin/pendingyou-hook`:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
"~/.config/pendingyou/bin/pendingyou-hook" pickup --app claude-code || true
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
(the path in full). Upgrading rewrites that script, never the hook lines, so Codex, which runs a hook only while you
|
|
68
|
+
trust its exact definition, doesn't ask again. The script runs the copy with the Node `init` ran with, by its stable
|
|
69
|
+
path (Homebrew's `/opt/homebrew/bin/node`, which outlives an upgrade), or the first Node it finds. If the copy can't be
|
|
70
|
+
made (no npm, no network), the hooks run through `npx -y --prefer-offline pendingyou@<version>` instead.
|
|
38
71
|
|
|
39
72
|
The hooks never get in your way: if anything goes wrong (no network, not signed in, a bad option), they print nothing
|
|
40
73
|
and let your message through. Each one stops within 3 seconds whatever happens, with at most its one-line reminder, and
|
|
41
74
|
never refreshes the sign-in itself: when that's due, it starts the refresh in the background, which finishes on its
|
|
42
|
-
own.
|
|
75
|
+
own. Each hands an agent only its own app's cards from its folder, never one another agent posted there.
|
|
43
76
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
77
|
+
If the `pendingyou` MCP server Claude Code uses in a session's folder is another Pending You than the hooks' (staging
|
|
78
|
+
and production, say), both hooks add one line telling Claude Code so, and to ask you which one you use: its cards
|
|
79
|
+
would otherwise go where you don't look. `npx pendingyou status` flags it too. Fix it with `npx pendingyou init
|
|
80
|
+
--origin <the one you use>`, then restart the session. Codex's hooks do the same for Codex's server.
|
|
81
|
+
|
|
82
|
+
## Codex
|
|
83
|
+
|
|
84
|
+
Codex CLI 0.152 or later (its `http_headers_helper` gives the sign-in; 0.157 or later wakes an idle thread by itself).
|
|
85
|
+
`init` writes, in `~/.codex/config.toml`:
|
|
86
|
+
|
|
87
|
+
```toml
|
|
88
|
+
[mcp_servers.pendingyou]
|
|
89
|
+
url = "https://www.pendingyou.com/mcp"
|
|
90
|
+
http_headers_helper = "/Users/ann/.config/pendingyou/bin/pendingyou-mcp-headers --app codex"
|
|
91
|
+
default_tools_approval_mode = "approve"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
and four hooks in `~/.codex/hooks.json`: a session start, each message, Pending You's card tools (so the Stop check
|
|
95
|
+
knows a turn posted, and so the thread is woken), and the Stop check. **Codex runs a hook only once you trust it**: start
|
|
96
|
+
`codex` and choose “Trust all and continue” (or trust them in `/hooks`). `status` says which are trusted. A
|
|
97
|
+
`pendingyou` server or hooks Codex's `/import` copied from Claude Code (without its sign-in) are replaced.
|
|
98
|
+
|
|
99
|
+
When you answer a card a Codex thread posted, a small listener `init`'s hooks start for that thread puts a message into
|
|
100
|
+
it with `codex queue`: “Pending You: your person answered “…” (req_…). Call get_request …”, which reads your answer (the
|
|
101
|
+
answer itself never goes in a command's arguments, where other programs could see it). Codex starts a turn at
|
|
102
|
+
once when the thread is open and idle, after the current one when it's working, or when you next open it.
|
|
103
|
+
|
|
104
|
+
## OpenCode
|
|
105
|
+
|
|
106
|
+
OpenCode 1.17.0 or later. Its MCP clients can't take a header from a command, so `init` gives it a local server instead:
|
|
107
|
+
the stdio bridge, `pendingyou mcp`, which passes each message on to Pending You with OpenCode's own connection here
|
|
108
|
+
("OpenCode on Ann-MBP"), so there's still one sign-in and nothing to Authenticate. In OpenCode's global config
|
|
109
|
+
(`~/.config/opencode/opencode.json` or `.jsonc`, edited in place with your comments and everything else kept):
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
"mcp": {
|
|
113
|
+
"pendingyou": {
|
|
114
|
+
"type": "local",
|
|
115
|
+
"command": ["/Users/ann/.config/pendingyou/bin/pendingyou-mcp", "--app", "opencode"]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
That path never changes: upgrading rewrites the small script there, never OpenCode's config. If your config's
|
|
121
|
+
`permission` makes OpenCode ask (`"ask"`), `init` adds `"pendingyou_*": "allow"` so a question you're away for doesn't
|
|
122
|
+
wait on a prompt; a rule of your own for Pending You's tools is kept. `--oauth` adds `{"type": "remote", "url":
|
|
123
|
+
"https://www.pendingyou.com/mcp"}` instead, which you sign in to with `opencode mcp auth pendingyou`.
|
|
124
|
+
|
|
125
|
+
And a plugin, `~/.config/opencode/plugins/pendingyou.js`, one line that loads this version's from its private copy. It
|
|
126
|
+
does in OpenCode what the hooks do elsewhere, through the same hooks' script: each message you send carries the
|
|
127
|
+
reminder and any answer waiting (hidden in OpenCode's view, read by the model), a session's first message also says
|
|
128
|
+
what setup has left, a session that left you a question in chat is asked once to put it on a card (with a toast saying
|
|
129
|
+
why), and when you answer a card a session posted, the plugin starts a turn in that session: “Pending You: your person
|
|
130
|
+
answered “…” (req_…). Call get_request …” (never the answer itself). That works while OpenCode is open, idle or busy.
|
|
131
|
+
|
|
132
|
+
Then restart OpenCode (`/exit`, then `opencode --continue`): it finishes setting up the first time you write to it.
|
|
133
|
+
|
|
134
|
+
## Pi
|
|
135
|
+
|
|
136
|
+
Pi 0.99.0 or later (pi.dev, the `pi` command; its MCP client came in 0.99.0). Like OpenCode, Pi runs the bridge as a
|
|
137
|
+
local server, with its own connection here ("Pi on Ann-MBP"). In `~/.pi/agent/mcp.json` (or `$PI_CODING_AGENT_DIR`'s,
|
|
138
|
+
edited in place, everything else kept):
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
"pendingyou": {
|
|
142
|
+
"command": "/Users/ann/.config/pendingyou/bin/pendingyou-mcp",
|
|
143
|
+
"args": ["--app", "pi"],
|
|
144
|
+
"exposure": "direct",
|
|
145
|
+
"description": "Ask your person through Pending You when a decision, fact or step is theirs, and hear their answers."
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
`direct` puts Pending You's tools in front of Pi's model (Pi's default leaves an MCP server's tools to scripts). Pi asks
|
|
150
|
+
nobody before it runs a tool, so there's nothing to allow. `--oauth` adds Pending You's address instead, which you sign
|
|
151
|
+
in to with `pi mcp login pendingyou` (from Pi 1.0.1 as pi.dev's own client).
|
|
152
|
+
|
|
153
|
+
Pi has no hooks, so `init` gives it an extension: `~/.config/pendingyou/pi/pendingyou.js`, in the `extensions` of Pi's
|
|
154
|
+
`~/.pi/agent/settings.json`, by a path that never changes (upgrading rewrites the file, never your settings). It runs
|
|
155
|
+
the same hooks' script as a session starts, with each message, after Pending You's card tools and as a run ends (a run
|
|
156
|
+
that leaves you something only in chat goes on once), and when you answer a card a session posted it starts a turn in
|
|
157
|
+
that session, idle or busy: “Pending You: your person answered “…” (req_…). Call get_request …” (never the answer
|
|
158
|
+
itself). In Pi's terminal the first session finishes setting up by itself, once Pending You's tools are there.
|
|
159
|
+
|
|
160
|
+
Then run `/reload` in each Pi session that's open, or start `pi`. Pi's shell waits for a command to end, so in Pi
|
|
161
|
+
`npx pendingyou hold` answers at once instead of waiting.
|
|
49
162
|
|
|
50
163
|
## Nothing left only in chat
|
|
51
164
|
|
|
@@ -78,6 +191,11 @@ card titled “Confirm in Claude Code on <computer>: <step>”, with the exact w
|
|
|
78
191
|
session's link when Remote Control or Claude Code on the web gives one) and what it'll do then. Only such a message
|
|
79
192
|
costs a request: this folder's open cards, given up after 1.5 seconds.
|
|
80
193
|
|
|
194
|
+
Codex gets the same two (0.11.0). Its Stop check reads Codex's final message, and whether the turn posted, updated or
|
|
195
|
+
replied on a card comes from Codex's own hook for Pending You's tools in that turn; it asks once a turn at most, for an
|
|
196
|
+
action card titled “Confirm in Codex on <computer>: <step>” when it asked you to type something there. OpenCode's plugin
|
|
197
|
+
and Pi's extension (0.12.0) do the same in theirs.
|
|
198
|
+
|
|
81
199
|
**On 0.2.0 with another origin?** Its hooks blocked every message (`There's no "--origin" command`). Run
|
|
82
200
|
`npx pendingyou@latest init --origin <url>` again to repair them; see [CHANGELOG.md](CHANGELOG.md).
|
|
83
201
|
|
|
@@ -111,41 +229,37 @@ next message brings any answer with it too.
|
|
|
111
229
|
When you're at the terminal, Claude Code asks you there and puts the same question in Pending You at once; the
|
|
112
230
|
first answer wins. If you answer in the terminal, it withdraws the card and the hold ends by itself.
|
|
113
231
|
|
|
232
|
+
**Finishing setup by itself (0.11.0).** In `init`'s copy of the mod, a few seconds after a session you're at opens
|
|
233
|
+
(never `claude -p`), it asks Pending You whether Claude Code is set up here (`whoami`, once Pending You's tools are
|
|
234
|
+
allowed and the server has connected). When it isn't, it starts one turn once the session is idle: “Finish setting up
|
|
235
|
+
Pending You: it’s connected here already.” and exactly what to do. Once per session, in at most three sessions, never
|
|
236
|
+
two within ten minutes, and never again once Pending You says it's set up.
|
|
237
|
+
|
|
114
238
|
## A computer with no browser
|
|
115
239
|
|
|
116
|
-
On a devbox or server you reach over SSH,
|
|
117
|
-
reach.
|
|
240
|
+
On a devbox or server you reach over SSH, an agent's own sign-in opens a browser on that machine, which you can't
|
|
241
|
+
reach. `init` signs in with a code there instead: SSH in, and at the prompt there run
|
|
118
242
|
|
|
119
243
|
```sh
|
|
120
|
-
npx pendingyou init
|
|
244
|
+
npx -y pendingyou@latest init
|
|
121
245
|
```
|
|
122
246
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
- adds the `pendingyou` MCP server for every project with a `headersHelper` instead of OAuth
|
|
129
|
-
(`claude mcp add-json --scope user pendingyou '{"type":"http","url":"…/mcp","headersHelper":"…"}'`), so Claude Code
|
|
130
|
-
signs in through this machine's sign-in and there's nothing to Authenticate,
|
|
131
|
-
- writes that helper, `~/.config/pendingyou/bin/pendingyou-mcp-headers`, a small sh script Claude Code runs each time
|
|
132
|
-
it connects. It finds Node on PATH, else nvm's default (`$NVM_DIR` or `~/.nvm`), else the Node `init` ran with,
|
|
133
|
-
runs this version's own copy (never npx), and prints only `{"Authorization":"Bearer …"}`, refreshing the sign-in
|
|
134
|
-
when it's due,
|
|
135
|
-
- adds the wake mod, the hooks and Pending You's tools to `~/.claude/settings.json` as above, so Remote Control,
|
|
136
|
-
terminal multiplexers and plain SSH sessions all get them, whatever shell profile they read.
|
|
247
|
+
It sees it's an SSH session (or Linux with no display) and shows a link for your phone, a QR code of it, and each code,
|
|
248
|
+
for every agent it found. Open it on your phone, sign in, check the codes match and press Allow once. Only allow codes
|
|
249
|
+
your own computer is showing you. `--device` shows codes like this anywhere; `--browser` opens the browser anyway;
|
|
250
|
+
`--no-browser` only prints the address.
|
|
137
251
|
|
|
138
252
|
Run it at an interactive prompt after you SSH in, not as `ssh host npx pendingyou init`: on stock Ubuntu that one-line
|
|
139
|
-
form doesn't read your shell's setup, so nvm's Node and `
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
If the sign-in ends (30 days, or you remove the machine on your Assistants page), `npx pendingyou login` approves a
|
|
143
|
-
new code and keeps the same connection.
|
|
253
|
+
form doesn't read your shell's setup, so nvm's Node, `claude` and `codex` may not be on PATH. The helper script and the
|
|
254
|
+
hooks find Node anyway when the agents run without your shell's PATH (a systemd service, a terminal multiplexer,
|
|
255
|
+
Remote Control): on PATH, nvm's default, the one `init` ran with, or where Node usually is.
|
|
144
256
|
|
|
145
257
|
The machine is called by its Tailscale name when Tailscale is installed and running (as `tailscale status` shows it),
|
|
146
|
-
else by its hostname, or by `--name devbox` on `init` or `login
|
|
147
|
-
kept when there's nothing better, and `login` says how to change it:
|
|
148
|
-
|
|
258
|
+
else by its hostname, or by `--name devbox` on `init` or `login`; a Mac by its own name (Sharing in System Settings). A
|
|
259
|
+
cloud's own hostname (AWS's `ip-10-42-1-252`) is kept when there's nothing better, and `login` says how to change it:
|
|
260
|
+
`npx pendingyou login --name <name>` asks for one more approval and renames the connection, which stays the same one.
|
|
261
|
+
If an agent's sign-in ends (30 days, or you remove it on your Assistants page), `npx pendingyou login` (`--app codex`
|
|
262
|
+
for Codex's) approves a new code and keeps the same connection.
|
|
149
263
|
|
|
150
264
|
Only want this command's own sign-in (for `watch`, below)? `npx pendingyou login --device` signs it in with a code,
|
|
151
265
|
hearing answers only, and adds no connection. Your phone asks "Let devbox hear your answers for the assistants running
|
|
@@ -170,35 +284,46 @@ more, then skipped. `--once` stops after the first.
|
|
|
170
284
|
|
|
171
285
|
| Command | What it does |
|
|
172
286
|
| --- | --- |
|
|
173
|
-
| `init` | Set up
|
|
287
|
+
| `init` | Set up every agent on this computer (`--app`, `--oauth`, `--no-login`, `--no-browser`, `--device`, `--browser`, `--yes`, `--name`) |
|
|
174
288
|
| `hold <requestId>` | Wait for the answer, print it, exit (`--timeout 4h`); the wake mod answers it itself |
|
|
175
|
-
| `status` | What's set up; exits 0 when
|
|
176
|
-
| `login` / `logout` | Sign
|
|
289
|
+
| `status` | What's set up for each agent; exits 0 when each hears answers right away (`--app`) |
|
|
290
|
+
| `login` / `logout` | Sign an agent in again, or out (`--app`, `--device`, `--browser`, `--force`, `--name`, `--all`) |
|
|
177
291
|
| `watch -- <command>` | Run a command each time an answer is ready (`--once`) |
|
|
178
|
-
| `pickup` / `handoff` | The session-start and next-message hooks |
|
|
179
|
-
| `stopcheck` | The Stop hook: items for you left only in chat |
|
|
180
|
-
| `uninstall` | Remove what `init` added, and sign out |
|
|
292
|
+
| `pickup` / `handoff` | The session-start and next-message hooks (`--app`) |
|
|
293
|
+
| `stopcheck` | The Stop hook: items for you left only in chat (`--app`) |
|
|
294
|
+
| `uninstall` | Remove what `init` added, and sign out (`--app`) |
|
|
295
|
+
| `mcp --app <app>` | The stdio bridge: a local MCP server for an agent that can't run a headers helper (OpenCode, Pi), which passes each message on to Pending You with that agent's own sign-in here (`--check`) |
|
|
181
296
|
|
|
182
|
-
Every command takes `--origin` (default `https://www.pendingyou.com`, or `$PENDINGYOU_ORIGIN`).
|
|
183
|
-
|
|
297
|
+
Every command takes `--origin` (default `https://www.pendingyou.com`, or `$PENDINGYOU_ORIGIN`). `--app` takes
|
|
298
|
+
`claude-code`, `codex`, `opencode` or `pi` (several with commas where a command sets up or reports several); with none,
|
|
299
|
+
a command that acts for one agent acts for Claude Code. Options can come before or after the command.
|
|
184
300
|
|
|
185
301
|
## What it can see, and where it keeps things
|
|
186
302
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
303
|
+
Each agent's sign-in is that agent's own connection on Pending You, signed in from this computer: it can post cards,
|
|
304
|
+
change or cancel its own, read the answers to them and reply in their threads, and it can't answer anything for you.
|
|
305
|
+
The hooks use the same sign-in, and hand a session only the cards its own app posted from its folder. An agent that
|
|
306
|
+
signs in by itself (`--oauth`, or one you kept) gets a sign-in that only hears its answers instead: it can't ask,
|
|
307
|
+
answer or change anything, and doesn't show up as an assistant. They're stored in `~/.config/pendingyou/credentials.json`
|
|
308
|
+
(readable only by you, in a folder with a `.gitignore` of `*` so a dotfiles repository never takes it), refresh
|
|
309
|
+
themselves, and end after 30 days or on `logout`. The headers helper hands an agent's token only to that agent's
|
|
310
|
+
Pending You (Claude Code says which server it's for; Codex's is the one `init` wrote). `clients.json` remembers which
|
|
311
|
+
sign-in each agent's connection used, so signing in again keeps it.
|
|
312
|
+
|
|
313
|
+
`state.json` beside them remembers which answers were already handed over (ids only) and how many session starts
|
|
314
|
+
reminded an unfinished setup, and when; `claude-code.json`, `codex.json`, `opencode.json` and `pi.json` what `init`
|
|
315
|
+
added; `codex-threads.json`, `opencode-threads.json` and `pi-threads.json` which cards each Codex thread or OpenCode or
|
|
316
|
+
Pi session waits on (ids, names and titles: never an answer); `pi/` Pi's extension; and `cli/` the hooks' copy of the
|
|
317
|
+
command line. `init`, `status` and the hooks read `~/.claude.json` (and a folder's `.mcp.json`, and
|
|
318
|
+
`~/.claude/settings.json`'s enabled plugins), `~/.codex/config.toml`, OpenCode's config and Pi's `mcp.json` only to see
|
|
319
|
+
whether the agent has a `pendingyou` MCP server and where it points. Nothing is sent anywhere but Pending You. OpenCode's plugin reads its session's messages only when it goes idle, for the check that
|
|
320
|
+
nothing was left in chat, and hands the hooks' script just that turn's words and tool names.
|
|
197
321
|
|
|
198
322
|
The wake mod runs inside Claude Code and reaches Pending You only through the session's own connection, with
|
|
199
|
-
`get_request` on the session's own cards
|
|
200
|
-
|
|
201
|
-
It marks the copy acting for a session in
|
|
323
|
+
`get_request` on the session's own cards (and, in `init`'s copy, `whoami` to see whether setup is finished). It keeps
|
|
324
|
+
each session's cards (id, title, the agent's name, where each stands) in Claude Code's store for mods,
|
|
325
|
+
`~/.claude/plugins/store/`, and forgets them once they close or after 7 days. It marks the copy acting for a session in
|
|
326
|
+
that session's environment (`PENDINGYOU_WAKE_OWNER`).
|
|
202
327
|
|
|
203
328
|
## Development
|
|
204
329
|
|