@aws/cloudformation-languageserver 0.0.0 → 1.14.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.
Files changed (75) hide show
  1. package/LICENSE +175 -0
  2. package/NOTICE +10 -0
  3. package/README.md +70 -3
  4. package/THIRD-PARTY-LICENSES.txt +15761 -0
  5. package/assets/featureFlag/alpha.json +57 -0
  6. package/assets/featureFlag/beta.json +56 -0
  7. package/assets/featureFlag/prod.json +56 -0
  8. package/assets/relationship_schemas.json +16282 -0
  9. package/assets/release-manifest.json +1115 -0
  10. package/assets/wheels/annotated_types-0.7.0-py3-none-any.whl +0 -0
  11. package/assets/wheels/attrs-26.1.0-py3-none-any.whl +0 -0
  12. package/assets/wheels/aws_sam_translator-1.109.0-py3-none-any.whl +0 -0
  13. package/assets/wheels/boto3-1.43.4-py3-none-any.whl +0 -0
  14. package/assets/wheels/botocore-1.43.4-py3-none-any.whl +0 -0
  15. package/assets/wheels/cfn_lint-1.57.0-py3-none-any.whl +0 -0
  16. package/assets/wheels/jmespath-1.1.0-py3-none-any.whl +0 -0
  17. package/assets/wheels/jsonpatch-1.33-py2.py3-none-any.whl +0 -0
  18. package/assets/wheels/jsonpointer-3.1.1-py3-none-any.whl +0 -0
  19. package/assets/wheels/jsonschema-4.26.0-py3-none-any.whl +0 -0
  20. package/assets/wheels/jsonschema_specifications-2025.9.1-py3-none-any.whl +0 -0
  21. package/assets/wheels/micropip-0.10.1-py3-none-any.whl +0 -0
  22. package/assets/wheels/mpmath-1.4.1-py3-none-any.whl +0 -0
  23. package/assets/wheels/networkx-3.6.1-py3-none-any.whl +0 -0
  24. package/assets/wheels/pydantic-2.10.6-py3-none-any.whl +0 -0
  25. package/assets/wheels/pydantic_core-2.27.2-cp313-cp313-pyodide_2025_0_wasm32.whl +0 -0
  26. package/assets/wheels/python_dateutil-2.9.0.post0-py2.py3-none-any.whl +0 -0
  27. package/assets/wheels/pyyaml-6.0.2-cp313-cp313-pyodide_2025_0_wasm32.whl +0 -0
  28. package/assets/wheels/referencing-0.37.0-py3-none-any.whl +0 -0
  29. package/assets/wheels/regex-2024.11.6-cp313-cp313-pyodide_2025_0_wasm32.whl +0 -0
  30. package/assets/wheels/rpds_py-0.23.1-cp313-cp313-pyodide_2025_0_wasm32.whl +0 -0
  31. package/assets/wheels/s3transfer-0.17.0-py3-none-any.whl +0 -0
  32. package/assets/wheels/six-1.17.0-py2.py3-none-any.whl +0 -0
  33. package/assets/wheels/sympy-1.14.0-py3-none-any.whl +0 -0
  34. package/assets/wheels/typing_extensions-4.15.0-py3-none-any.whl +0 -0
  35. package/assets/wheels/urllib3-2.7.0-py3-none-any.whl +0 -0
  36. package/cfn-lsp-server-standalone.js +45233 -0
  37. package/cfn-lsp-server-standalone.js.map +1 -0
  38. package/cfn-validate-worker.js +83 -0
  39. package/cfn-validate-worker.js.map +1 -0
  40. package/guard_bg.wasm +0 -0
  41. package/node_modules_aws-sdk_credential-provider-http_dist-es_index_js.js +225 -0
  42. package/node_modules_aws-sdk_credential-provider-http_dist-es_index_js.js.map +1 -0
  43. package/node_modules_aws-sdk_credential-provider-ini_dist-es_index_js.js +280 -0
  44. package/node_modules_aws-sdk_credential-provider-ini_dist-es_index_js.js.map +1 -0
  45. package/node_modules_aws-sdk_credential-provider-login_dist-es_index_js.js +329 -0
  46. package/node_modules_aws-sdk_credential-provider-login_dist-es_index_js.js.map +1 -0
  47. package/node_modules_aws-sdk_credential-provider-process_dist-es_index_js.js +111 -0
  48. package/node_modules_aws-sdk_credential-provider-process_dist-es_index_js.js.map +1 -0
  49. package/node_modules_aws-sdk_credential-provider-sso_dist-es_index_js.js +424 -0
  50. package/node_modules_aws-sdk_credential-provider-sso_dist-es_index_js.js.map +1 -0
  51. package/node_modules_aws-sdk_credential-provider-web-identity_dist-es_index_js.js +90 -0
  52. package/node_modules_aws-sdk_credential-provider-web-identity_dist-es_index_js.js.map +1 -0
  53. package/node_modules_smithy_credential-provider-imds_dist-es_index_js.js +437 -0
  54. package/node_modules_smithy_credential-provider-imds_dist-es_index_js.js.map +1 -0
  55. package/package.json +74 -7
  56. package/pyodide-worker.js +1207 -0
  57. package/pyodide-worker.js.map +1 -0
  58. package/vendor/cfn-guard/guard.js +414 -0
  59. package/vendor/cfn-guard/guard_bg.wasm +0 -0
  60. package/vendor/cfn-guard/index.js +87 -0
  61. package/vendor/cfn-guard/package.json +39 -0
  62. package/vendors-node_modules_aws-sdk_client-cloudcontrol_dist-es_index_js-node_modules_aws-sdk_client-4d5eee.js +140762 -0
  63. package/vendors-node_modules_aws-sdk_client-cloudcontrol_dist-es_index_js-node_modules_aws-sdk_client-4d5eee.js.map +1 -0
  64. package/vendors-node_modules_aws-sdk_credential-provider-sso_dist-es_loadSso_js.js +577 -0
  65. package/vendors-node_modules_aws-sdk_credential-provider-sso_dist-es_loadSso_js.js.map +1 -0
  66. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_signin_index_js.js +697 -0
  67. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_signin_index_js.js.map +1 -0
  68. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_sso-oidc_index_js.js +769 -0
  69. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_sso-oidc_index_js.js.map +1 -0
  70. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_sts_index_js.js +990 -0
  71. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_sts_index_js.js.map +1 -0
  72. package/vendors-node_modules_base2_pretty-print-object_dist_index_js-node_modules_vscode-jsonrpc_node-9a0a8d.js +8429 -0
  73. package/vendors-node_modules_base2_pretty-print-object_dist_index_js-node_modules_vscode-jsonrpc_node-9a0a8d.js.map +1 -0
  74. package/vendors-node_modules_bowser_src_bowser_js.js +3300 -0
  75. package/vendors-node_modules_bowser_src_bowser_js.js.map +1 -0
