create-booboo 0.2.0 → 0.4.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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cli.js +87 -8
  3. package/package.json +6 -6
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/dist/cli.js CHANGED
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/cli.ts
4
- import { mkdirSync, writeFileSync, existsSync, readdirSync } from "fs";
4
+ import { mkdirSync, writeFileSync, existsSync, readdirSync, readFileSync } from "fs";
5
5
  import path from "path";
6
- var BOOBOO_VERSION = "^0.2.0";
6
+ var BOOBOO_VERSION = "^0.5.0";
7
+ var VERSION = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
7
8
  var args = process.argv.slice(2);
8
9
  var flags = new Set(args.filter((a) => a.startsWith("--")));
9
10
  var dirArg = args.find((a) => !a.startsWith("--")) ?? "my-brain";
@@ -12,6 +13,17 @@ if (flags.has("--help") || flags.has("-h")) {
12
13
  console.log("usage: npx create-booboo <dir> [--force]\n scaffolds a runnable Booboo brain (json starter + postgres upgrade path)");
13
14
  process.exit(0);
14
15
  }
16
+ if (flags.has("--version") || flags.has("-v")) {
17
+ console.log(VERSION);
18
+ process.exit(0);
19
+ }
20
+ var KNOWN_FLAGS = /* @__PURE__ */ new Set(["--force", "--help", "-h", "--version", "-v"]);
21
+ var unknownFlags = [...flags].filter((f) => !KNOWN_FLAGS.has(f));
22
+ if (unknownFlags.length) {
23
+ console.error(`\u2717 unknown flag(s): ${unknownFlags.join(", ")}
24
+ usage: npx create-booboo <dir> [--force]`);
25
+ process.exit(1);
26
+ }
15
27
  var dir = path.resolve(process.cwd(), dirArg);
16
28
  var name = path.basename(dir);
17
29
  var TITLE = name.replace(/[-_]/g, " ").toUpperCase();
@@ -33,6 +45,10 @@ layers:
33
45
  # Namespaces that must NEVER be emitted (filtered in the builder, before JSON/API/MCP).
34
46
  walls: [private, sealed]
35
47
 
48
+ # Parse [[wikilinks]] in node text into first-class \`authored\` edges \u2014 the links
49
+ # a writer CHOSE while understanding the source outrank any harvested relation.
50
+ wikilinks: true
51
+
36
52
  sources:
37
53
  # 1) JSON starter \u2014 works immediately, no database. Edit data.booboo.json.
38
54
  - adapter: json
