mythos-router 1.1.8 → 1.2.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +145 -0
  2. package/README.md +45 -16
  3. package/dist/cli.js +10 -1
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/chat.d.ts +11 -0
  6. package/dist/commands/chat.d.ts.map +1 -1
  7. package/dist/commands/chat.js +232 -333
  8. package/dist/commands/chat.js.map +1 -1
  9. package/dist/commands/dream.d.ts.map +1 -1
  10. package/dist/commands/dream.js +15 -0
  11. package/dist/commands/dream.js.map +1 -1
  12. package/dist/commands/stats.d.ts +6 -0
  13. package/dist/commands/stats.d.ts.map +1 -0
  14. package/dist/commands/stats.js +68 -0
  15. package/dist/commands/stats.js.map +1 -0
  16. package/dist/config.d.ts +1 -1
  17. package/dist/config.d.ts.map +1 -1
  18. package/dist/config.js +11 -8
  19. package/dist/config.js.map +1 -1
  20. package/dist/git.d.ts +9 -0
  21. package/dist/git.d.ts.map +1 -1
  22. package/dist/git.js +24 -0
  23. package/dist/git.js.map +1 -1
  24. package/dist/index.d.ts +5 -2
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +7 -3
  27. package/dist/index.js.map +1 -1
  28. package/dist/memory.d.ts +4 -0
  29. package/dist/memory.d.ts.map +1 -1
  30. package/dist/memory.js +19 -0
  31. package/dist/memory.js.map +1 -1
  32. package/dist/metrics.d.ts +14 -0
  33. package/dist/metrics.d.ts.map +1 -0
  34. package/dist/metrics.js +37 -0
  35. package/dist/metrics.js.map +1 -0
  36. package/dist/swd-cli.d.ts +9 -0
  37. package/dist/swd-cli.d.ts.map +1 -0
  38. package/dist/swd-cli.js +56 -0
  39. package/dist/swd-cli.js.map +1 -0
  40. package/dist/swd.d.ts +44 -32
  41. package/dist/swd.d.ts.map +1 -1
  42. package/dist/swd.js +202 -308
  43. package/dist/swd.js.map +1 -1
  44. package/package.json +4 -2
