chat-recall 0.6.4 → 0.6.6

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.
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env bash
2
+ # chat-recall decision guard — fires before a tool call runs.
3
+ #
4
+ # Reads the harness's pre-execution payload on stdin, asks the decision register
5
+ # whether this call reaches for something already ruled out, and prints the
6
+ # answer in that harness's own dialect. Registered as:
7
+ #
8
+ # Claude Code PreToolUse settings.json hooks
9
+ # Codex PreToolUse hooks.json / [hooks] in config.toml
10
+ # Antigravity PreToolUse .agents/hooks.json
11
+ # Cursor beforeShellExecution .cursor/hooks.json
12
+ #
13
+ # OpenCode uses a TypeScript plugin rather than a script; `chat-recall guard`
14
+ # is the same entry point there.
15
+ #
16
+ # ── Silence is the correct failure mode ─────────────────────────────────────
17
+ #
18
+ # Every failure path exits 0 with no output, and this file never blocks. A guard
19
+ # that errors is a guard that stops work it was never asked to judge, and the
20
+ # first time it does that somebody removes it — after which it protects nothing.
21
+ # The binary itself is written the same way.
22
+ #
23
+ # Env:
24
+ # CHAT_RECALL_BIN path to the binary (default: from PATH)
25
+ # CHAT_RECALL_GUARD_HARNESS claude | codex | agy | cursor | opencode
26
+ # CHAT_RECALL_GUARD=0 turn the guard off entirely
27
+ # CHAT_RECALL_GUARD_ENFORCE=1 block instead of warning (opt in; see below)
28
+
29
+ set -uo pipefail
30
+
31
+ # Off by request. Checked first so disabling costs nothing.
32
+ if [[ "${CHAT_RECALL_GUARD:-1}" == "0" ]]; then exit 0; fi
33
+
34
+ # stdin is the payload. Read it even when we are about to bail, or the harness
35
+ # can see a broken pipe on a hook that was only meant to be quiet.
36
+ INPUT="$(cat 2>/dev/null || true)"
37
+ [[ -z "$INPUT" ]] && exit 0
38
+
39
+ BIN="${CHAT_RECALL_BIN:-$(command -v chat-recall 2>/dev/null || true)}"
40
+ if [[ -z "$BIN" ]] || [[ ! -x "$BIN" ]]; then exit 0; fi
41
+
42
+ HARNESS="${CHAT_RECALL_GUARD_HARNESS:-claude}"
43
+
44
+ ARGS=(guard --harness "$HARNESS")
45
+ # Enforcement is opt-in and per machine. The default is a warning on every
46
+ # harness, because a wrong block burns the user's turn while a wrong warning
47
+ # costs a line of context — and only one of those gets the guard uninstalled.
48
+ if [[ "${CHAT_RECALL_GUARD_ENFORCE:-0}" == "1" ]]; then ARGS+=(--enforce); fi
49
+
50
+ # A hard ceiling on top of the binary's own timeout. This runs in front of every
51
+ # tool call, so the worst case has to be bounded by something the harness can
52
+ # rely on rather than by a network.
53
+ printf '%s' "$INPUT" | timeout 8 "$BIN" "${ARGS[@]}" 2>/dev/null || true
54
+ exit 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chat-recall",
3
- "version": "0.6.4",
3
+ "version": "0.6.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/munhq/chat-recall.git"
@@ -29,7 +29,7 @@ All tools are MCP tools on the `chat-recall` server, named
29
29
  **Reads are safe to call proactively. Writes are not.** Everything below is a
30
30
  read except these, which change stored memory or state — treat each as an edit
31
31
  and apply the test in `chat-recall-memory` before calling one:
32
- `recall_kg_add`, `recall_kg_invalidate`, `recall_decision_record`,
32
+ `recall_kg_add`, `recall_kg_invalidate`, `recall_decision_record`, `recall_decisions`,
33
33
  `recall_diary_write`, `recall_set`, `recall_task_create`, `recall_task_update`,
34
34
  `recall_task_comment`,
35
35
  `recall_task_policy`,
