create-booboo 0.1.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/LICENSE +21 -0
- package/README.md +29 -0
- package/dist/cli.js +153 -0
- package/package.json +36 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jessy Mariau
|
|
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,29 @@
|
|
|
1
|
+
# create-booboo
|
|
2
|
+
|
|
3
|
+
Scaffold a runnable [Booboo](https://github.com/jessedu29260-netizen/booboo) brain in one
|
|
4
|
+
command. Zero dependencies, pure stdlib.
|
|
5
|
+
|
|
6
|
+
## Use
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npx create-booboo my-brain
|
|
10
|
+
cd my-brain
|
|
11
|
+
npm install
|
|
12
|
+
npm run build # booboo.config.yaml → brain.json (the snapshot)
|
|
13
|
+
npm run serve # REST API on http://localhost:8787
|
|
14
|
+
npm run mcp # MCP over stdio — point Claude / Cursor / Claude Code at it
|
|
15
|
+
npm run view # see your brain in 3D (opens your browser)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## What you get
|
|
19
|
+
|
|
20
|
+
- **`booboo.config.yaml`** — layers, privacy walls, and sources: a JSON starter that works
|
|
21
|
+
immediately, plus a commented postgres block to point at your own Postgres/Supabase
|
|
22
|
+
(`${DATABASE_URL}` from the environment).
|
|
23
|
+
- **`data.booboo.json`** — a small sample graph (agents / knowledge / memory) to build from.
|
|
24
|
+
- **`package.json`** — wired `build` / `serve` / `mcp` / `view` scripts on `@booboo/cli`.
|
|
25
|
+
- **`.gitignore`** — the built snapshot can contain real data, so it's never committed.
|
|
26
|
+
|
|
27
|
+
Pass `--force` to scaffold into a non-empty directory.
|
|
28
|
+
|
|
29
|
+
Part of [Booboo](https://github.com/jessedu29260-netizen/booboo) — the unified operational brain. MIT.
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/cli.ts
|
|
4
|
+
import { mkdirSync, writeFileSync, existsSync, readdirSync } from "fs";
|
|
5
|
+
import path from "path";
|
|
6
|
+
var BOOBOO_VERSION = "^0.1.0";
|
|
7
|
+
var args = process.argv.slice(2);
|
|
8
|
+
var flags = new Set(args.filter((a) => a.startsWith("--")));
|
|
9
|
+
var dirArg = args.find((a) => !a.startsWith("--")) ?? "my-brain";
|
|
10
|
+
var force = flags.has("--force");
|
|
11
|
+
if (flags.has("--help") || flags.has("-h")) {
|
|
12
|
+
console.log("usage: npx create-booboo <dir> [--force]\n scaffolds a runnable Booboo brain (json starter + postgres upgrade path)");
|
|
13
|
+
process.exit(0);
|
|
14
|
+
}
|
|
15
|
+
var dir = path.resolve(process.cwd(), dirArg);
|
|
16
|
+
var name = path.basename(dir);
|
|
17
|
+
var TITLE = name.replace(/[-_]/g, " ").toUpperCase();
|
|
18
|
+
if (existsSync(dir) && readdirSync(dir).length && !force) {
|
|
19
|
+
console.error(`\u2717 "${dirArg}" exists and is not empty \u2014 pass --force to scaffold anyway.`);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
mkdirSync(dir, { recursive: true });
|
|
23
|
+
var configYaml = `# ${name} \u2014 Booboo build config. Docs: SPEC.md + CONFIG.md in the booboo repo.
|
|
24
|
+
title: "${TITLE}"
|
|
25
|
+
root: { id: core, type: root, label: "${TITLE}" }
|
|
26
|
+
|
|
27
|
+
# The stacked planes (Z-order = array order). Use whatever layers fit YOUR system.
|
|
28
|
+
layers:
|
|
29
|
+
- { name: agents, color: "#c9a04a", label: "AGENTS" }
|
|
30
|
+
- { name: knowledge, color: "#4ECDC4", label: "KNOWLEDGE" }
|
|
31
|
+
- { name: memory, color: "#a78bd0", label: "MEMORY" }
|
|
32
|
+
|
|
33
|
+
# Namespaces that must NEVER be emitted (filtered in the builder, before JSON/API/MCP).
|
|
34
|
+
walls: [private, sealed]
|
|
35
|
+
|
|
36
|
+
sources:
|
|
37
|
+
# 1) JSON starter \u2014 works immediately, no database. Edit data.booboo.json.
|
|
38
|
+
- adapter: json
|
|
39
|
+
path: ./data.booboo.json
|
|
40
|
+
|
|
41
|
+
# 2) Your real data \u2014 uncomment and point at a Postgres/Supabase DB.
|
|
42
|
+
# Each \`nodes\` entry maps a table \u2192 a layer; \`weight_from\` reads a numeric column.
|
|
43
|
+
# - adapter: postgres
|
|
44
|
+
# url: \${DATABASE_URL} # postgres://\u2026 (read from the environment)
|
|
45
|
+
# nodes:
|
|
46
|
+
# - { table: agents, layer: agents, id: slug, label: name, parent: core, weight: 0.6 }
|
|
47
|
+
# - { table: observations, layer: memory, id: id, label: title, cluster: project }
|
|
48
|
+
# - { table: kg_entities, layer: knowledge, id: id, label: name, weight_from: degree }
|
|
49
|
+
# links:
|
|
50
|
+
# - { table: edges, source: src, target: dst, type: rel }
|
|
51
|
+
|
|
52
|
+
output:
|
|
53
|
+
snapshot: ./brain.json
|
|
54
|
+
`;
|
|
55
|
+
var dataJson = JSON.stringify(
|
|
56
|
+
{
|
|
57
|
+
booboo: "1.0",
|
|
58
|
+
meta: {
|
|
59
|
+
root: "core",
|
|
60
|
+
title: "Sample Brain",
|
|
61
|
+
layers: [
|
|
62
|
+
{ name: "agents", color: "#c9a04a", label: "AGENTS" },
|
|
63
|
+
{ name: "knowledge", color: "#4ECDC4", label: "KNOWLEDGE" },
|
|
64
|
+
{ name: "memory", color: "#a78bd0", label: "MEMORY" }
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
nodes: [
|
|
68
|
+
{ id: "agent:writer", type: "agent", layer: "agents", label: "Writer", weight: 0.6, tier: 1, parent: "core", icon: "\u270D", data: { role: "drafts content" } },
|
|
69
|
+
{ id: "agent:researcher", type: "agent", layer: "agents", label: "Researcher", weight: 0.6, tier: 1, parent: "core", icon: "\u{1F50E}", data: { role: "gathers sources" } },
|
|
70
|
+
{ id: "kb:spec", type: "entity", layer: "knowledge", label: "Spec", weight: 0.4, tier: 2, parent: "core" },
|
|
71
|
+
{ id: "kb:brand", type: "entity", layer: "knowledge", label: "Brand", weight: 0.4, tier: 2, parent: "core" },
|
|
72
|
+
{ id: "mem:1", type: "memory", layer: "memory", label: "shipped v1", weight: 0.2, tier: 3, parent: "agent:writer" },
|
|
73
|
+
{ id: "mem:2", type: "memory", layer: "memory", label: "found source", weight: 0.2, tier: 3, parent: "agent:researcher" }
|
|
74
|
+
],
|
|
75
|
+
links: [
|
|
76
|
+
{ source: "agent:writer", target: "kb:spec", type: "uses" },
|
|
77
|
+
{ source: "agent:researcher", target: "kb:brand", type: "uses" }
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
null,
|
|
81
|
+
2
|
|
82
|
+
);
|
|
83
|
+
var pkgJson = JSON.stringify(
|
|
84
|
+
{
|
|
85
|
+
name,
|
|
86
|
+
private: true,
|
|
87
|
+
version: "0.1.0",
|
|
88
|
+
type: "module",
|
|
89
|
+
scripts: {
|
|
90
|
+
build: "booboo build",
|
|
91
|
+
serve: "booboo serve --snapshot brain.json --port 8787",
|
|
92
|
+
mcp: "booboo mcp --snapshot brain.json",
|
|
93
|
+
view: "booboo view --snapshot brain.json"
|
|
94
|
+
},
|
|
95
|
+
dependencies: {
|
|
96
|
+
"@booboo/cli": BOOBOO_VERSION
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
null,
|
|
100
|
+
2
|
|
101
|
+
);
|
|
102
|
+
var readme = `# ${name} \u2014 a Booboo brain
|
|
103
|
+
|
|
104
|
+
A rooted, queryable graph of your system, built with [Booboo](https://github.com/jessedu29260-netizen/booboo) (the unified operational brain).
|
|
105
|
+
|
|
106
|
+
## Quickstart
|
|
107
|
+
|
|
108
|
+
\`\`\`bash
|
|
109
|
+
npm install
|
|
110
|
+
npm run build # booboo.config.yaml \u2192 brain.json (the snapshot)
|
|
111
|
+
npm run serve # REST API at http://localhost:8787 (/graph /stats /search /nodes/:id /neighbors/:id /path/:a/:b)
|
|
112
|
+
npm run mcp # MCP over stdio \u2014 point Claude / Cursor / Claude Code at it
|
|
113
|
+
npm run view # see your brain in 3D (opens your browser)
|
|
114
|
+
\`\`\`
|
|
115
|
+
|
|
116
|
+
## Make it yours
|
|
117
|
+
|
|
118
|
+
1. Edit **booboo.config.yaml** \u2014 declare your \`layers\`, then add \`sources\`.
|
|
119
|
+
2. Start from the JSON file (**data.booboo.json**), or uncomment the **postgres** source
|
|
120
|
+
to build straight from your own database. Set \`DATABASE_URL\` in your environment.
|
|
121
|
+
3. \`npm run build\` again. The snapshot \`brain.json\` is what gets served.
|
|
122
|
+
|
|
123
|
+
> **Privacy:** anything whose \`cluster\` is in \`walls:\` is filtered *before* emit \u2014 sealed data never reaches the snapshot, API, or MCP.
|
|
124
|
+
|
|
125
|
+
## MCP
|
|
126
|
+
|
|
127
|
+
\`npm run mcp\` exposes \`booboo_stats \xB7 booboo_search \xB7 booboo_node \xB7 booboo_neighbors \xB7 booboo_path\`
|
|
128
|
+
so an AI client can query the brain. See the Booboo repo for client config.
|
|
129
|
+
`;
|
|
130
|
+
var gitignore = `node_modules/
|
|
131
|
+
# the built snapshot can contain real/private data \u2014 don't commit it
|
|
132
|
+
brain.json
|
|
133
|
+
*.log
|
|
134
|
+
`;
|
|
135
|
+
var files = {
|
|
136
|
+
"booboo.config.yaml": configYaml,
|
|
137
|
+
"data.booboo.json": dataJson,
|
|
138
|
+
"package.json": pkgJson,
|
|
139
|
+
"README.md": readme,
|
|
140
|
+
".gitignore": gitignore
|
|
141
|
+
};
|
|
142
|
+
for (const [f, content] of Object.entries(files)) writeFileSync(path.join(dir, f), content, "utf8");
|
|
143
|
+
console.log(`
|
|
144
|
+
\u{1F43E} Booboo brain scaffolded \u2192 ${dirArg}/
|
|
145
|
+
`);
|
|
146
|
+
console.log("Next steps:");
|
|
147
|
+
console.log(` cd ${dirArg}`);
|
|
148
|
+
console.log(" npm install");
|
|
149
|
+
console.log(" npm run build # build the graph snapshot");
|
|
150
|
+
console.log(" npm run serve # REST API on http://localhost:8787");
|
|
151
|
+
console.log(" npm run mcp # MCP over stdio (Claude / Cursor / Claude Code)");
|
|
152
|
+
console.log(" npm run view # see your brain in 3D (opens your browser)\n");
|
|
153
|
+
console.log("Then edit booboo.config.yaml to point at your own data \u2014 a postgres example is included.\n");
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-booboo",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Scaffold a new Booboo brain — `npx create-booboo my-brain`. Zero deps.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/jessedu29260-netizen/booboo.git",
|
|
9
|
+
"directory": "packages/create-booboo"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/jessedu29260-netizen/booboo/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/jessedu29260-netizen/booboo#readme",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"bin": {
|
|
17
|
+
"create-booboo": "./dist/cli.js"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"tsup": "^8",
|
|
24
|
+
"typescript": "^5"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"booboo",
|
|
28
|
+
"scaffold",
|
|
29
|
+
"create",
|
|
30
|
+
"knowledge-graph",
|
|
31
|
+
"mcp"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsup src/cli.ts --format esm --clean"
|
|
35
|
+
}
|
|
36
|
+
}
|