@hviana/sema 0.1.3 → 0.1.5

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 (123) hide show
  1. package/dist/example/demo.js +25 -25
  2. package/dist/example/train_base.d.ts +21 -19
  3. package/dist/example/train_base.js +1952 -1684
  4. package/dist/src/alphabet.d.ts +3 -3
  5. package/dist/src/alphabet.js +27 -24
  6. package/dist/src/alu/src/alu.d.ts +194 -169
  7. package/dist/src/alu/src/alu.js +414 -374
  8. package/dist/src/alu/src/expr.d.ts +43 -36
  9. package/dist/src/alu/src/expr.js +278 -252
  10. package/dist/src/alu/src/index.d.ts +98 -9
  11. package/dist/src/alu/src/index.js +63 -9
  12. package/dist/src/alu/src/kernel-arith.d.ts +5 -1
  13. package/dist/src/alu/src/kernel-arith.js +285 -195
  14. package/dist/src/alu/src/kernel-bits.d.ts +5 -1
  15. package/dist/src/alu/src/kernel-bits.js +115 -81
  16. package/dist/src/alu/src/kernel-logic.js +63 -33
  17. package/dist/src/alu/src/kernel-nd.js +195 -155
  18. package/dist/src/alu/src/kernel-numeric.d.ts +80 -16
  19. package/dist/src/alu/src/kernel-numeric.js +331 -259
  20. package/dist/src/alu/src/operation.d.ts +132 -112
  21. package/dist/src/alu/src/operation.js +163 -149
  22. package/dist/src/alu/src/parser.d.ts +175 -168
  23. package/dist/src/alu/src/parser.js +421 -382
  24. package/dist/src/alu/src/resonance.d.ts +25 -16
  25. package/dist/src/alu/src/resonance.js +56 -49
  26. package/dist/src/alu/src/text.d.ts +7 -3
  27. package/dist/src/alu/src/text.js +37 -31
  28. package/dist/src/alu/src/value.d.ts +14 -14
  29. package/dist/src/alu/src/value.js +160 -150
  30. package/dist/src/alu/test/alu.test.js +656 -543
  31. package/dist/src/bytes.d.ts +5 -1
  32. package/dist/src/bytes.js +40 -33
  33. package/dist/src/config.d.ts +102 -102
  34. package/dist/src/config.js +83 -83
  35. package/dist/src/derive/src/deduction.d.ts +62 -60
  36. package/dist/src/derive/src/deduction.js +109 -103
  37. package/dist/src/derive/src/index.d.ts +7 -1
  38. package/dist/src/derive/src/priority-queue.d.ts +8 -8
  39. package/dist/src/derive/src/priority-queue.js +61 -57
  40. package/dist/src/derive/src/rewrite.d.ts +18 -15
  41. package/dist/src/derive/src/rewrite.js +67 -59
  42. package/dist/src/derive/src/trie.d.ts +56 -56
  43. package/dist/src/derive/src/trie.js +179 -175
  44. package/dist/src/derive/test/derive.test.js +100 -96
  45. package/dist/src/extension.d.ts +16 -13
  46. package/dist/src/geometry.d.ts +42 -17
  47. package/dist/src/geometry.js +266 -235
  48. package/dist/src/index.d.ts +17 -2
  49. package/dist/src/index.js +7 -1
  50. package/dist/src/ingest-cache.d.ts +30 -25
  51. package/dist/src/ingest-cache.js +127 -108
  52. package/dist/src/mind/articulation.d.ts +5 -1
  53. package/dist/src/mind/articulation.js +112 -77
  54. package/dist/src/mind/attention.d.ts +108 -40
  55. package/dist/src/mind/attention.js +871 -749
  56. package/dist/src/mind/canonical.d.ts +19 -4
  57. package/dist/src/mind/canonical.js +31 -27
  58. package/dist/src/mind/graph-search.d.ts +225 -201
  59. package/dist/src/mind/graph-search.js +821 -742
  60. package/dist/src/mind/index.d.ts +10 -2
  61. package/dist/src/mind/junction.d.ts +58 -31
  62. package/dist/src/mind/junction.js +237 -172
  63. package/dist/src/mind/learning.d.ts +52 -16
  64. package/dist/src/mind/learning.js +165 -143
  65. package/dist/src/mind/match.d.ts +69 -20
  66. package/dist/src/mind/match.js +318 -259
  67. package/dist/src/mind/mechanisms/alu.js +16 -16
  68. package/dist/src/mind/mechanisms/cast.d.ts +13 -9
  69. package/dist/src/mind/mechanisms/cast.js +456 -363
  70. package/dist/src/mind/mechanisms/confluence.d.ts +12 -8
  71. package/dist/src/mind/mechanisms/confluence.js +183 -152
  72. package/dist/src/mind/mechanisms/cover.d.ts +8 -2
  73. package/dist/src/mind/mechanisms/cover.js +210 -148
  74. package/dist/src/mind/mechanisms/extraction.d.ts +34 -8
  75. package/dist/src/mind/mechanisms/extraction.js +288 -234
  76. package/dist/src/mind/mechanisms/recall.d.ts +10 -6
  77. package/dist/src/mind/mechanisms/recall.js +185 -126
  78. package/dist/src/mind/mind.d.ts +154 -129
  79. package/dist/src/mind/mind.js +288 -258
  80. package/dist/src/mind/pipeline-mechanism.d.ts +124 -112
  81. package/dist/src/mind/pipeline-mechanism.js +172 -161
  82. package/dist/src/mind/pipeline.d.ts +14 -4
  83. package/dist/src/mind/pipeline.js +189 -125
  84. package/dist/src/mind/primitives.d.ts +32 -8
  85. package/dist/src/mind/primitives.js +117 -99
  86. package/dist/src/mind/rationale.d.ts +98 -86
  87. package/dist/src/mind/rationale.js +121 -113
  88. package/dist/src/mind/reasoning.d.ts +13 -2
  89. package/dist/src/mind/reasoning.js +166 -129
  90. package/dist/src/mind/recognition.d.ts +4 -1
  91. package/dist/src/mind/recognition.js +208 -183
  92. package/dist/src/mind/resonance.d.ts +22 -5
  93. package/dist/src/mind/resonance.js +0 -0
  94. package/dist/src/mind/trace.d.ts +25 -6
  95. package/dist/src/mind/trace.js +58 -50
  96. package/dist/src/mind/traverse.d.ts +58 -16
  97. package/dist/src/mind/traverse.js +357 -304
  98. package/dist/src/mind/types.d.ts +127 -120
  99. package/dist/src/mind/types.js +69 -60
  100. package/dist/src/rabitq-hnsw/src/database.d.ts +179 -177
  101. package/dist/src/rabitq-hnsw/src/database.js +359 -342
  102. package/dist/src/rabitq-hnsw/src/heap.d.ts +12 -12
  103. package/dist/src/rabitq-hnsw/src/heap.js +80 -75
  104. package/dist/src/rabitq-hnsw/src/hnsw.d.ts +103 -103
  105. package/dist/src/rabitq-hnsw/src/hnsw.js +454 -428
  106. package/dist/src/rabitq-hnsw/src/index.d.ts +6 -1
  107. package/dist/src/rabitq-hnsw/src/prng.d.ts +10 -10
  108. package/dist/src/rabitq-hnsw/src/prng.js +27 -25
  109. package/dist/src/rabitq-hnsw/src/rabitq.d.ts +69 -69
  110. package/dist/src/rabitq-hnsw/src/rabitq.js +262 -246
  111. package/dist/src/rabitq-hnsw/src/store.d.ts +132 -132
  112. package/dist/src/rabitq-hnsw/src/store.js +843 -752
  113. package/dist/src/rabitq-hnsw/test/hnsw.test.js +1054 -805
  114. package/dist/src/sema.d.ts +35 -0
  115. package/dist/src/sema.js +77 -0
  116. package/dist/src/store-sqlite.d.ts +166 -144
  117. package/dist/src/store-sqlite.js +660 -578
  118. package/dist/src/store.d.ts +630 -593
  119. package/dist/src/store.js +1581 -1440
  120. package/dist/src/vec.d.ts +9 -5
  121. package/dist/src/vec.js +73 -61
  122. package/package.json +2 -2
  123. package/src/sema.ts +102 -0
