pi-jarvis 1.3.2 → 1.4.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/AGENTS.md CHANGED
@@ -2,22 +2,29 @@
2
2
 
3
3
  ## Project Scope
4
4
  - `pi-jarvis` is a Pi extension that opens a `/jarvis` side-conversation overlay.
5
- - Core runtime files: `index.ts`, `side-session.ts`, `overlay.ts`, `jarvis-config.ts`, `session-ref.ts`.
5
+ - Core runtime files: `index.ts`, `side-session.ts`, `overlay.ts`, `model-picker.ts`, `jarvis-config.ts`, `session-ref.ts`.
6
+ - Current baseline: Pi 1.0.0 (`@earendil-works` packages), Node.js >=22.19.0. Older Pi hosts are not supported.
6
7
 
7
8
  ## Current `/jarvis-model` and `/jarvis-thinking` Behavior
8
- - `/jarvis-model` with no request opens a model picker when Pi has a UI.
9
+ - `/jarvis` requires `ctx.mode === "tui"`; other modes must not boot or prompt a hidden side session.
10
+ - `/jarvis-model` with no request opens a searchable host-registry model picker in TUI mode; other modes report status.
9
11
  - `/jarvis-model <provider/model>` writes a project-scoped override to `.pi/jarvis.json`.
10
12
  - `/jarvis-model --global <provider/model>` writes the default global override to the active Pi agent directory's `extensions/pi-jarvis.json` (by default `~/.pi/agent/extensions/pi-jarvis.json`).
11
13
  - `/jarvis-model [--project|--global] follow-main` stores a scoped `follow-main` override.
12
14
  - `/jarvis-model [--project|--global] clear` removes that scope's override so fallback applies.
13
- - `/jarvis-thinking [--project|--global] auto|follow-main|off|minimal|low|medium|high|xhigh` stores a scoped thinking override without changing the main session thinking level.
15
+ - `/jarvis-thinking [--project|--global] auto|follow-main|off|minimal|low|medium|high|xhigh|max` stores a scoped thinking override without changing the main session thinking level.
14
16
  - `/jarvis-thinking [--project|--global] clear` removes that scope's thinking override so fallback applies.
15
- - Resolution order is: project config, then global config, then built-in defaults (`follow-main` for model, `auto` for thinking).
17
+ - Resolution order is: project config, then global config, then built-in defaults (`follow-main` for model, `auto` for thinking). Global writes never override an active project setting.
18
+ - Config writes use atomic same-directory replacement. I/O errors must not trigger malformed-JSON recovery. Cross-process concurrent config writes are not locked.
16
19
  - `auto` thinking follows main only when `/jarvis` follows the main model; pinned `/jarvis` models default to thinking `off`.
17
20
  - `follow-main` thinking follows the main thinking level regardless of model selection, except xAI `/jarvis` models force thinking `off`.
18
21
  - `/compact`, `/tree`, and `/new` entered inside `/jarvis` operate on the isolated `/jarvis` side-session, not the main Pi session.
19
22
  - `Note main` and `Redirect` stay disabled when the active `/jarvis` model is incompatible with bridge tools.
20
- - Published package keeps Pi runtime packages and `pi-mcp-adapter` as optional peers so installing `pi-jarvis` does not pull the full Pi/AI/MCP dependency stack; MCP becomes available only when the host environment provides `pi-mcp-adapter`.
23
+ - Published package keeps Pi runtime packages as optional peers, not bundled dependencies. MCP adapter auto-loading is disabled: the published adapter does not declare Pi 1.0 support; native MCP is not enabled. Repo tools expose only read/bash/edit/write.
24
+ - Physical models delegate to the host's public registry for auth and dispatch. Virtual/router models explicitly reject; do not access the registry's private backing runtime.
25
+ - Side resources/settings honor `ctx.isProjectTrusted()`. Local tool execution and bridge delivery recheck live permissions; closing the overlay revokes them and cancels pending confirmations.
26
+ - Use `agent_settled`, not `agent_end`, for final idle state. Main context must honor Pi context-edit/compaction projection.
27
+ - Runtime disposal must not detach the overlay's bridge subscription. Queue ownership must survive side `/new` but not main-session replacement; failed/uncertain sends are not auto-retried.
21
28
 