@@ -0,0 +1,1207 @@
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ var __webpack_modules__ = ({
4
+
5
+ /***/ "./src/services/cfnLint/CfnLintDiagnosticConverter.ts"
6
+ (__unused_webpack_module, exports, __webpack_require__) {
7
+
8
+ var __webpack_unused_export__;
9
+
10
+ __webpack_unused_export__ = ({ value: true });
11
+ exports.toPublishDiagnostics = toPublishDiagnostics;
12
+ const vscode_languageserver_1 = __webpack_require__("./node_modules/vscode-languageserver/lib/node/main.js");
13
+ // Returns [] (not [{uri, diagnostics: []}]) when no findings, so callers can skip publishing.
14
+ function toPublishDiagnostics(diagnostics, uri) {
15
+ if (!diagnostics || diagnostics.length === 0) {
16
+ return [];
17
+ }
18
+ const lspDiagnostics = diagnostics.map((item) => {
19
+ const base = {
20
+ severity: convertSeverity(item.Level),
21
+ range: {
22
+ start: {
23
+ line: Math.max(0, (item.Location?.Start?.LineNumber || 1) - 1),
24
+ character: Math.max(0, (item.Location?.Start?.ColumnNumber || 1) - 1),
25
+ },
26
+ end: {
27
+ line: Math.max(0, (item.Location?.End?.LineNumber || 1) - 1),
28
+ character: Math.max(0, (item.Location?.End?.ColumnNumber || 1) - 1),
29
+ },
30
+ },
31
+ message: item.Message || 'Unknown cfn-lint error',
32
+ source: 'cfn-lint',
33
+ code: item.Rule?.Id || 'unknown',
34
+ };
35
+ const sourceUrl = item.Rule?.Source;
36
+ if (sourceUrl) {
37
+ return { ...base, codeDescription: { href: sourceUrl } };
38
+ }
39
+ return base;
40
+ });
41
+ return [{ uri, diagnostics: lspDiagnostics }];
42
+ }
43
+ function convertSeverity(level) {
44
+ switch (level) {
45
+ case 'Error': {
46
+ return vscode_languageserver_1.DiagnosticSeverity.Error;
47
+ }
48
+ case 'Warning': {
49
+ return vscode_languageserver_1.DiagnosticSeverity.Warning;
50
+ }
51
+ case 'Informational':
52
+ case 'Info': {
53
+ return vscode_languageserver_1.DiagnosticSeverity.Information;
54
+ }
55
+ default: {
56
+ return vscode_languageserver_1.DiagnosticSeverity.Information;
57
+ }
58
+ }
59
+ }
60
+
61
+
62
+ /***/ },
63
+
64
+ /***/ "./src/services/cfnLint/pyodide-worker.ts"
65
+ (__unused_webpack_module, exports, __webpack_require__) {
66
+
67
+
68
+ var __importDefault = (this && this.__importDefault) || function (mod) {
69
+ return (mod && mod.__esModule) ? mod : { "default": mod };
70
+ };
71
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
72
+ exports.convertPythonResultToDiagnostics = convertPythonResultToDiagnostics;
73
+ const path_1 = __importDefault(__webpack_require__("path"));
74
+ const worker_threads_1 = __webpack_require__("worker_threads");
75
+ const pyodide_1 = __webpack_require__("pyodide");
76
+ const ErrorUtils_1 = __webpack_require__("./src/utils/errors/ErrorUtils.ts");
77
+ const CfnLintDiagnosticConverter_1 = __webpack_require__("./src/services/cfnLint/CfnLintDiagnosticConverter.ts");
78
+ // Instead of sending stdout/stderr messages back to the main thread,
79
+ // we'll just log them in the worker thread
80
+ const customStdout = (_text) => {
81
+ // No-op in production, used for debugging
82
+ // console.log(text);
83
+ };
84
+ const customStderr = (_text) => {
85
+ // No-op in production, used for debugging
86
+ // console.error(text);
87
+ };
88
+ let pyodide;
89
+ let initialized = false;
90
+ let initializing = false;
91
+ // Handle messages from main thread
92
+ if (worker_threads_1.parentPort) {
93
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
94
+ worker_threads_1.parentPort.on('message', async (message) => {
95
+ const { id, action, payload } = message;
96
+ try {
97
+ let result;
98
+ switch (action) {
99
+ case 'initialize': {
100
+ result = await initializePyodide();
101
+ break;
102
+ }
103
+ case 'lint': {
104
+ result = await lintTemplate(payload.content, payload.uri, payload.fileType, payload.settings);
105
+ break;
106
+ }
107
+ case 'lintFile': {
108
+ result = await lintFile(payload.path, payload.uri, payload.fileType, payload.settings);
109
+ break;
110
+ }
111
+ case 'mountFolder': {
112
+ result = mountFolder(payload.fsDir, payload.mountDir);
113
+ break;
114
+ }
115
+ case 'getVersion': {
116
+ result = await getVersion();
117
+ break;
118
+ }
119
+ default: {
120
+ throw new Error(`Unknown action: ${action}`);
121
+ }
122
+ }
123
+ // Send successful result back to main thread
124
+ if (worker_threads_1.parentPort !== null && worker_threads_1.parentPort !== undefined) {
125
+ worker_threads_1.parentPort.postMessage({ id, result, success: true });
126
+ }
127
+ }
128
+ catch (error) {
129
+ // Send error back to main thread
130
+ if (worker_threads_1.parentPort !== null && worker_threads_1.parentPort !== undefined) {
131
+ worker_threads_1.parentPort.postMessage({
132
+ id,
133
+ error: (0, ErrorUtils_1.extractErrorMessage)(error),
134
+ success: false,
135
+ phase: action === 'initialize' ? currentInitPhase : undefined,
136
+ });
137
+ }
138
+ }
139
+ });
140
+ }
141
+ let currentInitPhase = 'pyodide_load';
142
+ // Initialize Pyodide with cfn-lint
143
+ async function initializePyodide() {
144
+ if (initialized) {
145
+ return { status: 'already-initialized' };
146
+ }
147
+ if (initializing) {
148
+ return { status: 'already-initializing' };
149
+ }
150
+ initializing = true;
151
+ try {
152
+ // Load Pyodide with explicit stdout/stderr handlers
153
+ currentInitPhase = 'pyodide_load';
154
+ pyodide = await (0, pyodide_1.loadPyodide)({
155
+ stdout: customStdout,
156
+ stderr: customStderr,
157
+ });
158
+ if (!pyodide) {
159
+ throw new Error('Failed to initialize Pyodide: returned null');
160
+ }
161
+ // Mount assets directory early so local wheels are available as fallback
162
+ const assetsPath = path_1.default.join(__dirname, 'assets');
163
+ try {
164
+ pyodide.FS.mkdirTree('/assets');
165
+ pyodide.mountNodeFS('/assets', assetsPath);
166
+ }
167
+ catch {
168
+ // Failed to mount assets directory
169
+ }
170
+ // Load bootstrap packages — micropip is required for fallback installs
171
+ // loadPackage fetches from JsDelivr CDN which can silently fail
172
+ // Set CFN_LSP_OFFLINE=1 to skip CDN and test local wheel fallback
173
+ currentInitPhase = 'micropip_load';
174
+ const offlineMode = process.env.CFN_LSP_OFFLINE === '1';
175
+ if (!offlineMode) {
176
+ await pyodide.loadPackage('micropip');
177
+ }
178
+ // ssl is a system shared library — must always use loadPackage (can't install via micropip)
179
+ currentInitPhase = 'ssl_load';
180
+ await pyodide.loadPackage('ssl');
181
+ // Verify micropip is available; fall back to local wheel if CDN failed
182
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
183
+ const micropipAvailable = await pyodide.runPythonAsync(`
184
+ try:
185
+ import micropip
186
+ True
187
+ except ModuleNotFoundError:
188
+ False
189
+ `);
190
+ if (!micropipAvailable) {
191
+ // loadPackage with emfs: URLs also silently fails, so unzip directly
192
+ await pyodide.runPythonAsync(`
193
+ from pathlib import Path
194
+ from zipfile import ZipFile
195
+ import importlib, site
196
+ wheels = list(Path('/assets/wheels').glob('micropip-*.whl'))
197
+ if not wheels:
198
+ raise ModuleNotFoundError('micropip not available and no local wheel found')
199
+ with ZipFile(str(wheels[0])) as zf:
200
+ zf.extractall(site.getsitepackages()[0])
201
+ importlib.invalidate_caches()
202
+ import micropip
203
+ `);
204
+ }
205
+ // Load packages with verification and local wheel/micropip fallback
206
+ // Define the package mapping once, used for both verification and cfn-lint skip logic
207
+ currentInitPhase = 'packages_load';
208
+ const pyodidePackages = ['pyyaml', 'regex', 'rpds-py', 'pydantic', 'pydantic-core'];
209
+ if (!offlineMode) {
210
+ for (const pkg of pyodidePackages) {
211
+ await pyodide.loadPackage(pkg);
212
+ }
213
+ }
214
+ await pyodide.runPythonAsync(`
215
+ import micropip
216
+ from pathlib import Path
217
+
218
+ # Package name -> import name mapping for Pyodide-managed packages
219
+ PYODIDE_PACKAGES = {
220
+ "micropip": "micropip", "pyyaml": "yaml", "regex": "regex",
221
+ "rpds-py": "rpds", "pydantic": "pydantic", "pydantic-core": "pydantic_core", "ssl": "ssl",
222
+ }
223
+
224
+ _wheels_dir = Path('/assets/wheels')
225
+ for pkg_name, import_name in PYODIDE_PACKAGES.items():
226
+ try:
227
+ __import__(import_name)
228
+ except ModuleNotFoundError:
229
+ _installed = False
230
+ if _wheels_dir.exists():
231
+ _prefix = pkg_name.replace('-', '_')
232
+ _local = [w for w in _wheels_dir.glob('*.whl') if w.name.lower().startswith(_prefix.lower())]
233
+ if _local:
234
+ try:
235
+ await micropip.install(f'emfs:{_local[0]}', deps=False)
236
+ _installed = True
237
+ except Exception:
238
+ pass
239
+ if not _installed:
240
+ await micropip.install(pkg_name)
241
+ `);
242
+ // Replace CSafeLoader with SafeLoader to avoid Pyodide parsing issues
243
+ await pyodide.runPythonAsync(`
244
+ import yaml
245
+ if hasattr(yaml, 'CSafeLoader'):
246
+ yaml.CSafeLoader = yaml.SafeLoader
247
+ `);
248
+ // Install cfn-lint with local wheel fallback
249
+ currentInitPhase = 'cfn_lint_install';
250
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
251
+ const installResult = await pyodide.runPythonAsync(`
252
+ import micropip
253
+ from pathlib import Path
254
+
255
+ cfn_lint_installed = False
256
+ install_source = None
257
+
258
+ # Try to install latest from PyPI first
259
+ try:
260
+ await micropip.install('cfn-lint')
261
+ cfn_lint_installed = True
262
+ install_source = 'pypi'
263
+ except Exception:
264
+ pass
265
+
266
+ # Fallback to local wheels if online installation failed
267
+ if not cfn_lint_installed:
268
+ wheels_dir = Path('/assets/wheels')
269
+ _fail_reason = f'wheels_dir exists={wheels_dir.exists()}'
270
+
271
+ if wheels_dir.exists():
272
+ wheel_files = list(wheels_dir.glob('*.whl'))
273
+ _fail_reason = f'{len(wheel_files)} wheel files found'
274
+
275
+ if wheel_files:
276
+ try:
277
+ # Skip packages already installed above
278
+ _skip = {p.replace('-','_') for p in PYODIDE_PACKAGES}
279
+ for whl in wheel_files:
280
+ if whl.name.split('-')[0].lower() in _skip:
281
+ continue
282
+ await micropip.install(f'emfs:{whl}', deps=False)
283
+ cfn_lint_installed = True
284
+ install_source = 'wheels'
285
+ except Exception as e:
286
+ _fail_reason = f'wheel install error: {e}'
287
+
288
+ if not cfn_lint_installed:
289
+ raise Exception(f'Failed to install cfn-lint from both PyPI and local wheels. {_fail_reason}')
290
+
291
+ install_source
292
+ `);
293
+ // Setup Python functions for linting
294
+ currentInitPhase = 'cfn_lint_setup';
295
+ await pyodide.runPythonAsync(`
296
+ from cfnlint.version import __version__
297
+
298
+ print('cfn-lint version:', __version__)
299
+
300
+ from pathlib import Path
301
+ from cfnlint import lint, lint_by_config, ManualArgs
302
+ from cfnlint.formatters import JsonFormatter
303
+
304
+ _json_formatter = JsonFormatter()
305
+
306
+ def lint_to_json(matches):
307
+ # Use JsonFormatter for --format json parity. Sort to match CLI ordering.
308
+ sorted_matches = sorted(matches, key=lambda m: (m.filename, m.linenumber, m.rule.id))
309
+ return _json_formatter.print_matches(sorted_matches, None, None)
310
+
311
+ def parse_cfn_lint_settings(settings):
312
+ """Parse cfn-lint settings into ManualArgs format"""
313
+ config = {}
314
+ if not settings:
315
+ return config
316
+
317
+ if settings.get('ignoreChecks'):
318
+ config['ignore_checks'] = settings['ignoreChecks']
319
+ if settings.get('includeChecks'):
320
+ config['include_checks'] = settings['includeChecks']
321
+ if settings.get('mandatoryChecks'):
322
+ config['mandatory_checks'] = settings['mandatoryChecks']
323
+ if settings.get('includeExperimental'):
324
+ config['include_experimental'] = settings['includeExperimental']
325
+ if settings.get('configureRules'):
326
+ # Parse configure rules from string format "RuleId:key=value"
327
+ configure_rules = {}
328
+ for rule_config in settings['configureRules']:
329
+ if ':' in rule_config:
330
+ rule_id, config_str = rule_config.split(':', 1)
331
+ if '=' in config_str:
332
+ key, value = config_str.split('=', 1)
333
+ if rule_id not in configure_rules:
334
+ configure_rules[rule_id] = {}
335
+ # Convert string values to appropriate types
336
+ if value.lower() == 'true':
337
+ configure_rules[rule_id][key] = True
338
+ elif value.lower() == 'false':
339
+ configure_rules[rule_id][key] = False
340
+ else:
341
+ try:
342
+ configure_rules[rule_id][key] = int(value)
343
+ except ValueError:
344
+ configure_rules[rule_id][key] = value
345
+ if configure_rules:
346
+ config['configure_rules'] = configure_rules
347
+ if settings.get('regions'):
348
+ config['regions'] = settings['regions']
349
+ return config
350
+
351
+ def lint_str(template_str, uri, settings=None):
352
+ """
353
+ Lint a CloudFormation template string and return cfn-lint JSON findings.
354
+
355
+ Args:
356
+ template_str (str): CloudFormation template as a string
357
+ uri (str): Document URI (unused here; passed through to the TS caller)
358
+ settings (dict, optional): cfn-lint settings
359
+
360
+ Returns:
361
+ str: JSON array of cfn-lint findings (same schema as --format json)
362
+ """
363
+ config = parse_cfn_lint_settings(settings)
364
+ return lint_to_json(lint(template_str, config=ManualArgs(**config) if config else None))
365
+
366
+ def lint_uri(lint_path, uri, lint_type, settings=None):
367
+ import glob
368
+ config = parse_cfn_lint_settings(settings)
369
+ path = Path(lint_path)
370
+
371
+ # cfn-lint expands these paths with glob.glob and raises ValueError when
372
+ # nothing matches, so escape glob metacharacters (e.g. [, ], *, ?) to make
373
+ # sure the path is treated literally.
374
+ if lint_type == "template":
375
+ config["templates"] = [glob.escape(str(path))]
376
+ elif lint_type == "gitsync-deployment":
377
+ config["deployment_files"] = [glob.escape(str(path))]
378
+
379
+ return lint_to_json(lint_by_config(ManualArgs(**config)))
380
+ `);
381
+ // Create result object with installation source
382
+ const result = { status: 'initialized', installSource: installResult };
383
+ // eslint-disable-next-line require-atomic-updates
384
+ initialized = true;
385
+ // eslint-disable-next-line require-atomic-updates
386
+ initializing = false;
387
+ return result;
388
+ }
389
+ catch (error) {
390
+ // eslint-disable-next-line require-atomic-updates
391
+ initializing = false;
392
+ throw error;
393
+ }
394
+ }
395
+ async function getVersion() {
396
+ if (!pyodide) {
397
+ throw new Error('Pyodide not initialized');
398
+ }
399
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
400
+ const result = await pyodide.runPythonAsync(`
401
+ from cfnlint.version import __version__
402
+ __version__
403
+ `);
404
+ return result;
405
+ }
406
+ // Parse the JSON string returned by lint_str/lint_uri (cfn-lint JsonFormatter output)
407
+ // and convert to LSP diagnostics using the shared converter.
408
+ function convertPythonResultToDiagnostics(result, uri) {
409
+ if (typeof result !== 'string') {
410
+ throw new TypeError('Expected a JSON string from Python linting');
411
+ }
412
+ let findings;
413
+ try {
414
+ findings = JSON.parse(result);
415
+ }
416
+ catch (error) {
417
+ throw new Error(`Failed to parse cfn-lint output from Pyodide: ${error instanceof Error ? error.message : String(error)}`);
418
+ }
419
+ return (0, CfnLintDiagnosticConverter_1.toPublishDiagnostics)(findings, uri);
420
+ }
421
+ // Lint template content as string
422
+ async function lintTemplate(content, uri, _fileType, settings) {
423
+ if (!initialized || !pyodide) {
424
+ throw new Error('Pyodide not initialized');
425
+ }
426
+ // Safe type assertions since we know the expected types
427
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
428
+ const pyUri = pyodide.toPy(uri);
429
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
430
+ const pyContent = pyodide.toPy(content.replaceAll('"""', '\\"\\"\\"'));
431
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
432
+ const pySettings = pyodide.toPy(settings ?? {});
433
+ // Execute Python code and get result
434
+ const pythonCode = `lint_str(r"""${pyContent}""", r"""${pyUri}""", ${pySettings})`;
435
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
436
+ const result = await pyodide.runPythonAsync(pythonCode);
437
+ return convertPythonResultToDiagnostics(result, uri);
438
+ }
439
+ // Lint file using path
440
+ async function lintFile(path, uri, fileType, settings) {
441
+ if (!initialized || !pyodide) {
442
+ throw new Error('Pyodide not initialized');
443
+ }
444
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
445
+ const pySettings = pyodide.toPy(settings ?? {});
446
+ // Execute Python code and get result
447
+ const pythonCode = `lint_uri(r"""${path}""", r"""${uri}""", r"""${fileType}""", ${pySettings})`;
448
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
449
+ const result = await pyodide.runPythonAsync(pythonCode);
450
+ return convertPythonResultToDiagnostics(result, uri);
451
+ }
452
+ // Mount folder to Pyodide filesystem
453
+ function mountFolder(fsDir, mountDir) {
454
+ if (!initialized || !pyodide) {
455
+ throw new Error('Pyodide not initialized');
456
+ }
457
+ try {
458
+ pyodide.FS.mkdirTree(mountDir);
459
+ // The first parameter should be the mount point, the second parameter should be the host path
460
+ pyodide.mountNodeFS(mountDir, fsDir);
461
+ return { mounted: true, mountDir };
462
+ }
463
+ catch (error) {
464
+ // Clean up if mounting fails
465
+ try {
466
+ pyodide.FS.rmdir(mountDir);
467
+ }
468
+ catch {
469
+ // Ignore cleanup errors
470
+ }
471
+ throw error;
472
+ }
473
+ }
474
+
475
+
476
+ /***/ },
477
+
478
+ /***/ "./src/utils/String.ts"
479
+ (__unused_webpack_module, exports, __webpack_require__) {
480
+
481
+ var __webpack_unused_export__;
482
+
483
+ __webpack_unused_export__ = ({ value: true });
484
+ exports.toString = toString;
485
+ __webpack_unused_export__ = dashesToUnderscores;
486
+ __webpack_unused_export__ = removeQuotes;
487
+ __webpack_unused_export__ = isStringABoolean;
488
+ __webpack_unused_export__ = stringToBoolean;
489
+ __webpack_unused_export__ = byteSize;
490
+ __webpack_unused_export__ = formatNumber;
491
+ __webpack_unused_export__ = toStringOrUndefined;
492
+ const pretty_print_object_1 = __webpack_require__("./node_modules/@base2/pretty-print-object/dist/index.js");
493
+ function toString(value, indent = '\t'.repeat(1)) {
494
+ if (value === null || !['object', 'function'].includes(typeof value)) {
495
+ return String(value);
496
+ }
497
+ return (0, pretty_print_object_1.prettyPrint)(value, {
498
+ indent,
499
+ inlineCharacterLimit: 50,
500
+ });
501
+ }
502
+ function dashesToUnderscores(input) {
503
+ // eslint-disable-next-line unicorn/prefer-string-replace-all
504
+ return input.replace(/-/g, '_');
505
+ }
506
+ function removeQuotes(str) {
507
+ // Only replace starting and ending quotes
508
+ // eslint-disable-next-line unicorn/prefer-string-replace-all
509
+ return str.replace(/^['"]|['"]$/g, '');
510
+ }
511
+ function isStringABoolean(value) {
512
+ return ['true', 'false'].includes(value.trim().toLowerCase());
513
+ }
514
+ function stringToBoolean(value) {
515
+ return value.trim().toLowerCase() === 'true';
516
+ }
517
+ function byteSize(str) {
518
+ const bytes = new TextEncoder().encode(str);
519
+ return bytes.length;
520
+ }
521
+ function formatNumber(value, decimals = 2) {
522
+ return value.toFixed(decimals);
523
+ }
524
+ function toStringOrUndefined(value) {
525
+ if (typeof value === 'string')
526
+ return value;
527
+ if (typeof value === 'number' || typeof value === 'boolean')
528
+ return String(value);
529
+ return undefined;
530
+ }
531
+
532
+
533
+ /***/ },
534
+
535
+ /***/ "./src/utils/errors/ErrorUtils.ts"
536
+ (__unused_webpack_module, exports, __webpack_require__) {
537
+
538
+ var __webpack_unused_export__;
539
+
540
+ __webpack_unused_export__ = ({ value: true });
541
+ __webpack_unused_export__ = extractStatusReason;
542
+ exports.extractErrorMessage = extractErrorMessage;
543
+ __webpack_unused_export__ = handleLspError;
544
+ __webpack_unused_export__ = extractRootCause;
545
+ __webpack_unused_export__ = errorCauseChain;
546
+ __webpack_unused_export__ = extractErrorCode;
547
+ __webpack_unused_export__ = extractHttpStatus;
548
+ const vscode_languageserver_1 = __webpack_require__("./node_modules/vscode-languageserver/lib/node/main.js");
549
+ const String_1 = __webpack_require__("./src/utils/String.ts");
550
+ function extractStatusReason(error) {
551
+ try {
552
+ const message = error instanceof Error ? error.message : String(error);
553
+ const parsed = JSON.parse(message);
554
+ if (parsed?.reason?.StatusReason) {
555
+ return parsed.reason.StatusReason;
556
+ }
557
+ }
558
+ catch {
559
+ // Not JSON, continue with normal error handling
560
+ }
561
+ }
562
+ function extractErrorMessage(error) {
563
+ if (error instanceof Error) {
564
+ const prefix = error.name === 'Error' ? '' : `${error.name}: `;
565
+ return `${prefix}${error.message}`;
566
+ }
567
+ return (0, String_1.toString)(error);
568
+ }
569
+ function createResponseError(code, message, cause) {
570
+ const responseError = new vscode_languageserver_1.ResponseError(code, message);
571
+ responseError.cause = cause;
572
+ return responseError;
573
+ }
574
+ function handleLspError(error, contextMessage) {
575
+ if (error instanceof vscode_languageserver_1.ResponseError) {
576
+ throw error;
577
+ }
578
+ if (error instanceof TypeError) {
579
+ throw createResponseError(vscode_languageserver_1.ErrorCodes.InvalidParams, error.message, error);
580
+ }
581
+ throw createResponseError(vscode_languageserver_1.ErrorCodes.InternalError, `${contextMessage}: ${extractErrorMessage(error)}`, error);
582
+ }
583
+ function extractRootCause(error) {
584
+ const [, cause] = errorCauseChain(error);
585
+ return cause instanceof Error ? cause : undefined;
586
+ }
587
+ const MaxCauseDepth = 8;
588
+ function errorCauseChain(error) {
589
+ const chain = [];
590
+ const seen = new Set();
591
+ let current = error;
592
+ while (current !== undefined && current !== null && chain.length < MaxCauseDepth) {
593
+ if (typeof current === 'object') {
594
+ if (seen.has(current)) {
595
+ break;
596
+ }
597
+ seen.add(current);
598
+ }
599
+ chain.push(current);
600
+ if (typeof current !== 'object') {
601
+ break;
602
+ }
603
+ const { cause, commitError } = current;
604
+ // A promise-valued `commitError` carries no synchronously readable message; only a resolved
605
+ // one (see `attachCommitCause`) is useful here.
606
+ current = (commitError instanceof Error ? commitError : undefined) ?? cause;
607
+ }
608
+ return chain;
609
+ }
610
+ function extractErrorCode(error) {
611
+ if (error === null || typeof error !== 'object') {
612
+ return undefined;
613
+ }
614
+ const { code, Code, CODE, errno } = error;
615
+ for (const val of [code, Code, CODE]) {
616
+ if (typeof val === 'string') {
617
+ return val;
618
+ }
619
+ }
620
+ for (const val of [code, errno]) {
621
+ if (typeof val === 'number') {
622
+ return `${val}`;
623
+ }
624
+ }
625
+ return undefined;
626
+ }
627
+ function extractHttpStatus(error) {
628
+ if (error === null || typeof error !== 'object') {
629
+ return undefined;
630
+ }
631
+ const candidate = error;
632
+ if (typeof candidate.$metadata?.httpStatusCode === 'number') {
633
+ return candidate.$metadata?.httpStatusCode;
634
+ }
635
+ if (typeof candidate.response?.status === 'number') {
636
+ return candidate.response?.status;
637
+ }
638
+ if (typeof candidate.status === 'number') {
639
+ return candidate.status;
640
+ }
641
+ return undefined;
642
+ }
643
+
644
+
645
+ /***/ },
646
+
647
+ /***/ "./node_modules/vscode-languageserver-protocol/lib/node/main.js"
648
+ (__unused_webpack_module, exports, __webpack_require__) {
649
+
650
+
651
+ /* --------------------------------------------------------------------------------------------
652
+ * Copyright (c) Microsoft Corporation. All rights reserved.
653
+ * Licensed under the MIT License. See License.txt in the project root for license information.
654
+ * ------------------------------------------------------------------------------------------ */
655
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
656
+ if (k2 === undefined) k2 = k;
657
+ var desc = Object.getOwnPropertyDescriptor(m, k);
658
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
659
+ desc = { enumerable: true, get: function() { return m[k]; } };
660
+ }
661
+ Object.defineProperty(o, k2, desc);
662
+ }) : (function(o, m, k, k2) {
663
+ if (k2 === undefined) k2 = k;
664
+ o[k2] = m[k];
665
+ }));
666
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
667
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
668
+ };
669
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
670
+ exports.createProtocolConnection = void 0;
671
+ const node_1 = __webpack_require__("./node_modules/vscode-jsonrpc/node.js");
672
+ __exportStar(__webpack_require__("./node_modules/vscode-jsonrpc/node.js"), exports);
673
+ __exportStar(__webpack_require__("./node_modules/vscode-languageserver-protocol/lib/common/api.js"), exports);
674
+ function createProtocolConnection(input, output, logger, options) {
675
+ return (0, node_1.createMessageConnection)(input, output, logger, options);
676
+ }
677
+ exports.createProtocolConnection = createProtocolConnection;
678
+
679
+
680
+ /***/ },
681
+
682
+ /***/ "./node_modules/vscode-languageserver/lib/node/main.js"
683
+ (__unused_webpack_module, exports, __webpack_require__) {
684
+
685
+
686
+ /* --------------------------------------------------------------------------------------------
687
+ * Copyright (c) Microsoft Corporation. All rights reserved.
688
+ * Licensed under the MIT License. See License.txt in the project root for license information.
689
+ * ------------------------------------------------------------------------------------------ */
690
+ /// <reference path="../../typings/thenable.d.ts" />
691
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
692
+ if (k2 === undefined) k2 = k;
693
+ var desc = Object.getOwnPropertyDescriptor(m, k);
694
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
695
+ desc = { enumerable: true, get: function() { return m[k]; } };
696
+ }
697
+ Object.defineProperty(o, k2, desc);
698
+ }) : (function(o, m, k, k2) {
699
+ if (k2 === undefined) k2 = k;
700
+ o[k2] = m[k];
701
+ }));
702
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
703
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
704
+ };
705
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
706
+ exports.createConnection = exports.Files = void 0;
707
+ const node_util_1 = __webpack_require__("node:util");
708
+ const Is = __webpack_require__("./node_modules/vscode-languageserver/lib/common/utils/is.js");
709
+ const server_1 = __webpack_require__("./node_modules/vscode-languageserver/lib/common/server.js");
710
+ const fm = __webpack_require__("./node_modules/vscode-languageserver/lib/node/files.js");
711
+ const node_1 = __webpack_require__("./node_modules/vscode-languageserver-protocol/node.js");
712
+ __exportStar(__webpack_require__("./node_modules/vscode-languageserver-protocol/node.js"), exports);
713
+ __exportStar(__webpack_require__("./node_modules/vscode-languageserver/lib/common/api.js"), exports);
714
+ var Files;
715
+ (function (Files) {
716
+ Files.uriToFilePath = fm.uriToFilePath;
717
+ Files.resolveGlobalNodePath = fm.resolveGlobalNodePath;
718
+ Files.resolveGlobalYarnPath = fm.resolveGlobalYarnPath;
719
+ Files.resolve = fm.resolve;
720
+ Files.resolveModulePath = fm.resolveModulePath;
721
+ })(Files || (exports.Files = Files = {}));
722
+ let _protocolConnection;
723
+ function endProtocolConnection() {
724
+ if (_protocolConnection === undefined) {
725
+ return;
726
+ }
727
+ try {
728
+ _protocolConnection.end();
729
+ }
730
+ catch (_err) {
731
+ // Ignore. The client process could have already
732
+ // did and we can't send an end into the connection.
733
+ }
734
+ }
735
+ let _shutdownReceived = false;
736
+ let exitTimer = undefined;
737
+ function setupExitTimer() {
738
+ const argName = '--clientProcessId';
739
+ function runTimer(value) {
740
+ try {
741
+ let processId = parseInt(value);
742
+ if (!isNaN(processId)) {
743
+ exitTimer = setInterval(() => {
744
+ try {
745
+ process.kill(processId, 0);
746
+ }
747
+ catch (ex) {
748
+ // Parent process doesn't exist anymore. Exit the server.
749
+ endProtocolConnection();
750
+ process.exit(_shutdownReceived ? 0 : 1);
751
+ }
752
+ }, 3000);
753
+ }
754
+ }
755
+ catch (e) {
756
+ // Ignore errors;
757
+ }
758
+ }
759
+ for (let i = 2; i < process.argv.length; i++) {
760
+ let arg = process.argv[i];
761
+ if (arg === argName && i + 1 < process.argv.length) {
762
+ runTimer(process.argv[i + 1]);
763
+ return;
764
+ }
765
+ else {
766
+ let args = arg.split('=');
767
+ if (args[0] === argName) {
768
+ runTimer(args[1]);
769
+ }
770
+ }
771
+ }
772
+ }
773
+ setupExitTimer();
774
+ const watchDog = {
775
+ initialize: (params) => {
776
+ const processId = params.processId;
777
+ if (Is.number(processId) && exitTimer === undefined) {
778
+ // We received a parent process id. Set up a timer to periodically check
779
+ // if the parent is still alive.
780
+ setInterval(() => {
781
+ try {
782
+ process.kill(processId, 0);
783
+ }
784
+ catch (ex) {
785
+ // Parent process doesn't exist anymore. Exit the server.
786
+ process.exit(_shutdownReceived ? 0 : 1);
787
+ }
788
+ }, 3000);
789
+ }
790
+ },
791
+ get shutdownReceived() {
792
+ return _shutdownReceived;
793
+ },
794
+ set shutdownReceived(value) {
795
+ _shutdownReceived = value;
796
+ },
797
+ exit: (code) => {
798
+ endProtocolConnection();
799
+ process.exit(code);
800
+ }
801
+ };
802
+ function createConnection(arg1, arg2, arg3, arg4) {
803
+ let factories;
804
+ let input;
805
+ let output;
806
+ let options;
807
+ if (arg1 !== void 0 && arg1.__brand === 'features') {
808
+ factories = arg1;
809
+ arg1 = arg2;
810
+ arg2 = arg3;
811
+ arg3 = arg4;
812
+ }
813
+ if (node_1.ConnectionStrategy.is(arg1) || node_1.ConnectionOptions.is(arg1)) {
814
+ options = arg1;
815
+ }
816
+ else {
817
+ input = arg1;
818
+ output = arg2;
819
+ options = arg3;
820
+ }
821
+ return _createConnection(input, output, options, factories);
822
+ }
823
+ exports.createConnection = createConnection;
824
+ function _createConnection(input, output, options, factories) {
825
+ let stdio = false;
826
+ if (!input && !output && process.argv.length > 2) {
827
+ let port = void 0;
828
+ let pipeName = void 0;
829
+ let argv = process.argv.slice(2);
830
+ for (let i = 0; i < argv.length; i++) {
831
+ let arg = argv[i];
832
+ if (arg === '--node-ipc') {
833
+ input = new node_1.IPCMessageReader(process);
834
+ output = new node_1.IPCMessageWriter(process);
835
+ break;
836
+ }
837
+ else if (arg === '--stdio') {
838
+ stdio = true;
839
+ input = process.stdin;
840
+ output = process.stdout;
841
+ break;
842
+ }
843
+ else if (arg === '--socket') {
844
+ port = parseInt(argv[i + 1]);
845
+ break;
846
+ }
847
+ else if (arg === '--pipe') {
848
+ pipeName = argv[i + 1];
849
+ break;
850
+ }
851
+ else {
852
+ var args = arg.split('=');
853
+ if (args[0] === '--socket') {
854
+ port = parseInt(args[1]);
855
+ break;
856
+ }
857
+ else if (args[0] === '--pipe') {
858
+ pipeName = args[1];
859
+ break;
860
+ }
861
+ }
862
+ }
863
+ if (port) {
864
+ let transport = (0, node_1.createServerSocketTransport)(port);
865
+ input = transport[0];
866
+ output = transport[1];
867
+ }
868
+ else if (pipeName) {
869
+ let transport = (0, node_1.createServerPipeTransport)(pipeName);
870
+ input = transport[0];
871
+ output = transport[1];
872
+ }
873
+ }
874
+ var commandLineMessage = 'Use arguments of createConnection or set command line parameters: \'--node-ipc\', \'--stdio\' or \'--socket={number}\'';
875
+ if (!input) {
876
+ throw new Error('Connection input stream is not set. ' + commandLineMessage);
877
+ }
878
+ if (!output) {
879
+ throw new Error('Connection output stream is not set. ' + commandLineMessage);
880
+ }
881
+ // Backwards compatibility
882
+ if (Is.func(input.read) && Is.func(input.on)) {
883
+ let inputStream = input;
884
+ inputStream.on('end', () => {
885
+ endProtocolConnection();
886
+ process.exit(_shutdownReceived ? 0 : 1);
887
+ });
888
+ inputStream.on('close', () => {
889
+ endProtocolConnection();
890
+ process.exit(_shutdownReceived ? 0 : 1);
891
+ });
892
+ }
893
+ const connectionFactory = (logger) => {
894
+ const result = (0, node_1.createProtocolConnection)(input, output, logger, options);
895
+ if (stdio) {
896
+ patchConsole(logger);
897
+ }
898
+ return result;
899
+ };
900
+ return (0, server_1.createConnection)(connectionFactory, watchDog, factories);
901
+ }
902
+ function patchConsole(logger) {
903
+ function serialize(args) {
904
+ return args.map(arg => typeof arg === 'string' ? arg : (0, node_util_1.inspect)(arg)).join(' ');
905
+ }
906
+ const counters = new Map();
907
+ console.assert = function assert(assertion, ...args) {
908
+ if (assertion) {
909
+ return;
910
+ }
911
+ if (args.length === 0) {
912
+ logger.error('Assertion failed');
913
+ }
914
+ else {
915
+ const [message, ...rest] = args;
916
+ logger.error(`Assertion failed: ${message} ${serialize(rest)}`);
917
+ }
918
+ };
919
+ console.count = function count(label = 'default') {
920
+ const message = String(label);
921
+ let counter = counters.get(message) ?? 0;
922
+ counter += 1;
923
+ counters.set(message, counter);
924
+ logger.log(`${message}: ${message}`);
925
+ };
926
+ console.countReset = function countReset(label) {
927
+ if (label === undefined) {
928
+ counters.clear();
929
+ }
930
+ else {
931
+ counters.delete(String(label));
932
+ }
933
+ };
934
+ console.debug = function debug(...args) {
935
+ logger.log(serialize(args));
936
+ };
937
+ console.dir = function dir(arg, options) {
938
+ // @ts-expect-error https://github.com/DefinitelyTyped/DefinitelyTyped/pull/66626
939
+ logger.log((0, node_util_1.inspect)(arg, options));
940
+ };
941
+ console.log = function log(...args) {
942
+ logger.log(serialize(args));
943
+ };
944
+ console.error = function error(...args) {
945
+ logger.error(serialize(args));
946
+ };
947
+ console.trace = function trace(...args) {
948
+ const stack = new Error().stack.replace(/(.+\n){2}/, '');
949
+ let message = 'Trace';
950
+ if (args.length !== 0) {
951
+ message += `: ${serialize(args)}`;
952
+ }
953
+ logger.log(`${message}\n${stack}`);
954
+ };
955
+ console.warn = function warn(...args) {
956
+ logger.warn(serialize(args));
957
+ };
958
+ }
959
+
960
+
961
+ /***/ },
962
+
963
+ /***/ "pyodide"
964
+ (module) {
965
+
966
+ module.exports = require("pyodide");
967
+
968
+ /***/ },
969
+
970
+ /***/ "vscode-languageserver-types"
971
+ (module) {
972
+
973
+ module.exports = require("vscode-languageserver-types");
974
+
975
+ /***/ },
976
+
977
+ /***/ "child_process"
978
+ (module) {
979
+
980
+ module.exports = require("child_process");
981
+
982
+ /***/ },
983
+
984
+ /***/ "crypto"
985
+ (module) {
986
+
987
+ module.exports = require("crypto");
988
+
989
+ /***/ },
990
+
991
+ /***/ "fs"
992
+ (module) {
993
+
994
+ module.exports = require("fs");
995
+
996
+ /***/ },
997
+
998
+ /***/ "net"
999
+ (module) {
1000
+
1001
+ module.exports = require("net");
1002
+
1003
+ /***/ },
1004
+
1005
+ /***/ "node:util"
1006
+ (module) {
1007
+
1008
+ module.exports = require("node:util");
1009
+
1010
+ /***/ },
1011
+
1012
+ /***/ "os"
1013
+ (module) {
1014
+
1015
+ module.exports = require("os");
1016
+
1017
+ /***/ },
1018
+
1019
+ /***/ "path"
1020
+ (module) {
1021
+
1022
+ module.exports = require("path");
1023
+
1024
+ /***/ },
1025
+
1026
+ /***/ "url"
1027
+ (module) {
1028
+
1029
+ module.exports = require("url");
1030
+
1031
+ /***/ },
1032
+
1033
+ /***/ "util"
1034
+ (module) {
1035
+
1036
+ module.exports = require("util");
1037
+
1038
+ /***/ },
1039
+
1040
+ /***/ "worker_threads"
1041
+ (module) {
1042
+
1043
+ module.exports = require("worker_threads");
1044
+
1045
+ /***/ }
1046
+
1047
+ /******/ });
1048
+ /************************************************************************/
1049
+ /******/ // The module cache
1050
+ /******/ const __webpack_module_cache__ = {};
1051
+ /******/
1052
+ /******/ // The require function
1053
+ /******/ function __webpack_require__(moduleId) {
1054
+ /******/ // Check if module is in cache
1055
+ /******/ const cachedModule = __webpack_module_cache__[moduleId];
1056
+ /******/ if (cachedModule !== undefined) {
1057
+ /******/ return cachedModule.exports;
1058
+ /******/ }
1059
+ /******/ // Create a new module (and put it into the cache)
1060
+ /******/ const module = __webpack_module_cache__[moduleId] = {
1061
+ /******/ // no module.id needed
1062
+ /******/ // no module.loaded needed
1063
+ /******/ exports: {}
1064
+ /******/ };
1065
+ /******/
1066
+ /******/ // Execute the module function
1067
+ /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
1068
+ /******/
1069
+ /******/ // Return the exports of the module
1070
+ /******/ return module.exports;
1071
+ /******/ }
1072
+ /******/
1073
+ /******/ // expose the modules object (__webpack_modules__)
1074
+ /******/ __webpack_require__.m = __webpack_modules__;
1075
+ /******/
1076
+ /******/ // the startup function
1077
+ /******/ __webpack_require__.x = () => {
1078
+ /******/ // Load entry module and return exports
1079
+ /******/ // This entry module depends on other loaded chunks and execution need to be delayed
1080
+ /******/ let __webpack_exports__ = __webpack_require__.O(undefined, ["vendors-node_modules_base2_pretty-print-object_dist_index_js-node_modules_vscode-jsonrpc_node-9a0a8d"], () => (__webpack_require__("./src/services/cfnLint/pyodide-worker.ts")))
1081
+ /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
1082
+ /******/ return __webpack_exports__;
1083
+ /******/ };
1084
+ /******/
1085
+ /************************************************************************/
1086
+ /******/ /* webpack/runtime/chunk loaded */
1087
+ /******/ (() => {
1088
+ /******/ const deferred = [];
1089
+ /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
1090
+ /******/ if(chunkIds) {
1091
+ /******/ priority = priority || 0;
1092
+ /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
1093
+ /******/ deferred[i] = [chunkIds, fn, priority];
1094
+ /******/ return;
1095
+ /******/ }
1096
+ /******/ let notFulfilled = Infinity;
1097
+ /******/ for (var i = 0; i < deferred.length; i++) {
1098
+ /******/ let [chunkIds, fn, priority] = deferred[i];
1099
+ /******/ let fulfilled = true;
1100
+ /******/ for (var j = 0; j < chunkIds.length; j++) {
1101
+ /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
1102
+ /******/ chunkIds.splice(j--, 1);
1103
+ /******/ } else {
1104
+ /******/ fulfilled = false;
1105
+ /******/ if(priority < notFulfilled) notFulfilled = priority;
1106
+ /******/ }
1107
+ /******/ }
1108
+ /******/ if(fulfilled) {
1109
+ /******/ deferred.splice(i--, 1)
1110
+ /******/ const r = fn();
1111
+ /******/ if (r !== undefined) result = r;
1112
+ /******/ }
1113
+ /******/ }
1114
+ /******/ return result;
1115
+ /******/ };
1116
+ /******/ })();
1117
+ /******/
1118
+ /******/ /* webpack/runtime/ensure chunk */
1119
+ /******/ (() => {
1120
+ /******/ __webpack_require__.f = {};
1121
+ /******/ // This file contains only the entry chunk.
1122
+ /******/ // The chunk loading function for additional chunks
1123
+ /******/ __webpack_require__.e = (chunkId) => {
1124
+ /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
1125
+ /******/ __webpack_require__.f[key](chunkId, promises);
1126
+ /******/ return promises;
1127
+ /******/ }, []));
1128
+ /******/ };
1129
+ /******/ })();
1130
+ /******/
1131
+ /******/ /* webpack/runtime/get javascript chunk filename */
1132
+ /******/ (() => {
1133
+ /******/ // This function allow to reference async chunks and chunks that the entrypoint depends on
1134
+ /******/ __webpack_require__.u = (chunkId) => {
1135
+ /******/ // return url for filenames based on template
1136
+ /******/ return "" + chunkId + ".js";
1137
+ /******/ };
1138
+ /******/ })();
1139
+ /******/
1140
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
1141
+ /******/ (() => {
1142
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1143
+ /******/ })();
1144
+ /******/
1145
+ /******/ /* webpack/runtime/require chunk loading */
1146
+ /******/ (() => {
1147
+ /******/ // no baseURI
1148
+ /******/
1149
+ /******/ // object to store loaded chunks
1150
+ /******/ // "1" means "loaded", otherwise not loaded yet
1151
+ /******/ const installedChunks = {
1152
+ /******/ "pyodide-worker": 1
1153
+ /******/ };
1154
+ /******/
1155
+ /******/ __webpack_require__.O.require = (chunkId) => (installedChunks[chunkId]);
1156
+ /******/
1157
+ /******/ const installChunk = (chunk) => {
1158
+ /******/ const moreModules = chunk.modules, chunkIds = chunk.ids, runtime = chunk.runtime;
1159
+ /******/ for(var moduleId in moreModules) {
1160
+ /******/ if(__webpack_require__.o(moreModules, moduleId)) {
1161
+ /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
1162
+ /******/ }
1163
+ /******/ }
1164
+ /******/ if(runtime) runtime(__webpack_require__);
1165
+ /******/ for(var i = 0; i < chunkIds.length; i++)
1166
+ /******/ installedChunks[chunkIds[i]] = 1;
1167
+ /******/ __webpack_require__.O();
1168
+ /******/ };
1169
+ /******/
1170
+ /******/ // require() chunk loading for javascript
1171
+ /******/ __webpack_require__.f.require = (chunkId, promises) => {
1172
+ /******/ // "1" is the signal for "already loaded"
1173
+ /******/ if(!installedChunks[chunkId]) {
1174
+ /******/ if(true) { // all chunks have JS
1175
+ /******/ const installedChunk = require("./" + __webpack_require__.u(chunkId));
1176
+ /******/ if (!installedChunks[chunkId]) {
1177
+ /******/ installChunk(installedChunk);
1178
+ /******/ }
1179
+ /******/ } else installedChunks[chunkId] = 1;
1180
+ /******/ }
1181
+ /******/ };
1182
+ /******/
1183
+ /******/ // no external install chunk
1184
+ /******/
1185
+ /******/ // no HMR
1186
+ /******/
1187
+ /******/ // no HMR manifest
1188
+ /******/ })();
1189
+ /******/
1190
+ /******/ /* webpack/runtime/startup chunk dependencies */
1191
+ /******/ (() => {
1192
+ /******/ const next = __webpack_require__.x;
1193
+ /******/ __webpack_require__.x = () => {
1194
+ /******/ __webpack_require__.e("vendors-node_modules_base2_pretty-print-object_dist_index_js-node_modules_vscode-jsonrpc_node-9a0a8d");
1195
+ /******/ return next();
1196
+ /******/ };
1197
+ /******/ })();
1198
+ /******/
1199
+ /************************************************************************/
1200
+ /******/
1201
+ /******/ // run startup
1202
+ /******/ var __webpack_exports__ = __webpack_require__.x();
1203
+ /******/ module.exports = __webpack_exports__;
1204
+ /******/
1205
+ /******/ })()
1206
+ ;
1207
+ //# sourceMappingURL=pyodide-worker.js.map