@@ -3,120 +3,124 @@
3
3
  // and the optimal cover. Uses node:test; no dependency on sema.
4
4
  import { test } from "node:test";
5
5
  import assert from "node:assert/strict";
6
- import { coverSequence, lightestDerivation, Trie, } from "../src/index.js";
6
+ import { coverSequence, lightestDerivation, Trie } from "../src/index.js";
7
7
  // ── trie: on-demand matching, no length bound ──────────────────────────────
8
8
  test("trie matchesAt reports forms beginning exactly at a position", () => {
9
- const t = new Trie();
10
- t.insert([1, 2], "ab");
11
- t.insert([1, 2, 3], "abc");
12
- t.insert([2, 3], "bc");
13
- const at0 = t.matchesAt([1, 2, 3, 4], 0).map((m) => m.payload);
14
- assert.deepEqual(at0, ["ab", "abc"]); // both forms starting at 0, shortest first
15
- const at1 = t.matchesAt([1, 2, 3, 4], 1).map((m) => m.payload);
16
- assert.deepEqual(at1, ["bc"]);
17
- const at3 = t.matchesAt([1, 2, 3, 4], 3).map((m) => m.payload);
18
- assert.deepEqual(at3, []); // nothing learned here → dead-ends immediately
9
+ const t = new Trie();
10
+ t.insert([1, 2], "ab");
11
+ t.insert([1, 2, 3], "abc");
12
+ t.insert([2, 3], "bc");
13
+ const at0 = t.matchesAt([1, 2, 3, 4], 0).map((m) => m.payload);
14
+ assert.deepEqual(at0, ["ab", "abc"]); // both forms starting at 0, shortest first
15
+ const at1 = t.matchesAt([1, 2, 3, 4], 1).map((m) => m.payload);
16
+ assert.deepEqual(at1, ["bc"]);
17
+ const at3 = t.matchesAt([1, 2, 3, 4], 3).map((m) => m.payload);
18
+ assert.deepEqual(at3, []); // nothing learned here → dead-ends immediately
19
19
  });
