@vercel/python-analysis 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -789,48 +789,25 @@ if (!getCoreModule) getCoreModule = (name) => fetchCompile(new URL(`./${name}`,
789
789
  const module0 = getCoreModule('vercel_python_analysis.core.wasm');
790
790
  const module1 = getCoreModule('vercel_python_analysis.core2.wasm');
791
791
  const module2 = getCoreModule('vercel_python_analysis.core3.wasm');
792
- const module3 = getCoreModule('vercel_python_analysis.core4.wasm');
793
792
 
794
793
  const { getEnvironment } = imports['wasi:cli/environment'];
795
794
  const { exit } = imports['wasi:cli/exit'];
796
795
  const { getStderr } = imports['wasi:cli/stderr'];
796
+ const { getStdin } = imports['wasi:cli/stdin'];
797
+ const { getStdout } = imports['wasi:cli/stdout'];
798
+ const { TerminalInput } = imports['wasi:cli/terminal-input'];
799
+ const { TerminalOutput } = imports['wasi:cli/terminal-output'];
800
+ const { getTerminalStderr } = imports['wasi:cli/terminal-stderr'];
801
+ const { getTerminalStdin } = imports['wasi:cli/terminal-stdin'];
802
+ const { getTerminalStdout } = imports['wasi:cli/terminal-stdout'];
797
803
  const { Error: Error$1 } = imports['wasi:io/error'];
798
- const { OutputStream } = imports['wasi:io/streams'];
804
+ const { Pollable } = imports['wasi:io/poll'];
805
+ const { InputStream, OutputStream } = imports['wasi:io/streams'];
799
806
  const { insecureSeed } = imports['wasi:random/insecure-seed'];
800
807
  let gen = (function* _initGenerator () {
801
808
  let exports0;
802
- const handleTable1 = [T_FLAG, 0];
803
- const captureTable1= new Map();
804
- let captureCnt1 = 0;
805
- handleTables[1] = handleTable1;
806
809
 
807
- function trampoline1() {
808
- _debugLog('[iface="wasi:cli/stderr@0.2.6", function="get-stderr"] [Instruction::CallInterface] (async? sync, @ enter)');
809
- const _interface_call_currentTaskID = startCurrentTask(0, false, 'get-stderr');
810
- const ret = getStderr();
811
- _debugLog('[iface="wasi:cli/stderr@0.2.6", function="get-stderr"] [Instruction::CallInterface] (sync, @ post-call)');
812
- endCurrentTask(0);
813
- if (!(ret instanceof OutputStream)) {
814
- throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
815
- }
816
- var handle0 = ret[symbolRscHandle];
817
- if (!handle0) {
818
- const rep = ret[symbolRscRep] || ++captureCnt1;
819
- captureTable1.set(rep, ret);
820
- handle0 = rscTableCreateOwn(handleTable1, rep);
821
- }
822
- _debugLog('[iface="wasi:cli/stderr@0.2.6", function="get-stderr"][Instruction::Return]', {
823
- funcName: 'get-stderr',
824
- paramCount: 1,
825
- async: false,
826
- postReturn: false
827
- });
828
- return handle0;
829
- }
830
-
831
- let exports1;
832
-
833
- function trampoline3(arg0) {
810
+ function trampoline6(arg0) {
834
811
  let variant0;
835
812
  switch (arg0) {
836
813
  case 0: {
@@ -864,12 +841,164 @@ let gen = (function* _initGenerator () {
864
841
  });
865
842
  }
866
843
 
867
- let exports2;
844
+ const handleTable0 = [T_FLAG, 0];
845
+ const captureTable0= new Map();
846
+ let captureCnt0 = 0;
847
+ handleTables[0] = handleTable0;
848
+
849
+ function trampoline7(arg0) {
850
+ var handle1 = arg0;
851
+ var rep2 = handleTable0[(handle1 << 1) + 1] & ~T_FLAG;
852
+ var rsc0 = captureTable0.get(rep2);
853
+ if (!rsc0) {
854
+ rsc0 = Object.create(Pollable.prototype);
855
+ Object.defineProperty(rsc0, symbolRscHandle, { writable: true, value: handle1});
856
+ Object.defineProperty(rsc0, symbolRscRep, { writable: true, value: rep2});
857
+ }
858
+ curResourceBorrows.push(rsc0);
859
+ _debugLog('[iface="wasi:io/poll@0.2.6", function="[method]pollable.block"] [Instruction::CallInterface] (async? sync, @ enter)');
860
+ const _interface_call_currentTaskID = startCurrentTask(0, false, '[method]pollable.block');
861
+ rsc0.block();
862
+ _debugLog('[iface="wasi:io/poll@0.2.6", function="[method]pollable.block"] [Instruction::CallInterface] (sync, @ post-call)');
863
+ for (const rsc of curResourceBorrows) {
864
+ rsc[symbolRscHandle] = undefined;
865
+ }
866
+ curResourceBorrows = [];
867
+ endCurrentTask(0);
868
+ _debugLog('[iface="wasi:io/poll@0.2.6", function="[method]pollable.block"][Instruction::Return]', {
869
+ funcName: '[method]pollable.block',
870
+ paramCount: 0,
871
+ async: false,
872
+ postReturn: false
873
+ });
874
+ }
875
+
876
+ const handleTable3 = [T_FLAG, 0];
877
+ const captureTable3= new Map();
878
+ let captureCnt3 = 0;
879
+ handleTables[3] = handleTable3;
880
+
881
+ function trampoline8(arg0) {
882
+ var handle1 = arg0;
883
+ var rep2 = handleTable3[(handle1 << 1) + 1] & ~T_FLAG;
884
+ var rsc0 = captureTable3.get(rep2);
885
+ if (!rsc0) {
886
+ rsc0 = Object.create(OutputStream.prototype);
887
+ Object.defineProperty(rsc0, symbolRscHandle, { writable: true, value: handle1});
888
+ Object.defineProperty(rsc0, symbolRscRep, { writable: true, value: rep2});
889
+ }
890
+ curResourceBorrows.push(rsc0);
891
+ _debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.subscribe"] [Instruction::CallInterface] (async? sync, @ enter)');
892
+ const _interface_call_currentTaskID = startCurrentTask(0, false, '[method]output-stream.subscribe');
893
+ const ret = rsc0.subscribe();
894
+ _debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.subscribe"] [Instruction::CallInterface] (sync, @ post-call)');
895
+ for (const rsc of curResourceBorrows) {
896
+ rsc[symbolRscHandle] = undefined;
897
+ }
898
+ curResourceBorrows = [];
899
+ endCurrentTask(0);
900
+ if (!(ret instanceof Pollable)) {
901
+ throw new TypeError('Resource error: Not a valid "Pollable" resource.');
902
+ }
903
+ var handle3 = ret[symbolRscHandle];
904
+ if (!handle3) {
905
+ const rep = ret[symbolRscRep] || ++captureCnt0;
906
+ captureTable0.set(rep, ret);
907
+ handle3 = rscTableCreateOwn(handleTable0, rep);
908
+ }
909
+ _debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.subscribe"][Instruction::Return]', {
910
+ funcName: '[method]output-stream.subscribe',
911
+ paramCount: 1,
912
+ async: false,
913
+ postReturn: false
914
+ });
915
+ return handle3;
916
+ }
917
+
918
+ const handleTable2 = [T_FLAG, 0];
919
+ const captureTable2= new Map();
920
+ let captureCnt2 = 0;
921
+ handleTables[2] = handleTable2;
922
+
923
+ function trampoline9() {
924
+ _debugLog('[iface="wasi:cli/stdin@0.2.6", function="get-stdin"] [Instruction::CallInterface] (async? sync, @ enter)');
925
+ const _interface_call_currentTaskID = startCurrentTask(0, false, 'get-stdin');
926
+ const ret = getStdin();
927
+ _debugLog('[iface="wasi:cli/stdin@0.2.6", function="get-stdin"] [Instruction::CallInterface] (sync, @ post-call)');
928
+ endCurrentTask(0);
929
+ if (!(ret instanceof InputStream)) {
930
+ throw new TypeError('Resource error: Not a valid "InputStream" resource.');
931
+ }
932
+ var handle0 = ret[symbolRscHandle];
933
+ if (!handle0) {
934
+ const rep = ret[symbolRscRep] || ++captureCnt2;
935
+ captureTable2.set(rep, ret);
936
+ handle0 = rscTableCreateOwn(handleTable2, rep);
937
+ }
938
+ _debugLog('[iface="wasi:cli/stdin@0.2.6", function="get-stdin"][Instruction::Return]', {
939
+ funcName: 'get-stdin',
940
+ paramCount: 1,
941
+ async: false,
942
+ postReturn: false
943
+ });
944
+ return handle0;
945
+ }
946
+
947
+
948
+ function trampoline10() {
949
+ _debugLog('[iface="wasi:cli/stdout@0.2.6", function="get-stdout"] [Instruction::CallInterface] (async? sync, @ enter)');
950
+ const _interface_call_currentTaskID = startCurrentTask(0, false, 'get-stdout');
951
+ const ret = getStdout();
952
+ _debugLog('[iface="wasi:cli/stdout@0.2.6", function="get-stdout"] [Instruction::CallInterface] (sync, @ post-call)');
953
+ endCurrentTask(0);
954
+ if (!(ret instanceof OutputStream)) {
955
+ throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
956
+ }
957
+ var handle0 = ret[symbolRscHandle];
958
+ if (!handle0) {
959
+ const rep = ret[symbolRscRep] || ++captureCnt3;
960
+ captureTable3.set(rep, ret);
961
+ handle0 = rscTableCreateOwn(handleTable3, rep);
962
+ }
963
+ _debugLog('[iface="wasi:cli/stdout@0.2.6", function="get-stdout"][Instruction::Return]', {
964
+ funcName: 'get-stdout',
965
+ paramCount: 1,
966
+ async: false,
967
+ postReturn: false
968
+ });
969
+ return handle0;
970
+ }
971
+
972
+
973
+ function trampoline11() {
974
+ _debugLog('[iface="wasi:cli/stderr@0.2.6", function="get-stderr"] [Instruction::CallInterface] (async? sync, @ enter)');
975
+ const _interface_call_currentTaskID = startCurrentTask(0, false, 'get-stderr');
976
+ const ret = getStderr();
977
+ _debugLog('[iface="wasi:cli/stderr@0.2.6", function="get-stderr"] [Instruction::CallInterface] (sync, @ post-call)');
978
+ endCurrentTask(0);
979
+ if (!(ret instanceof OutputStream)) {
980
+ throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
981
+ }
982
+ var handle0 = ret[symbolRscHandle];
983
+ if (!handle0) {
984
+ const rep = ret[symbolRscRep] || ++captureCnt3;
985
+ captureTable3.set(rep, ret);
986
+ handle0 = rscTableCreateOwn(handleTable3, rep);
987
+ }
988
+ _debugLog('[iface="wasi:cli/stderr@0.2.6", function="get-stderr"][Instruction::Return]', {
989
+ funcName: 'get-stderr',
990
+ paramCount: 1,
991
+ async: false,
992
+ postReturn: false
993
+ });
994
+ return handle0;
995
+ }
996
+
997
+ let exports1;
868
998
  let memory0;
869
999
  let realloc0;
870
- let realloc1;
871
1000
 
872
- function trampoline4(arg0) {
1001
+ function trampoline12(arg0) {
873
1002
  _debugLog('[iface="wasi:random/insecure-seed@0.2.6", function="insecure-seed"] [Instruction::CallInterface] (async? sync, @ enter)');
874
1003
  const _interface_call_currentTaskID = startCurrentTask(0, false, 'insecure-seed');
875
1004
  const ret = insecureSeed();
@@ -886,15 +1015,90 @@ let gen = (function* _initGenerator () {
886
1015
  });
887
1016
  }
888
1017
 
889
- const handleTable0 = [T_FLAG, 0];
890
- const captureTable0= new Map();
891
- let captureCnt0 = 0;
892
- handleTables[0] = handleTable0;
1018
+ const handleTable1 = [T_FLAG, 0];
1019
+ const captureTable1= new Map();
1020
+ let captureCnt1 = 0;
1021
+ handleTables[1] = handleTable1;
893
1022
 
894
- function trampoline5(arg0, arg1, arg2, arg3) {
1023
+ function trampoline13(arg0, arg1) {
895
1024
  var handle1 = arg0;
896
- var rep2 = handleTable1[(handle1 << 1) + 1] & ~T_FLAG;
897
- var rsc0 = captureTable1.get(rep2);
1025
+ var rep2 = handleTable3[(handle1 << 1) + 1] & ~T_FLAG;
1026
+ var rsc0 = captureTable3.get(rep2);
1027
+ if (!rsc0) {
1028
+ rsc0 = Object.create(OutputStream.prototype);
1029
+ Object.defineProperty(rsc0, symbolRscHandle, { writable: true, value: handle1});
1030
+ Object.defineProperty(rsc0, symbolRscRep, { writable: true, value: rep2});
1031
+ }
1032
+ curResourceBorrows.push(rsc0);
1033
+ _debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.check-write"] [Instruction::CallInterface] (async? sync, @ enter)');
1034
+ const _interface_call_currentTaskID = startCurrentTask(0, false, '[method]output-stream.check-write');
1035
+ let ret;
1036
+ try {
1037
+ ret = { tag: 'ok', val: rsc0.checkWrite()};
1038
+ } catch (e) {
1039
+ ret = { tag: 'err', val: getErrorPayload(e) };
1040
+ }
1041
+ _debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.check-write"] [Instruction::CallInterface] (sync, @ post-call)');
1042
+ for (const rsc of curResourceBorrows) {
1043
+ rsc[symbolRscHandle] = undefined;
1044
+ }
1045
+ curResourceBorrows = [];
1046
+ endCurrentTask(0);
1047
+ var variant5 = ret;
1048
+ switch (variant5.tag) {
1049
+ case 'ok': {
1050
+ const e = variant5.val;
1051
+ dataView(memory0).setInt8(arg1 + 0, 0, true);
1052
+ dataView(memory0).setBigInt64(arg1 + 8, toUint64(e), true);
1053
+ break;
1054
+ }
1055
+ case 'err': {
1056
+ const e = variant5.val;
1057
+ dataView(memory0).setInt8(arg1 + 0, 1, true);
1058
+ var variant4 = e;
1059
+ switch (variant4.tag) {
1060
+ case 'last-operation-failed': {
1061
+ const e = variant4.val;
1062
+ dataView(memory0).setInt8(arg1 + 8, 0, true);
1063
+ if (!(e instanceof Error$1)) {
1064
+ throw new TypeError('Resource error: Not a valid "Error" resource.');
1065
+ }
1066
+ var handle3 = e[symbolRscHandle];
1067
+ if (!handle3) {
1068
+ const rep = e[symbolRscRep] || ++captureCnt1;
1069
+ captureTable1.set(rep, e);
1070
+ handle3 = rscTableCreateOwn(handleTable1, rep);
1071
+ }
1072
+ dataView(memory0).setInt32(arg1 + 12, handle3, true);
1073
+ break;
1074
+ }
1075
+ case 'closed': {
1076
+ dataView(memory0).setInt8(arg1 + 8, 1, true);
1077
+ break;
1078
+ }
1079
+ default: {
1080
+ throw new TypeError(`invalid variant tag value \`${JSON.stringify(variant4.tag)}\` (received \`${variant4}\`) specified for \`StreamError\``);
1081
+ }
1082
+ }
1083
+ break;
1084
+ }
1085
+ default: {
1086
+ throw new TypeError('invalid variant specified for result');
1087
+ }
1088
+ }
1089
+ _debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.check-write"][Instruction::Return]', {
1090
+ funcName: '[method]output-stream.check-write',
1091
+ paramCount: 0,
1092
+ async: false,
1093
+ postReturn: false
1094
+ });
1095
+ }
1096
+
1097
+
1098
+ function trampoline14(arg0, arg1, arg2, arg3) {
1099
+ var handle1 = arg0;
1100
+ var rep2 = handleTable3[(handle1 << 1) + 1] & ~T_FLAG;
1101
+ var rsc0 = captureTable3.get(rep2);
898
1102
  if (!rsc0) {
899
1103
  rsc0 = Object.create(OutputStream.prototype);
900
1104
  Object.defineProperty(rsc0, symbolRscHandle, { writable: true, value: handle1});
@@ -904,15 +1108,15 @@ let gen = (function* _initGenerator () {
904
1108
  var ptr3 = arg1;
905
1109
  var len3 = arg2;
906
1110
  var result3 = new Uint8Array(memory0.buffer.slice(ptr3, ptr3 + len3 * 1));
907
- _debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.blocking-write-and-flush"] [Instruction::CallInterface] (async? sync, @ enter)');
908
- const _interface_call_currentTaskID = startCurrentTask(0, false, '[method]output-stream.blocking-write-and-flush');
1111
+ _debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.write"] [Instruction::CallInterface] (async? sync, @ enter)');
1112
+ const _interface_call_currentTaskID = startCurrentTask(0, false, '[method]output-stream.write');
909
1113
  let ret;
910
1114
  try {
911
- ret = { tag: 'ok', val: rsc0.blockingWriteAndFlush(result3)};
1115
+ ret = { tag: 'ok', val: rsc0.write(result3)};
912
1116
  } catch (e) {
913
1117
  ret = { tag: 'err', val: getErrorPayload(e) };
914
1118
  }
915
- _debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.blocking-write-and-flush"] [Instruction::CallInterface] (sync, @ post-call)');
1119
+ _debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.write"] [Instruction::CallInterface] (sync, @ post-call)');
916
1120
  for (const rsc of curResourceBorrows) {
917
1121
  rsc[symbolRscHandle] = undefined;
918
1122
  }
@@ -938,9 +1142,9 @@ let gen = (function* _initGenerator () {
938
1142
  }
939
1143
  var handle4 = e[symbolRscHandle];
940
1144
  if (!handle4) {
941
- const rep = e[symbolRscRep] || ++captureCnt0;
942
- captureTable0.set(rep, e);
943
- handle4 = rscTableCreateOwn(handleTable0, rep);
1145
+ const rep = e[symbolRscRep] || ++captureCnt1;
1146
+ captureTable1.set(rep, e);
1147
+ handle4 = rscTableCreateOwn(handleTable1, rep);
944
1148
  }
945
1149
  dataView(memory0).setInt32(arg3 + 8, handle4, true);
946
1150
  break;
@@ -959,8 +1163,8 @@ let gen = (function* _initGenerator () {
959
1163
  throw new TypeError('invalid variant specified for result');
960
1164
  }
961
1165
  }
962
- _debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.blocking-write-and-flush"][Instruction::Return]', {
963
- funcName: '[method]output-stream.blocking-write-and-flush',
1166
+ _debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.write"][Instruction::Return]', {
1167
+ funcName: '[method]output-stream.write',
964
1168
  paramCount: 0,
965
1169
  async: false,
966
1170
  postReturn: false
@@ -968,31 +1172,73 @@ let gen = (function* _initGenerator () {
968
1172
  }
969
1173
 
970
1174
 
971
- function trampoline6(arg0, arg1) {
1175
+ function trampoline15(arg0, arg1) {
972
1176
  var handle1 = arg0;
973
- var rep2 = handleTable0[(handle1 << 1) + 1] & ~T_FLAG;
974
- var rsc0 = captureTable0.get(rep2);
1177
+ var rep2 = handleTable3[(handle1 << 1) + 1] & ~T_FLAG;
1178
+ var rsc0 = captureTable3.get(rep2);
975
1179
  if (!rsc0) {
976
- rsc0 = Object.create(Error$1.prototype);
1180
+ rsc0 = Object.create(OutputStream.prototype);
977
1181
  Object.defineProperty(rsc0, symbolRscHandle, { writable: true, value: handle1});
978
1182
  Object.defineProperty(rsc0, symbolRscRep, { writable: true, value: rep2});
979
1183
  }
980
1184
  curResourceBorrows.push(rsc0);
981
- _debugLog('[iface="wasi:io/error@0.2.6", function="[method]error.to-debug-string"] [Instruction::CallInterface] (async? sync, @ enter)');
982
- const _interface_call_currentTaskID = startCurrentTask(0, false, '[method]error.to-debug-string');
983
- const ret = rsc0.toDebugString();
984
- _debugLog('[iface="wasi:io/error@0.2.6", function="[method]error.to-debug-string"] [Instruction::CallInterface] (sync, @ post-call)');
1185
+ _debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.blocking-flush"] [Instruction::CallInterface] (async? sync, @ enter)');
1186
+ const _interface_call_currentTaskID = startCurrentTask(0, false, '[method]output-stream.blocking-flush');
1187
+ let ret;
1188
+ try {
1189
+ ret = { tag: 'ok', val: rsc0.blockingFlush()};
1190
+ } catch (e) {
1191
+ ret = { tag: 'err', val: getErrorPayload(e) };
1192
+ }
1193
+ _debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.blocking-flush"] [Instruction::CallInterface] (sync, @ post-call)');
985
1194
  for (const rsc of curResourceBorrows) {
986
1195
  rsc[symbolRscHandle] = undefined;
987
1196
  }
988
1197
  curResourceBorrows = [];
989
1198
  endCurrentTask(0);
990
- var ptr3 = utf8Encode(ret, realloc0, memory0);
991
- var len3 = utf8EncodedLen;
992
- dataView(memory0).setUint32(arg1 + 4, len3, true);
993
- dataView(memory0).setUint32(arg1 + 0, ptr3, true);
994
- _debugLog('[iface="wasi:io/error@0.2.6", function="[method]error.to-debug-string"][Instruction::Return]', {
995
- funcName: '[method]error.to-debug-string',
1199
+ var variant5 = ret;
1200
+ switch (variant5.tag) {
1201
+ case 'ok': {
1202
+ const e = variant5.val;
1203
+ dataView(memory0).setInt8(arg1 + 0, 0, true);
1204
+ break;
1205
+ }
1206
+ case 'err': {
1207
+ const e = variant5.val;
1208
+ dataView(memory0).setInt8(arg1 + 0, 1, true);
1209
+ var variant4 = e;
1210
+ switch (variant4.tag) {
1211
+ case 'last-operation-failed': {
1212
+ const e = variant4.val;
1213
+ dataView(memory0).setInt8(arg1 + 4, 0, true);
1214
+ if (!(e instanceof Error$1)) {
1215
+ throw new TypeError('Resource error: Not a valid "Error" resource.');
1216
+ }
1217
+ var handle3 = e[symbolRscHandle];
1218
+ if (!handle3) {
1219
+ const rep = e[symbolRscRep] || ++captureCnt1;
1220
+ captureTable1.set(rep, e);
1221
+ handle3 = rscTableCreateOwn(handleTable1, rep);
1222
+ }
1223
+ dataView(memory0).setInt32(arg1 + 8, handle3, true);
1224
+ break;
1225
+ }
1226
+ case 'closed': {
1227
+ dataView(memory0).setInt8(arg1 + 4, 1, true);
1228
+ break;
1229
+ }
1230
+ default: {
1231
+ throw new TypeError(`invalid variant tag value \`${JSON.stringify(variant4.tag)}\` (received \`${variant4}\`) specified for \`StreamError\``);
1232
+ }
1233
+ }
1234
+ break;
1235
+ }
1236
+ default: {
1237
+ throw new TypeError('invalid variant specified for result');
1238
+ }
1239
+ }
1240
+ _debugLog('[iface="wasi:io/streams@0.2.6", function="[method]output-stream.blocking-flush"][Instruction::Return]', {
1241
+ funcName: '[method]output-stream.blocking-flush',
996
1242
  paramCount: 0,
997
1243
  async: false,
998
1244
  postReturn: false
@@ -1000,7 +1246,7 @@ let gen = (function* _initGenerator () {
1000
1246
  }
1001
1247
 
1002
1248
 
1003
- function trampoline7(arg0) {
1249
+ function trampoline16(arg0) {
1004
1250
  _debugLog('[iface="wasi:cli/environment@0.2.6", function="get-environment"] [Instruction::CallInterface] (async? sync, @ enter)');
1005
1251
  const _interface_call_currentTaskID = startCurrentTask(0, false, 'get-environment');
1006
1252
  const ret = getEnvironment();
@@ -1008,15 +1254,15 @@ let gen = (function* _initGenerator () {
1008
1254
  endCurrentTask(0);
1009
1255
  var vec3 = ret;
1010
1256
  var len3 = vec3.length;
1011
- var result3 = realloc1(0, 0, 4, len3 * 16);
1257
+ var result3 = realloc0(0, 0, 4, len3 * 16);
1012
1258
  for (let i = 0; i < vec3.length; i++) {
1013
1259
  const e = vec3[i];
1014
1260
  const base = result3 + i * 16;var [tuple0_0, tuple0_1] = e;
1015
- var ptr1 = utf8Encode(tuple0_0, realloc1, memory0);
1261
+ var ptr1 = utf8Encode(tuple0_0, realloc0, memory0);
1016
1262
  var len1 = utf8EncodedLen;
1017
1263
  dataView(memory0).setUint32(base + 4, len1, true);
1018
1264
  dataView(memory0).setUint32(base + 0, ptr1, true);
1019
- var ptr2 = utf8Encode(tuple0_1, realloc1, memory0);
1265
+ var ptr2 = utf8Encode(tuple0_1, realloc0, memory0);
1020
1266
  var len2 = utf8EncodedLen;
1021
1267
  dataView(memory0).setUint32(base + 12, len2, true);
1022
1268
  dataView(memory0).setUint32(base + 8, ptr2, true);
@@ -1031,7 +1277,111 @@ let gen = (function* _initGenerator () {
1031
1277
  });
1032
1278
  }
1033
1279
 
1034
- let exports3;
1280
+ const handleTable4 = [T_FLAG, 0];
1281
+ const captureTable4= new Map();
1282
+ let captureCnt4 = 0;
1283
+ handleTables[4] = handleTable4;
1284
+
1285
+ function trampoline17(arg0) {
1286
+ _debugLog('[iface="wasi:cli/terminal-stdin@0.2.6", function="get-terminal-stdin"] [Instruction::CallInterface] (async? sync, @ enter)');
1287
+ const _interface_call_currentTaskID = startCurrentTask(0, false, 'get-terminal-stdin');
1288
+ const ret = getTerminalStdin();
1289
+ _debugLog('[iface="wasi:cli/terminal-stdin@0.2.6", function="get-terminal-stdin"] [Instruction::CallInterface] (sync, @ post-call)');
1290
+ endCurrentTask(0);
1291
+ var variant1 = ret;
1292
+ if (variant1 === null || variant1=== undefined) {
1293
+ dataView(memory0).setInt8(arg0 + 0, 0, true);
1294
+ } else {
1295
+ const e = variant1;
1296
+ dataView(memory0).setInt8(arg0 + 0, 1, true);
1297
+ if (!(e instanceof TerminalInput)) {
1298
+ throw new TypeError('Resource error: Not a valid "TerminalInput" resource.');
1299
+ }
1300
+ var handle0 = e[symbolRscHandle];
1301
+ if (!handle0) {
1302
+ const rep = e[symbolRscRep] || ++captureCnt4;
1303
+ captureTable4.set(rep, e);
1304
+ handle0 = rscTableCreateOwn(handleTable4, rep);
1305
+ }
1306
+ dataView(memory0).setInt32(arg0 + 4, handle0, true);
1307
+ }
1308
+ _debugLog('[iface="wasi:cli/terminal-stdin@0.2.6", function="get-terminal-stdin"][Instruction::Return]', {
1309
+ funcName: 'get-terminal-stdin',
1310
+ paramCount: 0,
1311
+ async: false,
1312
+ postReturn: false
1313
+ });
1314
+ }
1315
+
1316
+ const handleTable5 = [T_FLAG, 0];
1317
+ const captureTable5= new Map();
1318
+ let captureCnt5 = 0;
1319
+ handleTables[5] = handleTable5;
1320
+
1321
+ function trampoline18(arg0) {
1322
+ _debugLog('[iface="wasi:cli/terminal-stdout@0.2.6", function="get-terminal-stdout"] [Instruction::CallInterface] (async? sync, @ enter)');
1323
+ const _interface_call_currentTaskID = startCurrentTask(0, false, 'get-terminal-stdout');
1324
+ const ret = getTerminalStdout();
1325
+ _debugLog('[iface="wasi:cli/terminal-stdout@0.2.6", function="get-terminal-stdout"] [Instruction::CallInterface] (sync, @ post-call)');
1326
+ endCurrentTask(0);
1327
+ var variant1 = ret;
1328
+ if (variant1 === null || variant1=== undefined) {
1329
+ dataView(memory0).setInt8(arg0 + 0, 0, true);
1330
+ } else {
1331
+ const e = variant1;
1332
+ dataView(memory0).setInt8(arg0 + 0, 1, true);
1333
+ if (!(e instanceof TerminalOutput)) {
1334
+ throw new TypeError('Resource error: Not a valid "TerminalOutput" resource.');
1335
+ }
1336
+ var handle0 = e[symbolRscHandle];
1337
+ if (!handle0) {
1338
+ const rep = e[symbolRscRep] || ++captureCnt5;
1339
+ captureTable5.set(rep, e);
1340
+ handle0 = rscTableCreateOwn(handleTable5, rep);
1341
+ }
1342
+ dataView(memory0).setInt32(arg0 + 4, handle0, true);
1343
+ }
1344
+ _debugLog('[iface="wasi:cli/terminal-stdout@0.2.6", function="get-terminal-stdout"][Instruction::Return]', {
1345
+ funcName: 'get-terminal-stdout',
1346
+ paramCount: 0,
1347
+ async: false,
1348
+ postReturn: false
1349
+ });
1350
+ }
1351
+
1352
+
1353
+ function trampoline19(arg0) {
1354
+ _debugLog('[iface="wasi:cli/terminal-stderr@0.2.6", function="get-terminal-stderr"] [Instruction::CallInterface] (async? sync, @ enter)');
1355
+ const _interface_call_currentTaskID = startCurrentTask(0, false, 'get-terminal-stderr');
1356
+ const ret = getTerminalStderr();
1357
+ _debugLog('[iface="wasi:cli/terminal-stderr@0.2.6", function="get-terminal-stderr"] [Instruction::CallInterface] (sync, @ post-call)');
1358
+ endCurrentTask(0);
1359
+ var variant1 = ret;
1360
+ if (variant1 === null || variant1=== undefined) {
1361
+ dataView(memory0).setInt8(arg0 + 0, 0, true);
1362
+ } else {
1363
+ const e = variant1;
1364
+ dataView(memory0).setInt8(arg0 + 0, 1, true);
1365
+ if (!(e instanceof TerminalOutput)) {
1366
+ throw new TypeError('Resource error: Not a valid "TerminalOutput" resource.');
1367
+ }
1368
+ var handle0 = e[symbolRscHandle];
1369
+ if (!handle0) {
1370
+ const rep = e[symbolRscRep] || ++captureCnt5;
1371
+ captureTable5.set(rep, e);
1372
+ handle0 = rscTableCreateOwn(handleTable5, rep);
1373
+ }
1374
+ dataView(memory0).setInt32(arg0 + 4, handle0, true);
1375
+ }
1376
+ _debugLog('[iface="wasi:cli/terminal-stderr@0.2.6", function="get-terminal-stderr"][Instruction::Return]', {
1377
+ funcName: 'get-terminal-stderr',
1378
+ paramCount: 0,
1379
+ async: false,
1380
+ postReturn: false
1381
+ });
1382
+ }
1383
+
1384
+ let exports2;
1035
1385
  let postReturn0;
1036
1386
  let postReturn1;
1037
1387
  let postReturn2;
@@ -1045,12 +1395,12 @@ let gen = (function* _initGenerator () {
1045
1395
  if (rsc) {
1046
1396
  if (rsc[symbolDispose]) rsc[symbolDispose]();
1047
1397
  captureTable1.delete(handleEntry.rep);
1048
- } else if (OutputStream[symbolCabiDispose]) {
1049
- OutputStream[symbolCabiDispose](handleEntry.rep);
1398
+ } else if (Error$1[symbolCabiDispose]) {
1399
+ Error$1[symbolCabiDispose](handleEntry.rep);
1050
1400
  }
1051
1401
  }
1052
1402
  }
1053
- function trampoline2(handle) {
1403
+ function trampoline1(handle) {
1054
1404
  const handleEntry = rscTableRemove(handleTable0, handle);
1055
1405
  if (handleEntry.own) {
1056
1406
 
@@ -1058,72 +1408,128 @@ let gen = (function* _initGenerator () {
1058
1408
  if (rsc) {
1059
1409
  if (rsc[symbolDispose]) rsc[symbolDispose]();
1060
1410
  captureTable0.delete(handleEntry.rep);
1061
- } else if (Error$1[symbolCabiDispose]) {
1062
- Error$1[symbolCabiDispose](handleEntry.rep);
1411
+ } else if (Pollable[symbolCabiDispose]) {
1412
+ Pollable[symbolCabiDispose](handleEntry.rep);
1413
+ }
1414
+ }
1415
+ }
1416
+ function trampoline2(handle) {
1417
+ const handleEntry = rscTableRemove(handleTable2, handle);
1418
+ if (handleEntry.own) {
1419
+
1420
+ const rsc = captureTable2.get(handleEntry.rep);
1421
+ if (rsc) {
1422
+ if (rsc[symbolDispose]) rsc[symbolDispose]();
1423
+ captureTable2.delete(handleEntry.rep);
1424
+ } else if (InputStream[symbolCabiDispose]) {
1425
+ InputStream[symbolCabiDispose](handleEntry.rep);
1426
+ }
1427
+ }
1428
+ }
1429
+ function trampoline3(handle) {
1430
+ const handleEntry = rscTableRemove(handleTable3, handle);
1431
+ if (handleEntry.own) {
1432
+
1433
+ const rsc = captureTable3.get(handleEntry.rep);
1434
+ if (rsc) {
1435
+ if (rsc[symbolDispose]) rsc[symbolDispose]();
1436
+ captureTable3.delete(handleEntry.rep);
1437
+ } else if (OutputStream[symbolCabiDispose]) {
1438
+ OutputStream[symbolCabiDispose](handleEntry.rep);
1439
+ }
1440
+ }
1441
+ }
1442
+ function trampoline4(handle) {
1443
+ const handleEntry = rscTableRemove(handleTable4, handle);
1444
+ if (handleEntry.own) {
1445
+
1446
+ const rsc = captureTable4.get(handleEntry.rep);
1447
+ if (rsc) {
1448
+ if (rsc[symbolDispose]) rsc[symbolDispose]();
1449
+ captureTable4.delete(handleEntry.rep);
1450
+ } else if (TerminalInput[symbolCabiDispose]) {
1451
+ TerminalInput[symbolCabiDispose](handleEntry.rep);
1452
+ }
1453
+ }
1454
+ }
1455
+ function trampoline5(handle) {
1456
+ const handleEntry = rscTableRemove(handleTable5, handle);
1457
+ if (handleEntry.own) {
1458
+
1459
+ const rsc = captureTable5.get(handleEntry.rep);
1460
+ if (rsc) {
1461
+ if (rsc[symbolDispose]) rsc[symbolDispose]();
1462
+ captureTable5.delete(handleEntry.rep);
1463
+ } else if (TerminalOutput[symbolCabiDispose]) {
1464
+ TerminalOutput[symbolCabiDispose](handleEntry.rep);
1063
1465
  }
1064
1466
  }
1065
1467
  }
1066
- Promise.all([module0, module1, module2, module3]).catch(() => {});
1067
- ({ exports: exports0 } = yield instantiateCore(yield module2));
1468
+ Promise.all([module0, module1, module2]).catch(() => {});
1469
+ ({ exports: exports0 } = yield instantiateCore(yield module1));
1068
1470
  ({ exports: exports1 } = yield instantiateCore(yield module0, {
1069
- 'wasi:cli/stderr@0.2.4': {
1070
- 'get-stderr': trampoline1,
1471
+ 'wasi:cli/environment@0.2.0': {
1472
+ 'get-environment': exports0['4'],
1071
1473
  },
1072
- 'wasi:io/error@0.2.4': {
1073
- '[method]error.to-debug-string': exports0['2'],
1074
- '[resource-drop]error': trampoline2,
1474
+ 'wasi:cli/exit@0.2.0': {
1475
+ exit: trampoline6,
1075
1476
  },
1076
- 'wasi:io/streams@0.2.4': {
1077
- '[method]output-stream.blocking-write-and-flush': exports0['1'],
1078
- '[resource-drop]output-stream': trampoline0,
1477
+ 'wasi:cli/stderr@0.2.0': {
1478
+ 'get-stderr': trampoline11,
1079
1479
  },
1080
- 'wasi:random/insecure-seed@0.2.4': {
1081
- 'insecure-seed': exports0['0'],
1480
+ 'wasi:cli/stdin@0.2.0': {
1481
+ 'get-stdin': trampoline9,
1082
1482
  },
1083
- wasi_snapshot_preview1: {
1084
- environ_get: exports0['3'],
1085
- environ_sizes_get: exports0['4'],
1086
- proc_exit: exports0['5'],
1483
+ 'wasi:cli/stdout@0.2.0': {
1484
+ 'get-stdout': trampoline10,
1087
1485
  },
1088
- }));
1089
- ({ exports: exports2 } = yield instantiateCore(yield module1, {
1090
- __main_module__: {
1091
- cabi_realloc: exports1.cabi_realloc,
1486
+ 'wasi:cli/terminal-input@0.2.0': {
1487
+ '[resource-drop]terminal-input': trampoline4,
1488
+ },
1489
+ 'wasi:cli/terminal-output@0.2.0': {
1490
+ '[resource-drop]terminal-output': trampoline5,
1092
1491
  },
1093
- env: {
1094
- memory: exports1.memory,
1492
+ 'wasi:cli/terminal-stderr@0.2.0': {
1493
+ 'get-terminal-stderr': exports0['7'],
1095
1494
  },
1096
- 'wasi:cli/environment@0.2.6': {
1097
- 'get-environment': exports0['6'],
1495
+ 'wasi:cli/terminal-stdin@0.2.0': {
1496
+ 'get-terminal-stdin': exports0['5'],
1098
1497
  },
1099
- 'wasi:cli/exit@0.2.6': {
1100
- exit: trampoline3,
1498
+ 'wasi:cli/terminal-stdout@0.2.0': {
1499
+ 'get-terminal-stdout': exports0['6'],
1101
1500
  },
1102
- 'wasi:cli/stderr@0.2.6': {
1103
- 'get-stderr': trampoline1,
1501
+ 'wasi:io/error@0.2.0': {
1502
+ '[resource-drop]error': trampoline0,
1104
1503
  },
1105
- 'wasi:io/error@0.2.6': {
1106
- '[resource-drop]error': trampoline2,
1504
+ 'wasi:io/poll@0.2.0': {
1505
+ '[method]pollable.block': trampoline7,
1506
+ '[resource-drop]pollable': trampoline1,
1107
1507
  },
1108
- 'wasi:io/streams@0.2.6': {
1109
- '[method]output-stream.blocking-write-and-flush': exports0['7'],
1110
- '[resource-drop]output-stream': trampoline0,
1508
+ 'wasi:io/streams@0.2.0': {
1509
+ '[method]output-stream.blocking-flush': exports0['3'],
1510
+ '[method]output-stream.check-write': exports0['1'],
1511
+ '[method]output-stream.subscribe': trampoline8,
1512
+ '[method]output-stream.write': exports0['2'],
1513
+ '[resource-drop]input-stream': trampoline2,
1514
+ '[resource-drop]output-stream': trampoline3,
1515
+ },
1516
+ 'wasi:random/insecure-seed@0.2.4': {
1517
+ 'insecure-seed': exports0['0'],
1111
1518
  },
1112
1519
  }));
1113
1520
  memory0 = exports1.memory;
1114
1521
  realloc0 = exports1.cabi_realloc;
1115
- realloc1 = exports2.cabi_import_realloc;
1116
- ({ exports: exports3 } = yield instantiateCore(yield module3, {
1522
+ ({ exports: exports2 } = yield instantiateCore(yield module2, {
1117
1523
  '': {
1118
1524
  $imports: exports0.$imports,
1119
- '0': trampoline4,
1120
- '1': trampoline5,
1121
- '2': trampoline6,
1122
- '3': exports2.environ_get,
1123
- '4': exports2.environ_sizes_get,
1124
- '5': exports2.proc_exit,
1125
- '6': trampoline7,
1126
- '7': trampoline5,
1525
+ '0': trampoline12,
1526
+ '1': trampoline13,
1527
+ '2': trampoline14,
1528
+ '3': trampoline15,
1529
+ '4': trampoline16,
1530
+ '5': trampoline17,
1531
+ '6': trampoline18,
1532
+ '7': trampoline19,
1127
1533
  },
1128
1534
  }));
1129
1535
  postReturn0 = exports1['cabi_post_get-string-constant'];
@@ -1202,51 +1608,30 @@ let gen = (function* _initGenerator () {
1202
1608
  return retCopy;
1203
1609
 
1204
1610
  }
1205
- let exports1ParseDjangoSettingsModule;
1611
+ let exports1ContainsTopLevelCallable;
1206
1612
 
1207
- function parseDjangoSettingsModule(arg0) {
1613
+ function containsTopLevelCallable(arg0, arg1) {
1208
1614
  var ptr0 = utf8Encode(arg0, realloc0, memory0);
1209
1615
  var len0 = utf8EncodedLen;
1210
- _debugLog('[iface="parse-django-settings-module", function="parse-django-settings-module"][Instruction::CallWasm] enter', {
1211
- funcName: 'parse-django-settings-module',
1212
- paramCount: 2,
1616
+ var ptr1 = utf8Encode(arg1, realloc0, memory0);
1617
+ var len1 = utf8EncodedLen;
1618
+ _debugLog('[iface="contains-top-level-callable", function="contains-top-level-callable"][Instruction::CallWasm] enter', {
1619
+ funcName: 'contains-top-level-callable',
1620
+ paramCount: 4,
1213
1621
  async: false,
1214
- postReturn: true,
1622
+ postReturn: false,
1215
1623
  });
1216
- const _wasm_call_currentTaskID = startCurrentTask(0, false, 'exports1ParseDjangoSettingsModule');
1217
- const ret = exports1ParseDjangoSettingsModule(ptr0, len0);
1624
+ const _wasm_call_currentTaskID = startCurrentTask(0, false, 'exports1ContainsTopLevelCallable');
1625
+ const ret = exports1ContainsTopLevelCallable(ptr0, len0, ptr1, len1);
1218
1626
  endCurrentTask(0);
1219
- let variant2;
1220
- switch (dataView(memory0).getUint8(ret + 0, true)) {
1221
- case 0: {
1222
- variant2 = undefined;
1223
- break;
1224
- }
1225
- case 1: {
1226
- var ptr1 = dataView(memory0).getUint32(ret + 4, true);
1227
- var len1 = dataView(memory0).getUint32(ret + 8, true);
1228
- var result1 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr1, len1));
1229
- variant2 = result1;
1230
- break;
1231
- }
1232
- default: {
1233
- throw new TypeError('invalid variant discriminant for option');
1234
- }
1235
- }
1236
- _debugLog('[iface="parse-django-settings-module", function="parse-django-settings-module"][Instruction::Return]', {
1237
- funcName: 'parse-django-settings-module',
1627
+ var bool2 = ret;
1628
+ _debugLog('[iface="contains-top-level-callable", function="contains-top-level-callable"][Instruction::Return]', {
1629
+ funcName: 'contains-top-level-callable',
1238
1630
  paramCount: 1,
1239
1631
  async: false,
1240
- postReturn: true
1632
+ postReturn: false
1241
1633
  });
1242
- const retCopy = variant2;
1243
-
1244
- let cstate = getOrCreateAsyncState(0);
1245
- cstate.mayLeave = false;
1246
- postReturn0(ret);
1247
- cstate.mayLeave = true;
1248
- return retCopy;
1249
-
1634
+ return bool2 == 0 ? false : (bool2 == 1 ? true : throwInvalidBool());
1250
1635
  }
1251
1636
  let exports1ParseDistMetadata;
1252
1637
 
@@ -1886,13 +2271,13 @@ let gen = (function* _initGenerator () {
1886
2271
  }
1887
2272
  exports1ContainsAppOrHandler = exports1['contains-app-or-handler'];
1888
2273
  exports1GetStringConstant = exports1['get-string-constant'];
1889
- exports1ParseDjangoSettingsModule = exports1['parse-django-settings-module'];
2274
+ exports1ContainsTopLevelCallable = exports1['contains-top-level-callable'];
1890
2275
  exports1ParseDistMetadata = exports1['parse-dist-metadata'];
1891
2276
  exports1ParseRecord = exports1['parse-record'];
1892
2277
  exports1ParseDirectUrl = exports1['parse-direct-url'];
1893
2278
  exports1NormalizePackageName = exports1['normalize-package-name'];
1894
2279
 
1895
- return { containsAppOrHandler, getStringConstant, normalizePackageName, parseDirectUrl, parseDistMetadata, parseDjangoSettingsModule, parseRecord, };
2280
+ return { containsAppOrHandler, containsTopLevelCallable, getStringConstant, normalizePackageName, parseDirectUrl, parseDistMetadata, parseRecord, };
1896
2281
  })();
1897
2282
  let promise, resolve, reject;
1898
2283
  function runNext (value) {