nucleation 0.10.12 → 0.10.13

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/Schematic.d.mts CHANGED
@@ -26,6 +26,31 @@ export class Schematic {
26
26
  */
27
27
  deepClone(): Schematic;
28
28
 
29
+ /**
30
+ * Inspect a versioned transform-plan JSON document without modifying
31
+ * this schematic. Writes a deterministic audit-report JSON document.
32
+ */
33
+ inspectTransformPlanJson(planJson: string): string;
34
+
35
+ /**
36
+ * Atomically apply a versioned transform-plan JSON document. Policy
37
+ * rejection is represented by `report.rejected == true` and leaves the
38
+ * schematic unchanged; malformed plans raise `InvalidArgument`.
39
+ */
40
+ applyTransformPlanJson(planJson: string): string;
41
+
42
+ /**
43
+ * Apply the bundled deterministic, lossless canonicalization preset.
44
+ */
45
+ canonicalizeJson(): string;
46
+
47
+ /**
48
+ * Inspect the bundled public-registry policy without modifying this
49
+ * schematic. Applications should review `rejected` and `quarantined`
50
+ * before choosing whether to call `apply_transform_plan_json`.
51
+ */
52
+ inspectRegistrySafeJson(): string;
53
+
29
54
  /**
30
55
  * Split spatially independent machines while keeping nearby tiny
31
56
  * detached parts with their machine. Components at least
@@ -61,6 +86,14 @@ export class Schematic {
61
86
  */
62
87
  static fromData(data: Array<number>): Schematic;
63
88
 
89
+ /**
90
+ * Decode untrusted bytes using a serialized `DecodeLimits` object.
91
+ * Empty JSON selects the conservative library defaults. Limits are
92
+ * enforced while decompressing/parsing and again before region
93
+ * allocations are accepted.
94
+ */
95
+ static fromDataBounded(data: Array<number>, limitsJson: string): Schematic;
96
+
64
97
  /**
65
98
  * Build a schematic from Litematic data.
66
99
  */
@@ -575,6 +608,19 @@ export class Schematic {
575
608
  */
576
609
  clearProvenance(): void;
577
610
 
611
+ /**
612
+ * Content-addressed processing history as a JSON array. This audit
613
+ * trail is deliberately separate from immutable source provenance.
614
+ */
615
+ transformationHistoryJson(): string;
616
+
617
+ /**
618
+ * Clear processing history without changing source provenance or
619
+ * schematic content. Intended for callers constructing a new artifact
620
+ * lineage, not for hiding registry audit records.
621
+ */
622
+ clearTransformationHistory(): void;
623
+
578
624
  /**
579
625
  * Mirror the default region along the X axis (in place). Block
580
626
  * orientations, block entities, and entities are mirrored too.
package/Schematic.d.ts CHANGED
@@ -26,6 +26,31 @@ export class Schematic {
26
26
  */
27
27
  deepClone(): Schematic;
28
28
 
29
+ /**
30
+ * Inspect a versioned transform-plan JSON document without modifying
31
+ * this schematic. Writes a deterministic audit-report JSON document.
32
+ */
33
+ inspectTransformPlanJson(planJson: string): string;
34
+
35
+ /**
36
+ * Atomically apply a versioned transform-plan JSON document. Policy
37
+ * rejection is represented by `report.rejected == true` and leaves the
38
+ * schematic unchanged; malformed plans raise `InvalidArgument`.
39
+ */
40
+ applyTransformPlanJson(planJson: string): string;
41
+
42
+ /**
43
+ * Apply the bundled deterministic, lossless canonicalization preset.
44
+ */
45
+ canonicalizeJson(): string;
46
+
47
+ /**
48
+ * Inspect the bundled public-registry policy without modifying this
49
+ * schematic. Applications should review `rejected` and `quarantined`
50
+ * before choosing whether to call `apply_transform_plan_json`.
51
+ */
52
+ inspectRegistrySafeJson(): string;
53
+
29
54
  /**
30
55
  * Split spatially independent machines while keeping nearby tiny
31
56
  * detached parts with their machine. Components at least
@@ -61,6 +86,14 @@ export class Schematic {
61
86
  */
62
87
  static fromData(data: Array<number>): Schematic;
63
88
 
89
+ /**
90
+ * Decode untrusted bytes using a serialized `DecodeLimits` object.
91
+ * Empty JSON selects the conservative library defaults. Limits are
92
+ * enforced while decompressing/parsing and again before region
93
+ * allocations are accepted.
94
+ */
95
+ static fromDataBounded(data: Array<number>, limitsJson: string): Schematic;
96
+
64
97
  /**
65
98
  * Build a schematic from Litematic data.
66
99
  */
@@ -575,6 +608,19 @@ export class Schematic {
575
608
  */
576
609
  clearProvenance(): void;
577
610
 
611
+ /**
612
+ * Content-addressed processing history as a JSON array. This audit
613
+ * trail is deliberately separate from immutable source provenance.
614
+ */
615
+ transformationHistoryJson(): string;
616
+
617
+ /**
618
+ * Clear processing history without changing source provenance or
619
+ * schematic content. Intended for callers constructing a new artifact
620
+ * lineage, not for hiding registry audit records.
621
+ */
622
+ clearTransformationHistory(): void;
623
+
578
624
  /**
579
625
  * Mirror the default region along the X axis (in place). Block
580
626
  * orientations, block entities, and entities are mirrored too.
package/Schematic.mjs CHANGED
@@ -78,6 +78,109 @@ export class Schematic {
78
78
  }
79
79
  }
80
80
 
81
+ /**
82
+ * Inspect a versioned transform-plan JSON document without modifying
83
+ * this schematic. Writes a deterministic audit-report JSON document.
84
+ */
85
+ inspectTransformPlanJson(planJson) {
86
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
87
+
88
+ const planJsonSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, planJson)));
89
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
90
+
91
+ const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
92
+
93
+
94
+ const result = wasm.Schematic_inspect_transform_plan_json(diplomatReceive.buffer, this.ffiValue, planJsonSlice.ptr, write.buffer);
95
+
96
+ try {
97
+ if (!diplomatReceive.resultFlag) {
98
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
99
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
100
+ }
101
+ return write.readString8();
102
+ }
103
+
104
+ finally {
105
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
106
+ functionCleanupArena.free();
107
+
108
+ diplomatReceive.free();
109
+ write.free();
110
+ }
111
+ }
112
+
113
+ /**
114
+ * Atomically apply a versioned transform-plan JSON document. Policy
115
+ * rejection is represented by `report.rejected == true` and leaves the
116
+ * schematic unchanged; malformed plans raise `InvalidArgument`.
117
+ */
118
+ applyTransformPlanJson(planJson) {
119
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
120
+
121
+ const planJsonSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, planJson)));
122
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
123
+
124
+ const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
125
+
126
+
127
+ const result = wasm.Schematic_apply_transform_plan_json(diplomatReceive.buffer, this.ffiValue, planJsonSlice.ptr, write.buffer);
128
+
129
+ try {
130
+ if (!diplomatReceive.resultFlag) {
131
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
132
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
133
+ }
134
+ return write.readString8();
135
+ }
136
+
137
+ finally {
138
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
139
+ functionCleanupArena.free();
140
+
141
+ diplomatReceive.free();
142
+ write.free();
143
+ }
144
+ }
145
+
146
+ /**
147
+ * Apply the bundled deterministic, lossless canonicalization preset.
148
+ */
149
+ canonicalizeJson() {
150
+ const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
151
+
152
+ wasm.Schematic_canonicalize_json(this.ffiValue, write.buffer);
153
+
154
+ try {
155
+ return write.readString8();
156
+ }
157
+
158
+ finally {
159
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
160
+ write.free();
161
+ }
162
+ }
163
+
164
+ /**
165
+ * Inspect the bundled public-registry policy without modifying this
166
+ * schematic. Applications should review `rejected` and `quarantined`
167
+ * before choosing whether to call `apply_transform_plan_json`.
168
+ */
169
+ inspectRegistrySafeJson() {
170
+ const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
171
+
172
+ wasm.Schematic_inspect_registry_safe_json(this.ffiValue, write.buffer);
173
+
174
+ try {
175
+ return write.readString8();
176
+ }
177
+
178
+ finally {
179
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
180
+ write.free();
181
+ }
182
+ }
183
+
81
184
  /**
82
185
  * Split spatially independent machines while keeping nearby tiny
83
186
  * detached parts with their machine. Components at least
@@ -205,6 +308,38 @@ export class Schematic {
205
308
  }
206
309
  }
207
310
 
311
+ /**
312
+ * Decode untrusted bytes using a serialized `DecodeLimits` object.
313
+ * Empty JSON selects the conservative library defaults. Limits are
314
+ * enforced while decompressing/parsing and again before region
315
+ * allocations are accepted.
316
+ */
317
+ static fromDataBounded(data, limitsJson) {
318
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
319
+
320
+ const dataSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.slice(wasm, data, "u8")));
321
+ const limitsJsonSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, limitsJson)));
322
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
323
+
324
+
325
+ const result = wasm.Schematic_from_data_bounded(diplomatReceive.buffer, dataSlice.ptr, limitsJsonSlice.ptr);
326
+
327
+ try {
328
+ if (!diplomatReceive.resultFlag) {
329
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
330
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
331
+ }
332
+ return new Schematic(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
333
+ }
334
+
335
+ finally {
336
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
337
+ functionCleanupArena.free();
338
+
339
+ diplomatReceive.free();
340
+ }
341
+ }
342
+
208
343
  /**
209
344
  * Build a schematic from Litematic data.
210
345
  */
