@yodaos-pkg/aix 0.9.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/README.md +188 -10
- package/check/index.d.ts +7 -0
- package/check/index.js +69 -0
- package/check/types.d.ts +48 -0
- package/check/types.js +1 -0
- package/index.d.ts +80 -8
- package/index.js +78 -16
- package/jsr.json +1 -1
- package/package.json +1 -2
- package/pkg/README.md +188 -10
- package/pkg/aix_web.d.ts +47 -12
- package/pkg/aix_web.js +142 -9
- package/pkg/aix_web_bg.wasm +0 -0
- package/pkg/aix_web_bg.wasm.d.ts +15 -8
- package/pkg/package.json +1 -1
- package/pkg-reader/README.md +412 -0
- package/pkg-reader/aix_web.d.ts +75 -0
- package/pkg-reader/aix_web.js +644 -0
- package/pkg-reader/aix_web_bg.wasm +0 -0
- package/pkg-reader/aix_web_bg.wasm.d.ts +22 -0
- package/pkg-reader/package.json +15 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yodaos-pkg/aix",
|
|
3
|
-
"version": "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
|
-
##
|
|
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
|
|
179
|
+
optimizer used by the npm CLI:
|
|
83
180
|
|
|
84
181
|
```ts
|
|
85
182
|
const packed = await AIX.pack(
|
|
@@ -165,11 +262,52 @@ const pages = aix.getPages();
|
|
|
165
262
|
[{
|
|
166
263
|
name: "pages/index/index",
|
|
167
264
|
title: "Home",
|
|
168
|
-
|
|
265
|
+
description: null,
|
|
266
|
+
data_schema: { ... },
|
|
267
|
+
size: { width: 480, height: 168 }
|
|
169
268
|
}]
|
|
170
269
|
*/
|
|
171
270
|
```
|
|
172
271
|
|
|
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.
|
|
274
|
+
```typescript
|
|
275
|
+
const widgets = aix.getWidgets('en-US');
|
|
276
|
+
// [{ path: "widgets/clock/index", family: "1x1", placement: "persistent", displayName: "Clock", description: "Shows the current time." }]
|
|
277
|
+
```
|
|
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
|
+
|
|
173
311
|
#### `getTools(): Tool[]`
|
|
174
312
|
Generates a list of OpenAI-compatible tool definitions based on the pages and their schemas.
|
|
175
313
|
```typescript
|
|
@@ -177,6 +315,8 @@ const tools = aix.getTools();
|
|
|
177
315
|
/*
|
|
178
316
|
[{
|
|
179
317
|
type: "function",
|
|
318
|
+
target: "_blank",
|
|
319
|
+
layout: { width: 480, height: 168 },
|
|
180
320
|
function: {
|
|
181
321
|
name: "pages_index_index",
|
|
182
322
|
description: "Home",
|
|
@@ -197,12 +337,39 @@ interface AixEntry {
|
|
|
197
337
|
}
|
|
198
338
|
```
|
|
199
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
|
+
|
|
200
354
|
### `PageInfo`
|
|
201
355
|
```typescript
|
|
202
356
|
interface PageInfo {
|
|
203
357
|
name: string;
|
|
204
|
-
title
|
|
205
|
-
|
|
358
|
+
title: string | null;
|
|
359
|
+
description: string | null;
|
|
360
|
+
data_schema: JsonSchema;
|
|
361
|
+
size: PageConstraint;
|
|
362
|
+
}
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### `WidgetInfo`
|
|
366
|
+
```typescript
|
|
367
|
+
interface WidgetInfo {
|
|
368
|
+
path: string;
|
|
369
|
+
family: string;
|
|
370
|
+
placement: WidgetPlacement;
|
|
371
|
+
displayName: string | null;
|
|
372
|
+
description: string | null;
|
|
206
373
|
}
|
|
207
374
|
```
|
|
208
375
|
|
|
@@ -211,14 +378,25 @@ OpenAI compatible tool format.
|
|
|
211
378
|
```typescript
|
|
212
379
|
interface Tool {
|
|
213
380
|
type: string;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
381
|
+
target: ToolTarget;
|
|
382
|
+
layout: PageConstraint;
|
|
383
|
+
function: FunctionDefinition;
|
|
384
|
+
}
|
|
385
|
+
interface FunctionDefinition {
|
|
386
|
+
name: string;
|
|
387
|
+
description: string | null;
|
|
388
|
+
parameters: JsonSchema;
|
|
219
389
|
}
|
|
220
390
|
```
|
|
221
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
|
+
|
|
222
400
|
## Build
|
|
223
401
|
|
|
224
402
|
To build the library for distribution:
|
package/pkg/aix_web.d.ts
CHANGED
|
@@ -13,14 +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;
|
|
21
|
+
get_widgets(locale?: string | null): any;
|
|
20
22
|
list(): any;
|
|
23
|
+
/**
|
|
24
|
+
* Compatibility constructor without caller resource budgets.
|
|
25
|
+
*/
|
|
21
26
|
constructor(data: Uint8Array);
|
|
22
27
|
read_file(name: string): Uint8Array;
|
|
28
|
+
/**
|
|
29
|
+
* Resolve readable pages/tools and expose per-resource failures as diagnostics.
|
|
30
|
+
*/
|
|
31
|
+
resolve_metadata(): any;
|
|
23
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;
|
|
24
37
|
}
|
|
25
38
|
|
|
26
39
|
export class AixSourcePackBuilderWasm {
|
|
@@ -28,42 +41,64 @@ export class AixSourcePackBuilderWasm {
|
|
|
28
41
|
[Symbol.dispose](): void;
|
|
29
42
|
add_file(path: string, data: Uint8Array): void;
|
|
30
43
|
constructor();
|
|
31
|
-
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;
|
|
32
45
|
}
|
|
33
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
|
+
|
|
34
57
|
export function optimize_aix(data: Uint8Array, options: any): AixPackResultWasm;
|
|
35
58
|
|
|
36
|
-
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;
|
|
37
62
|
|
|
38
|
-
export function
|
|
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;
|
|
39
64
|
|
|
40
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Check source files and return diagnostics with executed check coverage.
|
|
67
|
+
*/
|
|
68
|
+
export function prepare_aix_check(files: any): any;
|
|
41
69
|
|
|
42
70
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
43
71
|
|
|
44
72
|
export interface InitOutput {
|
|
45
73
|
readonly memory: WebAssembly.Memory;
|
|
46
74
|
readonly __wbg_aixpackresultwasm_free: (a: number, b: number) => void;
|
|
47
|
-
readonly __wbg_aixreaderwasm_free: (a: number, b: number) => void;
|
|
48
75
|
readonly __wbg_aixsourcepackbuilderwasm_free: (a: number, b: number) => void;
|
|
49
76
|
readonly aixpackresultwasm_data: (a: number) => any;
|
|
50
77
|
readonly aixpackresultwasm_report: (a: number) => [number, number, number];
|
|
51
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];
|
|
52
91
|
readonly aixreaderwasm_get_pages: (a: number) => [number, number, number];
|
|
53
92
|
readonly aixreaderwasm_get_title: (a: number) => [number, number];
|
|
54
93
|
readonly aixreaderwasm_get_tools: (a: number) => [number, number, number];
|
|
55
94
|
readonly aixreaderwasm_get_version: (a: number) => [number, number];
|
|
95
|
+
readonly aixreaderwasm_get_widgets: (a: number, b: number, c: number) => [number, number, number];
|
|
56
96
|
readonly aixreaderwasm_list: (a: number) => [number, number, number];
|
|
57
97
|
readonly aixreaderwasm_new: (a: number, b: number) => [number, number, number];
|
|
58
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];
|
|
59
100
|
readonly aixreaderwasm_supports_engine: (a: number, b: number, c: number) => [number, number, number];
|
|
60
|
-
readonly
|
|
61
|
-
readonly aixsourcepackbuilderwasm_new: () => number;
|
|
62
|
-
readonly aixsourcepackbuilderwasm_pack_from_source_with_progress: (a: number, b: number, c: number, d: number, e: number, f: any, g: any) => [number, number, number];
|
|
63
|
-
readonly optimize_aix: (a: number, b: number, c: any) => [number, number, number];
|
|
64
|
-
readonly pack_aix: (a: any, b: number, c: number, d: number, e: number, f: any) => [number, number, number];
|
|
65
|
-
readonly pack_aix_from_source: (a: any, b: number, c: number, d: number, e: number, f: any) => [number, number, number];
|
|
66
|
-
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];
|
|
67
102
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
68
103
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
69
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
|
*/
|
|
@@ -102,6 +123,19 @@ export class AixReaderWasm {
|
|
|
102
123
|
}
|
|
103
124
|
return v1;
|
|
104
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* @param {string | null} [locale]
|
|
128
|
+
* @returns {any}
|
|
129
|
+
*/
|
|
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);
|
|
134
|
+
if (ret[2]) {
|
|
135
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
136
|
+
}
|
|
137
|
+
return takeFromExternrefTable0(ret[0]);
|
|
138
|
+
}
|
|
105
139
|
/**
|
|
106
140
|
* @returns {any}
|
|
107
141
|
*/
|
|
@@ -113,6 +147,7 @@ export class AixReaderWasm {
|
|
|
113
147
|
return takeFromExternrefTable0(ret[0]);
|
|
114
148
|
}
|
|
115
149
|
/**
|
|
150
|
+
* Compatibility constructor without caller resource budgets.
|
|
116
151
|
* @param {Uint8Array} data
|
|
117
152
|
*/
|
|
118
153
|
constructor(data) {
|
|
@@ -141,6 +176,17 @@ export class AixReaderWasm {
|
|
|
141
176
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
142
177
|
return v2;
|
|
143
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
|
+
}
|
|
144
190
|
/**
|
|
145
191
|
* @param {string} current_version
|
|
146
192
|
* @returns {boolean}
|
|
@@ -154,6 +200,21 @@ export class AixReaderWasm {
|
|
|
154
200
|
}
|
|
155
201
|
return ret[0] !== 0;
|
|
156
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
|
+
}
|
|
157
218
|
}
|
|
158
219
|
if (Symbol.dispose) AixReaderWasm.prototype[Symbol.dispose] = AixReaderWasm.prototype.free;
|
|
159
220
|
|
|
@@ -190,14 +251,17 @@ export class AixSourcePackBuilderWasm {
|
|
|
190
251
|
* @param {string | null | undefined} engine
|
|
191
252
|
* @param {any} optimize_options
|
|
192
253
|
* @param {Function} progress
|
|
254
|
+
* @param {string | null} [agent_id]
|
|
193
255
|
* @returns {AixPackResultWasm}
|
|
194
256
|
*/
|
|
195
|
-
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) {
|
|
196
258
|
const ptr0 = passStringToWasm0(build_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
197
259
|
const len0 = WASM_VECTOR_LEN;
|
|
198
260
|
var ptr1 = isLikeNone(engine) ? 0 : passStringToWasm0(engine, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
199
261
|
var len1 = WASM_VECTOR_LEN;
|
|
200
|
-
|
|
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);
|
|
201
265
|
if (ret[2]) {
|
|
202
266
|
throw takeFromExternrefTable0(ret[1]);
|
|
203
267
|
}
|
|
@@ -206,6 +270,32 @@ export class AixSourcePackBuilderWasm {
|
|
|
206
270
|
}
|
|
207
271
|
if (Symbol.dispose) AixSourcePackBuilderWasm.prototype[Symbol.dispose] = AixSourcePackBuilderWasm.prototype.free;
|
|
208
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
|
+
|
|
209
299
|
/**
|
|
210
300
|
* @param {Uint8Array} data
|
|
211
301
|
* @param {any} options
|
|
@@ -226,14 +316,17 @@ export function optimize_aix(data, options) {
|
|
|
226
316
|
* @param {string} build_id
|
|
227
317
|
* @param {string | null | undefined} engine
|
|
228
318
|
* @param {any} optimize_options
|
|
319
|
+
* @param {string | null} [agent_id]
|
|
229
320
|
* @returns {AixPackResultWasm}
|
|
230
321
|
*/
|
|
231
|
-
export function pack_aix(files, build_id, engine, optimize_options) {
|
|
322
|
+
export function pack_aix(files, build_id, engine, optimize_options, agent_id) {
|
|
232
323
|
const ptr0 = passStringToWasm0(build_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
233
324
|
const len0 = WASM_VECTOR_LEN;
|
|
234
325
|
var ptr1 = isLikeNone(engine) ? 0 : passStringToWasm0(engine, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
235
326
|
var len1 = WASM_VECTOR_LEN;
|
|
236
|
-
|
|
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);
|
|
237
330
|
if (ret[2]) {
|
|
238
331
|
throw takeFromExternrefTable0(ret[1]);
|
|
239
332
|
}
|
|
@@ -245,14 +338,17 @@ export function pack_aix(files, build_id, engine, optimize_options) {
|
|
|
245
338
|
* @param {string} build_id
|
|
246
339
|
* @param {string | null | undefined} engine
|
|
247
340
|
* @param {any} optimize_options
|
|
341
|
+
* @param {string | null} [agent_id]
|
|
248
342
|
* @returns {AixPackResultWasm}
|
|
249
343
|
*/
|
|
250
|
-
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) {
|
|
251
345
|
const ptr0 = passStringToWasm0(build_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
252
346
|
const len0 = WASM_VECTOR_LEN;
|
|
253
347
|
var ptr1 = isLikeNone(engine) ? 0 : passStringToWasm0(engine, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
254
348
|
var len1 = WASM_VECTOR_LEN;
|
|
255
|
-
|
|
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);
|
|
256
352
|
if (ret[2]) {
|
|
257
353
|
throw takeFromExternrefTable0(ret[1]);
|
|
258
354
|
}
|
|
@@ -265,19 +361,35 @@ export function pack_aix_from_source(files, build_id, engine, optimize_options)
|
|
|
265
361
|
* @param {string | null | undefined} engine
|
|
266
362
|
* @param {any} optimize_options
|
|
267
363
|
* @param {Function} progress
|
|
364
|
+
* @param {string | null} [agent_id]
|
|
268
365
|
* @returns {AixPackResultWasm}
|
|
269
366
|
*/
|
|
270
|
-
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) {
|
|
271
368
|
const ptr0 = passStringToWasm0(build_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
272
369
|
const len0 = WASM_VECTOR_LEN;
|
|
273
370
|
var ptr1 = isLikeNone(engine) ? 0 : passStringToWasm0(engine, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
274
371
|
var len1 = WASM_VECTOR_LEN;
|
|
275
|
-
|
|
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);
|
|
276
375
|
if (ret[2]) {
|
|
277
376
|
throw takeFromExternrefTable0(ret[1]);
|
|
278
377
|
}
|
|
279
378
|
return AixPackResultWasm.__wrap(ret[0]);
|
|
280
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
|
+
}
|
|
281
393
|
function __wbg_get_imports() {
|
|
282
394
|
const import0 = {
|
|
283
395
|
__proto__: null,
|
|
@@ -296,6 +408,12 @@ function __wbg_get_imports() {
|
|
|
296
408
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
297
409
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
298
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
|
+
},
|
|
299
417
|
__wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(arg0) {
|
|
300
418
|
const v = arg0;
|
|
301
419
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
@@ -312,6 +430,10 @@ function __wbg_get_imports() {
|
|
|
312
430
|
const ret = arg0 in arg1;
|
|
313
431
|
return ret;
|
|
314
432
|
},
|
|
433
|
+
__wbg___wbindgen_is_bigint_2f76dc55065b4273: function(arg0) {
|
|
434
|
+
const ret = typeof(arg0) === 'bigint';
|
|
435
|
+
return ret;
|
|
436
|
+
},
|
|
315
437
|
__wbg___wbindgen_is_function_1ff95bcc5517c252: function(arg0) {
|
|
316
438
|
const ret = typeof(arg0) === 'function';
|
|
317
439
|
return ret;
|
|
@@ -333,6 +455,10 @@ function __wbg_get_imports() {
|
|
|
333
455
|
const ret = arg0 === undefined;
|
|
334
456
|
return ret;
|
|
335
457
|
},
|
|
458
|
+
__wbg___wbindgen_jsval_eq_e659fcf7b0e32763: function(arg0, arg1) {
|
|
459
|
+
const ret = arg0 === arg1;
|
|
460
|
+
return ret;
|
|
461
|
+
},
|
|
336
462
|
__wbg___wbindgen_jsval_loose_eq_db4c3b15f63fc170: function(arg0, arg1) {
|
|
337
463
|
const ret = arg0 == arg1;
|
|
338
464
|
return ret;
|
|
@@ -366,6 +492,9 @@ function __wbg_get_imports() {
|
|
|
366
492
|
const ret = arg0.done;
|
|
367
493
|
return ret;
|
|
368
494
|
},
|
|
495
|
+
__wbg_getRandomValues_3f44b700395062e5: function() { return handleError(function (arg0, arg1) {
|
|
496
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
497
|
+
}, arguments); },
|
|
369
498
|
__wbg_get_c7eb1f358a7654df: function() { return handleError(function (arg0, arg1) {
|
|
370
499
|
const ret = Reflect.get(arg0, arg1);
|
|
371
500
|
return ret;
|
|
@@ -410,6 +539,10 @@ function __wbg_get_imports() {
|
|
|
410
539
|
const ret = Symbol.iterator;
|
|
411
540
|
return ret;
|
|
412
541
|
},
|
|
542
|
+
__wbg_keys_58421f8f96795607: function(arg0) {
|
|
543
|
+
const ret = Object.keys(arg0);
|
|
544
|
+
return ret;
|
|
545
|
+
},
|
|
413
546
|
__wbg_length_1f0964f4a5e2c6d8: function(arg0) {
|
|
414
547
|
const ret = arg0.length;
|
|
415
548
|
return ret;
|
|
@@ -463,7 +596,7 @@ function __wbg_get_imports() {
|
|
|
463
596
|
const ret = arg0.value;
|
|
464
597
|
return ret;
|
|
465
598
|
},
|
|
466
|
-
|
|
599
|
+
__wbg_warn_2b7048edbbe2fa2a: function(arg0, arg1) {
|
|
467
600
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
468
601
|
},
|
|
469
602
|
__wbindgen_cast_0000000000000001: function(arg0) {
|
package/pkg/aix_web_bg.wasm
CHANGED
|
Binary file
|