package/CHANGELOG.md ADDED
@@ -0,0 +1,145 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ---
9
+
10
+ ## [1.2.0] — 2026-04-23
11
+
12
+ ### Added
13
+ - **SWDEngine v1 API** — Transactional filesystem execution kernel with `Plan → Snapshot → Execute → Verify → Rollback` lifecycle. Single entry point: `engine.run(actions)`.
14
+ - **ChatUI Abstraction** — Decoupled chat session logic from the terminal via a `ChatUI` interface. `ChatSession` is now a pure orchestrator, fully testable and reusable outside the CLI.
15
+ - **TerminalUI Implementation** — CLI-specific `ChatUI` adapter wrapping the Spinner and ANSI output.
16
+ - **SWD Lifecycle Hooks** — Extensibility layer (`onAction`, `onVerify`, `onRollback`) allowing consumers to inject logging, telemetry, or custom UI into the engine.
17
+ - **Rollback Auditability** — `SWDRunResult.rollbackErrors` field captures and reports rollback failures instead of silently swallowing them.
18
+ - **`swd-cli.ts`** — Separated SWD terminal presentation (verification output, dry-run preview, verbose traces) from the pure execution kernel.
19
+ - **Git Sandbox** — `ChatSession.setupSandbox()` for automated `mythos/` branch creation with nested-sandboxing protection.
20
+
21
+ ### Changed
22
+ - **SWD Kernel is now I/O-free** — `swd.ts` contains zero `console.log` calls. All presentation lives in `swd-cli.ts`.
23
+ - **`validateApiKey()` throws instead of `process.exit(1)`** — library-safe error handling.
24
+ - **SDK exports (`index.ts`) fully updated** — removed dead symbols (`runSWD`, `parseFileActions`, `snapshotFiles`), added `SWDEngine`, `parseActions`, `SessionBudget`, `ChatUI`, and all v1 types.
25
+
26
+ ### Fixed
27
+ - **🔴 Snapshot memoization bug** — `InternalSessionContext.getSnapshot('after')` was returning stale cached state on multi-action same-file scenarios. After snapshots now always re-read disk state.
28
+ - **🔴 Broken `index.ts` exports** — SDK entry point was referencing pre-refactor symbols that no longer existed.
29
+
30
+ ---
31
+
32
+ ## [1.1.9] — 2026-04-22
33
+
34
+ ### Added
35
+ - **Budget Analytics & Cost Profiling** — Persistent tracking of token usage and API costs across all sessions, projects, and commands.
36
+ - **`mythos stats` Command** — New reporting engine for financial transparency. Aggregate costs by command, project, or time period (last N days).
37
+ - **Global Metrics Store** — Local append-only JSON store in `~/.mythos-router/metrics.json` for cross-project financial auditing.
38
+ - **Session Instrumentation** — Automated recording of chat sessions and memory compression (dream) events.
39
+
40
+ ---
41
+
42
+ ## [1.1.8] — 2026-04-20
43
+
44
+ ### Added
45
+ - **Self-Healing Memory (V4)** — Re-architected memory system with a dual Authority/Derivative model. `MEMORY.md` remains the sole source of truth, backed by a rebuildable SQLite index.
46
+ - **SQLite Derivative Index** — High-performance query acceleration layer using `node:sqlite`.
47
+ - **FTS5 Smart Search** — Intelligent, ranked text retrieval via FTS5 virtual tables with `unicode61` tokenization.
48
+ - **Integrity Signposting** — SHA-256 manifest hashing on startup ensuring zero drift between the authoritative log and the search index.
49
+ - **Atomic Rebuilds** — Transactional reconstruction logic (`BEGIN/COMMIT`) to ensure index consistency even during hard crashes.
50
+
51
+ ### Changed
52
+ - **O(1) Append Protocol** — Optimized logging to use `appendFileSync` for better performance and durability under load.
53
+ - **Hardened Test Suite** — Expanded testing to verify SQLite initialization, FTS5 search ranking, and recovery logic.
54
+
55
+ ---
56
+
57
+ ## [1.1.7] — 2026-04-19
58
+
59
+ ### Added
60
+ - **Interactive Inline Diffs** — High-fidelity terminal previews for dry-run mode. Review exact line changes with ANSI coloring and line numbering before applying.
61
+ - **Myers Diff Engine** — Implemented a zero-dependency, line-based shortest-edit-script algorithm in `src/diff.ts`.
62
+
63
+ ### Changed
64
+ - **SWD Protocol Upgrade** — Updated the "Capybara" system prompt to include the `CONTENT` field for 100% verifiability of file operations.
65
+ - **Enhanced Regex Parsing** — Robust multi-line block extraction for complex code transfers.
66
+
67
+ ---
68
+
69
+ ## [1.1.6] — 2026-04-19
70
+
71
+ ### Added
72
+ - **Atomic SWD Rollbacks** — Transactional filesystem safety. If any file action in a batch fails verification, the entire operation is reverted to its pristine state.
73
+ - **Claude Opus 4.7 Support** — Official integration as the default `high` effort model.
74
+ - **Adaptive Thinking Protocol** — Real-time streaming of model reasoning in the CLI REPL.
75
+ - **Enhanced Dry-Run Previews** — Per-action confirmation prompts with detailed diff-style metadata.
76
+ - **Adaptive Thinking Mode** — Full support in `client.ts` for thought-process streaming.
77
+
78
+ ### Changed
79
+ - Updated model identifiers for Claude Opus 4.7 compatibility.
80
+ - Added SDK usage examples for programmatic integration.
81
+ - Updated pricing constants and tokenization logic for Opus 4.7 compatibility.
82
+ - Improved memory summarization "Dream" logic and session budget visualization.
83
+
84
+ ### Fixed
85
+ - Deduplicated internal `progressBar` utility.
86
+ - `--effort` flag now validates input and warns on unrecognized values.
87
+ - Improved path traversal detection in `resolveSafePath`.
88
+ - Fixed memory leakage in long REPL sessions.
89
+
90
+ ---
91
+
92
+ ## [1.1.3] — 2026-04-17
93
+
94
+ ### Added
95
+ - **Programmable SDK API** — Added the `src/index.ts` entry point and updated package module resolution.
96
+ - **Exposed Modules** — Native export of `{ runSWD, streamMessage, snapshotFiles }` for external integration.
97
+ - **SDK Documentation** — Integrated a new SDK Usage guide into the `README.md`.
98
+
99
+ ---
100
+
101
+ ## [1.1.2] — 2026-04-17
102
+
103
+ ### Added
104
+ - **Multi-Model Orchestration** — Dynamic routing engine delegating tasks by effort (Opus 4.7 for Thinking, Sonnet 3.5 for Writing, Haiku 3 for Verifying).
105
+ - **Dynamic CLI Badging** — Terminal now explicitly displays the exact model assigned to the current session.
106
+ - **Protocol Tokenomics** — Added the official `TOKENOMICS.md`, formalizing the $MYTHOS Reasoning Tier Matrix.
107
+
108
+ ---
109
+
110
+ ## [1.1.1] — 2026-04-12
111
+
112
+ ### Fixed
113
+ - **Zero-Drift Accuracy** — Filesystem scanner now recursively snapshots subdirectories for 100% drift detection.
114
+ - **True Dry-Run** — Fixed an issue where `MEMORY.md` was being created on disk even with the `--dry-run` flag.
115
+ - **Memory Example** — Enriched the default `MEMORY.md` to reflect real sessions with file modifications.
116
+ - **Codebase Polish** — Removed unused imports and obsolete Git-status checks.
117
+
118
+ ---
119
+
120
+ ## [1.1.0] — 2026-03-31
121
+
122
+ ### Added
123
+ - **Financial Safety** — Hard budget cap and token tracker to prevent bill-shock.
124
+ - **Dry-Run Mode** — Preview all file operations with `[Y/n]` prompts before execution.
125
+ - **Strict Write Discipline** — Enhanced verification logic for cleaner code.
126
+ - **Zero-Drift Scanning** — Initial `verify` command implementation.
127
+
128
+ ---
129
+
130
+ ## [1.0.0] — 2026-03-29
131
+
132
+ ### Added
133
+ - Initial release of mythos-router.
134
+ - **Strict Write Discipline (SWD)** — pre/post filesystem snapshot verification.
135
+ - **Adaptive Thinking** — Claude Opus with configurable effort levels.
136
+ - **Self-Healing Memory** — `MEMORY.md` auto-logging with verification status.
137
+ - **Correction Turns** — max 2 retries before yielding to human.
138
+ - **Dream/Verify Commands** — memory compression and drift detection.
139
+
140
+ [1.1.6]: https://github.com/thewaltero/mythos-router/compare/v1.1.3...v1.1.6
141
+ [1.1.3]: https://github.com/thewaltero/mythos-router/compare/v1.1.2...v1.1.3
142
+ [1.1.2]: https://github.com/thewaltero/mythos-router/compare/v1.1.1...v1.1.2
143
+ [1.1.1]: https://github.com/thewaltero/mythos-router/compare/v1.1.0...v1.1.1
144
+ [1.1.0]: https://github.com/thewaltero/mythos-router/compare/v1.0.0...v1.1.0
145
+ [1.0.0]: https://github.com/thewaltero/mythos-router/releases/tag/v1.0.0
package/README.md CHANGED
@@ -55,6 +55,7 @@ Zero slop. Zero hallucinated state. Full adaptive thinking.
55
55
  | **Token Limiter** | Budget cap with graceful save — progress saved to MEMORY.md, never lose work |
