@bytecodealliance/jco 1.17.6 → 1.17.7

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.
@@ -4,7 +4,6 @@ import { preopens, types } from '@bytecodealliance/preview2-shim/filesystem';
4
4
  import { error, streams } from '@bytecodealliance/preview2-shim/io';
5
5
  import { random } from '@bytecodealliance/preview2-shim/random';
6
6
  const { getEnvironment } = environment;
7
- getEnvironment._isHostProvided = true;
8
7
 
9
8
  if (getEnvironment=== undefined) {
10
9
  const err = new Error("unexpectedly undefined local import 'getEnvironment', was 'getEnvironment' available at instantiation?");
@@ -12,8 +11,8 @@ if (getEnvironment=== undefined) {
12
11
  throw err;
13
12
  }
14
13
 
14
+ getEnvironment._isHostProvided = true;
15
15
  const { exit } = exit$1;
16
- exit._isHostProvided = true;
17
16
 
18
17
  if (exit=== undefined) {
19
18
  const err = new Error("unexpectedly undefined local import 'exit', was 'exit' available at instantiation?");
@@ -21,8 +20,8 @@ if (exit=== undefined) {
21
20
  throw err;
22
21
  }
23
22
 
23
+ exit._isHostProvided = true;
24
24
  const { getStderr } = stderr;
25
- getStderr._isHostProvided = true;
26
25
 
27
26
  if (getStderr=== undefined) {
28
27
  const err = new Error("unexpectedly undefined local import 'getStderr', was 'getStderr' available at instantiation?");
@@ -30,8 +29,8 @@ if (getStderr=== undefined) {
30
29
  throw err;
31
30
  }
32
31
 
32
+ getStderr._isHostProvided = true;
33
33
  const { getStdin } = stdin;
34
- getStdin._isHostProvided = true;
35
34
 
36
35
  if (getStdin=== undefined) {
37
36
  const err = new Error("unexpectedly undefined local import 'getStdin', was 'getStdin' available at instantiation?");
@@ -39,8 +38,8 @@ if (getStdin=== undefined) {
39
38
  throw err;
40
39
  }
41
40
 
41
+ getStdin._isHostProvided = true;
42
42
  const { getStdout } = stdout;
43
- getStdout._isHostProvided = true;
44
43
 
45
44
  if (getStdout=== undefined) {
46
45
  const err = new Error("unexpectedly undefined local import 'getStdout', was 'getStdout' available at instantiation?");
@@ -48,8 +47,8 @@ if (getStdout=== undefined) {
48
47
  throw err;
49
48
  }
50
49
 
50
+ getStdout._isHostProvided = true;
51
51
  const { TerminalInput } = terminalInput;
52
- TerminalInput._isHostProvided = true;
53
52
 
54
53
  if (TerminalInput=== undefined) {
55
54
  const err = new Error("unexpectedly undefined local import 'TerminalInput', was 'TerminalInput' available at instantiation?");
@@ -57,8 +56,8 @@ if (TerminalInput=== undefined) {
57
56
  throw err;
58
57
  }
59
58
 
59
+ TerminalInput._isHostProvided = true;
60
60
  const { TerminalOutput } = terminalOutput;
61
- TerminalOutput._isHostProvided = true;
62
61
 
63
62
  if (TerminalOutput=== undefined) {
64
63
  const err = new Error("unexpectedly undefined local import 'TerminalOutput', was 'TerminalOutput' available at instantiation?");
@@ -66,8 +65,8 @@ if (TerminalOutput=== undefined) {
66
65
  throw err;
67
66
  }
68
67
 
68
+ TerminalOutput._isHostProvided = true;
69
69
  const { getTerminalStderr } = terminalStderr;
70
- getTerminalStderr._isHostProvided = true;
71
70
 
72
71
  if (getTerminalStderr=== undefined) {
73
72
  const err = new Error("unexpectedly undefined local import 'getTerminalStderr', was 'getTerminalStderr' available at instantiation?");
@@ -75,8 +74,8 @@ if (getTerminalStderr=== undefined) {
75
74
  throw err;
76
75
  }
77
76
 
77
+ getTerminalStderr._isHostProvided = true;
78
78
  const { getTerminalStdin } = terminalStdin;
79
- getTerminalStdin._isHostProvided = true;
80
79
 
81
80
  if (getTerminalStdin=== undefined) {
82
81
  const err = new Error("unexpectedly undefined local import 'getTerminalStdin', was 'getTerminalStdin' available at instantiation?");
@@ -84,8 +83,8 @@ if (getTerminalStdin=== undefined) {
84
83
  throw err;
85
84
  }
86
85
 
86
+ getTerminalStdin._isHostProvided = true;
87
87
  const { getTerminalStdout } = terminalStdout;
88
- getTerminalStdout._isHostProvided = true;
89
88
 
90
89
  if (getTerminalStdout=== undefined) {
91
90
  const err = new Error("unexpectedly undefined local import 'getTerminalStdout', was 'getTerminalStdout' available at instantiation?");
@@ -93,8 +92,8 @@ if (getTerminalStdout=== undefined) {
93
92
  throw err;
94
93
  }
95
94
 
95
+ getTerminalStdout._isHostProvided = true;
96
96
  const { getDirectories } = preopens;
97
- getDirectories._isHostProvided = true;
98
97
 
99
98
  if (getDirectories=== undefined) {
100
99
  const err = new Error("unexpectedly undefined local import 'getDirectories', was 'getDirectories' available at instantiation?");
@@ -102,10 +101,10 @@ if (getDirectories=== undefined) {
102
101
  throw err;
103
102
  }
104
103
 
104
+ getDirectories._isHostProvided = true;
105
105
  const { Descriptor,
106
106
  DirectoryEntryStream,
107
107
  filesystemErrorCode } = types;
108
- Descriptor._isHostProvided = true;
109
108
 
110
109
  if (Descriptor=== undefined) {
111
110
  const err = new Error("unexpectedly undefined local import 'Descriptor', was 'Descriptor' available at instantiation?");
@@ -113,7 +112,7 @@ if (Descriptor=== undefined) {
113
112
  throw err;
114
113
  }
115
114
 
116
- DirectoryEntryStream._isHostProvided = true;
115
+ Descriptor._isHostProvided = true;
117
116
 
118
117
  if (DirectoryEntryStream=== undefined) {
119
118
  const err = new Error("unexpectedly undefined local import 'DirectoryEntryStream', was 'DirectoryEntryStream' available at instantiation?");
@@ -121,7 +120,7 @@ if (DirectoryEntryStream=== undefined) {
121
120
  throw err;
122
121
  }
123
122
 
124
- filesystemErrorCode._isHostProvided = true;
123
+ DirectoryEntryStream._isHostProvided = true;
125
124
 
126
125
  if (filesystemErrorCode=== undefined) {
127
126
  const err = new Error("unexpectedly undefined local import 'filesystemErrorCode', was 'filesystemErrorCode' available at instantiation?");
@@ -129,8 +128,8 @@ if (filesystemErrorCode=== undefined) {
129
128
  throw err;
130
129
  }
131
130
 
131
+ filesystemErrorCode._isHostProvided = true;
132
132
  const { Error: Error$1 } = error;
133
- Error$1._isHostProvided = true;
134
133
 
135
134
  if (Error$1=== undefined) {
136
135
  const err = new Error("unexpectedly undefined local import 'Error$1', was 'Error' available at instantiation?");
@@ -138,9 +137,9 @@ if (Error$1=== undefined) {
138
137
  throw err;
139
138
  }
140
139
 
140
+ Error$1._isHostProvided = true;
141
141
  const { InputStream,
142
142
  OutputStream } = streams;
143
- InputStream._isHostProvided = true;
144
143
 
145
144
  if (InputStream=== undefined) {
146
145
  const err = new Error("unexpectedly undefined local import 'InputStream', was 'InputStream' available at instantiation?");
@@ -148,7 +147,7 @@ if (InputStream=== undefined) {
148
147
  throw err;
149
148
  }
150
149
 
151
- OutputStream._isHostProvided = true;
150
+ InputStream._isHostProvided = true;
152
151
 
153
152
  if (OutputStream=== undefined) {
154
153
  const err = new Error("unexpectedly undefined local import 'OutputStream', was 'OutputStream' available at instantiation?");
@@ -156,8 +155,8 @@ if (OutputStream=== undefined) {
156
155
  throw err;
157
156
  }
158
157
 
158
+ OutputStream._isHostProvided = true;
159
159
  const { getRandomBytes } = random;
160
- getRandomBytes._isHostProvided = true;
161
160
 
162
161
  if (getRandomBytes=== undefined) {
163
162
  const err = new Error("unexpectedly undefined local import 'getRandomBytes', was 'getRandomBytes' available at instantiation?");
@@ -165,6 +164,7 @@ if (getRandomBytes=== undefined) {
165
164
  throw err;
166
165
  }
167
166
 
167
+ getRandomBytes._isHostProvided = true;
168
168
 
169
169
  function promiseWithResolvers() {
170
170
  if (Promise.withResolvers) {
@@ -179,8 +179,9 @@ function promiseWithResolvers() {
179
179
  return { promise, resolve, reject };
180
180
  }
181
181
  }
182
-
183
182
  const symbolDispose = Symbol.dispose || Symbol.for('dispose');
183
+ const symbolAsyncIterator = Symbol.asyncIterator;
184
+ const symbolIterator = Symbol.iterator;
184
185
 
185
186
  const _debugLog = (...args) => {
186
187
  if (!globalThis?.process?.env?.JCO_DEBUG) { return; }
@@ -275,7 +276,7 @@ async function _clearCurrentTask(args) {
275
276
  const { taskID, componentIdx } = args;
276
277
 
277
278
  const meta = CURRENT_TASK_META[componentIdx];
278
- if (!meta) { throw new Error(`missing current task meta for component idx [${componentIdx}]`); }
279
+ if (!meta) { throw new Error(`missing current task meta for component idx [${componentIdx}]n`); }
279
280
 
280
281
  if (meta.taskID !== taskID) {
281
282
  throw new Error(`task ID [${meta.taskID}] != requested ID [${taskID}]`);
@@ -383,13 +384,54 @@ const _coinFlip = () => { return Math.random() > 0.5; };
383
384
  let SCOPE_ID = 0;
384
385
  const I32_MIN = -2_147_483_648;
385
386
  const I32_MAX = 2_147_483_647;
387
+
388
+ function _isValidNumericPrimitive(ty, v) {
389
+ if (v === undefined || v === null) { return false; }
390
+ switch (ty) {
391
+ case 'bool':
392
+ return v === 0 || v === 1;
393
+ break;
394
+ case 'u8':
395
+ return v >= 0 && v <= 255;
396
+ break;
397
+ case 's8':
398
+ return v >= -128 && v <= 127;
399
+ break;
400
+ case 'u16':
401
+ return v >= 0 && v <= 65535;
402
+ break;
403
+ case 's16':
404
+ return v >= -32768 && v <= 32767;
405
+ case 'u32':
406
+ return v >= 0 && v <= 4_294_967_295;
407
+ case 's32':
408
+ return v >= -2_147_483_648 && v <= 2_147_483_647;
409
+ case 'u64':
410
+ return typeof v === 'bigint' && v >= 0 && v <= 18_446_744_073_709_551_615n;
411
+ case 's64':
412
+ return typeof v === 'bigint' && v >= -9223372036854775808n && v <= 9223372036854775807n;
413
+ break;
414
+ case 'f32':
415
+ case 'f64': return typeof v === 'number';
416
+ default:
417
+ return false;
418
+ }
419
+ return true;
420
+ }
421
+
422
+ function _requireValidNumericPrimitive(ty, v) {
423
+ if (v === undefined || v === null || !_isValidNumericPrimitive(ty, v)) {
424
+ throw new TypeError(`invalid ${ty} value [${v}]`);
425
+ }
426
+ return true;
427
+ }
386
428
  const _typeCheckValidI32 = (n) => typeof n === 'number' && n >= I32_MIN && n <= I32_MAX;
387
429
 
388
430
  const _typeCheckAsyncFn= (f) => {
389
431
  return f instanceof ASYNC_FN_CTOR;
390
432
  };
391
433
 
392
- const ASYNC_FN_CTOR = (async () => {}).constructor;
434
+ let RESOURCE_CALL_BORROWS = [];const ASYNC_FN_CTOR = (async () => {}).constructor;
393
435
 
394
436
  function clearCurrentTask(componentIdx, taskID) {
395
437
  _debugLog('[clearCurrentTask()] args', { componentIdx, taskID });
@@ -678,6 +720,7 @@ class AsyncSubtask {
678
720
  realloc,
679
721
  vals: [subtaskValue],
680
722
  storagePtr: resultPtr,
723
+ stringEncoding: callMetadata.stringEncoding,
681
724
  });
682
725
  }
683
726
  }
@@ -867,6 +910,7 @@ resultCountOrAsync,
867
910
  resultPtr,
868
911
  returnFn,
869
912
  startFn,
913
+ stringEncoding,
870
914
  }
871
915
  });
872
916
 
@@ -1032,7 +1076,8 @@ function _asyncStartCall(args, callee, paramCount, resultCount, flags) {
1032
1076
  memory: callerMemory,
1033
1077
  vals: [res],
1034
1078
  storagePtr: subtaskCallMeta.resultPtr,
1035
- componentIdx: callerComponentIdx
1079
+ componentIdx: callerComponentIdx,
1080
+ stringEncoding: subtaskCallMeta.stringEncoding,
1036
1081
  });
1037
1082
 
1038
1083
  });
@@ -1270,11 +1315,19 @@ class Waitable {
1270
1315
  let dv = new DataView(new ArrayBuffer());
1271
1316
  const dataView = mem => dv.buffer === mem.buffer ? dv : dv = new DataView(mem.buffer);
1272
1317
 
1273
- const toUint64 = val => BigInt.asUintN(64, BigInt(val));
1318
+ function toUint64(val) {
1319
+ const converted = BigInt(val)
1320
+ _requireValidNumericPrimitive('u64', converted);
1321
+ return BigInt.asUintN(64, converted);
1322
+ }
1323
+
1274
1324
 
1275
1325
  function toUint32(val) {
1326
+ _requireValidNumericPrimitive('u32', val);
1276
1327
  return val >>> 0;
1277
1328
  }
1329
+
1330
+ const utf16Decoder = new TextDecoder('utf-16');
1278
1331
  const TEXT_DECODER_UTF8 = new TextDecoder();
1279
1332
  const TEXT_ENCODER_UTF8 = new TextEncoder();
1280
1333
 
@@ -2051,6 +2104,7 @@ function _lowerImportBackwardsCompat(args) {
2051
2104
  getMemoryFn,
2052
2105
  getReallocFn,
2053
2106
  importFn,
2107
+ stringEncoding,
2054
2108
  } = args;
2055
2109
 
2056
2110
  let meta = _getGlobalCurrentTaskMeta(componentIdx);
@@ -2130,6 +2184,7 @@ function _lowerImportBackwardsCompat(args) {
2130
2184
  realloc: getReallocFn(),
2131
2185
  resultPtr: params[0],
2132
2186
  lowers: resultLowerFns,
2187
+ stringEncoding,
2133
2188
  }
2134
2189
  });
2135
2190
  task.setReturnMemoryIdx(memoryIdx);
@@ -2259,8 +2314,8 @@ function _lowerImportBackwardsCompat(args) {
2259
2314
  return [val, ctx];
2260
2315
  }
2261
2316
 
2262
- if (ctx.storageLen !== undefined && ctx.storageLen < ctx.storagePtr + 1) {
2263
- throw new Error('not enough storage remaining for lift');
2317
+ if (ctx.storageLen !== undefined && ctx.storageLen < 1) {
2318
+ throw new Error(`insufficient storage ([${ctx.storageLen}] bytes) for lift (u8 requires 1 byte)`);
2264
2319
  }
2265
2320
 
2266
2321
  val = new DataView(ctx.memory.buffer).getUint8(ctx.storagePtr, true);
@@ -2271,6 +2326,7 @@ function _lowerImportBackwardsCompat(args) {
2271
2326
  return [val, ctx];
2272
2327
  }
2273
2328
 
2329
+
2274
2330
  function _liftFlatU16(ctx) {
2275
2331
  _debugLog('[_liftFlatU16()] args', { ctx });
2276
2332
  let val;
@@ -2282,8 +2338,8 @@ function _lowerImportBackwardsCompat(args) {
2282
2338
  return [val, ctx];
2283
2339
  }
2284
2340
 
2285
- if (ctx.storageLen !== undefined && ctx.storageLen < ctx.storagePtr + 2) {
2286
- throw new Error('not enough storage remaining for lift');
2341
+ if (ctx.storageLen !== undefined && ctx.storageLen < 2) {
2342
+ throw new Error(`insufficient storage ([${ctx.storageLen}] bytes) for lift (u16 requires 2 bytes)`);
2287
2343
  }
2288
2344
 
2289
2345
  val = new DataView(ctx.memory.buffer).getUint16(ctx.storagePtr, true);
@@ -2297,6 +2353,7 @@ function _lowerImportBackwardsCompat(args) {
2297
2353
  return [val, ctx];
2298
2354
  }
2299
2355
 
2356
+
2300
2357
  function _liftFlatU32(ctx) {
2301
2358
  _debugLog('[_liftFlatU32()] args', { ctx });
2302
2359
  let val;
@@ -2308,8 +2365,8 @@ function _lowerImportBackwardsCompat(args) {
2308
2365
  return [val, ctx];
2309
2366
  }
2310
2367
 
2311
- if (ctx.storageLen !== undefined && ctx.storageLen < ctx.storagePtr + 4) {
2312
- throw new Error('not enough storage remaining for lift');
2368
+ if (ctx.storageLen !== undefined && ctx.storageLen < 4) {
2369
+ throw new Error(`insufficient storage ([${ctx.storageLen}] bytes) for lift (u32 requires 4 bytes)`);
2313
2370
  }
2314
2371
  val = new DataView(ctx.memory.buffer).getUint32(ctx.storagePtr, true);
2315
2372
  ctx.storagePtr += 4;
@@ -2318,6 +2375,7 @@ function _lowerImportBackwardsCompat(args) {
2318
2375
  return [val, ctx];
2319
2376
  }
2320
2377
 
2378
+
2321
2379
  function _liftFlatU64(ctx) {
2322
2380
  _debugLog('[_liftFlatU64()] args', { ctx });
2323
2381
  let val;
@@ -2330,9 +2388,10 @@ function _lowerImportBackwardsCompat(args) {
2330
2388
  return [val, ctx];
2331
2389
  }
2332
2390
 
2333
- if (ctx.storageLen !== undefined && ctx.storageLen < ctx.storagePtr + 8) {
2334
- throw new Error('not enough storage remaining for lift');
2391
+ if (ctx.storageLen !== undefined && ctx.storageLen < 8) {
2392
+ throw new Error(`insufficient storage ([${ctx.storageLen}] bytes) for lift (u64 requires 8 bytes)`);
2335
2393
  }
2394
+
2336
2395
  val = new DataView(ctx.memory.buffer).getBigUint64(ctx.storagePtr, true);
2337
2396
  ctx.storagePtr += 8;
2338
2397
  if (ctx.storageLen !== undefined) { ctx.storageLen -= 8; }
@@ -2340,6 +2399,18 @@ function _lowerImportBackwardsCompat(args) {
2340
2399
  return [val, ctx];
2341
2400
  }
2342
2401
 
2402
+
2403
+ function _liftFlatStringAny(ctx) {
2404
+ switch (ctx.stringEncoding) {
2405
+ case 'utf8':
2406
+ return _liftFlatStringUTF8(ctx);
2407
+ case 'utf16':
2408
+ return _liftFlatStringUTF16(ctx);
2409
+ default:
2410
+ throw new Error(`missing/unrecognized/unsupported string encoding [${ctx.stringEncoding}]`);
2411
+ }
2412
+ }
2413
+
2343
2414
  function _liftFlatStringUTF8(ctx) {
2344
2415
  _debugLog('[_liftFlatStringUTF8()] args', { ctx });
2345
2416
  let val;
@@ -2355,14 +2426,42 @@ function _lowerImportBackwardsCompat(args) {
2355
2426
  return [val, ctx];
2356
2427
  }
2357
2428
 
2358
- const start = new DataView(ctx.memory.buffer).getUint32(ctx.storagePtr, true);
2359
- const codeUnits = new DataView(ctx.memory.buffer).getUint32(ctx.storagePtr + 4, true);
2429
+ const rem = ctx.storagePtr % 4;
2430
+ if (rem !== 0) { ctx.storagePtr += (4 - rem); }
2431
+
2432
+ const dv = new DataView(ctx.memory.buffer);
2433
+ const start = dv.getUint32(ctx.storagePtr, true);
2434
+ const codeUnits = dv.getUint32(ctx.storagePtr + 4, true);
2435
+
2360
2436
  val = TEXT_DECODER_UTF8.decode(new Uint8Array(ctx.memory.buffer, start, codeUnits));
2361
2437
 
2362
2438
  ctx.storagePtr += 8;
2439
+ if (ctx.storageLen !== undefined) { ctx.storagelen -= 8; }
2363
2440
 
2364
- const rem = ctx.storagePtr % 4;
2365
- if (rem !== 0) { ctx.storagePtr += (4 - rem); }
2441
+ return [val, ctx];
2442
+ }
2443
+
2444
+ function _liftFlatStringUTF16(ctx) {
2445
+ _debugLog('[_liftFlatStringUTF16()] args', { ctx });
2446
+ let val;
2447
+
2448
+ if (ctx.useDirectParams) {
2449
+ if (ctx.params.length < 2) { throw new Error('expected at least two u32 arguments'); }
2450
+ const offset = ctx.params[0];
2451
+ if (!Number.isSafeInteger(offset)) { throw new Error('invalid offset'); }
2452
+ const len = ctx.params[1];
2453
+ if (!Number.isSafeInteger(len)) { throw new Error('invalid len'); }
2454
+ val = utf16Decoder.decode(new DataView(ctx.memory.buffer, offset, len));
2455
+ ctx.params = ctx.params.slice(2);
2456
+ return [val, ctx];
2457
+ }
2458
+
2459
+ const data = new DataView(ctx.memory.buffer)
2460
+ const start = data.getUint32(ctx.storagePtr, vals[0], true);
2461
+ const codeUnits = data.getUint32(ctx.storagePtr, vals[0] + 4, true);
2462
+ val = utf16Decoder.decode(new Uint16Array(ctx.memory.buffer, start, codeUnits));
2463
+ ctx.storagePtr = ctx.storagePtr + 2 * codeUnits;
2464
+ if (ctx.storageLen !== undefined) { ctx.storageLen = ctx.storageLen - 2 * codeUnits }
2366
2465
 
2367
2466
  return [val, ctx];
2368
2467
  }
@@ -2422,7 +2521,7 @@ function _lowerImportBackwardsCompat(args) {
2422
2521
  }
2423
2522
 
2424
2523
  function _liftFlatList(meta) {
2425
- const { elemLiftFn, align32, knownLen } = meta;
2524
+ const { elemLiftFn, elemSize32, elemAlign32, knownLen } = meta;
2426
2525
 
2427
2526
  const readValuesAndReset = (ctx, originalPtr, dataPtr, len) => {
2428
2527
  ctx.storagePtr = dataPtr;
@@ -2432,37 +2531,40 @@ function _lowerImportBackwardsCompat(args) {
2432
2531
  val.push(res);
2433
2532
  ctx = nextCtx;
2434
2533
 
2435
- const rem = ctx.storagePtr % align32;
2436
- if (rem !== 0) { ctx.storagePtr += align32 - rem; }
2534
+ const rem = ctx.storagePtr % elemAlign32;
2535
+ if (rem !== 0) { ctx.storagePtr += elemAlign32 - rem; }
2437
2536
  }
2438
2537
  if (originalPtr !== null) { ctx.storagePtr = originalPtr; }
2439
2538
  return [val, ctx];
2440
2539
  };
2441
2540
 
2541
+ // TODO(fix): special case for u8/u16/etc into appropriate type
2542
+
2442
2543
  return function _liftFlatListInner(ctx) {
2443
2544
  _debugLog('[_liftFlatList()] args', { ctx });
2444
2545
 
2445
2546
  let liftResults;
2446
- if (knownLen) { // list with known length
2547
+ if (knownLen !== undefined) { // list with known length
2447
2548
 
2448
2549
  if (ctx.useDirectParams) {
2449
2550
  // list with known length w/ direct params
2450
2551
  const dataPtr = ctx.params[0];
2451
2552
  ctx.params = ctx.params.slice(1);
2452
2553
 
2453
- // TODO: is it possible for all values to come in from params?
2554
+ // TODO(???): is it possible for all values to come in from params?
2454
2555
 
2455
2556
  ctx.useDirectParams = false;
2456
2557
  const originalPtr = ctx.storagePtr;
2457
- ctx.storageLen = 8;
2558
+ ctx.storageLen = knownLen * elemSize32;
2458
2559
 
2459
- liftResults = readValuesAndReset(ctx, originalPtr, dataPtr, len);
2560
+ liftResults = readValuesAndReset(ctx, originalPtr, dataPtr, knownLen);
2460
2561
 
2461
2562
  ctx.useDirectParams = true;
2462
2563
  ctx.storagePtr = null;
2463
2564
  ctx.storageLen = null;
2464
2565
 
2465
2566
  } else {
2567
+ ctx.storageLen = knownLen * elemSize32;
2466
2568
  liftResults = readValuesAndReset(ctx, null, ctx.storagePtr, knownLen);
2467
2569
  }
2468
2570
 
@@ -2476,7 +2578,7 @@ function _lowerImportBackwardsCompat(args) {
2476
2578
 
2477
2579
  ctx.useDirectParams = false;
2478
2580
  const originalPtr = ctx.storagePtr;
2479
- ctx.storageLen = 8;
2581
+ ctx.storageLen = len * elemSize32;
2480
2582
 
2481
2583
  liftResults = readValuesAndReset(ctx, originalPtr, dataPtr, len);
2482
2584
 
@@ -2486,6 +2588,8 @@ function _lowerImportBackwardsCompat(args) {
2486
2588
 
2487
2589
  } else {
2488
2590
  // unknown length list ptr w/ in-memory params
2591
+ ctx.storageLen = 8;
2592
+
2489
2593
  const dataPtrLiftRes = _liftFlatU32(ctx);
2490
2594
  const dataPtr = dataPtrLiftRes[0];
2491
2595
  ctx = dataPtrLiftRes[1];
@@ -2497,6 +2601,7 @@ function _lowerImportBackwardsCompat(args) {
2497
2601
  const originalPtr = ctx.storagePtr;
2498
2602
  ctx.storagePtr = dataPtr;
2499
2603
 
2604
+ ctx.storageLen = len * elemSize32;
2500
2605
  liftResults = readValuesAndReset(ctx, originalPtr, dataPtr, len);
2501
2606
  }
2502
2607
  }
@@ -2506,7 +2611,7 @@ function _lowerImportBackwardsCompat(args) {
2506
2611
  }
2507
2612
 
2508
2613
  function _liftFlatFlags(meta) {
2509
- const { names, size32, align32, intSize } = meta;
2614
+ const { names, size32, align32, intSizeBytes } = meta;
2510
2615
 
2511
2616
  return function _liftFlatFlagsInner(ctx) {
2512
2617
  _debugLog('[_liftFlatFlags()] args', { ctx });
@@ -2515,7 +2620,7 @@ function _liftFlatFlags(meta) {
2515
2620
 
2516
2621
  let liftRes;
2517
2622
  let align;
2518
- switch (intSize) {
2623
+ switch (intSizeBytes) {
2519
2624
  case 1:
2520
2625
  liftRes = _liftFlatU8(ctx);
2521
2626
  break;
@@ -2555,109 +2660,149 @@ function _liftFlatBorrow(componentTableIdx, size, memory, vals, storagePtr, stor
2555
2660
  throw new Error('flat lift for borrowed resources is not supported!');
2556
2661
  }
2557
2662
 
2663
+
2558
2664
  function _lowerFlatU8(ctx) {
2559
2665
  _debugLog('[_lowerFlatU8()] args', ctx);
2560
- const { memory, realloc, vals, storagePtr, storageLen } = ctx;
2561
- if (vals.length !== 1) {
2562
- throw new Error('unexpected number (' + vals.length + ') of core vals (expected 1)');
2666
+
2667
+ if (ctx.vals.length !== 1) {
2668
+ throw new Error(`unexpected number [${ctx.vals.length}] of vals (expected 1)`);
2563
2669
  }
2564
- if (vals[0] > 255 || vals[0] < 0) { throw new Error('invalid value for core value representing u8'); }
2565
- if (!memory) { throw new Error("missing memory for lower"); }
2566
- new DataView(memory.buffer).setUint32(storagePtr, vals[0], true);
2567
2670
 
2568
- // TODO: ALIGNMENT IS WRONG?
2671
+ _requireValidNumericPrimitive.bind('u8', ctx.vals[0]);
2569
2672
 
2570
- return 1;
2673
+ if (!ctx.memory) { throw new Error("missing memory for lower"); }
2674
+ new DataView(ctx.memory.buffer).setUint32(ctx.storagePtr, ctx.vals[0], true);
2675
+
2676
+ ctx.storagePtr += 1;
2571
2677
  }
2572
2678
 
2573
- function _lowerFlatU16(memory, vals, storagePtr, storageLen) {
2574
- _debugLog('[_lowerFlatU16()] args', { memory, vals, storagePtr, storageLen });
2575
- if (vals.length !== 1) {
2576
- throw new Error('unexpected number (' + vals.length + ') of core vals (expected 1)');
2679
+ function _lowerFlatU16(ctx) {
2680
+ _debugLog('[_lowerFlatU16()] args', { ctx });
2681
+
2682
+ if (!ctx.memory) { throw new Error("missing memory for lower"); }
2683
+ if (ctx.vals.length !== 1) {
2684
+ throw new Error(`unexpected number [${ctx.vals.length}] of vals (expected 1)`);
2577
2685
  }
2578
- if (vals[0] > 65_535 || vals[0] < 0) { throw new Error('invalid value for core value representing u16'); }
2579
- new DataView(memory.buffer).setUint16(storagePtr, vals[0], true);
2580
- return 2;
2686
+
2687
+ const rem = ctx.storagePtr % 2;
2688
+ if (rem !== 0) { ctx.storagePtr += (2 - rem); }
2689
+
2690
+ _requireValidNumericPrimitive.bind('u16', ctx.vals[0]);
2691
+ new DataView(ctx.memory.buffer).setUint16(ctx.storagePtr, ctx.vals[0], true);
2692
+
2693
+ ctx.storagePtr += 2;
2581
2694
  }
2582
2695
 
2583
2696
  function _lowerFlatU32(ctx) {
2584
2697
  _debugLog('[_lowerFlatU32()] args', { ctx });
2585
- const { memory, realloc, vals, storagePtr, storageLen } = ctx;
2586
- if (vals.length !== 1) { throw new Error('expected single value to lower, got (' + vals.length + ')'); }
2587
- if (vals[0] > 4_294_967_295 || vals[0] < 0) { throw new Error('invalid value for core value representing u32'); }
2588
2698
 
2589
- // TODO(refactor): fail loudly on misaligned flat lowers?
2699
+ if (ctx.vals.length !== 1) {
2700
+ throw new Error(`expected single value to lower, got [${ctx.vals.length}]`);
2701
+ }
2702
+
2590
2703
  const rem = ctx.storagePtr % 4;
2591
2704
  if (rem !== 0) { ctx.storagePtr += (4 - rem); }
2592
2705
 
2593
- new DataView(memory.buffer).setUint32(storagePtr, vals[0], true);
2706
+ _requireValidNumericPrimitive.bind('u32', ctx.vals[0]);
2707
+ new DataView(ctx.memory.buffer).setUint32(ctx.storagePtr, ctx.vals[0], true);
2708
+
2709
+ ctx.storagePtr += 4;
2710
+ }
2711
+
2712
+ function _lowerFlatU64(ctx) {
2713
+ _debugLog('[_lowerFlatU64()] args', { ctx });
2714
+
2715
+ if (ctx.vals.length !== 1) { throw new Error('unexpected number of vals'); }
2716
+
2717
+ const rem = ctx.storagePtr % 8;
2718
+ if (rem !== 0) { ctx.storagePtr += (8 - rem); }
2719
+
2720
+ _requireValidNumericPrimitive.bind('u64', ctx.vals[0]);
2721
+ new DataView(ctx.memory.buffer).setBigUint64(ctx.storagePtr, ctx.vals[0], true);
2594
2722
 
2595
- return 4;
2723
+ ctx.storagePtr += 8;
2596
2724
  }
2597
2725
 
2598
- function _lowerFlatU64(memory, vals, storagePtr, storageLen) {
2599
- _debugLog('[_lowerFlatU64()] args', { memory, vals, storagePtr, storageLen });
2600
- if (vals.length !== 1) { throw new Error('unexpected number of core vals'); }
2601
- if (vals[0] > 18_446_744_073_709_551_615n || vals[0] < 0n) { throw new Error('invalid value for core value representing u64'); }
2602
- new DataView(memory.buffer).setBigUint64(storagePtr, vals[0], true);
2603
- return 8;
2726
+ function _lowerFlatStringAny(ctx) {
2727
+ switch (ctx.stringEncoding) {
2728
+ case 'utf8':
2729
+ return _lowerFlatStringUTF8(ctx);
2730
+ case 'utf16':
2731
+ return _lowerFlatStringUTF16(ctx);
2732
+ default:
2733
+ throw new Error(`missing/unrecognized/unsupported string encoding [${ctx.stringEncoding}]`);
2734
+ }
2604
2735
  }
2605
2736
 
2606
2737
  function _lowerFlatStringUTF8(ctx) {
2607
2738
  _debugLog('[_lowerFlatStringUTF8()] args', ctx);
2739
+ if (!ctx.realloc) { throw new Error('missing realloc during flat string lower'); }
2608
2740
 
2609
- const { memory, realloc, vals, storagePtr, storageLen } = ctx;
2741
+ const s = ctx.vals[0];
2742
+ const { ptr, codepoints } = _utf8AllocateAndEncode(ctx.vals[0], ctx.realloc, ctx.memory);
2610
2743
 
2611
- const s = vals[0];
2612
- const { ptr, len, codepoints } = _utf8AllocateAndEncode(vals[0], realloc, memory);
2744
+ const view = new DataView(ctx.memory.buffer);
2745
+ view.setUint32(ctx.storagePtr, ptr, true);
2746
+ view.setUint32(ctx.storagePtr + 4, codepoints, true);
2613
2747
 
2614
- const view = new DataView(memory.buffer);
2615
- view.setUint32(storagePtr, ptr, true);
2616
- view.setUint32(storagePtr + 4, codepoints, true);
2748
+ ctx.storagePtr += 8;
2749
+ }
2750
+
2751
+ function _lowerFlatStringUTF16(ctx) {
2752
+ _debugLog('[_lowerFlatStringUTF16()] args', { ctx });
2753
+ if (!ctx.realloc) { throw new Error('missing realloc during flat string lower'); }
2754
+
2755
+ const s = ctx.vals[0];
2756
+ const { ptr, len, codepoints } = _utf16AllocateAndEncode(ctx.vals[0], ctx.realloc, ctx.memory);
2617
2757
 
2618
- return len;
2758
+ const view = new DataView(ctx.memory.buffer);
2759
+ view.setUint32(ctx.storagePtr, ptr, true);
2760
+ view.setUint32(ctx.storagePtr + 4, codepoints, true);
2761
+
2762
+ const bytes = new Uint16Array(ctx.memory.buffer, start, codeUnits);
2763
+ if (ctx.memory.buffer.byteLength < start + bytes.byteLength) {
2764
+ throw new Error('memory out of bounds');
2765
+ }
2766
+ if (ctx.storageLen !== undefined && ctx.storageLen !== bytes.byteLength) {
2767
+ throw new Error(`storage length [${ctx.storageLen}] != [${bytes.byteLength}])`);
2768
+ }
2769
+ new Uint16Array(ctx.memory.buffer, ctx.storagePtr).set(bytes);
2770
+
2771
+ ctx.storagePtr += len;
2619
2772
  }
2620
2773
 
2621
2774
  function _lowerFlatRecord(fieldMetas) {
2622
- return (size, memory, vals, storagePtr, storageLen) => {
2623
- const params = [...arguments].slice(5);
2624
- _debugLog('[_lowerFlatRecord()] args', {
2625
- size,
2626
- memory,
2627
- vals,
2628
- storagePtr,
2629
- storageLen,
2630
- params,
2631
- fieldMetas
2632
- });
2775
+ return function _lowerFlatRecordInner(ctx) {
2776
+ _debugLog('[_lowerFlatRecord()] args', { ctx });
2633
2777
 
2634
- const [start] = vals;
2635
- if (storageLen !== undefined && size !== undefined && size > storageLen) {
2636
- throw new Error('not enough storage remaining for record flat lower');
2778
+ const r = ctx.vals[0];
2779
+ for (const [tag, lowerFn, size32, align32 ] of fieldMetas) {
2780
+ ctx.vals = [r[tag]];
2781
+ lowerFn(ctx);
2637
2782
  }
2638
- const data = new Uint8Array(memory.buffer, start, size);
2639
- new Uint8Array(memory.buffer, storagePtr, size).set(data);
2640
- return data.byteLength;
2641
2783
  }
2642
2784
  }
2643
2785
 
2644
2786
  function _lowerFlatVariant(lowerMetas) {
2787
+ let caseLookup = {};
2788
+ for (const [idx, meta] of lowerMetas.entries()) {
2789
+ let tag = meta[0];
2790
+ caseLookup[tag] = { discriminant: idx, meta };
2791
+ }
2792
+
2645
2793
  return function _lowerFlatVariantInner(ctx) {
2646
- _debugLog('[_lowerFlatVariant()] args', ctx);
2647
-
2648
- const { memory, realloc, vals, storageLen, componentIdx } = ctx;
2649
- let storagePtr = ctx.storagePtr;
2794
+ _debugLog('[_lowerFlatVariant()] args', { ctx });
2650
2795
 
2651
- const { tag, val } = vals[0];
2652
- const disc = lowerMetas.findIndex(m => m[0] === tag);
2653
- if (disc === -1) {
2654
- throw new Error(`invalid variant tag/discriminant [${tag}] (valid tags: ${variantMetas.map(m => m[0])})`);
2796
+ const { tag, val } = ctx.vals[0];
2797
+ const variantCase = caseLookup[tag];
2798
+ if (!variantCase) {
2799
+ throw new Error(`missing tag [${tag}] (valid tags: ${Object.keys(caseLookup)})`);
2655
2800
  }
2656
2801
 
2657
- const [ _tag, lowerFn, size32, align32, payloadOffset32 ] = lowerMetas[disc];
2802
+ const [ _tag, lowerFn, size32, align32, payloadOffset32 ] = variantCase.meta;
2658
2803
 
2659
- const originalPtr = ctx.resultPtr;
2660
- ctx.vals = [disc];
2804
+ const originalPtr = ctx.storagePtr;
2805
+ ctx.vals = [variantCase.discriminant];
2661
2806
  let discLowerRes;
2662
2807
  if (lowerMetas.length < 256) {
2663
2808
  discLowerRes = _lowerFlatU8(ctx);
@@ -2666,23 +2811,15 @@ function _lowerFlatVariant(lowerMetas) {
2666
2811
  } else if (lowerMetas.length >= 65536 && lowerMetas.length < 4_294_967_296) {
2667
2812
  discLowerRes = _lowerFlatU32(ctx);
2668
2813
  } else {
2669
- throw new Error('unsupported number of cases [' + lowerMetas.legnth + ']');
2814
+ throw new Error(`unsupported number of cases [${lowerMetas.length}]`);
2670
2815
  }
2671
2816
 
2672
- ctx.resultPtr = originalPtr + payloadOffset32;
2817
+ const payloadOffsetPtr = originalPtr + payloadOffset32;
2818
+ ctx.storagePtr = payloadOffsetPtr;
2819
+ ctx.vals = [val];
2820
+ if (lowerFn) { lowerFn(ctx); }
2673
2821
 
2674
- let payloadBytesWritten = 0;
2675
- if (lowerFn) {
2676
- lowerFn({
2677
- memory,
2678
- realloc,
2679
- vals: [val],
2680
- storagePtr,
2681
- storageLen,
2682
- componentIdx,
2683
- });
2684
- }
2685
- let bytesWritten = payloadOffset + payloadBytesWritten;
2822
+ let bytesWritten = ctx.storagePtr - payloadOffsetPtr;
2686
2823
 
2687
2824
  const rem = ctx.storagePtr % align32;
2688
2825
  if (rem !== 0) {
@@ -2691,99 +2828,219 @@ function _lowerFlatVariant(lowerMetas) {
2691
2828
  bytesWritten += pad;
2692
2829
  }
2693
2830
 
2694
- return bytesWritten;
2831
+ ctx.storagePtr += bytesWritten;
2695
2832
  }
2696
2833
  }
2697
2834
 
2698
- function _lowerFlatList(args) {
2699
- const { elemLowerFn } = args;
2835
+ function _lowerFlatList(meta) {
2836
+ const {
2837
+ elemLowerFn,
2838
+ knownLen,
2839
+ size32,
2840
+ align32,
2841
+ elemSize32,
2842
+ elemAlign32,
2843
+ } = meta;
2844
+
2700
2845
  if (!elemLowerFn) { throw new TypeError("missing/invalid element lower fn for list"); }
2701
2846
 
2702
2847
  return function _lowerFlatListInner(ctx) {
2703
2848
  _debugLog('[_lowerFlatList()] args', { ctx });
2704
2849
 
2705
- if (ctx.params.length < 2) { throw new Error('insufficient params left to lower list'); }
2706
- const storagePtr = ctx.params[0];
2707
- const elemCount = ctx.params[1];
2708
- ctx.params = ctx.params.slice(2);
2709
-
2710
2850
  if (ctx.useDirectParams) {
2851
+ if (ctx.params.length < 2) { throw new Error('insufficient params left to lower list'); }
2852
+ const storagePtr = ctx.params[0];
2853
+ const elemCount = ctx.params[1];
2854
+ ctx.params = ctx.params.slice(2);
2855
+
2711
2856
  const list = ctx.vals[0];
2712
2857
  if (!list) { throw new Error("missing direct param value"); }
2713
2858
 
2714
- const elemLowerCtx = { storagePtr, memory: ctx.memory };
2859
+ const lowerCtx = {
2860
+ storagePtr,
2861
+ memory: ctx.memory,
2862
+ stringEncoding: ctx.stringEncoding,
2863
+ };
2715
2864
  for (let idx = 0; idx < list.length; idx++) {
2716
- elemLowerCtx.vals = list.slice(idx, idx+1);
2717
- elemLowerCtx.storagePtr += elemLowerFn(elemLowerCtx);
2865
+ lowerCtx.vals = list.slice(idx, idx+1);
2866
+ elemLowerFn(lowerCtx);
2718
2867
  }
2719
2868
 
2720
- const bytesLowered = elemLowerCtx.storagePtr - ctx.storagePtr;
2721
- ctx.storagePtr = elemLowerCtx.storagePtr;
2722
- return bytesLowered;
2869
+ const bytesLowered = lowerCtx.storagePtr - ctx.storagePtr;
2870
+ ctx.storagePtr = lowerCtx.storagePtr;
2871
+
2872
+ // TODO: implement parma-only known-length processing
2873
+
2874
+ ctx.storagePtr += bytesLowered;
2875
+ return;
2723
2876
  }
2724
2877
 
2725
- if (ctx.vals.length !== 2) {
2726
- throw new Error('indirect parameter loading must have a pointer and length as vals');
2878
+ // TODO(fix): is it possible to get a vals that are a addr and length here from
2879
+ // a component lower?
2880
+
2881
+ const elems = ctx.vals[0];
2882
+ if (knownLen === undefined) {
2883
+ // unknown length
2884
+ if (!ctx.realloc) { throw new Error('missing realloc during flat string lower'); }
2885
+ const dataPtr = ctx.realloc(0, 0, elemAlign32, elemSize32 * elems.length);
2886
+
2887
+ ctx.vals[0] = dataPtr;
2888
+ _lowerFlatU32(ctx);
2889
+
2890
+ ctx.vals[0] = elems.length;
2891
+ _lowerFlatU32(ctx);
2892
+
2893
+ const origPtr = ctx.storagePtr;
2894
+ ctx.storagePtr = dataPtr;
2895
+
2896
+ ctx.storagePtr = dataPtr;
2897
+ for (const elem of elems) {
2898
+ ctx.vals = [elem];
2899
+ elemLowerFn(ctx);
2900
+ }
2901
+
2902
+ ctx.storagePtr = origPtr;
2903
+
2904
+ } else {
2905
+ // known length
2906
+
2907
+ if (elems.length !== knownLen) {
2908
+ throw new TypeError(`invalid list input of length [${elems.length}], must be length [${knownLen}]`);
2909
+ }
2910
+
2911
+ for (const elem of elems) {
2912
+ ctx.vals = [elem];
2913
+ elemLowerFn(ctx);
2914
+ }
2727
2915
  }
2728
- let [valStartPtr, valLen] = ctx.vals;
2729
- const totalSizeBytes = valLen * size;
2916
+
2917
+ // TODO(fix): special case for u8/u16/etc, we can do a direct copy
2918
+
2919
+ const totalSizeBytes = elems.length * size32;
2730
2920
  if (ctx.storageLen !== undefined && totalSizeBytes > ctx.storageLen) {
2731
2921
  throw new Error('not enough storage remaining for list flat lower');
2732
2922
  }
2733
-
2734
- const data = new Uint8Array(memory.buffer, valStartPtr, totalSizeBytes);
2735
- new Uint8Array(memory.buffer, storagePtr, totalSizeBytes).set(data);
2736
-
2737
- return totalSizeBytes;
2738
2923
  }
2739
2924
  }
2740
2925
 
2741
- function _lowerFlatTuple(size, memory, vals, storagePtr, storageLen) {
2742
- _debugLog('[_lowerFlatTuple()] args', { size, memory, vals, storagePtr, storageLen });
2743
- let [start, len] = vals;
2744
- if (storageLen !== undefined && len > storageLen) {
2745
- throw new Error('not enough storage remaining for tuple flat lower');
2926
+ function _lowerFlatTuple(elemLowerMetas) {
2927
+ return function _lowerFlatTupleInner(ctx) {
2928
+ _debugLog('[_lowerFlatTuple()] args', { ctx });
2929
+ const tuple = ctx.vals[0];
2930
+ for (const [idx, [ lowerFn, size32, align32 ]] of elemLowerMetas.entries()) {
2931
+ ctx.vals = [tuple[idx]];
2932
+ lowerFn(ctx);
2933
+ }
2746
2934
  }
2747
- const data = new Uint8Array(memory.buffer, start, len);
2748
- new Uint8Array(memory.buffer, storagePtr, len).set(data);
2749
- return data.byteLength;
2750
2935
  }
2751
2936
 
2752
- function _lowerFlatFlags(memory, vals, storagePtr, storageLen) {
2753
- _debugLog('[_lowerFlatFlags()] args', { size, memory, vals, storagePtr, storageLen });
2754
- if (vals.length !== 1) { throw new Error('unexpected number of core vals'); }
2755
- new DataView(memory.buffer).setInt32(storagePtr, vals[0], true);
2756
- return 4;
2937
+ function _lowerFlatFlags(meta) {
2938
+ const { names, size32, align32, intSizeBytes } = meta;
2939
+
2940
+ return function _lowerFlatFlagsInner(ctx) {
2941
+ _debugLog('[_lowerFlatFlags()] args', { ctx });
2942
+ if (ctx.vals.length !== 1) { throw new Error('unexpected number of vals'); }
2943
+
2944
+ let flagObj = ctx.vals[0];
2945
+ let flagValue = 0;
2946
+ for (const [idx, name] of names.entries()) {
2947
+ if (flagObj[name] === true) {
2948
+ flagValue |= 1 << idx;
2949
+ }
2950
+ }
2951
+
2952
+ const rem = ctx.storagePtr % align32;
2953
+ if (rem !== 0) { ctx.storagePtr += (align32 - rem); }
2954
+
2955
+ const dv = new DataView(ctx.memory.buffer);
2956
+ if (intSizeBytes === 1) {
2957
+ dv.setUint8(ctx.storagePtr, flagValue);
2958
+ } else if (intSizeBytes === 2) {
2959
+ dv.setUint16(ctx.storagePtr, flagValue);
2960
+ } else if (intSizeBytes === 4) {
2961
+ dv.setUint32(ctx.storagePtr, flagValue);
2962
+ } else {
2963
+ throw new Error(`unrecognized flag size [${intSizeBytes} bytes]`);
2964
+ }
2965
+
2966
+ ctx.storagePtr += intSizeBytes;
2967
+ }
2757
2968
  }
2758
2969
 
2759
- function _lowerFlatEnum(size, memory, vals, storagePtr, storageLen) {
2760
- _debugLog('[_lowerFlatEnum()] args', { size, memory, vals, storagePtr, storageLen });
2761
- let [start] = vals;
2762
- if (storageLen !== undefined && size !== undefined && size > storageLen) {
2763
- throw new Error('not enough storage remaining for enum flat lower');
2970
+ function _lowerFlatEnum(lowerMetas) {
2971
+ return function _lowerFlatEnumInner(ctx) {
2972
+ _debugLog('[_lowerFlatEnum()] args', { ctx });
2973
+
2974
+ const v = ctx.vals[0];
2975
+ const isNotEnumObject = typeof v !== 'object'
2976
+ || Object.keys(v).length !== 2
2977
+ || !('tag' in v);
2978
+ if (isNotEnumObject) {
2979
+ ctx.vals[0] = { tag: v };
2980
+ }
2981
+
2982
+ _lowerFlatVariant(lowerMetas)(ctx);
2764
2983
  }
2765
- const data = new Uint8Array(memory.buffer, start, size);
2766
- new Uint8Array(memory.buffer, storagePtr, size).set(data);
2767
- return data.byteLength;
2768
2984
  }
2769
2985
 
2770
2986
  function _lowerFlatOption(lowerMetas) {
2771
- function _lowerFlatOptionInner(ctx) {
2987
+ return function _lowerFlatOptionInner(ctx) {
2772
2988
  _debugLog('[_lowerFlatOption()] args', { ctx });
2773
- return _lowerFlatVariant(lowerMetas)(ctx);
2989
+
2990
+ const v = ctx.vals[0];
2991
+ if (v === null) {
2992
+ ctx.vals[0] = { tag: 'none' };
2993
+ } else {
2994
+ const isNotOptionObject = typeof v !== 'object'
2995
+ || Object.keys(v).length !== 2
2996
+ || !('tag' in v)
2997
+ || !(v.tag === 'some' || v.tag === 'none')
2998
+ || !('val' in v);
2999
+ if (isNotOptionObject) {
3000
+ ctx.vals[0] = { tag: 'some', val: v };
3001
+ }
3002
+ }
3003
+
3004
+ _lowerFlatVariant(lowerMetas)(ctx);
2774
3005
  }
2775
3006
  }
2776
3007
 
2777
3008
  function _lowerFlatResult(lowerMetas) {
2778
3009
  return function _lowerFlatResultInner(ctx) {
2779
3010
  _debugLog('[_lowerFlatResult()] args', { lowerMetas });
2780
- return _lowerFlatVariant(lowerMetas)(ctx);
3011
+
3012
+ const v = ctx.vals[0];
3013
+ const isNotResultObject = typeof v !== 'object'
3014
+ || Object.keys(v).length !== 2
3015
+ || !('tag' in v)
3016
+ || !('ok' === v.tag || 'err' === v.tag)
3017
+ || !('val' in v);
3018
+ if (isNotResultObject) {
3019
+ ctx.vals[0] = { tag: 'ok', val: v };
3020
+ }
3021
+
3022
+ _lowerFlatVariant(lowerMetas)(ctx);
2781
3023
  };
2782
3024
  }
2783
3025
 
2784
- function _lowerFlatOwn(size, memory, vals, storagePtr, storageLen) {
2785
- _debugLog('[_lowerFlatOwn()] args', { size, memory, vals, storagePtr, storageLen });
2786
- throw new Error('flat lower for owned resources not yet implemented!');
3026
+ function _lowerFlatOwn(meta) {
3027
+ const { lowerFn, componentIdx } = meta;
3028
+
3029
+ return function _lowerFlatOwnInner(ctx) {
3030
+ _debugLog('[_lowerFlatOwn()] args', { ctx });
3031
+ const { createFn } = ctx;
3032
+
3033
+ if (ctx.componentIdx !== componentIdx) {
3034
+ throw new Error(`component index mismatch (expected [${componentIdx}], lift called from [${ctx.componentIdx}])`);
3035
+ }
3036
+
3037
+ const obj = ctx.vals[0];
3038
+ if (obj === undefined || obj === null) { throw new Error('missing resource'); }
3039
+ const handle = lowerFn(obj);
3040
+
3041
+ ctx.vals[0] = handle;
3042
+ _lowerFlatU32(ctx);
3043
+ };
2787
3044
  }
2788
3045
 
2789
3046
  const STREAMS = new RepTable({ target: 'global stream map' });
@@ -3130,9 +3387,48 @@ class ComponentAsyncState {
3130
3387
  return new Waitable({ target: args?.target, });
3131
3388
  }
3132
3389
 
3390
+ createReadableStreamEnd(args) {
3391
+ _debugLog('[ComponentAsyncState#createStreamEnd()] args', args);
3392
+ const { tableIdx, elemMeta, hostInjectFn } = args;
3393
+
3394
+ const { table: localStreamTable, componentIdx } = STREAM_TABLES[tableIdx];
3395
+ if (!localStreamTable) {
3396
+ throw new Error(`missing global stream table lookup for table [${tableIdx}] while creating stream`);
3397
+ }
3398
+ if (componentIdx !== this.#componentIdx) {
3399
+ throw new Error('component idx mismatch while creating stream');
3400
+ }
3401
+
3402
+ const waitable = this.createWaitable();
3403
+ const streamEnd = new StreamReadableEnd({
3404
+ tableIdx,
3405
+ elemMeta,
3406
+ hostInjectFn,
3407
+ pendingBufferMeta: {},
3408
+ target: `stream read end (lowered, @init)`,
3409
+ waitable,
3410
+ });
3411
+
3412
+ streamEnd.setWaitableIdx(this.handles.insert(streamEnd));
3413
+ streamEnd.setHandle(localStreamTable.insert(streamEnd));
3414
+ if (streamEnd.streamTableIdx() !== tableIdx) {
3415
+ throw new Error("unexpectedly mismatched stream table");
3416
+ }
3417
+ const streamEndWaitableIdx = streamEnd.waitableIdx();
3418
+ const streamEndHandle = streamEnd.handle();
3419
+ waitable.setTarget(`waitable for stream read end (lowered, waitable [${streamEndWaitableIdx}])`);
3420
+ streamEnd.setTarget(`stream read end (lowered, waitable [${streamEndWaitableIdx}])`);
3421
+
3422
+ return {
3423
+ waitableIdx: streamEndWaitableIdx,
3424
+ handle: streamEndHandle,
3425
+ streamEnd,
3426
+ };
3427
+ }
3428
+
3133
3429
  createStream(args) {
3134
3430
  _debugLog('[ComponentAsyncState#createStream()] args', args);
3135
- const { tableIdx, elemMeta } = args;
3431
+ const { tableIdx, elemMeta, hostInjectFn } = args;
3136
3432
  if (tableIdx === undefined) { throw new Error("missing table idx while adding stream"); }
3137
3433
  if (elemMeta === undefined) { throw new Error("missing element metadata while adding stream"); }
3138
3434
 
@@ -3149,10 +3445,10 @@ class ComponentAsyncState {
3149
3445
 
3150
3446
  const stream = new InternalStream({
3151
3447
  tableIdx,
3152
- componentIdx: this.#componentIdx,
3153
3448
  elemMeta,
3154
3449
  readWaitable,
3155
3450
  writeWaitable,
3451
+ hostInjectFn,
3156
3452
  });
3157
3453
  stream.setGlobalStreamMapRep(STREAMS.insert(stream));
3158
3454
 
@@ -3177,17 +3473,21 @@ class ComponentAsyncState {
3177
3473
  readEnd.setTarget(`stream read end (waitable [${readEndWaitableIdx}])`);
3178
3474
 
3179
3475
  return {
3476
+ writeEnd,
3180
3477
  writeEndWaitableIdx,
3181
3478
  writeEndHandle,
3182
3479
  readEndWaitableIdx,
3183
3480
  readEndHandle,
3481
+ readEnd,
3184
3482
  };
3185
3483
  }
3186
3484
 
3187
3485
  getStreamEnd(args) {
3188
3486
  _debugLog('[ComponentAsyncState#getStreamEnd()] args', args);
3189
3487
  const { tableIdx, streamEndHandle, streamEndWaitableIdx } = args;
3190
- if (tableIdx === undefined) { throw new Error('missing table idx while getting stream end'); }
3488
+ if (tableIdx === undefined) {
3489
+ throw new Error('missing table idx while getting stream end');
3490
+ }
3191
3491
 
3192
3492
  const { table, componentIdx } = STREAM_TABLES[tableIdx];
3193
3493
  const cstate = getOrCreateAsyncState(componentIdx);
@@ -3274,6 +3574,128 @@ class ComponentAsyncState {
3274
3574
 
3275
3575
  return streamEnd;
3276
3576
  }
3577
+
3578
+ createFuture(args) {
3579
+ _debugLog('[ComponentAsyncState#createFuture()] args', args);
3580
+ const { tableIdx, elemMeta, hostInjectFn } = args;
3581
+ if (tableIdx === undefined) { throw new Error("missing table idx while adding future"); }
3582
+ if (elemMeta === undefined) { throw new Error("missing element metadata while adding future"); }
3583
+
3584
+ const { table: futureTable, componentIdx } = FUTURE_TABLES[tableIdx];
3585
+ if (!futureTable) {
3586
+ throw new Error(`missing global future table lookup for table [${tableIdx}] while creating future`);
3587
+ }
3588
+ if (componentIdx !== this.#componentIdx) {
3589
+ throw new Error('component idx mismatch while creating future');
3590
+ }
3591
+
3592
+ const readWaitable = this.createWaitable();
3593
+ const writeWaitable = this.createWaitable();
3594
+
3595
+ const future = new InternalFuture({
3596
+ tableIdx,
3597
+ componentIdx: this.#componentIdx,
3598
+ elemMeta,
3599
+ readWaitable,
3600
+ writeWaitable,
3601
+ hostInjectFn,
3602
+ });
3603
+ future.setGlobalFutureMapRep(FUTURES.insert(future));
3604
+
3605
+ const writeEnd = future.writeEnd();
3606
+ writeEnd.setWaitableIdx(this.handles.insert(writeEnd));
3607
+ writeEnd.setHandle(futureTable.insert(writeEnd));
3608
+ if (writeEnd.futureTableIdx() !== tableIdx) { throw new Error("unexpectedly mismatched future table"); }
3609
+
3610
+ const writeEndWaitableIdx = writeEnd.waitableIdx();
3611
+ const writeEndHandle = writeEnd.handle();
3612
+ writeWaitable.setTarget(`waitable for future write end (waitable [${writeEndWaitableIdx}])`);
3613
+ writeEnd.setTarget(`future write end (waitable [${writeEndWaitableIdx}])`);
3614
+
3615
+ const readEnd = future.readEnd();
3616
+ readEnd.setWaitableIdx(this.handles.insert(readEnd));
3617
+ readEnd.setHandle(futureTable.insert(readEnd));
3618
+ if (readEnd.futureTableIdx() !== tableIdx) { throw new Error("unexpectedly mismatched future table"); }
3619
+
3620
+ const readEndWaitableIdx = readEnd.waitableIdx();
3621
+ const readEndHandle = readEnd.handle();
3622
+ readWaitable.setTarget(`waitable for read end (waitable [${readEndWaitableIdx}])`);
3623
+ readEnd.setTarget(`future read end (waitable [${readEndWaitableIdx}])`);
3624
+
3625
+ return {
3626
+ writeEnd,
3627
+ writeEndWaitableIdx,
3628
+ writeEndHandle,
3629
+ readEndWaitableIdx,
3630
+ readEndHandle,
3631
+ readEnd,
3632
+ };
3633
+ }
3634
+
3635
+ getFutureEnd(args) {
3636
+ _debugLog('[ComponentAsyncState#getFutureEnd()] args', args);
3637
+ const { tableIdx, futureEndHandle, futureEndWaitableIdx } = args;
3638
+ if (tableIdx === undefined) {
3639
+ throw new Error('missing table idx while getting future end');
3640
+ }
3641
+
3642
+ const { table, componentIdx } = FUTURE_TABLES[tableIdx];
3643
+ const cstate = getOrCreateAsyncState(componentIdx);
3644
+
3645
+ let futureEnd;
3646
+ if (futureEndWaitableIdx !== undefined) {
3647
+ futureEnd = cstate.handles.get(futureEndWaitableIdx);
3648
+ } else if (futureEndHandle !== undefined) {
3649
+ if (!table) { throw new Error(`missing/invalid table [${tableIdx}] while getting future end`); }
3650
+ futureEnd = table.get(futureEndHandle);
3651
+ } else {
3652
+ console.log("args?", args);
3653
+ throw new TypeError("must specify either waitable idx or handle to retrieve future");
3654
+ }
3655
+
3656
+ if (!futureEnd) {
3657
+ throw new Error(`missing future end (tableIdx [${tableIdx}], handle [${futureEndHandle}], waitableIdx [${futureEndWaitableIdx}])`);
3658
+ }
3659
+ if (tableIdx && futureEnd.futureTableIdx() !== tableIdx) {
3660
+ throw new Error(`future end table idx [${futureEnd.futureTableIdx()}] does not match [${tableIdx}]`);
3661
+ }
3662
+
3663
+ return futureEnd;
3664
+ }
3665
+
3666
+ removeFutureEndFromTable(args) {
3667
+ _debugLog('[ComponentAsyncState#removeFutureEndFromTable()] args', args);
3668
+
3669
+ const { tableIdx, futureWaitableIdx } = args;
3670
+ if (tableIdx === undefined) { throw new Error("missing table idx while removing future end"); }
3671
+ if (futureWaitableIdx === undefined) {
3672
+ throw new Error("missing future end waitable idx while removing future end");
3673
+ }
3674
+
3675
+ const { table, componentIdx } = FUTURE_TABLES[tableIdx];
3676
+ if (!table) { throw new Error(`missing/invalid table [${tableIdx}] while removing future end`); }
3677
+
3678
+ const cstate = getOrCreateAsyncState(componentIdx);
3679
+
3680
+ const futureEnd = cstate.handles.get(futureWaitableIdx);
3681
+ if (!futureEnd) {
3682
+ throw new Error(`missing future end (handle [${futureWaitableIdx}], table [${tableIdx}])`);
3683
+ }
3684
+ const handle = futureEnd.handle();
3685
+
3686
+ let removed = cstate.handles.remove(futureWaitableIdx);
3687
+ if (!removed) {
3688
+ throw new Error(`failed to remove futureEnd from handles (waitable idx [${futureWaitableIdx}]), component [${componentIdx}])`);
3689
+ }
3690
+
3691
+ removed = table.remove(handle);
3692
+ if (!removed) {
3693
+ throw new Error(`failed to remove futureEnd from table (handle [${handle}]), table [${tableIdx}], component [${componentIdx}])`);
3694
+ }
3695
+
3696
+ return futureEnd;
3697
+ }
3698
+
3277
3699
  }
3278
3700
 
3279
3701
  const base64Compile = str => WebAssembly.compile(typeof Buffer !== 'undefined' ? Buffer.from(str, 'base64') : Uint8Array.from(atob(str), b => b.charCodeAt(0)));
@@ -3310,6 +3732,8 @@ function getErrorPayload(e) {
3310
3732
  return e;
3311
3733
  }
3312
3734
 
3735
+ const isLE = new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
3736
+
3313
3737
  function throwUninitialized() {
3314
3738
  throw new TypeError('Wasm uninitialized use `await $init` first');
3315
3739
  }
@@ -3372,8 +3796,9 @@ const _trampoline5 = function() {
3372
3796
  fn: () => getStderr()
3373
3797
  })
3374
3798
  ;
3799
+
3375
3800
  if (!(ret instanceof OutputStream)) {
3376
- throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
3801
+ throw new TypeError('Resource error: Not a valid \"OutputStream\" resource.');
3377
3802
  }
3378
3803
  var handle0 = ret[symbolRscHandle];
3379
3804
  if (!handle0) {
@@ -3381,6 +3806,7 @@ const _trampoline5 = function() {
3381
3806
  captureTable2.set(rep, ret);
3382
3807
  handle0 = rscTableCreateOwn(handleTable2, rep);
3383
3808
  }
3809
+
3384
3810
  _debugLog('[iface="wasi:cli/stderr@0.2.3", function="get-stderr"][Instruction::Return]', {
3385
3811
  funcName: 'get-stderr',
3386
3812
  paramCount: 1,
@@ -3443,8 +3869,9 @@ const _trampoline8 = function() {
3443
3869
  fn: () => getStdin()
3444
3870
  })
3445
3871
  ;
3872
+
3446
3873
  if (!(ret instanceof InputStream)) {
3447
- throw new TypeError('Resource error: Not a valid "InputStream" resource.');
3874
+ throw new TypeError('Resource error: Not a valid \"InputStream\" resource.');
3448
3875
  }
3449
3876
  var handle0 = ret[symbolRscHandle];
3450
3877
  if (!handle0) {
@@ -3452,6 +3879,7 @@ const _trampoline8 = function() {
3452
3879
  captureTable1.set(rep, ret);
3453
3880
  handle0 = rscTableCreateOwn(handleTable1, rep);
3454
3881
  }
3882
+
3455
3883
  _debugLog('[iface="wasi:cli/stdin@0.2.3", function="get-stdin"][Instruction::Return]', {
3456
3884
  funcName: 'get-stdin',
3457
3885
  paramCount: 1,
@@ -3510,8 +3938,9 @@ const _trampoline9 = function() {
3510
3938
  fn: () => getStdout()
3511
3939
  })
3512
3940
  ;
3941
+
3513
3942
  if (!(ret instanceof OutputStream)) {
3514
- throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
3943
+ throw new TypeError('Resource error: Not a valid \"OutputStream\" resource.');
3515
3944
  }
3516
3945
  var handle0 = ret[symbolRscHandle];
3517
3946
  if (!handle0) {
@@ -3519,6 +3948,7 @@ const _trampoline9 = function() {
3519
3948
  captureTable2.set(rep, ret);
3520
3949
  handle0 = rscTableCreateOwn(handleTable2, rep);
3521
3950
  }
3951
+
3522
3952
  _debugLog('[iface="wasi:cli/stdout@0.2.3", function="get-stdout"][Instruction::Return]', {
3523
3953
  funcName: 'get-stdout',
3524
3954
  paramCount: 1,
@@ -5110,8 +5540,9 @@ switch (variant5.tag) {
5110
5540
  case 'ok': {
5111
5541
  const e = variant5.val;
5112
5542
  dataView(memory0).setInt8(arg2 + 0, 0, true);
5543
+
5113
5544
  if (!(e instanceof InputStream)) {
5114
- throw new TypeError('Resource error: Not a valid "InputStream" resource.');
5545
+ throw new TypeError('Resource error: Not a valid \"InputStream\" resource.');
5115
5546
  }
5116
5547
  var handle3 = e[symbolRscHandle];
5117
5548
  if (!handle3) {
@@ -5119,6 +5550,7 @@ switch (variant5.tag) {
5119
5550
  captureTable1.set(rep, e);
5120
5551
  handle3 = rscTableCreateOwn(handleTable1, rep);
5121
5552
  }
5553
+
5122
5554
  dataView(memory0).setInt32(arg2 + 4, handle3, true);
5123
5555
 
5124
5556
  break;
@@ -5378,8 +5810,9 @@ switch (variant5.tag) {
5378
5810
  case 'ok': {
5379
5811
  const e = variant5.val;
5380
5812
  dataView(memory0).setInt8(arg2 + 0, 0, true);
5813
+
5381
5814
  if (!(e instanceof OutputStream)) {
5382
- throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
5815
+ throw new TypeError('Resource error: Not a valid \"OutputStream\" resource.');
5383
5816
  }
5384
5817
  var handle3 = e[symbolRscHandle];
5385
5818
  if (!handle3) {
@@ -5387,6 +5820,7 @@ switch (variant5.tag) {
5387
5820
  captureTable2.set(rep, e);
5388
5821
  handle3 = rscTableCreateOwn(handleTable2, rep);
5389
5822
  }
5823
+
5390
5824
  dataView(memory0).setInt32(arg2 + 4, handle3, true);
5391
5825
 
5392
5826
  break;
@@ -5646,8 +6080,9 @@ switch (variant5.tag) {
5646
6080
  case 'ok': {
5647
6081
  const e = variant5.val;
5648
6082
  dataView(memory0).setInt8(arg1 + 0, 0, true);
6083
+
5649
6084
  if (!(e instanceof OutputStream)) {
5650
- throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
6085
+ throw new TypeError('Resource error: Not a valid \"OutputStream\" resource.');
5651
6086
  }
5652
6087
  var handle3 = e[symbolRscHandle];
5653
6088
  if (!handle3) {
@@ -5655,6 +6090,7 @@ switch (variant5.tag) {
5655
6090
  captureTable2.set(rep, e);
5656
6091
  handle3 = rscTableCreateOwn(handleTable2, rep);
5657
6092
  }
6093
+
5658
6094
  dataView(memory0).setInt32(arg1 + 4, handle3, true);
5659
6095
 
5660
6096
  break;
@@ -5918,8 +6354,9 @@ switch (variant5.tag) {
5918
6354
  case 'ok': {
5919
6355
  const e = variant5.val;
5920
6356
  dataView(memory0).setInt8(arg1 + 0, 0, true);
6357
+
5921
6358
  if (!(e instanceof DirectoryEntryStream)) {
5922
- throw new TypeError('Resource error: Not a valid "DirectoryEntryStream" resource.');
6359
+ throw new TypeError('Resource error: Not a valid \"DirectoryEntryStream\" resource.');
5923
6360
  }
5924
6361
  var handle3 = e[symbolRscHandle];
5925
6362
  if (!handle3) {
@@ -5927,6 +6364,7 @@ switch (variant5.tag) {
5927
6364
  captureTable5.set(rep, e);
5928
6365
  handle3 = rscTableCreateOwn(handleTable5, rep);
5929
6366
  }
6367
+
5930
6368
  dataView(memory0).setInt32(arg1 + 4, handle3, true);
5931
6369
 
5932
6370
  break;
@@ -6894,8 +7332,9 @@ switch (variant9.tag) {
6894
7332
  case 'ok': {
6895
7333
  const e = variant9.val;
6896
7334
  dataView(memory0).setInt8(arg6 + 0, 0, true);
7335
+
6897
7336
  if (!(e instanceof Descriptor)) {
6898
- throw new TypeError('Resource error: Not a valid "Descriptor" resource.');
7337
+ throw new TypeError('Resource error: Not a valid \"Descriptor\" resource.');
6899
7338
  }
6900
7339
  var handle7 = e[symbolRscHandle];
6901
7340
  if (!handle7) {
@@ -6903,6 +7342,7 @@ switch (variant9.tag) {
6903
7342
  captureTable6.set(rep, e);
6904
7343
  handle7 = rscTableCreateOwn(handleTable6, rep);
6905
7344
  }
7345
+
6906
7346
  dataView(memory0).setInt32(arg6 + 4, handle7, true);
6907
7347
 
6908
7348
  break;
@@ -7490,13 +7930,14 @@ switch (variant6.tag) {
7490
7930
  let offset = 0;
7491
7931
  const dv3 = new DataView(memory0.buffer);
7492
7932
  for (const v of val3) {
7933
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
7493
7934
  dv3.setUint8(ptr3+ offset, v, true);
7494
7935
  offset += 1;
7495
7936
  }
7496
7937
  } else {
7497
7938
  // TypedArray / ArrayBuffer-like, direct copy
7498
7939
  valData3 = new Uint8Array(val3.buffer || val3, val3.byteOffset, valLenBytes3);
7499
- const out3 = new Uint8Array(memory0.buffer, ptr3,valLenBytes3);
7940
+ const out3 = new Uint8Array(memory0.buffer, ptr3, valLenBytes3);
7500
7941
  out3.set(valData3);
7501
7942
  }
7502
7943
 
@@ -7513,8 +7954,9 @@ switch (variant6.tag) {
7513
7954
  case 'last-operation-failed': {
7514
7955
  const e = variant5.val;
7515
7956
  dataView(memory0).setInt8(arg2 + 4, 0, true);
7957
+
7516
7958
  if (!(e instanceof Error$1)) {
7517
- throw new TypeError('Resource error: Not a valid "Error" resource.');
7959
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
7518
7960
  }
7519
7961
  var handle4 = e[symbolRscHandle];
7520
7962
  if (!handle4) {
@@ -7522,6 +7964,7 @@ switch (variant6.tag) {
7522
7964
  captureTable0.set(rep, e);
7523
7965
  handle4 = rscTableCreateOwn(handleTable0, rep);
7524
7966
  }
7967
+
7525
7968
  dataView(memory0).setInt32(arg2 + 8, handle4, true);
7526
7969
  break;
7527
7970
  }
@@ -7636,13 +8079,14 @@ switch (variant6.tag) {
7636
8079
  let offset = 0;
7637
8080
  const dv3 = new DataView(memory0.buffer);
7638
8081
  for (const v of val3) {
8082
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
7639
8083
  dv3.setUint8(ptr3+ offset, v, true);
7640
8084
  offset += 1;
7641
8085
  }
7642
8086
  } else {
7643
8087
  // TypedArray / ArrayBuffer-like, direct copy
7644
8088
  valData3 = new Uint8Array(val3.buffer || val3, val3.byteOffset, valLenBytes3);
7645
- const out3 = new Uint8Array(memory0.buffer, ptr3,valLenBytes3);
8089
+ const out3 = new Uint8Array(memory0.buffer, ptr3, valLenBytes3);
7646
8090
  out3.set(valData3);
7647
8091
  }
7648
8092
 
@@ -7659,8 +8103,9 @@ switch (variant6.tag) {
7659
8103
  case 'last-operation-failed': {
7660
8104
  const e = variant5.val;
7661
8105
  dataView(memory0).setInt8(arg2 + 4, 0, true);
8106
+
7662
8107
  if (!(e instanceof Error$1)) {
7663
- throw new TypeError('Resource error: Not a valid "Error" resource.');
8108
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
7664
8109
  }
7665
8110
  var handle4 = e[symbolRscHandle];
7666
8111
  if (!handle4) {
@@ -7668,6 +8113,7 @@ switch (variant6.tag) {
7668
8113
  captureTable0.set(rep, e);
7669
8114
  handle4 = rscTableCreateOwn(handleTable0, rep);
7670
8115
  }
8116
+
7671
8117
  dataView(memory0).setInt32(arg2 + 8, handle4, true);
7672
8118
  break;
7673
8119
  }
@@ -7783,8 +8229,9 @@ switch (variant5.tag) {
7783
8229
  case 'last-operation-failed': {
7784
8230
  const e = variant4.val;
7785
8231
  dataView(memory0).setInt8(arg1 + 8, 0, true);
8232
+
7786
8233
  if (!(e instanceof Error$1)) {
7787
- throw new TypeError('Resource error: Not a valid "Error" resource.');
8234
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
7788
8235
  }
7789
8236
  var handle3 = e[symbolRscHandle];
7790
8237
  if (!handle3) {
@@ -7792,6 +8239,7 @@ switch (variant5.tag) {
7792
8239
  captureTable0.set(rep, e);
7793
8240
  handle3 = rscTableCreateOwn(handleTable0, rep);
7794
8241
  }
8242
+
7795
8243
  dataView(memory0).setInt32(arg1 + 12, handle3, true);
7796
8244
  break;
7797
8245
  }
@@ -7909,8 +8357,9 @@ switch (variant6.tag) {
7909
8357
  case 'last-operation-failed': {
7910
8358
  const e = variant5.val;
7911
8359
  dataView(memory0).setInt8(arg3 + 4, 0, true);
8360
+
7912
8361
  if (!(e instanceof Error$1)) {
7913
- throw new TypeError('Resource error: Not a valid "Error" resource.');
8362
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
7914
8363
  }
7915
8364
  var handle4 = e[symbolRscHandle];
7916
8365
  if (!handle4) {
@@ -7918,6 +8367,7 @@ switch (variant6.tag) {
7918
8367
  captureTable0.set(rep, e);
7919
8368
  handle4 = rscTableCreateOwn(handleTable0, rep);
7920
8369
  }
8370
+
7921
8371
  dataView(memory0).setInt32(arg3 + 8, handle4, true);
7922
8372
  break;
7923
8373
  }
@@ -8035,8 +8485,9 @@ switch (variant6.tag) {
8035
8485
  case 'last-operation-failed': {
8036
8486
  const e = variant5.val;
8037
8487
  dataView(memory0).setInt8(arg3 + 4, 0, true);
8488
+
8038
8489
  if (!(e instanceof Error$1)) {
8039
- throw new TypeError('Resource error: Not a valid "Error" resource.');
8490
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
8040
8491
  }
8041
8492
  var handle4 = e[symbolRscHandle];
8042
8493
  if (!handle4) {
@@ -8044,6 +8495,7 @@ switch (variant6.tag) {
8044
8495
  captureTable0.set(rep, e);
8045
8496
  handle4 = rscTableCreateOwn(handleTable0, rep);
8046
8497
  }
8498
+
8047
8499
  dataView(memory0).setInt32(arg3 + 8, handle4, true);
8048
8500
  break;
8049
8501
  }
@@ -8158,8 +8610,9 @@ switch (variant5.tag) {
8158
8610
  case 'last-operation-failed': {
8159
8611
  const e = variant4.val;
8160
8612
  dataView(memory0).setInt8(arg1 + 4, 0, true);
8613
+
8161
8614
  if (!(e instanceof Error$1)) {
8162
- throw new TypeError('Resource error: Not a valid "Error" resource.');
8615
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
8163
8616
  }
8164
8617
  var handle3 = e[symbolRscHandle];
8165
8618
  if (!handle3) {
@@ -8167,6 +8620,7 @@ switch (variant5.tag) {
8167
8620
  captureTable0.set(rep, e);
8168
8621
  handle3 = rscTableCreateOwn(handleTable0, rep);
8169
8622
  }
8623
+
8170
8624
  dataView(memory0).setInt32(arg1 + 8, handle3, true);
8171
8625
  break;
8172
8626
  }
@@ -8254,13 +8708,14 @@ const _trampoline31 = function(arg0, arg1) {
8254
8708
  let offset = 0;
8255
8709
  const dv0 = new DataView(memory0.buffer);
8256
8710
  for (const v of val0) {
8711
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
8257
8712
  dv0.setUint8(ptr0+ offset, v, true);
8258
8713
  offset += 1;
8259
8714
  }
8260
8715
  } else {
8261
8716
  // TypedArray / ArrayBuffer-like, direct copy
8262
8717
  valData0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, valLenBytes0);
8263
- const out0 = new Uint8Array(memory0.buffer, ptr0,valLenBytes0);
8718
+ const out0 = new Uint8Array(memory0.buffer, ptr0, valLenBytes0);
8264
8719
  out0.set(valData0);
8265
8720
  }
8266
8721
 
@@ -8329,8 +8784,9 @@ const _trampoline32 = function(arg0) {
8329
8784
  for (let i = 0; i < vec3.length; i++) {
8330
8785
  const e = vec3[i];
8331
8786
  const base = result3 + i * 12;var [tuple0_0, tuple0_1] = e;
8787
+
8332
8788
  if (!(tuple0_0 instanceof Descriptor)) {
8333
- throw new TypeError('Resource error: Not a valid "Descriptor" resource.');
8789
+ throw new TypeError('Resource error: Not a valid \"Descriptor\" resource.');
8334
8790
  }
8335
8791
  var handle1 = tuple0_0[symbolRscHandle];
8336
8792
  if (!handle1) {
@@ -8338,6 +8794,7 @@ const _trampoline32 = function(arg0) {
8338
8794
  captureTable6.set(rep, tuple0_0);
8339
8795
  handle1 = rscTableCreateOwn(handleTable6, rep);
8340
8796
  }
8797
+
8341
8798
  dataView(memory0).setInt32(base + 0, handle1, true);
8342
8799
 
8343
8800
  var encodeRes = _utf8AllocateAndEncode(tuple0_1, realloc0, memory0);
@@ -8416,8 +8873,9 @@ const _trampoline33 = function(arg0) {
8416
8873
  } else {
8417
8874
  const e = variant1;
8418
8875
  dataView(memory0).setInt8(arg0 + 0, 1, true);
8876
+
8419
8877
  if (!(e instanceof TerminalInput)) {
8420
- throw new TypeError('Resource error: Not a valid "TerminalInput" resource.');
8878
+ throw new TypeError('Resource error: Not a valid \"TerminalInput\" resource.');
8421
8879
  }
8422
8880
  var handle0 = e[symbolRscHandle];
8423
8881
  if (!handle0) {
@@ -8425,6 +8883,7 @@ const _trampoline33 = function(arg0) {
8425
8883
  captureTable3.set(rep, e);
8426
8884
  handle0 = rscTableCreateOwn(handleTable3, rep);
8427
8885
  }
8886
+
8428
8887
  dataView(memory0).setInt32(arg0 + 4, handle0, true);
8429
8888
  }
8430
8889
  _debugLog('[iface="wasi:cli/terminal-stdin@0.2.3", function="get-terminal-stdin"][Instruction::Return]', {
@@ -8494,8 +8953,9 @@ const _trampoline34 = function(arg0) {
8494
8953
  } else {
8495
8954
  const e = variant1;
8496
8955
  dataView(memory0).setInt8(arg0 + 0, 1, true);
8956
+
8497
8957
  if (!(e instanceof TerminalOutput)) {
8498
- throw new TypeError('Resource error: Not a valid "TerminalOutput" resource.');
8958
+ throw new TypeError('Resource error: Not a valid \"TerminalOutput\" resource.');
8499
8959
  }
8500
8960
  var handle0 = e[symbolRscHandle];
8501
8961
  if (!handle0) {
@@ -8503,6 +8963,7 @@ const _trampoline34 = function(arg0) {
8503
8963
  captureTable4.set(rep, e);
8504
8964
  handle0 = rscTableCreateOwn(handleTable4, rep);
8505
8965
  }
8966
+
8506
8967
  dataView(memory0).setInt32(arg0 + 4, handle0, true);
8507
8968
  }
8508
8969
  _debugLog('[iface="wasi:cli/terminal-stdout@0.2.3", function="get-terminal-stdout"][Instruction::Return]', {
@@ -8568,8 +9029,9 @@ const _trampoline35 = function(arg0) {
8568
9029
  } else {
8569
9030
  const e = variant1;
8570
9031
  dataView(memory0).setInt8(arg0 + 0, 1, true);
9032
+
8571
9033
  if (!(e instanceof TerminalOutput)) {
8572
- throw new TypeError('Resource error: Not a valid "TerminalOutput" resource.');
9034
+ throw new TypeError('Resource error: Not a valid \"TerminalOutput\" resource.');
8573
9035
  }
8574
9036
  var handle0 = e[symbolRscHandle];
8575
9037
  if (!handle0) {
@@ -8577,6 +9039,7 @@ const _trampoline35 = function(arg0) {
8577
9039
  captureTable4.set(rep, e);
8578
9040
  handle0 = rscTableCreateOwn(handleTable4, rep);
8579
9041
  }
9042
+
8580
9043
  dataView(memory0).setInt32(arg0 + 4, handle0, true);
8581
9044
  }
8582
9045
  _debugLog('[iface="wasi:cli/terminal-stderr@0.2.3", function="get-terminal-stderr"][Instruction::Return]', {
@@ -8612,13 +9075,14 @@ function generate(arg0, arg1) {
8612
9075
  let offset = 0;
8613
9076
  const dv1 = new DataView(memory0.buffer);
8614
9077
  for (const v of val1) {
9078
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
8615
9079
  dv1.setUint8(ptr1+ offset, v, true);
8616
9080
  offset += 1;
8617
9081
  }
8618
9082
  } else {
8619
9083
  // TypedArray / ArrayBuffer-like, direct copy
8620
9084
  valData1 = new Uint8Array(val1.buffer || val1, val1.byteOffset, valLenBytes1);
8621
- const out1 = new Uint8Array(memory0.buffer, ptr1,valLenBytes1);
9085
+ const out1 = new Uint8Array(memory0.buffer, ptr1, valLenBytes1);
8622
9086
  out1.set(valData1);
8623
9087
  }
8624
9088
 
@@ -9011,13 +9475,14 @@ function generateTypes(arg0, arg1) {
9011
9475
  let offset = 0;
9012
9476
  const dv4 = new DataView(memory0.buffer);
9013
9477
  for (const v of val4) {
9478
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
9014
9479
  dv4.setUint8(ptr4+ offset, v, true);
9015
9480
  offset += 1;
9016
9481
  }
9017
9482
  } else {
9018
9483
  // TypedArray / ArrayBuffer-like, direct copy
9019
9484
  valData4 = new Uint8Array(val4.buffer || val4, val4.byteOffset, valLenBytes4);
9020
- const out4 = new Uint8Array(memory0.buffer, ptr4,valLenBytes4);
9485
+ const out4 = new Uint8Array(memory0.buffer, ptr4, valLenBytes4);
9021
9486
  out4.set(valData4);
9022
9487
  }
9023
9488
 
@@ -9372,12 +9837,16 @@ null,
9372
9837
  isAsync: false,
9373
9838
  isManualAsync: _trampoline5.manuallyAsync,
9374
9839
  paramLiftFns: [],
9375
- resultLowerFns: [_lowerFlatOwn.bind(null, 2)],
9840
+ resultLowerFns: [_lowerFlatOwn({
9841
+ componentIdx: 0,
9842
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
9843
+ })],
9376
9844
  funcTypeIsAsync: false,
9377
9845
  getCallbackFn: () => null,
9378
9846
  getPostReturnFn: () => null,
9379
9847
  isCancellable: false,
9380
9848
  memoryIdx: null,
9849
+ stringEncoding: 'utf8',
9381
9850
  getMemoryFn: () => null,
9382
9851
  getReallocFn: () => null,
9383
9852
  importFn: _trampoline5,
@@ -9390,12 +9859,16 @@ null,
9390
9859
  isAsync: false,
9391
9860
  isManualAsync: _trampoline5.manuallyAsync,
9392
9861
  paramLiftFns: [],
9393
- resultLowerFns: [_lowerFlatOwn.bind(null, 2)],
9862
+ resultLowerFns: [_lowerFlatOwn({
9863
+ componentIdx: 0,
9864
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
9865
+ })],
9394
9866
  funcTypeIsAsync: false,
9395
9867
  getCallbackFn: () => null,
9396
9868
  getPostReturnFn: () => null,
9397
9869
  isCancellable: false,
9398
9870
  memoryIdx: null,
9871
+ stringEncoding: 'utf8',
9399
9872
  getMemoryFn: () => null,
9400
9873
  getReallocFn: () => null,
9401
9874
  importFn: _trampoline5,
@@ -9435,12 +9908,16 @@ null,
9435
9908
  isAsync: false,
9436
9909
  isManualAsync: _trampoline8.manuallyAsync,
9437
9910
  paramLiftFns: [],
9438
- resultLowerFns: [_lowerFlatOwn.bind(null, 1)],
9911
+ resultLowerFns: [_lowerFlatOwn({
9912
+ componentIdx: 0,
9913
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
9914
+ })],
9439
9915
  funcTypeIsAsync: false,
9440
9916
  getCallbackFn: () => null,
9441
9917
  getPostReturnFn: () => null,
9442
9918
  isCancellable: false,
9443
9919
  memoryIdx: null,
9920
+ stringEncoding: 'utf8',
9444
9921
  getMemoryFn: () => null,
9445
9922
  getReallocFn: () => null,
9446
9923
  importFn: _trampoline8,
@@ -9453,12 +9930,16 @@ null,
9453
9930
  isAsync: false,
9454
9931
  isManualAsync: _trampoline8.manuallyAsync,
9455
9932
  paramLiftFns: [],
9456
- resultLowerFns: [_lowerFlatOwn.bind(null, 1)],
9933
+ resultLowerFns: [_lowerFlatOwn({
9934
+ componentIdx: 0,
9935
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
9936
+ })],
9457
9937
  funcTypeIsAsync: false,
9458
9938
  getCallbackFn: () => null,
9459
9939
  getPostReturnFn: () => null,
9460
9940
  isCancellable: false,
9461
9941
  memoryIdx: null,
9942
+ stringEncoding: 'utf8',
9462
9943
  getMemoryFn: () => null,
9463
9944
  getReallocFn: () => null,
9464
9945
  importFn: _trampoline8,
@@ -9472,12 +9953,16 @@ null,
9472
9953
  isAsync: false,
9473
9954
  isManualAsync: _trampoline9.manuallyAsync,
9474
9955
  paramLiftFns: [],
9475
- resultLowerFns: [_lowerFlatOwn.bind(null, 2)],
9956
+ resultLowerFns: [_lowerFlatOwn({
9957
+ componentIdx: 0,
9958
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
9959
+ })],
9476
9960
  funcTypeIsAsync: false,
9477
9961
  getCallbackFn: () => null,
9478
9962
  getPostReturnFn: () => null,
9479
9963
  isCancellable: false,
9480
9964
  memoryIdx: null,
9965
+ stringEncoding: 'utf8',
9481
9966
  getMemoryFn: () => null,
9482
9967
  getReallocFn: () => null,
9483
9968
  importFn: _trampoline9,
@@ -9490,12 +9975,16 @@ null,
9490
9975
  isAsync: false,
9491
9976
  isManualAsync: _trampoline9.manuallyAsync,
9492
9977
  paramLiftFns: [],
9493
- resultLowerFns: [_lowerFlatOwn.bind(null, 2)],
9978
+ resultLowerFns: [_lowerFlatOwn({
9979
+ componentIdx: 0,
9980
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
9981
+ })],
9494
9982
  funcTypeIsAsync: false,
9495
9983
  getCallbackFn: () => null,
9496
9984
  getPostReturnFn: () => null,
9497
9985
  isCancellable: false,
9498
9986
  memoryIdx: null,
9987
+ stringEncoding: 'utf8',
9499
9988
  getMemoryFn: () => null,
9500
9989
  getReallocFn: () => null,
9501
9990
  importFn: _trampoline9,
@@ -9515,6 +10004,7 @@ null,
9515
10004
  getPostReturnFn: () => null,
9516
10005
  isCancellable: false,
9517
10006
  memoryIdx: null,
10007
+ stringEncoding: 'utf8',
9518
10008
  getMemoryFn: () => null,
9519
10009
  getReallocFn: () => null,
9520
10010
  importFn: _trampoline10,
@@ -9533,6 +10023,7 @@ null,
9533
10023
  getPostReturnFn: () => null,
9534
10024
  isCancellable: false,
9535
10025
  memoryIdx: null,
10026
+ stringEncoding: 'utf8',
9536
10027
  getMemoryFn: () => null,
9537
10028
  getReallocFn: () => null,
9538
10029
  importFn: _trampoline10,
@@ -9546,12 +10037,17 @@ null,
9546
10037
  isAsync: false,
9547
10038
  isManualAsync: _trampoline11.manuallyAsync,
9548
10039
  paramLiftFns: [],
9549
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatTuple.bind(null, 0), typeIdx: 0 })],
10040
+ resultLowerFns: [_lowerFlatList({
10041
+ elemLowerFn: _lowerFlatTuple([[_lowerFlatStringAny, 16, 4],[_lowerFlatStringAny, 16, 4],]),
10042
+ elemSize32: 16,
10043
+ elemAlign32: 4,
10044
+ })],
9550
10045
  funcTypeIsAsync: false,
9551
10046
  getCallbackFn: () => null,
9552
10047
  getPostReturnFn: () => null,
9553
10048
  isCancellable: false,
9554
10049
  memoryIdx: 0,
10050
+ stringEncoding: 'utf8',
9555
10051
  getMemoryFn: () => memory0,
9556
10052
  getReallocFn: () => realloc0,
9557
10053
  importFn: _trampoline11,
@@ -9564,12 +10060,17 @@ null,
9564
10060
  isAsync: false,
9565
10061
  isManualAsync: _trampoline11.manuallyAsync,
9566
10062
  paramLiftFns: [],
9567
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatTuple.bind(null, 0), typeIdx: 0 })],
10063
+ resultLowerFns: [_lowerFlatList({
10064
+ elemLowerFn: _lowerFlatTuple([[_lowerFlatStringAny, 16, 4],[_lowerFlatStringAny, 16, 4],]),
10065
+ elemSize32: 16,
10066
+ elemAlign32: 4,
10067
+ })],
9568
10068
  funcTypeIsAsync: false,
9569
10069
  getCallbackFn: () => null,
9570
10070
  getPostReturnFn: () => null,
9571
10071
  isCancellable: false,
9572
10072
  memoryIdx: 0,
10073
+ stringEncoding: 'utf8',
9573
10074
  getMemoryFn: () => memory0,
9574
10075
  getReallocFn: () => realloc0,
9575
10076
  importFn: _trampoline11,
@@ -9583,12 +10084,17 @@ null,
9583
10084
  isAsync: false,
9584
10085
  isManualAsync: _trampoline12.manuallyAsync,
9585
10086
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9586
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatFlags.bind(null, 0), 2, 1, 1 ],[ 'err', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],])],
10087
+ resultLowerFns: [_lowerFlatResult([
10088
+ [ 'ok', _lowerFlatFlags({ names: ['read','write','file-integrity-sync','data-integrity-sync','requested-write-sync','mutate-directory'], size32: 1, align32: 1, intSizeBytes: 1 }), 2, 1, 1 ],
10089
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 2, 1, 1 ],
10090
+ ])
10091
+ ],
9587
10092
  funcTypeIsAsync: false,
9588
10093
  getCallbackFn: () => null,
9589
10094
  getPostReturnFn: () => null,
9590
10095
  isCancellable: false,
9591
10096
  memoryIdx: 0,
10097
+ stringEncoding: 'utf8',
9592
10098
  getMemoryFn: () => memory0,
9593
10099
  getReallocFn: () => null,
9594
10100
  importFn: _trampoline12,
@@ -9601,12 +10107,17 @@ null,
9601
10107
  isAsync: false,
9602
10108
  isManualAsync: _trampoline12.manuallyAsync,
9603
10109
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9604
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatFlags.bind(null, 0), 2, 1, 1 ],[ 'err', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],])],
10110
+ resultLowerFns: [_lowerFlatResult([
10111
+ [ 'ok', _lowerFlatFlags({ names: ['read','write','file-integrity-sync','data-integrity-sync','requested-write-sync','mutate-directory'], size32: 1, align32: 1, intSizeBytes: 1 }), 2, 1, 1 ],
10112
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 2, 1, 1 ],
10113
+ ])
10114
+ ],
9605
10115
  funcTypeIsAsync: false,
9606
10116
  getCallbackFn: () => null,
9607
10117
  getPostReturnFn: () => null,
9608
10118
  isCancellable: false,
9609
10119
  memoryIdx: 0,
10120
+ stringEncoding: 'utf8',
9610
10121
  getMemoryFn: () => memory0,
9611
10122
  getReallocFn: () => null,
9612
10123
  importFn: _trampoline12,
@@ -9620,12 +10131,17 @@ null,
9620
10131
  isAsync: false,
9621
10132
  isManualAsync: _trampoline13.manuallyAsync,
9622
10133
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9623
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatEnum.bind(null, 1), 2, 1, 1 ],[ 'err', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],])],
10134
+ resultLowerFns: [_lowerFlatResult([
10135
+ [ 'ok', _lowerFlatEnum([['unknown', null, 1, 1, 1],['block-device', null, 1, 1, 1],['character-device', null, 1, 1, 1],['directory', null, 1, 1, 1],['fifo', null, 1, 1, 1],['symbolic-link', null, 1, 1, 1],['regular-file', null, 1, 1, 1],['socket', null, 1, 1, 1],]), 2, 1, 1 ],
10136
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 2, 1, 1 ],
10137
+ ])
10138
+ ],
9624
10139
  funcTypeIsAsync: false,
9625
10140
  getCallbackFn: () => null,
9626
10141
  getPostReturnFn: () => null,
9627
10142
  isCancellable: false,
9628
10143
  memoryIdx: 0,
10144
+ stringEncoding: 'utf8',
9629
10145
  getMemoryFn: () => memory0,
9630
10146
  getReallocFn: () => null,
9631
10147
  importFn: _trampoline13,
@@ -9638,12 +10154,17 @@ null,
9638
10154
  isAsync: false,
9639
10155
  isManualAsync: _trampoline13.manuallyAsync,
9640
10156
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9641
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatEnum.bind(null, 1), 2, 1, 1 ],[ 'err', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],])],
10157
+ resultLowerFns: [_lowerFlatResult([
10158
+ [ 'ok', _lowerFlatEnum([['unknown', null, 1, 1, 1],['block-device', null, 1, 1, 1],['character-device', null, 1, 1, 1],['directory', null, 1, 1, 1],['fifo', null, 1, 1, 1],['symbolic-link', null, 1, 1, 1],['regular-file', null, 1, 1, 1],['socket', null, 1, 1, 1],]), 2, 1, 1 ],
10159
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 2, 1, 1 ],
10160
+ ])
10161
+ ],
9642
10162
  funcTypeIsAsync: false,
9643
10163
  getCallbackFn: () => null,
9644
10164
  getPostReturnFn: () => null,
9645
10165
  isCancellable: false,
9646
10166
  memoryIdx: 0,
10167
+ stringEncoding: 'utf8',
9647
10168
  getMemoryFn: () => memory0,
9648
10169
  getReallocFn: () => null,
9649
10170
  importFn: _trampoline13,
@@ -9657,12 +10178,17 @@ null,
9657
10178
  isAsync: false,
9658
10179
  isManualAsync: _trampoline14.manuallyAsync,
9659
10180
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9660
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatRecord.bind(null, [['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],[ 'err', _lowerFlatEnum.bind(null, 0), 24, 8, 8 ],])],
10181
+ resultLowerFns: [_lowerFlatResult([
10182
+ [ 'ok', _lowerFlatRecord([['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],
10183
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 24, 8, 8 ],
10184
+ ])
10185
+ ],
9661
10186
  funcTypeIsAsync: false,
9662
10187
  getCallbackFn: () => null,
9663
10188
  getPostReturnFn: () => null,
9664
10189
  isCancellable: false,
9665
10190
  memoryIdx: 0,
10191
+ stringEncoding: 'utf8',
9666
10192
  getMemoryFn: () => memory0,
9667
10193
  getReallocFn: () => null,
9668
10194
  importFn: _trampoline14,
@@ -9675,12 +10201,17 @@ null,
9675
10201
  isAsync: false,
9676
10202
  isManualAsync: _trampoline14.manuallyAsync,
9677
10203
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9678
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatRecord.bind(null, [['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],[ 'err', _lowerFlatEnum.bind(null, 0), 24, 8, 8 ],])],
10204
+ resultLowerFns: [_lowerFlatResult([
10205
+ [ 'ok', _lowerFlatRecord([['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],
10206
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 24, 8, 8 ],
10207
+ ])
10208
+ ],
9679
10209
  funcTypeIsAsync: false,
9680
10210
  getCallbackFn: () => null,
9681
10211
  getPostReturnFn: () => null,
9682
10212
  isCancellable: false,
9683
10213
  memoryIdx: 0,
10214
+ stringEncoding: 'utf8',
9684
10215
  getMemoryFn: () => memory0,
9685
10216
  getReallocFn: () => null,
9686
10217
  importFn: _trampoline14,
@@ -9694,12 +10225,17 @@ null,
9694
10225
  isAsync: false,
9695
10226
  isManualAsync: _trampoline15.manuallyAsync,
9696
10227
  paramLiftFns: [_liftFlatBorrow.bind(null, 0)],
9697
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],[ 'none', null, 2, 1, 1 ],])],
10228
+ resultLowerFns: [_lowerFlatOption([
10229
+ [ 'none', null, 2, 1, 1 ],
10230
+ [ 'some', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 2, 1, 1 ],
10231
+ ])
10232
+ ],
9698
10233
  funcTypeIsAsync: false,
9699
10234
  getCallbackFn: () => null,
9700
10235
  getPostReturnFn: () => null,
9701
10236
  isCancellable: false,
9702
10237
  memoryIdx: 0,
10238
+ stringEncoding: 'utf8',
9703
10239
  getMemoryFn: () => memory0,
9704
10240
  getReallocFn: () => null,
9705
10241
  importFn: _trampoline15,
@@ -9712,12 +10248,17 @@ null,
9712
10248
  isAsync: false,
9713
10249
  isManualAsync: _trampoline15.manuallyAsync,
9714
10250
  paramLiftFns: [_liftFlatBorrow.bind(null, 0)],
9715
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],[ 'none', null, 2, 1, 1 ],])],
10251
+ resultLowerFns: [_lowerFlatOption([
10252
+ [ 'none', null, 2, 1, 1 ],
10253
+ [ 'some', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 2, 1, 1 ],
10254
+ ])
10255
+ ],
9716
10256
  funcTypeIsAsync: false,
9717
10257
  getCallbackFn: () => null,
9718
10258
  getPostReturnFn: () => null,
9719
10259
  isCancellable: false,
9720
10260
  memoryIdx: 0,
10261
+ stringEncoding: 'utf8',
9721
10262
  getMemoryFn: () => memory0,
9722
10263
  getReallocFn: () => null,
9723
10264
  importFn: _trampoline15,
@@ -9730,13 +10271,18 @@ null,
9730
10271
  componentIdx: 0,
9731
10272
  isAsync: false,
9732
10273
  isManualAsync: _trampoline16.manuallyAsync,
9733
- paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSize: 1 }),_liftFlatStringUTF8],
9734
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatRecord.bind(null, [['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],[ 'err', _lowerFlatEnum.bind(null, 0), 24, 8, 8 ],])],
10274
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny],
10275
+ resultLowerFns: [_lowerFlatResult([
10276
+ [ 'ok', _lowerFlatRecord([['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],
10277
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 24, 8, 8 ],
10278
+ ])
10279
+ ],
9735
10280
  funcTypeIsAsync: false,
9736
10281
  getCallbackFn: () => null,
9737
10282
  getPostReturnFn: () => null,
9738
10283
  isCancellable: false,
9739
10284
  memoryIdx: 0,
10285
+ stringEncoding: 'utf8',
9740
10286
  getMemoryFn: () => memory0,
9741
10287
  getReallocFn: () => null,
9742
10288
  importFn: _trampoline16,
@@ -9748,13 +10294,18 @@ null,
9748
10294
  componentIdx: 0,
9749
10295
  isAsync: false,
9750
10296
  isManualAsync: _trampoline16.manuallyAsync,
9751
- paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSize: 1 }),_liftFlatStringUTF8],
9752
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatRecord.bind(null, [['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],[ 'err', _lowerFlatEnum.bind(null, 0), 24, 8, 8 ],])],
10297
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny],
10298
+ resultLowerFns: [_lowerFlatResult([
10299
+ [ 'ok', _lowerFlatRecord([['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],
10300
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 24, 8, 8 ],
10301
+ ])
10302
+ ],
9753
10303
  funcTypeIsAsync: false,
9754
10304
  getCallbackFn: () => null,
9755
10305
  getPostReturnFn: () => null,
9756
10306
  isCancellable: false,
9757
10307
  memoryIdx: 0,
10308
+ stringEncoding: 'utf8',
9758
10309
  getMemoryFn: () => memory0,
9759
10310
  getReallocFn: () => null,
9760
10311
  importFn: _trampoline16,
@@ -9768,12 +10319,20 @@ null,
9768
10319
  isAsync: false,
9769
10320
  isManualAsync: _trampoline17.manuallyAsync,
9770
10321
  paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatU64],
9771
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 1), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10322
+ resultLowerFns: [_lowerFlatResult([
10323
+ [ 'ok', _lowerFlatOwn({
10324
+ componentIdx: 0,
10325
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10326
+ }), 8, 4, 4 ],
10327
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10328
+ ])
10329
+ ],
9772
10330
  funcTypeIsAsync: false,
9773
10331
  getCallbackFn: () => null,
9774
10332
  getPostReturnFn: () => null,
9775
10333
  isCancellable: false,
9776
10334
  memoryIdx: 0,
10335
+ stringEncoding: 'utf8',
9777
10336
  getMemoryFn: () => memory0,
9778
10337
  getReallocFn: () => null,
9779
10338
  importFn: _trampoline17,
@@ -9786,12 +10345,20 @@ null,
9786
10345
  isAsync: false,
9787
10346
  isManualAsync: _trampoline17.manuallyAsync,
9788
10347
  paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatU64],
9789
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 1), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10348
+ resultLowerFns: [_lowerFlatResult([
10349
+ [ 'ok', _lowerFlatOwn({
10350
+ componentIdx: 0,
10351
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10352
+ }), 8, 4, 4 ],
10353
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10354
+ ])
10355
+ ],
9790
10356
  funcTypeIsAsync: false,
9791
10357
  getCallbackFn: () => null,
9792
10358
  getPostReturnFn: () => null,
9793
10359
  isCancellable: false,
9794
10360
  memoryIdx: 0,
10361
+ stringEncoding: 'utf8',
9795
10362
  getMemoryFn: () => memory0,
9796
10363
  getReallocFn: () => null,
9797
10364
  importFn: _trampoline17,
@@ -9805,12 +10372,20 @@ null,
9805
10372
  isAsync: false,
9806
10373
  isManualAsync: _trampoline18.manuallyAsync,
9807
10374
  paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatU64],
9808
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 2), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10375
+ resultLowerFns: [_lowerFlatResult([
10376
+ [ 'ok', _lowerFlatOwn({
10377
+ componentIdx: 0,
10378
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10379
+ }), 8, 4, 4 ],
10380
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10381
+ ])
10382
+ ],
9809
10383
  funcTypeIsAsync: false,
9810
10384
  getCallbackFn: () => null,
9811
10385
  getPostReturnFn: () => null,
9812
10386
  isCancellable: false,
9813
10387
  memoryIdx: 0,
10388
+ stringEncoding: 'utf8',
9814
10389
  getMemoryFn: () => memory0,
9815
10390
  getReallocFn: () => null,
9816
10391
  importFn: _trampoline18,
@@ -9823,12 +10398,20 @@ null,
9823
10398
  isAsync: false,
9824
10399
  isManualAsync: _trampoline18.manuallyAsync,
9825
10400
  paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatU64],
9826
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 2), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10401
+ resultLowerFns: [_lowerFlatResult([
10402
+ [ 'ok', _lowerFlatOwn({
10403
+ componentIdx: 0,
10404
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10405
+ }), 8, 4, 4 ],
10406
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10407
+ ])
10408
+ ],
9827
10409
  funcTypeIsAsync: false,
9828
10410
  getCallbackFn: () => null,
9829
10411
  getPostReturnFn: () => null,
9830
10412
  isCancellable: false,
9831
10413
  memoryIdx: 0,
10414
+ stringEncoding: 'utf8',
9832
10415
  getMemoryFn: () => memory0,
9833
10416
  getReallocFn: () => null,
9834
10417
  importFn: _trampoline18,
@@ -9842,12 +10425,20 @@ null,
9842
10425
  isAsync: false,
9843
10426
  isManualAsync: _trampoline19.manuallyAsync,
9844
10427
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9845
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 2), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10428
+ resultLowerFns: [_lowerFlatResult([
10429
+ [ 'ok', _lowerFlatOwn({
10430
+ componentIdx: 0,
10431
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10432
+ }), 8, 4, 4 ],
10433
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10434
+ ])
10435
+ ],
9846
10436
  funcTypeIsAsync: false,
9847
10437
  getCallbackFn: () => null,
9848
10438
  getPostReturnFn: () => null,
9849
10439
  isCancellable: false,
9850
10440
  memoryIdx: 0,
10441
+ stringEncoding: 'utf8',
9851
10442
  getMemoryFn: () => memory0,
9852
10443
  getReallocFn: () => null,
9853
10444
  importFn: _trampoline19,
@@ -9860,12 +10451,20 @@ null,
9860
10451
  isAsync: false,
9861
10452
  isManualAsync: _trampoline19.manuallyAsync,
9862
10453
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9863
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 2), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10454
+ resultLowerFns: [_lowerFlatResult([
10455
+ [ 'ok', _lowerFlatOwn({
10456
+ componentIdx: 0,
10457
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10458
+ }), 8, 4, 4 ],
10459
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10460
+ ])
10461
+ ],
9864
10462
  funcTypeIsAsync: false,
9865
10463
  getCallbackFn: () => null,
9866
10464
  getPostReturnFn: () => null,
9867
10465
  isCancellable: false,
9868
10466
  memoryIdx: 0,
10467
+ stringEncoding: 'utf8',
9869
10468
  getMemoryFn: () => memory0,
9870
10469
  getReallocFn: () => null,
9871
10470
  importFn: _trampoline19,
@@ -9879,12 +10478,20 @@ null,
9879
10478
  isAsync: false,
9880
10479
  isManualAsync: _trampoline20.manuallyAsync,
9881
10480
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9882
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 5), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10481
+ resultLowerFns: [_lowerFlatResult([
10482
+ [ 'ok', _lowerFlatOwn({
10483
+ componentIdx: 0,
10484
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10485
+ }), 8, 4, 4 ],
10486
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10487
+ ])
10488
+ ],
9883
10489
  funcTypeIsAsync: false,
9884
10490
  getCallbackFn: () => null,
9885
10491
  getPostReturnFn: () => null,
9886
10492
  isCancellable: false,
9887
10493
  memoryIdx: 0,
10494
+ stringEncoding: 'utf8',
9888
10495
  getMemoryFn: () => memory0,
9889
10496
  getReallocFn: () => null,
9890
10497
  importFn: _trampoline20,
@@ -9897,12 +10504,20 @@ null,
9897
10504
  isAsync: false,
9898
10505
  isManualAsync: _trampoline20.manuallyAsync,
9899
10506
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9900
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 5), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10507
+ resultLowerFns: [_lowerFlatResult([
10508
+ [ 'ok', _lowerFlatOwn({
10509
+ componentIdx: 0,
10510
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10511
+ }), 8, 4, 4 ],
10512
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10513
+ ])
10514
+ ],
9901
10515
  funcTypeIsAsync: false,
9902
10516
  getCallbackFn: () => null,
9903
10517
  getPostReturnFn: () => null,
9904
10518
  isCancellable: false,
9905
10519
  memoryIdx: 0,
10520
+ stringEncoding: 'utf8',
9906
10521
  getMemoryFn: () => memory0,
9907
10522
  getReallocFn: () => null,
9908
10523
  importFn: _trampoline20,
@@ -9916,12 +10531,29 @@ null,
9916
10531
  isAsync: false,
9917
10532
  isManualAsync: _trampoline21.manuallyAsync,
9918
10533
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9919
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatRecord.bind(null, [['type', _lowerFlatEnum.bind(null, 1), 96, 8 ],['linkCount', _lowerFlatU64, 96, 8 ],['size', _lowerFlatU64, 96, 8 ],['dataAccessTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],]), 104, 8, 8 ],[ 'err', _lowerFlatEnum.bind(null, 0), 104, 8, 8 ],])],
10534
+ resultLowerFns: [_lowerFlatResult([
10535
+ [ 'ok', _lowerFlatRecord([['type', _lowerFlatEnum([['unknown', null, 1, 1, 1],['block-device', null, 1, 1, 1],['character-device', null, 1, 1, 1],['directory', null, 1, 1, 1],['fifo', null, 1, 1, 1],['symbolic-link', null, 1, 1, 1],['regular-file', null, 1, 1, 1],['socket', null, 1, 1, 1],]), 96, 8 ],['linkCount', _lowerFlatU64, 96, 8 ],['size', _lowerFlatU64, 96, 8 ],['dataAccessTimestamp', _lowerFlatOption([
10536
+ [ 'none', null, 24, 8, 8 ],
10537
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10538
+ ])
10539
+ , 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([
10540
+ [ 'none', null, 24, 8, 8 ],
10541
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10542
+ ])
10543
+ , 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([
10544
+ [ 'none', null, 24, 8, 8 ],
10545
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10546
+ ])
10547
+ , 96, 8 ],]), 104, 8, 8 ],
10548
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 104, 8, 8 ],
10549
+ ])
10550
+ ],
9920
10551
  funcTypeIsAsync: false,
9921
10552
  getCallbackFn: () => null,
9922
10553
  getPostReturnFn: () => null,
9923
10554
  isCancellable: false,
9924
10555
  memoryIdx: 0,
10556
+ stringEncoding: 'utf8',
9925
10557
  getMemoryFn: () => memory0,
9926
10558
  getReallocFn: () => null,
9927
10559
  importFn: _trampoline21,
@@ -9934,12 +10566,29 @@ null,
9934
10566
  isAsync: false,
9935
10567
  isManualAsync: _trampoline21.manuallyAsync,
9936
10568
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9937
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatRecord.bind(null, [['type', _lowerFlatEnum.bind(null, 1), 96, 8 ],['linkCount', _lowerFlatU64, 96, 8 ],['size', _lowerFlatU64, 96, 8 ],['dataAccessTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],]), 104, 8, 8 ],[ 'err', _lowerFlatEnum.bind(null, 0), 104, 8, 8 ],])],
10569
+ resultLowerFns: [_lowerFlatResult([
10570
+ [ 'ok', _lowerFlatRecord([['type', _lowerFlatEnum([['unknown', null, 1, 1, 1],['block-device', null, 1, 1, 1],['character-device', null, 1, 1, 1],['directory', null, 1, 1, 1],['fifo', null, 1, 1, 1],['symbolic-link', null, 1, 1, 1],['regular-file', null, 1, 1, 1],['socket', null, 1, 1, 1],]), 96, 8 ],['linkCount', _lowerFlatU64, 96, 8 ],['size', _lowerFlatU64, 96, 8 ],['dataAccessTimestamp', _lowerFlatOption([
10571
+ [ 'none', null, 24, 8, 8 ],
10572
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10573
+ ])
10574
+ , 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([
10575
+ [ 'none', null, 24, 8, 8 ],
10576
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10577
+ ])
10578
+ , 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([
10579
+ [ 'none', null, 24, 8, 8 ],
10580
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10581
+ ])
10582
+ , 96, 8 ],]), 104, 8, 8 ],
10583
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 104, 8, 8 ],
10584
+ ])
10585
+ ],
9938
10586
  funcTypeIsAsync: false,
9939
10587
  getCallbackFn: () => null,
9940
10588
  getPostReturnFn: () => null,
9941
10589
  isCancellable: false,
9942
10590
  memoryIdx: 0,
10591
+ stringEncoding: 'utf8',
9943
10592
  getMemoryFn: () => memory0,
9944
10593
  getReallocFn: () => null,
9945
10594
  importFn: _trampoline21,
@@ -9952,13 +10601,30 @@ null,
9952
10601
  componentIdx: 0,
9953
10602
  isAsync: false,
9954
10603
  isManualAsync: _trampoline22.manuallyAsync,
9955
- paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSize: 1 }),_liftFlatStringUTF8],
9956
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatRecord.bind(null, [['type', _lowerFlatEnum.bind(null, 1), 96, 8 ],['linkCount', _lowerFlatU64, 96, 8 ],['size', _lowerFlatU64, 96, 8 ],['dataAccessTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],]), 104, 8, 8 ],[ 'err', _lowerFlatEnum.bind(null, 0), 104, 8, 8 ],])],
10604
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny],
10605
+ resultLowerFns: [_lowerFlatResult([
10606
+ [ 'ok', _lowerFlatRecord([['type', _lowerFlatEnum([['unknown', null, 1, 1, 1],['block-device', null, 1, 1, 1],['character-device', null, 1, 1, 1],['directory', null, 1, 1, 1],['fifo', null, 1, 1, 1],['symbolic-link', null, 1, 1, 1],['regular-file', null, 1, 1, 1],['socket', null, 1, 1, 1],]), 96, 8 ],['linkCount', _lowerFlatU64, 96, 8 ],['size', _lowerFlatU64, 96, 8 ],['dataAccessTimestamp', _lowerFlatOption([
10607
+ [ 'none', null, 24, 8, 8 ],
10608
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10609
+ ])
10610
+ , 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([
10611
+ [ 'none', null, 24, 8, 8 ],
10612
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10613
+ ])
10614
+ , 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([
10615
+ [ 'none', null, 24, 8, 8 ],
10616
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10617
+ ])
10618
+ , 96, 8 ],]), 104, 8, 8 ],
10619
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 104, 8, 8 ],
10620
+ ])
10621
+ ],
9957
10622
  funcTypeIsAsync: false,
9958
10623
  getCallbackFn: () => null,
9959
10624
  getPostReturnFn: () => null,
9960
10625
  isCancellable: false,
9961
10626
  memoryIdx: 0,
10627
+ stringEncoding: 'utf8',
9962
10628
  getMemoryFn: () => memory0,
9963
10629
  getReallocFn: () => null,
9964
10630
  importFn: _trampoline22,
@@ -9970,13 +10636,30 @@ null,
9970
10636
  componentIdx: 0,
9971
10637
  isAsync: false,
9972
10638
  isManualAsync: _trampoline22.manuallyAsync,
9973
- paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSize: 1 }),_liftFlatStringUTF8],
9974
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatRecord.bind(null, [['type', _lowerFlatEnum.bind(null, 1), 96, 8 ],['linkCount', _lowerFlatU64, 96, 8 ],['size', _lowerFlatU64, 96, 8 ],['dataAccessTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],]), 104, 8, 8 ],[ 'err', _lowerFlatEnum.bind(null, 0), 104, 8, 8 ],])],
10639
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny],
10640
+ resultLowerFns: [_lowerFlatResult([
10641
+ [ 'ok', _lowerFlatRecord([['type', _lowerFlatEnum([['unknown', null, 1, 1, 1],['block-device', null, 1, 1, 1],['character-device', null, 1, 1, 1],['directory', null, 1, 1, 1],['fifo', null, 1, 1, 1],['symbolic-link', null, 1, 1, 1],['regular-file', null, 1, 1, 1],['socket', null, 1, 1, 1],]), 96, 8 ],['linkCount', _lowerFlatU64, 96, 8 ],['size', _lowerFlatU64, 96, 8 ],['dataAccessTimestamp', _lowerFlatOption([
10642
+ [ 'none', null, 24, 8, 8 ],
10643
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10644
+ ])
10645
+ , 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([
10646
+ [ 'none', null, 24, 8, 8 ],
10647
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10648
+ ])
10649
+ , 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([
10650
+ [ 'none', null, 24, 8, 8 ],
10651
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10652
+ ])
10653
+ , 96, 8 ],]), 104, 8, 8 ],
10654
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 104, 8, 8 ],
10655
+ ])
10656
+ ],
9975
10657
  funcTypeIsAsync: false,
9976
10658
  getCallbackFn: () => null,
9977
10659
  getPostReturnFn: () => null,
9978
10660
  isCancellable: false,
9979
10661
  memoryIdx: 0,
10662
+ stringEncoding: 'utf8',
9980
10663
  getMemoryFn: () => memory0,
9981
10664
  getReallocFn: () => null,
9982
10665
  importFn: _trampoline22,
@@ -9989,13 +10672,21 @@ null,
9989
10672
  componentIdx: 0,
9990
10673
  isAsync: false,
9991
10674
  isManualAsync: _trampoline23.manuallyAsync,
9992
- paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSize: 1 }),_liftFlatStringUTF8,_liftFlatFlags({ names: ['create','directory','exclusive','truncate'], size32: 1, align32: 1, intSize: 1 }),_liftFlatFlags({ names: ['read','write','file-integrity-sync','data-integrity-sync','requested-write-sync','mutate-directory'], size32: 1, align32: 1, intSize: 1 })],
9993
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 6), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10675
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny,_liftFlatFlags({ names: ['create','directory','exclusive','truncate'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatFlags({ names: ['read','write','file-integrity-sync','data-integrity-sync','requested-write-sync','mutate-directory'], size32: 1, align32: 1, intSizeBytes: 1 })],
10676
+ resultLowerFns: [_lowerFlatResult([
10677
+ [ 'ok', _lowerFlatOwn({
10678
+ componentIdx: 0,
10679
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10680
+ }), 8, 4, 4 ],
10681
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10682
+ ])
10683
+ ],
9994
10684
  funcTypeIsAsync: false,
9995
10685
  getCallbackFn: () => null,
9996
10686
  getPostReturnFn: () => null,
9997
10687
  isCancellable: false,
9998
10688
  memoryIdx: 0,
10689
+ stringEncoding: 'utf8',
9999
10690
  getMemoryFn: () => memory0,
10000
10691
  getReallocFn: () => null,
10001
10692
  importFn: _trampoline23,
@@ -10007,13 +10698,21 @@ null,
10007
10698
  componentIdx: 0,
10008
10699
  isAsync: false,
10009
10700
  isManualAsync: _trampoline23.manuallyAsync,
10010
- paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSize: 1 }),_liftFlatStringUTF8,_liftFlatFlags({ names: ['create','directory','exclusive','truncate'], size32: 1, align32: 1, intSize: 1 }),_liftFlatFlags({ names: ['read','write','file-integrity-sync','data-integrity-sync','requested-write-sync','mutate-directory'], size32: 1, align32: 1, intSize: 1 })],
10011
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 6), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10701
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny,_liftFlatFlags({ names: ['create','directory','exclusive','truncate'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatFlags({ names: ['read','write','file-integrity-sync','data-integrity-sync','requested-write-sync','mutate-directory'], size32: 1, align32: 1, intSizeBytes: 1 })],
10702
+ resultLowerFns: [_lowerFlatResult([
10703
+ [ 'ok', _lowerFlatOwn({
10704
+ componentIdx: 0,
10705
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10706
+ }), 8, 4, 4 ],
10707
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10708
+ ])
10709
+ ],
10012
10710
  funcTypeIsAsync: false,
10013
10711
  getCallbackFn: () => null,
10014
10712
  getPostReturnFn: () => null,
10015
10713
  isCancellable: false,
10016
10714
  memoryIdx: 0,
10715
+ stringEncoding: 'utf8',
10017
10716
  getMemoryFn: () => memory0,
10018
10717
  getReallocFn: () => null,
10019
10718
  importFn: _trampoline23,
@@ -10027,12 +10726,21 @@ null,
10027
10726
  isAsync: false,
10028
10727
  isManualAsync: _trampoline24.manuallyAsync,
10029
10728
  paramLiftFns: [_liftFlatBorrow.bind(null, 5)],
10030
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['type', _lowerFlatEnum.bind(null, 1), 12, 4 ],['name', _lowerFlatStringUTF8, 12, 4 ],]), 16, 4, 4 ],[ 'none', null, 16, 4, 4 ],]), 20, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 20, 4, 4 ],])],
10729
+ resultLowerFns: [_lowerFlatResult([
10730
+ [ 'ok', _lowerFlatOption([
10731
+ [ 'none', null, 16, 4, 4 ],
10732
+ [ 'some', _lowerFlatRecord([['type', _lowerFlatEnum([['unknown', null, 1, 1, 1],['block-device', null, 1, 1, 1],['character-device', null, 1, 1, 1],['directory', null, 1, 1, 1],['fifo', null, 1, 1, 1],['symbolic-link', null, 1, 1, 1],['regular-file', null, 1, 1, 1],['socket', null, 1, 1, 1],]), 12, 4 ],['name', _lowerFlatStringAny, 12, 4 ],]), 16, 4, 4 ],
10733
+ ])
10734
+ , 20, 4, 4 ],
10735
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 20, 4, 4 ],
10736
+ ])
10737
+ ],
10031
10738
  funcTypeIsAsync: false,
10032
10739
  getCallbackFn: () => null,
10033
10740
  getPostReturnFn: () => null,
10034
10741
  isCancellable: false,
10035
10742
  memoryIdx: 0,
10743
+ stringEncoding: 'utf8',
10036
10744
  getMemoryFn: () => memory0,
10037
10745
  getReallocFn: () => realloc0,
10038
10746
  importFn: _trampoline24,
@@ -10045,12 +10753,21 @@ null,
10045
10753
  isAsync: false,
10046
10754
  isManualAsync: _trampoline24.manuallyAsync,
10047
10755
  paramLiftFns: [_liftFlatBorrow.bind(null, 5)],
10048
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['type', _lowerFlatEnum.bind(null, 1), 12, 4 ],['name', _lowerFlatStringUTF8, 12, 4 ],]), 16, 4, 4 ],[ 'none', null, 16, 4, 4 ],]), 20, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 20, 4, 4 ],])],
10756
+ resultLowerFns: [_lowerFlatResult([
10757
+ [ 'ok', _lowerFlatOption([
10758
+ [ 'none', null, 16, 4, 4 ],
10759
+ [ 'some', _lowerFlatRecord([['type', _lowerFlatEnum([['unknown', null, 1, 1, 1],['block-device', null, 1, 1, 1],['character-device', null, 1, 1, 1],['directory', null, 1, 1, 1],['fifo', null, 1, 1, 1],['symbolic-link', null, 1, 1, 1],['regular-file', null, 1, 1, 1],['socket', null, 1, 1, 1],]), 12, 4 ],['name', _lowerFlatStringAny, 12, 4 ],]), 16, 4, 4 ],
10760
+ ])
10761
+ , 20, 4, 4 ],
10762
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 20, 4, 4 ],
10763
+ ])
10764
+ ],
10049
10765
  funcTypeIsAsync: false,
10050
10766
  getCallbackFn: () => null,
10051
10767
  getPostReturnFn: () => null,
10052
10768
  isCancellable: false,
10053
10769
  memoryIdx: 0,
10770
+ stringEncoding: 'utf8',
10054
10771
  getMemoryFn: () => memory0,
10055
10772
  getReallocFn: () => realloc0,
10056
10773
  importFn: _trampoline24,
@@ -10064,12 +10781,24 @@ null,
10064
10781
  isAsync: false,
10065
10782
  isManualAsync: _trampoline25.manuallyAsync,
10066
10783
  paramLiftFns: [_liftFlatBorrow.bind(null, 1),_liftFlatU64],
10067
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatList({ elemLowerFn: _lowerFlatU8, typeIdx: 1 }), 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
10784
+ resultLowerFns: [_lowerFlatResult([
10785
+ [ 'ok', _lowerFlatList({
10786
+ elemLowerFn: _lowerFlatU8,
10787
+ elemSize32: 1,
10788
+ elemAlign32: 1,
10789
+ }), 12, 4, 4 ],
10790
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
10791
+ componentIdx: 0,
10792
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10793
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
10794
+ ])
10795
+ ],
10068
10796
  funcTypeIsAsync: false,
10069
10797
  getCallbackFn: () => null,
10070
10798
  getPostReturnFn: () => null,
10071
10799
  isCancellable: false,
10072
10800
  memoryIdx: 0,
10801
+ stringEncoding: 'utf8',
10073
10802
  getMemoryFn: () => memory0,
10074
10803
  getReallocFn: () => realloc0,
10075
10804
  importFn: _trampoline25,
@@ -10082,12 +10811,24 @@ null,
10082
10811
  isAsync: false,
10083
10812
  isManualAsync: _trampoline25.manuallyAsync,
10084
10813
  paramLiftFns: [_liftFlatBorrow.bind(null, 1),_liftFlatU64],
10085
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatList({ elemLowerFn: _lowerFlatU8, typeIdx: 1 }), 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
10814
+ resultLowerFns: [_lowerFlatResult([
10815
+ [ 'ok', _lowerFlatList({
10816
+ elemLowerFn: _lowerFlatU8,
10817
+ elemSize32: 1,
10818
+ elemAlign32: 1,
10819
+ }), 12, 4, 4 ],
10820
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
10821
+ componentIdx: 0,
10822
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10823
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
10824
+ ])
10825
+ ],
10086
10826
  funcTypeIsAsync: false,
10087
10827
  getCallbackFn: () => null,
10088
10828
  getPostReturnFn: () => null,
10089
10829
  isCancellable: false,
10090
10830
  memoryIdx: 0,
10831
+ stringEncoding: 'utf8',
10091
10832
  getMemoryFn: () => memory0,
10092
10833
  getReallocFn: () => realloc0,
10093
10834
  importFn: _trampoline25,
@@ -10101,12 +10842,24 @@ null,
10101
10842
  isAsync: false,
10102
10843
  isManualAsync: _trampoline26.manuallyAsync,
10103
10844
  paramLiftFns: [_liftFlatBorrow.bind(null, 1),_liftFlatU64],
10104
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatList({ elemLowerFn: _lowerFlatU8, typeIdx: 1 }), 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
10845
+ resultLowerFns: [_lowerFlatResult([
10846
+ [ 'ok', _lowerFlatList({
10847
+ elemLowerFn: _lowerFlatU8,
10848
+ elemSize32: 1,
10849
+ elemAlign32: 1,
10850
+ }), 12, 4, 4 ],
10851
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
10852
+ componentIdx: 0,
10853
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10854
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
10855
+ ])
10856
+ ],
10105
10857
  funcTypeIsAsync: false,
10106
10858
  getCallbackFn: () => null,
10107
10859
  getPostReturnFn: () => null,
10108
10860
  isCancellable: false,
10109
10861
  memoryIdx: 0,
10862
+ stringEncoding: 'utf8',
10110
10863
  getMemoryFn: () => memory0,
10111
10864
  getReallocFn: () => realloc0,
10112
10865
  importFn: _trampoline26,
@@ -10119,12 +10872,24 @@ null,
10119
10872
  isAsync: false,
10120
10873
  isManualAsync: _trampoline26.manuallyAsync,
10121
10874
  paramLiftFns: [_liftFlatBorrow.bind(null, 1),_liftFlatU64],
10122
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatList({ elemLowerFn: _lowerFlatU8, typeIdx: 1 }), 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
10875
+ resultLowerFns: [_lowerFlatResult([
10876
+ [ 'ok', _lowerFlatList({
10877
+ elemLowerFn: _lowerFlatU8,
10878
+ elemSize32: 1,
10879
+ elemAlign32: 1,
10880
+ }), 12, 4, 4 ],
10881
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
10882
+ componentIdx: 0,
10883
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10884
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
10885
+ ])
10886
+ ],
10123
10887
  funcTypeIsAsync: false,
10124
10888
  getCallbackFn: () => null,
10125
10889
  getPostReturnFn: () => null,
10126
10890
  isCancellable: false,
10127
10891
  memoryIdx: 0,
10892
+ stringEncoding: 'utf8',
10128
10893
  getMemoryFn: () => memory0,
10129
10894
  getReallocFn: () => realloc0,
10130
10895
  importFn: _trampoline26,
@@ -10138,12 +10903,20 @@ null,
10138
10903
  isAsync: false,
10139
10904
  isManualAsync: _trampoline27.manuallyAsync,
10140
10905
  paramLiftFns: [_liftFlatBorrow.bind(null, 2)],
10141
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatU64, 16, 8, 8 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 16, 8, 8 ],])],
10906
+ resultLowerFns: [_lowerFlatResult([
10907
+ [ 'ok', _lowerFlatU64, 16, 8, 8 ],
10908
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
10909
+ componentIdx: 0,
10910
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10911
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 16, 8, 8 ],
10912
+ ])
10913
+ ],
10142
10914
  funcTypeIsAsync: false,
10143
10915
  getCallbackFn: () => null,
10144
10916
  getPostReturnFn: () => null,
10145
10917
  isCancellable: false,
10146
10918
  memoryIdx: 0,
10919
+ stringEncoding: 'utf8',
10147
10920
  getMemoryFn: () => memory0,
10148
10921
  getReallocFn: () => null,
10149
10922
  importFn: _trampoline27,
@@ -10156,12 +10929,20 @@ null,
10156
10929
  isAsync: false,
10157
10930
  isManualAsync: _trampoline27.manuallyAsync,
10158
10931
  paramLiftFns: [_liftFlatBorrow.bind(null, 2)],
10159
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatU64, 16, 8, 8 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 16, 8, 8 ],])],
10932
+ resultLowerFns: [_lowerFlatResult([
10933
+ [ 'ok', _lowerFlatU64, 16, 8, 8 ],
10934
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
10935
+ componentIdx: 0,
10936
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10937
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 16, 8, 8 ],
10938
+ ])
10939
+ ],
10160
10940
  funcTypeIsAsync: false,
10161
10941
  getCallbackFn: () => null,
10162
10942
  getPostReturnFn: () => null,
10163
10943
  isCancellable: false,
10164
10944
  memoryIdx: 0,
10945
+ stringEncoding: 'utf8',
10165
10946
  getMemoryFn: () => memory0,
10166
10947
  getReallocFn: () => null,
10167
10948
  importFn: _trampoline27,
@@ -10174,13 +10955,25 @@ null,
10174
10955
  componentIdx: 0,
10175
10956
  isAsync: false,
10176
10957
  isManualAsync: _trampoline28.manuallyAsync,
10177
- paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({ elemLiftFn: _liftFlatU8, align32: 1, size32: 1 })],
10178
- resultLowerFns: [_lowerFlatResult([[ 'ok', null, 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
10958
+ paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({
10959
+ elemLiftFn: _liftFlatU8,
10960
+ elemAlign32: 1,
10961
+ elemSize32: 1,
10962
+ })],
10963
+ resultLowerFns: [_lowerFlatResult([
10964
+ [ 'ok', null, 12, 4, 4 ],
10965
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
10966
+ componentIdx: 0,
10967
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10968
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
10969
+ ])
10970
+ ],
10179
10971
  funcTypeIsAsync: false,
10180
10972
  getCallbackFn: () => null,
10181
10973
  getPostReturnFn: () => null,
10182
10974
  isCancellable: false,
10183
10975
  memoryIdx: 0,
10976
+ stringEncoding: 'utf8',
10184
10977
  getMemoryFn: () => memory0,
10185
10978
  getReallocFn: () => null,
10186
10979
  importFn: _trampoline28,
@@ -10192,13 +10985,25 @@ null,
10192
10985
  componentIdx: 0,
10193
10986
  isAsync: false,
10194
10987
  isManualAsync: _trampoline28.manuallyAsync,
10195
- paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({ elemLiftFn: _liftFlatU8, align32: 1, size32: 1 })],
10196
- resultLowerFns: [_lowerFlatResult([[ 'ok', null, 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
10988
+ paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({
10989
+ elemLiftFn: _liftFlatU8,
10990
+ elemAlign32: 1,
10991
+ elemSize32: 1,
10992
+ })],
10993
+ resultLowerFns: [_lowerFlatResult([
10994
+ [ 'ok', null, 12, 4, 4 ],
10995
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
10996
+ componentIdx: 0,
10997
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10998
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
10999
+ ])
11000
+ ],
10197
11001
  funcTypeIsAsync: false,
10198
11002
  getCallbackFn: () => null,
10199
11003
  getPostReturnFn: () => null,
10200
11004
  isCancellable: false,
10201
11005
  memoryIdx: 0,
11006
+ stringEncoding: 'utf8',
10202
11007
  getMemoryFn: () => memory0,
10203
11008
  getReallocFn: () => null,
10204
11009
  importFn: _trampoline28,
@@ -10211,13 +11016,25 @@ null,
10211
11016
  componentIdx: 0,
10212
11017
  isAsync: false,
10213
11018
  isManualAsync: _trampoline29.manuallyAsync,
10214
- paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({ elemLiftFn: _liftFlatU8, align32: 1, size32: 1 })],
10215
- resultLowerFns: [_lowerFlatResult([[ 'ok', null, 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
11019
+ paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({
11020
+ elemLiftFn: _liftFlatU8,
11021
+ elemAlign32: 1,
11022
+ elemSize32: 1,
11023
+ })],
11024
+ resultLowerFns: [_lowerFlatResult([
11025
+ [ 'ok', null, 12, 4, 4 ],
11026
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11027
+ componentIdx: 0,
11028
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11029
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11030
+ ])
11031
+ ],
10216
11032
  funcTypeIsAsync: false,
10217
11033
  getCallbackFn: () => null,
10218
11034
  getPostReturnFn: () => null,
10219
11035
  isCancellable: false,
10220
11036
  memoryIdx: 0,
11037
+ stringEncoding: 'utf8',
10221
11038
  getMemoryFn: () => memory0,
10222
11039
  getReallocFn: () => null,
10223
11040
  importFn: _trampoline29,
@@ -10229,13 +11046,25 @@ null,
10229
11046
  componentIdx: 0,
10230
11047
  isAsync: false,
10231
11048
  isManualAsync: _trampoline29.manuallyAsync,
10232
- paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({ elemLiftFn: _liftFlatU8, align32: 1, size32: 1 })],
10233
- resultLowerFns: [_lowerFlatResult([[ 'ok', null, 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
11049
+ paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({
11050
+ elemLiftFn: _liftFlatU8,
11051
+ elemAlign32: 1,
11052
+ elemSize32: 1,
11053
+ })],
11054
+ resultLowerFns: [_lowerFlatResult([
11055
+ [ 'ok', null, 12, 4, 4 ],
11056
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11057
+ componentIdx: 0,
11058
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11059
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11060
+ ])
11061
+ ],
10234
11062
  funcTypeIsAsync: false,
10235
11063
  getCallbackFn: () => null,
10236
11064
  getPostReturnFn: () => null,
10237
11065
  isCancellable: false,
10238
11066
  memoryIdx: 0,
11067
+ stringEncoding: 'utf8',
10239
11068
  getMemoryFn: () => memory0,
10240
11069
  getReallocFn: () => null,
10241
11070
  importFn: _trampoline29,
@@ -10249,12 +11078,20 @@ null,
10249
11078
  isAsync: false,
10250
11079
  isManualAsync: _trampoline30.manuallyAsync,
10251
11080
  paramLiftFns: [_liftFlatBorrow.bind(null, 2)],
10252
- resultLowerFns: [_lowerFlatResult([[ 'ok', null, 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
11081
+ resultLowerFns: [_lowerFlatResult([
11082
+ [ 'ok', null, 12, 4, 4 ],
11083
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11084
+ componentIdx: 0,
11085
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11086
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11087
+ ])
11088
+ ],
10253
11089
  funcTypeIsAsync: false,
10254
11090
  getCallbackFn: () => null,
10255
11091
  getPostReturnFn: () => null,
10256
11092
  isCancellable: false,
10257
11093
  memoryIdx: 0,
11094
+ stringEncoding: 'utf8',
10258
11095
  getMemoryFn: () => memory0,
10259
11096
  getReallocFn: () => null,
10260
11097
  importFn: _trampoline30,
@@ -10267,12 +11104,20 @@ null,
10267
11104
  isAsync: false,
10268
11105
  isManualAsync: _trampoline30.manuallyAsync,
10269
11106
  paramLiftFns: [_liftFlatBorrow.bind(null, 2)],
10270
- resultLowerFns: [_lowerFlatResult([[ 'ok', null, 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
11107
+ resultLowerFns: [_lowerFlatResult([
11108
+ [ 'ok', null, 12, 4, 4 ],
11109
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11110
+ componentIdx: 0,
11111
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11112
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11113
+ ])
11114
+ ],
10271
11115
  funcTypeIsAsync: false,
10272
11116
  getCallbackFn: () => null,
10273
11117
  getPostReturnFn: () => null,
10274
11118
  isCancellable: false,
10275
11119
  memoryIdx: 0,
11120
+ stringEncoding: 'utf8',
10276
11121
  getMemoryFn: () => memory0,
10277
11122
  getReallocFn: () => null,
10278
11123
  importFn: _trampoline30,
@@ -10286,12 +11131,17 @@ null,
10286
11131
  isAsync: false,
10287
11132
  isManualAsync: _trampoline31.manuallyAsync,
10288
11133
  paramLiftFns: [_liftFlatU64],
10289
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatU8, typeIdx: 1 })],
11134
+ resultLowerFns: [_lowerFlatList({
11135
+ elemLowerFn: _lowerFlatU8,
11136
+ elemSize32: 1,
11137
+ elemAlign32: 1,
11138
+ })],
10290
11139
  funcTypeIsAsync: false,
10291
11140
  getCallbackFn: () => null,
10292
11141
  getPostReturnFn: () => null,
10293
11142
  isCancellable: false,
10294
11143
  memoryIdx: 0,
11144
+ stringEncoding: 'utf8',
10295
11145
  getMemoryFn: () => memory0,
10296
11146
  getReallocFn: () => realloc0,
10297
11147
  importFn: _trampoline31,
@@ -10304,12 +11154,17 @@ null,
10304
11154
  isAsync: false,
10305
11155
  isManualAsync: _trampoline31.manuallyAsync,
10306
11156
  paramLiftFns: [_liftFlatU64],
10307
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatU8, typeIdx: 1 })],
11157
+ resultLowerFns: [_lowerFlatList({
11158
+ elemLowerFn: _lowerFlatU8,
11159
+ elemSize32: 1,
11160
+ elemAlign32: 1,
11161
+ })],
10308
11162
  funcTypeIsAsync: false,
10309
11163
  getCallbackFn: () => null,
10310
11164
  getPostReturnFn: () => null,
10311
11165
  isCancellable: false,
10312
11166
  memoryIdx: 0,
11167
+ stringEncoding: 'utf8',
10313
11168
  getMemoryFn: () => memory0,
10314
11169
  getReallocFn: () => realloc0,
10315
11170
  importFn: _trampoline31,
@@ -10323,12 +11178,20 @@ null,
10323
11178
  isAsync: false,
10324
11179
  isManualAsync: _trampoline32.manuallyAsync,
10325
11180
  paramLiftFns: [],
10326
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatTuple.bind(null, 30), typeIdx: 2 })],
11181
+ resultLowerFns: [_lowerFlatList({
11182
+ elemLowerFn: _lowerFlatTuple([[_lowerFlatOwn({
11183
+ componentIdx: 0,
11184
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11185
+ }), 12, 4],[_lowerFlatStringAny, 12, 4],]),
11186
+ elemSize32: 12,
11187
+ elemAlign32: 4,
11188
+ })],
10327
11189
  funcTypeIsAsync: false,
10328
11190
  getCallbackFn: () => null,
10329
11191
  getPostReturnFn: () => null,
10330
11192
  isCancellable: false,
10331
11193
  memoryIdx: 0,
11194
+ stringEncoding: 'utf8',
10332
11195
  getMemoryFn: () => memory0,
10333
11196
  getReallocFn: () => realloc0,
10334
11197
  importFn: _trampoline32,
@@ -10341,12 +11204,20 @@ null,
10341
11204
  isAsync: false,
10342
11205
  isManualAsync: _trampoline32.manuallyAsync,
10343
11206
  paramLiftFns: [],
10344
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatTuple.bind(null, 30), typeIdx: 2 })],
11207
+ resultLowerFns: [_lowerFlatList({
11208
+ elemLowerFn: _lowerFlatTuple([[_lowerFlatOwn({
11209
+ componentIdx: 0,
11210
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11211
+ }), 12, 4],[_lowerFlatStringAny, 12, 4],]),
11212
+ elemSize32: 12,
11213
+ elemAlign32: 4,
11214
+ })],
10345
11215
  funcTypeIsAsync: false,
10346
11216
  getCallbackFn: () => null,
10347
11217
  getPostReturnFn: () => null,
10348
11218
  isCancellable: false,
10349
11219
  memoryIdx: 0,
11220
+ stringEncoding: 'utf8',
10350
11221
  getMemoryFn: () => memory0,
10351
11222
  getReallocFn: () => realloc0,
10352
11223
  importFn: _trampoline32,
@@ -10360,12 +11231,20 @@ null,
10360
11231
  isAsync: false,
10361
11232
  isManualAsync: _trampoline33.manuallyAsync,
10362
11233
  paramLiftFns: [],
10363
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 3), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11234
+ resultLowerFns: [_lowerFlatOption([
11235
+ [ 'none', null, 8, 4, 4 ],
11236
+ [ 'some', _lowerFlatOwn({
11237
+ componentIdx: 0,
11238
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11239
+ }), 8, 4, 4 ],
11240
+ ])
11241
+ ],
10364
11242
  funcTypeIsAsync: false,
10365
11243
  getCallbackFn: () => null,
10366
11244
  getPostReturnFn: () => null,
10367
11245
  isCancellable: false,
10368
11246
  memoryIdx: 0,
11247
+ stringEncoding: 'utf8',
10369
11248
  getMemoryFn: () => memory0,
10370
11249
  getReallocFn: () => null,
10371
11250
  importFn: _trampoline33,
@@ -10378,12 +11257,20 @@ null,
10378
11257
  isAsync: false,
10379
11258
  isManualAsync: _trampoline33.manuallyAsync,
10380
11259
  paramLiftFns: [],
10381
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 3), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11260
+ resultLowerFns: [_lowerFlatOption([
11261
+ [ 'none', null, 8, 4, 4 ],
11262
+ [ 'some', _lowerFlatOwn({
11263
+ componentIdx: 0,
11264
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11265
+ }), 8, 4, 4 ],
11266
+ ])
11267
+ ],
10382
11268
  funcTypeIsAsync: false,
10383
11269
  getCallbackFn: () => null,
10384
11270
  getPostReturnFn: () => null,
10385
11271
  isCancellable: false,
10386
11272
  memoryIdx: 0,
11273
+ stringEncoding: 'utf8',
10387
11274
  getMemoryFn: () => memory0,
10388
11275
  getReallocFn: () => null,
10389
11276
  importFn: _trampoline33,
@@ -10397,12 +11284,20 @@ null,
10397
11284
  isAsync: false,
10398
11285
  isManualAsync: _trampoline34.manuallyAsync,
10399
11286
  paramLiftFns: [],
10400
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 4), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11287
+ resultLowerFns: [_lowerFlatOption([
11288
+ [ 'none', null, 8, 4, 4 ],
11289
+ [ 'some', _lowerFlatOwn({
11290
+ componentIdx: 0,
11291
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11292
+ }), 8, 4, 4 ],
11293
+ ])
11294
+ ],
10401
11295
  funcTypeIsAsync: false,
10402
11296
  getCallbackFn: () => null,
10403
11297
  getPostReturnFn: () => null,
10404
11298
  isCancellable: false,
10405
11299
  memoryIdx: 0,
11300
+ stringEncoding: 'utf8',
10406
11301
  getMemoryFn: () => memory0,
10407
11302
  getReallocFn: () => null,
10408
11303
  importFn: _trampoline34,
@@ -10415,12 +11310,20 @@ null,
10415
11310
  isAsync: false,
10416
11311
  isManualAsync: _trampoline34.manuallyAsync,
10417
11312
  paramLiftFns: [],
10418
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 4), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11313
+ resultLowerFns: [_lowerFlatOption([
11314
+ [ 'none', null, 8, 4, 4 ],
11315
+ [ 'some', _lowerFlatOwn({
11316
+ componentIdx: 0,
11317
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11318
+ }), 8, 4, 4 ],
11319
+ ])
11320
+ ],
10419
11321
  funcTypeIsAsync: false,
10420
11322
  getCallbackFn: () => null,
10421
11323
  getPostReturnFn: () => null,
10422
11324
  isCancellable: false,
10423
11325
  memoryIdx: 0,
11326
+ stringEncoding: 'utf8',
10424
11327
  getMemoryFn: () => memory0,
10425
11328
  getReallocFn: () => null,
10426
11329
  importFn: _trampoline34,
@@ -10434,12 +11337,20 @@ null,
10434
11337
  isAsync: false,
10435
11338
  isManualAsync: _trampoline35.manuallyAsync,
10436
11339
  paramLiftFns: [],
10437
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 4), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11340
+ resultLowerFns: [_lowerFlatOption([
11341
+ [ 'none', null, 8, 4, 4 ],
11342
+ [ 'some', _lowerFlatOwn({
11343
+ componentIdx: 0,
11344
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11345
+ }), 8, 4, 4 ],
11346
+ ])
11347
+ ],
10438
11348
  funcTypeIsAsync: false,
10439
11349
  getCallbackFn: () => null,
10440
11350
  getPostReturnFn: () => null,
10441
11351
  isCancellable: false,
10442
11352
  memoryIdx: 0,
11353
+ stringEncoding: 'utf8',
10443
11354
  getMemoryFn: () => memory0,
10444
11355
  getReallocFn: () => null,
10445
11356
  importFn: _trampoline35,
@@ -10452,12 +11363,20 @@ null,
10452
11363
  isAsync: false,
10453
11364
  isManualAsync: _trampoline35.manuallyAsync,
10454
11365
  paramLiftFns: [],
10455
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 4), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11366
+ resultLowerFns: [_lowerFlatOption([
11367
+ [ 'none', null, 8, 4, 4 ],
11368
+ [ 'some', _lowerFlatOwn({
11369
+ componentIdx: 0,
11370
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11371
+ }), 8, 4, 4 ],
11372
+ ])
11373
+ ],
10456
11374
  funcTypeIsAsync: false,
10457
11375
  getCallbackFn: () => null,
10458
11376
  getPostReturnFn: () => null,
10459
11377
  isCancellable: false,
10460
11378
  memoryIdx: 0,
11379
+ stringEncoding: 'utf8',
10461
11380
  getMemoryFn: () => memory0,
10462
11381
  getReallocFn: () => null,
10463
11382
  importFn: _trampoline35,