@@ -88,6 +88,7 @@ CLAUDE.md rule is additive and reversible, so take it; ask first before setting
88
88
  **Findings, ranked** — `recall_claude_suggestions` (every finding that becomes an agent-instruction change — the CLAUDE.md rules and skill installs — merged across account scope and every indexed project) and `recall_improvements` (everything else, most urgent first; `create_tasks: true` opens one team task per item). They split the same engines, so an item never appears in both. Neither needs the codeindex binary: without it you still get the account-level half.
89
89
  **What changed** — `recall_edits_timeline` (cross-tool edits), `recall_diff` (per-session diffs), `recall_commits` (did it actually land), `recall_markers` (where a session went sideways).
90
90
  **Durable memory / KG** — `recall_kg_query` / `recall_kg_add` / `recall_kg_invalidate` / `recall_kg_timeline` / `recall_kg_stats`, `recall_decision_record`, `recall_diary_write` / `recall_diary_read`, `recall_set` / `recall_get`.
91
+ **Decisions** — `recall_decisions` (what is already settled per area, cascade resolved; call it before choosing a library or a datastore).
91
92
  **Team** — `recall_tasks` (the shared task board), `recall_task_create`, `recall_task_update` (status, assignee, linked session; task ids look like `t_…`; when you start work on a task, set it `in_progress` and pass your session id as `linked_session_id` so the board can verify the work shipped), `recall_task_comment` (leave a progress note on a card), `recall_task_policy` (read or change WHAT the board files — severity floor, open-card ceiling, cards per run, categories, and the projects that never file at all via `exclude_project` — reach for that one when the user says "do not put work on my board for this repo", e.g. a client's codebase they keep separate; call it with no arguments to read, and reach for it when the user says "only security", "high and critical for now", or asks why a full board has stopped filing), `recall_team_activity` (per-teammate × per-project rollup), `recall_shares` (which projects are shared — private by default, nothing is visible to teammates until shared).
92
93
  **Toolkit sync across tools and devices** — `recall_toolkit_status` (which MCP servers, skills, commands and agents exist, on which tool, on which device — and which of them can be installed elsewhere at all), `recall_toolkit_sync` (queue an install: everything or one type, every device or one machine, or fan a machine's own artifacts across its own tools). Reach for these on "set up my other laptop", "get my MCPs everywhere", "why does this tool not have my skill".
93
94
 
@@ -26,11 +26,27 @@ future sessions inherit them.
26
26
  - `mcp__chat-recall__recall_diary_read` — prior agent diary entries (narrative
27
27
  notes across sessions). `mcp__chat-recall__recall_get` — a scoped key/value.
28
28
 
29
+ ## Check what is already decided (do this BEFORE you choose)
30
+
31
+ - `mcp__chat-recall__recall_decisions` — the decision register, cascade already
32
+ resolved: one value per area (auth, database, payments, deploy, pricing,
33
+ licensing…), what it replaced and when, and the session behind it. Call it
34
+ before picking a library, a datastore or an auth method. If the area is
35
+ already decided, follow it or say plainly that you are proposing a reversal.
36
+ It also returns `gaps` — areas nobody has decided, where you are free to
37
+ choose and should record the choice afterwards.
38
+
39
+ Project overrides beat account-wide decisions. A personal preference is
40
+ returned marked `advisory` and never overrides a team decision.
41
+
29
42
  ## Record new knowledge (do this when something non-obvious is decided)
30
43
 
31
44
  - `mcp__chat-recall__recall_decision_record` — an explicit decision (subject,
32
- decision, reason, importance). Shows up in future wake-up context. Use the
33
- moment you and the user agree on something a later session would need.
45
+ decision, reason, importance). **Pass `area`**: it is the key a reversal
46
+ supersedes on, so recording a new `auth` decision closes the previous one and
47
+ leaves every other area alone. Without it nothing the decision contradicts is
48
+ closed. Shows up in future wake-up context. Use the moment you and the user
49
+ agree on something a later session would need.
34
50
  - `mcp__chat-recall__recall_kg_add` — assert a fact triple
35
51
  (subject → predicate → object, optional `valid_from`). E.g.
36
52
  `("chat-recall", "uses", "Postgres")`.