slopie 1.6.2 → 1.7.5

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/NOTICE CHANGED
@@ -73,3 +73,5 @@ This tokenizer is a transport accounting unit, not the host model tokenizer.
73
73
  Models.dev
74
74
  ----------
75
75
  The terminal audit includes reduced public model/pricing metadata from Models.dev (Anomaly). Source: https://github.com/anomalyco/models.dev. Licensed under MIT; see licenses/models-dev-MIT.txt. Snapshot retrieval date and hash are retained in each audit price basis.
76
+
77
+ Native usage discovery and duplicate normalization were adapted with reference to ccusage (https://github.com/ccusage/ccusage), commit 656f7f86c5b832eedd8227f6174761852aa6c2fb, Copyright (c) 2025 ryoppippi. Licensed under MIT; see licenses/ccusage-MIT.txt. Slopie current-catalog reference valuation is separate from ccusage recorded/historical cost modes.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [Slopie](https://github.com/HulkInTherapy/slopie), formerly Potsherd, is local memory for coding-agent sessions. Capture supported history, find exact source evidence, and save scoped handoffs with provenance.
4
4
 
5
- **Slopie 1.6.1 is published with provenance; this checkout prepares the 1.6.2 live-store patch.** Requires Node.js 22 or newer.
5
+ Requires Node.js 22 or newer.
6
6
 
7
7
  ## Audit your recorded history
8
8
 
@@ -10,13 +10,17 @@
10
10
  npx slopie audit
11
11
  ```
12
12
 
13
- The default interactive audit sends selected redacted conversation text to OpenCode Zen and TypeSafe/Jev after its opening recipient notice, with no extra Enter step. It presents recorded API-equivalent value at a dated current price catalog, favourite model, real projects, recent Jev work stories, memorable source lines and direct-user language. Arrow keys or Tab switch sections; Enter opens details and evidence, Esc returns, S freezes the current view and q exits. `--tone elegant|witty|chaotic|roast` overrides the inferred voice. `--plain`, `--ascii`, `--no-color` and `--no-motion` support simpler terminals.
13
+ The interactive audit opens one responsive wallboard with recorded API-equivalent value, known tokens, favourite models and prices, your top projects, requested work focus and source-backed repeated lines. Small terminals use left/right pages; `?` opens help, `s` freezes the displayed results, `d` opens a captured source and `q` exits. There are no section tabs or scrolling controls. `--plain` prints the full report; `--json` uses the safe aggregate representation. `--ascii`, `--no-color` and `--no-motion` support simpler terminals.
14
14
 
15
- Jev analyzes the largest complete recent scope that fits the free token and estimated time allowance: All, 45, 30, 7 or 3 days. When none fits, an explicitly labelled selection of the newest coherent episodes keeps the scope bounded and the calendar coverage partial. Its opening notice names OpenCode Zen and TypeSafe/Jev as recipients. Retained archives remain read-only; redacted conversation text is sent only through the qualified free route, with no paid fallback. The anonymous free-model route previously returned zero-cost answers for an authored synthetic sample. Current free capacity is limited: four authorized private requests received quota errors and no accepted answers, so private semantic accuracy is unavailable. No private accuracy pass or guaranteed capacity is claimed. Results and date inventories use a separate body-free local cache. Prices revalue recorded tokens at current catalog rates; they are not historical invoices. Missing usage, endpoints, rates or provenance stay visible.
15
+ Native Claude Code, Codex, OpenCode and pi usage is read before retained-history fallback. Message/request identities, cumulative usage, cache inclusion and recorded per-response models determine the totals. Known machine/test inputs and copied history are separated from personal language. Reaction counts describe recorded feedback associated with a known assistant model; they are not model-quality benchmarks or universal human-authorship claims.
16
16
 
17
- The audit remains experimental. The unchanged large synthetic fixture took about 33 seconds cold and 22 seconds warm. Independent, untuned scores were usefulness 7/10, ease 8/10 and appearance 8/10 at 80 columns (7/10 at 40); these do not establish broader semantic accuracy.
17
+ Prices revalue recorded usage at a dated current catalog. Exact known Claude models can use an explicitly named Anthropic first-party reference when the serving provider is unrecorded. Native recorded API-cost fields remain a separate basis. None is an invoice or subscription bill. Missing models, usage, rates and contradictory cache-duration fields stay unavailable.
18
18
 
19
- Use `slopie audit --legacy` for the local retention audit, or set `POTSHERD_OFFLINE=1` to keep the new retrospective local. Window estimates describe remaining analysis after inventory, not the entire cold command; large cold archives can take longer. `--sweep` and `--verify` keep their prior behavior. See [terminal audit coverage and privacy](https://github.com/HulkInTherapy/slopie/blob/main/docs/audit-terminal.md).
19
+ Selected redacted conversations may be sent to OpenCode Zen and TypeSafe/Jev for free semantic analysis. A recipient notice is physically displayed immediately before each actual request, with no extra Enter or consumer key required. Offline and cache-only work makes no transfer claim. Set `POTSHERD_OFFLINE=1` to keep the retrospective local. Free capacity is limited; quota errors leave local facts usable and do not produce invented stories or quotes. Private semantic accuracy remains unqualified.
20
+
21
+ Jev selects the largest complete recent scope fitting the free allowance, or a visibly smaller selection of newest whole episodes. Recorded requests, assistant-reported outcomes and supported success remain distinct. `--tone elegant|witty|chaotic|roast` overrides the inferred voice. The audit remains experimental; large inventories can take longer, and source-format or pricing gaps are disclosed. See [coverage and privacy](https://github.com/HulkInTherapy/slopie/blob/main/docs/audit-terminal.md).
22
+
23
+ Use `slopie audit --legacy` for the local retention audit. `--sweep` and `--verify` keep their prior behavior.
20
24
 
21
25
  ## Install and use
22
26
 
@@ -0,0 +1,71 @@
1
+ // Instant first frame for `slopie audit`.
2
+ //
3
+ // Loading the CLI bundle takes ~300 ms. For the interactive audit we paint a
4
+ // skeleton frame first (in well under 100 ms), so the screen responds at once;
5
+ // the real wallboard takes over the alternate screen as soon as it loads and
6
+ // calls `globalThis.__slopieSplash.handOff()`.
7
+ //
8
+ // If anything else ends up writing (an error, --help), the alternate screen is
9
+ // left first so the message stays visible, and the terminal is always restored
10
+ // on exit.
11
+
12
+ const PLAIN_FLAGS = new Set(['--json', '--plain', '--export', '--legacy', '--sweep', '--verify', '--help', '-h', '--version', '-V']);
13
+
14
+ export function auditSplash(argv = process.argv.slice(2)) {
15
+ const { stdin, stdout, stderr } = process;
16
+ if (argv[0] !== 'audit' || argv.some(arg => PLAIN_FLAGS.has(arg.split('=')[0]))) return;
17
+ if (!stdin.isTTY || !stdout.isTTY || process.env.SLOPIE_NO_SPLASH === '1') return;
18
+ const columns = stdout.columns || 80;
19
+ const rows = stdout.rows || 24;
20
+ if (columns < 40 || rows < 12) return;
21
+
22
+ const color = !('NO_COLOR' in process.env) && !argv.includes('--no-color') && process.env.TERM !== 'dumb';
23
+ const ascii = argv.includes('--ascii');
24
+ const paint = (code, text) => (color ? `\x1b[${code}m${text}\x1b[0m` : text);
25
+ const orange = '1;38;5;215';
26
+ const gray = '38;5;248';
27
+ const dark = '38;5;241';
28
+
29
+ const width = Math.min(132, columns - 4);
30
+ const margin = ' '.repeat(Math.floor((columns - width) / 2));
31
+ const status = 'reading your history…';
32
+ const block = ascii ? '.' : '░';
33
+ const lines = [];
34
+ lines[0] = margin + paint(orange, 'slopie') + ' '.repeat(Math.max(1, width - 6 - status.length)) + paint(gray, status);
35
+ for (let i = 2; i <= 4; i++) lines[i] = margin + paint(dark, block.repeat(20));
36
+ lines[5] = margin + paint(gray, 'what your tokens would cost at API prices');
37
+ lines[rows - 1] = margin + paint(orange, ascii ? '-' : '⠋') + ' ' + paint(gray, 'starting…');
38
+
39
+ let out = '\x1b[?1049h\x1b[H\x1b[2J\x1b[?25l';
40
+ lines.forEach((line, row) => {
41
+ if (line) out += `\x1b[${row + 1};1H${line}`;
42
+ });
43
+ stdout.write(out);
44
+ try { stdin.setRawMode(true); } catch { /* not a raw-capable tty */ }
45
+
46
+ let active = true;
47
+ const originalOut = stdout.write.bind(stdout);
48
+ const originalErr = stderr.write.bind(stderr);
49
+ const leave = () => {
50
+ if (!active) return;
51
+ active = false;
52
+ stdout.write = originalOut;
53
+ stderr.write = originalErr;
54
+ try { stdin.setRawMode(false); } catch { /* ignore */ }
55
+ originalOut('\x1b[0m\x1b[?25h\x1b[?1049l');
56
+ };
57
+ // Anything other than the wallboard writing first means we must get out of the way.
58
+ stdout.write = (...args) => { leave(); return stdout.write(...args); };
59
+ stderr.write = (...args) => { leave(); return stderr.write(...args); };
60
+ process.once('exit', leave);
61
+
62
+ globalThis.__slopieSplash = {
63
+ handOff() {
64
+ if (!active) return;
65
+ active = false;
66
+ stdout.write = originalOut;
67
+ stderr.write = originalErr;
68
+ process.off('exit', leave);
69
+ },
70
+ };
71
+ }
package/bin/potsherd.js CHANGED
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  // The published entry point. `dist/potsherd.js` is a single bundled file so
3
3
  // that `npx potsherd audit` needs no workspace resolution and no build step.
4
+ import {auditSplash} from './audit-splash.js';
5
+ auditSplash();
4
6
  import('../dist/potsherd.js').catch((err) => {
5
7
  console.error('potsherd failed to start:', err?.message ?? err);
6
8
  // NOT `npm i -g potsherd`: the package is unpublished, so that is a 404
package/bin/slopie.js CHANGED
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  // Public Slopie launcher; storage and the potsherd launcher remain compatible.
3
3
  process.env['POTSHERD_CLI_PUBLIC_NAME']='slopie';
4
+ import {auditSplash} from './audit-splash.js';
5
+ auditSplash();
4
6
  import('../dist/potsherd.js').catch((err)=>{
5
7
  console.error('slopie failed to start:',err?.message??err);
6
8
  console.error('this usually means the package did not build. try: pnpm install && pnpm build');