make-laten 1.0.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/README.md +132 -0
- package/dist/cli/index.js +1302 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/index.mjs +1279 -0
- package/dist/cli/index.mjs.map +1 -0
- package/dist/index.js +2036 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1946 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +64 -0
package/README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# make-laten
|
|
2
|
+
|
|
3
|
+
Universal efficiency toolkit for AI coding agents — compress, cache, route, and optimize token usage.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
make-laten reduces token consumption when working with AI coding agents by compressing outputs, caching results, and routing operations intelligently.
|
|
8
|
+
|
|
9
|
+
**Token savings:** 60-90% reduction across file reads, grep, git diff, and web fetches.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g make-laten
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## CLI Commands
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Compressed file read (89% savings)
|
|
21
|
+
make-laten read src/index.ts
|
|
22
|
+
|
|
23
|
+
# Compressed grep with file grouping
|
|
24
|
+
make-laten grep "TODO" src/
|
|
25
|
+
|
|
26
|
+
# Compressed git diff
|
|
27
|
+
make-laten git diff
|
|
28
|
+
make-laten git diff --staged
|
|
29
|
+
make-laten git status
|
|
30
|
+
|
|
31
|
+
# Web search (via DuckDuckGo)
|
|
32
|
+
make-laten search "typescript generics"
|
|
33
|
+
|
|
34
|
+
# Web fetch + semantic extraction + compression
|
|
35
|
+
make-laten fetch https://docs.example.com
|
|
36
|
+
|
|
37
|
+
# Cache management
|
|
38
|
+
make-laten cache stats
|
|
39
|
+
make-laten cache clear
|
|
40
|
+
|
|
41
|
+
# Install adapters for detected agents
|
|
42
|
+
make-laten install
|
|
43
|
+
make-laten install --status
|
|
44
|
+
make-laten install --uninstall
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Programmatic Usage
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import {
|
|
51
|
+
FileReadCompressor,
|
|
52
|
+
GrepCompressor,
|
|
53
|
+
GitDiffCompressor,
|
|
54
|
+
SemanticCache,
|
|
55
|
+
WebRouter,
|
|
56
|
+
getAdapter,
|
|
57
|
+
createInstaller
|
|
58
|
+
} from 'make-laten'
|
|
59
|
+
|
|
60
|
+
// Compress file reads
|
|
61
|
+
const compressor = new FileReadCompressor()
|
|
62
|
+
const result = await compressor.compress({
|
|
63
|
+
content: readFile('src/main.ts'),
|
|
64
|
+
filePath: 'src/main.ts',
|
|
65
|
+
language: 'typescript'
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
// Semantic web search
|
|
69
|
+
const web = new WebRouter()
|
|
70
|
+
const results = await web.search('how to use async await')
|
|
71
|
+
const page = await web.fetch('https://example.com/docs')
|
|
72
|
+
|
|
73
|
+
// Cache with cosine similarity
|
|
74
|
+
const cache = new SemanticCache()
|
|
75
|
+
cache.set('key1', { content: 'docs', embedding: [0.1, 0.2], metadata: {} })
|
|
76
|
+
const similar = cache.search([0.1, 0.2], 0.8)
|
|
77
|
+
|
|
78
|
+
// Agent adapters
|
|
79
|
+
const installer = createInstaller()
|
|
80
|
+
await installer.install()
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Modules
|
|
84
|
+
|
|
85
|
+
| Module | Description |
|
|
86
|
+
|--------|-------------|
|
|
87
|
+
| `compress` | File read, grep, git diff, output compressors |
|
|
88
|
+
| `cache` | L1 session cache, L2 cross-session, L3 semantic (cosine similarity) |
|
|
89
|
+
| `graph` | Knowledge graph for operation patterns |
|
|
90
|
+
| `route` | Smart routing between compression strategies |
|
|
91
|
+
| `tool` | Tool router with pattern matching |
|
|
92
|
+
| `adapter` | Agent adapters (Claude Code, Codex, Gemini, Cursor, etc.) |
|
|
93
|
+
| `learn` | Pattern mining and failure learning |
|
|
94
|
+
| `correct` | Auto-correction engine |
|
|
95
|
+
| `web` | Web search, fetch, semantic extraction |
|
|
96
|
+
| `middleware` | Middleware pipeline |
|
|
97
|
+
| `plugin` | Plugin system with lifecycle |
|
|
98
|
+
| `security` | Rate limiter |
|
|
99
|
+
| `logging` | Structured logger |
|
|
100
|
+
| `error` | Error handler with suggestions |
|
|
101
|
+
| `metrics` | Counters, gauges, histograms |
|
|
102
|
+
| `session` | Session manager with timeout |
|
|
103
|
+
|
|
104
|
+
## Supported Agents
|
|
105
|
+
|
|
106
|
+
make-laten works with 7+ AI coding agents:
|
|
107
|
+
|
|
108
|
+
- **Claude Code** — hook-based interception
|
|
109
|
+
- **Codex** — hook-based interception
|
|
110
|
+
- **Gemini CLI** — hook-based interception
|
|
111
|
+
- **Cursor** — rules injection
|
|
112
|
+
- **Windsurf** — rules injection
|
|
113
|
+
- **Cline** — rules injection
|
|
114
|
+
- **GitHub Copilot** — rules injection
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Auto-detect and configure
|
|
118
|
+
make-laten install
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Development
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
npm install
|
|
125
|
+
npm test # Run 201 tests
|
|
126
|
+
npm run build # Build CJS + ESM
|
|
127
|
+
npm run typecheck # Type check
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## License
|
|
131
|
+
|
|
132
|
+
MIT
|