composto-ai 0.6.0 → 0.6.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 +39 -26
- package/dist/index.js +16 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
# Composto
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Causal memory layer for coding agents. Catches the bug your agent is about to reintroduce.**
|
|
4
4
|
|
|
5
|
-
Composto
|
|
5
|
+
Composto is a repo-local graph of your git history that your AI coding agent consults before every edit. When a file was reverted recently, has a fix cluster in its history, or was last touched by someone who left the team, Composto surfaces that signal as in-context guidance before the agent writes the code. Hook-enforced on Claude Code, Cursor, and Gemini CLI. Local-first, MIT.
|
|
6
6
|
|
|
7
7
|
```
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
CASE:"L3" → RET options.code
|
|
8
|
+
$ composto impact src/memory/signals/hotspot.ts
|
|
9
|
+
|
|
10
|
+
verdict: medium
|
|
11
|
+
score: 0.52
|
|
12
|
+
confidence: 0.50
|
|
13
|
+
signals:
|
|
14
|
+
revert_match ■■■■■■■■■■ strength=1.00 precision=1.00
|
|
15
|
+
hotspot ■ strength=0.10 precision=0.54
|
|
16
|
+
fix_ratio ■ strength=0.07 precision=0.54
|
|
17
|
+
author_churn · strength=0.00 precision=0.16
|
|
18
|
+
|
|
19
|
+
# This file was touched by a Revert commit in history.
|
|
20
|
+
# blastradius remembers. Your LLM couldn't.
|
|
22
21
|
```
|
|
23
22
|
|
|
24
23
|
---
|
|
@@ -29,21 +28,35 @@ OUT FN:generateLayer(layer: IRLayer, options: {...})
|
|
|
29
28
|
# Install
|
|
30
29
|
npm install -g composto-ai
|
|
31
30
|
|
|
32
|
-
#
|
|
33
|
-
|
|
31
|
+
# One-command setup, wires MCP + PreToolUse hook into your AI client
|
|
32
|
+
cd your-project
|
|
33
|
+
composto init --client=claude-code # or cursor, or gemini-cli
|
|
34
34
|
|
|
35
|
-
#
|
|
36
|
-
|
|
35
|
+
# Restart your AI client. Hook fires on every Edit / Write / MultiEdit.
|
|
36
|
+
# On medium|high|unknown verdicts, the agent gets a composto_blastradius
|
|
37
|
+
# block in context before it acts. Passthrough on low.
|
|
37
38
|
|
|
38
|
-
#
|
|
39
|
-
composto
|
|
39
|
+
# Observe
|
|
40
|
+
composto stats # hook invocations, verdict distribution, latency
|
|
41
|
+
composto stats --disable # local-only opt-out (writes .composto/telemetry-disabled)
|
|
40
42
|
|
|
41
|
-
#
|
|
42
|
-
COMPOSTO_BLASTRADIUS=1 composto index
|
|
43
|
+
# Query on demand
|
|
43
44
|
composto impact src/auth/login.ts
|
|
44
|
-
composto index --status
|
|
45
|
+
composto index --status # diagnostics: schema, freshness, calibration
|
|
45
46
|
```
|
|
46
47
|
|
|
48
|
+
### Also in the box: AST compression tools
|
|
49
|
+
|
|
50
|
+
Composto also ships a tree-sitter based AST compressor (about 89% token savings) and a smart context packer for bug-fix tasks. These are separate from the causal layer but live in the same binary.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
composto ir src/app.ts # compress a file to IR (L0/L1/L2/L3)
|
|
54
|
+
composto context src/ --budget 2000 # smart context within a token budget
|
|
55
|
+
composto benchmark . # see compression stats
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
See the [IR Layers](#ir-layers), [Health-Aware IR](#health-aware-ir), and [Context Budget](#context-budget) sections below for details.
|
|
59
|
+
|
|
47
60
|
### MCP plugin (Claude Code, Cursor, Claude Desktop)
|
|
48
61
|
|
|
49
62
|
The MCP server is bundled inside `composto-ai`. Install the package globally first, then register the server with your client:
|
|
@@ -175,7 +188,7 @@ composto index --status # diagnostics: schema, freshness, calibration
|
|
|
175
188
|
|
|
176
189
|
---
|
|
177
190
|
|
|
178
|
-
## BlastRadius
|
|
191
|
+
## BlastRadius
|
|
179
192
|
|
|
180
193
|
Beyond compression, Composto indexes your repo's git history into a local SQLite graph and exposes it as a queryable risk surface. Before your agent edits a file, it can ask: *"has this region been reverted? who fixed the last similar bug? is the last author still around?"* — signals no LLM can infer from current code alone.
|
|
181
194
|
|
package/dist/index.js
CHANGED
|
@@ -3065,7 +3065,14 @@ function writeCursorHooks(projectPath, result) {
|
|
|
3065
3065
|
function initCursor(projectPath, result) {
|
|
3066
3066
|
writeJsonMerged(
|
|
3067
3067
|
join7(projectPath, ".cursor", "mcp.json"),
|
|
3068
|
-
{
|
|
3068
|
+
{
|
|
3069
|
+
mcpServers: {
|
|
3070
|
+
composto: {
|
|
3071
|
+
command: "composto-mcp",
|
|
3072
|
+
env: { COMPOSTO_BLASTRADIUS: "1" }
|
|
3073
|
+
}
|
|
3074
|
+
}
|
|
3075
|
+
},
|
|
3069
3076
|
result,
|
|
3070
3077
|
".cursor/mcp.json"
|
|
3071
3078
|
);
|
|
@@ -3084,7 +3091,10 @@ function initClaudeCode(projectPath, result) {
|
|
|
3084
3091
|
const existing = readJsonIfExists(settingsPath);
|
|
3085
3092
|
const mcpServers = {
|
|
3086
3093
|
...existing.mcpServers ?? {},
|
|
3087
|
-
composto: {
|
|
3094
|
+
composto: {
|
|
3095
|
+
command: "composto-mcp",
|
|
3096
|
+
env: { COMPOSTO_BLASTRADIUS: "1" }
|
|
3097
|
+
}
|
|
3088
3098
|
};
|
|
3089
3099
|
const compostoHookEntry = {
|
|
3090
3100
|
matcher: "Edit|Write|MultiEdit",
|
|
@@ -3116,7 +3126,10 @@ function initGeminiCli(_projectPath, result, options) {
|
|
|
3116
3126
|
const existing = readJsonIfExists(settingsPath);
|
|
3117
3127
|
const mcpServers = {
|
|
3118
3128
|
...existing.mcpServers ?? {},
|
|
3119
|
-
composto: {
|
|
3129
|
+
composto: {
|
|
3130
|
+
command: "composto-mcp",
|
|
3131
|
+
env: { COMPOSTO_BLASTRADIUS: "1" }
|
|
3132
|
+
}
|
|
3120
3133
|
};
|
|
3121
3134
|
const compostoHookEntry = {
|
|
3122
3135
|
matcher: "edit_file|write_file|replace",
|