@agentuity/cli 0.0.106 → 0.0.108

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.
Files changed (74) hide show
  1. package/dist/cmd/build/entry-generator.d.ts.map +1 -1
  2. package/dist/cmd/build/entry-generator.js +43 -50
  3. package/dist/cmd/build/entry-generator.js.map +1 -1
  4. package/dist/cmd/build/index.d.ts.map +1 -1
  5. package/dist/cmd/build/index.js +9 -9
  6. package/dist/cmd/build/index.js.map +1 -1
  7. package/dist/cmd/build/typecheck.d.ts +23 -0
  8. package/dist/cmd/build/typecheck.d.ts.map +1 -0
  9. package/dist/cmd/build/typecheck.js +38 -0
  10. package/dist/cmd/build/typecheck.js.map +1 -0
  11. package/dist/cmd/build/vite/metadata-generator.d.ts +2 -1
  12. package/dist/cmd/build/vite/metadata-generator.d.ts.map +1 -1
  13. package/dist/cmd/build/vite/metadata-generator.js +14 -0
  14. package/dist/cmd/build/vite/metadata-generator.js.map +1 -1
  15. package/dist/cmd/build/vite/vite-asset-server-config.d.ts.map +1 -1
  16. package/dist/cmd/build/vite/vite-asset-server-config.js +15 -8
  17. package/dist/cmd/build/vite/vite-asset-server-config.js.map +1 -1
  18. package/dist/cmd/build/vite/vite-asset-server.d.ts.map +1 -1
  19. package/dist/cmd/build/vite/vite-asset-server.js +6 -2
  20. package/dist/cmd/build/vite/vite-asset-server.js.map +1 -1
  21. package/dist/cmd/build/vite/vite-builder.d.ts +2 -1
  22. package/dist/cmd/build/vite/vite-builder.d.ts.map +1 -1
  23. package/dist/cmd/build/vite/vite-builder.js +15 -2
  24. package/dist/cmd/build/vite/vite-builder.js.map +1 -1
  25. package/dist/cmd/build/vite-bundler.d.ts +2 -1
  26. package/dist/cmd/build/vite-bundler.d.ts.map +1 -1
  27. package/dist/cmd/build/vite-bundler.js +2 -1
  28. package/dist/cmd/build/vite-bundler.js.map +1 -1
  29. package/dist/cmd/cloud/deploy.d.ts.map +1 -1
  30. package/dist/cmd/cloud/deploy.js +50 -24
  31. package/dist/cmd/cloud/deploy.js.map +1 -1
  32. package/dist/cmd/dev/index.d.ts.map +1 -1
  33. package/dist/cmd/dev/index.js +623 -578
  34. package/dist/cmd/dev/index.js.map +1 -1
  35. package/dist/schema-parser.d.ts.map +1 -1
  36. package/dist/schema-parser.js +17 -3
  37. package/dist/schema-parser.js.map +1 -1
  38. package/dist/tsc-output-parser.d.ts +54 -0
  39. package/dist/tsc-output-parser.d.ts.map +1 -0
  40. package/dist/tsc-output-parser.js +926 -0
  41. package/dist/tsc-output-parser.js.map +1 -0
  42. package/dist/tui.d.ts +77 -0
  43. package/dist/tui.d.ts.map +1 -1
  44. package/dist/tui.js +27 -2
  45. package/dist/tui.js.map +1 -1
  46. package/dist/types.d.ts +24 -0
  47. package/dist/types.d.ts.map +1 -1
  48. package/dist/types.js +22 -0
  49. package/dist/types.js.map +1 -1
  50. package/dist/typescript-errors.d.ts +26 -0
  51. package/dist/typescript-errors.d.ts.map +1 -0
  52. package/dist/typescript-errors.js +249 -0
  53. package/dist/typescript-errors.js.map +1 -0
  54. package/package.json +4 -4
  55. package/src/cmd/build/entry-generator.ts +43 -51
  56. package/src/cmd/build/index.ts +13 -10
  57. package/src/cmd/build/typecheck.ts +55 -0
  58. package/src/cmd/build/vite/metadata-generator.ts +17 -1
  59. package/src/cmd/build/vite/vite-asset-server-config.ts +17 -8
  60. package/src/cmd/build/vite/vite-asset-server.ts +6 -2
  61. package/src/cmd/build/vite/vite-builder.ts +16 -3
  62. package/src/cmd/build/vite-bundler.ts +4 -1
  63. package/src/cmd/cloud/deploy.ts +68 -32
  64. package/src/cmd/dev/index.ts +713 -657
  65. package/src/schema-parser.ts +17 -3
  66. package/src/tsc-output-parser.ts +1115 -0
  67. package/src/tui.ts +40 -2
  68. package/src/types.ts +25 -0
  69. package/src/typescript-errors.ts +382 -0
  70. package/dist/schemas/deploy.d.ts +0 -24
  71. package/dist/schemas/deploy.d.ts.map +0 -1
  72. package/dist/schemas/deploy.js +0 -26
  73. package/dist/schemas/deploy.js.map +0 -1
  74. package/src/schemas/deploy.ts +0 -28
