soturail 0.2.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/LICENSE +21 -0
- package/README.md +205 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +54 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/bench.d.ts +31 -0
- package/dist/commands/bench.js +387 -0
- package/dist/commands/bench.js.map +1 -0
- package/dist/commands/dedupe.d.ts +2 -0
- package/dist/commands/dedupe.js +16 -0
- package/dist/commands/dedupe.js.map +1 -0
- package/dist/commands/doctor.d.ts +14 -0
- package/dist/commands/doctor.js +122 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/expand.d.ts +3 -0
- package/dist/commands/expand.js +23 -0
- package/dist/commands/expand.js.map +1 -0
- package/dist/commands/format.d.ts +6 -0
- package/dist/commands/format.js +48 -0
- package/dist/commands/format.js.map +1 -0
- package/dist/commands/hooks.d.ts +11 -0
- package/dist/commands/hooks.js +248 -0
- package/dist/commands/hooks.js.map +1 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.js +28 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/ingest.d.ts +6 -0
- package/dist/commands/ingest.js +52 -0
- package/dist/commands/ingest.js.map +1 -0
- package/dist/commands/init.d.ts +7 -0
- package/dist/commands/init.js +179 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/memory.d.ts +39 -0
- package/dist/commands/memory.js +184 -0
- package/dist/commands/memory.js.map +1 -0
- package/dist/commands/native.d.ts +2 -0
- package/dist/commands/native.js +17 -0
- package/dist/commands/native.js.map +1 -0
- package/dist/commands/read.d.ts +8 -0
- package/dist/commands/read.js +87 -0
- package/dist/commands/read.js.map +1 -0
- package/dist/commands/rules.d.ts +5 -0
- package/dist/commands/rules.js +62 -0
- package/dist/commands/rules.js.map +1 -0
- package/dist/commands/run.d.ts +22 -0
- package/dist/commands/run.js +200 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/spec.d.ts +11 -0
- package/dist/commands/spec.js +217 -0
- package/dist/commands/spec.js.map +1 -0
- package/dist/commands/stats.d.ts +15 -0
- package/dist/commands/stats.js +82 -0
- package/dist/commands/stats.js.map +1 -0
- package/dist/compressors/agent-response-reducer.d.ts +13 -0
- package/dist/compressors/agent-response-reducer.js +160 -0
- package/dist/compressors/agent-response-reducer.js.map +1 -0
- package/dist/compressors/generic-stream.d.ts +6 -0
- package/dist/compressors/generic-stream.js +63 -0
- package/dist/compressors/generic-stream.js.map +1 -0
- package/dist/compressors/git-reducer.d.ts +2 -0
- package/dist/compressors/git-reducer.js +78 -0
- package/dist/compressors/git-reducer.js.map +1 -0
- package/dist/compressors/index.d.ts +10 -0
- package/dist/compressors/index.js +84 -0
- package/dist/compressors/index.js.map +1 -0
- package/dist/compressors/json-toon.d.ts +14 -0
- package/dist/compressors/json-toon.js +149 -0
- package/dist/compressors/json-toon.js.map +1 -0
- package/dist/compressors/test-reducer.d.ts +2 -0
- package/dist/compressors/test-reducer.js +50 -0
- package/dist/compressors/test-reducer.js.map +1 -0
- package/dist/core/cache-normalizer.d.ts +23 -0
- package/dist/core/cache-normalizer.js +170 -0
- package/dist/core/cache-normalizer.js.map +1 -0
- package/dist/core/config.d.ts +104 -0
- package/dist/core/config.js +186 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/dedupe-store.d.ts +17 -0
- package/dist/core/dedupe-store.js +44 -0
- package/dist/core/dedupe-store.js.map +1 -0
- package/dist/core/document-ingest.d.ts +15 -0
- package/dist/core/document-ingest.js +45 -0
- package/dist/core/document-ingest.js.map +1 -0
- package/dist/core/file-scanner.d.ts +47 -0
- package/dist/core/file-scanner.js +248 -0
- package/dist/core/file-scanner.js.map +1 -0
- package/dist/core/git.d.ts +2 -0
- package/dist/core/git.js +29 -0
- package/dist/core/git.js.map +1 -0
- package/dist/core/metrics-store.d.ts +20 -0
- package/dist/core/metrics-store.js +19 -0
- package/dist/core/metrics-store.js.map +1 -0
- package/dist/core/native-engine.d.ts +25 -0
- package/dist/core/native-engine.js +137 -0
- package/dist/core/native-engine.js.map +1 -0
- package/dist/core/native-runner-adapter.d.ts +18 -0
- package/dist/core/native-runner-adapter.js +60 -0
- package/dist/core/native-runner-adapter.js.map +1 -0
- package/dist/core/raw-store.d.ts +28 -0
- package/dist/core/raw-store.js +57 -0
- package/dist/core/raw-store.js.map +1 -0
- package/dist/core/response-policy.d.ts +11 -0
- package/dist/core/response-policy.js +14 -0
- package/dist/core/response-policy.js.map +1 -0
- package/dist/core/rule-extractor.d.ts +18 -0
- package/dist/core/rule-extractor.js +116 -0
- package/dist/core/rule-extractor.js.map +1 -0
- package/dist/core/rule-validator.d.ts +9 -0
- package/dist/core/rule-validator.js +85 -0
- package/dist/core/rule-validator.js.map +1 -0
- package/dist/core/safety-policy.d.ts +10 -0
- package/dist/core/safety-policy.js +69 -0
- package/dist/core/safety-policy.js.map +1 -0
- package/dist/core/token-estimator.d.ts +2 -0
- package/dist/core/token-estimator.js +7 -0
- package/dist/core/token-estimator.js.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/docs/architecture.md +47 -0
- package/docs/assets/screenshots/README.md +18 -0
- package/docs/assets/screenshots/init.svg +13 -0
- package/docs/assets/screenshots/run-expand.svg +13 -0
- package/docs/assets/screenshots/stats.svg +11 -0
- package/docs/assets/soturail-fox.svg +17 -0
- package/docs/assets/soturail-icon.svg +10 -0
- package/docs/benchmarking.md +34 -0
- package/docs/branding.md +14 -0
- package/docs/hooks/claude.md +24 -0
- package/docs/hooks/codex.md +5 -0
- package/docs/hooks/cursor.md +5 -0
- package/docs/hooks/gemini.md +5 -0
- package/docs/hooks/host-capabilities.json +22 -0
- package/docs/hooks.md +15 -0
- package/docs/knowledge-to-rules.md +23 -0
- package/docs/metrics.md +35 -0
- package/docs/mvp.md +21 -0
- package/docs/native-runner.md +52 -0
- package/docs/prompt-caching.md +27 -0
- package/docs/pt-BR/visao-geral.md +26 -0
- package/docs/public-roadmap.md +20 -0
- package/docs/reducers.md +19 -0
- package/docs/release-checklist.md +13 -0
- package/docs/response-compression.md +15 -0
- package/docs/rules.md +23 -0
- package/docs/security-model.md +32 -0
- package/docs/spec-driven-workflow.md +22 -0
- package/docs/usage.md +64 -0
- package/package.json +71 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rafael Ryan Ramos de Souza
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="docs/assets/soturail-fox.svg" alt="SotuRail fox logo" width="180" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# SotuRail
|
|
6
|
+
|
|
7
|
+
[](package.json)
|
|
8
|
+
[](tsconfig.json)
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
[](https://github.com/Soturine/soturail/actions/workflows/ci.yml)
|
|
11
|
+
[](docs/security-model.md)
|
|
12
|
+
[](docs/prompt-caching.md)
|
|
13
|
+
|
|
14
|
+
SotuRail — Local-first context rails for AI coding agents.
|
|
15
|
+
SotuRail — trilhos locais de contexto para agentes de IA.
|
|
16
|
+
|
|
17
|
+
## 1. What Is SotuRail?
|
|
18
|
+
|
|
19
|
+
SotuRail is a local-first Context OS for AI coding agents such as Claude Code, Codex CLI, Gemini CLI, Cursor and similar tools.
|
|
20
|
+
|
|
21
|
+
It wraps a repository and terminal session with reversible evidence rails: heuristic repo maps, progressive file reading, safe command execution, raw log recovery, reducers, prompt-cache-friendly blocks, Spec-Driven Development artifacts, local memory, hooks, benchmarks and rules extraction.
|
|
22
|
+
|
|
23
|
+
## Project Status
|
|
24
|
+
|
|
25
|
+
v0.2.x is early but functional. TypeScript mode is stable for local usage. Native Rust mode is optional and focused on hot paths. Benchmarks are local and reproducible. External comparisons are optional and user-provided.
|
|
26
|
+
|
|
27
|
+
## 2. Why SotuRail Exists
|
|
28
|
+
|
|
29
|
+
AI coding agents often receive too much unstable context: full files, noisy test logs, repeated terminal output and long conversational summaries. SotuRail is designed to unify those workflows into one independent local-first tool without sending telemetry or inventing provider metrics.
|
|
30
|
+
|
|
31
|
+
## 3. Key Features
|
|
32
|
+
|
|
33
|
+
- Heuristic Repo Map with cross-platform ignore handling.
|
|
34
|
+
- Progressive reader for large files with reversible collapsed ranges.
|
|
35
|
+
- Safe tee-stream runner with raw log preservation.
|
|
36
|
+
- Git, test, JSON and generic terminal reducers.
|
|
37
|
+
- Optional Rust native reducer and runner hot paths with TypeScript fallback.
|
|
38
|
+
- Cross-call dedupe for repeated command output.
|
|
39
|
+
- Reproducible local benchmark suite.
|
|
40
|
+
- Agent response compression modes.
|
|
41
|
+
- Knowledge-to-Rules ingestion and validators.
|
|
42
|
+
- Prompt-only and hook-style agent integrations.
|
|
43
|
+
- SDD specs, approved memory and cache block normalization.
|
|
44
|
+
- Honest local metrics.
|
|
45
|
+
|
|
46
|
+
## 4. How It Differs Conceptually
|
|
47
|
+
|
|
48
|
+
SotuRail is an independent implementation. It may be conceptually adjacent to terminal reducers, host hook systems, Spec-Driven Development kits and memory tools, but it does not depend on RTK, Squeez, Spec Kit, Caveman, MemPalace or proprietary workflows.
|
|
49
|
+
|
|
50
|
+
SotuRail aims to unify these ideas into one local-first workflow: reversible raw logs, safety policy, benchmarks, prompt cache ordering, specs, memory, hooks and rules.
|
|
51
|
+
|
|
52
|
+
## 5. Installation
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm install
|
|
56
|
+
npm run build
|
|
57
|
+
npm link
|
|
58
|
+
soturail --help
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Rust is optional. TypeScript builds do not require Rust.
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm run build:native # optional, requires cargo
|
|
65
|
+
npm run build:all # TypeScript + native, requires cargo
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Native Performance Path
|
|
69
|
+
|
|
70
|
+
TypeScript remains the public CLI, orchestration, docs and npm distribution layer. Rust handles optional hot paths where streaming, low overhead and binary execution matter:
|
|
71
|
+
|
|
72
|
+
- native terminal reducers;
|
|
73
|
+
- native JSON/tool payload reducer;
|
|
74
|
+
- native tee-stream runner with raw log and summary sidecar support.
|
|
75
|
+
|
|
76
|
+
SotuRail does not claim native speedups unless local benchmark results show them for your machine.
|
|
77
|
+
|
|
78
|
+
## 6. Quick Start
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
soturail init
|
|
82
|
+
soturail index
|
|
83
|
+
soturail read README.md --query "quick start"
|
|
84
|
+
soturail run npm test
|
|
85
|
+
soturail expand <raw_id>
|
|
86
|
+
soturail stats
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 7. Commands
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
soturail init
|
|
93
|
+
soturail index
|
|
94
|
+
soturail read <file> --query "goal"
|
|
95
|
+
soturail run --engine auto <command...>
|
|
96
|
+
soturail run --engine native <command...>
|
|
97
|
+
soturail expand <raw_id>
|
|
98
|
+
soturail bench prepare
|
|
99
|
+
soturail bench run --engine ts
|
|
100
|
+
soturail hooks list
|
|
101
|
+
soturail format README.md --mode concise
|
|
102
|
+
soturail ingest README.md --type docs
|
|
103
|
+
soturail rules check
|
|
104
|
+
soturail spec status
|
|
105
|
+
soturail memory propose "decision"
|
|
106
|
+
soturail doctor cache
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## 8. Benchmarks
|
|
110
|
+
|
|
111
|
+
SotuRail includes deterministic local fixtures for terminal compression, agent response compression, JSON/tool payload compression, Knowledge-to-Rules structuring and native performance readiness.
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npm run build
|
|
115
|
+
soturail bench prepare
|
|
116
|
+
soturail bench run --engine ts
|
|
117
|
+
soturail bench report
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The latest report is written to [benchmarks/reports/latest.md](benchmarks/reports/latest.md). External comparisons are optional and user-provided only:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
soturail bench compare-optional --tool rtk
|
|
124
|
+
soturail bench compare-optional --tool squeez
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Benchmark Interpretation
|
|
128
|
+
|
|
129
|
+
- Terminal compression measures how reducers shrink logs while preserving errors, paths and recovery links.
|
|
130
|
+
- Agent response compression measures deterministic formatting modes.
|
|
131
|
+
- JSON/tool payload compression preserves relevant primitive values while collapsing repetitive structure.
|
|
132
|
+
- Knowledge-to-Rules is reusable structuring, not pure compression; structured rules can be larger than a tiny source document because they add citations and validator metadata.
|
|
133
|
+
- Native performance compares Rust and TypeScript only when `soturail-native` is built locally.
|
|
134
|
+
|
|
135
|
+
## 9. Agent Hooks
|
|
136
|
+
|
|
137
|
+
SotuRail provides cautious hook scaffolding and prompt-only fallbacks:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
soturail hooks list
|
|
141
|
+
soturail hooks doctor
|
|
142
|
+
soturail hooks install claude --dry-run
|
|
143
|
+
soturail hooks prompt-only codex
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Host APIs vary, so SotuRail never writes guessed config without showing the target and creating backups for existing files.
|
|
147
|
+
|
|
148
|
+
## 10. Agent Response Compression
|
|
149
|
+
|
|
150
|
+
SotuRail includes Caveman-like output compression as inspiration, implemented independently with professional modes:
|
|
151
|
+
|
|
152
|
+
- `normal`
|
|
153
|
+
- `concise`
|
|
154
|
+
- `ultra`
|
|
155
|
+
- `review`
|
|
156
|
+
- `commit`
|
|
157
|
+
- `debug`
|
|
158
|
+
- `docs`
|
|
159
|
+
|
|
160
|
+
It preserves fenced code blocks, shell commands, file paths, line numbers, security warnings and failure details using deterministic reducers. See [docs/response-compression.md](docs/response-compression.md).
|
|
161
|
+
|
|
162
|
+
## 11. Knowledge-to-Rules Engine
|
|
163
|
+
|
|
164
|
+
SotuRail can ingest Markdown, TXT, JSON and YAML into structured YAML/JSON rules, checklists, citations and simple validators.
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
soturail ingest docs/requirements.md --type requirements
|
|
168
|
+
soturail rules list
|
|
169
|
+
soturail rules check
|
|
170
|
+
soturail rules export --format yaml
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
This makes heavy docs smaller, reusable and auditable without inventing rules that do not appear in the source. See [docs/knowledge-to-rules.md](docs/knowledge-to-rules.md).
|
|
174
|
+
|
|
175
|
+
## 12. Prompt Caching Design
|
|
176
|
+
|
|
177
|
+
Stable blocks are ordered before dynamic data:
|
|
178
|
+
|
|
179
|
+
1. static_header
|
|
180
|
+
2. governance
|
|
181
|
+
3. config
|
|
182
|
+
4. repo_map
|
|
183
|
+
5. approved_specs
|
|
184
|
+
6. approved_memory
|
|
185
|
+
7. dynamic_footer
|
|
186
|
+
|
|
187
|
+
SotuRail reports estimated cache stability only. It never claims real provider cache hits unless imported metadata exists.
|
|
188
|
+
|
|
189
|
+
## 13. Security Model
|
|
190
|
+
|
|
191
|
+
`soturail run` blocks dangerous patterns by default, including `rm -rf`, `sudo`, `format`, `dd if=`, `curl | sh`, `del /s` and `git push`.
|
|
192
|
+
|
|
193
|
+
Raw logs may contain secrets because they preserve real terminal output. Treat `.soturail/raw/` as local evidence, not public artifact material.
|
|
194
|
+
|
|
195
|
+
## 14. Roadmap
|
|
196
|
+
|
|
197
|
+
See [ROADMAP.md](ROADMAP.md). v0.3.0 focuses on deeper native paths, MCP, hardened PDF extraction, semantic memory approval, Tree-sitter repo maps and optional local embeddings.
|
|
198
|
+
|
|
199
|
+
## 15. Contributing
|
|
200
|
+
|
|
201
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Reducers, hooks and rules should include tests, safety notes and benchmark impact when relevant.
|
|
202
|
+
|
|
203
|
+
## 16. License
|
|
204
|
+
|
|
205
|
+
MIT © Rafael Ryan Ramos de Souza
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
import { registerBenchCommand } from "./commands/bench.js";
|
|
6
|
+
import { registerDedupeCommand } from "./commands/dedupe.js";
|
|
7
|
+
import { registerDoctorCommand } from "./commands/doctor.js";
|
|
8
|
+
import { registerExpandCommand } from "./commands/expand.js";
|
|
9
|
+
import { registerFormatCommand } from "./commands/format.js";
|
|
10
|
+
import { registerHooksCommand } from "./commands/hooks.js";
|
|
11
|
+
import { registerIngestCommand } from "./commands/ingest.js";
|
|
12
|
+
import { registerIndexCommand } from "./commands/index.js";
|
|
13
|
+
import { registerInitCommand } from "./commands/init.js";
|
|
14
|
+
import { registerMemoryCommand } from "./commands/memory.js";
|
|
15
|
+
import { registerNativeCommand } from "./commands/native.js";
|
|
16
|
+
import { registerReadCommand } from "./commands/read.js";
|
|
17
|
+
import { registerRunCommand } from "./commands/run.js";
|
|
18
|
+
import { registerRulesCommand } from "./commands/rules.js";
|
|
19
|
+
import { registerSpecCommand } from "./commands/spec.js";
|
|
20
|
+
import { registerStatsCommand } from "./commands/stats.js";
|
|
21
|
+
export function buildProgram() {
|
|
22
|
+
const program = new Command();
|
|
23
|
+
program
|
|
24
|
+
.name("soturail")
|
|
25
|
+
.description("Local-first Context OS rails for AI coding agents.")
|
|
26
|
+
.version("0.2.1")
|
|
27
|
+
.showHelpAfterError();
|
|
28
|
+
registerInitCommand(program);
|
|
29
|
+
registerIndexCommand(program);
|
|
30
|
+
registerReadCommand(program);
|
|
31
|
+
registerRunCommand(program);
|
|
32
|
+
registerBenchCommand(program);
|
|
33
|
+
registerDedupeCommand(program);
|
|
34
|
+
registerExpandCommand(program);
|
|
35
|
+
registerFormatCommand(program);
|
|
36
|
+
registerHooksCommand(program);
|
|
37
|
+
registerIngestCommand(program);
|
|
38
|
+
registerSpecCommand(program);
|
|
39
|
+
registerMemoryCommand(program);
|
|
40
|
+
registerNativeCommand(program);
|
|
41
|
+
registerRulesCommand(program);
|
|
42
|
+
registerDoctorCommand(program);
|
|
43
|
+
registerStatsCommand(program);
|
|
44
|
+
return program;
|
|
45
|
+
}
|
|
46
|
+
const currentFile = fileURLToPath(import.meta.url);
|
|
47
|
+
if (process.argv[1] && path.resolve(process.argv[1]) === currentFile) {
|
|
48
|
+
buildProgram().parseAsync(process.argv).catch((error) => {
|
|
49
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
50
|
+
process.stderr.write(`SotuRail error: ${message}\n`);
|
|
51
|
+
process.exitCode = 1;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
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vE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,OAAO,IAAI,CAAC,CAAC;QACrD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import { type ReducerEngine } from "../core/native-engine.js";
|
|
3
|
+
interface BenchOptions {
|
|
4
|
+
engine?: ReducerEngine;
|
|
5
|
+
tool?: string;
|
|
6
|
+
}
|
|
7
|
+
interface BenchResult {
|
|
8
|
+
name: string;
|
|
9
|
+
category: "terminal_compression" | "agent_response_compression" | "json_tool_payload_compression" | "knowledge_structuring" | "native_performance";
|
|
10
|
+
engine: string;
|
|
11
|
+
raw_bytes: number;
|
|
12
|
+
reduced_bytes: number;
|
|
13
|
+
estimated_raw_tokens: number;
|
|
14
|
+
estimated_reduced_tokens: number;
|
|
15
|
+
compression_ratio_percent: number | null;
|
|
16
|
+
wall_time_ms: number;
|
|
17
|
+
preserved_error_lines_count: number;
|
|
18
|
+
preserved_file_paths_count: number;
|
|
19
|
+
raw_id: string | null;
|
|
20
|
+
raw_sha256: string;
|
|
21
|
+
reduced_sha256: string;
|
|
22
|
+
quality_passed: boolean;
|
|
23
|
+
details: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export declare function prepareBenchmarks(root?: string): Promise<string>;
|
|
26
|
+
export declare function runBenchmarks(options?: BenchOptions, root?: string): Promise<BenchResult[]>;
|
|
27
|
+
export declare function compareEngines(root?: string): Promise<string>;
|
|
28
|
+
export declare function reportBenchmarks(root?: string): Promise<string>;
|
|
29
|
+
export declare function compareOptional(tool: string, root?: string): Promise<string>;
|
|
30
|
+
export declare function registerBenchCommand(program: Command): void;
|
|
31
|
+
export {};
|