pi-jarvis 1.3.1 → 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 +12 -4
- package/README.md +27 -23
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +175 -75
- package/dist/index.js.map +1 -1
- package/dist/jarvis-config.d.ts +3 -1
- package/dist/jarvis-config.d.ts.map +1 -1
- package/dist/jarvis-config.js +75 -25
- package/dist/jarvis-config.js.map +1 -1
- package/dist/main-context.d.ts.map +1 -1
- package/dist/main-context.js +70 -69
- package/dist/main-context.js.map +1 -1
- package/dist/main-session-state.d.ts +3 -1
- package/dist/main-session-state.d.ts.map +1 -1
- package/dist/main-session-state.js +25 -23
- package/dist/main-session-state.js.map +1 -1
- package/dist/model-picker.d.ts +23 -0
- package/dist/model-picker.d.ts.map +1 -0
- package/dist/model-picker.js +93 -0
- package/dist/model-picker.js.map +1 -0
- package/dist/overlay.d.ts +24 -6
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +244 -109
- package/dist/overlay.js.map +1 -1
- package/dist/side-session.d.ts +18 -5
- package/dist/side-session.d.ts.map +1 -1
- package/dist/side-session.js +230 -47
- package/dist/side-session.js.map +1 -1
- package/package.json +25 -15
package/AGENTS.md
CHANGED
|
@@ -2,21 +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
|
|
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.
|
|
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.
|
|
20
28
|
|
|
21
29
|
## Validation
|
|
22
30
|
- Run `npm test` for full validation.
|
package/README.md
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
[](https://www.npmjs.com/package/pi-jarvis)
|
|
12
12
|
[](./LICENSE)
|
|
13
|
-
[](https://github.com/
|
|
13
|
+
[](https://github.com/crustyhacker/pi-jarvis)
|
|
14
14
|
[](./package.json)
|
|
15
15
|
|
|
16
|
-
<p><strong>Current version:</strong> 1.
|
|
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`,
|
|
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,19 +115,16 @@ Stay in the main lane when you want:
|
|
|
116
115
|
### 1) Install
|
|
117
116
|
|
|
118
117
|
```bash
|
|
119
|
-
|
|
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
|
-
|
|
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
|
-
|
|
127
|
-
./dist/index.js
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
This package is meant to run **inside a Pi installation** that provides the required peer dependencies.
|
|
125
|
+
### 2) Restart or reload Pi
|
|
131
126
|
|
|
127
|
+
`pi install` registers the package automatically. For local development, build and load `./dist/index.js` with `pi -e ./dist/index.js`.
|
|
132
128
|
### 3) Open Jarvis
|
|
133
129
|
|
|
134
130
|
```bash
|
|
@@ -144,7 +140,7 @@ Or open it and send the first message immediately:
|
|
|
144
140
|
### 4) Turn on more power only when you want it
|
|
145
141
|
|
|
146
142
|
- leave `Repo tools` off for pure context / analysis
|
|
147
|
-
- turn `Repo tools` on when you want local `read`, `bash`, `edit`,
|
|
143
|
+
- turn `Repo tools` on when you want local `read`, `bash`, `edit`, and `write`
|
|
148
144
|
- turn `Note main` on when you want Jarvis to quietly message the main session
|
|
149
145
|
- turn `Redirect` on when you want Jarvis to propose a redirect that you still explicitly confirm
|
|
150
146
|
|
|
@@ -156,7 +152,7 @@ Or open it and send the first message immediately:
|
|
|
156
152
|
Opens the side overlay. If text follows the command, that text becomes the first side-session prompt.
|
|
157
153
|
|
|
158
154
|
### `/jarvis-model`
|
|
159
|
-
|
|
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.
|
|
160
156
|
|
|
161
157
|
### `/jarvis-model [--project|--global] <provider/model>`
|
|
162
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`.
|
|
@@ -167,12 +163,13 @@ Restores the chosen scope to `follow-main`. A project-scoped `follow-main` overr
|
|
|
167
163
|
### `/jarvis-model [--project|--global] clear`
|
|
168
164
|
Removes the selected scope so `/jarvis` falls back through the remaining config layers to the built-in default.
|
|
169
165
|
|
|
170
|
-
### `/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`
|
|
171
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`.
|
|
172
168
|
|
|
173
169
|
- `auto` preserves the built-in behavior: follow the main thinking level only when `/jarvis` follows the main model; pinned `/jarvis` models use `off`.
|
|
174
170
|
- `follow-main` follows the main thinking level even when `/jarvis` is pinned to a separate model.
|
|
175
|
-
- Explicit levels
|
|
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.
|
|
176
173
|
- xAI `/jarvis` models still force thinking `off`.
|
|
177
174
|
|
|
178
175
|
### `/jarvis-thinking [--project|--global] clear`
|
|
@@ -211,6 +208,8 @@ Model and thinking settings resolve through the same config layers, then fall ba
|
|
|
211
208
|
2. global config: `~/.pi/agent/extensions/pi-jarvis.json` or the equivalent path under a custom Pi agent dir
|
|
212
209
|
3. built-in defaults: model `follow-main`, thinking `auto`
|
|
213
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
|
+
|
|
214
213
|
---
|
|
215
214
|
|
|
216
215
|
## Overlay controls
|
|
@@ -219,11 +218,13 @@ The overlay header exposes three controls, all **off by default**:
|
|
|
219
218
|
|
|
220
219
|
| Control | What it does | Safety model |
|
|
221
220
|
|---|---|---|
|
|
222
|
-
| `Repo tools` | Enables local `read`, `bash`, `edit`,
|
|
221
|
+
| `Repo tools` | Enables local `read`, `bash`, `edit`, and `write` | Explicit opt-in |
|
|
223
222
|
| `Note main` | Sends a concise, non-interrupting note to the main session | Explicit opt-in |
|
|
224
223
|
| `Redirect` | Sends a redirecting instruction to the main session | Explicit opt-in + per-send confirmation |
|
|
225
224
|
|
|
226
|
-
`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.
|
|
227
228
|
|
|
228
229
|
### Permission flow
|
|
229
230
|
|
|
@@ -234,9 +235,7 @@ flowchart TD
|
|
|
234
235
|
A --> D[Redirect off]
|
|
235
236
|
|
|
236
237
|
B -->|enable| E[Jarvis may use local tools]
|
|
237
|
-
E -->
|
|
238
|
-
F -->|yes| G[Local tools + MCP]
|
|
239
|
-
F -->|no| H[Local tools only]
|
|
238
|
+
E --> H[MCP unavailable in this release]
|
|
240
239
|
|
|
241
240
|
C -->|enable| I[Jarvis may send a quiet note to main]
|
|
242
241
|
D -->|enable| J[Jarvis may request redirect sends]
|
|
@@ -270,6 +269,9 @@ sequenceDiagram
|
|
|
270
269
|
|
|
271
270
|
- `/jarvis` keeps its own isolated conversation state
|
|
272
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
|
|
273
275
|
- Jarvis sees current main-session state plus a compact delta since the last `/jarvis` turn
|
|
274
276
|
- `/compact`, `/tree`, and `/new` entered inside `/jarvis` operate on the side-session, not the main session
|
|
275
277
|
- plain `/jarvis-model <provider/model>` writes the project model override; use `--global` to change the global default
|
|
@@ -315,9 +317,11 @@ sequenceDiagram
|
|
|
315
317
|
|
|
316
318
|
## Compatibility note
|
|
317
319
|
|
|
318
|
-
This repository's
|
|
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.
|
|
319
323
|
|
|
320
|
-
|
|
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.
|
|
321
325
|
|
|
322
326
|
---
|
|
323
327
|
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
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"}
|