proper-base 0.7.0 → 0.8.1

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
@@ -3,36 +3,75 @@
3
3
  Baseline [Pi](https://pi.dev) behavior for quieter transcripts, automatic
4
4
  session titles, model-preserving `/clear`, project prompt history, prompt
5
5
  editing, fullscreen navigation, image handling, cancellation, autocomplete,
6
- footer layout, and deferred automatic updates.
6
+ footer layout, context-window and Fast-mode control, commit message checks,
7
+ proactive subagent delegation, and deferred automatic updates.
7
8
 
8
9
  ## User-facing features
9
10
 
10
11
  ### Sessions and transcript
11
12
 
12
- - Completed tools and errors collapse into separate one-line rows after a run
13
- settles. Click one row to expand it, use its `collapse` control to close it,
14
- or use Pi's normal tool-output shortcut, Ctrl+O by default, for all rows.
15
- Settlement resets Pi's global tool-output state to collapsed. Thoughts,
16
- tool-calling text, direct replies, and agent status updates remain fully
17
- visible and in their original order.
13
+ - Completed tools and errors collapse into separate one-line rows once later
14
+ output appears, or when the run settles. In fullscreen mode, click a row to
15
+ expand it and its `collapse` control to close it. Pi's tool-output shortcut,
16
+ Ctrl+O by default, expands or collapses every row, and every row returns to
17
+ collapsed when a run settles. Thoughts, tool-calling text, direct replies,
18
+ and agent status updates remain fully visible and in their original order.
18
19
  - A fresh unnamed session gets a hidden 3 to 7 word title from the first
19
20
  successful assistant response. Existing, resumed, and already-named sessions
20
21
  keep their names.
21
- - `/clear` starts an empty session but restores the exact provider and model
22
- selected in the previous one. No messages, name, or branch state carry over.
23
- - The model you pick in `/model` and the level you pick in `/thinking` become
24
- Pi's startup defaults, so the next session opens on them. Pi otherwise saves
22
+ - `/clear` starts an empty session but preserves the current provider, model,
23
+ thinking level, session Fast setting, and session context window. Global
24
+ Fast and the global context window stay unchanged.
25
+ No messages, name, or branch state carry over.
26
+ - The model you pick with `/model` or Ctrl+P and the level you pick with
27
+ `/thinking`, Shift+Tab, or `/model <model> <level>` become Pi's startup
28
+ defaults, so the next session opens on them. Pi otherwise saves
25
29
  those only when you press Ctrl+S in the picker, and because Pi re-derives the
26
30
  thinking level from the saved default on every model switch, an unsaved level
27
- is otherwise lost mid-session at the next `/model`, Ctrl+P, or `/clear`.
31
+ is otherwise lost mid-session at the next `/model` or Ctrl+P.
28
32
  Automatic model-switch clamps do not redefine that choice, and the router's
29
33
  `llm-router/auto` placeholder persists neither itself nor its forced `off`.
30
34
  Resuming a session does not redefine the model. Set `"stickyDefaults": false`
31
35
  in `~/.pi/agent/proper-base.json` to turn this off.
32
36
  - Prompt-template expansions remain model-facing, while the transcript shows
33
37
  the slash command you typed, such as `/implement-ready epic-1 4`.
34
- - CLIProxyAPI `empty_stream` failures become normal retryable network errors, so
35
- Pi applies its existing retry budget and backoff.
38
+ - `/resume` builds its session list from a raw byte scan of each session file
39
+ instead of parsing every message, then loads message text in the background.
40
+ Search matches session names, IDs, and working directories at once, and
41
+ message text as it arrives.
42
+ - CLIProxyAPI `empty_stream` failures and `Selected model is at capacity`
43
+ overload errors become normal retryable network errors, so Pi applies its
44
+ existing retry budget and backoff.
45
+ - `/tokens max` raises an OpenAI model's context window from its 272K default
46
+ to the backend's 922K input cap for this session, through `openai-codex`,
47
+ CLIProxyAPI, or the `openai` API. `/tokens default` returns to
48
+ the default. Append `global` to set it for every session (saved as
49
+ `contextTokens` in `~/.pi/agent/proper-base.json`); a session choice
50
+ overrides the global one. Bare `/tokens` shows the current window. Tab on
51
+ `max` or `default` opens the scope menu, where `global` is one arrow away.
52
+ Auto-compaction then triggers at the new window minus your `reserveTokens`,
53
+ including per-model `compaction.modelOverrides`. Input above 272K bills at
54
+ the long-context rate.
55
+
56
+ ### Fast mode
57
+
58
+ With the CLIProxyAPI provider (`@router-for-me/pi-cliproxyapi-provider`),
59
+ proper-base takes over its `/fast` command and splits the priority-tier Fast
60
+ mode into two scopes:
61
+
62
+ - `/fast` toggles Fast for the current session only. proper-base never saves
63
+ it, so new, resumed, and reloaded sessions start with it off; `/clear` keeps
64
+ it.
65
+ - `/fast-global` toggles Fast for every session by saving the provider's
66
+ `fast` key in `~/.pi/agent/cliproxyapi.json`. Running sessions pick up the
67
+ change on their next request.
68
+
69
+ Fast applies when either scope is on, and only to models the provider's
70
+ catalog marks as Fast-capable. Turning one scope off tells you when the other
71
+ still keeps Fast on, and turning Fast on warns when the current model cannot
72
+ use it. While `CLIPROXYAPI_FAST` is set, `/fast-global` refuses to change the
73
+ saved setting and reports the environment value. The footer shows the `fast`
74
+ tag whenever Fast applies to the current model.
36
75
 
37
76
  ### Automatic updates
38
77
 
@@ -96,6 +135,10 @@ directory to forget all proper-base history.
96
135
  - Slash-command completion works after whitespace and on later prompt lines.
97
136
  It replaces only the active slash segment and ignores slashes inside paths
98
137
  and URLs.
138
+ - Accepting a slash command completion opens that command's argument menu
139
+ right away, such as the model list after `/model`.
140
+ - Word and line deletes (Alt+Backspace, Ctrl+W, Ctrl+U, Ctrl+K) refresh an
141
+ open menu instead of leaving suggestions for text that no longer exists.
99
142
  - `/model ` results sort by displayed model ID in descending numeric-aware
100
143
  order. Typed terms must all match when strict matches exist.
101
144
  - `/model` takes an optional thinking level after the model name, as in
@@ -121,18 +164,26 @@ Enable Pi's native fullscreen mode with `/settings` or:
121
164
  }