56
56
  | **Dry-Run Mode** | Preview every file operation before it executes — full transparency |
57
57
  | **Verbose Tracing** | See exactly what the AI is parsing, thinking, and verifying |
58
+ | **Budget Analytics** | Persistent tracking of cost across sessions and projects via `stats` |
58
59
  | **Session Branching** | Isolate AI actions in a namespaced git branch (`mythos/`) |
59
60
  | **Zero Build** | Runs directly via `tsx` — no compile step in dev |
60
61
 
@@ -200,29 +201,51 @@ mythos dream --dry-run # Preview without writing
200
201
 
201
202
  When `MEMORY.md` exceeds 100 entries, older logs are compressed into a summary block using Claude (low effort, minimal token burn). Recent entries are preserved intact.
202
203
 
204
+ ### `mythos stats` — Budget Analytics & Cost Profiling
205
+
206
+ ```bash
207
+ mythos stats # Show all-time token usage and costs
208
+ mythos stats --days 7 # Filter for the last week
209
+ ```
210
+
211
+ Tracks every penny spent across all your projects. Costs are aggregated by:
212
+ - **Command** (e.g., `chat` vs `dream`)
213
+ - **Project** (directory name)
214
+ - **Time Period**
215
+
216
+ Data is stored locally in `~/.mythos-router/metrics.json`.
217
+
203
218
  ### 🔌 SDK Usage (For Agentic Systems)
