@yodaos-pkg/aix 0.10.0 → 0.11.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.
package/jsr.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@yodaos-pkg/aix",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "exports": "./index.js"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yodaos-pkg/aix",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Ink AIX Package Reader",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -8,7 +8,6 @@
8
8
  "files": [
9
9
  "*"
10
10
  ],
11
- "dependencies": {},
12
11
  "repository": {
13
12
  "url": "https://github.com/jsar-project/ink"
14
13
  },
package/pkg/README.md CHANGED
@@ -30,7 +30,104 @@ async function fromFile(file: File) {
30
30
  }
31
31
  ```
32
32
 
33
- ## Using the Package Lab
33
+ ## WASM Loading
34
+
35
+ `AIX.From()` and all instance methods initialize a separate reader-only WASM.
36
+ They do not load image codecs, script minification, or source/schema checking.
37
+ The first pack, optimize, or source-check call lazily loads the full module;
38
+ concurrent tooling calls share initialization. Existing reader instances remain
39
+ valid after tooling loads, and tooling-only calls do not fetch reader WASM.
40
+
41
+ The generated distribution includes `pkg-reader/` and `pkg/`; self-host both
42
+ with their adjacent JS/WASM files. The existing raw `pkg/aix_web.js` exports
43
+ remain complete and the npm CLI keeps its synchronous full Node.js bundle.
44
+ Rust builds default to the `tooling` feature; `--no-default-features` produces
45
+ reader exports without the packer dependency. `npm run build` builds both web
46
+ artifacts; `npm run build:wasm:reader` builds only the reader artifact.
47
+
48
+ Local measurements reduced reader WASM from 5,514,021 to 355,365 bytes. Mixed
49
+ reader/tooling workflows load both binaries and retain two module memories.
50
+ See the repository's `docs/wasm.md` for baseline samples, timing limits, the
51
+ compatibility plan, and reproduction commands.
52
+
53
+ ## Archive Resource Limits
54
+
55
+ Pass caller-selected budgets when reading untrusted packages:
56
+
57
+ ```typescript
58
+ const aix = await AIX.From(file, {
59
+ maxEntries: 1024,
60
+ maxEntryBytes: 8 * 1024 * 1024,
61
+ maxTotalBytes: 32 * 1024 * 1024,
62
+ });
63
+ ```
64
+
65
+ All limits are inclusive non-negative safe integers. Directories and signature
66
+ metadata count too. Metadata is rejected before extraction if over budget;
67
+ extraction also bounds output and retains CRC and size checks. `maxTotalBytes`
68
+ is the sum of declared uncompressed sizes, not a cumulative read budget.
69
+ Zero allows no entries or bytes. Omitted fields and the original `AIX.From(data)`
70
+ call remain unlimited for compatibility; set all three limits for untrusted
71
+ packages. The input archive buffer, parsed objects, and retained copies need
72
+ separate budgets. This policy applies to readers, not `AIX.optimize`.
73
+
74
+ Direct WASM consumers can call `AixReaderWasm.with_limits(data, limits)` using
75
+ the same fields. The existing `new AixReaderWasm(data)` constructor is unchanged.
76
+
77
+ ## Check Source Files
78
+
79
+ The Web SDK and npm CLI use the same complete in-memory check engine:
80
+
81
+ ```typescript
82
+ import { AIX, type CheckReport } from '@yodaos-pkg/aix';
83
+
84
+ const encode = (source: string) => new TextEncoder().encode(source);
85
+ const report: CheckReport = await AIX.checkFromSource([
86
+ { path: 'app.json', data: encode('{"pages":[]}') },
87
+ { path: 'main.ts', data: encode('const count: number = ;') },
88
+ ], { onProgress: (event) => console.log(event.type) });
89
+ console.log(report.diagnostics); // AIX029: invalid TypeScript syntax at main.ts:1
90
+
91
+ // Files from an <input type="file" webkitdirectory> selection also work.
92
+ const fileReport = await AIX.checkFromFiles(Array.from(input.files ?? []));
93
+ ```
94
+
95
+ Checks cover JSON/config validity, Page/Widget structure, component references
96
+ and cycles, JS/TS syntax, statically recognizable permissions, and Page JSON Schemas. Each diagnostic has `code`, `severity`, `path`,
97
+ `line`, `column`, and `message`. Source errors are returned in the report;
98
+ invalid input paths or collection failures reject the promise.
99
+
100
+ `checkFromSource` takes paths relative to the application root. `checkFromFiles`
101
+ uses `webkitRelativePath`, removing the selected directory's outer folder.
102
+ Both apply nested `.aixignore` rules and exclude local `.aix` caches. The shared
103
+ check adapter loads only when checking is first requested. It uses the WASM
104
+ engine without a Node filesystem, Node polyfills, or dependency downloads.
105
+ The same API also works in a Web Worker.
106
+
107
+ Both methods accept `CheckOptions` with an optional `onProgress` callback.
108
+ `CheckProgressEvent` reports checker loading, source/schema validation (input
109
+ file count), and diagnostic collection. These are stage notifications, not a
110
+ percentage estimate. Browser checks are synchronous after loading; run the API
111
+ in a Web Worker to keep a browser progress display responsive.
112
+
113
+ `check_finished` events carry an exported `CheckResult` with `id`, `label`,
114
+ `status` (`passed`, `warning`, `failed`, or `skipped`), `errors`, `warnings`, and
115
+ an optional `detail` explaining incomplete/skipped checks. The CLI uses the same
116
+ results for its final checklist. The returned `CheckReport` remains a diagnostic
117
+ report, so JSON callers do not need to parse terminal output.
118
+
119
+ JavaScript and TypeScript are syntax-checked, including `.ts`, `.mts`, `.cts`,
120
+ and Ink `<script lang="ts">` blocks. Inline diagnostics retain their original
121
+ Ink file locations. TypeScript semantic, import-resolution, and compiler-option
122
+ checks are currently excluded. No type environment is loaded, and checks do not
123
+ emit or run code.
124
+
125
+ Page `schema.data` is validated against `$schema` (2020-12 by default), including
126
+ nested keywords, patterns, and local references. Missing/null schemas remain
127
+ accepted. External schema resources are not fetched. These checks validate
128
+ schema declarations, not runtime data; packing and reader semantics are unchanged.
129
+
130
+ ## Using Play
34
131
 
35
132
  The official browser lab now lives in the docs site at `/play`.
36
133
 
@@ -79,7 +176,7 @@ This is useful for verifying whether `app.json`, page schemas, and `getTools()`
79
176
  ### Pack and Optimize
80
177
 
81
178
  The Web package includes the same in-memory packer and pure Rust resource
82
- optimizer as the native CLI:
179
+ optimizer used by the npm CLI:
83
180
 
84
181
  ```ts