20
20
  test("trie scan finds every occurrence; duplicate inserts share an id", () => {
21
- const t = new Trie();
22
- const id1 = t.insert([7, 7], 1);
23
- const id2 = t.insert([7, 7], 2); // same content
24
- assert.equal(id1, id2);
25
- assert.equal(t.size, 1);
26
- const hits = t.scan([7, 7, 7]);
27
- assert.equal(hits.length, 2); // [0,2) and [1,3)
21
+ const t = new Trie();
22
+ const id1 = t.insert([7, 7], 1);
23
+ const id2 = t.insert([7, 7], 2); // same content
24
+ assert.equal(id1, id2);
25
+ assert.equal(t.size, 1);
26
+ const hits = t.scan([7, 7, 7]);
27
+ assert.equal(hits.length, 2); // [0,2) and [1,3)
28
28
  });
29
29
  // ── engine: Dijkstra/Knuth core with a bridge (multi-premise) rule ─────────
30
30
  test("lightestDerivation solves a hypergraph with a bridge premise", () => {
31
- // Items: "A", "B", "AB". Axioms A (3) and B (4). A binary bridge A ∧ B → AB
32
- // at cost 1. The only derivation of AB costs 3 + 4 + 1 = 8.
33
- const A = "A", B = "B", AB = "AB";
34
- const system = {
35
- key: (s) => s,
36
- axioms: () => [{ item: A, cost: 3 }, { item: B, cost: 4 }],
37
- isGoal: (s) => s === AB,
38
- *rules(item) {
39
- // Bridge fires from either premise; the engine waits until both are known.
40
- if (item === A)
41
- yield { premises: [A, B], conclusion: AB, cost: 1 };
42
- if (item === B)
43
- yield { premises: [A, B], conclusion: AB, cost: 1 };
44
- },
45
- };
46
- const d = lightestDerivation(system);
47
- assert.ok(d);
48
- assert.equal(d.item, AB);
49
- assert.equal(d.cost, 8);
50
- assert.equal(d.premises.length, 2); // it really used the bridge
31
+ // Items: "A", "B", "AB". Axioms A (3) and B (4). A binary bridge A ∧ B → AB
32
+ // at cost 1. The only derivation of AB costs 3 + 4 + 1 = 8.
33
+ const A = "A", B = "B", AB = "AB";
34
+ const system = {
35
+ key: (s) => s,
36
+ axioms: () => [{ item: A, cost: 3 }, { item: B, cost: 4 }],
37
+ isGoal: (s) => s === AB,
38
+ *rules(item) {
39
+ // Bridge fires from either premise; the engine waits until both are known.
40
+ if (item === A) {
41
+ yield { premises: [A, B], conclusion: AB, cost: 1 };
42
+ }
43
+ if (item === B) {
44
+ yield { premises: [A, B], conclusion: AB, cost: 1 };
45
+ }
46
+ },
47
+ };
48
+ const d = lightestDerivation(system);
49
+ assert.ok(d);
50
+ assert.equal(d.item, AB);
51
+ assert.equal(d.cost, 8);
52
+ assert.equal(d.premises.length, 2); // it really used the bridge
51
53
  });
