@juicesharp/rpiv-btw 2.0.0 → 2.1.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/README.md +75 -66
- package/docs/architecture.md +161 -0
- package/docs/context-model.md +95 -0
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -1,94 +1,103 @@
|
|
|
1
|
-
# rpiv-btw
|
|
1
|
+
# @juicesharp/rpiv-btw
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@juicesharp/rpiv-btw)
|
|
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-btw">
|
|
5
|
-
<
|
|
6
|
-
<img src="https://raw.githubusercontent.com/juicesharp/rpiv-mono/main/packages/rpiv-btw/docs/cover.png" alt="rpiv-btw cover" width="50%">
|
|
7
|
-
</picture>
|
|
8
|
+
<img src="https://raw.githubusercontent.com/juicesharp/rpiv-mono/main/packages/rpiv-btw/docs/cover.png" alt="rpiv-btw cover art: a Pi transcript with a /btw side question answered below it, labelled ephemeral and never written" width="50%">
|
|
8
9
|
</a>
|
|
9
10
|
</div>
|
|
10
11
|
|
|
11
|
-
Ask a side question without polluting the main conversation. `rpiv-btw` adds
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
Ask a side question without polluting the main conversation. `rpiv-btw` adds
|
|
13
|
+
`/btw <question>` to [Pi Agent](https://github.com/badlogic/pi-mono) — your same
|
|
14
|
+
primary model answers in a panel at the bottom of the terminal, using a read-only
|
|
15
|
+
clone of the current conversation as context. The answer never enters the
|
|
16
|
+
transcript and never touches disk.
|
|
14
17
|
|
|
15
18
|
## Install
|
|
16
19
|
|
|
17
|
-
```
|
|
20
|
+
```sh
|
|
18
21
|
pi install npm:@juicesharp/rpiv-btw
|
|
19
22
|
```
|
|
20
23
|
|
|
21
|
-
Restart your Pi
|
|
24
|
+
Restart your Pi session.
|
|
25
|
+
|
|
26
|
+
## Quick start
|
|
27
|
+
|
|
28
|
+
Type `/btw` followed by your question:
|
|
22
29
|
|
|
23
30
|
```
|
|
24
31
|
/btw why did we switch from sockets to SSE last week?
|
|
25
32
|
```
|
|
26
33
|
|
|
27
|
-
|
|
34
|
+
A panel opens at the bottom of the terminal with your question on a banner, a `…`
|
|
35
|
+
while the model works, and the answer when it arrives. Prior `/btw` questions from
|
|
36
|
+
this session are listed under the banner, so follow-ups have context.
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
`/btw` uses whatever model is already driving your session — there is nothing to
|
|
39
|
+
pick, but Pi needs an active model with working credentials (`/login`).
|
|
30
40
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- your question on a banner,
|
|
34
|
-
- a `…` while the model is thinking,
|
|
35
|
-
- the answer when it arrives.
|
|
36
|
-
|
|
37
|
-
Prior `/btw` questions from the same session appear above the banner, so follow-ups have context.
|
|
38
|
-
|
|
39
|
-
### Keys
|
|
41
|
+

|
|
40
42
|
|
|
41
43
|
| Key | Action |
|
|
42
|
-
|
|
43
|
-
| `↑` / `↓` | Scroll the panel
|
|
44
|
-
| `x` | Clear this session's `/btw` history
|
|
45
|
-
| `Esc` |
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
rpiv-btw/
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| `↑` / `↓` | Scroll the panel whenever content overflows — the hint appears once the answer arrives |
|
|
46
|
+
| `x` | Clear this session's `/btw` history — hint shown only when you have prior entries |
|
|
47
|
+
| `Esc` | Dismiss the panel, cancelling the call if it is still running |
|
|
48
|
+
|
|
49
|
+
## What you get
|
|
50
|
+
|
|
51
|
+
- **Nothing leaks into the main chat** — the answer is drawn in an overlay, never
|
|
52
|
+
emitted as an agent message, never written to the transcript, never written to disk.
|
|
53
|
+
- **The side question already knows your work** — it is handed a read-only clone
|
|
54
|
+
of the current conversation branch, so you do not re-explain context.
|
|
55
|
+
- **Follow-ups have their own thread** — every `/btw` turn in a session is replayed
|
|
56
|
+
into the next one, so the side conversation remembers itself.
|
|
57
|
+
- **`Esc` cancels only the side question** — cancelling it never interrupts what
|
|
58
|
+
the main session is doing.
|
|
59
|
+
- **Survives `/new`, `/fork`, `/resume`, `/reload`** — history is held in the
|
|
60
|
+
running Pi process and clears when Pi exits.
|
|
61
|
+
- **Correct after compaction** — the context snapshot is rebuilt whenever the
|
|
62
|
+
conversation is compacted or re-branched, so a later `/btw` never answers off a
|
|
63
|
+
stale view.
|
|
64
|
+
- **No tools, plain text** — a side question cannot edit a file or run a command.
|
|
65
|
+
|
|
66
|
+
## Reference
|
|
67
|
+
|
|
68
|
+
- [Context model](https://github.com/juicesharp/rpiv-mono/blob/main/packages/rpiv-btw/docs/context-model.md) — exactly what each `/btw` call
|
|
69
|
+
sends to the model: the branch snapshot and its invalidation rules, session
|
|
70
|
+
history threading, the cross-session question hint, and the no-pollution
|
|
71
|
+
guarantees.
|
|
72
|
+
- [Architecture](https://github.com/juicesharp/rpiv-mono/blob/main/packages/rpiv-btw/docs/architecture.md) — modules, registered command and
|
|
73
|
+
hooks, overlay layout and key handling, process-scoped state, Pi host-version
|
|
74
|
+
tolerance, and the full error-message list.
|
|
75
|
+
|
|
76
|
+
## Requirements
|
|
77
|
+
|
|
78
|
+
- **An interactive terminal.** `/btw` refuses to run without a UI — it is not
|
|
79
|
+
available under `pi --print` or RPC.
|
|
80
|
+
- **An active primary model with resolvable credentials.** Any provider works.
|
|
79
81
|
|
|
80
82
|
## Troubleshooting
|
|
81
83
|
|
|
82
84
|
| Symptom | Cause | Fix |
|
|
83
|
-
|
|
84
|
-
| `/btw requires interactive mode` | Running
|
|
85
|
-
| `/btw requires an active model` | No primary model configured | Set one with `/login
|
|
86
|
-
|
|
|
87
|
-
|
|
|
85
|
+
| --- | --- | --- |
|
|
86
|
+
| `/btw requires interactive mode` | Running under `pi --print …` or RPC | Run Pi interactively |
|
|
87
|
+
| `/btw requires an active model` | No primary model configured | Set one with `/login`, or edit Pi's own `~/.pi/agent/models.json` |
|
|
88
|
+
| `/btw model (…) has no API key available.` | Credentials for the active model do not resolve | Re-authenticate that provider |
|
|
89
|
+
| `Usage: /btw <question>` | `/btw` ran with no argument | Put the question on the same line |
|
|
90
|
+
| Pressing `X` does nothing | Only lowercase `x` is bound to clear history | Press `x` |
|
|
91
|
+
| History gone after restarting Pi | By design — state is process-scoped, never written to disk | Nothing to fix; your main session is unaffected |
|
|
92
|
+
|
|
93
|
+
## Related
|
|
94
|
+
|
|
95
|
+
- [`@juicesharp/rpiv-pi`](https://www.npmjs.com/package/@juicesharp/rpiv-pi) — the
|
|
96
|
+
umbrella package. It does not install `rpiv-btw`; install this one yourself when
|
|
97
|
+
you want `/btw`.
|
|
98
|
+
- [juicesharp/rpiv-mono](https://github.com/juicesharp/rpiv-mono#readme) — the rest
|
|
99
|
+
of the rpiv family.
|
|
88
100
|
|
|
89
101
|
## License
|
|
90
102
|
|
|
91
|
-
[
|
|
92
|
-
[](https://opensource.org/licenses/MIT)
|
|
93
|
-
|
|
94
|
-
MIT
|
|
103
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# rpiv-btw architecture
|
|
2
|
+
|
|
3
|
+
Module layout, what the extension registers with Pi, how the overlay is laid out,
|
|
4
|
+
how state is stored, and how the package tolerates different Pi host versions.
|
|
5
|
+
|
|
6
|
+
## Modules
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
rpiv-btw/
|
|
10
|
+
├── index.ts — extension entry; registers the command + 3 hooks
|
|
11
|
+
├── btw.ts — state, snapshotting, message threading, the model call
|
|
12
|
+
├── btw-ui.ts — bottom-anchored overlay component and key handling
|
|
13
|
+
├── pi-compat.ts — host-version-tolerant loader for pi-ai's completeSimple
|
|
14
|
+
└── prompts/
|
|
15
|
+
└── btw-system.txt — system prompt for the side call
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Pi discovers the extension through the manifest block in `package.json`:
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
"pi": { "extensions": ["./index.ts"] }
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
That is the entire registration surface. The package ships no skills, no agents,
|
|
25
|
+
no `bin`, and declares no `exports` or `main`. A test (`ship-manifest.test.ts`)
|
|
26
|
+
asserts that the published `files` list covers every production module.
|
|
27
|
+
|
|
28
|
+
## What gets registered
|
|
29
|
+
|
|
30
|
+
One slash command:
|
|
31
|
+
|
|
32
|
+
| Command | Description string |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| `/btw <question>` | `Ask a side question without polluting the main conversation` |
|
|
35
|
+
|
|
36
|
+
Three lifecycle hooks:
|
|
37
|
+
|
|
38
|
+
| Event | Behavior |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `message_end` | Snapshots the branch, only for assistant messages whose `stopReason` is not `toolUse` |
|
|
41
|
+
| `session_compact` | Invalidates this session's cached snapshot |
|
|
42
|
+
| `session_tree` | Invalidates this session's cached snapshot |
|
|
43
|
+
|
|
44
|
+
No tools are registered. No CLI flags are added.
|
|
45
|
+
|
|
46
|
+
## State
|
|
47
|
+
|
|
48
|
+
All state lives on a single process-wide cell:
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
export const BTW_STATE_KEY = Symbol.for("rpiv-btw");
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
It holds two maps — `histories` and `snapshots` — both keyed by
|
|
55
|
+
`ctx.sessionManager.getSessionFile()`, with `memory:<sessionId>` as the fallback
|
|
56
|
+
key when there is no session file.
|
|
57
|
+
|
|
58
|
+
Using `globalThis` plus `Symbol.for()` (the same idiom OpenTelemetry uses for
|
|
59
|
+
cross-import-graph singletons) means the cell survives module re-import, so
|
|
60
|
+
`/btw` history outlives `/new`, `/fork`, `/resume`, and `/reload`. It is lost
|
|
61
|
+
when the Pi process exits — by design. Nothing is persisted to disk, and the
|
|
62
|
+
package reads no environment variables and no config files.
|
|
63
|
+
|
|
64
|
+
## Overlay
|
|
65
|
+
|
|
66
|
+
`showBtwOverlay` mounts a `Component` through `ctx.ui.custom` with these options:
|
|
67
|
+
|
|
68
|
+
| Option | Value |
|
|
69
|
+
| --- | --- |
|
|
70
|
+
| `anchor` | `bottom-center` |
|
|
71
|
+
| `width` | `100%` |
|
|
72
|
+
| `maxHeight` | `85%` (`BTW_MAX_HEIGHT_RATIO = 0.85`) |
|
|
73
|
+
| `margin` | `{ left: 0, right: 0, bottom: 0 }` |
|
|
74
|
+
|
|
75
|
+
Render order, top to bottom:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
banner — your question on a themed stripe, padded to full width
|
|
79
|
+
(blank)
|
|
80
|
+
history — prior "/btw <q>" lines for this session
|
|
81
|
+
echo — "/btw <q>" for the current question
|
|
82
|
+
(blank)
|
|
83
|
+
answer — "…" while pending, the answer text, or the error in red
|
|
84
|
+
(blank)
|
|
85
|
+
footer — key hints
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
History and echo use a 2-column left gutter; the answer body uses 4. The panel
|
|
89
|
+
grows upward with content. When the natural height exceeds
|
|
90
|
+
`floor(terminalRows × 0.85)` (terminal rows default to 24 if unknown, with a
|
|
91
|
+
floor of 4 rows), it clips from the top and `↑`/`↓` scroll that window —
|
|
92
|
+
offset `0` shows the newest content.
|
|
93
|
+
|
|
94
|
+
### Keys and footer gates
|
|
95
|
+
|
|
96
|
+
| Key | Action | Matching |
|
|
97
|
+
| --- | --- | --- |
|
|
98
|
+
| `Esc` | Aborts the in-flight call and dismisses the overlay | `matchesKey` (ANSI + Kitty) |
|
|
99
|
+
| `↑` | Scroll up one row, clamped at 0 | `matchesKey` |
|
|
100
|
+
| `↓` | Scroll down one row, clamped to the overflow amount | `matchesKey` |
|
|
101
|
+
| `x` | Clears this session's `/btw` history and resets scroll | raw `data === "x"` — uppercase `X` is not bound |
|
|
102
|
+
|
|
103
|
+
| Footer hint | Shown when |
|
|
104
|
+
| --- | --- |
|
|
105
|
+
| `↑/↓ to scroll` | the call is no longer pending (an answer or error has arrived) |
|
|
106
|
+
| `x to clear history` | this session has at least one prior `/btw` turn |
|
|
107
|
+
| `Esc to dismiss` | always |
|
|
108
|
+
|
|
109
|
+
Hints are joined with `" · "` and truncated to the panel width.
|
|
110
|
+
|
|
111
|
+
## Host-version tolerance
|
|
112
|
+
|
|
113
|
+
pi-ai resolves at runtime against the *host's* copy (all three pi peers are
|
|
114
|
+
declared `"*"`), and pi moved the global dispatch API to a `/compat` entrypoint
|
|
115
|
+
in 0.80.1. `pi-compat.ts` therefore resolves `completeSimple` lazily:
|
|
116
|
+
|
|
117
|
+
1. `import("@earendil-works/pi-ai/compat")` — pi >= 0.80.1.
|
|
118
|
+
2. On a **module-resolution** failure only, fall back to
|
|
119
|
+
`import("@earendil-works/pi-ai")` — pi <= 0.79.x, which has no `/compat`
|
|
120
|
+
subpath at all.
|
|
121
|
+
|
|
122
|
+
The fallback is gated on the error codes `ERR_PACKAGE_PATH_NOT_EXPORTED`,
|
|
123
|
+
`ERR_MODULE_NOT_FOUND`, and `MODULE_NOT_FOUND`, walked down the `cause` chain
|
|
124
|
+
(bounded at 16 links, because ESM loaders and test mock layers nest the real
|
|
125
|
+
code). Any other `/compat` error — the entrypoint exists but throws at module
|
|
126
|
+
init — rethrows, so a real failure surfaces instead of being masked by a root
|
|
127
|
+
import that may not have the export.
|
|
128
|
+
|
|
129
|
+
If neither entrypoint exposes the function, the call fails with
|
|
130
|
+
`pi-ai does not expose completeSimple on /compat or the package root — unsupported host pi-ai version`.
|
|
131
|
+
|
|
132
|
+
`/compat` is documented upstream as temporary, so this module is the single place
|
|
133
|
+
to migrate when it is removed.
|
|
134
|
+
|
|
135
|
+
## Messages and errors
|
|
136
|
+
|
|
137
|
+
Every user-visible string the package can produce:
|
|
138
|
+
|
|
139
|
+
| String | When |
|
|
140
|
+
| --- | --- |
|
|
141
|
+
| `/btw requires interactive mode` (error) | `ctx.hasUI` is false — `pi --print`, RPC |
|
|
142
|
+
| `Usage: /btw <question>` (warning) | the argument is empty or whitespace-only |
|
|
143
|
+
| `/btw requires an active model` (error) | there is no `ctx.model` |
|
|
144
|
+
| `/btw model (<provider>:<id>) is misconfigured: <err>` | credential lookup returned an error |
|
|
145
|
+
| `/btw model (<provider>:<id>) has no API key available.` | lookup succeeded but the API key is empty |
|
|
146
|
+
| `/btw call failed: <err ?? "unknown error">` | the completion returned `stopReason: "error"` |
|
|
147
|
+
| `/btw call threw: <message>` | the completion threw and the call was not aborted |
|
|
148
|
+
| `/btw returned no text content.` | the response contained no text parts |
|
|
149
|
+
|
|
150
|
+
The first three are `ctx.ui.notify` toasts raised before the overlay opens; the
|
|
151
|
+
rest render inside the overlay in the error style.
|
|
152
|
+
|
|
153
|
+
## Boundaries
|
|
154
|
+
|
|
155
|
+
- **No runtime dependencies.** No `dependencies`, no `devDependencies` — only the
|
|
156
|
+
three `@earendil-works` peers.
|
|
157
|
+
- **No sibling imports at runtime.** `pi-compat.ts` deliberately duplicates
|
|
158
|
+
rpiv-core's `isModuleNotFound` rather than importing it, because the rpiv
|
|
159
|
+
packages never import each other at runtime.
|
|
160
|
+
- **Standalone.** rpiv-btw is excluded from `rpiv-pi`'s auto-install sibling list,
|
|
161
|
+
and a test asserts that exclusion.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# What `/btw` sends to the model
|
|
2
|
+
|
|
3
|
+
Exactly what every `/btw` call puts in front of your primary model, where each
|
|
4
|
+
piece comes from, and what is guaranteed never to leave the panel.
|
|
5
|
+
|
|
6
|
+
## The request
|
|
7
|
+
|
|
8
|
+
Each `/btw` call is a single non-streaming completion against `ctx.model` — the
|
|
9
|
+
same primary model driving your session. There is no model picker and no
|
|
10
|
+
lighter-weight side model.
|
|
11
|
+
|
|
12
|
+
| Part | Value |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| Model | `ctx.model`, with credentials from `ctx.modelRegistry.getApiKeyAndHeaders(model)` |
|
|
15
|
+
| System prompt | the bundled `prompts/btw-system.txt`, plus the cross-session hint appendix |
|
|
16
|
+
| Messages | `[...branch clone, ...this-session /btw turns, your question]` |
|
|
17
|
+
| Tools | `[]` — none, always |
|
|
18
|
+
| Abort signal | a fresh `AbortController` owned by `/btw`, never `ctx.signal` |
|
|
19
|
+
|
|
20
|
+
## The branch clone
|
|
21
|
+
|
|
22
|
+
The first block of messages is a read-only clone of your current session branch,
|
|
23
|
+
so you do not have to re-explain what you have been working on.
|
|
24
|
+
|
|
25
|
+
- The `message_end` hook takes the snapshot: it reads `ctx.sessionManager.getBranch()`
|
|
26
|
+
and converts it with `convertToLlm`.
|
|
27
|
+
- It snapshots **only** on `role === "assistant"` messages, and **only** when
|
|
28
|
+
`stopReason !== "toolUse"` — so mid-tool-call states never become the context.
|
|
29
|
+
- Snapshots are cached per session, keyed by `ctx.sessionManager.getSessionFile()`,
|
|
30
|
+
falling back to `memory:<sessionId>` when there is no session file.
|
|
31
|
+
- Cold start: if no `message_end` has fired yet, `/btw` reads the branch live
|
|
32
|
+
instead of using a cache.
|
|
33
|
+
|
|
34
|
+
### Invalidation
|
|
35
|
+
|
|
36
|
+
The cached snapshot is deleted on both `session_compact` and `session_tree`, so a
|
|
37
|
+
`/btw` issued after compaction or a branch switch never answers off a stale view
|
|
38
|
+
of the conversation.
|
|
39
|
+
|
|
40
|
+
Auto-compaction races session disposal in pi-core: `session_compact` can fire
|
|
41
|
+
with an already-invalidated `ctx` proxy. `/btw` swallows only that specific stale
|
|
42
|
+
error (`stale after session replacement`) — the session being compacted has no
|
|
43
|
+
snapshot worth invalidating. Every other error propagates, because it is a bug.
|
|
44
|
+
|
|
45
|
+
## The `/btw` history
|
|
46
|
+
|
|
47
|
+
After a successful answer, the turn is appended to this session's `/btw` history,
|
|
48
|
+
and every later `/btw` call in the same session replays that history between the
|
|
49
|
+
branch clone and your new question. Follow-ups therefore work: the side thread
|
|
50
|
+
has its own memory.
|
|
51
|
+
|
|
52
|
+
History stores the **actual** `UserMessage` and `AssistantMessage` object
|
|
53
|
+
references returned by the call — nothing is reconstructed or re-serialised.
|
|
54
|
+
Concatenated in a fixed order, this keeps the prompt prefix byte-identical
|
|
55
|
+
across calls, so provider-side prompt caching keeps hitting.
|
|
56
|
+
|
|
57
|
+
Press `x` in the overlay to clear this session's history. It is also dropped when
|
|
58
|
+
the Pi process exits.
|
|
59
|
+
|
|
60
|
+
## The cross-session hint
|
|
61
|
+
|
|
62
|
+
The system prompt gets an appendix listing the last **10** `/btw` *question
|
|
63
|
+
strings* from **all** sessions in the current Pi process, oldest first, under the
|
|
64
|
+
heading `## Recent /btw questions across sessions (oldest first)`. Each is
|
|
65
|
+
whitespace-collapsed and truncated to 200 characters.
|
|
66
|
+
|
|
67
|
+
- Only your question text crosses sessions — never answers, never branch content.
|
|
68
|
+
- The system prompt tells the model to treat it as a pattern hint, useful only
|
|
69
|
+
when the side question is itself about recent topics or trends.
|
|
70
|
+
- Clearing a session's history with `x` removes its contributions to the hint.
|
|
71
|
+
- It lives on the same process-scoped state, so it is gone when Pi exits.
|
|
72
|
+
|
|
73
|
+
## The system prompt
|
|
74
|
+
|
|
75
|
+
`prompts/btw-system.txt` tells the side call to:
|
|
76
|
+
|
|
77
|
+
- treat the primary conversation as background, not as work to continue — the
|
|
78
|
+
side question is self-contained, and it must not pick up a tool call mid-flight;
|
|
79
|
+
- answer directly and concisely, in compact bullets or short paragraphs;
|
|
80
|
+
- cite files, functions, and line numbers when grounding a claim in the context;
|
|
81
|
+
- say so briefly when the context is insufficient, rather than guessing;
|
|
82
|
+
- use no tools and reply in plain text only, even if prior assistant turns in the
|
|
83
|
+
context demonstrate tool use.
|
|
84
|
+
|
|
85
|
+
## What never happens
|
|
86
|
+
|
|
87
|
+
- **No transcript entry.** The answer is rendered through `ctx.ui.custom` as an
|
|
88
|
+
overlay component. It is never emitted as an agent message.
|
|
89
|
+
- **No disk writes.** History and snapshots live on `globalThis[Symbol.for("rpiv-btw")]`.
|
|
90
|
+
The package's only filesystem access is one read of its own bundled prompt file
|
|
91
|
+
at module init.
|
|
92
|
+
- **No tool use.** The call runs with `tools: []`, so a side question cannot edit
|
|
93
|
+
a file or run a command even if it wanted to.
|
|
94
|
+
- **No effect on the main session.** `Esc` aborts the `/btw` controller only; the
|
|
95
|
+
main agent's signal is never touched.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juicesharp/rpiv-btw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Pi extension. The /btw slash command, for putting a one-off side question to the same primary model without polluting the main conversation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -34,6 +34,10 @@
|
|
|
34
34
|
"btw-ui.ts",
|
|
35
35
|
"pi-compat.ts",
|
|
36
36
|
"prompts/",
|
|
37
|
+
"docs/",
|
|
38
|
+
"!docs/*.png",
|
|
39
|
+
"!docs/*.jpg",
|
|
40
|
+
"!docs/*.svg",
|
|
37
41
|
"README.md",
|
|
38
42
|
"LICENSE"
|
|
39
43
|
],
|