204
219
 
205
220
  `mythos-router` exposes its Strict Write Discipline engine for programmatic use:
206
221
 
207
222
  ```typescript
208
- import { runSWD, snapshotFiles } from 'mythos-router';
223
+ import { SWDEngine, parseActions } from 'mythos-router';
209
224
 
210
- // 1. Snapshot the target directory before your agent executes
211
- const beforeState = snapshotFiles(['./src/components']);
225
+ // 1. Create an engine instance with your preferred options
226
+ const engine = new SWDEngine({
227
+ strict: true,
228
+ enableRollback: true,
229
+ onAction: (action) => console.log(`Executing: ${action.operation} ${action.path}`),
230
+ onVerify: (result) => console.log(`${result.status}: ${result.detail}`),
231
+ });
212
232
 
213
233
  // 2. Let your agent generate code (must output [FILE_ACTION] blocks)
214
- const agentOutput = await myAgent.generateCode();
234
+ const agentOutput = await myAgent.generateCode();
215
235
 
216
- // 3. Route through the Strict Write Discipline engine
217
- const result = runSWD(agentOutput, beforeState);
236
+ // 3. Parse the agent's output and route through the SWD engine
237
+ const actions = parseActions(agentOutput);
238
+ const result = await engine.run(actions);
218
239
 
219
- if (result.verified) {
240
+ if (result.success) {
220
241
  console.log('✅ Agent execution verified securely');
221
242
  } else {
222
- console.log('❌ Agent hallucinated a write. Stopping execution.');
243
+ console.log('❌ Agent hallucinated a write. Rolled back:', result.rolledBack);
244
+ console.log('Errors:', result.errors);
223
245
  }
224
246
  ```
225
247
 
248
+
226
249
  ---
227
250
 
228
251
  ## Architecture