@@ -2267,6 +2402,40 @@ export class Schematic {
2267
2402
  }
2268
2403
  }
2269
2404
 
2405
+ /**
2406
+ * Content-addressed processing history as a JSON array. This audit
2407
+ * trail is deliberately separate from immutable source provenance.
2408
+ */
2409
+ transformationHistoryJson() {
2410
+ const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
2411
+
2412
+ wasm.Schematic_transformation_history_json(this.ffiValue, write.buffer);
2413
+
2414
+ try {
2415
+ return write.readString8();
2416
+ }
2417
+
2418
+ finally {
2419
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
2420
+ write.free();
2421
+ }
2422
+ }
2423
+
2424
+ /**
2425
+ * Clear processing history without changing source provenance or
2426
+ * schematic content. Intended for callers constructing a new artifact
2427
+ * lineage, not for hiding registry audit records.
2428
+ */
2429
+ clearTransformationHistory() {
2430
+ wasm.Schematic_clear_transformation_history(this.ffiValue);
2431
+
2432
+ try {}
2433
+
2434
+ finally {
2435
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
2436
+ }
2437
+ }
2438
+
2270
2439
  /**
2271
2440
  * Mirror the default region along the X axis (in place). Block
2272
2441
  * orientations, block entities, and entities are mirrored too.
package/nucleation.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nucleation",
3
- "version": "0.10.12",
3
+ "version": "0.10.13",
4
4
  "description": "A high-performance Minecraft schematic parser and utility library",
5
5
  "type": "module",
6
6
  "main": "index.mjs",