85
182
  const packed = await AIX.pack(
@@ -165,18 +262,52 @@ const pages = aix.getPages();
165
262
  [{
166
263
  name: "pages/index/index",
167
264
  title: "Home",
168
- data_schema: { ... }
265
+ description: null,
266
+ data_schema: { ... },
267
+ size: { width: 480, height: 168 }
169
268
  }]
170
269
  */
171
270
  ```
172
271
 
173
- #### `getWidgets(): WidgetInfo[]`
174
- Returns widget declarations after verifying that every path resolves to an `.ink` entry in the package. Throws when a declared entry is missing.
272
+ #### `getWidgets(locale?): WidgetInfo[]`
273
+ Returns widget declarations after verifying that every path resolves to an `.ink` entry in the package. When `locale` is provided, merges `displayName` and `description` from the matching `app.<locale>.json` overlay. Throws when a declared entry is missing or the selected locale file is invalid.
175
274
  ```typescript
176
- const widgets = aix.getWidgets();
177
- // [{ path: "widgets/clock/index", family: "1x1", placement: "persistent" }]
275
+ const widgets = aix.getWidgets('en-US');
276
+ // [{ path: "widgets/clock/index", family: "1x1", placement: "persistent", displayName: "Clock", description: "Shows the current time." }]
178
277
  ```
179
278
 
279
+ #### `resolveMetadata(): MetadataResolution`
280
+
281
+ Returns `{ pages, tools, diagnostics }` synchronously. Missing/unreadable resources,
282
+ UTF-8 errors, and malformed page metadata produce `{ path, message }` diagnostics,
283
+ one per failed page. Failed pages are excluded from both result lists; other
284
+ pages retain declaration order. A valid empty page list has no diagnostics;
285
+ invalid/unreadable `app.json.pages` produces an `app.json` diagnostic.
286
+
287
+ ```typescript
288
+ const result = aix.resolveMetadata();
289
+ console.log(result.diagnostics);
290
+ const tools = result.tools; // only successfully resolved pages
291
+ // For all-or-nothing acceptance, require result.diagnostics.length === 0.
292
+ ```
293
+
294
+ This API requires readable `.ink`, or both `.json` and `.wxml` for traditional
295
+ pages, and checks ZIP integrity and UTF-8 for resources it reads. It deserializes
296
+ page JSON and complete Ink `<script def>` blocks. Optional definitions, schemas,
297
+ and styles may be absent; present styles must be readable (`.wcss` before `.wxss`).
298
+ A broken Ink entry never falls back to traditional files. Use source checking
299
+ for full syntax, component, and JSON Schema validation. Runtime execution and
300
+ packing validation are unchanged.
301
+
302
+ `getPages()`/`getTools()` remain tolerant and can return default metadata/tools
303
+ even for missing resources. Page, Widget, and title fields are parsed separately;
304
+ invalid Widget fields no longer hide valid pages. `getWidgets()` still reports
305
+ Widget errors. Direct WASM consumers use `reader.resolve_metadata()`.
306
+
307
+ Exported `MetadataResolution` has `pages: PageInfo[]`, `tools: Tool[]`, and
308
+ `diagnostics: MetadataDiagnostic[]`; `MetadataDiagnostic` has `path` and `message`
309
+ string fields.
310
+
180
311
  #### `getTools(): Tool[]`
181
312
  Generates a list of OpenAI-compatible tool definitions based on the pages and their schemas.
182
313
  ```typescript
@@ -184,6 +315,8 @@ const tools = aix.getTools();
184
315
  /*
185
316
  [{
186
317
  type: "function",
318
+ target: "_blank",
319
+ layout: { width: 480, height: 168 },
187
320
  function: {
188
321
  name: "pages_index_index",
189
322
  description: "Home",
@@ -204,12 +337,28 @@ interface AixEntry {
204
337
  }
205
338
  ```
206
339
 
340
+ ### JSON and layout types
341
+ ```typescript
342
+ type JsonValue = null | boolean | number | string | JsonValue[] | JsonObject;
343
+ interface JsonObject { [key: string]: JsonValue }
344
+ type JsonSchema = JsonValue;
345
+ interface PageConstraint { width: number; height: number }
346
+ type ToolTarget = '_current' | '_blank';
347
+ type WidgetPlacement = 'persistent' | 'overlay';
348
+ ```
349
+
350
+ `JsonSchema` retains arbitrary JSON, including boolean schemas and unvalidated
351
+ legacy values. Use `AIX.checkFromSource()` for schema validation. Page `size`
352
+ and tool `layout` both contain numeric width/height constraints.
353
+
207
354
  ### `PageInfo`
208
355
  ```typescript
209
356
  interface PageInfo {
210
357
  name: string;
211
- title?: string;
212
- data_schema: any;
358
+ title: string | null;
359
+ description: string | null;
360
+ data_schema: JsonSchema;
361
+ size: PageConstraint;
213
362
  }
214
363
  ```
215
364
 
@@ -218,6 +367,9 @@ interface PageInfo {
218
367
  interface WidgetInfo {
219
368
  path: string;
220
369
  family: string;
370
+ placement: WidgetPlacement;
371
+ displayName: string | null;
372
+ description: string | null;
221
373
  }
222
374
  ```
223
375
 
@@ -226,14 +378,25 @@ OpenAI compatible tool format.
226
378
  ```typescript
227
379
  interface Tool {
228
380
  type: string;
229
- function: {
230
- name: string;
231
- description?: string;
232
- parameters: any;
233
- };
381
+ target: ToolTarget;
382
+ layout: PageConstraint;
383
+ function: FunctionDefinition;
384
+ }
385
+ interface FunctionDefinition {
386
+ name: string;
387
+ description: string | null;
388
+ parameters: JsonSchema;
234
389
  }
235
390
  ```
236
391
 
392
+ Metadata fields above are always present. Missing strings and nested JSON null
393
+ values now remain `null` through raw WASM, SDK getters, and `resolveMetadata()`,
394
+ matching native Rust JSON. Earlier WASM builds returned `undefined` for these
395
+ values; update explicit `=== undefined` checks to `=== null` when migrating
396
+ metadata consumers. Standalone `getTitle()` and `getVersion()` retain their
397
+ `string | undefined` return type. Tools currently emit `type: "function"` and
398
+ underscore-prefixed targets; `current`/`blank` are input aliases only.
399
+
237
400
  ## Build
238
401
 
239
402
  To build the library for distribution:
package/pkg/aix_web.d.ts CHANGED
@@ -13,15 +13,27 @@ export class AixPackResultWasm {
13
13
  export class AixReaderWasm {
14
14
  free(): void;
15
15
  [Symbol.dispose](): void;
16
+ get_agent_id(): string | undefined;
16
17
  get_pages(): any;
17
18
  get_title(): string | undefined;
18
19
  get_tools(): any;
19
20
  get_version(): string | undefined;
20
- get_widgets(): any;
21
+ get_widgets(locale?: string | null): any;
21
22
  list(): any;
23
+ /**
24
+ * Compatibility constructor without caller resource budgets.
25
+ */
22
26
  constructor(data: Uint8Array);
23
27
  read_file(name: string): Uint8Array;
28
+ /**
29
+ * Resolve readable pages/tools and expose per-resource failures as diagnostics.
30
+ */
31
+ resolve_metadata(): any;
24
32
  supports_engine(current_version: string): boolean;
33
+ /**
34
+ * Create a reader with inclusive caller budgets. Omitted fields are unlimited.
35
+ */
36
+ static with_limits(data: Uint8Array, limits: any): AixReaderWasm;
25
37
  }
