pi-noodle 0.0.0-stage → 1.15.4

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.
Files changed (188) hide show
  1. package/AGENTS.md +153 -0
  2. package/LICENSE +21 -0
  3. package/README.md +150 -2
  4. package/dist/archive-config.d.ts +15 -0
  5. package/dist/archive-config.d.ts.map +1 -0
  6. package/dist/archive-config.js +338 -0
  7. package/dist/archive-config.js.map +1 -0
  8. package/dist/archive-crypto.d.ts +55 -0
  9. package/dist/archive-crypto.d.ts.map +1 -0
  10. package/dist/archive-crypto.js +274 -0
  11. package/dist/archive-crypto.js.map +1 -0
  12. package/dist/archive-extension.d.ts +40 -0
  13. package/dist/archive-extension.d.ts.map +1 -0
  14. package/dist/archive-extension.js +385 -0
  15. package/dist/archive-extension.js.map +1 -0
  16. package/dist/archive-import.d.ts +77 -0
  17. package/dist/archive-import.d.ts.map +1 -0
  18. package/dist/archive-import.js +341 -0
  19. package/dist/archive-import.js.map +1 -0
  20. package/dist/archive-keychain.d.ts +38 -0
  21. package/dist/archive-keychain.d.ts.map +1 -0
  22. package/dist/archive-keychain.js +102 -0
  23. package/dist/archive-keychain.js.map +1 -0
  24. package/dist/archive-migration.d.ts +13 -0
  25. package/dist/archive-migration.d.ts.map +1 -0
  26. package/dist/archive-migration.js +302 -0
  27. package/dist/archive-migration.js.map +1 -0
  28. package/dist/archive-secret-input.d.ts +106 -0
  29. package/dist/archive-secret-input.d.ts.map +1 -0
  30. package/dist/archive-secret-input.js +600 -0
  31. package/dist/archive-secret-input.js.map +1 -0
  32. package/dist/archive-service.d.ts +82 -0
  33. package/dist/archive-service.d.ts.map +1 -0
  34. package/dist/archive-service.js +690 -0
  35. package/dist/archive-service.js.map +1 -0
  36. package/dist/archive-sqlite.d.ts +35 -0
  37. package/dist/archive-sqlite.d.ts.map +1 -0
  38. package/dist/archive-sqlite.js +167 -0
  39. package/dist/archive-sqlite.js.map +1 -0
  40. package/dist/archive-store.d.ts +93 -0
  41. package/dist/archive-store.d.ts.map +1 -0
  42. package/dist/archive-store.js +1049 -0
  43. package/dist/archive-store.js.map +1 -0
  44. package/dist/archive-types.d.ts +58 -0
  45. package/dist/archive-types.d.ts.map +1 -0
  46. package/dist/archive-types.js +2 -0
  47. package/dist/archive-types.js.map +1 -0
  48. package/dist/archive-unlock.d.ts +68 -0
  49. package/dist/archive-unlock.d.ts.map +1 -0
  50. package/dist/archive-unlock.js +268 -0
  51. package/dist/archive-unlock.js.map +1 -0
  52. package/dist/archive-vault-files.d.ts +96 -0
  53. package/dist/archive-vault-files.d.ts.map +1 -0
  54. package/dist/archive-vault-files.js +854 -0
  55. package/dist/archive-vault-files.js.map +1 -0
  56. package/dist/archive-vault.d.ts +37 -0
  57. package/dist/archive-vault.d.ts.map +1 -0
  58. package/dist/archive-vault.js +1297 -0
  59. package/dist/archive-vault.js.map +1 -0
  60. package/dist/draft-editor.d.ts +55 -0
  61. package/dist/draft-editor.d.ts.map +1 -0
  62. package/dist/draft-editor.js +305 -0
  63. package/dist/draft-editor.js.map +1 -0
  64. package/dist/index.d.ts +3 -0
  65. package/dist/index.d.ts.map +1 -0
  66. package/dist/index.js +1839 -0
  67. package/dist/index.js.map +1 -0
  68. package/dist/legacy-aliases.d.ts +14 -0
  69. package/dist/legacy-aliases.d.ts.map +1 -0
  70. package/dist/legacy-aliases.js +98 -0
  71. package/dist/legacy-aliases.js.map +1 -0
  72. package/dist/main-context.d.ts +49 -0
  73. package/dist/main-context.d.ts.map +1 -0
  74. package/dist/main-context.js +645 -0
  75. package/dist/main-context.js.map +1 -0
  76. package/dist/main-session-state.d.ts +66 -0
  77. package/dist/main-session-state.d.ts.map +1 -0
  78. package/dist/main-session-state.js +235 -0
  79. package/dist/main-session-state.js.map +1 -0
  80. package/dist/memory-config.d.ts +21 -0
  81. package/dist/memory-config.d.ts.map +1 -0
  82. package/dist/memory-config.js +326 -0
  83. package/dist/memory-config.js.map +1 -0
  84. package/dist/memory-content.d.ts +26 -0
  85. package/dist/memory-content.d.ts.map +1 -0
  86. package/dist/memory-content.js +223 -0
  87. package/dist/memory-content.js.map +1 -0
  88. package/dist/memory-editor-controller.d.ts +28 -0
  89. package/dist/memory-editor-controller.d.ts.map +1 -0
  90. package/dist/memory-editor-controller.js +234 -0
  91. package/dist/memory-editor-controller.js.map +1 -0
  92. package/dist/memory-editor-types.d.ts +61 -0
  93. package/dist/memory-editor-types.d.ts.map +1 -0
  94. package/dist/memory-editor-types.js +2 -0
  95. package/dist/memory-editor-types.js.map +1 -0
  96. package/dist/memory-editor.d.ts +100 -0
  97. package/dist/memory-editor.d.ts.map +1 -0
  98. package/dist/memory-editor.js +1131 -0
  99. package/dist/memory-editor.js.map +1 -0
  100. package/dist/memory-extension.d.ts +12 -0
  101. package/dist/memory-extension.d.ts.map +1 -0
  102. package/dist/memory-extension.js +288 -0
  103. package/dist/memory-extension.js.map +1 -0
  104. package/dist/memory-service.d.ts +64 -0
  105. package/dist/memory-service.d.ts.map +1 -0
  106. package/dist/memory-service.js +488 -0
  107. package/dist/memory-service.js.map +1 -0
  108. package/dist/memory-store.d.ts +67 -0
  109. package/dist/memory-store.d.ts.map +1 -0
  110. package/dist/memory-store.js +955 -0
  111. package/dist/memory-store.js.map +1 -0
  112. package/dist/memory-types.d.ts +54 -0
  113. package/dist/memory-types.d.ts.map +1 -0
  114. package/dist/memory-types.js +10 -0
  115. package/dist/memory-types.js.map +1 -0
  116. package/dist/model-picker.d.ts +38 -0
  117. package/dist/model-picker.d.ts.map +1 -0
  118. package/dist/model-picker.js +158 -0
  119. package/dist/model-picker.js.map +1 -0
  120. package/dist/native-mcp.d.ts +50 -0
  121. package/dist/native-mcp.d.ts.map +1 -0
  122. package/dist/native-mcp.js +263 -0
  123. package/dist/native-mcp.js.map +1 -0
  124. package/dist/noodle-branding.d.ts +21 -0
  125. package/dist/noodle-branding.d.ts.map +1 -0
  126. package/dist/noodle-branding.js +86 -0
  127. package/dist/noodle-branding.js.map +1 -0
  128. package/dist/noodle-config.d.ts +27 -0
  129. package/dist/noodle-config.d.ts.map +1 -0
  130. package/dist/noodle-config.js +179 -0
  131. package/dist/noodle-config.js.map +1 -0
  132. package/dist/overlay-layout.d.ts +32 -0
  133. package/dist/overlay-layout.d.ts.map +1 -0
  134. package/dist/overlay-layout.js +212 -0
  135. package/dist/overlay-layout.js.map +1 -0
  136. package/dist/overlay.d.ts +172 -0
  137. package/dist/overlay.d.ts.map +1 -0
  138. package/dist/overlay.js +956 -0
  139. package/dist/overlay.js.map +1 -0
  140. package/dist/session-ref.d.ts +14 -0
  141. package/dist/session-ref.d.ts.map +1 -0
  142. package/dist/session-ref.js +33 -0
  143. package/dist/session-ref.js.map +1 -0
  144. package/dist/side-session.d.ts +108 -0
  145. package/dist/side-session.d.ts.map +1 -0
  146. package/dist/side-session.js +1221 -0
  147. package/dist/side-session.js.map +1 -0
  148. package/dist/storage-layout.d.ts +11 -0
  149. package/dist/storage-layout.d.ts.map +1 -0
  150. package/dist/storage-layout.js +61 -0
  151. package/dist/storage-layout.js.map +1 -0
  152. package/dist/storage-migration.d.ts +33 -0
  153. package/dist/storage-migration.d.ts.map +1 -0
  154. package/dist/storage-migration.js +218 -0
  155. package/dist/storage-migration.js.map +1 -0
  156. package/dist/transcript-viewport.d.ts +61 -0
  157. package/dist/transcript-viewport.d.ts.map +1 -0
  158. package/dist/transcript-viewport.js +174 -0
  159. package/dist/transcript-viewport.js.map +1 -0
  160. package/dist/watchers-check.d.ts +6 -0
  161. package/dist/watchers-check.d.ts.map +1 -0
  162. package/dist/watchers-check.js +129 -0
  163. package/dist/watchers-check.js.map +1 -0
  164. package/dist/watchers-config.d.ts +8 -0
  165. package/dist/watchers-config.d.ts.map +1 -0
  166. package/dist/watchers-config.js +195 -0
  167. package/dist/watchers-config.js.map +1 -0
  168. package/dist/watchers-extension.d.ts +18 -0
  169. package/dist/watchers-extension.d.ts.map +1 -0
  170. package/dist/watchers-extension.js +272 -0
  171. package/dist/watchers-extension.js.map +1 -0
  172. package/dist/watchers-render.d.ts +12 -0
  173. package/dist/watchers-render.d.ts.map +1 -0
  174. package/dist/watchers-render.js +76 -0
  175. package/dist/watchers-render.js.map +1 -0
  176. package/dist/watchers-service.d.ts +50 -0
  177. package/dist/watchers-service.d.ts.map +1 -0
  178. package/dist/watchers-service.js +352 -0
  179. package/dist/watchers-service.js.map +1 -0
  180. package/dist/watchers-types.d.ts +77 -0
  181. package/dist/watchers-types.d.ts.map +1 -0
  182. package/dist/watchers-types.js +9 -0
  183. package/dist/watchers-types.js.map +1 -0
  184. package/docs/archive-encryption-design.md +124 -0
  185. package/docs/storage-migration.md +78 -0
  186. package/docs/user-guide.md +915 -0
  187. package/docs/watchers-host-investigation.md +79 -0
  188. package/package.json +108 -4
