@codemem/pi-extension 0.47.0-beta.2 → 0.47.0-beta.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.
package/README.md CHANGED
@@ -34,7 +34,7 @@ Build first so `dist/index.js` exists (`pnpm --filter @codemem/pi-extension buil
34
34
  - **Ingest** — ordinary session events (`session_start`, user/assistant messages, tool calls/results) prefer `POST /api/pi-hooks` (`source: "pi"`), with `codemem pi-hook-ingest` CLI fallback (spool on failure). Boundary events (`session_before_compact`, `session_shutdown`) always attempt the CLI path so a flush can run; failure is fail-open.
35
35
  - **Injection** — on pi's `context` event, appends a `## codemem memories` block to the latest user message of the **request copy** (never the system prompt, never the saved session). Older user messages replay the exact bytes already injected for them, and a new pack is fetched only for the latest undecided message, so the provider's prefix cache stays stable. Already-shown items are cut from new packs when the pack response carries renderer spans. A contract-valid HTTP or `pack --json` response, including a zero-item pack, ends that fetch; `{}` and error-shaped bodies fall through. Those span-bearing successes log `inject.pack.ok source=pi` to the plugin log, the same line `pi-hook-inject` writes when it is the fallback. Decisions live in memory: a restart fetches again.
36
36
  - **File context** — after a successful built-in `read`, related memories may be appended to that tool result. Failed reads and other tools are skipped.
37
- - **Tools** — registers the 14 `memory_*` tools natively (HTTP preferred, CLI fallback). Every HTTP operation first proves the viewer is target-aware (`GET /api/prompt-pack-profile` must report this process's `db_path` + `identity_target`) and re-sends the target on the query, so a foreign or stale older viewer on the port is never trusted (409 or unproven → targeted CLI path). Non-idempotent `memory_remember` does NOT CLI-replay on ambiguous HTTP failures (timeout/5xx/reset after send). No `pi-mcp-adapter` needed. Skipped when `pi.tools_mode` is `mcp-adapter`.
37
+ - **Tools** — registers the 15 `memory_*` tools natively (HTTP preferred, CLI fallback), including `memory_session_search` over stored Pi session text. Every HTTP operation first proves the viewer is target-aware (`GET /api/prompt-pack-profile` must report this process's `db_path` + `identity_target`) and re-sends the target on the query, so a foreign or stale older viewer on the port is never trusted (409 or unproven → targeted CLI path). Non-idempotent `memory_remember` does NOT CLI-replay on ambiguous HTTP failures (timeout/5xx/reset after send). No `pi-mcp-adapter` needed. Skipped when `pi.tools_mode` is `mcp-adapter`.
38
38
  - **Compaction** — `session_before_compact` attempts a flush only and never returns a custom summary. `session_compact` skips one new fetch only when `willRetry` is set and `reason` is not `manual`. Failed compaction, `agent_settled`, manual compaction, and a later user message clear that skip. A threshold compact skips only if that same guard matches.
39
39
  - **Fork/resume** — re-keys stream identity on every `session_start`. Ingest cursor metadata persists via `pi.appendEntry` (`codemem.cursor`). Recall decisions stay in memory and are cleared on `session_start`; a restart refetches.
40
40
  - **Cross-agent** — one shared, project-scoped store. Memories from OpenCode/Claude/Codex inject into pi and the reverse.
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  * - Injection → context event: cached framed block replayed onto older user
14
14
  * messages, one new pack appended to the latest user message of the request
15
15
  * copy (never the system prompt, never the saved session)
16
- * - Tools → pi.registerTool × 14 when pi.tools_mode === "native"
16
+ * - Tools → pi.registerTool × 15 when pi.tools_mode === "native"
17
17
  * - session_before_compact → flush only; it does not skip the next pack fetch
18
18
  * - session_compact with willRetry → one-shot replay skip for the immediate resume
19
19
  * - session_compact_failed, agent_settled, a non-resume compact, or a later user message clears that skip