@juicesharp/rpiv-warp 2.0.0 → 2.2.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 +8 -0
- package/README.md +91 -55
- package/docs/detection.md +94 -0
- package/docs/events.md +129 -0
- package/package.json +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ All notable changes to `@juicesharp/rpiv-warp` are documented here.
|
|
|
5
5
|
Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
6
|
Versioning: [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.2.0] - 2026-07-29
|
|
9
|
+
|
|
10
|
+
## [2.1.0] - 2026-07-23
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- README rewritten to follow the documentation standard shared across all packages.
|
|
14
|
+
- npm tarball now includes the versioned `docs/` reference and no longer ships cover or screenshot art.
|
|
15
|
+
|
|
8
16
|
## [2.0.0] - 2026-07-21
|
|
9
17
|
|
|
10
18
|
### Added
|
package/README.md
CHANGED
|
@@ -1,87 +1,123 @@
|
|
|
1
|
-
# rpiv-warp
|
|
1
|
+
# @juicesharp/rpiv-warp
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@juicesharp/rpiv-warp)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
2
5
|
|
|
3
6
|
<div align="center">
|
|
4
7
|
<a href="https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-warp">
|
|
5
|
-
<
|
|
6
|
-
<img src="https://raw.githubusercontent.com/juicesharp/rpiv-mono/main/packages/rpiv-warp/docs/cover.png" alt="rpiv-warp cover" width="50%">
|
|
7
|
-
</picture>
|
|
8
|
+
<img src="https://raw.githubusercontent.com/juicesharp/rpiv-mono/main/packages/rpiv-warp/docs/cover.png" alt="rpiv-warp cover: a Pi lifecycle event traced from the agent_end hook, through the OSC 777 escape sequence, into a delivered macOS toast reading 'Pi needs attention — Waiting for your answer'" width="60%">
|
|
8
9
|
</a>
|
|
9
10
|
</div>
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- **Configurable blocking-tool allowlist** - choose which tool calls flip the badge to **Blocked** via `~/.config/rpiv-warp/config.json`. Defaults to `ask_user_question`.
|
|
19
|
-
- **Startup-only session notifications** - `/new`, `/resume`, `/fork`, and `/reload` stay quiet; only fresh startups notify.
|
|
20
|
-
- **Silent outside Warp** - no-op when not running in Warp, on known-broken Warp builds, or when `/dev/tty` is unreachable.
|
|
21
|
-
- **Windows support** - best-effort delivery via `process.stdout` / ConPTY, gated on `isTTY`.
|
|
22
|
-
- **Zero-tool, zero-UI footprint** - no tools registered with the model, no commands, no widgets, no token cost.
|
|
12
|
+
The [Warp terminal](https://www.warp.dev/) tells you when
|
|
13
|
+
[Pi Agent](https://github.com/badlogic/pi-mono) needs you — a native OS toast, a
|
|
14
|
+
tab badge, and an animated tab title while a turn is running. `rpiv-warp` listens
|
|
15
|
+
to Pi's lifecycle events and writes Warp's `OSC 777` cli-agent sequence to the
|
|
16
|
+
terminal; Warp does the rest. Outside Warp it registers nothing and writes
|
|
17
|
+
nothing, so installing it costs you exactly zero everywhere else — it is opt-in,
|
|
18
|
+
and nothing else installs it for you.
|
|
23
19
|
|
|
24
20
|
## Install
|
|
25
21
|
|
|
26
|
-
```
|
|
22
|
+
```sh
|
|
27
23
|
pi install npm:@juicesharp/rpiv-warp
|
|
28
24
|
```
|
|
29
25
|
|
|
30
|
-
|
|
26
|
+
Restart your Pi session.
|
|
31
27
|
|
|
32
|
-
##
|
|
28
|
+
## Quick start
|
|
29
|
+
|
|
30
|
+
Start Pi inside Warp, send it a prompt that takes a while, then switch to another
|
|
31
|
+
tab or another app. You get:
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
| `agent_start` | `prompt_submit` | → **In progress** |
|
|
38
|
-
| `agent_end` | `stop` | → **Success** (checkmark) |
|
|
39
|
-
| `tool_call` (configured blocking tool) | `question_asked` | → **Blocked** ("Waiting for your answer") |
|
|
40
|
-
| `tool_execution_end` (configured blocking tool) | `tool_complete` | Blocked → **In progress** |
|
|
33
|
+
- the tab title animating a braille spinner for as long as the turn runs
|
|
34
|
+
- an OS notification when Pi finishes, naming the project and quoting the reply
|
|
35
|
+
- an OS notification the moment Pi asks a question and blocks on your answer
|
|
41
36
|
|
|
42
|
-
|
|
37
|
+
Nothing to configure, no key to supply.
|
|
43
38
|
|
|
44
|
-
##
|
|
39
|
+
## What you get
|
|
45
40
|
|
|
46
|
-
|
|
41
|
+
- **A toast the moment Pi needs you** — six lifecycle moments (session start,
|
|
42
|
+
prompt submitted, question asked, tool finished, turn stopped, gone idle) reach
|
|
43
|
+
Warp as structured notifications carrying the project name, your query and the
|
|
44
|
+
assistant's reply.
|
|
45
|
+
- **A tab that shows Pi is still working** — a braille spinner animates the tab
|
|
46
|
+
title for the whole turn, then Pi's original `π - <repo>` label comes back.
|
|
47
|
+
- **A Blocked badge that never sticks** — an ESC-aborted question is drained at
|
|
48
|
+
turn end instead of leaving the badge lit.
|
|
49
|
+
- **No false idle mid-task** — the running prompt is re-announced every 15
|
|
50
|
+
seconds while the turn is live.
|
|
51
|
+
- **Per-run badges for parked workflow questions** — each `/wf` run gets its own
|
|
52
|
+
badge keyed on the run id, so concurrent runs light up and clear independently.
|
|
53
|
+
- **Nothing to pay for where it can't help** — outside Warp or on a known-broken
|
|
54
|
+
Warp build it registers zero handlers; when `/dev/tty` is unreachable every
|
|
55
|
+
terminal write is silently swallowed, so a failed notification can never reach
|
|
56
|
+
the agent loop.
|
|
57
|
+
- **No tokens, no clutter** — no tools registered with the model, no slash
|
|
58
|
+
commands, no widgets. Only lifecycle listeners and escape bytes the terminal
|
|
59
|
+
eats before they reach stdout.
|
|
60
|
+
|
|
61
|
+
## Configuration
|
|
62
|
+
|
|
63
|
+
Optional. Create `~/.config/rpiv-warp/config.json`:
|
|
47
64
|
|
|
48
65
|
```json
|
|
49
|
-
{
|
|
50
|
-
"blockingTools": ["ask_user_question", "my_custom_blocking_tool"]
|
|
51
|
-
}
|
|
66
|
+
{ "blockingTools": ["ask_user_question", "my_custom_tool"], "heartbeatMs": 5000 }
|
|
52
67
|
```
|
|
53
68
|
|
|
54
|
-
| Key |
|
|
55
|
-
|
|
56
|
-
| `blockingTools` |
|
|
69
|
+
| Key | What it does | Default |
|
|
70
|
+
| --- | --- | --- |
|
|
71
|
+
| `blockingTools` | Tool names that raise the Blocked badge when called and clear it when they finish. Set to `[]` to turn the badge off entirely. | `["ask_user_question"]` |
|
|
72
|
+
| `heartbeatMs` | How often the running prompt is re-announced so Warp doesn't mark the tab idle. Set to `0` to disable. | `15000` |
|
|
57
73
|
|
|
58
|
-
|
|
74
|
+
Both keys are optional, and a missing or malformed file falls back to the
|
|
75
|
+
defaults. If `XDG_CONFIG_HOME` is set to an absolute path the file is read from
|
|
76
|
+
`$XDG_CONFIG_HOME/rpiv-warp/config.json` instead, falling back to the
|
|
77
|
+
`~/.config` location when that file does not exist. Config is read once when the
|
|
78
|
+
extension registers, so restart Pi after editing it.
|
|
59
79
|
|
|
60
|
-
|
|
80
|
+
`rpiv-warp` reads this file and never writes one.
|
|
61
81
|
|
|
62
|
-
|
|
82
|
+
## Reference
|
|
63
83
|
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
84
|
+
- [Event reference](https://github.com/juicesharp/rpiv-mono/blob/main/packages/rpiv-warp/docs/events.md)
|
|
85
|
+
— every lifecycle handler and what it emits, the timer-driven events, the exact
|
|
86
|
+
escape sequences, the full payload field list, and the workflow-question API.
|
|
87
|
+
- [Detection and edge cases](https://github.com/juicesharp/rpiv-mono/blob/main/packages/rpiv-warp/docs/detection.md)
|
|
88
|
+
— the environment variables Warp sets, protocol negotiation, broken-build
|
|
89
|
+
gating, Windows behavior, and what happens in every environment where nothing
|
|
90
|
+
can be emitted.
|
|
67
91
|
|
|
68
|
-
##
|
|
92
|
+
## Requirements
|
|
69
93
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
94
|
+
- **Warp.** Warp sets `TERM_PROGRAM`, `WARP_CLI_AGENT_PROTOCOL_VERSION` and
|
|
95
|
+
`WARP_CLIENT_VERSION` itself; you never set them. Any other terminal is a
|
|
96
|
+
silent no-op.
|
|
97
|
+
- **A current Warp build.** Builds at or below `v0.2026.3.25.8.24.stable_5` on the
|
|
98
|
+
stable and preview channels are gated off — they advertise the protocol but do
|
|
99
|
+
not render the notifications.
|
|
100
|
+
- **macOS or Linux** for the `/dev/tty` transport. Windows delivery via ConPTY is
|
|
101
|
+
best-effort and untested in the wild.
|
|
77
102
|
|
|
78
|
-
|
|
103
|
+
No API key, no model selection, no native modules — nothing to set up beyond Warp
|
|
104
|
+
itself.
|
|
79
105
|
|
|
80
|
-
|
|
106
|
+
## Troubleshooting
|
|
81
107
|
|
|
82
|
-
|
|
108
|
+
- **No notifications at all, and the tab title never animates.** Your Warp build
|
|
109
|
+
is at or below the gated threshold above, or you are not in Warp. Upgrade Warp
|
|
110
|
+
and restart your Pi session.
|
|
111
|
+
- **The tab title animates but no OS toast arrives.** Warp does not have OS
|
|
112
|
+
notification permission, or the system is in Do Not Disturb. Enable
|
|
113
|
+
notifications for Warp in your OS settings.
|
|
83
114
|
|
|
84
|
-
|
|
85
|
-
|
|
115
|
+
## Related
|
|
116
|
+
|
|
117
|
+
- [`@juicesharp/rpiv-pi`](https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-pi)
|
|
118
|
+
— drives the per-run workflow-question badges when both are installed, and
|
|
119
|
+
keeps `rpiv-warp` out of detached workflow child sessions.
|
|
120
|
+
|
|
121
|
+
## License
|
|
86
122
|
|
|
87
|
-
MIT
|
|
123
|
+
MIT — see [LICENSE](./LICENSE).
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Detection and edge cases
|
|
2
|
+
|
|
3
|
+
How `rpiv-warp` decides whether to emit anything at all, and exactly what it does
|
|
4
|
+
in every environment where it cannot.
|
|
5
|
+
|
|
6
|
+
## The gate
|
|
7
|
+
|
|
8
|
+
`rpiv-warp` checks the environment once, at registration. If the check fails it
|
|
9
|
+
returns immediately — **zero** handlers are subscribed, no timers are armed, and
|
|
10
|
+
nothing is ever written. There is no partial mode.
|
|
11
|
+
|
|
12
|
+
Both of these must hold:
|
|
13
|
+
|
|
14
|
+
1. `TERM_PROGRAM === "WarpTerminal"`
|
|
15
|
+
2. `WARP_CLI_AGENT_PROTOCOL_VERSION` is set to a non-empty string, **and**
|
|
16
|
+
`WARP_CLIENT_VERSION` is not a known-broken build
|
|
17
|
+
|
|
18
|
+
Warp sets all three variables itself. You never set them by hand.
|
|
19
|
+
|
|
20
|
+
## Environment variables
|
|
21
|
+
|
|
22
|
+
| Variable | Read for | Behavior |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| `TERM_PROGRAM` | terminal identification | Must equal exactly `"WarpTerminal"`. Anything else — iTerm2, Ghostty, VS Code, a bare SSH session — is a total no-op. |
|
|
25
|
+
| `WARP_CLI_AGENT_PROTOCOL_VERSION` | structured protocol support | Any non-empty value enables emission. Unset means the extension does nothing rather than falling back to a less-rich legacy format. |
|
|
26
|
+
| `WARP_CLIENT_VERSION` | broken-build gating | Parsed and compared against a per-channel threshold. An unparseable value is treated as fine and emission proceeds. |
|
|
27
|
+
| `XDG_CONFIG_HOME` | config file location | Relocates the config directory. See the [Configuration](../README.md#configuration) section. |
|
|
28
|
+
|
|
29
|
+
All three Warp variables are read fresh on every call — nothing is cached at
|
|
30
|
+
module level.
|
|
31
|
+
|
|
32
|
+
## Protocol negotiation
|
|
33
|
+
|
|
34
|
+
The version written into every payload's `v` field is
|
|
35
|
+
`min(WARP_CLI_AGENT_PROTOCOL_VERSION, 1)`, where `1` is the highest protocol this
|
|
36
|
+
extension speaks. Clamping client-side means an older Warp that only understands
|
|
37
|
+
`v: 1` keeps seeing `v: 1` even after the plugin's ceiling is raised. A missing,
|
|
38
|
+
empty or unparseable environment value falls back to `1`.
|
|
39
|
+
|
|
40
|
+
## Broken-build gating
|
|
41
|
+
|
|
42
|
+
Some Warp builds advertise structured-protocol support but render the
|
|
43
|
+
notifications behind a feature flag. Emission is suppressed for builds at or
|
|
44
|
+
below the last known-broken build on their channel:
|
|
45
|
+
|
|
46
|
+
| Channel | Last broken build |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `stable` | `v0.2026.3.25.8.24.stable_5` |
|
|
49
|
+
| `preview` | `v0.2026.3.25.8.24.preview_5` |
|
|
50
|
+
| `dev` | never gated |
|
|
51
|
+
|
|
52
|
+
Version literals follow the grammar `v0.YYYY.M.D.H.M.(stable|preview|dev)_N`.
|
|
53
|
+
Comparison is element-wise and inclusive — a build equal to the threshold is
|
|
54
|
+
gated. Upgrading Warp clears the gate; there is nothing to configure.
|
|
55
|
+
|
|
56
|
+
## Edge cases
|
|
57
|
+
|
|
58
|
+
| Situation | Behavior |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| Not running in Warp | Silent no-op. No handlers registered, nothing written, no measurable cost. Install it everywhere. |
|
|
61
|
+
| Known-broken Warp build | Silent no-op, per the table above. |
|
|
62
|
+
| `WARP_CLI_AGENT_PROTOCOL_VERSION` unset | Silent no-op. No legacy fallback format. |
|
|
63
|
+
| `/dev/tty` unopenable (cron, no-TTY SSH) | Every write is silently swallowed. The `open`/`write`/`close` cycle is wrapped in a try/catch that never rethrows, so a failed notification cannot reach the agent loop. |
|
|
64
|
+
| Windows | Best-effort. There is no `/dev/tty`, so the same OSC bytes go to `process.stdout` and ConPTY forwards them to Warp. Skipped entirely when `process.stdout.isTTY` is false, so piped or redirected output is never polluted. This path is untested in the wild. |
|
|
65
|
+
| Detached workflow child sessions | The extension is not loaded at all. See below. |
|
|
66
|
+
| `blockingTools` configured empty | The `tool_call` and `tool_execution_end` handlers short-circuit; no Blocked badge, everything else unaffected. |
|
|
67
|
+
| `heartbeatMs` set to `0` | The heartbeat interval never starts. |
|
|
68
|
+
| Terminal without an xterm title stack | The CSI push/pop sequences are ignored silently; the spinner still animates. |
|
|
69
|
+
|
|
70
|
+
## Detached workflow child sessions
|
|
71
|
+
|
|
72
|
+
`rpiv-warp` declares `"pi": { "ambientObserver": true }` in its `package.json`.
|
|
73
|
+
That flag marks it as a launcher-only extension: it registers lifecycle handlers
|
|
74
|
+
and side effects — timers, terminal writes, a spinner — but exposes no tool or
|
|
75
|
+
command that a workflow stage could invoke.
|
|
76
|
+
|
|
77
|
+
`rpiv-pi`'s workflow host reads the flag before it constructs a child session's
|
|
78
|
+
extensions and filters `rpiv-warp` out. A detached child has no terminal of its
|
|
79
|
+
own, so loading it there would be pure cost, and the 300 ms idle timer armed at
|
|
80
|
+
`agent_end` would fire against an already-disposed context.
|
|
81
|
+
|
|
82
|
+
Workflow questions still reach Warp — they go through the run-keyed transport
|
|
83
|
+
described in [events.md](./events.md#workflow-question-transport), driven from the
|
|
84
|
+
launcher session where the terminal actually is.
|
|
85
|
+
|
|
86
|
+
## Terminal writes
|
|
87
|
+
|
|
88
|
+
Every emission opens `/dev/tty`, writes, and closes. There is no cached file
|
|
89
|
+
descriptor. On Unix the escape bytes are intercepted by the terminal emulator and
|
|
90
|
+
never enter stdout or stderr, so they cannot corrupt piped output or Pi's own
|
|
91
|
+
capture.
|
|
92
|
+
|
|
93
|
+
`rpiv-warp` writes no other files. It reads its config file and never creates,
|
|
94
|
+
modifies or chmods one.
|
package/docs/events.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Event reference
|
|
2
|
+
|
|
3
|
+
Every Pi lifecycle event `rpiv-warp` subscribes to, the Warp wire event it emits,
|
|
4
|
+
and the exact bytes and JSON that go out to the terminal.
|
|
5
|
+
|
|
6
|
+
## Lifecycle handlers
|
|
7
|
+
|
|
8
|
+
`rpiv-warp` registers exactly seven `pi.on(...)` handlers. It registers no tools,
|
|
9
|
+
no slash commands, no widgets, and no keyboard shortcuts.
|
|
10
|
+
|
|
11
|
+
| Pi event | Emits | Side effects |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| `session_start` | `session_start` — only when `reason === "startup"` | none |
|
|
14
|
+
| `before_agent_start` | nothing | captures the prompt for `prompt_submit` and the heartbeat |
|
|
15
|
+
| `agent_start` | `session_start` (defensive re-announce), then `prompt_submit` | starts the tab-title spinner, cancels the pending idle timer, starts the heartbeat |
|
|
16
|
+
| `agent_end` | one `tool_complete` per outstanding blocking call, then `stop` | stops the spinner, stops the heartbeat, arms the 300 ms idle timer |
|
|
17
|
+
| `tool_call` | `question_asked` — only for a tool in `blockingTools` | records the call's input, stops the spinner, pauses the heartbeat |
|
|
18
|
+
| `tool_execution_end` | `tool_complete` — only for a tool in `blockingTools` | restarts the spinner, resumes the heartbeat |
|
|
19
|
+
| `session_shutdown` | nothing | cancels the idle timer, stops the heartbeat, stops the spinner, clears pending state |
|
|
20
|
+
|
|
21
|
+
`/new`, `/resume`, `/fork` and `/reload` all fire `session_start` with a reason
|
|
22
|
+
other than `"startup"`, so none of them notify — you are already looking at the
|
|
23
|
+
terminal in those cases.
|
|
24
|
+
|
|
25
|
+
### Why `agent_end` drains blocking calls
|
|
26
|
+
|
|
27
|
+
Pressing ESC during a blocking tool aborts it, and an aborted tool never fires
|
|
28
|
+
`tool_execution_end`. Without a drain, Warp's Blocked badge would stay lit for the
|
|
29
|
+
rest of the session. `agent_end` therefore emits a `tool_complete` for every call
|
|
30
|
+
still outstanding — carrying the tool name and the input captured at `tool_call`
|
|
31
|
+
time — before it emits `stop`.
|
|
32
|
+
|
|
33
|
+
## Timer-driven emissions
|
|
34
|
+
|
|
35
|
+
| Emission | Trigger |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| `idle_prompt` | 300 ms after `agent_end`, unless `agent_start` or `session_shutdown` cancels first. Carries the last assistant message as `summary`. |
|
|
38
|
+
| `prompt_submit` | Re-emitted every `heartbeatMs` (default 15000) while a turn is active, so Warp does not decide the session went idle mid-task. Paused for blocking tools, stopped at turn end. |
|
|
39
|
+
|
|
40
|
+
Both timers, and the spinner's interval, are `unref()`d — a stray timer can never
|
|
41
|
+
hold the process open.
|
|
42
|
+
|
|
43
|
+
## Wire format
|
|
44
|
+
|
|
45
|
+
Every notification is one OSC 777 write to the controlling terminal, with the
|
|
46
|
+
literal title `warp://cli-agent` and a JSON body:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
ESC ] 777 ; notify ; warp://cli-agent ; <json> BEL
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The tab-title spinner uses three more sequences:
|
|
53
|
+
|
|
54
|
+
| Sequence | Bytes | Used for |
|
|
55
|
+
| --- | --- | --- |
|
|
56
|
+
| OSC 0 | `ESC ] 0 ; <title> BEL` | writing the animated tab title |
|
|
57
|
+
| CSI 22;0t | `ESC [ 22;0t` | pushing the current title onto the xterm title stack on spinner start |
|
|
58
|
+
| CSI 23;0t | `ESC [ 23;0t` | popping it on spinner stop, restoring Pi's `π - <repo>` title verbatim |
|
|
59
|
+
|
|
60
|
+
The spinner is four braille frames rewritten every 160 ms, so a full cycle takes
|
|
61
|
+
~640 ms. Terminals that do not implement the title stack ignore both CSI
|
|
62
|
+
sequences silently.
|
|
63
|
+
|
|
64
|
+
## Payload fields
|
|
65
|
+
|
|
66
|
+
Every payload carries the same envelope:
|
|
67
|
+
|
|
68
|
+
| Field | Value |
|
|
69
|
+
| --- | --- |
|
|
70
|
+
| `v` | negotiated protocol version (see [detection.md](./detection.md)) |
|
|
71
|
+
| `agent` | `"pi"` |
|
|
72
|
+
| `event` | one of `session_start`, `prompt_submit`, `stop`, `question_asked`, `tool_complete`, `idle_prompt` |
|
|
73
|
+
| `session_id` | Pi's session id — or the workflow run id, for workflow-question badges |
|
|
74
|
+
| `cwd` | absolute working directory |
|
|
75
|
+
| `project` | `basename(cwd)` |
|
|
76
|
+
|
|
77
|
+
Per-event additions:
|
|
78
|
+
|
|
79
|
+
| Event | Extra fields |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| `prompt_submit` | `query` — the prompt you submitted |
|
|
82
|
+
| `stop` | `query` — last user message; `response` — last assistant message |
|
|
83
|
+
| `idle_prompt` | `summary` — last assistant message |
|
|
84
|
+
| `tool_complete` | `tool_name`, plus `tool_input` when the input was captured at `tool_call` |
|
|
85
|
+
| `session_start`, `question_asked` | none |
|
|
86
|
+
|
|
87
|
+
Example `stop` body:
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"v": 1,
|
|
92
|
+
"agent": "pi",
|
|
93
|
+
"event": "stop",
|
|
94
|
+
"session_id": "0199c0d5-...",
|
|
95
|
+
"cwd": "/Users/you/src/rpiv-mono",
|
|
96
|
+
"project": "rpiv-mono",
|
|
97
|
+
"query": "/skill:commit the config change",
|
|
98
|
+
"response": "Committed as 4f2a1c9."
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Text normalization
|
|
103
|
+
|
|
104
|
+
- Fields read back from the session branch — `stop.query`, `stop.response` and
|
|
105
|
+
`idle_prompt.summary` — are truncated to 200 characters with a trailing `...`.
|
|
106
|
+
The `query` on `prompt_submit` is the prompt as submitted, untruncated.
|
|
107
|
+
- A `<skill name="…" location="…">…</skill>` wrapper is collapsed back to
|
|
108
|
+
`/skill:<name> <args>`, and the internal `Skill input: ` label is stripped, so a
|
|
109
|
+
toast shows what you typed rather than the expanded LLM input.
|
|
110
|
+
|
|
111
|
+
## Workflow-question transport
|
|
112
|
+
|
|
113
|
+
`rpiv-warp` also exports a direct-call API used by
|
|
114
|
+
[`@juicesharp/rpiv-pi`](https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-pi)
|
|
115
|
+
to badge parked workflow questions independently of the launcher session:
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
import { createWorkflowQuestionTransport } from "@juicesharp/rpiv-warp";
|
|
119
|
+
|
|
120
|
+
const transport = createWorkflowQuestionTransport(process.cwd());
|
|
121
|
+
transport.asked("run-1"); // session_start + question_asked, session_id = "run-1"
|
|
122
|
+
transport.resolved("run-1"); // tool_complete, tool_name = "ask_user_question"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Keying `session_id` on the workflow run id is what lets concurrent `/wf` runs
|
|
126
|
+
badge and clear independently. Both methods check the Warp environment on every
|
|
127
|
+
call and no-op outside it, so a caller can invoke them unconditionally.
|
|
128
|
+
`resolved` carries no `tool_input` — the bridge aggregates questions and has no
|
|
129
|
+
per-question input to report.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juicesharp/rpiv-warp",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Pi extension. Native Warp terminal notifications, dispatched via OSC 777 on Pi lifecycle events.",
|
|
6
6
|
"keywords": [
|
|
@@ -40,6 +40,10 @@
|
|
|
40
40
|
"title-spinner.ts",
|
|
41
41
|
"payload.ts",
|
|
42
42
|
"config.ts",
|
|
43
|
+
"docs/",
|
|
44
|
+
"!docs/*.png",
|
|
45
|
+
"!docs/*.jpg",
|
|
46
|
+
"!docs/*.svg",
|
|
43
47
|
"README.md",
|
|
44
48
|
"CHANGELOG.md",
|
|
45
49
|
"LICENSE"
|
|
@@ -54,6 +58,6 @@
|
|
|
54
58
|
"@earendil-works/pi-coding-agent": "*"
|
|
55
59
|
},
|
|
56
60
|
"dependencies": {
|
|
57
|
-
"@juicesharp/rpiv-config": "^2.
|
|
61
|
+
"@juicesharp/rpiv-config": "^2.2.0"
|
|
58
62
|
}
|
|
59
63
|
}
|