package/AGENTS.md ADDED
@@ -0,0 +1,153 @@
1
+ # pi-noodle Agent Notes
2
+
3
+ ## Project Scope
4
+ - `pi-noodle` is a Pi extension that opens a `/noodle` 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`, `noodle-branding.ts`, `model-picker.ts`, `noodle-config.ts`, `session-ref.ts`, `memory-{types,config,content,store,service,extension,editor-types,editor,editor-controller}.ts`, and `archive-{types,config,store,service,extension,import,crypto,sqlite,keychain,unlock,secret-input,vault-files,vault,migration}.ts`.
6
+ - Current baseline: Pi 1.0.0 (`@earendil-works` packages), Node.js >=22.19.0. Older Pi hosts are not supported.
7
+
8
+ ## Current `/noodle-model` and `/noodle-thinking` Behavior
9
+ - `/noodle` requires `ctx.mode === "tui"`; other modes must not boot or prompt a hidden side session.
10
+ - `/noodle-model` with no request opens a searchable host-registry model picker in TUI mode; other modes report status.
11
+ - `/noodle-model <provider/model>` writes a project-scoped override to `.pi/jarvis.json`.
12
+ - `/noodle-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`).
13
+ - `/noodle-model [--project|--global] follow-main` stores a scoped `follow-main` override.
14
+ - `/noodle-model [--project|--global] clear` removes that scope's override so fallback applies.
15
+ - `/noodle-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
+ - `/noodle-thinking [--project|--global] clear` removes that scope's thinking override so fallback applies.
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. 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
+ - `auto` thinking follows main only when `/noodle` follows the main model; pinned `/noodle` models default to thinking `off`.
20
+ - `follow-main` thinking follows the main thinking level regardless of model selection, except xAI `/noodle` models force thinking `off`.
21
+ - `/compact`, `/tree`, and `/new` entered inside `/noodle` operate on the isolated `/noodle` side-session, not the main Pi session.
22
+ - `Note main` and `Redirect` stay disabled when the active `/noodle` model is incompatible with bridge tools.
23
+ - Published packages keep Pi runtime packages as optional peers, not bundled dependencies. Never load the legacy MCP adapter. Version 1.6.0 adds native MCP to Repo tools opt-in alongside 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. Ordinary overlay close hides presentation without stopping assigned work or clearing its three grants; cancel pending confirmations and refuse new invisible reviews. Grants are in-memory, scoped to the current main/side owner, not saved across restart/reload. Explicit access-off, observed trust denial, side `/new`, reference/main replacement and teardown revoke them. Archive private-input preparation explicitly revokes transient grants before closing/yielding.
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.
28
+
29
+ ## Overlay UX
30
+ - Closing presentation is distinct from stopping work. Keep background activity and enabled grants visible in main Pi; local `/noodle status`, `/noodle stop` and `/noodle access off` require no hidden side boot/model work. Stop cancels active work and clears waiting input, without replay/rollback promises. Main/side replacement and reload/quit still end background work; this is not a detached daemon.
31
+ - Compact header by default; Ctrl+O expands verbose focus/settings/diagnostics, PageUp/PageDown scroll transcript, Ctrl+End follows live, Ctrl+L dismisses notices. Keep permission states and focused controls visible while giving the conversation a distinct padded reading panel, bounded column width and quiet contextual hints. Use public theme APIs with readable light/dark/256-color fallbacks; never change user theme/renderer settings. Summarize informational notices without hiding warnings/errors. Regular-mode mouse scrolling belongs to the terminal, while supported fullscreen wheel events use the public component API.
32
+ - Model/thinking pickers stay inside the overlay, use the public physical-model registry and existing scoped config rules, and preserve draft state. Reject changes during active work before persistence; do not silently stop a turn or change the main model/thinking. Async picker results and configuration completions must be owner-bound and private-input-safe.
33
+ - Use Pi's public multiline Editor. Enter sends; Shift+Enter/Ctrl+J inserts newline. Preserve indentation and reject unsafe/oversized drafts (64 KiB) explicitly.
34
+ - Bridge-owned in-memory drafts survive close/reopen. Bridge reset clears draft/recall on side `/new` or main/side-reference replacement; side-tree navigation only resets scroll.
35
+ - Consume bracketed paste before global shortcuts and confirmation keys; pasted content must not toggle permissions or approve a redirect.
36
+ - Queue count excludes active work; processing includes boot and complete queue settlement. Keep activity separate from scrollback and never replay uncertain sends.
37
+ - Bound overlay history (500 entries, 512K UTF-16 units total, 64K per entry) with explicit omission notices; never truncate persisted history.
38
+
39
+ ## Branding intro (1.6.1)
40
+ - The first overlay for each main-session ID in the loaded extension shows a 1.8-second neon/chrome ASCII sweep, then returns to the compact UI. Reopen, side `/new`, tree navigation, and returning to an already-seen main session must not replay it. Reload/restart resets this in-memory bookkeeping.
41
+ - The intro is decoration, never a boot/queue gate. Keep editor, permissions, and activity available. Input dismisses it without being consumed; paste framing still precedes shortcuts. Confirmations and warnings/errors preempt it.
42
+ - Use a bounded, unreferenced, lazily started timer; stop on dismissal, expiry, or disposal. No blinking, flashing, terminal-clearing commands, transcript entries, or persisted session changes.
43
+ - Suppress with `PI_NOODLE_NO_ANIMATION=1` (legacy `PI_JARVIS_NO_ANIMATION=1` remains an alias), non-empty `NO_COLOR`, or `TERM=dumb`. Use compact/no intro on small terminals and readable palettes for light themes and 256-color output.
44
+ - `noodle-branding.ts` owns the original wordmark. `npm run render:branding` regenerates README SVGs with local renderer fixtures, not live provider/session data. Label fixture previews honestly.
45
+ - `npm run render:showcase` generates self-contained conceptual workspace/history/access SVGs; `npm run check:showcase` optionally uses an existing Playwright installation for loopback-only desktop/narrow/light/dark screenshots and text-bound checks. Keep browser dependencies out of the runtime package, distinguish conceptual diagrams from live UI, and preserve truthful defaults/privacy/close-versus-stop labels.
46
+
47
+ ## GitHub visual identity and feature priority (1.15.4)
48
+ - The README logo is Marc's supplied `docs/assets/pi-noodle-neon.gif`, copied unchanged. Respect browser reduced-motion preferences with static desktop/compact SVG fallbacks. Keep the editable vector master and feature diagrams; this is not a change to the terminal intro.
49
+ - Marc selects `noodle-neon-skull.png` as the visual reference: neon-outline skull, noodles and wordmark, not the white-filled icon variant. `docs/assets/noodle-logo-editable.svg` is the 14-layer vector master; its PNG comparison layer is hidden. Letter paths and live tagline/badge text stay editable.
50
+ - `npm run render:hero` removes that reference layer from the web exports and generates responsive heroes. `npm run render:overview` generates the explanatory diagrams. SVG exports have no raster embeds, external fonts, scripts or animation; the supplied GIF is the explicit animated header exception. Preserve the supplied art credit.
51
+ - Lead the landing page and GitHub About with memory, optional archive encryption, then side chat. Put detailed commands and limits in `docs/user-guide.md`. Keep plaintext memory, archive-only encryption, separate access controls and close-versus-stop visible; never imply encryption of original transcripts or an always-running daemon.
52
+ - Current owner/repository links use `rustytensor/pi-noodle`, including About homepage, description and topics. Preserve historical changelog/fixture text and frozen data identifiers. Check the whole page on desktop and narrow screens with local synthetic content; presentation work must not alter runtime behavior.
53
+
54
+ ## Native MCP (1.6.0)
55
+ - Use Pi's root-exported native factories, not private registry/runtime/transport internals. Noodle owns separate configured-server connections; main-only extension registrations are not inherited.
56
+ - No native startup/credential expansion while initially off. Respect project trust, enabled states, native tool exposures, and live Repo tools permission for direct/deferred/codemode/resource execution.
57
+ - Revocation invalidates permission generations, hides owned tools, aborts calls and invokes owned native shutdown. Stale prepared tools and late registrations cannot regain access after re-enable.
58
+ - Pi cancellation is best effort: already-started handshake/authentication/remote work may finish or time out after shutdown is requested. Do not promise immediate child teardown, rollback, or sandboxing.
59
+ - Keep server administration in main Pi. Disable codemode model helpers (`models: false`); preserve independent Note main/Redirect gates and the overlay-owned bridge subscription.
60
+ - Tests use temporary agent/workspace directories and local fixture servers only; never start real user MCP servers or resolve real credentials during validation.
61
+
62
+ ## Shared memory (1.7.0)
63
+ - Main Pi and the isolated Noodle 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.
64
+ - `/noodle-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.
65
+ - Inside the overlay, `/memory …` and `/noodle-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.
66
+ - 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.
67
+ - 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.
68
+ - 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.
69
+ - 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.
70
+ - 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.
71
+ - 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.
72
+
73
+ ## Curated memory editor
74
+ - `/noodle-memory editor` opens a human-only TUI overlay; `/memory editor` inside Noodle is intercepted locally before boot/provider/queue work. It manages only curated `kind=note` memories, including manual notes, not bounded conversation captures or the separate archive.
75
+ - Browse/search/filter/sort with bounded summary pages; inspect full text/provenance; create, duplicate, edit title/body/category/scope, and explicitly review saves and single/selected deletion. Full-off/untrusted/config errors deny reads and writes. Human administration remains available when only capture or recall is paused; never change those controls automatically.
76
+ - Create must not overwrite an existing scoped title. Renames/scope changes and reviewed deletions compare exact snapshots transactionally, retain tombstone/FTS/identity-budget semantics, and never replay uncertain writes. Forgotten titles require the existing explicit remember command rather than silent editor resurrection. Separate note-data notifications from policy invalidation so edits do not discard pending captures.
77
+ - Reserve editor modal ownership before closing/yielding Noodle. Coordinate with private archive input, model pickers and main memory-forget reviews; use live owner/cancellation checks at operation/transaction boundaries. Dispose/revocation rejects stale callbacks and clears local editor references; no auto-reopen or hidden model boot. Preserve ordinary close-versus-stop and archive finalization boundaries.
78
+ - Use public multiline editing, explicit size validation, paste-first shortcut/review handling, fresh visible confirmation and bounded small-screen layouts. Memory-editor Escape retains a possible split paste opener; Escape then Enter performs back/close, while another Escape only re-arms. Do not restore immediate lone-Escape exit or weaken all-page save/delete/discard review. Notes remain local plaintext, untrusted historical data; this is not a password vault or forensic erasure. No real memories, archives, credentials or providers in tests.
79
+
80
+ ## Optional full-session archive (1.8.0)
81
+ - `archive-{types,config,store,service,extension}.ts` implement an independent OFF-by-default archive, explicitly mounted in main and Noodle. 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.
82
+ - Separate settings: `<agentDir>/extensions/pi-jarvis-archive.json` and `.pi/jarvis-archive.json`, top-level `archive`. Controls default global. Settings writers may retry only a raced inode/unlink preflight read once under the existing cooperative lock; policy readers and locked-read races remain fail-closed, with no uncertain write replay. on/model-access on/model-search 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.
83
+ - Model-tool reach: `noodle_archive_search/read/session` default to the current session (scope "session", mapped to project + current session ID; store read gains a session filter so entry IDs cannot bypass the reach). Wider reaches (scope "current"/"all" or a foreign session ID) require one approval per request via Pi's normal confirmation (the Noodle lane bridges it through the overlay like `confirmForget`), or the standing `modelWideSearch` setting (`/noodle-archive model-search on --confirm-sensitive`, off by default, layered like model-access). A declined/unavailable approval returns one refusal sentence and executes nothing. Flipping the setting revokes prepared tool definitions. Session reach follows the current Pi session ID; pre-fork/pre-tree history is outside it (documented follow-up). Human CLI commands keep defaulting to this project.
84
+ - `/noodle-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.
85
+ - 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.
86
+ - Lazy private SQLite FTS5, plaintext by default at `<agentDir>/extensions/pi-jarvis-archive/archive.sqlite`; optional encryption selects a managed generation at `vaults/<UUID>/archive.sqlite` under that fixed root. 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. Inspection uses read-only schema snapshots and bounded observation of a version-zero, truly empty database while a concurrent creator initializes it; release each empty snapshot before waiting. Never let readers initialize/reset storage or retry record writes; unknown nonempty schemas reject.
87
+ - Explicit human single-file 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 automatic directory scans or legacy auto-migration. Scoped forget-session/prune require --confirm; tombstones stop identical entry resurrection, not all copies. Plaintext remains the default; optional archive-only encryption protects the active database/index/journals, not original transcripts/shared memory/retained plaintext backups. No sandbox, forensic erase, or hard total-disk-quota claims.
88
+ - 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.
89
+
90
+ ## Bulk archive import (1.9.0)
91
+ - `archive-import.ts` owns bounded discovery and the shared streaming reader. `/noodle-archive import-all [absolute-directory]` is an explicit metadata-only recursive preview, defaulting to `<agentDir>/sessions` (older Noodle side history lives under `<agentDir>/jarvis-sessions` and needs an explicit root). Require enabled recording/trust before scanning; never read transcript bodies or open archive records for preview. No startup scan, model import tool, or implicit history backfill.
92
+ - Confirmation requires `import-all --confirm-sensitive --preview <id>` and consumes the 10-minute preview once. Pin the exact reviewed set, root/directory/file identities and metadata; do not rescan or add newly discovered files. Bind to cwd/session and live permission/import generations; new previews replace old ones. Cancellation/revocation/session change stops remaining work, without replay or rollback promises.
93
+ - Bounded sequential discovery/import: 10,000 candidates, 50,000 entries visited, depth 64, approximately 8 MiB manifest. Skip nested symlinks, hardlinks and nonregular files. Fail incomplete/over-limit previews explicitly. Recheck opened FDs and directory identities, cap bulk reads at reviewed size, check mutation at streaming boundaries; do not claim a filesystem snapshot/sandbox.
94
+ - Preserve single-file import compatibility, v3/header provenance, dedup/conflict/tombstone semantics and partial counts. Per-file source failures continue; cancellation/permission/storage-wide failure stops the batch. Sources are never intentionally written. Tests use temporary synthetic session directories only.
95
+ - `import-report <id> [offset]` pages the latest ephemeral per-file report under the same project/session owner, with enabled archive but no model-access/capture requirement. Bound JSON output to 24,000 bytes, explicitly abbreviate oversized paths and preserve pagination progress. `import-cancel` cancels local imports/previews without changing settings and works while off. No persisted report or automatic context injection.
96
+
97
+ ## Optional archive encryption (1.10.0)
98
+ - Password-based archive encryption ships OPTIONAL/OFF by default, agent-wide and independent of archive enablement/capture/modelAccess, shared memory, Repo tools and bridge permissions. No automatic migration, history import, backfill or user-setting changes. Public/private-key support is deferred. `docs/archive-encryption-design.md` documents the shipped operating/security contract, not independent cryptographic certification.
99
+ - Safe setup is human-directed: review configured/effective status, trust and global/project overrides; if avoiding new plaintext archive captures, pause CAPTURE at the effective scope BEFORE enabling/migrating. Global capture off does not override project capture on; explicit global enabled=false blocks project on. Stop all other Pi instances, enable only the intended scope in a trusted project with capture still off, migrate/unlock, verify active storage and chosen plaintext cleanup, unlock again after cleanup, then resume capture explicitly. Never recommend or perform automatic user-control/renderer changes. This does not pause original Pi transcripts or shared memory.
100
+ - Human-only agent-wide syntax (no scope/password/key/path arguments): `/noodle-archive encryption [status]`; `encryption on|off|cleanup --confirm-sensitive --confirm-stopped`; `encryption recover --rollback --confirm-sensitive --confirm-stopped`; `encryption break-lock --confirm-sensitive --confirm-stopped`; `unlock [session|process|remember|for MINUTES|idle MINUTES]`; `lock`; `password`; `startup manual|prompt|remember`. Overlay `/archive` interception is local, without provider/boot/queue work; password entry closes Noodle and revokes its transient permissions. Enabled/trusted archive policy is required for unlock/migration/cleanup/data operations; capture/modelAccess may remain off. Status and explicit lock are available while access is paused.
101
+ - `encryption on` migrates to encrypted storage; `encryption off` converts to plaintext without disabling recording. Ordinary `/noodle-archive off` pauses archive reads/capture and revokes local access without decrypting/deleting files. Password change requires unlock, asks twice, rewraps the SAME data key and ends the local grant: it is not key rotation; old key/envelope backups may still unlock that key's data.
102
+ - Use a random 256-bit data key with authenticated password wrapping (fixed asynchronous scrypt and AES-256-GCM); encrypt the SQLite database and its FTS/journal/WAL content, not just message bodies. Ordinary encrypted operation has no temporary plaintext database; temp_store must be MEMORY. Passwords are valid Unicode, 1–4096 UTF-8 bytes, without controls/line breaks, with no trimming/normalization. Never fall back to plaintext, ordinary password input, unprotected key files or another credential backend after encryption/remembered-unlock failure.
103
+ - Native dependencies are exact-pinned optional packages, lazy loaded: `better-sqlite3-multiple-ciphers@13.0.3` and `@napi-rs/keyring@2.1.0`. Plaintext stays on node:sqlite. Linux glibc prebuilds require >=2.35; upstream advertises musl/macOS/Windows binaries, but local runtime validation is Linux-only. Remember uses the OS store (Linux explicitly Secret Service, no kernel-keyring downgrade); service/platform authorization applies. Missing/omitted/incompatible dependencies fail closed. Do not execute install scripts or auto-build/download fallback binaries at runtime. Tests use disposable native databases and fake keychains only, never real OS credentials/user archives; preserve host optional peers.
104
+ - Password entry supports ONLY public Pi regular TUI (`pi --tui-mode regular`); fullscreen/unknown/missing/non-TUI refuse. Never change user settings. EVERY submit/cancel, including typed-only Enter/Escape/Ctrl+C, requires a fresh displayed 12-symbol/60-bit code typed + Enter; paste cannot authorize completion. Passwords never enter arguments, environment variables, ordinary editors/history, tools, session entries, notifications or logs.
105
+ - Reserve private-input ownership synchronously before closing Noodle/yielding. Noodle/model-picker/main-memory-review admission must use the same gate through preparation, deferred mount, custom lifecycle and cancellation sink. Abort revokes backend work immediately but retains a cancel-only sink until fresh verified exit; never release merely because the backend promise resolves. Cancellable main switch/fork/tree navigation retains the sink and is refused until verified exit. Forced reload/quit/trusted external focus replacement cannot preserve quarantine: abandon without stale done or waiting; disclose this unsupported boundary. Bytes after verified release/host teardown and trusted screen/input/process code are outside protection; hostile input can deny service.
106
+ - Session leases belong to MAIN and are shared with Noodle; side /new and overlay close preserve them. Default unlock is session. Process/timed/persistent-local grants hand off only across supported main new/resume/fork, preserving fixed/idle deadlines; reload/quit/restart end local grants. Minutes are integers 1–10080. Timed grants check monotonic/wall clocks and access-boundary expiry; idle refreshes only on successful archive data operations, never status/policy checks. No immediate erasure during OS sleep.
107
+ - `unlock remember` authorizes a unique OS account containing the random key, not password, and selects startup remember; `startup remember` requires a live encrypted unlock. Default startup manual and startup prompt clear remembered authorization and lock locally; prompt requests session unlock only on permitted MAIN startup. Explicit nonremember unlock clears prior remembered authorization (remember startup becomes manual). Explicit lock revokes locally first, then durably clears/rotates remembered authorization before best-effort native deletion; report potentially remaining credentials or failed durable revocation honestly. Full-off/untrusted/config errors/restart-required state suppress startup prompts/credentials/authentication; trust restoration does not silently revive revoked grants. Noodle boot never restores credentials.
108
+ - Locked, transitional, invalid or restart-required vaults block record reads/capture/import/ordinary deletion. Rebaseline capture, cancel imports/previews and reject stale tools; never queue plaintext/backfill after unlock. Observe trust denials through shared policy to revoke keys/pending grants, not just hide tools. Observed durable revisions revoke at operation boundaries, not instant cross-process key erasure/push notification. Final side/main snapshots and side disposal precede boot-generation invalidation, so retiring-side cleanup cannot falsely revoke the main grant.
109
+ - Fixed root `<agentDir>/extensions/pi-jarvis-archive`, strict bounded Ready/Transition metadata `archive.vault.json` (64 KiB), cooperative `archive.vault.lock`, UUID generations `vaults/<UUID>/archive.sqlite`, max EIGHT distinct retired generations. Metadata/wrapping parameters/filesystem identities are not concealed. Canonicalize the selected root only; appended paths remain strict no-follow. Serialize managed operations; stop all other Pi instances, including older versions, before migration/recovery/cleanup. Never auto-steal locks, repair metadata, replay uncertain writes or treat confirm-stopped as stopping processes. Break-lock requires a demonstrably dead local PID on the same host plus identity/token rechecks.
110
+ - Source/active-file observation is stat-only: NEVER open/close another SQLite database/SHM descriptor to inspect a live file, since POSIX close can release the process's native transaction locks. Keep private owner/type/mode/nlink/ancestry and operation-local identity/presence checks. This is not an immutable filesystem snapshot.
111
+ - Throwing trust observations are denial and revoke keys/pending work, including direct policy/status paths. Mid-operation denial revokes immediately; restoring permission cannot reuse that grant. Recheck permits after lease.touch(), which may itself expire/revoke. Import counts retain acknowledged append outcomes despite later guard/release failure; never infer an uncertain COMMIT or retry a write.
112
+ - Stream/verify exact raw JSON spelling/index/provenance/rowids/tombstones to a DISTINCT target, checkpoint/close/fsync before publication, and retain sources until explicit cleanup (including plaintext). Check disk space for both copies; no hard disk-quota guarantee. Record initial legacy-source presence; missing/empty/unsafe/changed known sources require manual inspection/restoration and preservation of unpublished target/Transition, never empty publication or deletion of the only potential copy. An originally absent legacy source is distinct from loss; unknown prototype presence is handled conservatively.
113
+ - Cleanup deletes only recognized retired SQLite files, not active storage or outside backups. Preflight all candidates, auxiliaries before main, live authorization/source checks between deletions; failed cleanup can leave a PARTIAL retained backup, with metadata retained and no automatic uncertain-deletion replay. Encrypted cleanup requires a live lease and existing-active-DB authentication; never recreate a missing active database. Cleanup ends the local grant. Explicit recover --rollback is separate, source-checked, target-only recovery, not migration resume. Timed/idle grants cannot convert to plaintext; explicitly select session/process BEFORE key copying or Transition publication.
114
+ - Preserve native close uncertainty even before a factory returns its handle. Restart-required canonical-root poison survives new facades, aliases, main changes and logical reload/quit, with no unsafe eviction; ONLY ACTUAL PROCESS RESTART resets it. No startup credential/auth work or rollback/cleanup under poison. Grant only after successful lock release and fresh ownership checks. Uncertain publication may already have succeeded; require status/manual inspection/restart, never claim guaranteed Transition or retry automatically. Restart does not repair durable metadata, missing sources or pending transitions.
115
+ - Best-effort buffer wiping/file deletion is NOT forensic erasure. Encryption protects only active archive database/index/journals: original Pi transcripts, shared memory, attachments/exports, retained plaintext sources/backups, previously retrieved/provider context, swap/core dumps and same-user code remain outside the boundary. No sandbox, independently audited cryptography, official/vendor-audited SQLCipher, FIPS or independent certification claims.
116
+
117
+ ## Main-session watchers (1.14.0)
118
+ - `watchers-{types,config,check,service,extension}.ts` implement independent OFF-by-default main-only watchers. No side tools, automatic model polling, daemon, startup checks or interrupted-check replay. Require nonempty label/note; preserve notes in active-branch custom snapshots across compaction; report lost/overdue on resume, not successful completion while closed.
119
+ - Human `/noodle-watchers [--global|--project] status|on|off|clear|set FIELD INTEGER|cancel ID` defaults global for controls; overlay `/watchers` and `/noodle-watchers` intercept locally. Settings are separate `<agentDir>/extensions/pi-jarvis-watchers.json` / `.pi/jarvis-watchers.json`, top-level watchers; project > global > defaults except explicit global off is master-off. Invalid/untrusted/throwing trust pauses execution. clear removes settings only and fallback may re-enable. Lock contention fails without stealing/replaying writes.
120
+ - Limits default interval >=10s, timeout <=6h, <=5 jobs, check <=20s, output tail 500 UTF-16 units, metadata inventory <=2000 entries including root; hard config ceilings are in watchers-config.ts. Runtime metadata depth <=64 and approximately 8 MiB. Command exits 0=met, 1=not yet, other exits/signals/runtime failures=check failed. Missing file_lines is not yet; quiet missing/unreadable fails. Named targets reject symlink ancestry; recursive quiet does not follow targets and observes metadata only, not successful completion or a filesystem snapshot.
121
+ - Launch-time fallback is intentional: first check via ctx.executeTool('bash') INSIDE noodle_watcher_set; deny/changed/unverifiable launch refuses. Use Pi's public tool renderer expanded flag (normal Ctrl+O, respect existing preferences): compact launch/progress/final blocks show label, plain-language condition, interval/time limit, cwd and exact command line count; expanded displays the COMPLETE immutable command including foreground supervisor without abbreviation/reformatting. Use semantic accent, not success/added-code green or hard-coded colour. Pi 1.0.0/1.1.0 suppresses a separate transcript row for nested bash (parentToolCallId), so do not override/re-register bash or change hook/approval arguments for presentation; repeat its exact bytes and cwd via local pi.exec('/bin/sh', ['-c', command]). Never capture a returned tool context for idle calls or use private host APIs. Repeats do NOT pass bash hooks, custom backends, prefixes, result redactors or session environment. No per-check approval/isolation claim. Raw pi.exec alone does not reliably enforce bounded output/process-tree termination.
122
+ - Custom notifications use triggerTurn=true/deliverAs=followUp, explicitly disclaim user authorship/approval and treat output/notes as untrusted. Pi projects custom content to user role; no impossible-to-confuse/authenticated-role claim. Mark sends before submission, report uncertainty, never automatically retry. Cancellation cannot retract queued notices or undo effects. Lifecycle stops jobs; host SIGKILL/escaped descendants are outside best-effort supervisor cleanup. POSIX only; local Linux validation only.
123
+ - Register the watcher extension only AFTER all existing Noodle/main memory/archive lifecycle handlers. Preserve the v1.13.1 synchronous owner/queue invalidation prefix at every boundary, even with watchers off; an earlier synchronous handler still adds an awaited dispatch boundary. Never weaken the original owner/queue regression tests.
124
+ - Watcher launch admission reserves synchronous setup state; block competing Noodle/modal/private interactions. Modal/private ownership defers repeats/notices but not deadlines. Model tools recheck live policy/owner/cancellation, reject stale prepared definitions, and stop incompatible jobs rather than alter approved commands. Footer/status remain separate from side stop/access meanings. Test only temporary synthetic files, fake clocks and fixture providers, never user credentials/archives/MCP.
125
+
126
+ ## Rename compatibility and optional storage migration (1.15.0)
127
+ - Public commands/tools use noodle; `legacy-aliases.ts` preserves old names and hides live alias declarations through the public loadout API, never exposure:hidden while enabled. Revocation and execution guards apply equally to aliases. Legacy animation opt-out remains supported.
128
+ - Storage names remain legacy unless a human explicitly runs the offline `pi-noodle-migrate` utility. `storage-layout.ts` selects new names only after a valid marker; malformed markers fail closed. `storage-migration.ts` requires stopped instances and reviewed input, copies and verifies before activation, retains originals and old credentials, and refuses conflicts or unfinished work. See `docs/storage-migration.md`.
129
+ - Keep stored schema lanes, custom-entry types, opaque record identities and authenticated format tags unchanged. Never rewrite historical conversation text. Translate old side-session references only inside the known side-session root.
130
+ - Marc delegates routine reversible choices for this rename; do not interrupt for ordinary implementation or fixture issues. Stop for a failed gate as requested. Real-data migration remains separately gated by explicit approval after Pi sessions are stopped.
131
+
132
+ ## Git and Release Policy
133
+ - 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.
134
+ - 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` and pass the secret scan before pushing. Do not move or replace existing tags or rewrite shared history.
135
+ - This open-source project pushes every commit and its annotated stable version tag to BOTH GitHub and git.servorra.com immediately after tagging and validation. Push only the current branch and its tags, atomically on each remote; there is no cross-server atomicity. Use existing configured remotes; never add or change a remote without Marc's approval. Report a failed push and which remote succeeded; never force-push or rewrite history to reconcile them. npm publication remains manual.
136
+ - Marc approved renaming the GitHub repository to `rustytensor/pi-noodle` and updating its remote/links. GitHub pushes remain approved; the git.servorra.com push is explicitly deferred until Marc supplies its repository URL. npm publication remains manual.
137
+ - Prefer fast-forwarding the exact validated commits to `main`; a new merge commit also requires its own version bump and tag. Every pushed `vX.Y.Z` tag triggers validated GitHub release packaging; npm publication remains manual.
138
+ - Stable-only CI enforcement starts after historical baseline `4b6b4e6`, preserving already-pushed history. Branch/PR jobs validate on Node 22.19.0 and 24 and reject missing, lightweight, prerelease, or SHA-only version coverage. Each new tag must match that commit's package metadata, lockfile, README, and changelog.
139
+ - Existing release assets must not be overwritten with differing bytes. See `RELEASING.md` for branch/tag protection and merge/fork constraints; CI alone cannot prevent administrator bypass.
140
+
141
+ ## Validation
142
+ - Run `npm test` for full validation.
143
+ - Run `npm run build` before release packaging.
144
+ - Run `npm run verify:release` to validate npm pack payload and release metadata expectations.
145
+ - Run `npm run check:tags` after tagging commits to validate annotated-tag policy.
146
+
147
+ ## Docs To Keep In Sync
148
+ - `README.md`
149
+ - `docs/user-guide.md` (complete controls, limits and privacy boundaries)
150
+ - `docs/branding.md` when artwork or page presentation changes
151
+ - `CHANGELOG.md`
152
+ - `package.json` version
153
+ - this `AGENTS.md` when command/config behavior changes
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Marc Mironescu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,151 @@
1
- # Temporary Holding Version
1
+ pi-noodle: your Pi agent's inner voice and memory.
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <div align="center">
4
+
5
+ <picture>
6
+ <source media="(prefers-reduced-motion: reduce) and (max-width: 760px)" srcset="https://raw.githubusercontent.com/rustytensor/pi-noodle/main/docs/assets/noodle-hero-compact.svg">
7
+ <source media="(prefers-reduced-motion: reduce)" srcset="https://raw.githubusercontent.com/rustytensor/pi-noodle/main/docs/assets/noodle-hero.svg">
8
+ <img src="https://raw.githubusercontent.com/rustytensor/pi-noodle/main/docs/assets/pi-noodle-neon.gif" alt="pi-noodle: a neon skull bowl, noodles becoming a voice, and the Noodle wordmark" width="880">
9
+ </picture>
10
+
11
+ ## Remember what matters. Keep your train of thought.
12
+
13
+ **Shared memory. Optional archive encryption. A side chat beside your main task.**
14
+
15
+ [Memory](#shared-memory) · [Encryption](#optional-archive-encryption) · [Side chat](#side-chat) · [Install](#quick-start) · [Full guide](docs/user-guide.md)
16
+
17
+ ```bash
18
+ pi install npm:pi-noodle
19
+ ```
20
+
21
+ <p><strong>Current version:</strong> 1.15.4</p>
22
+
23
+ [Editable SVG logo](docs/assets/noodle-logo-editable.svg) · [Releases](https://github.com/rustytensor/pi-noodle/releases) · [Issues](https://github.com/rustytensor/pi-noodle/issues)
24
+
25
+ </div>
26
+
27
+ **What is it?** pi-noodle is an extension for [Pi, the terminal coding agent](https://github.com/earendil-works/pi). It gives main Pi and its side conversation a shared place to remember useful facts, an optional searchable history archive, and a separate space to ask questions without replacing the main task.
28
+
29
+ **Know the defaults:** shared memory is **on in trusted projects** and stored in **local plaintext**. Recalled facts can reach your active model. The archive, encryption, watchers and side-chat tool/bridge grants start **off**. Nothing is silently imported or encrypted.
30
+
31
+ ## Shared memory
32
+
33
+ **Stop explaining the same project decisions in every session.** Save preferences, corrections and useful references once; make them available to both main Pi and Noodle.
34
+
35
+ <picture>
36
+ <source media="(max-width: 760px)" srcset="https://raw.githubusercontent.com/rustytensor/pi-noodle/main/docs/assets/noodle-memory-flow-compact.svg">
37
+ <img src="https://raw.githubusercontent.com/rustytensor/pi-noodle/main/docs/assets/noodle-memory-flow.svg" alt="Main Pi and the side chat share local memory. You review and edit notes. Relevant facts can return to either conversation; memory is plaintext." width="960">
38
+ </picture>
39
+
40
+ *Conceptual flow, not a live UI. Memory works even when the side-chat window is closed.*
41
+
42
+ - **Remember useful facts:** project notes for local decisions; global notes for preferences you deliberately want across projects.
43
+ - **Find them again:** bounded automatic recall and local keyword search, without embeddings or background model jobs.
44
+ - **Stay in control:** inspect provenance, edit curated notes, review deletion, or pause saving and recall separately.
45
+ - **Go beyond notes:** the separate, opt-in archive can search recorded conversations and tool output, or explicitly import older Pi sessions.
46
+
47
+ Try a synthetic project note:
48
+
49
+ ```text
50
+ /noodle-memory remember Build workflow | This project uses npm, not pnpm.
51
+ /noodle-memory search Build workflow
52
+ /noodle-memory editor
53
+ ```
54
+
55
+ Memory is **reference material, not higher-priority instructions**. Recall is bounded, not perfect; do not store passwords or tokens in it. [Memory controls and privacy](docs/user-guide.md#shared-memory) · [Editor preview](docs/assets/noodle-memory-editor.svg)
56
+
57
+ <a id="full-session-archive"></a>
58
+
59
+ ## Optional archive encryption
60
+
61
+ **Keep a searchable archive, and choose whether to encrypt it on disk.** The archive is separate from shared memory. Recording, model access and encryption are independent opt-ins.
62
+
63
+ <picture>
64
+ <source media="(max-width: 760px)" srcset="https://raw.githubusercontent.com/rustytensor/pi-noodle/main/docs/assets/noodle-encryption-flow-compact.svg">
65
+ <img src="https://raw.githubusercontent.com/rustytensor/pi-noodle/main/docs/assets/noodle-encryption-flow.svg" alt="Optional encryption protects the active archive database, search index and SQLite journals. Shared memory, original Pi transcripts and retained plaintext copies are outside that boundary. Retrieved text can reach a model." width="960">
66
+ </picture>
67
+
68
+ *Conceptual protection boundary. This is archive encryption, not end-to-end encryption.*
69
+
70
+ - **Protect the active archive:** its database, search index and SQLite journals—not just individual message bodies.
71
+ - **Choose how to unlock:** a password, a session/process grant, a time limit, or an explicitly remembered key in the OS credential store.
72
+ - **Search when permitted:** human inspection and model access have separate controls; encrypted storage does not prevent authorized reads from reaching a model provider.
73
+
74
+ **What it does not encrypt:** shared memory, Pi's original transcripts, attachments, exports and retained plaintext copies. The archive can contain sensitive unredacted content. This is not a sandbox or independently audited cryptography.
75
+
76
+ <a id="safe-initial-setup"></a>
77
+
78
+ **Read the [safe setup instructions](docs/user-guide.md#safe-initial-setup) before enabling recording or migrating.** Pause effective capture first if you want to avoid new plaintext archive captures. Password entry requires Pi's regular TUI; native-library and OS requirements apply. Existing plaintext sources remain until you explicitly clean them up.
79
+
80
+ [Archive search and import](docs/user-guide.md#full-session-archive) · [Encryption, unlock and recovery](docs/user-guide.md#optional-archive-encryption) · [Technical security boundary](docs/archive-encryption-design.md)
81
+
82
+ <a id="overlay-controls"></a>
83
+
84
+ ## Side chat
85
+
86
+ **Ask a question without replacing the main conversation.** Open `/noodle` for a separate thread that receives a summary and bounded recent context from main Pi.
87
+
88
+ <picture>
89
+ <source media="(max-width: 760px)" srcset="https://raw.githubusercontent.com/rustytensor/pi-noodle/main/docs/assets/noodle-side-chat-flow-compact.svg">
90
+ <img src="https://raw.githubusercontent.com/rustytensor/pi-noodle/main/docs/assets/noodle-side-chat-flow.svg" alt="Main Pi supplies bounded context to the side chat. Repo tools, Note main and Redirect start off. Enabled notes and separately reviewed redirects can go back to main. Closing does not stop work." width="960">
91
+ </picture>
92
+
93
+ *Conceptual flow. Separate conversations are not a privacy sandbox; shared memory has its own controls.*
94
+
95
+ ```text
96
+ /noodle explain the last validation failure and suggest what to check next
97
+ ```
98
+
99
+ Use the main model or choose another physical model with **F2**; adjust thinking with **F3**. Enable repository tools only when wanted. **Note main** sends a quiet follow-up when enabled; **Redirect** requires review for every send.
100
+
101
+ **Close is not stop.** Assigned work and enabled grants can continue after closing the panel. `/noodle status`, `/noodle stop` and `/noodle access off` keep control available without reopening it. Restart/reload ends background work; this is not a daemon.
102
+
103
+ [Side-chat controls](docs/user-guide.md#overlay-controls) · [Model selection](docs/user-guide.md#model-and-thinking-resolution) · [Overlay preview](docs/assets/noodle-overlay.svg)
104
+
105
+ ## Quick start
106
+
107
+ 1. Install with `pi install npm:pi-noodle`, then restart or reload Pi.
108
+ 2. Read the first-use memory notice. Use `/noodle-memory` to inspect effective controls, or `/noodle-memory off` to pause memory without deleting data.
109
+ 3. Try the memory commands above or open `/noodle`. Enable archive recording, encryption and extra tools only when you choose.
110
+
111
+ Requires **Pi 1.0.0 or newer** and **Node.js 22.19.0 or newer**. Pi supplies the host runtime and model authentication; this package does not install another copy of Pi. Encryption has optional native dependencies; local runtime validation is Linux-only.
112
+
113
+ <a id="two-complementary-memory-features"></a>
114
+
115
+ ### What starts on—and what stays off
116
+
117
+ | Feature | Default | Important boundary |
118
+ |---|---|---|
119
+ | Shared memory | **On in trusted projects** | Local plaintext; recalled facts may reach your active model. |
120
+ | Session archive | **Off** | Separate store; no silent backfill or import. |
121
+ | Archive encryption | **Off** | Protects only the active archive; does not turn recording on. |
122
+ | Model archive access | **Off** | Separate opt-in; wider searches need approval or an explicit standing setting. |
123
+ | Repo tools, Note main, Redirect | **Off** | Separate grants; redirects also need per-send confirmation. |
124
+
125
+ ## Also included
126
+
127
+ <a id="main-session-watchers"></a>
128
+
129
+ | Capability | What it adds |
130
+ |---|---|
131
+ | [Watchers](docs/user-guide.md#main-session-watchers) | Bounded local checks can wake an idle main agent, without model polling. Off by default; the wake-up model turn can cost tokens. |
132
+ | [Native MCP](docs/user-guide.md#native-mcp) | Use configured external tools and services through Pi when Repo tools is enabled. |
133
+ | [History import](docs/user-guide.md#import-all-existing-pi-sessions) | Preview and explicitly approve existing session files; inspect duplicates and partial results. |
134
+ | [Memory editor](docs/user-guide.md#curated-memory-editor) | Browse, search, correct and organize curated notes with visible save/delete reviews. |
135
+
136
+ ## Renamed from pi-jarvis
137
+
138
+ The old `/jarvis*` commands and `jarvis_*` tools still work as aliases. Saved memory, archives, watchers and side-session references remain compatible. Remove the old extension before loading pi-noodle; do not load both together.
139
+
140
+ Storage keeps its legacy names unless you explicitly use the [offline storage migration utility](docs/storage-migration.md). No migration is required to use the renamed extension. Historical records and authenticated format tags are not blindly rewritten.
141
+
142
+ ## Go deeper
143
+
144
+ - [Complete user guide and command reference](docs/user-guide.md)
145
+ - [Archive encryption design](docs/archive-encryption-design.md)
146
+ - [Editable logo, layers and artwork generation](docs/branding.md)
147
+ - [Release process](RELEASING.md) · [Changelog](CHANGELOG.md) · [MIT code license](LICENSE)
148
+
149
+ Maintained at **[rustytensor/pi-noodle](https://github.com/rustytensor/pi-noodle)**. npm publication is manual.
150
+
151
+ Logo adapted from 'Death Ramen Skull Bowl Logo' by gagavastard (Envato Elements).
@@ -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;AAGtE,KAAK,KAAK,GAAG,YAAY,CAAC;AAa1B,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"}