cerebrex 0.3.0 → 0.3.2
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 +130 -0
- package/README.md +274 -0
- package/dist/index.js +378 -393
- package/package.json +16 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship made available under
|
|
36
|
+
the License, as indicated by a copyright notice that is included in
|
|
37
|
+
or attached to the work (an example is provided in the Appendix below).
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other transformations
|
|
42
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
43
|
+
of this License, Derivative Works shall not include works that remain
|
|
44
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
45
|
+
the Work and Derivative Works thereof.
|
|
46
|
+
|
|
47
|
+
"Contribution" shall mean, as submitted to the Licensor for inclusion
|
|
48
|
+
in the Work by You, including the original version of the Work and any
|
|
49
|
+
modifications or additions to that Work or Derivative Works of the Work.
|
|
50
|
+
|
|
51
|
+
"Contributor" shall mean Licensor and any Legal Entity on behalf of
|
|
52
|
+
whom a Contribution has been received by the Licensor.
|
|
53
|
+
|
|
54
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
55
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
56
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
57
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
58
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
59
|
+
Work and such Derivative Works in Source or Object form.
|
|
60
|
+
|
|
61
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
62
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
63
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
64
|
+
(except as stated in this section) patent license to make, have made,
|
|
65
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
66
|
+
where such license applies only to those patent claims licensable
|
|
67
|
+
by such Contributor that are necessarily infringed by their
|
|
68
|
+
Contribution(s) alone or by the combination of their Contribution(s)
|
|
69
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
70
|
+
institute patent litigation against any entity (including a cross-claim
|
|
71
|
+
or counterclaim in a lawsuit) alleging that the Work or any
|
|
72
|
+
Contribution embodied within the Work constitutes direct or contributory
|
|
73
|
+
patent infringement, then any patent licenses granted to You under
|
|
74
|
+
this License for that Work shall terminate as of the date such
|
|
75
|
+
litigation is filed.
|
|
76
|
+
|
|
77
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
78
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
79
|
+
modifications, and in Source or Object form, provided that You
|
|
80
|
+
meet the following conditions:
|
|
81
|
+
|
|
82
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
83
|
+
Works a copy of this License; and
|
|
84
|
+
|
|
85
|
+
(b) You must cause any modified files to carry prominent notices
|
|
86
|
+
stating that You changed the files; and
|
|
87
|
+
|
|
88
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
89
|
+
that You distribute, all copyright, patent, trademark, and
|
|
90
|
+
attribution notices from the Source form of the Work,
|
|
91
|
+
excluding those notices that do not pertain to any part of
|
|
92
|
+
the Derivative Works; and
|
|
93
|
+
|
|
94
|
+
(d) If the Work includes a "NOTICE" text file, You must include a
|
|
95
|
+
readable copy of the attribution notices contained within such
|
|
96
|
+
NOTICE file, in the Derivative Works that You distribute.
|
|
97
|
+
|
|
98
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
99
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
100
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
101
|
+
this License, without any additional terms or conditions.
|
|
102
|
+
|
|
103
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
104
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
105
|
+
including "CerebreX", "A Real Cool Co.", and associated logos,
|
|
106
|
+
except as required for reasonable and customary use in describing the
|
|
107
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
108
|
+
|
|
109
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
110
|
+
agreed to in writing, Licensor provides the Work on an "AS IS" BASIS,
|
|
111
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
|
|
112
|
+
|
|
113
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
114
|
+
whether in tort, contract, or otherwise, shall any Contributor be
|
|
115
|
+
liable for damages, including any direct, indirect, special,
|
|
116
|
+
incidental, or exemplary damages arising out of this License or
|
|
117
|
+
out of the use or inability to use the Work.
|
|
118
|
+
|
|
119
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
120
|
+
the Work or Derivative Works thereof, You may offer and charge a fee
|
|
121
|
+
for acceptance of support, warranty, indemnity, or other liability
|
|
122
|
+
obligations and rights consistent with this License.
|
|
123
|
+
|
|
124
|
+
END OF TERMS AND CONDITIONS
|
|
125
|
+
|
|
126
|
+
Copyright 2026 A Real Cool Co. — Josef Douglas Charles McClammey
|
|
127
|
+
Licensed under the Apache License, Version 2.0.
|
|
128
|
+
You may not use this file except in compliance with the License.
|
|
129
|
+
You may obtain a copy of the License at:
|
|
130
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
package/README.md
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# CerebreX
|
|
4
|
+
|
|
5
|
+
### The Open-Source Agent Infrastructure OS
|
|
6
|
+
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
[](https://github.com/therealcoolnerd/CerebreX/actions/workflows/ci.yml)
|
|
9
|
+
[](https://www.npmjs.com/package/cerebrex)
|
|
10
|
+
[](https://github.com/therealcoolnerd/CerebreX)
|
|
11
|
+
[](https://github.com/therealcoolnerd/CerebreX/issues)
|
|
12
|
+
|
|
13
|
+
**Build. Test. Remember. Coordinate. Publish.**
|
|
14
|
+
The complete infrastructure layer for AI agents — in one CLI.
|
|
15
|
+
|
|
16
|
+
[🚀 Quickstart](#-quickstart) · [🗂 Structure](#-monorepo-structure) · [🛣 Roadmap](#-roadmap) · [🐛 Issues](https://github.com/therealcoolnerd/CerebreX/issues)
|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
> **Status: v0.3.2 — All 6 modules complete and live on npm**
|
|
23
|
+
> `npm install -g cerebrex` — FORGE, TRACE, MEMEX, AUTH, REGISTRY, and HIVE are all working.
|
|
24
|
+
> Live registry: `https://cerebrex-registry.therealjosefdmcclammey.workers.dev`
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## What is CerebreX?
|
|
29
|
+
|
|
30
|
+
CerebreX is an open-source **Agent Infrastructure OS** — the tools developers need to build reliable, observable, and secure AI agents.
|
|
31
|
+
|
|
32
|
+
Six modules. One CLI.
|
|
33
|
+
|
|
34
|
+
| Module | Command | Status | What It Does |
|
|
35
|
+
|--------|---------|--------|-------------|
|
|
36
|
+
| 🔨 **FORGE** | `cerebrex build` | ✅ Working | Generate production MCP servers from any OpenAPI spec |
|
|
37
|
+
| 🔍 **TRACE** | `cerebrex trace` | ✅ Working | Record agent execution + visual web dashboard |
|
|
38
|
+
| 🧠 **MEMEX** | `cerebrex memex` | ✅ Working | Persistent memory with SHA-256 integrity + TTL |
|
|
39
|
+
| 🔑 **AUTH** | `cerebrex auth` | ✅ Working | Secure token storage for registry authentication |
|
|
40
|
+
| 📦 **REGISTRY** | `cerebrex publish` | ✅ Working | Publish and install MCP servers (live registry) |
|
|
41
|
+
| 🐝 **HIVE** | `cerebrex hive` | ✅ Working | Multi-agent coordination with JWT auth |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## ⚡ Quickstart
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm install -g cerebrex
|
|
49
|
+
cerebrex --help
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Or build from source (requires [Bun](https://bun.sh)):
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
git clone https://github.com/therealcoolnerd/CerebreX.git
|
|
56
|
+
cd CerebreX
|
|
57
|
+
bun install
|
|
58
|
+
cd packages/types && bun run build && cd ../..
|
|
59
|
+
cd packages/core && bun run build && cd ../..
|
|
60
|
+
cd packages/registry-client && bun run build && cd ../..
|
|
61
|
+
cd apps/cli && bun run build
|
|
62
|
+
node dist/index.js --help
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 🔨 FORGE — MCP Server Generation
|
|
68
|
+
|
|
69
|
+
Generate a production-ready MCP server from any OpenAPI spec:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# From a URL
|
|
73
|
+
cerebrex build --spec https://petstore3.swagger.io/api/v3/openapi.json --output ./my-server
|
|
74
|
+
|
|
75
|
+
# From a local file
|
|
76
|
+
cerebrex build --spec ./openapi.yaml --output ./my-server
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Output is a Cloudflare Workers project with:
|
|
80
|
+
- Zod input validation on every tool
|
|
81
|
+
- MCP-compliant stdio/SSE/Streamable HTTP transports
|
|
82
|
+
- Ready for `wrangler deploy`
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 🔍 TRACE — Agent Execution Recording
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Start recording (runs in foreground)
|
|
90
|
+
cerebrex trace start --session my-agent --port 7432
|
|
91
|
+
|
|
92
|
+
# From your agent, push steps:
|
|
93
|
+
# POST http://localhost:7432/step
|
|
94
|
+
# Body: { "type": "tool_call", "toolName": "listPets", "inputs": {}, "latencyMs": 42 }
|
|
95
|
+
|
|
96
|
+
# Stop and save
|
|
97
|
+
cerebrex trace stop --session my-agent
|
|
98
|
+
|
|
99
|
+
# View in terminal
|
|
100
|
+
cerebrex trace view --session my-agent
|
|
101
|
+
|
|
102
|
+
# View in visual web dashboard (opens browser)
|
|
103
|
+
cerebrex trace view --session my-agent --web
|
|
104
|
+
|
|
105
|
+
# List all saved sessions
|
|
106
|
+
cerebrex trace list
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Traces are saved to `~/.cerebrex/traces/`.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 🧠 MEMEX — Persistent Agent Memory
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Store a value
|
|
117
|
+
cerebrex memex set "user-pref" "dark mode" --namespace ui
|
|
118
|
+
|
|
119
|
+
# Retrieve it
|
|
120
|
+
cerebrex memex get "user-pref" --namespace ui
|
|
121
|
+
|
|
122
|
+
# List all memory
|
|
123
|
+
cerebrex memex list
|
|
124
|
+
|
|
125
|
+
# With TTL (auto-expires after 3600 seconds)
|
|
126
|
+
cerebrex memex set "session-ctx" "..." --ttl 3600
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
All writes are SHA-256 checksummed. Reads verify integrity before returning.
|
|
130
|
+
Storage: `~/.cerebrex/memex/<namespace>.json` — local, no cloud required.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 🔑 AUTH — Secure Credentials
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
cerebrex auth login # store token at ~/.cerebrex/.credentials (mode 0600)
|
|
138
|
+
cerebrex auth status # check current auth state
|
|
139
|
+
cerebrex auth logout # remove stored token
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 📦 REGISTRY — Publish & Install MCP Servers
|
|
145
|
+
|
|
146
|
+
Registry: `https://cerebrex-registry.therealjosefdmcclammey.workers.dev`
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
cerebrex auth login # authenticate first
|
|
150
|
+
cerebrex publish --dir ./my-server # publish to registry
|
|
151
|
+
cerebrex install my-mcp-server # install from registry
|
|
152
|
+
cerebrex validate ./my-server # validate before publishing
|
|
153
|
+
cerebrex validate ./my-server --strict # + OWASP checks
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## 🐝 HIVE — Multi-Agent Coordination
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Initialize a HIVE coordinator
|
|
162
|
+
cerebrex hive init --name my-hive
|
|
163
|
+
|
|
164
|
+
# Start the coordinator (runs on port 7433)
|
|
165
|
+
cerebrex hive start
|
|
166
|
+
|
|
167
|
+
# In another terminal — register an agent and get a JWT
|
|
168
|
+
cerebrex hive register --id agent-1 --name "Summarizer" --capabilities summarize,classify
|
|
169
|
+
|
|
170
|
+
# Check who's connected
|
|
171
|
+
cerebrex hive status
|
|
172
|
+
|
|
173
|
+
# Send a task to an agent (use the JWT printed by register)
|
|
174
|
+
cerebrex hive send --agent agent-1 --type summarize --payload '{"text":"..."}' --token <JWT>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
HIVE runs a local HTTP coordinator with JWT-signed agent authentication.
|
|
178
|
+
Agents register, receive tasks, and report results back via the REST API.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 🗂 Monorepo Structure
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
CerebreX/
|
|
186
|
+
├── apps/
|
|
187
|
+
│ ├── cli/ # cerebrex CLI — the main published package
|
|
188
|
+
│ │ ├── src/
|
|
189
|
+
│ │ │ ├── commands/ # build, trace, memex, auth, hive, other-commands
|
|
190
|
+
│ │ │ └── core/ # forge/, trace/, memex/ engines + dashboard
|
|
191
|
+
│ │ └── dist/ # built output (git-ignored, built by CI)
|
|
192
|
+
│ └── dashboard/ # Web trace explorer (embedded in CLI bundle)
|
|
193
|
+
│ └── src/index.html
|
|
194
|
+
├── workers/
|
|
195
|
+
│ └── registry/ # Cloudflare Worker — live registry backend
|
|
196
|
+
│ ├── src/index.ts # REST API (D1 + KV)
|
|
197
|
+
│ ├── schema.sql # D1 database schema
|
|
198
|
+
│ └── wrangler.toml
|
|
199
|
+
├── packages/
|
|
200
|
+
│ ├── core/ # @cerebrex/core — shared utilities
|
|
201
|
+
│ ├── types/ # @cerebrex/types — shared TypeScript types
|
|
202
|
+
│ └── registry-client/ # @cerebrex/registry — registry API client
|
|
203
|
+
├── .github/
|
|
204
|
+
│ └── workflows/
|
|
205
|
+
│ ├── ci.yml # build + typecheck on push/PR
|
|
206
|
+
│ ├── publish.yml # npm publish on GitHub release
|
|
207
|
+
│ └── deploy-registry.yml # auto-deploy registry Worker
|
|
208
|
+
└── turbo.json
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 🔒 Security
|
|
214
|
+
|
|
215
|
+
Built security-first, aligned with the [OWASP Top 10 for Agentic Applications (2025)](https://genai.owasp.org).
|
|
216
|
+
|
|
217
|
+
- **Memory Integrity** — All MEMEX writes are SHA-256 checksummed. Reads verify before returning.
|
|
218
|
+
- **Zero Hardcoded Secrets** — `cerebrex validate` scans for hardcoded credentials and blocks deploy.
|
|
219
|
+
- **Input Validation** — Zod schemas validate every tool input in generated MCP servers.
|
|
220
|
+
- **Secure Credentials** — Auth tokens stored at `~/.cerebrex/.credentials` (mode 0600).
|
|
221
|
+
- **JWT Agent Auth** — HIVE uses HMAC-SHA256 signed JWTs for all agent communications.
|
|
222
|
+
|
|
223
|
+
Found a vulnerability? Please read our [Security Policy](./SECURITY.md) and report it privately.
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## 🤝 Contributing
|
|
228
|
+
|
|
229
|
+
Contributions are welcome. CerebreX is a solo-built open-source project — PRs, issues, and feedback all help.
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
git clone https://github.com/therealcoolnerd/CerebreX.git
|
|
233
|
+
cd CerebreX
|
|
234
|
+
bun install
|
|
235
|
+
cd packages/types && bun run build && cd ../..
|
|
236
|
+
cd packages/core && bun run build && cd ../..
|
|
237
|
+
cd packages/registry-client && bun run build && cd ../..
|
|
238
|
+
cd apps/cli && bun run build
|
|
239
|
+
# Open a PR against main
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## 🛣 Roadmap
|
|
245
|
+
|
|
246
|
+
- [x] FORGE — MCP server generation from OpenAPI *(v0.1)*
|
|
247
|
+
- [x] TRACE — Real HTTP event server, step recording + replay *(v0.2)*
|
|
248
|
+
- [x] MEMEX — Persistent agent memory, SHA-256 integrity, TTL *(v0.2)*
|
|
249
|
+
- [x] AUTH — Secure token storage, `cerebrex auth login/logout/status` *(v0.2)*
|
|
250
|
+
- [x] VALIDATE — Real MCP + OWASP compliance checks *(v0.2)*
|
|
251
|
+
- [x] CI/CD — GitHub Actions build + npm publish pipeline *(v0.2)*
|
|
252
|
+
- [x] npm package live — `npm install -g cerebrex` *(v0.2.1)*
|
|
253
|
+
- [x] Web dashboard — Visual trace explorer (`cerebrex trace view --web`) *(v0.3)*
|
|
254
|
+
- [x] Registry backend — Cloudflare Worker + D1 + KV *(v0.3)*
|
|
255
|
+
- [x] HIVE — Multi-agent JWT coordination (init/start/register/status/send) *(v0.3)*
|
|
256
|
+
- [ ] Custom domain — `registry.cerebrex.dev` *(next)*
|
|
257
|
+
- [ ] Web UI — Browser-based registry and trace browser *(v0.4)*
|
|
258
|
+
- [ ] Enterprise tier + on-prem *(v1.0)*
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## 📄 License
|
|
263
|
+
|
|
264
|
+
CerebreX is open source under the [Apache 2.0 License](./LICENSE).
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
<div align="center">
|
|
269
|
+
|
|
270
|
+
Built by [therealcoolnerd](https://github.com/therealcoolnerd) · Gulf Coast, Mississippi
|
|
271
|
+
|
|
272
|
+
*"The developer who builds the standard wins the ecosystem."*
|
|
273
|
+
|
|
274
|
+
</div>
|