22
29
  ## Validation
23
30
  - Run `npm test` for full validation.
package/README.md CHANGED
@@ -10,10 +10,10 @@
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/pi-jarvis?style=for-the-badge&color=7c3aed)](https://www.npmjs.com/package/pi-jarvis)
12
12
  [![license](https://img.shields.io/badge/license-MIT-111827?style=for-the-badge)](./LICENSE)
13
- [![Pi extension](https://img.shields.io/badge/Pi-extension-06b6d4?style=for-the-badge)](https://github.com/fluxgear/pi-jarvis)
13
+ [![Pi extension](https://img.shields.io/badge/Pi-extension-06b6d4?style=for-the-badge)](https://github.com/crustyhacker/pi-jarvis)
14
14
  [![TypeScript](https://img.shields.io/badge/TypeScript-powered-2563eb?style=for-the-badge)](./package.json)
15
15
 
16
- <p><strong>Current version:</strong> 1.3.2</p>
16
+ <p><strong>Current version:</strong> 1.4.0</p>
17
17
 
18
18
  <p>
19
19
  <strong>Persistent side session</strong> ·
@@ -57,7 +57,7 @@ The main Pi session should stay on the critical path.
57
57
  |---|---|
58
58
  | **Persistent side lane** | `/jarvis` keeps its own isolated conversation state and restores prior side-session history |
59
59
  | **Live awareness** | Jarvis sees the current main-session summary plus a delta since the last `/jarvis` turn |
60
- | **Permission-gated tools** | Local `read`, `bash`, `edit`, `write`, and optional `mcp` stay off until you enable them |
60
+ | **Permission-gated tools** | Local `read`, `bash`, `edit`, and `write` stay off until you enable them |
61
61
  | **Safe main-session handoff** | `Note main` is quiet; `Redirect` is confirmation-gated |
62
62
  | **Independent model control** | Follow the main model or pin `/jarvis` to a separate model |
63
63
  | **Cleaner UX** | Thinking-step streaming is collapsed into a cleaner animated fallback |
@@ -72,7 +72,6 @@ flowchart LR
72
72
  U -->|open /jarvis| J[Jarvis overlay]
73
73
  M -->|summary + recent delta| J
74
74
  J -->|Repo tools enabled| R[Local tools\nread • bash • edit • write]
75
- J -->|optional| X[MCP]
76
75
  J -. Note main .-> M
77
76
  J -. Redirect after confirmation .-> M
78
77
  ```
@@ -116,20 +115,16 @@ Stay in the main lane when you want:
116
115
  ### 1) Install
117
116
 
118
117
  ```bash
119
- npm install pi-jarvis
118
+ pi install npm:pi-jarvis
120
119
  ```
121
120
 
122
121
  This package is meant to run **inside a Pi installation** that already provides the Pi runtime packages. Those host packages are declared as optional peers so npm does not install a second copy of the full Pi/AI provider stack just to add this extension.
123
122
 
124
- MCP support is optional. If you want the `/jarvis` Repo tools toggle to expose the `mcp` tool, install `pi-mcp-adapter` in the same Pi environment; otherwise `/jarvis` still enables local `read`, `bash`, `edit`, and `write` tools when you opt in.
123
+ Requires **Pi 1.0.0** and **Node.js 22.19.0 or newer**. This release supports local repository tools only: automatic `pi-mcp-adapter` loading is disabled because the published adapter does not declare Pi 1.0 support. Native MCP integration is not yet enabled; the overlay reports MCP as unavailable.
125
124
 
126
- ### 2) Register the extension in Pi
125
+ ### 2) Restart or reload Pi
127
126
 
128
- Use the package's published extension entrypoint:
129
-
130
- ```text
131
- ./dist/index.js
132
- ```
127
+ `pi install` registers the package automatically. For local development, build and load `./dist/index.js` with `pi -e ./dist/index.js`.
133
128
  ### 3) Open Jarvis
134
129
 
135
130
  ```bash
@@ -145,7 +140,7 @@ Or open it and send the first message immediately:
145
140
  ### 4) Turn on more power only when you want it
146
141
 
147
142
  - leave `Repo tools` off for pure context / analysis
148
- - turn `Repo tools` on when you want local `read`, `bash`, `edit`, `write`, and optional `mcp`
143
+ - turn `Repo tools` on when you want local `read`, `bash`, `edit`, and `write`
149
144
  - turn `Note main` on when you want Jarvis to quietly message the main session
150
145
  - turn `Redirect` on when you want Jarvis to propose a redirect that you still explicitly confirm
151
146
 
@@ -157,7 +152,7 @@ Or open it and send the first message immediately:
157
152
  Opens the side overlay. If text follows the command, that text becomes the first side-session prompt.
158
153
 
159
154
  ### `/jarvis-model`
160
- When Pi has a UI, running `/jarvis-model` with no argument opens a model picker instead of requiring an exact provider/model string.
155
+ In Pi's terminal UI, running `/jarvis-model` with no argument opens a searchable model picker. In RPC, JSON, and print modes it reports the current selection; exact model-setting commands still work. `/jarvis` itself requires the terminal UI and does not start hidden work in other modes.
161
156
 
162
157
  ### `/jarvis-model [--project|--global] <provider/model>`
163
158
  Pins `/jarvis` to a specific model without changing the main session model. A plain `/jarvis-model <provider/model>` writes a **project-local** override to `.pi/jarvis.json`.
@@ -168,12 +163,13 @@ Restores the chosen scope to `follow-main`. A project-scoped `follow-main` overr
168
163
  ### `/jarvis-model [--project|--global] clear`
169
164
  Removes the selected scope so `/jarvis` falls back through the remaining config layers to the built-in default.
170
165
 
171
- ### `/jarvis-thinking [--project|--global] auto|follow-main|off|minimal|low|medium|high|xhigh`
166
+ ### `/jarvis-thinking [--project|--global] auto|follow-main|off|minimal|low|medium|high|xhigh|max`
172
167
  Sets the thinking level used by `/jarvis` without changing the main session thinking level. A plain `/jarvis-thinking <level>` writes a **project-local** override to `.pi/jarvis.json`.
173
168
 
174
169
  - `auto` preserves the built-in behavior: follow the main thinking level only when `/jarvis` follows the main model; pinned `/jarvis` models use `off`.
175
170
  - `follow-main` follows the main thinking level even when `/jarvis` is pinned to a separate model.
176
- - Explicit levels pin `/jarvis` thinking to that level.
171
+ - Explicit levels request that thinking level; Pi clamps it to the selected model's supported levels.
172
+ - Changes to main thinking immediately synchronize when `/jarvis` follows it.
177
173
  - xAI `/jarvis` models still force thinking `off`.
178
174
 
179
175
  ### `/jarvis-thinking [--project|--global] clear`
@@ -212,6 +208,8 @@ Model and thinking settings resolve through the same config layers, then fall ba
212
208
  2. global config: `~/.pi/agent/extensions/pi-jarvis.json` or the equivalent path under a custom Pi agent dir
213
209
  3. built-in defaults: model `follow-main`, thinking `auto`
214
210
 
211
+ Global writes do not displace an existing project override. Config writes use same-directory atomic replacement and preserve unrelated keys; unreadable files are never treated as malformed JSON and overwritten. Malformed JSON can still be explicitly cleared or replaced. Avoid simultaneous configuration writes from multiple Pi processes: cross-process locking is not implemented.
212
+
215
213
  ---
216
214
 
217
215
  ## Overlay controls
@@ -220,11 +218,13 @@ The overlay header exposes three controls, all **off by default**:
220
218
 
221
219
  | Control | What it does | Safety model |
222
220
  |---|---|---|
223
- | `Repo tools` | Enables local `read`, `bash`, `edit`, `write`, and optional `mcp` | Explicit opt-in |
221
+ | `Repo tools` | Enables local `read`, `bash`, `edit`, and `write` | Explicit opt-in |
224
222
  | `Note main` | Sends a concise, non-interrupting note to the main session | Explicit opt-in |
225
223
  | `Redirect` | Sends a redirecting instruction to the main session | Explicit opt-in + per-send confirmation |
226
224
 
227
- `Note main` and `Redirect` can be forcibly disabled when the active `/jarvis` model is incompatible with bridge tools.
225
+ `Note main` and `Redirect` can be forcibly disabled when the active `/jarvis` model is incompatible with bridge tools. Closing the overlay revokes all three permissions and cancels pending confirmations. Already-running local operations are not undone; newly starting calls are blocked.
226
+
227
+ Long redirects are paged: review every page with Up/Down or PageUp/PageDown before pressing Y. Resize if the terminal is too small to review safely. Configured Pi selection keybindings are respected.
228
228
 
229
229
  ### Permission flow
230
230
 
@@ -235,9 +235,7 @@ flowchart TD
235
235
  A --> D[Redirect off]
236
236
 
237
237
  B -->|enable| E[Jarvis may use local tools]
238
- E --> F{MCP adapter available?}
239
- F -->|yes| G[Local tools + MCP]
240
- F -->|no| H[Local tools only]
238
+ E --> H[MCP unavailable in this release]
241
239
 
242
240
  C -->|enable| I[Jarvis may send a quiet note to main]
243
241
  D -->|enable| J[Jarvis may request redirect sends]
@@ -271,6 +269,9 @@ sequenceDiagram
271
269
 
272
270
  - `/jarvis` keeps its own isolated conversation state
273
271
  - prior side-session history is restored from a session file under `jarvis-sessions/`
272
+ - main-tree navigation reconciles the side-session reference instead of continuing in an unrelated side thread
273
+ - reset/shutdown invalidates old queues; failed commands and uncertain sends are not automatically replayed
274
+ - side-session project resources honor the main session's project-trust decision
274
275
  - Jarvis sees current main-session state plus a compact delta since the last `/jarvis` turn
275
276
  - `/compact`, `/tree`, and `/new` entered inside `/jarvis` operate on the side-session, not the main session
276
277
  - plain `/jarvis-model <provider/model>` writes the project model override; use `--global` to change the global default
@@ -316,9 +317,11 @@ sequenceDiagram
316
317
 
317
318
  ## Compatibility note
318
319
 
319
- This repository's current validation baseline is **Pi 0.69.0**.
320
+ This repository's validation baseline is **Pi 1.0.0**, using host-provided `@earendil-works/pi-ai`, `@earendil-works/pi-coding-agent`, and `@earendil-works/pi-tui`. Older Pi versions are not supported by this release.
321
+
322
+ Physical models use the main host's public model registry for requests and credentials, including custom providers and runtime-only authentication. **Virtual/router models are not supported**: Pi's public extension registry does not expose session-aware virtual routing. Pin `/jarvis-model <provider/physical-model>` if the main session uses a virtual model.
320
323
 
321
- The package relies on Pi-provided peer dependencies, so treat other host versions as **not the validated baseline for this repo** unless you have tested them yourself.
324
+ MCP is deliberately unavailable in this release. A future native integration needs execution-time permission checks for direct, deferred, and nested tool calls; installing the old adapter does not enable it.
322
325
 
323
326
  ---
324
327
 
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { type ExtensionAPI } from "@mariozechner/pi-coding-agent";
1
+ import { type ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
2
  export default function jarvisExtension(pi: ExtensionAPI): void;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,EAGN,KAAK,YAAY,EAGjB,MAAM,+BAA+B,CAAC;AA8FvC,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CA8c9D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,KAAK,YAAY,EAGjB,MAAM,iCAAiC,CAAC;AAkGzC,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAqhB9D"}