26
38
 
27
39
  export class AixSourcePackBuilderWasm {
@@ -29,43 +41,64 @@ export class AixSourcePackBuilderWasm {
29
41
  [Symbol.dispose](): void;
30
42
  add_file(path: string, data: Uint8Array): void;
31
43
  constructor();
32
- pack_from_source_with_progress(build_id: string, engine: string | null | undefined, optimize_options: any, progress: Function): AixPackResultWasm;
44
+ pack_from_source_with_progress(build_id: string, engine: string | null | undefined, optimize_options: any, progress: Function, agent_id?: string | null): AixPackResultWasm;
33
45
  }
34
46
 
47
+ /**
48
+ * Check source files using the same collection rules as the pack command.
49
+ */
50
+ export function check_aix_from_source(files: any): any;
51
+
52
+ /**
53
+ * Collect a pre-optimization source snapshot using the packer's shared rules.
54
+ */
55
+ export function collect_aix_source(files: any): any;
56
+
35
57
  export function optimize_aix(data: Uint8Array, options: any): AixPackResultWasm;
36
58
 
37
- export function pack_aix(files: any, build_id: string, engine: string | null | undefined, optimize_options: any): AixPackResultWasm;
59
+ export function pack_aix(files: any, build_id: string, engine: string | null | undefined, optimize_options: any, agent_id?: string | null): AixPackResultWasm;
60
+
61
+ export function pack_aix_from_source(files: any, build_id: string, engine: string | null | undefined, optimize_options: any, agent_id?: string | null): AixPackResultWasm;
38
62
 
39
- export function pack_aix_from_source(files: any, build_id: string, engine: string | null | undefined, optimize_options: any): AixPackResultWasm;
63
+ export function pack_aix_from_source_with_progress(files: any, build_id: string, engine: string | null | undefined, optimize_options: any, progress: Function, agent_id?: string | null): AixPackResultWasm;
40
64
 
41
- export function pack_aix_from_source_with_progress(files: any, build_id: string, engine: string | null | undefined, optimize_options: any, progress: Function): AixPackResultWasm;
65
+ /**
66
+ * Check source files and return diagnostics with executed check coverage.
67
+ */
68
+ export function prepare_aix_check(files: any): any;
42
69
 
43
70
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
44
71
 
45
72
  export interface InitOutput {
46
73
  readonly memory: WebAssembly.Memory;
47
74
  readonly __wbg_aixpackresultwasm_free: (a: number, b: number) => void;
48
- readonly __wbg_aixreaderwasm_free: (a: number, b: number) => void;
49
75
  readonly __wbg_aixsourcepackbuilderwasm_free: (a: number, b: number) => void;
50
76
  readonly aixpackresultwasm_data: (a: number) => any;
51
77
  readonly aixpackresultwasm_report: (a: number) => [number, number, number];
52
78
  readonly aixpackresultwasm_warnings: (a: number) => [number, number, number];
79
+ readonly aixsourcepackbuilderwasm_add_file: (a: number, b: number, c: number, d: number, e: number) => void;
80
+ readonly aixsourcepackbuilderwasm_new: () => number;
81
+ readonly aixsourcepackbuilderwasm_pack_from_source_with_progress: (a: number, b: number, c: number, d: number, e: number, f: any, g: any, h: number, i: number) => [number, number, number];
82
+ readonly check_aix_from_source: (a: any) => [number, number, number];
83
+ readonly collect_aix_source: (a: any) => [number, number, number];
84
+ readonly optimize_aix: (a: number, b: number, c: any) => [number, number, number];
85
+ readonly pack_aix: (a: any, b: number, c: number, d: number, e: number, f: any, g: number, h: number) => [number, number, number];
86
+ readonly pack_aix_from_source: (a: any, b: number, c: number, d: number, e: number, f: any, g: number, h: number) => [number, number, number];
87
+ readonly pack_aix_from_source_with_progress: (a: any, b: number, c: number, d: number, e: number, f: any, g: any, h: number, i: number) => [number, number, number];
88
+ readonly prepare_aix_check: (a: any) => [number, number, number];
89
+ readonly __wbg_aixreaderwasm_free: (a: number, b: number) => void;
90
+ readonly aixreaderwasm_get_agent_id: (a: number) => [number, number, number, number];
53
91
  readonly aixreaderwasm_get_pages: (a: number) => [number, number, number];
54
92
  readonly aixreaderwasm_get_title: (a: number) => [number, number];
55
93
  readonly aixreaderwasm_get_tools: (a: number) => [number, number, number];
56
94
  readonly aixreaderwasm_get_version: (a: number) => [number, number];
57
- readonly aixreaderwasm_get_widgets: (a: number) => [number, number, number];
95
+ readonly aixreaderwasm_get_widgets: (a: number, b: number, c: number) => [number, number, number];
58
96
  readonly aixreaderwasm_list: (a: number) => [number, number, number];
59
97
  readonly aixreaderwasm_new: (a: number, b: number) => [number, number, number];
60
98
  readonly aixreaderwasm_read_file: (a: number, b: number, c: number) => [number, number, number, number];
99
+ readonly aixreaderwasm_resolve_metadata: (a: number) => [number, number, number];
61
100
  readonly aixreaderwasm_supports_engine: (a: number, b: number, c: number) => [number, number, number];
62
- readonly aixsourcepackbuilderwasm_add_file: (a: number, b: number, c: number, d: number, e: number) => void;
63
- readonly aixsourcepackbuilderwasm_new: () => number;
64
- readonly aixsourcepackbuilderwasm_pack_from_source_with_progress: (a: number, b: number, c: number, d: number, e: number, f: any, g: any) => [number, number, number];
65
- readonly optimize_aix: (a: number, b: number, c: any) => [number, number, number];
66
- readonly pack_aix: (a: any, b: number, c: number, d: number, e: number, f: any) => [number, number, number];
67
- readonly pack_aix_from_source: (a: any, b: number, c: number, d: number, e: number, f: any) => [number, number, number];
68
- readonly pack_aix_from_source_with_progress: (a: any, b: number, c: number, d: number, e: number, f: any, g: any) => [number, number, number];
101
+ readonly aixreaderwasm_with_limits: (a: number, b: number, c: any) => [number, number, number];
69
102
  readonly __wbindgen_malloc: (a: number, b: number) => number;
70
103
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
71
104
  readonly __wbindgen_exn_store: (a: number) => void;
package/pkg/aix_web.js CHANGED
@@ -48,6 +48,12 @@ export class AixPackResultWasm {
48
48
  if (Symbol.dispose) AixPackResultWasm.prototype[Symbol.dispose] = AixPackResultWasm.prototype.free;
49
49
 
50
50
  export class AixReaderWasm {
51
+ static __wrap(ptr) {
52
+ const obj = Object.create(AixReaderWasm.prototype);
53
+ obj.__wbg_ptr = ptr;
54
+ AixReaderWasmFinalization.register(obj, obj.__wbg_ptr, obj);
55
+ return obj;
56
+ }
51
57
  __destroy_into_raw() {
52
58
  const ptr = this.__wbg_ptr;
53
59
  this.__wbg_ptr = 0;
@@ -58,6 +64,21 @@ export class AixReaderWasm {
58
64
  const ptr = this.__destroy_into_raw();
59
65
  wasm.__wbg_aixreaderwasm_free(ptr, 0);
60
66
  }
67
+ /**
68
+ * @returns {string | undefined}
69
+ */
70
+ get_agent_id() {
71
+ const ret = wasm.aixreaderwasm_get_agent_id(this.__wbg_ptr);
72
+ if (ret[3]) {
73
+ throw takeFromExternrefTable0(ret[2]);
74
+ }
75
+ let v1;
76
+ if (ret[0] !== 0) {
77
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
78
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
79
+ }
80
+ return v1;
81
+ }
61
82
  /**
62
83
  * @returns {any}
63
84
  */
@@ -103,10 +124,13 @@ export class AixReaderWasm {
103
124
  return v1;
104
125
  }
105
126
  /**
127
+ * @param {string | null} [locale]
106
128
  * @returns {any}
107
129
  */
108
- get_widgets() {
109
- const ret = wasm.aixreaderwasm_get_widgets(this.__wbg_ptr);
130
+ get_widgets(locale) {
131
+ var ptr0 = isLikeNone(locale) ? 0 : passStringToWasm0(locale, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
132
+ var len0 = WASM_VECTOR_LEN;
133
+ const ret = wasm.aixreaderwasm_get_widgets(this.__wbg_ptr, ptr0, len0);
110
134
  if (ret[2]) {
111
135
  throw takeFromExternrefTable0(ret[1]);
112
136
  }
@@ -123,6 +147,7 @@ export class AixReaderWasm {
123
147
  return takeFromExternrefTable0(ret[0]);
124
148
  }
125
149
  /**
150
+ * Compatibility constructor without caller resource budgets.
126
151
  * @param {Uint8Array} data
127
152
  */
128
153
  constructor(data) {
@@ -151,6 +176,17 @@ export class AixReaderWasm {
151
176
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
152
177
  return v2;
153
178
  }
179
+ /**
180
+ * Resolve readable pages/tools and expose per-resource failures as diagnostics.
181
+ * @returns {any}
182
+ */
183
+ resolve_metadata() {
184
+ const ret = wasm.aixreaderwasm_resolve_metadata(this.__wbg_ptr);
185
+ if (ret[2]) {
186
+ throw takeFromExternrefTable0(ret[1]);
187
+ }
188
+ return takeFromExternrefTable0(ret[0]);
189
+ }
154
190
  /**
155
191
  * @param {string} current_version
156
192
  * @returns {boolean}
@@ -164,6 +200,21 @@ export class AixReaderWasm {
164
200
  }
165
201
  return ret[0] !== 0;
166
202
  }
203
+ /**
204
+ * Create a reader with inclusive caller budgets. Omitted fields are unlimited.
205
+ * @param {Uint8Array} data
206
+ * @param {any} limits
207
+ * @returns {AixReaderWasm}
208
+ */
209
+ static with_limits(data, limits) {
210
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
211
+ const len0 = WASM_VECTOR_LEN;
212
+ const ret = wasm.aixreaderwasm_with_limits(ptr0, len0, limits);
213
+ if (ret[2]) {
214
+ throw takeFromExternrefTable0(ret[1]);
215
+ }
216
+ return AixReaderWasm.__wrap(ret[0]);
217
+ }
167
218
  }
168
219
  if (Symbol.dispose) AixReaderWasm.prototype[Symbol.dispose] = AixReaderWasm.prototype.free;
169
220
 
@@ -200,14 +251,17 @@ export class AixSourcePackBuilderWasm {
200
251
  * @param {string | null | undefined} engine
201
252
  * @param {any} optimize_options
202
253
  * @param {Function} progress
254
+ * @param {string | null} [agent_id]
203
255
  * @returns {AixPackResultWasm}
204
256
  */
205
- pack_from_source_with_progress(build_id, engine, optimize_options, progress) {
257
+ pack_from_source_with_progress(build_id, engine, optimize_options, progress, agent_id) {
206
258
  const ptr0 = passStringToWasm0(build_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
207
259
  const len0 = WASM_VECTOR_LEN;
208
260
  var ptr1 = isLikeNone(engine) ? 0 : passStringToWasm0(engine, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
209
261
  var len1 = WASM_VECTOR_LEN;
210
- const ret = wasm.aixsourcepackbuilderwasm_pack_from_source_with_progress(this.__wbg_ptr, ptr0, len0, ptr1, len1, optimize_options, progress);
262
+ var ptr2 = isLikeNone(agent_id) ? 0 : passStringToWasm0(agent_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
263
+ var len2 = WASM_VECTOR_LEN;
264
+ const ret = wasm.aixsourcepackbuilderwasm_pack_from_source_with_progress(this.__wbg_ptr, ptr0, len0, ptr1, len1, optimize_options, progress, ptr2, len2);
211
265
  if (ret[2]) {
212
266
  throw takeFromExternrefTable0(ret[1]);
213
267
  }
@@ -216,6 +270,32 @@ export class AixSourcePackBuilderWasm {
216
270
  }
217
271
  if (Symbol.dispose) AixSourcePackBuilderWasm.prototype[Symbol.dispose] = AixSourcePackBuilderWasm.prototype.free;
218
272
 
273
+ /**
274
+ * Check source files using the same collection rules as the pack command.
275
+ * @param {any} files
276
+ * @returns {any}
277
+ */
278
+ export function check_aix_from_source(files) {
279
+ const ret = wasm.check_aix_from_source(files);
280
+ if (ret[2]) {
281
+ throw takeFromExternrefTable0(ret[1]);
282
+ }
283
+ return takeFromExternrefTable0(ret[0]);
284
+ }
285
+
286
+ /**
287
+ * Collect a pre-optimization source snapshot using the packer's shared rules.
288
+ * @param {any} files
289
+ * @returns {any}
290
+ */
291
+ export function collect_aix_source(files) {
292
+ const ret = wasm.collect_aix_source(files);
293
+ if (ret[2]) {
294
+ throw takeFromExternrefTable0(ret[1]);
295
+ }
296
+ return takeFromExternrefTable0(ret[0]);
297
+ }
298
+
219
299
  /**
220
300
  * @param {Uint8Array} data
221
301
  * @param {any} options
@@ -236,14 +316,17 @@ export function optimize_aix(data, options) {
236
316
  * @param {string} build_id
237
317
  * @param {string | null | undefined} engine
238
318
  * @param {any} optimize_options
319
+ * @param {string | null} [agent_id]
239
320
  * @returns {AixPackResultWasm}
240
321
  */
241
- export function pack_aix(files, build_id, engine, optimize_options) {
322
+ export function pack_aix(files, build_id, engine, optimize_options, agent_id) {
242
323
  const ptr0 = passStringToWasm0(build_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
243
324
  const len0 = WASM_VECTOR_LEN;
244
325
  var ptr1 = isLikeNone(engine) ? 0 : passStringToWasm0(engine, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
245
326
  var len1 = WASM_VECTOR_LEN;
246
- const ret = wasm.pack_aix(files, ptr0, len0, ptr1, len1, optimize_options);
327
+ var ptr2 = isLikeNone(agent_id) ? 0 : passStringToWasm0(agent_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
328
+ var len2 = WASM_VECTOR_LEN;
329
+ const ret = wasm.pack_aix(files, ptr0, len0, ptr1, len1, optimize_options, ptr2, len2);
247
330
  if (ret[2]) {
248
331
  throw takeFromExternrefTable0(ret[1]);
249
332
  }
@@ -255,14 +338,17 @@ export function pack_aix(files, build_id, engine, optimize_options) {
255
338
  * @param {string} build_id
256
339
  * @param {string | null | undefined} engine
257
340
  * @param {any} optimize_options
341
+ * @param {string | null} [agent_id]
258
342
  * @returns {AixPackResultWasm}
259
343
  */
260
- export function pack_aix_from_source(files, build_id, engine, optimize_options) {
344
+ export function pack_aix_from_source(files, build_id, engine, optimize_options, agent_id) {
261
345
  const ptr0 = passStringToWasm0(build_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
262
346
  const len0 = WASM_VECTOR_LEN;
263
347
  var ptr1 = isLikeNone(engine) ? 0 : passStringToWasm0(engine, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
264
348
  var len1 = WASM_VECTOR_LEN;
265
- const ret = wasm.pack_aix_from_source(files, ptr0, len0, ptr1, len1, optimize_options);
349
+ var ptr2 = isLikeNone(agent_id) ? 0 : passStringToWasm0(agent_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
350
+ var len2 = WASM_VECTOR_LEN;
351
+ const ret = wasm.pack_aix_from_source(files, ptr0, len0, ptr1, len1, optimize_options, ptr2, len2);
266
352
  if (ret[2]) {
267
353
  throw takeFromExternrefTable0(ret[1]);
268
354
  }
@@ -275,19 +361,35 @@ export function pack_aix_from_source(files, build_id, engine, optimize_options)
275
361
  * @param {string | null | undefined} engine
276
362
  * @param {any} optimize_options
277
363
  * @param {Function} progress
364
+ * @param {string | null} [agent_id]
278
365
  * @returns {AixPackResultWasm}
279
366
  */
280
- export function pack_aix_from_source_with_progress(files, build_id, engine, optimize_options, progress) {
367
+ export function pack_aix_from_source_with_progress(files, build_id, engine, optimize_options, progress, agent_id) {
281
368
  const ptr0 = passStringToWasm0(build_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
282
369
  const len0 = WASM_VECTOR_LEN;
283
370
  var ptr1 = isLikeNone(engine) ? 0 : passStringToWasm0(engine, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
284
371
  var len1 = WASM_VECTOR_LEN;
285
- const ret = wasm.pack_aix_from_source_with_progress(files, ptr0, len0, ptr1, len1, optimize_options, progress);
372
+ var ptr2 = isLikeNone(agent_id) ? 0 : passStringToWasm0(agent_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
373
+ var len2 = WASM_VECTOR_LEN;
374
+ const ret = wasm.pack_aix_from_source_with_progress(files, ptr0, len0, ptr1, len1, optimize_options, progress, ptr2, len2);
286
375
  if (ret[2]) {
287
376
  throw takeFromExternrefTable0(ret[1]);
288
377
  }
289
378
  return AixPackResultWasm.__wrap(ret[0]);
290
379
  }
380
+
381
+ /**
382
+ * Check source files and return diagnostics with executed check coverage.
383
+ * @param {any} files
384
+ * @returns {any}
385
+ */
386
+ export function prepare_aix_check(files) {
387
+ const ret = wasm.prepare_aix_check(files);
388
+ if (ret[2]) {
389
+ throw takeFromExternrefTable0(ret[1]);
390
+ }
391
+ return takeFromExternrefTable0(ret[0]);
392
+ }
291
393
  function __wbg_get_imports() {
292
394
  const import0 = {
293
395
  __proto__: null,
@@ -306,6 +408,12 @@ function __wbg_get_imports() {
306
408
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
307
409
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
308
410
  },
411
+ __wbg___wbindgen_bigint_get_as_i64_d968e41184ae354f: function(arg0, arg1) {
412
+ const v = arg1;
413
+ const ret = typeof(v) === 'bigint' ? v : undefined;
414
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
415
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
416
+ },
309
417
  __wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(arg0) {
310
418
  const v = arg0;
311
419
  const ret = typeof(v) === 'boolean' ? v : undefined;
@@ -322,6 +430,10 @@ function __wbg_get_imports() {
322
430
  const ret = arg0 in arg1;
323
431
  return ret;
324
432
  },
433
+ __wbg___wbindgen_is_bigint_2f76dc55065b4273: function(arg0) {
434
+ const ret = typeof(arg0) === 'bigint';
435
+ return ret;
436
+ },
325
437
  __wbg___wbindgen_is_function_1ff95bcc5517c252: function(arg0) {
326
438
  const ret = typeof(arg0) === 'function';
327
439
  return ret;
@@ -343,6 +455,10 @@ function __wbg_get_imports() {
343
455
  const ret = arg0 === undefined;
344
456
  return ret;
345
457
  },
458
+ __wbg___wbindgen_jsval_eq_e659fcf7b0e32763: function(arg0, arg1) {
459
+ const ret = arg0 === arg1;
460
+ return ret;
461
+ },
346
462
  __wbg___wbindgen_jsval_loose_eq_db4c3b15f63fc170: function(arg0, arg1) {
347
463
  const ret = arg0 == arg1;
348
464
  return ret;
@@ -376,6 +492,9 @@ function __wbg_get_imports() {
376
492
  const ret = arg0.done;
377
493
  return ret;
378
494
  },
495
+ __wbg_getRandomValues_3f44b700395062e5: function() { return handleError(function (arg0, arg1) {
496
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
497
+ }, arguments); },
379
498
  __wbg_get_c7eb1f358a7654df: function() { return handleError(function (arg0, arg1) {
380
499
  const ret = Reflect.get(arg0, arg1);
381
500
  return ret;
@@ -420,6 +539,10 @@ function __wbg_get_imports() {
420
539
  const ret = Symbol.iterator;
421
540
  return ret;
422
541
  },
542
+ __wbg_keys_58421f8f96795607: function(arg0) {
543
+ const ret = Object.keys(arg0);
544
+ return ret;
545
+ },
423
546
  __wbg_length_1f0964f4a5e2c6d8: function(arg0) {
424
547
  const ret = arg0.length;
425
548
  return ret;
@@ -473,7 +596,7 @@ function __wbg_get_imports() {
473
596
  const ret = arg0.value;
474
597
  return ret;
475
598
  },
476
- __wbg_warn_eb943974f65fe1d7: function(arg0, arg1) {
599
+ __wbg_warn_2b7048edbbe2fa2a: function(arg0, arg1) {
477
600
  console.warn(getStringFromWasm0(arg0, arg1));
478
601
  },
479
602
  __wbindgen_cast_0000000000000001: function(arg0) {
Binary file