@@ -231,16 +254,22 @@ if (result.verified) {
231
254
  mythos-router/
232
255
  ├── src/
233
256
  │ ├── cli.ts # Commander.js entry point
234
- │ ├── config.ts # System prompt + constants + budget defaults
235
- │ ├── client.ts # Anthropic SDK (adaptive thinking)
236
- │ ├── budget.ts # Session budget limiter (token cap, turn cap)
237
- │ ├── swd.ts # Strict Write Discipline + dry-run preview
238
- │ ├── memory.ts # MEMORY.md self-healing manager (dry-run aware)
239
- │ ├── utils.ts # Terminal formatting, badges, prompts (zero-dep)
257
+ │ ├── config.ts # System prompt + constants + budget defaults + validation
258
+ │ ├── client.ts # Anthropic SDK (adaptive thinking, streaming)
259
+ │ ├── budget.ts # Session budget limiter (token cap, turn cap, progress bar)
260
+ │ ├── swd.ts # SWD execution kernel (engine, types, parsing, snapshots)
261
+ │ ├── swd-cli.ts # SWD terminal presentation (verification output, dry-run)
262
+ │ ├── memory.ts # MEMORY.md self-healing manager (SQLite FTS5 index)
263
+ │ ├── metrics.ts # Global metrics store (persistent budget tracking)
264
+ │ ├── diff.ts # Myers' diff algorithm (zero-dependency)
265
+ │ ├── git.ts # Git operations (branching, committing)
266
+ │ ├── utils.ts # Terminal formatting, badges, prompts (zero-dep ANSI)
267
+ │ ├── index.ts # Public SDK exports
240
268
  │ └── commands/
241
- │ ├── chat.ts # Interactive REPL (budget + dry-run + verbose)
269
+ │ ├── chat.ts # Interactive REPL (ChatSession + ChatUI abstraction)
242
270
  │ ├── verify.ts # Codebase ↔ Memory scanner (dry-run aware)
243
- └── dream.ts # Memory compression (dry-run aware)
271
+ ├── dream.ts # Memory compression (dry-run aware)
272
+ │ └── stats.ts # Budget analytics reporter
244
273
  ├── test/ # Automated test suite (node:test)
245
274
  ├── .mythosignore # SWD scan exclusions
246
275
  ├── MEMORY.md # Auto-generated agentic memory
package/dist/cli.js CHANGED
@@ -7,13 +7,14 @@ import { Command } from 'commander';
7
7
  import { chatCommand } from './commands/chat.js';
8
8
  import { verifyCommand } from './commands/verify.js';
9
9
  import { dreamCommand } from './commands/dream.js';
10
+ import { statsCommand } from './commands/stats.js';
10
11
  import { DEFAULT_MAX_TOKENS_PER_SESSION, DEFAULT_MAX_TURNS, } from './config.js';
11
12
  const program = new Command();
12
13
  program
13
14
  .name('mythos')
14
15
  .description('Capybara-tier CLI router — Claude Opus 4.7 with Adaptive Thinking, ' +
15
16
  'Strict Write Discipline, and Self-Healing Memory.')
16
- .version('1.1.7');
17
+ .version('1.2.0');
17
18
  // ── mythos chat ──────────────────────────────────────────────
18
19
  program
19
20
  .command('chat')
@@ -45,6 +46,14 @@ program
45
46
  .action(async (options) => {
46
47
  await dreamCommand(options);
47
48
  });
49
+ // ── mythos stats ─────────────────────────────────────────────
50
+ program
51
+ .command('stats')
52
+ .description('Show budget analytics and token usage across sessions')
53
+ .option('-d, --days <n>', 'Filter metrics by the last N days')
54
+ .action(async (options) => {
55
+ await statsCommand(options);
56
+ });
48
57
  // ── Default: show help ───────────────────────────────────────
49
58
  if (process.argv.length <= 2) {
50
59
  // Import banner and show it before help
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,gEAAgE;AAChE,2BAA2B;AAC3B,+CAA+C;AAC/C,gEAAgE;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,8BAA8B,EAC9B,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAErB,MAAM,OAAO,GAAG,IAAI,OAAO,E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AC;AAC9B,CAAC,CAAC,CAAC;AAEL,gEAAgE;AAChE,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;IAC7B,wCAAwC;IACxC,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;QACvC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpB,OAAO,CAAC,IAAI,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;AACL,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC"}
@@ -1,3 +1,14 @@
1
+ export interface ChatUI {
2
+ startLoading(msg: string): void;
3
+ updateLoading(msg: string): void;
4
+ stopLoading(msg?: string): void;
5
+ write(text: string): void;
6
+ log(msg: string): void;
7
+ warn(msg: string): void;
8
+ error(msg: string): void;
9
+ success(msg: string): void;
10
+ divider(): void;
11
+ }
1
12
  interface ChatOptions {
2
13
  effort?: string;
3
14
  maxTokens?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/commands/chat.ts"],"names":[],"mappings":"AA4CA,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAkVrE"}
1
+ {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/commands/chat.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,MAAM;IACrB,YAAY,CAAC,GAAG,EAAE,MAAM,GA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