@@ -69,8 +85,8 @@ var dataJson = JSON.stringify(
69
85
  { id: "agent:researcher", type: "agent", layer: "agents", label: "Researcher", weight: 0.6, tier: 1, parent: "core", icon: "\u{1F50E}", data: { role: "gathers sources" } },
70
86
  { id: "kb:spec", type: "entity", layer: "knowledge", label: "Spec", weight: 0.4, tier: 2, parent: "core" },
71
87
  { 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" }
88
+ { id: "mem:1", type: "memory", layer: "memory", label: "shipped v1", weight: 0.2, tier: 3, parent: "agent:writer", data: { text: "v1 shipped against [[kb:spec]] \u2014 the launch note the Writer drafted." } },
89
+ { id: "mem:2", type: "memory", layer: "memory", label: "found source", weight: 0.2, tier: 3, parent: "agent:researcher", data: { text: "primary source located; informs [[kb:brand]]." } }
74
90
  ],
75
91
  links: [
76
92
  { source: "agent:writer", target: "kb:spec", type: "uses" },
@@ -105,7 +121,8 @@ var pkgJson = JSON.stringify(
105
121
  serve: "booboo serve --snapshot brain.json --port 8787",
106
122
  mcp: "booboo mcp --snapshot brain.json --org org.booboo.json",
107
123
  view: "booboo view --snapshot brain.json",
108
- panel: "booboo panel --org org.booboo.json --snapshot brain.json"
124
+ panel: "booboo panel --org org.booboo.json --snapshot brain.json",
125
+ vault: "booboo vault --snapshot brain.json --org org.booboo.json --out vault"
109
126
  },
110
127
  dependencies: {
111
128
  "@booboo-brain/cli": BOOBOO_VERSION
@@ -146,23 +163,82 @@ latest reports. This file is a **source** (commit it) \u2014 the snapshot is der
146
163
 
147
164
  > **Privacy:** anything whose \`cluster\` is in \`walls:\` is filtered *before* emit \u2014 sealed data never reaches the snapshot, API, or MCP.
148
165
 
166
+ ## The vault \u2014 your brain as plain markdown
167
+
168
+ \`npm run vault\` emits the whole brain as a wiki-linked markdown vault (\`vault/\`):
169
+ one page per node, index pages per layer/cluster, an agent dossier per org member.
170
+ Open it as an Obsidian vault, read it on a couch, or hand it to ANY agent \u2014 plain
171
+ files survive every provider. It is derived: regenerate, never hand-edit.
172
+
173
+ ## The agent contract
174
+
175
+ **AGENTS.md** (imported by CLAUDE.md) is the operating doctrine an AI agent working
176
+ this folder reads first: boot from the org, author \`[[wikilinks]]\`, one atomic fact
177
+ per note, corrections replace, respect the walls, watch the quality gate. Edit it as
178
+ your conventions evolve \u2014 it IS your system's constitution.
179
+
149
180
  ## MCP
150
181
 
151
182
  \`npm run mcp\` exposes \`booboo_stats \xB7 booboo_search \xB7 booboo_node \xB7 booboo_neighbors \xB7 booboo_path\`
152
- so an AI client can query the brain. See the Booboo repo for client config.
183
+ (+ \`booboo_boot \xB7 booboo_org\` with \`--org\`) so an AI client can query the brain, plus the LIVE
184
+ memory verbs \`booboo_remember\` and \`booboo_report\` \u2014 durable writes that append to the journal
185
+ beside the snapshot and are queryable the same session (pass \`--no-write\` for a read-only server).
186
+ See the Booboo repo for client config.
153
187
  `;
154
188
  var gitignore = `node_modules/
155
189
  # the built snapshot can contain real/private data \u2014 don't commit it
156
190
  brain.json
191
+ # the LIVE MEMORY journal \u2014 durable agent writes (remember/report). Private,
192
+ # and NOT regenerated by build, so it's never deleted \u2014 just don't commit it.
193
+ *.journal.jsonl
194
+ # the vault is derived from the snapshot \u2014 regenerate, never commit
195
+ vault/
157
196
  *.log
158
197
  `;
198
+ var agentsMd = `# ${TITLE} \u2014 the agent contract
199
+ *Any AI agent working in this folder reads this first, every session. It is the
200
+ operating doctrine for this brain \u2014 the conventions match the setup.*
201
+
202
+ ## What this folder is
203
+ - \`booboo.config.yaml\` \u2014 build config (layers \xB7 sources \xB7 walls \xB7 wikilinks). Edit to shape the brain.
204
+ - \`org.booboo.json\` \u2014 **SOURCE**: the agent organigram you boot from. Versioned, validated, edited via the panel or a reviewed change \u2014 never ad-hoc.
205
+ - \`brain.json\` \u2014 **DERIVED** snapshot. Regenerate with \`npm run build\`; never hand-edit.
206
+ - \`vault/\` \u2014 **DERIVED** markdown mirror of the brain (Obsidian-compatible). Regenerate with \`npm run vault\`; never hand-edit.
207
+
208
+ ## The loop (every non-trivial task)
209
+ 1. **ORIENT** \u2014 never assume what the brain knows: boot as your agent (\`booboo_boot('<agent-id>')\` over MCP) for your identity, inherited rules and buckets; then \`booboo_search\`/\`booboo_neighbors\` for the facts you need. *Assumption is not recall.*
210
+ 2. **ACT** \u2014 the smallest correct change.
211
+ 3. **VERIFY against reality** \u2014 \`npm run build\` and read the \`quality\` line; open \`npm run view\` or \`npm run panel\` when the change is visual. Introspection is not verification.
212
+ 4. **RECORD** \u2014 write what you learned: call \`booboo_remember\` (a durable memory) and \`booboo_report\` (what you closed) over MCP. These are LIVE \u2014 they append to the journal beside the snapshot and are queryable the same session; no rebuild needed. Close every substantial task with a \`booboo_report\`.
213
+
214
+ ## Writing memories (the conventions that keep the brain curated)
215
+ - **Use \`booboo_remember\`** \u2014 pass \`agent\` (who it belongs to), \`text\` (the fact), and optionally \`kind\` / \`bucket\`. It writes to the durable journal (survives every rebuild) and is instantly searchable. \`booboo_report\` files what you closed; it lands on the panel's Reports timeline.
216
+ - **One atomic fact per note**, written for the future reader. Never dump a transcript \u2014 the quality gate counts \`dump-suspects\` and they are a smell.
217
+ - **Author your links**: put \`[[node-id]]\` (or \`[[exact label]]\`) refs in the note text where you KNOW the connection. \`wikilinks: true\` turns them into first-class \`authored\` edges that outrank any harvested relation.
218
+ - **Corrections replace**: when a note corrects an earlier fact, remove or supersede the old one in the same act. A brain that only accumulates is not curated \u2014 stale truth next to live truth is worse than either.
219
+ - **Respect the walls**: anything in a \`walls:\` cluster never leaves the builder. Never move data out of a walled cluster; never widen the walls without the human.
220
+
221
+ ## The org is law
222
+ Rules in \`org.booboo.json\` inherit top-down \u2014 \`booboo_boot\` returns yours; obey them. Reorganising the fleet (reparenting, new agents, rule changes) goes through the panel (\`npm run panel\`) or a reviewed edit so the change is validated and diffable.
223
+
224
+ ## Quality gate (read it every build)
225
+ \`npm run build\` prints \`quality \xB7 authored:N \xB7 orphans:N \xB7 dump-suspects:N\`.
226
+ Authored should grow; orphans and dumps should not. Rising orphans/dumps = accumulating, not curating \u2014 fix the notes before adding more.
227
+
228
+ ## Honest close
229
+ End substantial work by reporting plainly: what changed, what you verified against the running thing, what you couldn't verify, and any note you superseded.
230
+ `;
231
+ var claudeMd = `@AGENTS.md
232
+ `;
159
233
  var files = {
160
234
  "booboo.config.yaml": configYaml,
161
235
  "data.booboo.json": dataJson,
162
236
  "org.booboo.json": orgJson,
163
237
  "package.json": pkgJson,
164
238
  "README.md": readme,
165
- ".gitignore": gitignore
239
+ ".gitignore": gitignore,
240
+ "AGENTS.md": agentsMd,
241
+ "CLAUDE.md": claudeMd
166
242
  };
167
243
  for (const [f, content] of Object.entries(files)) writeFileSync(path.join(dir, f), content, "utf8");
168
244
  console.log(`
@@ -175,5 +251,8 @@ console.log(" npm run build # build the graph snapshot");
175
251
  console.log(" npm run serve # REST API on http://localhost:8787");
176
252
  console.log(" npm run mcp # MCP over stdio (Claude / Cursor / Claude Code)");
177
253
  console.log(" npm run view # see your brain in 3D (opens your browser)");
178
- console.log(" npm run panel # the organigram \u2014 run your agents like a company\n");
254
+ console.log(" npm run panel # the organigram \u2014 run your agents like a company");
255
+ console.log(" npm run vault # the brain as a wiki-linked markdown vault (Obsidian-ready)\n");
256
+ console.log("Your agent's contract is AGENTS.md (CLAUDE.md imports it) \u2014 Claude/Codex read it");
257
+ console.log("automatically in this folder and will follow the brain's conventions.\n");
179
258
  console.log("Then edit booboo.config.yaml to point at your own data \u2014 a postgres example is included.\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-booboo",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Scaffold a new Booboo brain — `npx create-booboo my-brain`. Zero deps.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -19,9 +19,6 @@
19
19
  "files": [
20
20
  "dist"
21
21
  ],
22
- "scripts": {
23
- "build": "tsup src/cli.ts --format esm --clean"
24
- },
25
22
  "devDependencies": {
26
23
  "tsup": "^8",
27
24
  "typescript": "^5"
@@ -32,5 +29,8 @@
32
29
  "create",
33
30
  "knowledge-graph",
34
31
  "mcp"
35
- ]
36
- }
32
+ ],
33
+ "scripts": {
34
+ "build": "tsup src/cli.ts --format esm --clean"
35
+ }
36
+ }