@@ -0,0 +1,926 @@
1
+ /**
2
+ * TSC Output Parser
3
+ *
4
+ * Parses TypeScript compiler output into structured JSON format.
5
+ *
6
+ * This is an internalized version of @aivenio/tsc-output-parser.
7
+ * Original source: https://github.com/Aiven-Open/tsc-output-parser
8
+ *
9
+ * Copyright Aiven
10
+ * Licensed under the Apache License, Version 2.0
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Generated by PEG.js v. 0.10.0 (ts-pegjs plugin v. 0.2.7)
14
+ * https://pegjs.org/ https://github.com/metadevpro/ts-pegjs
15
+ */
16
+ class SyntaxError extends Error {
17
+ static buildMessage(expected, found) {
18
+ function hex(ch) {
19
+ return ch.charCodeAt(0).toString(16).toUpperCase();
20
+ }
21
+ function literalEscape(s) {
22
+ return s
23
+ .replace(/\\/g, '\\\\')
24
+ .replace(/"/g, '\\"')
25
+ .replace(/\0/g, '\\0')
26
+ .replace(/\t/g, '\\t')
27
+ .replace(/\n/g, '\\n')
28
+ .replace(/\r/g, '\\r')
29
+ .replace(/[\x00-\x0F]/g, (ch) => '\\x0' + hex(ch))
30
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => '\\x' + hex(ch));
31
+ }
32
+ function classEscape(s) {
33
+ return s
34
+ .replace(/\\/g, '\\\\')
35
+ .replace(/\]/g, '\\]')
36
+ .replace(/\^/g, '\\^')
37
+ .replace(/-/g, '\\-')
38
+ .replace(/\0/g, '\\0')
39
+ .replace(/\t/g, '\\t')
40
+ .replace(/\n/g, '\\n')
41
+ .replace(/\r/g, '\\r')
42
+ .replace(/[\x00-\x0F]/g, (ch) => '\\x0' + hex(ch))
43
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => '\\x' + hex(ch));
44
+ }
45
+ function describeExpectation(expectation) {
46
+ switch (expectation.type) {
47
+ case 'literal':
48
+ return '"' + literalEscape(expectation.text) + '"';
49
+ case 'class': {
50
+ const escapedParts = expectation.parts.map((part) => {
51
+ return Array.isArray(part)
52
+ ? classEscape(part[0]) + '-' + classEscape(part[1])
53
+ : classEscape(part);
54
+ });
55
+ return '[' + (expectation.inverted ? '^' : '') + escapedParts + ']';
56
+ }
57
+ case 'any':
58
+ return 'any character';
59
+ case 'end':
60
+ return 'end of input';
61
+ case 'other':
62
+ return expectation.description;
63
+ }
64
+ }
65
+ function describeExpected(expected1) {
66
+ const descriptions = expected1.map(describeExpectation);
67
+ let i;
68
+ let j;
69
+ descriptions.sort();
70
+ if (descriptions.length > 0) {
71
+ for (i = 1, j = 1; i < descriptions.length; i++) {
72
+ if (descriptions[i - 1] !== descriptions[i]) {
73
+ descriptions[j] = descriptions[i];
74
+ j++;
75
+ }
76
+ }
77
+ descriptions.length = j;
78
+ }
79
+ switch (descriptions.length) {
80
+ case 1:
81
+ return descriptions[0];
82
+ case 2:
83
+ return descriptions[0] + ' or ' + descriptions[1];
84
+ default:
85
+ return (descriptions.slice(0, -1).join(', ') +
86
+ ', or ' +
87
+ descriptions[descriptions.length - 1]);
88
+ }
89
+ }
90
+ function describeFound(found1) {
91
+ return found1 ? '"' + literalEscape(found1) + '"' : 'end of input';
92
+ }
93
+ return 'Expected ' + describeExpected(expected) + ' but ' + describeFound(found) + ' found.';
94
+ }
95
+ message;
96
+ expected;
97
+ found;
98
+ location;
99
+ name;
100
+ constructor(message, expected, found, location) {
101
+ super();
102
+ this.message = message;
103
+ this.expected = expected;
104
+ this.found = found;
105
+ this.location = location;
106
+ this.name = 'SyntaxError';
107
+ if (typeof Error.captureStackTrace === 'function') {
108
+ Error.captureStackTrace(this, SyntaxError);
109
+ }
110
+ }
111
+ }
112
+ function peg$parse(input, options) {
113
+ options = options !== undefined ? options : {};
114
+ const peg$FAILED = {};
115
+ const peg$startRuleFunctions = { Main: peg$parseMain };
116
+ let peg$startRuleFunction = peg$parseMain;
117
+ const peg$c0 = function (items) {
118
+ return items;
119
+ };
120
+ const peg$c1 = ':';
121
+ const peg$c2 = peg$literalExpectation(':', false);
122
+ const peg$c3 = function (path, cursor, tsError, message) {
123
+ return {
124
+ type: 'Item',
125
+ value: {
126
+ path,
127
+ cursor,
128
+ tsError,
129
+ message,
130
+ },
131
+ };
132
+ };
133
+ const peg$c4 = function (line, extraLines) {
134
+ return {
135
+ type: 'Message',
136
+ value: `${line}${extraLines.join('')}`,
137
+ };
138
+ };
139
+ const peg$c5 = function (indent, tail) {
140
+ return `${indent}${tail}`;
141
+ };
142
+ const peg$c6 = ' ';
143
+ const peg$c7 = peg$literalExpectation(' ', false);
144
+ const peg$c8 = function (indent) {
145
+ return indent;
146
+ };
147
+ const peg$c9 = ' TS';
148
+ const peg$c10 = peg$literalExpectation(' TS', false);
149
+ const peg$c11 = function (type, num) {
150
+ return {
151
+ type: 'TsError',
152
+ value: {
153
+ type,
154
+ errorString: `TS${num}`,
155
+ },
156
+ };
157
+ };
158
+ const peg$c12 = 'error';
159
+ const peg$c13 = peg$literalExpectation('error', false);
160
+ const peg$c14 = 'warning';
161
+ const peg$c15 = peg$literalExpectation('warning', false);
162
+ const peg$c16 = function (type) {
163
+ return type;
164
+ };
165
+ const peg$c17 = '(';
166
+ const peg$c18 = peg$literalExpectation('(', false);
167
+ const peg$c19 = ',';
168
+ const peg$c20 = peg$literalExpectation(',', false);
169
+ const peg$c21 = ')';
170
+ const peg$c22 = peg$literalExpectation(')', false);
171
+ const peg$c23 = function (line, col) {
172
+ return {
173
+ type: 'Cursor',
174
+ value: {
175
+ line,
176
+ col,
177
+ },
178
+ };
179
+ };
180
+ const peg$c24 = /^[^\n\r(]/;
181
+ const peg$c25 = peg$classExpectation(['\n', '\r', '('], true, false);
182
+ const peg$c26 = function (path) {
183
+ return {
184
+ type: 'Path',
185
+ value: path.join(''),
186
+ };
187
+ };
188
+ const peg$c27 = '\n';
189
+ const peg$c28 = peg$literalExpectation('\n', false);
190
+ const peg$c29 = function (text, newlines) {
191
+ return `${text.join('')}${newlines.join('')}`;
192
+ };
193
+ const peg$c30 = /^[^\n\r]/;
194
+ const peg$c31 = peg$classExpectation(['\n', '\r'], true, false);
195
+ const peg$c32 = /^[0-9]/;
196
+ const peg$c33 = peg$classExpectation([['0', '9']], false, false);
197
+ const peg$c34 = function (digits) {
198
+ return parseInt(digits.join(''), 10);
199
+ };
200
+ const peg$c35 = /^[ \t\r\n]/;
201
+ const peg$c36 = peg$classExpectation([' ', '\t', '\r', '\n'], false, false);
202
+ const peg$c37 = function () {
203
+ return null;
204
+ };
205
+ let peg$currPos = 0;
206
+ let peg$savedPos = 0;
207
+ const peg$posDetailsCache = [{ line: 1, column: 1 }];
208
+ let peg$maxFailPos = 0;
209
+ let peg$maxFailExpected = [];
210
+ let peg$silentFails = 0;
211
+ const peg$resultsCache = {};
212
+ let peg$result;
213
+ if (options.startRule !== undefined) {
214
+ if (!(options.startRule in peg$startRuleFunctions)) {
215
+ throw new Error('Can\'t start parsing from rule "' + options.startRule + '".');
216
+ }
217
+ peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
218
+ }
219
+ function peg$literalExpectation(text1, ignoreCase) {
220
+ return { type: 'literal', text: text1, ignoreCase: ignoreCase };
221
+ }
222
+ function peg$classExpectation(parts, inverted, ignoreCase) {
223
+ return { type: 'class', parts: parts, inverted: inverted, ignoreCase: ignoreCase };
224
+ }
225
+ function peg$endExpectation() {
226
+ return { type: 'end' };
227
+ }
228
+ function peg$computePosDetails(pos) {
229
+ let details = peg$posDetailsCache[pos];
230
+ let p;
231
+ if (details) {
232
+ return details;
233
+ }
234
+ else {
235
+ p = pos - 1;
236
+ while (!peg$posDetailsCache[p]) {
237
+ p--;
238
+ }
239
+ details = peg$posDetailsCache[p];
240
+ details = {
241
+ line: details.line,
242
+ column: details.column,
243
+ };
244
+ while (p < pos) {
245
+ if (input.charCodeAt(p) === 10) {
246
+ details.line++;
247
+ details.column = 1;
248
+ }
249
+ else {
250
+ details.column++;
251
+ }
252
+ p++;
253
+ }
254
+ peg$posDetailsCache[pos] = details;
255
+ return details;
256
+ }
257
+ }
258
+ function peg$computeLocation(startPos, endPos) {
259
+ const startPosDetails = peg$computePosDetails(startPos);
260
+ const endPosDetails = peg$computePosDetails(endPos);
261
+ return {
262
+ start: {
263
+ offset: startPos,
264
+ line: startPosDetails.line,
265
+ column: startPosDetails.column,
266
+ },
267
+ end: {
268
+ offset: endPos,
269
+ line: endPosDetails.line,
270
+ column: endPosDetails.column,
271
+ },
272
+ };
273
+ }
274
+ function peg$fail(expected1) {
275
+ if (peg$currPos < peg$maxFailPos) {
276
+ return;
277
+ }
278
+ if (peg$currPos > peg$maxFailPos) {
279
+ peg$maxFailPos = peg$currPos;
280
+ peg$maxFailExpected = [];
281
+ }
282
+ peg$maxFailExpected.push(expected1);
283
+ }
284
+ function peg$buildStructuredError(expected1, found, location1) {
285
+ return new SyntaxError(SyntaxError.buildMessage(expected1, found), expected1, found, location1);
286
+ }
287
+ function peg$parseMain() {
288
+ let s0, s1, s2, s3;
289
+ const key = peg$currPos * 13 + 0;
290
+ const cached = peg$resultsCache[key];
291
+ if (cached) {
292
+ peg$currPos = cached.nextPos;
293
+ return cached.result;
294
+ }
295
+ s0 = peg$currPos;
296
+ s1 = peg$parse_();
297
+ if (s1 !== peg$FAILED) {
298
+ s2 = [];
299
+ s3 = peg$parseItem();
300
+ while (s3 !== peg$FAILED) {
301
+ s2.push(s3);
302
+ s3 = peg$parseItem();
303
+ }
304
+ if (s2 !== peg$FAILED) {
305
+ s3 = peg$parse_();
306
+ if (s3 !== peg$FAILED) {
307
+ peg$savedPos = s0;
308
+ s1 = peg$c0(s2);
309
+ s0 = s1;
310
+ }
311
+ else {
312
+ peg$currPos = s0;
313
+ s0 = peg$FAILED;
314
+ }
315
+ }
316
+ else {
317
+ peg$currPos = s0;
318
+ s0 = peg$FAILED;
319
+ }
320
+ }
321
+ else {
322
+ peg$currPos = s0;
323
+ s0 = peg$FAILED;
324
+ }
325
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
326
+ return s0;
327
+ }
328
+ function peg$parseItem() {
329
+ let s0, s1, s2, s3, s4, s5, s6, s7, s8;
330
+ const key = peg$currPos * 13 + 1;
331
+ const cached = peg$resultsCache[key];
332
+ if (cached) {
333
+ peg$currPos = cached.nextPos;
334
+ return cached.result;
335
+ }
336
+ s0 = peg$currPos;
337
+ s1 = peg$parsePath();
338
+ if (s1 !== peg$FAILED) {
339
+ s2 = peg$parseCursor();
340
+ if (s2 !== peg$FAILED) {
341
+ if (input.charCodeAt(peg$currPos) === 58) {
342
+ s3 = peg$c1;
343
+ peg$currPos++;
344
+ }
345
+ else {
346
+ s3 = peg$FAILED;
347
+ if (peg$silentFails === 0) {
348
+ peg$fail(peg$c2);
349
+ }
350
+ }
351
+ if (s3 !== peg$FAILED) {
352
+ s4 = peg$parse_();
353
+ if (s4 !== peg$FAILED) {
354
+ s5 = peg$parseTsError();
355
+ if (s5 !== peg$FAILED) {
356
+ s6 = peg$parse_();
357
+ if (s6 !== peg$FAILED) {
358
+ if (input.charCodeAt(peg$currPos) === 58) {
359
+ s7 = peg$c1;
360
+ peg$currPos++;
361
+ }
362
+ else {
363
+ s7 = peg$FAILED;
364
+ if (peg$silentFails === 0) {
365
+ peg$fail(peg$c2);
366
+ }
367
+ }
368
+ if (s7 !== peg$FAILED) {
369
+ s8 = peg$parseMessage();
370
+ if (s8 !== peg$FAILED) {
371
+ peg$savedPos = s0;
372
+ s1 = peg$c3(s1, s2, s5, s8);
373
+ s0 = s1;
374
+ }
375
+ else {
376
+ peg$currPos = s0;
377
+ s0 = peg$FAILED;
378
+ }
379
+ }
380
+ else {
381
+ peg$currPos = s0;
382
+ s0 = peg$FAILED;
383
+ }
384
+ }
385
+ else {
386
+ peg$currPos = s0;
387
+ s0 = peg$FAILED;
388
+ }
389
+ }
390
+ else {
391
+ peg$currPos = s0;
392
+ s0 = peg$FAILED;
393
+ }
394
+ }
395
+ else {
396
+ peg$currPos = s0;
397
+ s0 = peg$FAILED;
398
+ }
399
+ }
400
+ else {
401
+ peg$currPos = s0;
402
+ s0 = peg$FAILED;
403
+ }
404
+ }
405
+ else {
406
+ peg$currPos = s0;
407
+ s0 = peg$FAILED;
408
+ }
409
+ }
410
+ else {
411
+ peg$currPos = s0;
412
+ s0 = peg$FAILED;
413
+ }
414
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
415
+ return s0;
416
+ }
417
+ function peg$parseMessage() {
418
+ let s0, s1, s2, s3;
419
+ const key = peg$currPos * 13 + 2;
420
+ const cached = peg$resultsCache[key];
421
+ if (cached) {
422
+ peg$currPos = cached.nextPos;
423
+ return cached.result;
424
+ }
425
+ s0 = peg$currPos;
426
+ s1 = peg$parseTextLine();
427
+ if (s1 !== peg$FAILED) {
428
+ s2 = [];
429
+ s3 = peg$parseMessageExtraLine();
430
+ while (s3 !== peg$FAILED) {
431
+ s2.push(s3);
432
+ s3 = peg$parseMessageExtraLine();
433
+ }
434
+ if (s2 !== peg$FAILED) {
435
+ peg$savedPos = s0;
436
+ s1 = peg$c4(s1, s2);
437
+ s0 = s1;
438
+ }
439
+ else {
440
+ peg$currPos = s0;
441
+ s0 = peg$FAILED;
442
+ }
443
+ }
444
+ else {
445
+ peg$currPos = s0;
446
+ s0 = peg$FAILED;
447
+ }
448
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
449
+ return s0;
450
+ }
451
+ function peg$parseMessageExtraLine() {
452
+ let s0, s1, s2;
453
+ const key = peg$currPos * 13 + 3;
454
+ const cached = peg$resultsCache[key];
455
+ if (cached) {
456
+ peg$currPos = cached.nextPos;
457
+ return cached.result;
458
+ }
459
+ s0 = peg$currPos;
460
+ s1 = peg$parseMessageExtraLineStart();
461
+ if (s1 !== peg$FAILED) {
462
+ s2 = peg$parseTextLine();
463
+ if (s2 !== peg$FAILED) {
464
+ peg$savedPos = s0;
465
+ s1 = peg$c5(s1, s2);
466
+ s0 = s1;
467
+ }
468
+ else {
469
+ peg$currPos = s0;
470
+ s0 = peg$FAILED;
471
+ }
472
+ }
473
+ else {
474
+ peg$currPos = s0;
475
+ s0 = peg$FAILED;
476
+ }
477
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
478
+ return s0;
479
+ }
480
+ function peg$parseMessageExtraLineStart() {
481
+ let s0, s1;
482
+ const key = peg$currPos * 13 + 4;
483
+ const cached = peg$resultsCache[key];
484
+ if (cached) {
485
+ peg$currPos = cached.nextPos;
486
+ return cached.result;
487
+ }
488
+ s0 = peg$currPos;
489
+ if (input.substr(peg$currPos, 2) === peg$c6) {
490
+ s1 = peg$c6;
491
+ peg$currPos += 2;
492
+ }
493
+ else {
494
+ s1 = peg$FAILED;
495
+ if (peg$silentFails === 0) {
496
+ peg$fail(peg$c7);
497
+ }
498
+ }
499
+ if (s1 !== peg$FAILED) {
500
+ peg$savedPos = s0;
501
+ s1 = peg$c8(s1);
502
+ }
503
+ s0 = s1;
504
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
505
+ return s0;
506
+ }
507
+ function peg$parseTsError() {
508
+ let s0, s1, s2, s3;
509
+ const key = peg$currPos * 13 + 5;
510
+ const cached = peg$resultsCache[key];
511
+ if (cached) {
512
+ peg$currPos = cached.nextPos;
513
+ return cached.result;
514
+ }
515
+ s0 = peg$currPos;
516
+ s1 = peg$parseTsErrorType();
517
+ if (s1 !== peg$FAILED) {
518
+ if (input.substr(peg$currPos, 3) === peg$c9) {
519
+ s2 = peg$c9;
520
+ peg$currPos += 3;
521
+ }
522
+ else {
523
+ s2 = peg$FAILED;
524
+ if (peg$silentFails === 0) {
525
+ peg$fail(peg$c10);
526
+ }
527
+ }
528
+ if (s2 !== peg$FAILED) {
529
+ s3 = peg$parseInteger();
530
+ if (s3 !== peg$FAILED) {
531
+ peg$savedPos = s0;
532
+ s1 = peg$c11(s1, s3);
533
+ s0 = s1;
534
+ }
535
+ else {
536
+ peg$currPos = s0;
537
+ s0 = peg$FAILED;
538
+ }
539
+ }
540
+ else {
541
+ peg$currPos = s0;
542
+ s0 = peg$FAILED;
543
+ }
544
+ }
545
+ else {
546
+ peg$currPos = s0;
547
+ s0 = peg$FAILED;
548
+ }
549
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
550
+ return s0;
551
+ }
552
+ function peg$parseTsErrorType() {
553
+ let s0, s1;
554
+ const key = peg$currPos * 13 + 6;
555
+ const cached = peg$resultsCache[key];
556
+ if (cached) {
557
+ peg$currPos = cached.nextPos;
558
+ return cached.result;
559
+ }
560
+ s0 = peg$currPos;
561
+ if (input.substr(peg$currPos, 5) === peg$c12) {
562
+ s1 = peg$c12;
563
+ peg$currPos += 5;
564
+ }
565
+ else {
566
+ s1 = peg$FAILED;
567
+ if (peg$silentFails === 0) {
568
+ peg$fail(peg$c13);
569
+ }
570
+ }
571
+ if (s1 === peg$FAILED) {
572
+ if (input.substr(peg$currPos, 7) === peg$c14) {
573
+ s1 = peg$c14;
574
+ peg$currPos += 7;
575
+ }
576
+ else {
577
+ s1 = peg$FAILED;
578
+ if (peg$silentFails === 0) {
579
+ peg$fail(peg$c15);
580
+ }
581
+ }
582
+ }
583
+ if (s1 !== peg$FAILED) {
584
+ peg$savedPos = s0;
585
+ s1 = peg$c16(s1);
586
+ }
587
+ s0 = s1;
588
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
589
+ return s0;
590
+ }
591
+ function peg$parseCursor() {
592
+ let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
593
+ const key = peg$currPos * 13 + 7;
594
+ const cached = peg$resultsCache[key];
595
+ if (cached) {
596
+ peg$currPos = cached.nextPos;
597
+ return cached.result;
598
+ }
599
+ s0 = peg$currPos;
600
+ if (input.charCodeAt(peg$currPos) === 40) {
601
+ s1 = peg$c17;
602
+ peg$currPos++;
603
+ }
604
+ else {
605
+ s1 = peg$FAILED;
606
+ if (peg$silentFails === 0) {
607
+ peg$fail(peg$c18);
608
+ }
609
+ }
610
+ if (s1 !== peg$FAILED) {
611
+ s2 = peg$parse_();
612
+ if (s2 !== peg$FAILED) {
613
+ s3 = peg$parseInteger();
614
+ if (s3 !== peg$FAILED) {
615
+ s4 = peg$parse_();
616
+ if (s4 !== peg$FAILED) {
617
+ if (input.charCodeAt(peg$currPos) === 44) {
618
+ s5 = peg$c19;
619
+ peg$currPos++;
620
+ }
621
+ else {
622
+ s5 = peg$FAILED;
623
+ if (peg$silentFails === 0) {
624
+ peg$fail(peg$c20);
625
+ }
626
+ }
627
+ if (s5 !== peg$FAILED) {
628
+ s6 = peg$parse_();
629
+ if (s6 !== peg$FAILED) {
630
+ s7 = peg$parseInteger();
631
+ if (s7 !== peg$FAILED) {
632
+ s8 = peg$parse_();
633
+ if (s8 !== peg$FAILED) {
634
+ if (input.charCodeAt(peg$currPos) === 41) {
635
+ s9 = peg$c21;
636
+ peg$currPos++;
637
+ }
638
+ else {
639
+ s9 = peg$FAILED;
640
+ if (peg$silentFails === 0) {
641
+ peg$fail(peg$c22);
642
+ }
643
+ }
644
+ if (s9 !== peg$FAILED) {
645
+ peg$savedPos = s0;
646
+ s1 = peg$c23(s3, s7);
647
+ s0 = s1;
648
+ }
649
+ else {
650
+ peg$currPos = s0;
651
+ s0 = peg$FAILED;
652
+ }
653
+ }
654
+ else {
655
+ peg$currPos = s0;
656
+ s0 = peg$FAILED;
657
+ }
658
+ }
659
+ else {
660
+ peg$currPos = s0;
661
+ s0 = peg$FAILED;
662
+ }
663
+ }
664
+ else {
665
+ peg$currPos = s0;
666
+ s0 = peg$FAILED;
667
+ }
668
+ }
669
+ else {
670
+ peg$currPos = s0;
671
+ s0 = peg$FAILED;
672
+ }
673
+ }
674
+ else {
675
+ peg$currPos = s0;
676
+ s0 = peg$FAILED;
677
+ }
678
+ }
679
+ else {
680
+ peg$currPos = s0;
681
+ s0 = peg$FAILED;
682
+ }
683
+ }
684
+ else {
685
+ peg$currPos = s0;
686
+ s0 = peg$FAILED;
687
+ }
688
+ }
689
+ else {
690
+ peg$currPos = s0;
691
+ s0 = peg$FAILED;
692
+ }
693
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
694
+ return s0;
695
+ }
696
+ function peg$parsePath() {
697
+ let s0, s1, s2;
698
+ const key = peg$currPos * 13 + 8;
699
+ const cached = peg$resultsCache[key];
700
+ if (cached) {
701
+ peg$currPos = cached.nextPos;
702
+ return cached.result;
703
+ }
704
+ s0 = peg$currPos;
705
+ s1 = [];
706
+ if (peg$c24.test(input.charAt(peg$currPos))) {
707
+ s2 = input.charAt(peg$currPos);
708
+ peg$currPos++;
709
+ }
710
+ else {
711
+ s2 = peg$FAILED;
712
+ if (peg$silentFails === 0) {
713
+ peg$fail(peg$c25);
714
+ }
715
+ }
716
+ if (s2 !== peg$FAILED) {
717
+ while (s2 !== peg$FAILED) {
718
+ s1.push(s2);
719
+ if (peg$c24.test(input.charAt(peg$currPos))) {
720
+ s2 = input.charAt(peg$currPos);
721
+ peg$currPos++;
722
+ }
723
+ else {
724
+ s2 = peg$FAILED;
725
+ if (peg$silentFails === 0) {
726
+ peg$fail(peg$c25);
727
+ }
728
+ }
729
+ }
730
+ }
731
+ else {
732
+ s1 = peg$FAILED;
733
+ }
734
+ if (s1 !== peg$FAILED) {
735
+ peg$savedPos = s0;
736
+ s1 = peg$c26(s1);
737
+ }
738
+ s0 = s1;
739
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
740
+ return s0;
741
+ }
742
+ function peg$parseTextLine() {
743
+ let s0, s1, s2, s3;
744
+ const key = peg$currPos * 13 + 9;
745
+ const cached = peg$resultsCache[key];
746
+ if (cached) {
747
+ peg$currPos = cached.nextPos;
748
+ return cached.result;
749
+ }
750
+ s0 = peg$currPos;
751
+ s1 = [];
752
+ s2 = peg$parseAnyCharExceptNewLine();
753
+ if (s2 !== peg$FAILED) {
754
+ while (s2 !== peg$FAILED) {
755
+ s1.push(s2);
756
+ s2 = peg$parseAnyCharExceptNewLine();
757
+ }
758
+ }
759
+ else {
760
+ s1 = peg$FAILED;
761
+ }
762
+ if (s1 !== peg$FAILED) {
763
+ s2 = [];
764
+ if (input.charCodeAt(peg$currPos) === 10) {
765
+ s3 = peg$c27;
766
+ peg$currPos++;
767
+ }
768
+ else {
769
+ s3 = peg$FAILED;
770
+ if (peg$silentFails === 0) {
771
+ peg$fail(peg$c28);
772
+ }
773
+ }
774
+ while (s3 !== peg$FAILED) {
775
+ s2.push(s3);
776
+ if (input.charCodeAt(peg$currPos) === 10) {
777
+ s3 = peg$c27;
778
+ peg$currPos++;
779
+ }
780
+ else {
781
+ s3 = peg$FAILED;
782
+ if (peg$silentFails === 0) {
783
+ peg$fail(peg$c28);
784
+ }
785
+ }
786
+ }
787
+ if (s2 !== peg$FAILED) {
788
+ peg$savedPos = s0;
789
+ s1 = peg$c29(s1, s2);
790
+ s0 = s1;
791
+ }
792
+ else {
793
+ peg$currPos = s0;
794
+ s0 = peg$FAILED;
795
+ }
796
+ }
797
+ else {
798
+ peg$currPos = s0;
799
+ s0 = peg$FAILED;
800
+ }
801
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
802
+ return s0;
803
+ }
804
+ function peg$parseAnyCharExceptNewLine() {
805
+ let s0;
806
+ const key = peg$currPos * 13 + 10;
807
+ const cached = peg$resultsCache[key];
808
+ if (cached) {
809
+ peg$currPos = cached.nextPos;
810
+ return cached.result;
811
+ }
812
+ if (peg$c30.test(input.charAt(peg$currPos))) {
813
+ s0 = input.charAt(peg$currPos);
814
+ peg$currPos++;
815
+ }
816
+ else {
817
+ s0 = peg$FAILED;
818
+ if (peg$silentFails === 0) {
819
+ peg$fail(peg$c31);
820
+ }
821
+ }
822
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
823
+ return s0;
824
+ }
825
+ function peg$parseInteger() {
826
+ let s0, s1, s2;
827
+ const key = peg$currPos * 13 + 11;
828
+ const cached = peg$resultsCache[key];
829
+ if (cached) {
830
+ peg$currPos = cached.nextPos;
831
+ return cached.result;
832
+ }
833
+ s0 = peg$currPos;
834
+ s1 = [];
835
+ if (peg$c32.test(input.charAt(peg$currPos))) {
836
+ s2 = input.charAt(peg$currPos);
837
+ peg$currPos++;
838
+ }
839
+ else {
840
+ s2 = peg$FAILED;
841
+ if (peg$silentFails === 0) {
842
+ peg$fail(peg$c33);
843
+ }
844
+ }
845
+ if (s2 !== peg$FAILED) {
846
+ while (s2 !== peg$FAILED) {
847
+ s1.push(s2);
848
+ if (peg$c32.test(input.charAt(peg$currPos))) {
849
+ s2 = input.charAt(peg$currPos);
850
+ peg$currPos++;
851
+ }
852
+ else {
853
+ s2 = peg$FAILED;
854
+ if (peg$silentFails === 0) {
855
+ peg$fail(peg$c33);
856
+ }
857
+ }
858
+ }
859
+ }
860
+ else {
861
+ s1 = peg$FAILED;
862
+ }
863
+ if (s1 !== peg$FAILED) {
864
+ peg$savedPos = s0;
865
+ s1 = peg$c34(s1);
866
+ }
867
+ s0 = s1;
868
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
869
+ return s0;
870
+ }
871
+ function peg$parse_() {
872
+ let s0, s1, s2;
873
+ const key = peg$currPos * 13 + 12;
874
+ const cached = peg$resultsCache[key];
875
+ if (cached) {
876
+ peg$currPos = cached.nextPos;
877
+ return cached.result;
878
+ }
879
+ s0 = peg$currPos;
880
+ s1 = [];
881
+ if (peg$c35.test(input.charAt(peg$currPos))) {
882
+ s2 = input.charAt(peg$currPos);
883
+ peg$currPos++;
884
+ }
885
+ else {
886
+ s2 = peg$FAILED;
887
+ if (peg$silentFails === 0) {
888
+ peg$fail(peg$c36);
889
+ }
890
+ }
891
+ while (s2 !== peg$FAILED) {
892
+ s1.push(s2);
893
+ if (peg$c35.test(input.charAt(peg$currPos))) {
894
+ s2 = input.charAt(peg$currPos);
895
+ peg$currPos++;
896
+ }
897
+ else {
898
+ s2 = peg$FAILED;
899
+ if (peg$silentFails === 0) {
900
+ peg$fail(peg$c36);
901
+ }
902
+ }
903
+ }
904
+ if (s1 !== peg$FAILED) {
905
+ peg$savedPos = s0;
906
+ s1 = peg$c37();
907
+ }
908
+ s0 = s1;
909
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
910
+ return s0;
911
+ }
912
+ peg$result = peg$startRuleFunction();
913
+ if (peg$result !== peg$FAILED && peg$currPos === input.length) {
914
+ return peg$result;
915
+ }
916
+ else {
917
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
918
+ peg$fail(peg$endExpectation());
919
+ }
920
+ throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length
921
+ ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
922
+ : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
923
+ }
924
+ }
925
+ export const parse = peg$parse;
926
+ //# sourceMappingURL=tsc-output-parser.js.map