@hypercarrier/rarebit 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +41 -1
- package/RUNBOOK.md +7 -5
- package/package.json +1 -1
- package/scripts/e2e-recall-pi0842.mjs +31 -13
- package/scripts/e2e-view-pi.mjs +500 -0
- package/src/extension.mjs +50 -14
- package/src/rarebit-command.mjs +5 -0
- package/src/rarebit-recall.mjs +39 -27
- package/src/rarebit-recap.mjs +2 -1
- package/src/rarebit-settings-ui.mjs +2 -0
- package/src/rarebit-view.mjs +426 -0
- package/test/rarebit-command.test.mjs +10 -2
- package/test/rarebit-recall.test.mjs +84 -41
- package/test/rarebit-view.test.mjs +270 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0 — 2026-10-07
|
|
4
|
+
|
|
5
|
+
- Replace Recall's hour-bucketed `rarebit_conversation/v1` with a flat
|
|
6
|
+
`rarebit_conversation/v2` message list. Each message has `seq`, `round`,
|
|
7
|
+
`role`, `kind`, second-precision UTC `time`, and `text`. Detailed evidence
|
|
8
|
+
occurrences gain the same `seq` join key.
|
|
9
|
+
- Add the conversation schema and `jq` tail queries to the Recall message.
|
|
10
|
+
|
|
11
|
+
## 0.3.0 — 2026-10-04
|
|
12
|
+
|
|
13
|
+
- Add `/rarebit view [context|all|peek|off]` and a View action in the palette.
|
|
14
|
+
Read active-branch Rarebits across compactions, or keep the editor live in
|
|
15
|
+
peek.
|
|
16
|
+
- Add scroll and smartcase search controls, toggle/cycle shortcuts with Super
|
|
17
|
+
aliases, and active-view status. First toggle opens all; off clears status.
|
|
18
|
+
- Add the experimental context view with capability checks and an all-view
|
|
19
|
+
fallback. It relies on unsupported Pi internals and can break after updates.
|
|
20
|
+
- Reset views on Session replacement, reload, and shutdown. Verify views on
|
|
21
|
+
Pi 0.84.2 and 1.0.0; component wheel input requires a supporting fullscreen
|
|
22
|
+
host.
|
|
23
|
+
- Stop retained Recap entries from reading a closed Session after shutdown or
|
|
24
|
+
`/resume`.
|
|
25
|
+
|
|
3
26
|
## 0.2.1 — 2026-09-29
|
|
4
27
|
|
|
5
28
|
- Move Recap into the scrollable transcript using native custom-entry renderers,
|
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ an existing Summary in the Pi TUI.
|
|
|
52
52
|
```text
|
|
53
53
|
long Pi Session
|
|
54
54
|
└─ Distill: selected active-branch prose
|
|
55
|
-
├─ Catch up: read the conversation
|
|
55
|
+
├─ Catch up: read the conversation through CLI extract or Pi view
|
|
56
56
|
├─ Recall: let an agent use the selection for one request
|
|
57
57
|
├─ Fork: start a new native Pi Session from a bounded suffix
|
|
58
58
|
└─ Summary / Title: optional model-derived projections
|
|
@@ -72,6 +72,46 @@ records. Selection is deterministic. It is not model summarization. Each
|
|
|
72
72
|
selected occurrence keeps its source entry, branch position, role, outcome,
|
|
73
73
|
timestamp when available, and lineage.
|
|
74
74
|
|
|
75
|
+
#### Read in the Pi TUI
|
|
76
|
+
|
|
77
|
+
Use `/rarebit view` beside CLI `extract` to read the current Session without a
|
|
78
|
+
model call. The command opens a picker. Choose a view directly with
|
|
79
|
+
`/rarebit view [context|all|peek|off]`:
|
|
80
|
+
|
|
81
|
+
- **all** reads every Rarebit on the active branch across compactions. Each
|
|
82
|
+
compaction has a marker. This is the first-toggle default.
|
|
83
|
+
- **peek** reads that same branch while you type in the editor. It stays open
|
|
84
|
+
on submit. Replies appear when finished. It reserves a fixed seven-row dock;
|
|
85
|
+
a tall multiline editor can overlap the view.
|
|
86
|
+
- **context** is experimental. The context view filters Pi's own transcript.
|
|
87
|
+
It depends on how Pi draws the transcript, which Pi does not guarantee for
|
|
88
|
+
extensions, so a Pi update can disable it. Rarebit then reports that the
|
|
89
|
+
context view is unavailable on this Pi version; the all and peek views keep
|
|
90
|
+
working. Context shows only Rarebits after the last compaction; use all to
|
|
91
|
+
read across compactions. It keeps Pi's compaction summary and Rarebit Recaps
|
|
92
|
+
visible.
|
|
93
|
+
- **off** restores the normal transcript and removes the view status line.
|
|
94
|
+
|
|
95
|
+
In `all`, use j/k or ↑/↓ for lines, u/d or Ctrl+U/Ctrl+D for half pages,
|
|
96
|
+
b/Space for pages, and g/G for the ends. Search with `/` or `?`, then repeat
|
|
97
|
+
with n/N. Search ignores case unless the query has an uppercase letter. Esc
|
|
98
|
+
clears a search before it closes the view; q closes it. Mouse wheel scrolling
|
|
99
|
+
requires fullscreen Pi with component mouse-event support. Pi 0.84.2 does not
|
|
100
|
+
provide that support; Pi 1.0.0 does. In `peek`, keyboard input goes to the
|
|
101
|
+
editor.
|
|
102
|
+
|
|
103
|
+
Ctrl+Alt+R toggles the view. Ctrl+Alt+N cycles context → all → peek. The
|
|
104
|
+
Ctrl+Super+R/N aliases support terminals that report the Super modifier through
|
|
105
|
+
Kitty keyboard sequences. Later toggles reopen the last used view. Extension
|
|
106
|
+
shortcuts cannot be rebound in `keybindings.json`; `/rarebit view` is the
|
|
107
|
+
fallback. Close `all` before using Ctrl+Alt+G to acknowledge a Recap.
|
|
108
|
+
|
|
109
|
+
The status line names the active view. The palette's **View** action opens the
|
|
110
|
+
picker. Opening the Rarebit palette or settings closes the view. Session
|
|
111
|
+
replacement, reload, and shutdown reset it to off. Turn it off before changing
|
|
112
|
+
TUI mode. The views are verified on Pi 0.84.2 and 1.0.0. Other versions use
|
|
113
|
+
capability checks and can report an unavailable view.
|
|
114
|
+
|
|
75
115
|
### 2. Recall for the agent
|
|
76
116
|
|
|
77
117
|
In Pi, run:
|
package/RUNBOOK.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# Rarebit runbook
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
To release, merge the version bump and its [CHANGELOG.md](CHANGELOG.md) entry
|
|
4
|
+
to `main`, run `git-privacy-scan --ref HEAD history`, then push tag
|
|
5
|
+
`v<version>`. The tag push runs
|
|
6
|
+
[`.github/workflows/publish.yml`](.github/workflows/publish.yml). It runs the
|
|
7
|
+
package gates, publishes one verified packed artifact with npm provenance, and
|
|
8
|
+
creates the GitHub Release. A prerelease version goes to npm `next`; any other
|
|
9
|
+
version goes to `latest`. Publication adds no commit.
|
|
8
10
|
|
|
9
11
|
Set `rarebit.model` in global Pi settings or in a trusted Project's
|
|
10
12
|
`.pi/settings.json`. It must be `provider/model` or an object with `provider`
|
package/package.json
CHANGED
|
@@ -18,29 +18,47 @@ async function waitFor(predicate, label, timeout = 2_000) {
|
|
|
18
18
|
function expectedRecallMarkdown(conversationPath, detailedPath, request) {
|
|
19
19
|
return `# Rarebit Recall
|
|
20
20
|
|
|
21
|
-
*Use these local private
|
|
21
|
+
*Answer the **Current request** below. Use these local private files to recover earlier context from this Session.*
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Files
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
2. Read **Conversation** first for meaning.
|
|
27
|
-
3. Use **Detailed evidence** only for source, Session, branch, or lineage facts.
|
|
28
|
-
4. Answer the current request using this evidence.
|
|
29
|
-
|
|
30
|
-
## Local private evidence files
|
|
31
|
-
|
|
32
|
-
**Conversation** — \`rarebit_conversation/v1\`
|
|
25
|
+
**Conversation** — \`rarebit_conversation/v2\`. Read this first.
|
|
33
26
|
|
|
34
27
|
\`\`\`text
|
|
35
28
|
${conversationPath}
|
|
36
29
|
\`\`\`
|
|
37
30
|
|
|
38
|
-
**Detailed evidence** — \`rarebit_message_recall/v1\`
|
|
31
|
+
**Detailed evidence** — \`rarebit_message_recall/v1\`. Use it only for source, Session, branch, or lineage facts. Join on \`seq\`.
|
|
39
32
|
|
|
40
33
|
\`\`\`text
|
|
41
34
|
${detailedPath}
|
|
42
35
|
\`\`\`
|
|
43
36
|
|
|
37
|
+
## Conversation schema
|
|
38
|
+
|
|
39
|
+
\`\`\`text
|
|
40
|
+
{ messageCount, lastRound, messages: [{ seq, round, role, kind, time, text }] }
|
|
41
|
+
seq 1-based, oldest first
|
|
42
|
+
round increments at each user message; agent messages before the first user message have round 0
|
|
43
|
+
role "user" | "agent"
|
|
44
|
+
kind "request" (user) | "progress" (agent text before a tool call) | "reply" (agent final answer)
|
|
45
|
+
time UTC "YYYY-MM-DDTHH:MM:SSZ", or null
|
|
46
|
+
\`\`\`
|
|
47
|
+
|
|
48
|
+
Messages contain user and agent text only. Tool calls and tool results are excluded.
|
|
49
|
+
|
|
50
|
+
## Example queries
|
|
51
|
+
|
|
52
|
+
Set \`F\` to the Conversation path. Read the smallest slice that answers the request.
|
|
53
|
+
|
|
54
|
+
\`\`\`sh
|
|
55
|
+
jq '.messages[-20:]' "$F" # last 20 messages
|
|
56
|
+
jq '[.messages[] | select(.role == "user")][-3:]' "$F" # last 3 user messages
|
|
57
|
+
jq '[.messages[] | select(.kind == "reply")][-10:]' "$F" # last 10 agent replies
|
|
58
|
+
jq '.lastRound as $r | [.messages[] | select(.round > $r - 5)]' "$F" # last 5 rounds
|
|
59
|
+
jq '(now - 8*3600 | todate) as $t | [.messages[] | select(.time >= $t)]' "$F" # last 8 hours
|
|
60
|
+
\`\`\`
|
|
61
|
+
|
|
44
62
|
## Current request
|
|
45
63
|
|
|
46
64
|
\`\`\`text
|
|
@@ -50,7 +68,7 @@ ${request}
|
|
|
50
68
|
|
|
51
69
|
function conversationPathFrom(message) {
|
|
52
70
|
const match = message.match(
|
|
53
|
-
/\*\*Conversation\*\* — `rarebit_conversation\/
|
|
71
|
+
/\*\*Conversation\*\* — `rarebit_conversation\/v2`\. Read this first\.\n\n```text\n([^\n]*rarebit-conversation\.json)\n```/,
|
|
54
72
|
);
|
|
55
73
|
assert.ok(match, "Recall Markdown must contain the fenced conversation path");
|
|
56
74
|
return match[1];
|
|
@@ -58,7 +76,7 @@ function conversationPathFrom(message) {
|
|
|
58
76
|
|
|
59
77
|
function detailedPathFrom(message) {
|
|
60
78
|
const match = message.match(
|
|
61
|
-
/\*\*Detailed evidence\*\* — `rarebit_message_recall\/v1
|
|
79
|
+
/\*\*Detailed evidence\*\* — `rarebit_message_recall\/v1`\. Use it only for source, Session, branch, or lineage facts\. Join on `seq`\.\n\n```text\n([^\n]*rarebit-evidence\.json)\n```/,
|
|
62
80
|
);
|
|
63
81
|
assert.ok(match, "Recall Markdown must contain the fenced detailed path");
|
|
64
82
|
return match[1];
|