@brunobracaioli/aibrain 0.0.0-stage → 0.2.0-beta.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 +57 -2
- package/dist/assets/claude/.claude-plugin/plugin.json +99 -0
- package/dist/assets/claude/hooks/context-compaction.ts +1355 -0
- package/dist/assets/claude/hooks/hooks.json +3 -0
- package/dist/assets/codex-context-compaction.mjs +1590 -0
- package/dist/assets/jev-paid-pilot-terminal.mjs +321 -0
- package/dist/cli.mjs +485 -0
- package/dist/launch.mjs +318 -0
- package/dist/mcp.mjs +640 -0
- package/dist/monitor.mjs +122 -0
- package/dist/package.json +5 -0
- package/dist/platform.mjs +82 -0
- package/dist/policy.mjs +218 -0
- package/dist/state.mjs +305 -0
- package/package.json +23 -4
package/README.md
CHANGED
|
@@ -1,3 +1,58 @@
|
|
|
1
|
-
#
|
|
1
|
+
# aibrain
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Assisted AI Brain context beta client for Linux/WSL with Node.js 22 or newer.
|
|
4
|
+
|
|
5
|
+
The reviewed native compatibility set is Claude Code 2.1.294, 2.1.295, or
|
|
6
|
+
2.1.296, and Codex CLI 0.161.0, 0.162.0 or 0.162.1. Other versions require a new
|
|
7
|
+
compatibility review before setup.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
# Install the published beta:
|
|
11
|
+
npm install -g @brunobracaioli/aibrain@beta
|
|
12
|
+
aibrain setup --client both
|
|
13
|
+
aibrain doctor --json
|
|
14
|
+
aibrain claude
|
|
15
|
+
aibrain codex
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Installation does not contact AI Brain, change native client configuration, or
|
|
19
|
+
enable all paid accounts. Setup requires an existing AI Brain PAT, explicit
|
|
20
|
+
versioned disclosure, and successful provider-free pilot access. Claude and
|
|
21
|
+
Codex continue to own their own authentication. Windows native is unsupported;
|
|
22
|
+
run the beta inside WSL. Pricing and general customer activation are outside
|
|
23
|
+
this beta.
|
|
24
|
+
|
|
25
|
+
For reviewed noninteractive automation only, use a private token file and
|
|
26
|
+
explicitly acknowledge the displayed disclosure with
|
|
27
|
+
`aibrain setup --client both --token-file /private/path/brain.pat
|
|
28
|
+
--accept-disclosure`.
|
|
29
|
+
|
|
30
|
+
For a CI-reviewed tarball, use
|
|
31
|
+
`brunobracaioli-aibrain-*.tgz` with
|
|
32
|
+
`npm install -g ./brunobracaioli-aibrain-*.tgz`; registry installation is gated on
|
|
33
|
+
the operator's npm review and authentication.
|
|
34
|
+
|
|
35
|
+
For users of an earlier unscoped review tarball, close its client sessions,
|
|
36
|
+
run `npm uninstall -g aibrain`, and install this scoped package. Local
|
|
37
|
+
`~/.aibrain` state, notes, and checkpoints are retained.
|
|
38
|
+
|
|
39
|
+
This `0.2` client adds configurable context profiles. A fresh
|
|
40
|
+
setup defaults to `upstream`: 60% trigger, 0.5 keep threshold, six recent items
|
|
41
|
+
protected, and broader completed text-tool eligibility in Claude. Existing
|
|
42
|
+
schema1 configurations keep their previous behavior. After a reviewed v2 backend
|
|
43
|
+
and client release, opt in explicitly with:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
aibrain setup --client both --context-profile upstream
|
|
47
|
+
# Or retain conservative retention with the v2 protocol:
|
|
48
|
+
aibrain setup --client both --context-profile conservative
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Use `aibrain --help` for individual overrides. Claude-only flags are rejected for
|
|
52
|
+
Codex-only setup. Status and doctor show effective settings without custom goal
|
|
53
|
+
text; they do not claim that a live session is being monitored. Codex keeps native
|
|
54
|
+
compaction and recovery notes in the same thread. The backend checks paid access
|
|
55
|
+
and unchanged shared quotas before any JEV request.
|
|
56
|
+
|
|
57
|
+
Read the [canonical subscriber beta guide](https://github.com/brunobracaioli/mcp-ai-brain/blob/main/docs/how-to/aibrain-subscriber-beta.md)
|
|
58
|
+
for setup, support, disclosure, limits, and disable procedures.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ai-brain-context-compaction",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"author": { "name": "AISAC" },
|
|
5
|
+
"description": "AI Brain paid-plan context monitoring with conservative Claude compaction fallback.",
|
|
6
|
+
"hooks": "./hooks/hooks.json",
|
|
7
|
+
"userConfig": {
|
|
8
|
+
"policyVersion": {
|
|
9
|
+
"type": "number",
|
|
10
|
+
"title": "Context policy version",
|
|
11
|
+
"description": "Use 2 for configurable broader parity; omit or use 1 to preserve legacy behavior.",
|
|
12
|
+
"default": 1
|
|
13
|
+
},
|
|
14
|
+
"brainServer": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"title": "AI Brain MCP server",
|
|
17
|
+
"description": "The name of the already authenticated AI Brain MCP server. The hook uses that connection and never accepts a JEV key.",
|
|
18
|
+
"default": "brain"
|
|
19
|
+
},
|
|
20
|
+
"compactAtPercent": {
|
|
21
|
+
"type": "number",
|
|
22
|
+
"title": "Context threshold",
|
|
23
|
+
"description": "Request host compaction at or above this reported context percentage.",
|
|
24
|
+
"default": 85
|
|
25
|
+
},
|
|
26
|
+
"keepThreshold": {
|
|
27
|
+
"type": "number",
|
|
28
|
+
"title": "JEV keep threshold",
|
|
29
|
+
"description": "V2 score threshold for retaining eligible content.",
|
|
30
|
+
"default": 0.5
|
|
31
|
+
},
|
|
32
|
+
"preserveRecentMessages": {
|
|
33
|
+
"type": "number",
|
|
34
|
+
"title": "Recent messages to preserve",
|
|
35
|
+
"description": "Number of recent messages pinned before scoring.",
|
|
36
|
+
"default": 6
|
|
37
|
+
},
|
|
38
|
+
"minReductionRatio": {
|
|
39
|
+
"type": "number",
|
|
40
|
+
"title": "Minimum reduction ratio",
|
|
41
|
+
"description": "Minimum configured reduction required before returning a candidate.",
|
|
42
|
+
"default": 0.25
|
|
43
|
+
},
|
|
44
|
+
"truncateHeadChars": {
|
|
45
|
+
"type": "number",
|
|
46
|
+
"title": "Truncated result head characters",
|
|
47
|
+
"description": "Unicode-safe head size for eligible result truncation.",
|
|
48
|
+
"default": 300
|
|
49
|
+
},
|
|
50
|
+
"maxStateTokens": {
|
|
51
|
+
"type": "number",
|
|
52
|
+
"title": "Maximum scoring state units",
|
|
53
|
+
"description": "Upper bound for the provider scoring state.",
|
|
54
|
+
"default": 25000
|
|
55
|
+
},
|
|
56
|
+
"maxRequestTokens": {
|
|
57
|
+
"type": "number",
|
|
58
|
+
"title": "Maximum scoring request units",
|
|
59
|
+
"description": "Upper bound for the provider scoring request.",
|
|
60
|
+
"default": 30000
|
|
61
|
+
},
|
|
62
|
+
"toolPolicy": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"title": "Claude tool policy",
|
|
65
|
+
"description": "Use read_only or compatible v2 eligibility.",
|
|
66
|
+
"default": "compatible"
|
|
67
|
+
},
|
|
68
|
+
"goal": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"title": "Private task goal",
|
|
71
|
+
"description": "Optional bounded private task goal sent in the redacted projection.",
|
|
72
|
+
"default": ""
|
|
73
|
+
},
|
|
74
|
+
"enabled": {
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"title": "Enable automatic compaction",
|
|
77
|
+
"description": "Requires explicit local opt-in and AI Brain disclosure; failures use Claude's built-in fallback.",
|
|
78
|
+
"default": false
|
|
79
|
+
},
|
|
80
|
+
"disclosed": {
|
|
81
|
+
"type": "boolean",
|
|
82
|
+
"title": "Projection disclosure acknowledged",
|
|
83
|
+
"description": "Allow the redacted projection to be sent to AI Brain for the paid-gated plan.",
|
|
84
|
+
"default": false
|
|
85
|
+
},
|
|
86
|
+
"preservationMode": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"title": "Claude preservation mode",
|
|
89
|
+
"description": "preserve_internal keeps handled messages intact. upstream_compatible rebuilds selected handled read messages from exposed fields and may lose hidden engine metadata.",
|
|
90
|
+
"default": "preserve_internal"
|
|
91
|
+
},
|
|
92
|
+
"diagnosticMode": {
|
|
93
|
+
"type": "boolean",
|
|
94
|
+
"title": "Emit runtime diagnostics",
|
|
95
|
+
"description": "Opt-in content-free hook entry diagnostics for local pilot verification.",
|
|
96
|
+
"default": false
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|