52
54
  test("lightestDerivation picks the cheaper of competing derivations", () => {
53
- // Two ways to reach the goal G from axiom S: S→G cost 10, or S→M→G cost 3+3.
54
- const system = {
55
- key: (s) => s,
56
- axioms: () => [{ item: "S", cost: 0 }],
57
- isGoal: (s) => s === "G",
58
- *rules(item) {
59
- if (item === "S") {
60
- yield { premises: ["S"], conclusion: "G", cost: 10 };
61
- yield { premises: ["S"], conclusion: "M", cost: 3 };
62
- }
63
- if (item === "M")
64
- yield { premises: ["M"], conclusion: "G", cost: 3 };
65
- },
66
- };
67
- const d = lightestDerivation(system);
68
- assert.ok(d);
69
- assert.equal(d.cost, 6); // via M, not the direct 10
70
- assert.equal(d.rule?.premises[0], "M");
55
+ // Two ways to reach the goal G from axiom S: S→G cost 10, or S→M→G cost 3+3.
56
+ const system = {
57
+ key: (s) => s,
58
+ axioms: () => [{ item: "S", cost: 0 }],
59
+ isGoal: (s) => s === "G",
60
+ *rules(item) {
61
+ if (item === "S") {
62
+ yield { premises: ["S"], conclusion: "G", cost: 10 };
63
+ yield { premises: ["S"], conclusion: "M", cost: 3 };
64
+ }
65
+ if (item === "M") {
66
+ yield { premises: ["M"], conclusion: "G", cost: 3 };
67
+ }
68
+ },
69
+ };
70
+ const d = lightestDerivation(system);
71
+ assert.ok(d);
72
+ assert.equal(d.cost, 6); // via M, not the direct 10
73
+ assert.equal(d.rule?.premises[0], "M");
71
74
  });
72
75
  test("lightestDerivation returns null when the goal is unreachable", () => {
73
- const system = {
74
- key: (n) => "" + n,
75
- axioms: () => [{ item: 0, cost: 0 }],
76
- isGoal: (n) => n === 99,
77
- *rules(n) {
78
- if (n < 3)
79
- yield { premises: [n], conclusion: n + 1, cost: 1 };
80
- },
81
- };
82
- assert.equal(lightestDerivation(system), null);
76
+ const system = {
77
+ key: (n) => "" + n,
78
+ axioms: () => [{ item: 0, cost: 0 }],
79
+ isGoal: (n) => n === 99,
80
+ *rules(n) {
81
+ if (n < 3) {
82
+ yield { premises: [n], conclusion: n + 1, cost: 1 };
83
+ }
84
+ },
85
+ };
86
+ assert.equal(lightestDerivation(system), null);
83
87
  });
84
88
  // ── cover: optimal, not greedy ─────────────────────────────────────────────
85
89
  test("coverSequence maximises coverage, beating greedy longest-match", () => {
86
- // Over [0,4): one long span [1,4) (len 3) vs two short [0,2),[2,4) (cover 4).
87
- // Greedy-longest takes [1,4) and covers 3; the optimal cover takes the pair.
88
- const cover = coverSequence(4, [
89
- { start: 1, end: 4, payload: "long" },
90
- { start: 0, end: 2, payload: "left" },
91
- { start: 2, end: 4, payload: "right" },
92
- ]);
93
- assert.equal(cover.covered, 4);
94
- assert.equal(cover.uncovered, 0);
95
- assert.deepEqual(cover.spans.map((s) => s.payload), ["left", "right"]);
90
+ // Over [0,4): one long span [1,4) (len 3) vs two short [0,2),[2,4) (cover 4).
91
+ // Greedy-longest takes [1,4) and covers 3; the optimal cover takes the pair.
92
+ const cover = coverSequence(4, [
93
+ { start: 1, end: 4, payload: "long" },
94
+ { start: 0, end: 2, payload: "left" },
95
+ { start: 2, end: 4, payload: "right" },
96
+ ]);
97
+ assert.equal(cover.covered, 4);
98
+ assert.equal(cover.uncovered, 0);
99
+ assert.deepEqual(cover.spans.map((s) => s.payload), ["left", "right"]);
96
100
  });
