glassbrain 0.1.3 → 0.1.4

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.
@@ -947,6 +947,10 @@ function baseStyle(theme = LIGHT_THEME, nodeScale = 1) {
947
947
  * (It used to add classes to thousands of elements and let cytoscape tween them: hundreds of ms per hover.)
948
948
  * Selection = identity, persistent. Here nodes only get an accent stroke; the truly prominent ring is drawn on the text layer, so it
949
949
  * stays prominent while hover dims what is below. */
950
+ // Touch preview in native rendering: emphasize locally, never dim either diff pane.
951
+ { selector: "node.gb-preview", style: { "border-width": 3, "border-color": theme.hit } },
952
+ { selector: "node.gb-preview-hop", style: { "font-weight": "bold", "text-opacity": 1 } },
953
+ { selector: "edge.gb-preview", style: { "overlay-opacity": 0.12, "overlay-color": theme.hit, "overlay-padding": 4 } },
950
954
  { selector: "node:selected", style: { "border-width": 3, "border-color": theme.selected } },
951
955
  { selector: "node.gb-hit", style: { "border-width": 3, "border-color": theme.hit } }
952
956
  ];
@@ -1113,7 +1117,7 @@ function chromeStyle(theme) {
1113
1117
  var GK_CSS = `
1114
1118
  .gb-root { display:flex; height:100%; min-height:0; font-family: var(--gb-font, ui-sans-serif, system-ui, sans-serif);
1115
1119
  color: var(--gb-text, var(--gb-default-text,#1f2937)); position:relative; container-type:inline-size; container-name:gk; }
1116
- .gb-stage { flex:1; min-width:0; position:relative; }
1120
+ .gb-stage { flex:1; min-width:0; position:relative; container-type:inline-size; container-name:gks; }
1117
1121
  .gb-canvas { position:absolute; inset:0; }
1118
1122
  /* The node text layer: cytoscape's canvases are z-index 1\u20133; this one sits above them and below the toolbar.
1119
1123
  canvas is a replaced element; inset alone is not enough, it needs an explicit 100%. */
@@ -1152,6 +1156,9 @@ var GK_CSS = `
1152
1156
  * radius 10, a very faint shadow: the graph is the star, the tools are a few buttons on glass. */
1153
1157
  .gb-bar { position:absolute; top:12px; left:12px; right:12px; z-index:10; display:flex; flex-wrap:wrap;
1154
1158
  align-items:flex-start; gap:8px; pointer-events:none; }
1159
+ /* With a layer row, one line is the contract: the layer track shrinks and scrolls; wrapping
1160
+ * would move search and layers onto separate rows at 641px, just above the compact breakpoint. */
1161
+ .gb-bar.has-layers { flex-wrap:nowrap; }
1155
1162
  .gb-bar > * { pointer-events:auto; }
1156
1163
  .gb-ico { display:block; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
1157
1164
  /* Only four radius levels, which the host can override as a set:
@@ -1168,7 +1175,7 @@ var GK_CSS = `
1168
1175
 
1169
1176
  /* Search: fixed width (it does not widen on focus: widening would push the layer toggle away, jumping sideways on every focus and blur),
1170
1177
  * a bit wider with a focus tag; the dropdown is a solid card (text must be readable, the graph must not show through), wider than the box. */
1171
- .gb-search { position:relative; width:260px; max-width:100%; transition: width .22s cubic-bezier(.3,.7,.2,1); }
1178
+ .gb-search { position:relative; width:260px; flex:0 1 260px; min-width:180px; max-width:100%; transition: width .22s cubic-bezier(.3,.7,.2,1); }
1172
1179
  .gb-field { display:flex; align-items:center; gap:7px; height:36px; padding:0 8px 0 11px;
1173
1180
  color: var(--gb-muted,var(--gb-default-muted,#64748b)); transition: border-color .15s, box-shadow .15s; }
1174
1181
  .gb-search.is-focus .gb-field { border-color: var(--gb-accent,var(--gb-default-accent,#0284c7));
@@ -1218,26 +1225,39 @@ var GK_CSS = `
1218
1225
 
1219
1226
  /* Filtering by source: a tag you can \xD7 away, the same height as the toolbar. */
1220
1227
  .gb-chip { display:inline-flex; align-items:center; gap:6px; height:36px; box-sizing:border-box; padding:0 6px 0 11px;
1221
- max-width:220px; font-size:12.5px; color: var(--gb-text,var(--gb-default-text,#1f2937)); background: var(--gb-active,var(--gb-default-active,#e0f2fe)); }
1228
+ min-width:0; flex:0 1 auto; max-width:220px; font-size:12.5px; color: var(--gb-text,var(--gb-default-text,#1f2937)); background: var(--gb-active,var(--gb-default-active,#e0f2fe)); }
1222
1229
  .gb-chip > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
1223
1230
  .gb-chip .gb-ico { color: var(--gb-accent,var(--gb-default-accent,#0284c7)); }
1224
1231
  .gb-chip button { display:grid; place-items:center; width:22px; height:22px; border:0; padding:0; border-radius:var(--gb-r-chip,5px);
1225
1232
  background:transparent; color: var(--gb-muted,var(--gb-default-muted,#64748b)); }
1226
1233
  .gb-chip button:hover { background: rgba(127,127,127,.18); color: var(--gb-text,var(--gb-default-text,#1f2937)); }
1227
1234
 
1228
- /* Segmented: a backing slides to the current item. */
1229
- .gb-segm { position:relative; display:inline-flex; height:36px; padding:3px; box-sizing:border-box; }
1230
- .gb-segm > button { position:relative; z-index:1; height:28px; padding:0 12px; border:0; border-radius:var(--gb-r-in-face,7px);
1235
+ /* Segmented: a backing slides to the current item. The layer names live in a horizontal
1236
+ * scroll track so a long list never pushes the toolbar wider than the canvas; the stack
1237
+ * toggle stays pinned at the right (it is a mode, not one more layer). */
1238
+ .gb-segm { position:relative; display:inline-flex; height:36px; padding:3px; box-sizing:border-box;
1239
+ min-width:0; max-width:100%; flex:0 1 auto; }
1240
+ .gb-layer-track { position:relative; display:flex; flex:1 1 auto; min-width:0; height:28px;
1241
+ overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain; touch-action:pan-x;
1242
+ scrollbar-width:none; }
1243
+ .gb-layer-track::-webkit-scrollbar { display:none; }
1244
+ /* Only the edge that actually has more layers is faded; a row that fits stays crisp. */
1245
+ .gb-layer-track.can-right { -webkit-mask-image:linear-gradient(to right, #000 calc(100% - 18px), transparent); mask-image:linear-gradient(to right, #000 calc(100% - 18px), transparent); }
1246
+ .gb-layer-track.can-left { -webkit-mask-image:linear-gradient(to right, transparent, #000 18px); mask-image:linear-gradient(to right, transparent, #000 18px); }
1247
+ .gb-layer-track.can-left.can-right { -webkit-mask-image:linear-gradient(to right, transparent, #000 18px, #000 calc(100% - 18px), transparent);
1248
+ mask-image:linear-gradient(to right, transparent, #000 18px, #000 calc(100% - 18px), transparent); }
1249
+ .gb-segm > button, .gb-layer-track > button { position:relative; z-index:1; height:28px; padding:0 12px; border:0; border-radius:var(--gb-r-in-face,7px);
1231
1250
  background:transparent; font-size:12.5px; font-weight:500; color: var(--gb-muted,var(--gb-default-muted,#64748b)); white-space:nowrap;
1232
- transition: color .2s, background-color .2s; }
1233
- .gb-segm > button:hover:not(.on):not(:disabled) { color: var(--gb-text,var(--gb-default-text,#1f2937)); }
1234
- .gb-segm > button.on { color: var(--gb-text,var(--gb-default-text,#1f2937)); }
1235
- .gb-segm > button:disabled { cursor:default; opacity:.5; }
1236
- .gb-thumb { position:absolute; top:3px; left:0; height:28px; border-radius:var(--gb-r-in-face,7px); background: var(--gb-active,var(--gb-default-active,#e0f2fe));
1251
+ transition: color .2s, background-color .2s; flex:none; }
1252
+ .gb-segm > button:hover:not(.on):not(:disabled), .gb-layer-track > button:hover:not(.on):not(:disabled) { color: var(--gb-text,var(--gb-default-text,#1f2937)); }
1253
+ .gb-segm > button.on, .gb-layer-track > button.on { color: var(--gb-text,var(--gb-default-text,#1f2937)); }
1254
+ .gb-segm > button:disabled, .gb-layer-track > button:disabled { cursor:default; opacity:.5; }
1255
+ .gb-thumb { position:absolute; top:0; left:0; z-index:0; height:28px; border-radius:var(--gb-r-in-face,7px); background: var(--gb-active,var(--gb-default-active,#e0f2fe));
1237
1256
  box-shadow: 0 1px 2px rgba(15,23,42,.08); transition: transform .3s cubic-bezier(.3,.7,.2,1), width .3s cubic-bezier(.3,.7,.2,1); }
1238
1257
  /* Stacked layers on: layer names are multi-select, each lit on its own; no slider. */
1239
- .gb-layers.is-multi > button[data-v].on { background: var(--gb-active,var(--gb-default-active,#e0f2fe)); box-shadow: 0 1px 2px rgba(15,23,42,.08); }
1240
- .gb-sep { align-self:center; width:1px; height:18px; margin:0 3px; background: var(--gb-border,var(--gb-default-border,#e2e8f0)); }
1258
+ .gb-layers.is-multi .gb-layer-track > button[data-v].on { background: var(--gb-active,var(--gb-default-active,#e0f2fe)); box-shadow: 0 1px 2px rgba(15,23,42,.08); }
1259
+ .gb-sep { align-self:center; width:1px; height:18px; margin:0 3px; background: var(--gb-border,var(--gb-default-border,#e2e8f0)); flex:none; }
1260
+ .gb-layer-track > button:focus-visible { outline-offset:-2px; }
1241
1261
  .gb-segm > button.gb-stack { display:grid; place-items:center; width:30px; padding:0; color: var(--gb-muted2,var(--gb-default-muted2,#94a3b8)); }
1242
1262
  .gb-segm > button.gb-stack:hover:not(:disabled) { color: var(--gb-text,var(--gb-default-text,#1f2937)); background: var(--gb-tint,var(--gb-default-tint,#f1f5f9)); }
1243
1263
  .gb-segm > button.gb-stack.on { color: var(--gb-accent,var(--gb-default-accent,#0284c7)); background: var(--gb-active,var(--gb-default-active,#e0f2fe)); }
@@ -1248,7 +1268,10 @@ var GK_CSS = `
1248
1268
  .gb-icon-btn:hover, .gb-icon-btn.on { color: var(--gb-text,var(--gb-default-text,#1f2937)); }
1249
1269
  .gb-icon-btn.on { background: var(--gb-active,var(--gb-default-active,#e0f2fe)); }
1250
1270
  .gb-panel { min-width:228px; }
1251
- .gb-panel-up { top:auto; bottom:calc(100% + 6px); left:auto; right:0; transform-origin: bottom right; animation-name: gb-pop-up; }
1271
+ /* Placement is measured by usePopover: open toward the space inside the stage, not off its edge. */
1272
+ .gb-panel[data-x="end"] { left:auto; right:0; transform-origin:top right; }
1273
+ .gb-panel[data-y="top"] { top:auto; bottom:calc(100% + 6px); transform-origin:bottom left; animation-name:gb-pop-up; }
1274
+ .gb-panel[data-y="top"][data-x="end"] { transform-origin:bottom right; }
1252
1275
  .gb-panel-sec + .gb-panel-sec { margin-top:4px; padding-top:4px; border-top:1px solid var(--gb-border,var(--gb-default-border,#e2e8f0)); }
1253
1276
  .gb-panel-h { padding:6px 8px 4px; font-size:10.5px; font-weight:600; letter-spacing:.05em; text-transform:uppercase;
1254
1277
  color: var(--gb-muted2,var(--gb-default-muted2,#94a3b8)); }
@@ -1293,8 +1316,8 @@ var GK_CSS = `
1293
1316
  .gb-drop, .gb-panel { animation:none; }
1294
1317
  }
1295
1318
  /* The caption goes **bottom left**: top left is tools, bottom right is the camera. The right side leaves room for the camera group so they do not collide on narrow screens. */
1296
- .gb-bl { position:absolute; bottom:12px; left:12px; z-index:10; max-width:calc(100% - 180px);
1297
- display:flex; flex-direction:column; align-items:flex-start; gap:8px; pointer-events:none; }
1319
+ .gb-bl { position:absolute; top:12px; bottom:12px; left:12px; z-index:10; max-width:calc(100% - 180px);
1320
+ display:flex; flex-direction:column; justify-content:flex-end; align-items:flex-start; gap:8px; pointer-events:none; }
1298
1321
  .gb-bl > * { pointer-events:auto; }
1299
1322
  .gb-note { font-size:11px; color: var(--gb-muted,var(--gb-default-muted,#64748b)); padding:4px 8px; display:flex; gap:8px; align-items:center; }
1300
1323
  .gb-warn { color: var(--gb-warn,var(--gb-default-warn,#b45309)); border-color: var(--gb-warn-border,var(--gb-default-warn-border,#fcd34d)); background: var(--gb-warn-bg,var(--gb-default-warn-bg,#fffbeb)); }
@@ -1308,8 +1331,17 @@ var GK_CSS = `
1308
1331
 
1309
1332
  /* \u2500\u2500 Legend (bottom left): marks with the same shape and color as on the graph, read from the graph. Resting on an entry pops this class's panel: eye, swatch,
1310
1333
  * size, one row; while the panel is open this class lights up on the graph. Same variables and radii as the toolbar. */
1311
- .gb-legend { max-width:100%; box-sizing:border-box; font-size:11.5px; position:relative; }
1312
- .gb-lg { display:flex; flex-direction:column; gap:3px; padding:6px 60px 6px 8px; box-sizing:border-box; }
1334
+ .gb-legend { max-width:100%; max-height:40%; box-sizing:border-box; font-size:11.5px; position:relative;
1335
+ display:flex; flex-direction:column; min-height:0; }
1336
+ .gb-lg { display:flex; flex-direction:column; gap:3px; box-sizing:border-box; flex:1 1 auto; min-height:0; max-height:100%; position:relative; }
1337
+ /* The rows scroll inside the 40% cap; the collapse button (absolute, top right) stays put. */
1338
+ .gb-lg-body { display:flex; flex-direction:column; gap:3px; flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior-y:contain;
1339
+ padding:6px 60px 6px 8px; box-sizing:border-box; scrollbar-width:thin;
1340
+ scrollbar-color: color-mix(in srgb, var(--gb-muted2,var(--gb-default-muted2,#94a3b8)) 40%, transparent) transparent; }
1341
+ .gb-lg-body > * { flex:none; }
1342
+ .gb-lg-body::-webkit-scrollbar { width:8px; }
1343
+ .gb-lg-body::-webkit-scrollbar-thumb { border:2px solid transparent; border-radius:6px;
1344
+ background: color-mix(in srgb, var(--gb-muted2,var(--gb-default-muted2,#94a3b8)) 40%, transparent) padding-box; }
1313
1345
  .gb-lg-row { display:flex; flex-wrap:wrap; align-items:center; gap:1px 4px; }
1314
1346
  .gb-lg-item { position:relative; display:inline-flex; color: var(--gb-muted,var(--gb-default-muted,#64748b)); }
1315
1347
  .gb-lg-hit { display:inline-flex; align-items:center; gap:5px; height:24px; padding:0 6px; border:0; border-radius:var(--gb-r-in-pop,6px);
@@ -1329,6 +1361,9 @@ var GK_CSS = `
1329
1361
  animation: gb-pop-up .14s cubic-bezier(.2,.8,.3,1); }
1330
1362
  /* The gap between panel and entry counts as panel: moving the mouse up from the entry is not leaving. */
1331
1363
  .gb-lg-pop::after { content:''; position:absolute; left:0; right:0; top:100%; height:8px; }
1364
+ /* Portaled panel: opens above by default, flips below when the stage is too short. */
1365
+ .gb-lg-pop[data-side="bottom"] { animation-name:gb-pop; transform-origin:top left; }
1366
+ .gb-lg-pop[data-side="bottom"]::after { top:auto; bottom:100%; }
1332
1367
  .gb-lg-eye, .gb-lg-well { position:relative; display:grid; place-items:center; width:28px; height:28px; padding:0;
1333
1368
  border:0; border-radius:var(--gb-r-in-pop,6px); background:none; color: var(--gb-text,var(--gb-default-text,#1f2937)); cursor:pointer; }
1334
1369
  .gb-lg-eye.off { color: var(--gb-muted2,var(--gb-default-muted2,#94a3b8)); }
@@ -1421,7 +1456,9 @@ var GK_CSS = `
1421
1456
  border:1px solid var(--gb-border,var(--gb-default-border,#e2e8f0)); }
1422
1457
  .gb-md-alt { color: var(--gb-muted2,var(--gb-default-muted2,#94a3b8)); font-style:italic; }
1423
1458
 
1424
- /* Narrow canvas (phone, small embed): the inspector is a sheet pulled up from the bottom, the legend is collapsed, search spans the row. */
1459
+ /* Narrow canvas (phone, small embed): the inspector is a sheet pulled up from the bottom, the legend is collapsed. The
1460
+ * drawer's own width follows the ROOT (the host width); the toolbar/legend/dock follow the STAGE (the canvas width), so
1461
+ * opening the 320px inspector narrows the chrome too. */
1425
1462
  @container gk (max-width: 640px) {
1426
1463
  .gb-drawer { position:absolute; left:0; right:0; bottom:0; z-index:25; width:auto; max-height:62%;
1427
1464
  border-radius:16px 16px 0 0; box-shadow: 0 -12px 40px -12px rgba(15,23,42,.3);
@@ -1431,9 +1468,22 @@ var GK_CSS = `
1431
1468
  .gb-dh::before { content:''; position:absolute; left:50%; top:6px; width:36px; height:4px; margin-left:-18px;
1432
1469
  border-radius:2px; background: var(--gb-border,var(--gb-default-border,#e2e8f0)); }
1433
1470
  .gb-dh { position:relative; }
1434
- .gb-search { width:auto; flex:1; min-width:0; }
1471
+ }
1472
+ @container gks (max-width: 640px) {
1435
1473
  .gb-bar { right:12px; }
1436
- .gb-bl { max-width:calc(100% - 140px); }
1474
+ .gb-bar.has-layers { flex-wrap:wrap; }
1475
+ /* With layers: search takes its own row; layers + view menu share the second row. The layer
1476
+ * track scrolls, so the menu keeps its place instead of being pushed to a third row. */
1477
+ .gb-bar.has-layers .gb-search { flex:1 1 100%; width:auto; max-width:none; min-width:0; }
1478
+ .gb-bar.has-layers .gb-segm { flex:1 1 0; }
1479
+ .gb-bar.has-layers .gb-menu { flex:none; }
1480
+ /* Without layers one row is enough; the search can shrink, but never to just the icon. */
1481
+ .gb-bar:not(.has-layers) .gb-search { flex:1 1 auto; width:auto; min-width:160px; }
1482
+ /* The camera becomes a compact vertical stack; the legend gets the freed horizontal room. */
1483
+ .gb-bl { max-width:calc(100% - 60px); }
1484
+ .gb-dock { flex-direction:column; align-items:flex-end; }
1485
+ .gb-dock .gb-group { flex-direction:column; }
1486
+ .gb-dock .gb-group > button + button { border-left:0; border-top:1px solid var(--gb-border,var(--gb-default-border,#e2e8f0)); }
1437
1487
  }
1438
1488
  @keyframes gb-sheet-in { from { transform: translateY(100%); } }
1439
1489
  @keyframes gb-sheet-out { to { transform: translateY(100%); } }
@@ -1271,14 +1271,21 @@ function diffText(s, labelOf, limit = 20) {
1271
1271
  }
1272
1272
 
1273
1273
  // cli/glassbrain.ts
1274
- var HELP = (schema) => `glassbrain: open, diff and validate knowledge graphs.
1275
- Your agent writes the graph as plain JSON; glassbrain shows it and what changed.
1276
- Not installed? Put npx in front: npx glassbrain kg
1274
+ var HELP = (schema) => `glassbrain: open, diff and validate knowledge graphs, written as plain JSON.
1277
1275
 
1278
- WRITE A GRAPH
1279
- One JSON file, two arrays. \`parent\` says what sits inside what; that is the
1280
- whole structure. Every other relation is an edge.
1276
+ [ STRUCTURE ]
1277
+ A folder is a graph; one folder per pass, the name sets the order.
1278
+ kg/
1279
+ \u251C\u2500\u2500 _profile.json shared by every pass ( see [ APPEARANCE ] )
1280
+ \u251C\u2500\u2500 1-skeleton/graph.json each folder holds a graph ( see [ DATA ] )
1281
+ \u251C\u2500\u2500 2-filled/graph.json
1282
+ \u2514\u2500\u2500 3-linked/graph.json
1281
1283
 
1284
+ Passes are optional. Use them for the step harness, diffs and version control.
1285
+ JSON at any depth merges by id; split by area only when a file gets too big to write.
1286
+
1287
+ [ DATA ]
1288
+ Two arrays, \`nodes\` and \`edges\`.
1282
1289
  { "nodes": [
1283
1290
  { "id": "src", "label": "src", "kind": "folder" },
1284
1291
  { "id": "src/login.ts", "label": "login.ts", "kind": "file", "parent": "src",
@@ -1287,47 +1294,51 @@ WRITE A GRAPH
1287
1294
  "edges": [
1288
1295
  { "source": "src/login.ts", "target": "src/db.ts", "kind": "uses" } ] }
1289
1296
 
1290
- id any string, stable across versions: a path or a slug, never a counter
1291
- label what is shown (defaults to id)
1292
- kind any word for what sort of thing it is (folder, page, feature, decision)
1293
- parent the id of the node it sits inside
1294
- description markdown for the detail panel; [text](node:<id>) links to a node
1295
- flags markers, e.g. ["stub"] for a node not filled in yet
1296
- Order in the arrays does not matter. Other fields are kept and shown in the detail panel.
1297
+ The parent structure helps readability. Start with a few meaningful groups and give every other node a parent.
1298
+ Keep kinds few and consistent; put supporting detail in descriptions.
1299
+
1300
+ FIELDS
1301
+ id stable across passes: a path or a slug, never a counter
1302
+ label what is shown (defaults to id)
1303
+ kind a word: folder, file, feature, decision
1304
+ parent id of the node this sits inside
1305
+ description markdown; [text](node:<id>) links to a node
1306
+ flags e.g. ["stub"] for a node not filled in yet
1307
+ layer which plane ( see [ APPEARANCE ] )
1308
+
1309
+ Any other field is kept and shown in the detail panel.
1310
+
1297
1311
  Full schema: ${schema}
1298
1312
 
1299
- BUILD IT IN PASSES
1300
- Each pass is a new folder: copy the last one, edit the copy.
1301
- kg/1-skeleton every node at the depth asked (or what a newcomer needs), read from
1302
- the source (not memory), nested by parent; flag each one "stub"
1303
- kg/2-filled descriptions (1-3 sentences, from the source), stub flags removed
1304
- kg/3-linked edges a reader would agree with
1305
- After each pass:
1306
- glassbrain validate kg --strict fix everything it reports
1307
- glassbrain diff kg/1-skeleton kg/2-filled only this pass's job: ~changed in 2,
1308
- edges added in 3, nothing else
1309
- At the end:
1310
- glassbrain kg opens all passes; give the user the path
1313
+ [ APPEARANCE ]
1314
+ kg/_profile.json, shared by every pass.
1315
+
1316
+ COLORS give each kind you use a color; the rest stay grey.
1317
+ { "nodePalette": { "file": "#6366f1", "function": "#10b981" },
1318
+ "edgePalette": { "calls": "#2563eb" }, "placeholderFlags": ["stub"] }
1319
+ "placeholderFlags" makes a flagged "stub" look unfinished.
1320
+
1321
+ LAYERS only for real planes: abstraction levels (contract vs implementation),
1322
+ never grouping. A node picks one with "layer", else the first; "z" orders them.
1323
+ { "layers": [ { "id": "api", "label": "API", "z": 0 },
1324
+ { "id": "ui", "label": "UI", "z": 1 } ] }
1325
+
1326
+ Full schema: ${schema.replace("graph.schema", "profile.schema")}
1311
1327
 
1312
- COLORS: kg/_profile.json, shared by every pass
1313
- Give each kind a color, or every node and edge is drawn the same grey:
1314
- { "nodePalette": { "file": "#6366f1", "function": "#10b981" },
1315
- "edgePalette": { "calls": "#2563eb" }, "placeholderFlags": ["stub"] }
1316
- Layers (2.5D), sizes, labels and the rest: ${schema.replace("graph.schema", "profile.schema")}
1328
+ [ COMMANDS ]
1329
+ Always: validate before handing over. Fix everything it reports.
1317
1330
 
1318
- COMMANDS
1319
- glassbrain <path> open in the browser (same as: view)
1320
- glassbrain diff <old> <new> what changed between two graphs
1321
- glassbrain diff <git-ref> <path> <path> at that commit vs. now (default ref: HEAD)
1322
- glassbrain validate <path> check against the schema and the structure
1331
+ glassbrain <path> open it (passes play as steps); prints the path to hand over
1332
+ glassbrain diff <old> <new> only what changed between two graphs
1333
+ glassbrain diff <git-ref> <path> in a git repo, the same graph at an earlier commit, where
1334
+ the history is the versions (default ref: HEAD)
1335
+ glassbrain validate <path> schema and structure
1323
1336
  glassbrain convert <path> [out-dir] write any supported format as glassbrain JSON
1324
1337
 
1325
1338
  <path> is a file, a folder, or <git-ref>:<path> (HEAD~1:kg/graph.json).
1326
- A folder of sub-folders is a list of versions. Also opens, as they are:
1327
- Graphify graph.json, Understand-Anything knowledge-graph.json, MCP memory.jsonl,
1328
- a markdown folder (Obsidian / LLM wiki).
1339
+ Also reads Graphify, Understand-Anything, memory.jsonl and markdown folders as-is.
1329
1340
 
1330
- OPTIONS
1341
+ [ OPTIONS ]
1331
1342
  --json machine-readable output (diff, validate)
1332
1343
  --strict exit 1 on warnings too (validate)
1333
1344
  --exit-code exit 1 when anything changed (diff)
@@ -1336,8 +1347,7 @@ OPTIONS
1336
1347
  --out <file.html> write the page here instead of a temp file (view, diff)
1337
1348
  --open / --no-open open the browser or not (diff opens only in a terminal)
1338
1349
  --format <id> force a format: native, graphify, understand-anything, memory, obsidian
1339
- -h, --help this help
1340
- -v, --version the version
1350
+ -h, --help / -v, --version this help / the version
1341
1351
 
1342
1352
  More: https://github.com/voidixyn/glassbrain
1343
1353
  `;