pi-jarvis 1.6.1 → 1.8.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 +22 -2
- package/README.md +174 -5
- package/dist/archive-config.d.ts +15 -0
- package/dist/archive-config.d.ts.map +1 -0
- package/dist/archive-config.js +310 -0
- package/dist/archive-config.js.map +1 -0
- package/dist/archive-extension.d.ts +38 -0
- package/dist/archive-extension.d.ts.map +1 -0
- package/dist/archive-extension.js +334 -0
- package/dist/archive-extension.js.map +1 -0
- package/dist/archive-service.d.ts +60 -0
- package/dist/archive-service.d.ts.map +1 -0
- package/dist/archive-service.js +441 -0
- package/dist/archive-service.js.map +1 -0
- package/dist/archive-store.d.ts +53 -0
- package/dist/archive-store.d.ts.map +1 -0
- package/dist/archive-store.js +782 -0
- package/dist/archive-store.js.map +1 -0
- package/dist/archive-types.d.ts +57 -0
- package/dist/archive-types.d.ts.map +1 -0
- package/dist/archive-types.js +2 -0
- package/dist/archive-types.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +110 -0
- package/dist/index.js.map +1 -1
- package/dist/jarvis-config.d.ts.map +1 -1
- package/dist/jarvis-config.js +7 -22
- package/dist/jarvis-config.js.map +1 -1
- package/dist/memory-config.d.ts +21 -0
- package/dist/memory-config.d.ts.map +1 -0
- package/dist/memory-config.js +325 -0
- package/dist/memory-config.js.map +1 -0
- package/dist/memory-content.d.ts +26 -0
- package/dist/memory-content.d.ts.map +1 -0
- package/dist/memory-content.js +223 -0
- package/dist/memory-content.js.map +1 -0
- package/dist/memory-extension.d.ts +12 -0
- package/dist/memory-extension.d.ts.map +1 -0
- package/dist/memory-extension.js +286 -0
- package/dist/memory-extension.js.map +1 -0
- package/dist/memory-service.d.ts +52 -0
- package/dist/memory-service.d.ts.map +1 -0
- package/dist/memory-service.js +390 -0
- package/dist/memory-service.js.map +1 -0
- package/dist/memory-store.d.ts +47 -0
- package/dist/memory-store.d.ts.map +1 -0
- package/dist/memory-store.js +659 -0
- package/dist/memory-store.js.map +1 -0
- package/dist/memory-types.d.ts +49 -0
- package/dist/memory-types.d.ts.map +1 -0
- package/dist/memory-types.js +2 -0
- package/dist/memory-types.js.map +1 -0
- package/dist/side-session.d.ts +10 -0
- package/dist/side-session.d.ts.map +1 -1
- package/dist/side-session.js +51 -5
- package/dist/side-session.js.map +1 -1
- package/package.json +7 -4
package/AGENTS.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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`, `native-mcp.ts`, `overlay.ts`, `overlay-layout.ts`, `draft-editor.ts`, `transcript-viewport.ts`, `jarvis-branding.ts`, `model-picker.ts`, `jarvis-config.ts`, `session-ref.ts`.
|
|
5
|
+
- Core runtime files: `index.ts`, `side-session.ts`, `native-mcp.ts`, `overlay.ts`, `overlay-layout.ts`, `draft-editor.ts`, `transcript-viewport.ts`, `jarvis-branding.ts`, `model-picker.ts`, `jarvis-config.ts`, `session-ref.ts`, `memory-{types,config,content,store,service,extension}.ts`, and `archive-{types,config,store,service,extension}.ts`.
|
|
6
6
|
- Current baseline: Pi 1.0.0 (`@earendil-works` packages), Node.js >=22.19.0. Older Pi hosts are not supported.
|
|
7
7
|
|
|
8
8
|
## Current `/jarvis-model` and `/jarvis-thinking` Behavior
|
|
@@ -15,7 +15,7 @@
|
|
|
15
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.
|
|
16
16
|
- `/jarvis-thinking [--project|--global] clear` removes that scope's thinking override so fallback applies.
|
|
17
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
|
|
18
|
+
- Config writes use atomic same-directory replacement. Malformed shared JSON requires manual repair: model/thinking set/clear must never replace/delete it and reset unknown memory privacy controls. Keep I/O errors distinct and parser input snippets out of UI errors. Legacy model/thinking cross-process writes remain unlocked.
|
|
19
19
|
- `auto` thinking follows main only when `/jarvis` follows the main model; pinned `/jarvis` models default to thinking `off`.
|
|
20
20
|
- `follow-main` thinking follows the main thinking level regardless of model selection, except xAI `/jarvis` models force thinking `off`.
|
|
21
21
|
- `/compact`, `/tree`, and `/new` entered inside `/jarvis` operate on the isolated `/jarvis` side-session, not the main Pi session.
|
|
@@ -49,6 +49,26 @@
|
|
|
49
49
|
- Keep server administration in main Pi. Disable codemode model helpers (`models: false`); preserve independent Note main/Redirect gates and the overlay-owned bridge subscription.
|
|
50
50
|
- Tests use temporary agent/workspace directories and local fixture servers only; never start real user MCP servers or resolve real credentials during validation.
|
|
51
51
|
|
|
52
|
+
## Shared memory (1.7.0)
|
|
53
|
+
- Main Pi and the isolated Jarvis SDK session explicitly mount one shared local service. Memory is enabled by default in trusted projects, independently of Repo tools, Note main, Redirect, and overlay open/close. It can share historical facts even when bridge delivery is off; it never steers or queues work.
|
|
54
|
+
- `/jarvis-memory` reports status; `help` documents controls. `[--global|--project] on|off|capture on|off|recall on|off|clear` controls default to GLOBAL (unlike model/thinking). Per-field project > global > defaults, except global enabled=false is a master kill switch. Untrusted projects and config errors pause all memory. Full off means no memory-record reads/capture/injection/tool execution; retain data. Explicit admin inspection still requires enabled memory; capture/recall-only pauses do not block manual commands.
|
|
55
|
+
- Inside the overlay, `/memory …` and `/jarvis-memory …` execute immediately without model/boot/queue work. `clear` removes settings, never data; `forget-all --confirm [--global|--all]` defaults to only the current project's records. Data scope flags follow the action.
|
|
56
|
+
- Disclose capture/recall before first use and only then persist the global disclosure marker. No silent historical import, background providers, embeddings, real user credential access, or real MCP servers during tests. Isolate every test's agent/workspace directories.
|
|
57
|
+
- Capture only new finalized user/assistant text, not thinking/tool/custom/system/attachment data or aborted/error output. Stage only event metadata (max 256 anchors); resolve at turn/settlement boundaries from at most 1,024 newly persisted parent-chain entries, stopping before the old leaf. Never archive intermediate message_end payloads before later redaction hooks. Discard pending anchors on revocation, session/tree change or disposal; never backfill. Secret filtering is best-effort, not a guarantee; reject suspected secrets in curated notes. Cap text at 16 KiB UTF-8; omit oversized archive captures, reject oversized notes. Archive retains newest 10,000 records; curated notes cap at 1,000 without automatic deletion.
|
|
58
|
+
- Keep auto recall scoped to global + canonical current cwd; explicit all-project search is supported. Request-local context injection is bounded to 6,000 bytes of untrusted record JSON plus notice; search results 12,000 bytes with excerpt/omission markers. Never persist automatically injected context via appendEntry/sendMessage or treat stored instructions as authority. Explicit tool calls/results still follow normal Pi persistence; don't promise that disabling/forgetting erases earlier tool results or already-viewed output.
|
|
59
|
+
- Store is lazy local SQLite under the active agent directory (`extensions/pi-jarvis-memory/memory.sqlite`), not a project-selected path. SQLite coordinates record writers; memory settings use atomic cooperative locking that legacy model/thinking writes do not participate in. Fail closed on malformed settings; never repair automatically.
|
|
60
|
+
- Memory guidance is also request-local: use a custom advisory so Pi's later forced-prompt projection cannot discard it. Preserve other prompt/tool state; a mid-turn disable removes both advisory and recalled records from future requests.
|
|
61
|
+
- Model tools recheck live trust/settings/cancellation and permission generations at execution, including captured definitions. Broadcast observed policy changes across mounted lanes and revoke per-binding generations at session/tree boundaries; don't promise live push delivery across processes. Model forget requires cancellable human review and transactionally compares the reviewed version. Tombstones prevent identical event/title resurrection, not every semantic mention; Pi transcripts, backups and already-sent context remain. Do not promise encryption, a sandbox, or forensic erasure.
|
|
62
|
+
|
|
63
|
+
## Optional full-session archive (1.8.0)
|
|
64
|
+
- `archive-{types,config,store,service,extension}.ts` implement an independent OFF-by-default archive, explicitly mounted in main and Jarvis. Defaults enabled=false/capture=true/modelAccess=false; per-field project > global > defaults except explicit global enabled=false is master-off. Untrusted/config errors pause everything. Never enable/import real user data in tests.
|
|
65
|
+
- Separate settings: `<agentDir>/extensions/pi-jarvis-archive.json` and `.pi/jarvis-archive.json`, top-level `archive`. Controls default global. on/model-access on/clear require `--confirm-sensitive`; clear removes settings, not data, and fallback can re-enable. Archive tools are read-only and need modelAccess; humans can inspect with only capture/modelAccess off, but not full off.
|
|
66
|
+
- `/jarvis-archive` and overlay `/archive` commands are local, immediate, no provider/boot/queue work. Search/read/session default current-project; all-project access is explicit. Model tools cannot change controls, import, or delete. No auto context injection.
|
|
67
|
+
- Archive accepted finalized journal entries unredacted, including exposed thinking/tool/system/custom/error/inline-image data. Never capture intermediate message_end/tool_result/raw-provider payloads before later redactors. Baseline existing entry IDs on activation, never auto-backfill; parent/header provenance retained. Snapshots are not crash-safe audit logging and cannot recover unpersisted events, earlier truncation or external referenced files. Warn on storage/observation failures, not silent replay.
|
|
68
|
+
- Lazy private SQLite FTS5 at `<agentDir>/extensions/pi-jarvis-archive/archive.sqlite`, no automatic retention eviction. 64 MiB raw-entry/index budgets and 64K UTF-16 normalization-context hard rejection, no truncation of accepted raw JSON or silent partial indexing. Identical serialized payloads deduplicate across lanes; conflicting payloads for one identity fail without replacement. Search/read output max 24,000 JSON bytes plus notice; raw read offsets count Unicode codepoints and preserve pagination through output shrinking. Oversized display provenance is explicitly abbreviated; read(part=metadata) / read --metadata pages exact original metadata so every accepted entry stays accessible. Images/signatures are raw-retained, not text-indexed. Never load full payloads for search or scan all raw bodies on open.
|
|
69
|
+
- Explicit human import streams one selected regular v3 JSONL file, honors its header's project/session provenance, checks live capture/epoch/cancellation at chunk/record boundaries, reports partial commits, never mutates source. No directory scans/legacy auto-migration. Scoped forget-session/prune require --confirm; tombstones stop identical entry resurrection, not all copies. No encryption, sandbox, forensic erase, or hard total-disk-quota claims.
|
|
70
|
+
- Keep live trust/settings and per-binding stale-definition guards independent of Repo tools. Reader permission changes must not discard pending recording. Main owner closes storage after final archive snapshot; the side owner snapshots finalized entries before revoking its lifetime/context, without closing the shared service. Preserve archive finalization before main boot-generation invalidation. Settings observations propagate between mounted lanes, not by a cross-process watcher.
|
|
71
|
+
|
|
52
72
|
## Git and Release Policy
|
|
53
73
|
- Every new commit MUST have an annotated **stable version tag `vX.Y.Z`**. No `dev`, alpha, beta, release-candidate, build-metadata, or SHA-only tags. This is a released extension, not a prerelease channel.
|
|
54
74
|
- Before committing, choose the next unused stable version and update package metadata, lockfile, README, and a dated changelog entry together. Tag every commit, including intermediate and merge commits; never leave a new commit untagged. Run `npm run check:tags`, then push the commit and version tag atomically. Do not move or replace existing tags or rewrite shared history.
|
package/README.md
CHANGED
|
@@ -6,19 +6,23 @@
|
|
|
6
6
|
|
|
7
7
|
## A cinematic side-conversation overlay for Pi
|
|
8
8
|
|
|
9
|
-
**
|
|
9
|
+
**A second lane of thought—with shared memory and an optional searchable history archive.**
|
|
10
10
|
|
|
11
11
|
`pi-jarvis` adds `/jarvis`: a polished overlay where you can ask for status, inspect the repo when you explicitly allow it, and send a quiet note or a confirmed redirect back to the main lane.
|
|
12
12
|
|
|
13
|
+
**Remember what matters. Find the original history when you need it.** Main Pi and Jarvis share [persistent memory](#shared-memory); the separate, opt-in [full-session archive](#full-session-archive) adds indexed history search across sessions and, when explicitly requested, projects.
|
|
14
|
+
|
|
13
15
|
[](https://github.com/crustyhacker/pi-jarvis/actions/workflows/ci.yml)
|
|
14
16
|
[](https://www.npmjs.com/package/pi-jarvis)
|
|
15
17
|
[](./LICENSE)
|
|
16
18
|
[](https://github.com/crustyhacker/pi-jarvis)
|
|
17
19
|
[](./package.json)
|
|
18
20
|
|
|
19
|
-
<p><strong>Current version:</strong> 1.
|
|
21
|
+
<p><strong>Current version:</strong> 1.8.0</p>
|
|
20
22
|
|
|
21
23
|
<p>
|
|
24
|
+
<strong>Shared persistent memory</strong> ·
|
|
25
|
+
<strong>Optional indexed session archive</strong> ·
|
|
22
26
|
<strong>Persistent side session</strong> ·
|
|
23
27
|
<strong>Live main-session awareness</strong> ·
|
|
24
28
|
<strong>Opt-in local tools + native MCP</strong> ·
|
|
@@ -73,10 +77,28 @@ The main Pi session should stay on the critical path.
|
|
|
73
77
|
|
|
74
78
|
---
|
|
75
79
|
|
|
80
|
+
## Two complementary memory features
|
|
81
|
+
|
|
82
|
+
| | Shared memory | Optional full-session archive |
|
|
83
|
+
|---|---|---|
|
|
84
|
+
| **Purpose** | Remember useful preferences, corrections, decisions and references | Find original recorded conversations, tool activity and session history |
|
|
85
|
+
| **What it keeps** | Curated notes plus bounded finalized user/assistant text captures | Complete accepted finalized Pi journal entries, with provenance and paged raw reads |
|
|
86
|
+
| **Default** | **On in trusted projects**, with separate capture/recall controls | **Off**; recording and model access are separately controlled |
|
|
87
|
+
| **Retrieval** | Automatic recall from global/current-project memory; explicit broader search | Local indexed search and session browsing; no automatic context injection |
|
|
88
|
+
| **Manage it** | `/jarvis-memory` · overlay `/memory` | `/jarvis-archive` · overlay `/archive` |
|
|
89
|
+
|
|
90
|
+
Both work across main Pi and Jarvis, independently of **Repo tools** and whether the overlay is open. Each has its own local SQLite store and global/project controls. Turning one off does not turn the other off.
|
|
91
|
+
|
|
92
|
+
**Privacy matters:** storage is local plaintext. Archive content is unredacted and can include secrets; granting model access can send retrieved content to your model provider. “Full” means accepted finalized data exposed by Pi—not hidden provider reasoning or a crash-safe audit log. Historical import is explicit. See the [memory controls](#shared-memory) and [archive limits](#full-session-archive) before enabling more access.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
76
96
|
## At a glance
|
|
77
97
|
|
|
78
98
|
| Capability | What you get |
|
|
79
99
|
|---|---|
|
|
100
|
+
| **Shared memory** | Main Pi and Jarvis remember useful discussions across sessions; enabled by default, with global/project controls and a master off switch |
|
|
101
|
+
| **Optional full-session archive** | Off by default; raw finalized entries, local indexed cross-session search, separate model permission and explicit historical import |
|
|
80
102
|
| **Persistent side lane** | `/jarvis` keeps its own isolated conversation state and restores prior side-session history |
|
|
81
103
|
| **Live awareness** | Jarvis sees the current main-session summary plus a delta since the last `/jarvis` turn |
|
|
82
104
|
| **Permission-gated tools** | Local `read`, `bash`, `edit`, `write`, and configured native MCP stay off until you enable Repo tools |
|
|
@@ -93,6 +115,12 @@ flowchart LR
|
|
|
93
115
|
U[You] -->|primary work| M[Main Pi session]
|
|
94
116
|
U -->|open /jarvis| J[Jarvis overlay]
|
|
95
117
|
M -->|summary + recent delta| J
|
|
118
|
+
M <-->|independent memory controls| S[Shared local memory]
|
|
119
|
+
J <-->|independent memory controls| S
|
|
120
|
+
M -->|recording opt-in| A[Separate local history archive]
|
|
121
|
+
J -->|recording opt-in| A
|
|
122
|
+
A -. separately authorized model reads .-> M
|
|
123
|
+
A -. separately authorized model reads .-> J
|
|
96
124
|
J -->|Repo tools enabled| R[Local tools\nread • bash • edit • write]
|
|
97
125
|
J -->|Repo tools enabled| C[Configured native MCP\nside-owned connections]
|
|
98
126
|
J -. Note main .-> M
|
|
@@ -148,6 +176,10 @@ Requires **Pi 1.0.0** and **Node.js 22.19.0 or newer**. Version **1.6.0** suppor
|
|
|
148
176
|
### 2) Restart or reload Pi
|
|
149
177
|
|
|
150
178
|
`pi install` registers the package automatically. For local development, build and load `./dist/index.js` with `pi -e ./dist/index.js`.
|
|
179
|
+
**New in 1.7.0: shared memory is enabled by default in trusted projects**, including main Pi even if you never open the overlay. A first-use notice explains capture and recall. Already using another memory extension? Run `/jarvis-memory off` before your first prompt; this disables both main and Jarvis memory without deleting anything.
|
|
180
|
+
|
|
181
|
+
**New in 1.8.0: the separate full-session archive is OFF by default.** Nothing is imported or recorded by that subsystem until you opt in. See [Full-session archive](#full-session-archive).
|
|
182
|
+
|
|
151
183
|
### 3) Open Jarvis
|
|
152
184
|
|
|
153
185
|
```bash
|
|
@@ -162,7 +194,7 @@ Or open it and send the first message immediately:
|
|
|
162
194
|
|
|
163
195
|
### 4) Turn on more power only when you want it
|
|
164
196
|
|
|
165
|
-
- leave `Repo tools` off for
|
|
197
|
+
- leave `Repo tools` off for context / analysis without repository or MCP access; shared memory has separate controls
|
|
166
198
|
- turn `Repo tools` on when you want local `read`, `bash`, `edit`, `write`, and configured native MCP capabilities
|
|
167
199
|
- turn `Note main` on when you want Jarvis to quietly message the main session
|
|
168
200
|
- turn `Redirect` on when you want Jarvis to propose a redirect that you still explicitly confirm
|
|
@@ -198,6 +230,12 @@ Sets the thinking level used by `/jarvis` without changing the main session thin
|
|
|
198
230
|
### `/jarvis-thinking [--project|--global] clear`
|
|
199
231
|
Removes the selected scope so `/jarvis` thinking falls back through the remaining config layers to the built-in `auto` default.
|
|
200
232
|
|
|
233
|
+
### `/jarvis-memory`
|
|
234
|
+
Reports shared-memory status. Use `/jarvis-memory help` for controls and data-management commands. Memory controls default to **global**, unlike model/thinking controls. See [Shared memory](#shared-memory) below.
|
|
235
|
+
|
|
236
|
+
### `/jarvis-archive`
|
|
237
|
+
Reports the separate full-session archive's status. It defaults **OFF**, with independent capture and model-access controls. `/jarvis-archive help` documents enablement warnings, paging, explicit import, and deletion. See [Full-session archive](#full-session-archive).
|
|
238
|
+
|
|
201
239
|
### Side-session commands inside `/jarvis`
|
|
202
240
|
The `/jarvis` input handles a small set of built-in commands against the isolated side-session:
|
|
203
241
|
|
|
@@ -206,6 +244,137 @@ The `/jarvis` input handles a small set of built-in commands against the isolate
|
|
|
206
244
|
- `/tree <entry-id>` navigates the `/jarvis` session tree to that entry.
|
|
207
245
|
- `/tree --summarize <entry-id> [instructions]` navigates and summarizes the branch being left.
|
|
208
246
|
- `/new` starts a fresh `/jarvis` side-session without changing the main Pi session.
|
|
247
|
+
- `/memory …` or `/jarvis-memory …` manages shared memory immediately, without sending a model prompt or waiting for queued side work. Initial forms such as `/jarvis /memory off` are also handled locally, without booting a side session.
|
|
248
|
+
- `/archive …` or `/jarvis-archive …` manages the separate optional archive locally, without model/queue work; initial `/jarvis /archive …` works without booting a side session.
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Full-session archive
|
|
253
|
+
|
|
254
|
+
This is a **separate, optional subsystem**, not a change to shared memory's curated notes or bounded text captures. It is **OFF by default**, independent of Repo tools, Note main, Redirect, and overlay open/close. Model reads are **also off by default**, even after recording is enabled. No archive content is automatically injected into prompts.
|
|
255
|
+
|
|
256
|
+
### Enable only after reviewing the risks
|
|
257
|
+
|
|
258
|
+
```text
|
|
259
|
+
/jarvis-archive # status; no archive-record reads
|
|
260
|
+
/jarvis-archive --project on --confirm-sensitive # record here only
|
|
261
|
+
/jarvis-archive on --confirm-sensitive # enable globally
|
|
262
|
+
/jarvis-archive model-access on --confirm-sensitive # allow model search/read; recording alone doesn't
|
|
263
|
+
/jarvis-archive capture off # pause recording default, retain access
|
|
264
|
+
/jarvis-archive off # global MASTER OFF; keep stored data
|
|
265
|
+
/jarvis-archive clear --confirm-sensitive # remove global settings; fallback may re-enable
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Controls default to **global**; use `--project` for an override. Resolution is per-field project > global > defaults (`enabled: false`, `capture: true`, `modelAccess: false`), except an **explicit global off overrides every project**. `capture off` and `model-access off` set defaults that a project can override; inspect effective status. Use `clear --confirm-sensitive` to remove a scoped setting, never data. Malformed/unreadable settings and untrusted projects pause **all** archive access. Full off blocks even manual record inspection; recording-only/model-only pauses do not prevent explicit human reads. Separate files avoid interfering with memory/model settings:
|
|
269
|
+
|
|
270
|
+
- Global: `<active-agent-dir>/extensions/pi-jarvis-archive.json`
|
|
271
|
+
- Project: `.pi/jarvis-archive.json`
|
|
272
|
+
- Shape: `{ "archive": { "enabled": true, "capture": true, "modelAccess": false } }`
|
|
273
|
+
|
|
274
|
+
Enabling/model-access commands require the literal warning acknowledgment, and direct-file enablement shows a first-use warning. **This archive is unredacted plaintext and may retain passwords, tokens, private files, and sensitive tool output.** Model access can send retrieved data to the active provider. It is not a sandbox, encryption mechanism, or a substitute for carefully managing secrets.
|
|
275
|
+
|
|
276
|
+
### What “full” means
|
|
277
|
+
|
|
278
|
+
Accepted **new, finalized Pi journal entries** are retained as complete JSON, without memory's secret filtering, 16 KiB text cap, or 10,000-record eviction. This includes user/assistant/system messages, exposed thinking, tool calls/results and details, failed/aborted output that Pi retained, inline image payloads, custom entries, compaction/context edits, and branch metadata. Session headers retain provenance, including parent-session links. Search indexes textual content locally with SQLite FTS5; binary image data and opaque signatures are retained but not text-indexed. There is no OCR, embedding service, or background model call.
|
|
279
|
+
|
|
280
|
+
“Full” **does not mean an infallible wire/stream audit log**. Hidden provider reasoning, keystrokes, intermediate stream/tool updates, non-persisted commands/events, external attachment files, and output already truncated by Pi/tools are not recovered. Referenced files are **never automatically opened or copied**. Later message-redaction hooks run before capture. Raw history includes abandoned branches and superseded context, not just the effective current model context.
|
|
281
|
+
|
|
282
|
+
Recording begins after an activation baseline, never by importing pre-existing entries. Captures occur at finalized turn/settlement and supported session boundaries, not per token. The side owner takes a final snapshot of already-finalized entries before disposal, while recording remains authorized. Crashes, late shutdown hooks, unsupported journal APIs, failed storage, or permission transitions can leave gaps; warnings report observation/storage failures without replaying uncertain writes. Pending/disabled-period content is not backfilled after re-enable. Explicit **64 MiB raw-entry and indexing ceilings reject oversized work rather than truncating it**. Normalization uses bounded chunks; pathological Unicode combining/composition contexts beyond 64K UTF-16 units also reject explicitly. Conservative index budgeting can reject excessive whitespace/normalization expansion even if its final folded text would be smaller. No automatic eviction or strict total-disk quota is imposed: monitor space and prune deliberately. Large synchronous writes/indexing can pause the UI. Search/page order may change as other sessions append/delete records; pagination is not a frozen snapshot.
|
|
283
|
+
|
|
284
|
+
### Search and inspect
|
|
285
|
+
|
|
286
|
+
```text
|
|
287
|
+
/jarvis-archive search deployment decision
|
|
288
|
+
/jarvis-archive search --all --offset 20 deployment
|
|
289
|
+
/jarvis-archive session --all <session-id> 0
|
|
290
|
+
/jarvis-archive read --all <record-id> 0
|
|
291
|
+
/jarvis-archive read --all --metadata <record-id> 0
|
|
292
|
+
/jarvis-archive stats --all
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Search/session pages return bounded excerpts of normalized indexing text with IDs, project, lane, timestamps and parent entry IDs. Excerpts are not exact quotations; use `read` for original case and content. Follow `nextOffset` to continue. Exceptionally large/escape-heavy provenance is explicitly labeled with `abbreviated` field names, never allowed to block record access; `read --metadata` (model tool `part: "metadata"`) pages the exact original metadata. `read` returns complete raw JSON **through pages**; its offsets count Unicode codepoints, not bytes or UTF-16 units. Results are bounded to 24,000 bytes of JSON plus an untrusted-data notice; stored payloads are not shortened. Use explicit `--all` to access other projects. Models get only three read-only tools—`jarvis_archive_search`, `jarvis_archive_read`, and `jarvis_archive_session`—when model access is enabled. No model controls, import, or deletion tools exist. Tools recheck current permissions/trust/cancellation and reject stale definitions.
|
|
296
|
+
|
|
297
|
+
Global accessibility is within the **same active Pi agent directory**, not cloud sync or other users' machines. Project controls govern operations initiated here; existing records from a paused project remain accessible through explicit all-project queries from another allowed project. Disabling is not deletion. Returned model-tool results persist normally in Pi and can be captured again as part of a later journal entry.
|
|
298
|
+
|
|
299
|
+
### Explicit import and retention
|
|
300
|
+
|
|
301
|
+
```text
|
|
302
|
+
/jarvis-archive import --confirm-sensitive /absolute/path/to/session.jsonl
|
|
303
|
+
/jarvis-archive forget-session --confirm <session-id>
|
|
304
|
+
/jarvis-archive prune --confirm 2026-01-01T00:00:00.000Z
|
|
305
|
+
/jarvis-archive prune --all --confirm 2026-01-01T00:00:00.000Z
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
Import is **human-only**, requires enabled recording and an explicit regular v3 JSONL file, and preserves the source header's project/session identity—even if different from the current project. No directory scan or silent historical import occurs; legacy session versions require a separately reviewed conversion first. Completed entries survive a partial/cancelled import, with counts reported; duplicate entries are skipped, differing payloads for an existing identity are rejected, and originals are never modified. Deletion defaults to this project; `--all` is explicit. Stable identity tombstones prevent re-import of deleted entries, not every semantic copy or other previously unarchived entry.
|
|
309
|
+
|
|
310
|
+
Storage is lazy SQLite under `<active-agent-dir>/extensions/pi-jarvis-archive/archive.sqlite`, defaulting to `~/.pi/agent/extensions/pi-jarvis-archive/archive.sqlite`. Owned directories/files use private permissions where supported, with defensive link/type checks and concurrent-writer transactions. There is no background watcher: observed settings changes are propagated between mounted lanes, while other processes recheck at operation boundaries. Deletion does not erase original Pi files, prior search-result copies, already-sent model context or backups, and does not guarantee reclaimed disk space or forensic erasure. For a complete reset, stop all Pi processes using the store and remove only its archive directory yourself; that also removes tombstones. Shared memory stays separate and unchanged. To stop both Jarvis persistence layers, use both `/jarvis-archive off` and `/jarvis-memory off`; neither disables Pi's original session transcripts.
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## Shared memory
|
|
315
|
+
|
|
316
|
+
Main Pi and Jarvis use **one local memory service**, independent of the overlay lifecycle. Useful Jarvis discussions can inform a later main session and vice versa—even when `Note main` is off. Memory does not steer or queue messages into the other session; it supplies historical context when recalled. Close/reopen, `/new`, and project changes do not erase it.
|
|
317
|
+
|
|
318
|
+
### What is remembered
|
|
319
|
+
|
|
320
|
+
- **Bounded conversation captures (not the optional full-session archive):** only newly finalized user/assistant text observed after loading this feature, labeled with project, main/Jarvis lane, session ID, event identity and timestamps. No silent historical import or reconstruction from old session files.
|
|
321
|
+
- **Curated notes:** your active model can save concise preferences, corrections, project decisions and references during normal foreground work. Stable scoped titles update/deduplicate notes. You can save or edit notes explicitly too. Curation depends on the model choosing the tool; it is not a separate background summarizer.
|
|
322
|
+
- **Bounded recall:** a small request-local selection of global/current-project notes and matching conversation excerpts, using local keyword search. Other projects are available through explicit `search --all` or the model's cross-project search tool. Project scope uses the canonical working directory, not a remote repository name; separate worktrees remain separate scopes unless a note is global.
|
|
323
|
+
|
|
324
|
+
There are **no embeddings, background model calls, telemetry, or memory-server connections**. Retrieval and saving tools can add normal foreground model turns/tokens. Recalled text is sent to the active model as untrusted historical data, not instructions. Automatic recall is capped at 6,000 UTF-8 bytes of record JSON plus a short notice; tool search results are capped at 12,000 bytes with explicit excerpt/omission markers. Automatically injected memory guidance and recall are request-local, not appended to Pi's persisted transcript. Explicit memory-tool calls/results are recorded normally by Pi and may contain saved facts; model replies may repeat them too.
|
|
325
|
+
|
|
326
|
+
### Controls
|
|
327
|
+
|
|
328
|
+
```text
|
|
329
|
+
/jarvis-memory # status, without reading stored memories
|
|
330
|
+
/jarvis-memory off # global MASTER OFF for main + Jarvis
|
|
331
|
+
/jarvis-memory on # enable globally; project restrictions still apply
|
|
332
|
+
/jarvis-memory capture off # saving default off (project overrides apply)
|
|
333
|
+
/jarvis-memory recall off # recall default off (project overrides apply)
|
|
334
|
+
/jarvis-memory --project off # pause memory in this project
|
|
335
|
+
/jarvis-memory --project clear # remove this project's memory settings
|
|
336
|
+
/jarvis-memory --global clear # remove global settings, not stored data
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
`enabled`, `capture`, and `recall` default to `true`. Each field resolves project → global → default, **except global `enabled: false` is a master switch that no project can override**. Untrusted projects and unreadable/malformed settings pause all memory. Use `--project capture off` or `--project recall off` to pause that capability specifically here; inspect status for the effective setting. The full off switch means no capture, memory-record reads, injection, tool execution, or background work; existing data remains on disk. Even inspection requires re-enabling memory. Explicit management commands still work with only capture or recall turned off. Turning memory off does not erase facts/tool results already in the current conversation or already-viewed output.
|
|
340
|
+
|
|
341
|
+
Controls share the existing settings files and preserve model/thinking/unknown keys:
|
|
342
|
+
|
|
343
|
+
```json
|
|
344
|
+
{
|
|
345
|
+
"memory": { "enabled": false }
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
Place this in `<agentDir>/extensions/pi-jarvis.json` to disable memory before installation/startup (normally `~/.pi/agent/extensions/pi-jarvis.json`; honors `PI_CODING_AGENT_DIR`). Project overrides live in `.pi/jarvis.json`. Memory settings writes are atomic and use a bounded cooperative lock; legacy model/thinking writers do not share that lock, so avoid concurrent configuration changes. Corrupt shared settings are never automatically repaired or overwritten—even by model/thinking set or clear commands. Repair the JSON manually while preserving privacy settings. A crashed config writer can leave a `.memory.lock` file; remove it only after confirming no writer is running.
|
|
350
|
+
|
|
351
|
+
### Inspect, edit and forget
|
|
352
|
+
|
|
353
|
+
```text
|
|
354
|
+
/jarvis-memory list # recent global/current-project records
|
|
355
|
+
/jarvis-memory search deployment # local keyword search
|
|
356
|
+
/jarvis-memory search --all deployment # explicitly search every project
|
|
357
|
+
/jarvis-memory show <id>
|
|
358
|
+
/jarvis-memory remember --global Answer style | Prefer concise answers.
|
|
359
|
+
/jarvis-memory remember Build choice | This project uses npm, not pnpm.
|
|
360
|
+
/jarvis-memory edit <id> Replacement fact, preserving the note's scope/title.
|
|
361
|
+
/jarvis-memory forget <id>
|
|
362
|
+
/jarvis-memory forget-all --confirm # this project's records only
|
|
363
|
+
/jarvis-memory forget-all --confirm --global
|
|
364
|
+
/jarvis-memory forget-all --confirm --all
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Put data scope flags **after the action**. `list --global` and `search --global …` restrict results to global records; `show --all <id>` and `forget --all <id>` explicitly allow another project's record. Lists and searches are bounded; narrow your query to find older records. Model-requested deletion is limited to one current/global record and requires human confirmation; commands above are explicit user actions. Confirmation is cancelled on observed permission change, abort or disposal, and a concurrently changed record must be reviewed again. Settings are rechecked at operation boundaries; other processes do not receive a live push notification.
|
|
368
|
+
|
|
369
|
+
### Storage and privacy
|
|
370
|
+
|
|
371
|
+
The store is `<agentDir>/extensions/pi-jarvis-memory/memory.sqlite`, with SQLite transaction/WAL coordination across processes. It is opened lazily; Node 22/24 may print an experimental SQLite warning on first actual use. On POSIX, the owned directory is mode `0700` and database mode `0600`; this is **local plaintext, not encryption or a sandbox**. Backups of your agent directory may include it.
|
|
372
|
+
|
|
373
|
+
Only newly finalized visible text is captured—not thinking blocks, tool results/calls, images, custom/system messages, failed/aborted assistant outputs, or old session files. Metadata-only event anchors are resolved after Pi's message-finalization/redaction hooks, at turn/settlement boundaries. Pending captures are discarded on permission/session changes or disposal, not replayed after re-enable. Recognizable credential blocks are omitted and common secret formats redacted, but **filtering is best-effort and cannot detect every sensitive detail**. Pause capture or disable memory for sensitive work. Notes containing detected secrets are rejected rather than silently changed. Oversized captures (over 16 KiB UTF-8) are omitted, not truncated into misleading facts; curated-note writes over that limit fail explicitly.
|
|
374
|
+
|
|
375
|
+
Retention is bounded to the newest 10,000 captured messages and 1,000 curated notes. Archive rollover never truncates Pi's original history; notes are not automatically discarded at their limit. Forgetting tombstones the record identity so the same captured event/scoped note title is not automatically restored; an explicit `remember` command can restore a forgotten title. This is not semantic erasure of every mention: other records, original Pi transcripts, already-sent model context and backups may still contain the fact. SQLite deletion is logical, **not forensic secure erasure**.
|
|
376
|
+
|
|
377
|
+
The combined live-record/tombstone budget is 100,000 identities: new identity saves fail at capacity rather than dropping deletion markers; existing records always reserve room for forgetting. First database open performs synchronous integrity checks and can briefly pause on a large archive. SQLite WAL files can temporarily grow while another process holds a reader snapshot; there is no strict total-directory disk quota. To completely reset/delete this local store without re-enabling memory, stop every Pi process using it, then remove only the `pi-jarvis-memory` directory yourself. This also removes tombstones, not original Pi transcripts.
|
|
209
378
|
|
|
210
379
|
---
|
|
211
380
|
|
|
@@ -231,7 +400,7 @@ Model and thinking settings resolve through the same config layers, then fall ba
|
|
|
231
400
|
2. global config: `~/.pi/agent/extensions/pi-jarvis.json` or the equivalent path under a custom Pi agent dir
|
|
232
401
|
3. built-in defaults: model `follow-main`, thinking `auto`
|
|
233
402
|
|
|
234
|
-
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
|
|
403
|
+
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 must be manually repaired: set/clear commands will not replace or delete a corrupt shared file and risk resetting memory privacy controls. Avoid simultaneous configuration writes from multiple Pi processes: cross-process locking is not implemented.
|
|
235
404
|
|
|
236
405
|
---
|
|
237
406
|
|
|
@@ -277,7 +446,7 @@ The compact header keeps main status, the side model, main focus, and permission
|
|
|
277
446
|
|
|
278
447
|
The multiline editor uses Pi's public editor and configured editing keybindings. Up/Down move within a draft; Up at the beginning of the first line (or in an empty editor) recalls prompts. Down past recalled prompts restores the draft. Pasted indentation and newlines are preserved, with Pi's normal tab-to-spaces normalization. Oversized drafts (over 64 KiB) and terminal-control payloads are rejected explicitly, never silently truncated or sent.
|
|
279
448
|
|
|
280
|
-
Unsent drafts survive closing and reopening `/jarvis` in the same running Pi session. They are not saved to disk. Side `/new`, main-session replacement, and switching to an unrelated side-session reference clear them; navigating the side tree only resets the transcript view. Closing still revokes
|
|
449
|
+
Unsent drafts survive closing and reopening `/jarvis` in the same running Pi session. They are not saved to disk. Side `/new`, main-session replacement, and switching to an unrelated side-session reference clear them; navigating the side tree only resets the transcript view. Closing still revokes all three overlay permissions; shared memory follows its separate persistent controls.
|
|
281
450
|
|
|
282
451
|
Scrollback follows new output until you scroll up. To bound rendering work, the overlay retains up to 500 recent entries and 512K UTF-16 code units of source text, with a 64K-unit per-entry limit. Omitted content is marked explicitly; these display limits do not modify persisted conversation history. Resizing preserves the reading position on a best-effort basis.
|
|
283
452
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ArchivePolicy, ArchiveScope } from "./archive-types.js";
|
|
2
|
+
type Scope = ArchiveScope;
|
|
3
|
+
/** Caller-spelled settings path, without I/O. Access canonicalizes only the chosen root. */
|
|
4
|
+
export declare function archiveConfigPath(cwd: string, agentDir: string, scope: Scope): string;
|
|
5
|
+
/** Reads settings only. Archiving defaults off; trust/read/validation failures disable every permission. */
|
|
6
|
+
export declare function resolveArchivePolicy(cwd: string, agentDir: string, trusted?: boolean): {
|
|
7
|
+
policy: ArchivePolicy;
|
|
8
|
+
errors: string[];
|
|
9
|
+
};
|
|
10
|
+
/** Merges only supplied fields into this scope; never materializes inherited/default values. */
|
|
11
|
+
export declare function saveArchivePolicy(cwd: string, agentDir: string, scope: Scope, patch: Partial<ArchivePolicy>): void;
|
|
12
|
+
/** Removes only archive controls. Corrupt files are never repaired or removed. */
|
|
13
|
+
export declare function clearArchivePolicy(cwd: string, agentDir: string, scope: Scope): void;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=archive-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archive-config.d.ts","sourceRoot":"","sources":["../archive-config.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEtE,KAAK,KAAK,GAAG,YAAY,CAAC;AAS1B,4FAA4F;AAC5F,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,CAGrF;AAED,4GAA4G;AAC5G,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,UAAO,GAAG;IACpF,MAAM,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAC;CACxC,CAoBA;AAED,gGAAgG;AAChG,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,CAOlH;AAED,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAMpF"}
|