97
101
  test("coverSequence prefers fewer, longer spans on ties (unit weight)", () => {
98
- // [0,3) covers the same as [0,1)+[1,3) but in one span → preferred.
99
- const cover = coverSequence(3, [
100
- { start: 0, end: 3, payload: "whole" },
101
- { start: 0, end: 1, payload: "a" },
102
- { start: 1, end: 3, payload: "b" },
103
- ]);
104
- assert.deepEqual(cover.spans.map((s) => s.payload), ["whole"]);
102
+ // [0,3) covers the same as [0,1)+[1,3) but in one span → preferred.
103
+ const cover = coverSequence(3, [
104
+ { start: 0, end: 3, payload: "whole" },
105
+ { start: 0, end: 1, payload: "a" },
106
+ { start: 1, end: 3, payload: "b" },
107
+ ]);
108
+ assert.deepEqual(cover.spans.map((s) => s.payload), ["whole"]);
105
109
  });
106
110
  test("coverSequence leaves genuinely uncovered gaps uncovered", () => {
107
- const cover = coverSequence(10, [
108
- { start: 0, end: 3, payload: "x" },
109
- { start: 6, end: 9, payload: "y" },
110
- ]);
111
- assert.equal(cover.covered, 6);
112
- assert.equal(cover.uncovered, 4);
113
- assert.deepEqual(cover.spans.map((s) => s.payload), ["x", "y"]);
111
+ const cover = coverSequence(10, [
112
+ { start: 0, end: 3, payload: "x" },
113
+ { start: 6, end: 9, payload: "y" },
114
+ ]);
115
+ assert.equal(cover.covered, 6);
116
+ assert.equal(cover.uncovered, 4);
117
+ assert.deepEqual(cover.spans.map((s) => s.payload), ["x", "y"]);
114
118
  });
115
119
  test("coverSequence honours weights when coverage ties", () => {
116
- // Both single-span covers cover all 2 symbols; the lighter weight wins.
117
- const cover = coverSequence(2, [
118
- { start: 0, end: 2, weight: 5, payload: "heavy" },
119
- { start: 0, end: 2, weight: 1, payload: "light" },
120
- ]);
121
- assert.deepEqual(cover.spans.map((s) => s.payload), ["light"]);
120
+ // Both single-span covers cover all 2 symbols; the lighter weight wins.
121
+ const cover = coverSequence(2, [
122
+ { start: 0, end: 2, weight: 5, payload: "heavy" },
123
+ { start: 0, end: 2, weight: 1, payload: "light" },
124
+ ]);
125
+ assert.deepEqual(cover.spans.map((s) => s.payload), ["light"]);
122
126
  });
@@ -1,9 +1,9 @@
1
1
  /** A half-open byte span of a query an extension computed, and the canonical
2
2
  * result bytes it is authoritative for. */
3
3
  export interface ComputedSpan {
4
- i: number;
5
- j: number;
6
- bytes: Uint8Array;
4
+ i: number;
5
+ j: number;
6
+ bytes: Uint8Array;
7
7
  }
8
8
  /** The generic capabilities the mind lends every extension — nothing here
9
9
  * names any particular extension, and every member is machinery the mind
@@ -24,14 +24,17 @@ export interface ComputedSpan {
24
24
  * • reach — the river's grouping capacity (maxGroup), bounding how far apart
25
25
  * two spans may sit and still be read as one construction. */
26
26
  export interface ExtensionHost {
27
- meaningOf(bytes: Uint8Array, anchors: ReadonlyArray<{
28
- name: string;
29
- form: Uint8Array;
30
- }>): Promise<string | null>;
31
- continuation(bytes: Uint8Array): Promise<Uint8Array | null>;
32
- segment(bytes: Uint8Array): Array<{
33
- i: number;
34
- j: number;
35
- }>;
36
- reach: number;
27
+ meaningOf(
28
+ bytes: Uint8Array,
29
+ anchors: ReadonlyArray<{
30
+ name: string;
31
+ form: Uint8Array;
32
+ }>,
33
+ ): Promise<string | null>;
34
+ continuation(bytes: Uint8Array): Promise<Uint8Array | null>;
35
+ segment(bytes: Uint8Array): Array<{
36
+ i: number;
37
+ j: number;
38
+ }>;
39
+ reach: number;
37
40
  }
@@ -21,7 +21,11 @@ export declare function mergeThreshold(D: number): number;
21
21
  * fraction, the span's MAGNITUDE (√len, the linear fold's own norm) converts
22
22
  * the tolerated fraction into tolerated bytes. Derived from W, D and the
23
23
  * span; never tuned. */