122
165
  ```
123
166
 
124
- proper-base keeps the prompt, queued messages, status, widgets, and footer
125
- pinned while Pi scrolls the transcript above them.
167
+ Pi keeps the prompt, queued messages, status, and footer pinned while the
168
+ transcript scrolls above them. Submitting a prompt scrolls the transcript back
169
+ to the newest output.
126
170
 
127
171
  | Input | Behavior in fullscreen mode |
128
172
  | --- | --- |
129
173
  | Home, End, PageUp, PageDown | Stay assigned to the prompt editor. |
130
174
  | Ctrl+Shift+Home or End | Jump the transcript to its top or bottom. |
131
175
  | Ctrl+Shift+PageUp or PageDown | Scroll the transcript by one page. |
176
+ | Mouse wheel | Scroll three lines per notch instead of Pi's one. |
177
+ | Double-click | Select a complete one-line URL, path, flag, qualified identifier, or quoted value when possible. |
132
178
 
179
+ Set `PROPER_WHEEL_SCROLL_LINES` to a positive integer to change the wheel step,
180
+ for example `1` in a terminal that already sends one report per scrolled line.
133
181
  Wheel and transcript scroll keys keep working while an `ask_user_question`
134
182
  questionnaire or other overlay has focus, so earlier context stays reachable.
135
- | Double-click | Select a complete one-line URL, path, flag, qualified identifier, or quoted value when possible. |
183
+
184
+ Typing or pasting clears a mouse selection, so a stale highlight never sits
185
+ over changing text. The copy shortcut leaves the selection in place, so it can
186
+ still be copied.
136
187
 
137
188
  Copying fullscreen Markdown paragraphs and blockquotes removes display margins,
138
189
  quote borders, and screen-width line breaks. Real newlines, paragraph boundaries,
@@ -154,6 +205,16 @@ to the bottom. While you are scrolled up, a dimmer `position/total` reading sits
154
205
  centred under the arrows and counts the prompts in the session; it disappears
155
206
  once the viewport is following output again.
156
207
 
208
+ A column of colored symbols along the transcript's right edge marks each
209
+ prompt, reply, and tool call in session order, newest at the bottom. `›` marks
210
+ your prompts, `‹` replies, and `×` failures. Tools show `/` for search, `≡`
211
+ for reads, `±` for edits, `+` for writes, `$` for shell commands, `@` for web
212
+ requests, `&` for agents, and `·` for anything else. Click a symbol to scroll
213
+ to that action. The action the viewport sits in shows in inverse video. At
214
+ rest the rail is faint and gives way to transcript text in its column, and
215
+ hovering it brings it to full strength with each action's name. Under a
216
+ terminal multiplexer, where Pi receives no hover events, it stays fully lit.
217
+
157
218
  Pi 0.85.0 moves the prompt cursor to wherever you click in the prompt. If you
158
219
  click the prompt area to focus the terminal or to select text, turn off
159
220
  `Prompt mouse clicks` in `/settings`: clicks on the prompt text then leave the
@@ -178,29 +239,145 @@ inverse-highlights the complete marker; Backspace removes the whole highlighted
178
239
  token. On submit, each marker expands back to the original path the agent can
179
240
  read.
180
241
 
181
- Under `TERM_PROGRAM=Scribe`, proper-base enables Kitty capability before Pi's
182
- renderer starts. Other terminals keep Pi's detected capabilities. Images remain
183
- in model context for every tool loop in the turn that introduced them. A later
184
- user message replaces older image blocks only in the outbound context copy, so
185
- saved sessions, exports, resumes, and branches retain the originals.
242
+ Images remain in model context for every tool loop in the turn that introduced
243
+ them. A later user message replaces older image blocks only in the outbound
244
+ context copy, so saved sessions, exports, resumes, and branches retain the
245
+ originals.
246
+
247
+ Under `TERM_PROGRAM=Scribe`, proper-base enables Kitty images and OSC 8
248
+ hyperlinks before Pi's renderer starts, so previews render and Ctrl+click on
249
+ any row of a wrapped link opens the full URL. Other terminals keep Pi's
250
+ detected capabilities. Every row of a wrapped link carries the same OSC 8 id,
251
+ so terminals that group links by id highlight and open it as one link.
252
+
253
+ On Linux, proper-base reads clipboard text through `wl-paste`, `xclip`, or
254
+ `xsel`, the tools Pi already uses to copy, instead of Pi's native clipboard
255
+ addon. That addon leaks two X connections on every read, and a long session
256
+ eventually hits the X server's client limit, after which paste silently stops
257
+ working. Image paste is unchanged, and macOS and Windows keep the addon.
186
258
 
187
259
  ### Skill context
188
260
 
189
- Pi expands `/skill:<name>` into a user message holding the whole `SKILL.md`
190
- body, then treats it like any other message. Invoking the same skill twice
191
- therefore sends two full copies, and compaction summarizes the body away while
192
- the model keeps following instructions it can no longer read.
193
-
194
- proper-base keeps each invoked skill present exactly once in the outbound
195
- context. A repeat invocation of an unchanged body keeps its request and shows
196
- the model a one-line already-loaded note instead of a second copy; a body that
197
- changed with its arguments is sent in full. After a compaction, the newest body
198
- of each dropped skill is restored on the first user turn following the summary,
199
- truncated to a character ceiling per skill and in total so the restored text
200
- cannot re-trigger the compaction that just ran. Restoration honors the latest
201
- context edit on the active branch: omitted or replaced skill text is not
202
- resurrected, while replacement skill bodies remain eligible. Only the outbound copy changes,
203
- so saved sessions, exports, resumes, and branches retain the originals.
261
+ Load several skills before one request:
262
+
263
+ ```text
264
+ /skill:security /skill:testing fix the login flow
265
+ ```
266
+
267
+ Only complete `/skill:name` tokens matching Pi's discovered catalog activate
268
+ skills. Matching is exact and case-sensitive; duplicate selections load once.
269
+ The first unknown or malformed token starts the literal request, with all
270
+ remaining text preserved. URLs, paths, queries, fragments, filename suffixes and
271
+ punctuation do not partially match names. Ambiguous, unreadable or malformed
272
+ registered selections reject the whole request. Explicit `/skill-context load`
273
+ and model-tool loads still report unknown names.
274
+
275
+ Use `--` after the command chain when the request itself starts with a literal
276
+ `/skill:` example. Inline, quoted, escaped, and fenced mentions are not commands.
277
+ Pi autocomplete completes partial input to `/skill:name`; submitted `/name`,
278
+ `$name`, `/skill name` and `/ skill:name` are not Pi skill aliases and remain
279
+ untouched. Other registered commands keep their own behavior. Pi's explicit
280
+ expansion opt-out remains respected, including RPC and queued prompts.
281
+
282
+ Each expanded skill appears as a collapsible section in terminal history,
283
+ including skills loaded through `skill_context`. Use Pi's tool-expansion shortcut
284
+ or click an individual section in fullscreen mode to view its instructions.
285
+ The request stays visible; the model still receives the full skill bodies.
286
+
287
+ Each selected skill retains a full snapshot and SHA-256 identity. Unchanged
288
+ instructions appear once in outbound context; repeating a workflow command
289
+ still submits its new request. Explicit reinvocation or refresh loads the current
290
+ file and supersedes older instructions. Compaction restores the selected
291
+ snapshots, never silently rereads changed files, and never replays the original
292
+ request. Normal task progress determines which workflow steps remain to do.
293
+
294
+ Manage the working set without starting a model turn:
295
+
296
+ ```text
297
+ /skill-context
298
+ /skill-context load security testing
299
+ /skill-context remove testing
300
+ /skill-context refresh security
301
+ /skill-context clear
302
+ ```
303
+
304
+ The list shows selected and removed snapshots, their version hashes, source
305
+ paths, changes on disk, character count, and confirmation threshold. Selections follow the current
306
+ session branch through resume, forks, context edits, and repeated compaction.
307
+ New sessions start empty. There is no guessed task expiry: reference instructions
308
+ apply only where relevant, and removal explicitly ends a selection. Removing a
309
+ skill omits its instruction blocks from future managed requests without deleting
310
+ historical user requests or the saved transcript. Conflicts are reported rather
311
+ than resolved by mention order; loading never grants extra tool permissions.
312
+
313
+ The model can use `skill_context` to list or load the smallest relevant set from
314
+ Pi's catalog. Explicit-only skills require the user's `/skill:` invocation.
315
+ Ordinary file reads remain available but do not automatically pin every skill
316
+ file inspected. Supporting resources load on demand; their files are not
317
+ snapshotted or version-pinned by this feature.
318
+
319
+ Selected instructions above 200,000 characters trigger a confirmation dialog.
320
+ Continue to keep every skill, or cancel to leave new selections unloaded.
321
+ Approval is remembered for the unchanged selection during the session, including
322
+ compaction. Changing the selection or reloading can require another confirmation.
323
+ There is no hard character cap or model-scaled limit; Pi and provider context
324
+ limits still apply. This count includes skill markup and separators, not tokens.
325
+
326
+ Restored selections are checked before reaching the model. Cancelling that check
327
+ stops the run; use `/skill-context remove <name>` or `/skill-context clear` to
328
+ reduce the selection, or retry and confirm. Runs without an interactive or RPC
329
+ confirmation UI stop with an explanation. No skill is silently truncated or
330
+ dropped.
331
+
332
+ **Skill context management** in `/settings` enables or disables the feature.
333
+ The preference is enabled by default and saved as `"skillContext"` in
334
+ `~/.pi/agent/proper-base.json`. `/skill-context on` and `/skill-context off`
335
+ provide a fallback when the native menu adapter is unavailable. Changes apply
336
+ to the next agent run. Disabled mode restores Pi's normal expansion and context
337
+ behavior; it does not erase instructions already delivered. Malformed or
338
+ unreadable configuration disables skill management until repaired.
339
+
340
+ Native menu integration and multi-command expansion use guarded Pi compatibility
341
+ adapters. `/skill-context load` remains available if expansion internals change.
342
+ The rest uses public command, tool, context, and session APIs. No new dependencies
343
+ or external registry are required.
344
+
345
+ ### Commit message guard
346
+
347
+ proper-base checks each `git commit` the agent runs through the `bash` or
348
+ `quill_execute` tool, and blocks the call unless all of these hold:
349
+
350
+ - The command is one direct `git commit` call. Chains (`&&`, `||`, `;`, `|`),
351
+ wrappers such as `sh -c`, `env`, `sudo`, or `timeout`, variable-assignment
352
+ prefixes, and dynamic text (`$(...)`, backticks, `$VAR`) are rejected.
353
+ - The message comes only from literal `-m` or `--message` text. `-F`, `-e`,
354
+ `-c`, `-C`, `-t`, `-s`, `--fixup`, `--squash`, `--trailer`, `--cleanup`,
355
+ `--allow-empty-message`, and `--no-verify` are rejected.
356
+ - The subject and every body line fit in 72 columns, the second line is blank,
357
+ and no line carries a `Co-Authored-By`, `noreply@anthropic`, or
358
+ `Generated with Claude` attribution. A final block of `Key: value` trailers
359
+ may exceed the length limit.
360
+
361
+ A blocked call lists every problem at once, so the agent can fix the whole
362
+ message in one retry. Commands that do not contain both `git` and `commit` skip
363
+ the check, and a commit command the guard cannot parse is blocked. There is no
364
+ setting to turn the guard off.
365
+
366
+ ### Proactive delegation
367
+
368
+ When pi-subagents' `subagent` tool or its `subagents_enable` loader is active,
369
+ proper-base replaces its rule to delegate only when needed with a proactive
370
+ multi-agent mode. The agent hands independent work that is large enough to
371
+ justify a fresh context to subagents without waiting to be asked. It keeps sequential steps, small tasks, and edits
372
+ to the same area in the main session, and writes the final answer itself. Your
373
+ own instructions still take priority.
374
+
375
+ If the session has scoped models (from `--models`, `enabledModels`, or
376
+ `/scoped-models`), the prompt names them as the only models subagents may use
377
+ and asks the agent to pick one per task by difficulty and cost. The
378
+ `llm-router/auto` placeholder is left out. Sessions without either tool keep
379
+ their system prompt unchanged. Set `"proactiveDelegation": false` in
380
+ `~/.pi/agent/proper-base.json` to keep pi-subagents' ask-first policy.
204
381
 
205
382
  ### Footer
206
383
 
@@ -212,7 +389,7 @@ highlight. Custom replacement footers are not changed.
212
389
 
213
390
  ## Install
214
391
 
215
- Node 22.19 or newer is required. The package is tested against Pi 0.87.0.
392
+ Node 22.19 or newer is required. The package is tested against Pi 1.3.0.
216
393
 
217
394
  From npm:
218
395
 
@@ -235,6 +412,31 @@ This package replaces the former local `proper-customs` identity. Keep only one
235
412
  registration. Existing data under the legacy `proper-history` path remains
236
413
  compatible.
237
414
 
415
+ ## Configuration
416
+
417
+ proper-base needs no configuration. Optional settings live in
418
+ `~/.pi/agent/proper-base.json`, and a missing or unreadable file keeps every
419
+ default.
420
+
421
+ | Key | Default | Effect |
422
+ | --- | --- | --- |
423
+ | `stickyDefaults` | `true` | `false` stops model and thinking choices from becoming Pi's startup defaults. |
424
+ | `contextTokens` | unset | Global `/tokens` window, `"max"` or `"default"`. `/tokens <mode> global` writes it. |
425
+ | `sessionRail` | `true` | Shows the session action rail. Toggle it with `Session action rail` in `/settings`. |
426
+ | `editorMouse` | `true` | Lets prompt clicks move the cursor. Toggle it with `Prompt mouse clicks` in `/settings`. |
427
+ | `proactiveDelegation` | `true` | `false` keeps pi-subagents' ask-first delegation policy. |
428
+
429
+ The **Automatic updates** entry in `/settings` is stored separately, as
430
+ described in [UPDATES.md](./UPDATES.md#disable).
431
+
432
+ | Environment variable | Effect |
433
+ | --- | --- |
434
+ | `PROPER_WHEEL_SCROLL_LINES` | Lines per mouse-wheel notch in fullscreen mode. Default `3`. |
435
+ | `PROPER_UPDATER_OFF=1` | Skips automatic updates for one launch, like `--no-auto-update`. |
436
+ | `CLIPROXYAPI_FAST` | The provider's Fast override. While it is set, `/fast-global` refuses to write. |
437
+ | `CLIPROXYAPI_PROVIDER_ID` | Provider ID that Fast mode and `/tokens` treat as CLIProxyAPI. Otherwise `providerId` from `cliproxyapi.json`, then `cliproxyapi`. |
438
+ | `TERM_PROGRAM=Scribe` | Set by the Scribe terminal. Enables Kitty image previews and OSC 8 links. |
439
+
238
440
  ## Compatibility
239
441
 
240
442
  Restart Pi once when upgrading from releases with permanent host patches.
@@ -249,7 +451,6 @@ New installations restore owned patches on unload and support reload takeover.
249
451
  disable individual enhancements; later-loaded replacements still win.
250
452
  - Ctrl+Shift fullscreen keys require a terminal that reports modifiers
251
453
  distinctly.
252
- - proper-base has no extension-specific runtime config file or feature toggles.
253
454
  - Slash commands beginning with `__proper-` are reserved for internal session
254
455
  recovery.
255
456