glassbrain 0.1.4 → 0.2.0-alpha.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/README.md +14 -8
- package/README.zh-CN.md +938 -0
- package/dist/adapters.js +1 -1
- package/dist/chunks/{chunk-VCM766BZ.js → chunk-7R6PO7AE.js} +4 -1
- package/dist/chunks/{chunk-EJURBBFC.js → chunk-F3DN7SLR.js} +1 -0
- package/dist/chunks/{chunk-CAXDADCO.js → chunk-TM27EXYP.js} +172 -11
- package/dist/chunks/{chunk-37BAJC3L.js → chunk-ZHPUQDOJ.js} +1 -1
- package/dist/cli/glassbrain.js +1372 -182
- package/dist/cli/viewer.js +50 -50
- package/dist/core.js +2 -2
- package/dist/index.js +4 -4
- package/dist/internal.js +4 -4
- package/dist/layers.d.ts +20 -0
- package/dist/layout/order.d.ts +18 -0
- package/dist/model.d.ts +5 -1
- package/dist/react/DetailPanel.js +2 -2
- package/dist/react/GraphCanvas.d.ts +3 -0
- package/dist/react/GraphCanvas.js +4 -4
- package/dist/react/Toolbar.d.ts +2 -0
- package/dist/strings.d.ts +1 -0
- package/package.json +1 -1
- package/schema/graph.schema.json +4 -4
- package/schema/profile.schema.json +103 -31
package/README.md
CHANGED
|
@@ -22,24 +22,30 @@ lets you read one at a glance, and when the agent learns something, shows you ex
|
|
|
22
22
|
```json
|
|
23
23
|
{
|
|
24
24
|
"nodes": [
|
|
25
|
-
{ "id": "src", "label": "src", "kind": "folder" },
|
|
26
|
-
{ "id": "src/auth", "label": "auth", "kind": "folder", "parent": "src" },
|
|
25
|
+
{ "id": "src", "label": "src", "kind": "folder", "parent": null },
|
|
26
|
+
{ "id": "src/auth", "label": "auth", "kind": "folder", "parent": "src", "order": 1 },
|
|
27
27
|
{ "id": "src/auth/login.ts", "label": "login.ts", "kind": "file", "parent": "src/auth" },
|
|
28
|
-
{ "id": "src/db.ts", "label": "db.ts", "kind": "file", "parent": "src" }
|
|
28
|
+
{ "id": "src/db.ts", "label": "db.ts", "kind": "file", "parent": "src", "order": 2 }
|
|
29
29
|
],
|
|
30
30
|
"edges": [{ "source": "src/auth/login.ts", "target": "src/db.ts", "kind": "uses" }]
|
|
31
31
|
}
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
`parent`
|
|
34
|
+
`parent` is required on every node (null for the one root) and says what sits inside what: that is
|
|
35
|
+
the whole structure. `order`, optional, turns the children of one node into a numbered list — the
|
|
36
|
+
layout reads it clockwise, and a numbered root *is* the 2.5D layer view. There is no layer field.
|
|
35
37
|
A [JSON Schema](https://github.com/voidixyn/glassbrain/blob/main/schema/graph.schema.json) describes every field, and the CLI answers in a form an
|
|
36
|
-
agent can act on:
|
|
38
|
+
agent can act on — every finding carries its repair:
|
|
37
39
|
|
|
38
40
|
```text
|
|
39
41
|
$ npx glassbrain validate kg
|
|
40
|
-
|
|
42
|
+
error dangling-edge graph.json edge src/auth/login.ts → src/session points at the missing node src/session
|
|
43
|
+
an edge can only join nodes that exist. Add the node, or repoint the edge:
|
|
44
|
+
- { "source": "src/auth/login.ts", "target": "src/session" }
|
|
45
|
+
+ { "source": "src/auth/login.ts", "target": "EXISTING_ID" }
|
|
41
46
|
|
|
42
|
-
kg:
|
|
47
|
+
kg: 1 node, 1 edge — 1 error · 0 warnings · 0 infos
|
|
48
|
+
structure: 1 root · depth 2 · 1/1 parented · isomorphism 1.00
|
|
43
49
|
|
|
44
50
|
$ npx glassbrain diff kg/1-skeleton kg/2-filled
|
|
45
51
|
1-skeleton → 2-filled
|
|
@@ -82,7 +88,7 @@ That makes change the main event:
|
|
|
82
88
|
|
|
83
89
|
Search ranks by how well a node matches, the detail panel renders the node's markdown, labels
|
|
84
90
|
make room for each other instead of piling up, and [dark mode is computed](https://github.com/voidixyn/glassbrain/blob/main/docs/guide.md#color-hue-is-configured-everything-else-is-computed)
|
|
85
|
-
from the light palette.
|
|
91
|
+
from the light palette. A root whose children carry `order` opens as floors in 2.5D:
|
|
86
92
|
|
|
87
93
|

|
|
88
94
|
|