24
- export declare function identityBar(D: number, maxGroup: number, len: number): number;
24
+ export declare function identityBar(
25
+ D: number,
26
+ maxGroup: number,
27
+ len: number,
28
+ ): number;
25
29
  /** The reach bar: half a river quantum, derived from the fold's own geometry.
26
30
  * A branch folds up to `maxGroup` children, so two forms that differ in ONE
27
31
  * whole child — the smallest distinction perception can mean — sit at cosine
@@ -91,20 +95,30 @@ export declare function consensusFloor(N: number): number;
91
95
  * structurally-isolated entries. Derived, never tuned. */
92
96
  export declare function coverageBar(_maxGroup: number, D: number): number;
93
97
  export interface Grid {
94
- width: number;
95
- height: number;
96
- channels: number;
97
- data: Uint8Array;
98
- dims?: number[];
98
+ width: number;
99
+ height: number;
100
+ channels: number;
101
+ data: Uint8Array;
102
+ dims?: number[];
99
103
  }
100
104
  /** Find the longest prefix of `bytes` whose leaf-id signature matches a
101
105
  * known branch via `lookup`. Returns the byte-length of that prefix, or 0. */
102
- export declare function knownPrefixLength(bytes: Uint8Array, leafAt: (i: number) => number | null, lookup: (leafIds: number[]) => number | null): number;
106
+ export declare function knownPrefixLength(
107
+ bytes: Uint8Array,
108
+ leafAt: (i: number) => number | null,
109
+ lookup: (leafIds: number[]) => number | null,
110
+ ): number;
103
111
  /** Bytes → Sema tree. `leafAt` and `lookup` are store capabilities for
104
112
  * detecting previously-stored prefixes so the river can split at the
105
113
  * correct boundary. Pass them through from `perceive`; the geometry
106
114
  * computes the stable prefix internally. */
107
- export declare function bytesToTree(space: Space, alphabet: Alphabet, bytes: Uint8Array, leafAt?: (i: number) => number | null, lookup?: (leafIds: number[]) => number | null): Sema;
115
+ export declare function bytesToTree(
116
+ space: Space,
117
+ alphabet: Alphabet,
118
+ bytes: Uint8Array,
119
+ leafAt?: (i: number) => number | null,
120
+ lookup?: (leafIds: number[]) => number | null,
121
+ ): Sema;
108
122
  /** The PLAIN fold's full level pyramid — every level's item list, bottom
109
123
  * (leaves) to top (root). Left-grouped folding is RADIX-ALIGNED: the item
110
124
  * at level L, index i, covers exactly bytes [i·mg^L, (i+1)·mg^L) whenever
@@ -118,20 +132,31 @@ export declare function bytesToTree(space: Space, alphabet: Alphabet, bytes: Uin
118
132
  * never mutated). Purely an implementation cache: structure and numerics
119
133
  * never depend on whether a pyramid was available. */
120
134
  export interface FoldPyramid {
121
- levels: Array<Array<{
122
- tree: Sema;
123
- len: number;
124
- }>>;
125
- bytes: number;
135
+ levels: Array<
136
+ Array<{
137
+ tree: Sema;
138
+ len: number;
139
+ }>
140
+ >;
141
+ bytes: number;
126
142
  }
127
143
  /** Plain bytes→tree (identical to capability-less {@link bytesToTree}) that
128
144
  * also RETURNS its pyramid, reusing `prev` — the pyramid of a PROPER
129
145
  * prefix of `bytes` (caller guarantees content match and
130
146
  * prev.bytes < bytes.length). */
131
- export declare function bytesToTreePyramid(space: Space, alphabet: Alphabet, bytes: Uint8Array, prev?: FoldPyramid): {
132
- tree: Sema;
133
- pyramid: FoldPyramid;
147
+ export declare function bytesToTreePyramid(
148
+ space: Space,
149
+ alphabet: Alphabet,
150
+ bytes: Uint8Array,
151
+ prev?: FoldPyramid,
152
+ ): {
153
+ tree: Sema;
154
+ pyramid: FoldPyramid;
134
155
  };
135
156
  export declare function hilbertBytes(grid: Grid): Uint8Array;
136
- export declare function gridToTree(space: Space, alphabet: Alphabet, grid: Grid): Sema;
157
+ export declare function gridToTree(
158
+ space: Space,
159
+ alphabet: Alphabet,
160
+ grid: Grid,
161
+ ): Sema;
137
162
  export declare function stackGrids(frames: Grid[]): Grid;